@gridui/data-cell 1.0.4 → 1.0.6
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 +2 -0
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/styles.css +24 -24
- package/docs/catalog.json +8 -3
- package/docs/reference/README.md +6 -0
- package/docs/reference/data-badge.md +63 -0
- package/docs/reference/data-bar.md +73 -0
- package/docs/reference/data-value.md +67 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,3 +6,5 @@ Import components from `@gridui/data-cell` and load `@gridui/data-cell/styles.cs
|
|
|
6
6
|
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
8
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-core/data-cell/.changeset/history).
|
|
9
|
+
|
|
10
|
+
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import { cn } from "@gridui/style-utils";
|
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
var dataBadgeStyles = cva(cn(
|
|
5
5
|
"gridui-data-badge",
|
|
6
|
-
"gridui-u-inline-block gridui-u-py-gridui-4 gridui-u-px-gridui-8 gridui-u-text-foreground gridui-u-bg-surface gridui-u-type-caption gridui-u-whitespace-nowrap",
|
|
7
|
-
"gridui-u-data-[tone='accent']:text-foreground gridui-u-data-[tone='accent']:bg-brand-tint"
|
|
6
|
+
"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",
|
|
7
|
+
"gridui-u-data-cell--data-[tone='accent']:text-foreground gridui-u-data-cell--data-[tone='accent']:bg-brand-tint"
|
|
8
8
|
));
|
|
9
9
|
|
|
10
10
|
// src/data-badge/data-badge.tsx
|
|
@@ -33,13 +33,13 @@ import { cn as cn3 } from "@gridui/style-utils";
|
|
|
33
33
|
import { cva as cva2 } from "class-variance-authority";
|
|
34
34
|
var dataBarStyles = cva2(cn3(
|
|
35
35
|
"gridui-data-bar",
|
|
36
|
-
"gridui-u-grid gridui-u-min-w-gridui-64 gridui-u-gap-gridui-8 gridui-u-tabular-nums",
|
|
37
|
-
"gridui-u-[&[data-partial='true']_.gridui-data-bar-track>span]:bg-transparent"
|
|
36
|
+
"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",
|
|
37
|
+
"gridui-u-data-cell--[&[data-partial='true']_.gridui-data-bar-track>span]:bg-transparent"
|
|
38
38
|
));
|
|
39
39
|
var dataBarTrackStyles = cva2(cn3(
|
|
40
40
|
"gridui-data-bar-track",
|
|
41
|
-
"gridui-u-h-(--gridui-space-4) gridui-u-bg-brand-tint",
|
|
42
|
-
"gridui-u-[&_>_span]:block gridui-u-[&_>_span]:h-full gridui-u-[&_>_span]:bg-accent-background"
|
|
41
|
+
"gridui-u-data-cell--h-(--gridui-space-4) gridui-u-data-cell--bg-brand-tint",
|
|
42
|
+
"gridui-u-data-cell--[&_>_span]:block gridui-u-data-cell--[&_>_span]:h-full gridui-u-data-cell--[&_>_span]:bg-accent-background"
|
|
43
43
|
));
|
|
44
44
|
|
|
45
45
|
// src/data-bar/data-bar.tsx
|
|
@@ -86,12 +86,12 @@ 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-grid gridui-u-gap-gridui-4",
|
|
90
|
-
"gridui-u-[&_small]:text-muted gridui-u-[&_small]:type-supporting"
|
|
89
|
+
"gridui-u-data-cell--grid gridui-u-data-cell--gap-gridui-4",
|
|
90
|
+
"gridui-u-data-cell--[&_small]:text-muted gridui-u-data-cell--[&_small]:type-supporting"
|
|
91
91
|
));
|
|
92
92
|
var dataMonoStyles = cva3(cn5(
|
|
93
93
|
"gridui-data-mono",
|
|
94
|
-
"gridui-u-type-code gridui-u-whitespace-nowrap"
|
|
94
|
+
"gridui-u-data-cell--type-code gridui-u-data-cell--whitespace-nowrap"
|
|
95
95
|
));
|
|
96
96
|
|
|
97
97
|
// src/data-value/data-value.tsx
|
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-inline-block gridui-u-py-gridui-4 gridui-u-px-gridui-8 gridui-u-text-foreground gridui-u-bg-surface gridui-u-type-caption gridui-u-whitespace-nowrap\",\n \"gridui-u-data-[tone='accent']:text-foreground gridui-u-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-grid gridui-u-min-w-gridui-64 gridui-u-gap-gridui-8 gridui-u-tabular-nums\",\n \"gridui-u-[&[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-h-(--gridui-space-4) gridui-u-bg-brand-tint\",\n \"gridui-u-[&_>_span]:block gridui-u-[&_>_span]:h-full gridui-u-[&_>_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-grid gridui-u-gap-gridui-4\",\n \"gridui-u-[&_small]:text-muted gridui-u-[&_small]:type-supporting\",\n));\n\nexport const dataMonoStyles = cva(cn(\n \"gridui-data-mono\",\n \"gridui-u-type-code gridui-u-whitespace-nowrap\",\n));\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataValue\n * @description Data Value\n */\n\nimport { dataMonoStyles, 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};\n\nexport const DataValue: FC<DataValueProps> = (props: DataValueProps) => {\n const {\n children,\n detail,\n mono = false,\n className,\n ...restProps\n } = props;\n return (<span\n {...restProps}\n className={cn(dataValueStyles(), mono && dataMonoStyles(), className)}\n >\n <span>\n {children}\n </span>\n {detail !== undefined && (<small>\n {detail}\n </small>)}\n </span>);\n};\n"],
|
|
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--grid gridui-u-data-cell--gap-gridui-4\",\n \"gridui-u-data-cell--[&_small]:text-muted gridui-u-data-cell--[&_small]:type-supporting\",\n));\n\nexport const dataMonoStyles = cva(cn(\n \"gridui-data-mono\",\n \"gridui-u-data-cell--type-code gridui-u-data-cell--whitespace-nowrap\",\n));\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataValue\n * @description Data Value\n */\n\nimport { dataMonoStyles, 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};\n\nexport const DataValue: FC<DataValueProps> = (props: DataValueProps) => {\n const {\n children,\n detail,\n mono = false,\n className,\n ...restProps\n } = props;\n return (<span\n {...restProps}\n className={cn(dataValueStyles(), mono && dataMonoStyles(), className)}\n >\n <span>\n {children}\n </span>\n {detail !== undefined && (<small>\n {detail}\n </small>)}\n </span>);\n};\n"],
|
|
5
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,EACA;AACJ,CAAC;AAEM,IAAM,iBAAiBC,KAAID;AAAA,EAC9B;AAAA,EACA;AACJ,CAAC;;;ACXD,SAAS,MAAAE,WAAU;AAgBP,SAIJ,OAAAC,MAJI,QAAAC,aAAA;AARL,IAAM,YAAgC,CAAC,UAA0B;AACpE,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWF,IAAG,gBAAgB,GAAG,QAAQ,eAAe,GAAG,SAAS;AAAA,MAEpE;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
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
/*! tailwindcss v4.3.
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer utilities {
|
|
5
|
-
.gridui-u-grid {
|
|
5
|
+
.gridui-u-data-cell--grid {
|
|
6
6
|
display: grid;
|
|
7
7
|
}
|
|
8
|
-
.gridui-u-inline-block {
|
|
8
|
+
.gridui-u-data-cell--inline-block {
|
|
9
9
|
display: inline-block;
|
|
10
10
|
}
|
|
11
|
-
.gridui-u-h-\(--gridui-space-4\) {
|
|
11
|
+
.gridui-u-data-cell--h-\(--gridui-space-4\) {
|
|
12
12
|
height: var(--gridui-space-4);
|
|
13
13
|
}
|
|
14
|
-
.gridui-u-min-w-gridui-64 {
|
|
14
|
+
.gridui-u-data-cell--min-w-gridui-64 {
|
|
15
15
|
min-width: var(--gridui-space-64);
|
|
16
16
|
}
|
|
17
|
-
.gridui-u-gap-gridui-4 {
|
|
17
|
+
.gridui-u-data-cell--gap-gridui-4 {
|
|
18
18
|
gap: var(--gridui-space-4);
|
|
19
19
|
}
|
|
20
|
-
.gridui-u-gap-gridui-8 {
|
|
20
|
+
.gridui-u-data-cell--gap-gridui-8 {
|
|
21
21
|
gap: var(--gridui-space-8);
|
|
22
22
|
}
|
|
23
|
-
.gridui-u-bg-brand-tint {
|
|
23
|
+
.gridui-u-data-cell--bg-brand-tint {
|
|
24
24
|
background-color: var(--gridui-brand-tint);
|
|
25
25
|
}
|
|
26
|
-
.gridui-u-bg-surface {
|
|
26
|
+
.gridui-u-data-cell--bg-surface {
|
|
27
27
|
background-color: var(--gridui-surface);
|
|
28
28
|
}
|
|
29
|
-
.gridui-u-px-gridui-8 {
|
|
29
|
+
.gridui-u-data-cell--px-gridui-8 {
|
|
30
30
|
padding-inline: var(--gridui-space-8);
|
|
31
31
|
}
|
|
32
|
-
.gridui-u-py-gridui-4 {
|
|
32
|
+
.gridui-u-data-cell--py-gridui-4 {
|
|
33
33
|
padding-block: var(--gridui-space-4);
|
|
34
34
|
}
|
|
35
|
-
.gridui-u-type-caption {
|
|
35
|
+
.gridui-u-data-cell--type-caption {
|
|
36
36
|
font: var(--gridui-type-caption);
|
|
37
37
|
letter-spacing: normal;
|
|
38
38
|
}
|
|
39
|
-
.gridui-u-type-code {
|
|
39
|
+
.gridui-u-data-cell--type-code {
|
|
40
40
|
font: var(--gridui-type-code);
|
|
41
41
|
letter-spacing: normal;
|
|
42
42
|
}
|
|
43
|
-
.gridui-u-whitespace-nowrap {
|
|
43
|
+
.gridui-u-data-cell--whitespace-nowrap {
|
|
44
44
|
white-space: nowrap;
|
|
45
45
|
}
|
|
46
|
-
.gridui-u-text-foreground {
|
|
46
|
+
.gridui-u-data-cell--text-foreground {
|
|
47
47
|
color: var(--gridui-foreground);
|
|
48
48
|
}
|
|
49
|
-
.gridui-u-tabular-nums {
|
|
49
|
+
.gridui-u-data-cell--tabular-nums {
|
|
50
50
|
--tw-numeric-spacing: tabular-nums;
|
|
51
51
|
font-variant-numeric: var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, );
|
|
52
52
|
}
|
|
53
|
-
.gridui-u-data-\[tone\=\'accent\'\]\:bg-brand-tint[data-tone='accent'] {
|
|
53
|
+
.gridui-u-data-cell--data-\[tone\=\'accent\'\]\:bg-brand-tint[data-tone='accent'] {
|
|
54
54
|
background-color: var(--gridui-brand-tint);
|
|
55
55
|
}
|
|
56
|
-
.gridui-u-data-\[tone\=\'accent\'\]\:text-foreground[data-tone='accent'] {
|
|
56
|
+
.gridui-u-data-cell--data-\[tone\=\'accent\'\]\:text-foreground[data-tone='accent'] {
|
|
57
57
|
color: var(--gridui-foreground);
|
|
58
58
|
}
|
|
59
|
-
.gridui-u
|
|
59
|
+
.gridui-u-data-cell--\[\&_\>_span\]\:block > span {
|
|
60
60
|
display: block;
|
|
61
61
|
}
|
|
62
|
-
.gridui-u
|
|
62
|
+
.gridui-u-data-cell--\[\&_\>_span\]\:h-full > span {
|
|
63
63
|
height: 100%;
|
|
64
64
|
}
|
|
65
|
-
.gridui-u
|
|
65
|
+
.gridui-u-data-cell--\[\&_\>_span\]\:bg-accent-background > span {
|
|
66
66
|
background-color: var(--gridui-accent-background);
|
|
67
67
|
}
|
|
68
|
-
.gridui-u
|
|
68
|
+
.gridui-u-data-cell--\[\&_small\]\:type-supporting small {
|
|
69
69
|
font: var(--gridui-type-supporting);
|
|
70
70
|
letter-spacing: normal;
|
|
71
71
|
}
|
|
72
|
-
.gridui-u
|
|
72
|
+
.gridui-u-data-cell--\[\&_small\]\:text-muted small {
|
|
73
73
|
color: var(--gridui-muted);
|
|
74
74
|
}
|
|
75
|
-
.gridui-u
|
|
75
|
+
.gridui-u-data-cell--\[\&\[data-partial\=\'true\'\]_\.gridui-data-bar-track\>span\]\:bg-transparent[data-partial='true'] .gridui-data-bar-track > span {
|
|
76
76
|
background-color: transparent;
|
|
77
77
|
}
|
|
78
78
|
}
|
package/docs/catalog.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/data-cell",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
5
|
"category": "core",
|
|
6
6
|
"description": "GridUI React data cell",
|
|
7
|
-
"usage": "
|
|
7
|
+
"usage": "Component reference contains focused API pages for each public component.",
|
|
8
8
|
"documentation": [
|
|
9
|
-
"README.md"
|
|
9
|
+
"README.md",
|
|
10
|
+
"docs/reference/README.md",
|
|
11
|
+
"docs/reference/data-badge.md",
|
|
12
|
+
"docs/reference/data-bar.md",
|
|
13
|
+
"docs/reference/data-value.md"
|
|
10
14
|
],
|
|
11
15
|
"exports": [
|
|
12
16
|
{
|
|
@@ -45,6 +49,7 @@
|
|
|
45
49
|
"@gridui/data-cell/styles.css"
|
|
46
50
|
],
|
|
47
51
|
"examples": [
|
|
52
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/data-cell/stories/values.mdx",
|
|
48
53
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/data-cell/stories/data-badge.stories.tsx",
|
|
49
54
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/data-cell/stories/data-bar.stories.tsx",
|
|
50
55
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/data-cell/stories/data-value.stories.tsx"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# DataBadge
|
|
3
|
+
|
|
4
|
+
Presents a short status or category with consistent data typography. Use it inside tables, lists, or summaries.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/data-cell`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { DataBadge } from "@gridui/data-cell";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/data-cell/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/data-cell/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/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
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLSpanElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLSpanElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### tone
|
|
59
|
+
|
|
60
|
+
``"neutral" | "accent" | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
Default: ``"neutral"``
|
|
63
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# DataBar
|
|
3
|
+
|
|
4
|
+
Displays a value as a compact proportional bar. Use it to compare magnitudes within a list or table.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/data-cell`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { DataBar } from "@gridui/data-cell";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/data-cell/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/data-cell/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/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
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLSpanElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLSpanElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### value
|
|
59
|
+
|
|
60
|
+
``number`` · Required
|
|
61
|
+
|
|
62
|
+
Controlled value. Pair with the corresponding change callback.
|
|
63
|
+
|
|
64
|
+
### maximum
|
|
65
|
+
|
|
66
|
+
``number`` · Required
|
|
67
|
+
|
|
68
|
+
### partial
|
|
69
|
+
|
|
70
|
+
``boolean | undefined`` · Optional
|
|
71
|
+
|
|
72
|
+
Default: ``false``
|
|
73
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# DataValue
|
|
3
|
+
|
|
4
|
+
Formats a compact value for data-heavy layouts. Use it for consistent alignment and typography in cells and summaries.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/data-cell`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { DataValue } from "@gridui/data-cell";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/data-cell/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/data-cell/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/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
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLSpanElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLSpanElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### detail
|
|
59
|
+
|
|
60
|
+
``ReactNode`` · Optional
|
|
61
|
+
|
|
62
|
+
### mono
|
|
63
|
+
|
|
64
|
+
``boolean | undefined`` · Optional
|
|
65
|
+
|
|
66
|
+
Default: ``false``
|
|
67
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/data-cell",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "GridUI React data cell",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react-dom": "^19.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@gridui/style-utils": "^
|
|
30
|
+
"@gridui/style-utils": "^4.0.0",
|
|
31
31
|
"@gridui/theme": "^2.5.3",
|
|
32
32
|
"class-variance-authority": "0.7.1"
|
|
33
33
|
},
|