@gridui/metrics-section 1.0.1 → 1.0.4
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 +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -4
- package/docs/catalog.json +39 -0
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Landing family. Public API: `MetricsSection`, `MetricsSectionItem`, `MetricsSect
|
|
|
5
5
|
Import components from `@gridui/metrics-section` and load `@gridui/metrics-section/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](
|
|
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-landing/metrics-section/.changeset/history).
|
|
9
9
|
|
|
10
10
|
## Metric sections
|
|
11
11
|
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { cn } from "@gridui/style-utils";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
var metricsTitleStyles = cva(cn(
|
|
5
|
-
"gridui-metrics-title type-supporting",
|
|
6
|
-
"text-muted"
|
|
5
|
+
"gridui-metrics-title gridui-u-type-supporting",
|
|
6
|
+
"gridui-u-text-muted"
|
|
7
7
|
));
|
|
8
8
|
var metricsSurfaceStyles = cva(cn(
|
|
9
9
|
"gridui-metrics-surface",
|
|
10
|
-
"h-full"
|
|
10
|
+
"gridui-u-h-full"
|
|
11
11
|
));
|
|
12
12
|
|
|
13
13
|
// src/metrics-section/metrics-section.tsx
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/metrics-section/style.ts", "../src/metrics-section/metrics-section.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Metrics Section\n * @namespace MetricsSection\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const metricsTitleStyles = cva(cn(\n \"gridui-metrics-title type-supporting\",\n \"text-muted\",\n));\n\nexport const metricsSurfaceStyles = cva(cn(\n \"gridui-metrics-surface\",\n \"h-full\",\n));\n", "/**\n * @author WMXPY\n * @package Metrics Section\n * @namespace MetricsSection\n * @description Metrics Section\n */\n\nimport { metricsSurfaceStyles, metricsTitleStyles } from \"./style\";\nimport { FrameSection, type FrameSectionProps, Grid, GridItem } from \"@gridui/grid\";\nimport { LoadingSurface } from \"@gridui/loading-surface\";\nimport { Metric } from \"@gridui/metric\";\nimport { ContentPanel } from \"@gridui/panel\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentProps, FC, ReactNode } from \"react\";\n\nexport type MetricsSectionItem = Pick<ComponentProps<typeof Metric>, \"label\" | \"value\" | \"valueId\" | \"description\"> & {\n readonly id: string;\n};\n\nexport type MetricsSectionProps = Omit<FrameSectionProps, \"children\" | \"title\"> & {\n readonly title: string;\n readonly items: readonly MetricsSectionItem[];\n readonly loading: boolean;\n readonly failed?: boolean;\n readonly notice?: ReactNode;\n};\n\nexport const MetricsSection: FC<MetricsSectionProps> = (props: MetricsSectionProps) => {\n const {\n title,\n items,\n loading,\n failed = false,\n notice,\n ...restProps\n } = props;\n return (<FrameSection\n {...restProps}\n >\n <Grid\n frame=\"internal\"\n columns={{\n base: 1,\n md: 2,\n }}\n fillLastRow\n >\n <GridItem\n span=\"full\"\n >\n <ContentPanel\n paddingInline={24}\n paddingBlock={16}\n >\n <h2\n className={cn(metricsTitleStyles())}\n >\n {title}\n </h2>\n </ContentPanel>\n </GridItem>\n {failed ? (<GridItem\n span=\"full\"\n padding={24}\n >\n {notice}\n </GridItem>) : items.map(({ id, ...metric }, index) => {\n return (<GridItem\n key={id}\n >\n <LoadingSurface\n loading={loading}\n phase={index}\n asChild\n hideContent\n >\n <ContentPanel\n className={cn(metricsSurfaceStyles())}\n >\n <Metric\n {...metric}\n />\n </ContentPanel>\n </LoadingSurface>\n </GridItem>);\n })}\n </Grid>\n </FrameSection>);\n};\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Metrics Section\n * @namespace MetricsSection\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const metricsTitleStyles = cva(cn(\n \"gridui-metrics-title gridui-u-type-supporting\",\n \"gridui-u-text-muted\",\n));\n\nexport const metricsSurfaceStyles = cva(cn(\n \"gridui-metrics-surface\",\n \"gridui-u-h-full\",\n));\n", "/**\n * @author WMXPY\n * @package Metrics Section\n * @namespace MetricsSection\n * @description Metrics Section\n */\n\nimport { metricsSurfaceStyles, metricsTitleStyles } from \"./style\";\nimport { FrameSection, type FrameSectionProps, Grid, GridItem } from \"@gridui/grid\";\nimport { LoadingSurface } from \"@gridui/loading-surface\";\nimport { Metric } from \"@gridui/metric\";\nimport { ContentPanel } from \"@gridui/panel\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentProps, FC, ReactNode } from \"react\";\n\nexport type MetricsSectionItem = Pick<ComponentProps<typeof Metric>, \"label\" | \"value\" | \"valueId\" | \"description\"> & {\n readonly id: string;\n};\n\nexport type MetricsSectionProps = Omit<FrameSectionProps, \"children\" | \"title\"> & {\n readonly title: string;\n readonly items: readonly MetricsSectionItem[];\n readonly loading: boolean;\n readonly failed?: boolean;\n readonly notice?: ReactNode;\n};\n\nexport const MetricsSection: FC<MetricsSectionProps> = (props: MetricsSectionProps) => {\n const {\n title,\n items,\n loading,\n failed = false,\n notice,\n ...restProps\n } = props;\n return (<FrameSection\n {...restProps}\n >\n <Grid\n frame=\"internal\"\n columns={{\n base: 1,\n md: 2,\n }}\n fillLastRow\n >\n <GridItem\n span=\"full\"\n >\n <ContentPanel\n paddingInline={24}\n paddingBlock={16}\n >\n <h2\n className={cn(metricsTitleStyles())}\n >\n {title}\n </h2>\n </ContentPanel>\n </GridItem>\n {failed ? (<GridItem\n span=\"full\"\n padding={24}\n >\n {notice}\n </GridItem>) : items.map(({ id, ...metric }, index) => {\n return (<GridItem\n key={id}\n >\n <LoadingSurface\n loading={loading}\n phase={index}\n asChild\n hideContent\n >\n <ContentPanel\n className={cn(metricsSurfaceStyles())}\n >\n <Metric\n {...metric}\n />\n </ContentPanel>\n </LoadingSurface>\n </GridItem>);\n })}\n </Grid>\n </FrameSection>);\n};\n"],
|
|
5
5
|
"mappings": ";AAOA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,qBAAqB,IAAI;AAAA,EAClC;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,uBAAuB,IAAI;AAAA,EACpC;AAAA,EACA;AACJ,CAAC;;;ACVD,SAAS,cAAsC,MAAM,gBAAgB;AACrE,SAAS,sBAAsB;AAC/B,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,MAAAA,WAAU;AA2BX,SAeY,KAfZ;AAZD,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACG,OAAM;AAAA,UACN,SAAS;AAAA,YACL,MAAM;AAAA,YACN,IAAI;AAAA,UACR;AAAA,UACA,aAAW;AAAA,UAEX;AAAA;AAAA,cAAC;AAAA;AAAA,gBACG,MAAK;AAAA,gBAEL;AAAA,kBAAC;AAAA;AAAA,oBACG,eAAe;AAAA,oBACf,cAAc;AAAA,oBAEd;AAAA,sBAAC;AAAA;AAAA,wBACG,WAAWA,IAAG,mBAAmB,CAAC;AAAA,wBAEjC;AAAA;AAAA,oBACL;AAAA;AAAA,gBACJ;AAAA;AAAA,YACJ;AAAA,YACC,SAAU;AAAA,cAAC;AAAA;AAAA,gBACR,MAAK;AAAA,gBACL,SAAS;AAAA,gBAER;AAAA;AAAA,YACL,IAAe,MAAM,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,UAAU;AACnD,qBAAQ;AAAA,gBAAC;AAAA;AAAA,kBAGL;AAAA,oBAAC;AAAA;AAAA,sBACG;AAAA,sBACA,OAAO;AAAA,sBACP,SAAO;AAAA,sBACP,aAAW;AAAA,sBAEX;AAAA,wBAAC;AAAA;AAAA,0BACG,WAAWA,IAAG,qBAAqB,CAAC;AAAA,0BAEpC;AAAA,4BAAC;AAAA;AAAA,8BACI,GAAG;AAAA;AAAA,0BACR;AAAA;AAAA,sBACJ;AAAA;AAAA,kBACJ;AAAA;AAAA,gBAfK;AAAA,cAgBT;AAAA,YACJ,CAAC;AAAA;AAAA;AAAA,MACL;AAAA;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": ["cn"]
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/*! tailwindcss v4.3.
|
|
1
|
+
/*! tailwindcss v4.3.4 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer theme, base, components, utilities;
|
|
3
3
|
@layer utilities {
|
|
4
|
-
.h-full {
|
|
4
|
+
.gridui-u-h-full {
|
|
5
5
|
height: 100%;
|
|
6
6
|
}
|
|
7
|
-
.type-supporting {
|
|
7
|
+
.gridui-u-type-supporting {
|
|
8
8
|
font: var(--gridui-type-supporting);
|
|
9
9
|
letter-spacing: normal;
|
|
10
10
|
}
|
|
11
|
-
.text-muted {
|
|
11
|
+
.gridui-u-text-muted {
|
|
12
12
|
color: var(--gridui-muted);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"name": "@gridui/metrics-section",
|
|
4
|
+
"version": "1.0.4",
|
|
5
|
+
"category": "landing",
|
|
6
|
+
"description": "GridUI React metrics section",
|
|
7
|
+
"usage": "`MetricsSection` from `@gridui/metrics-section` composes a full-width summary heading and Metric cells inside one `Grid frame=\"internal\"`. Grid draws the heading seam and cell separators; FrameSection owns the outer frame. MetricsSection sets 16px block and 24px inline title padding, 24px metric padding, one column below 40rem, and two columns above it. An incomplete final row fills the available tracks. No application-specific border styles or divider flags are needed.",
|
|
8
|
+
"documentation": [
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"exports": [
|
|
12
|
+
{
|
|
13
|
+
"name": "MetricsSection",
|
|
14
|
+
"kind": "component",
|
|
15
|
+
"importPath": "@gridui/metrics-section"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "MetricsSectionItem",
|
|
19
|
+
"kind": "type",
|
|
20
|
+
"importPath": "@gridui/metrics-section"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "MetricsSectionProps",
|
|
24
|
+
"kind": "type",
|
|
25
|
+
"importPath": "@gridui/metrics-section"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"styles": [
|
|
29
|
+
"@gridui/theme/styles.css",
|
|
30
|
+
"@gridui/grid/styles.css",
|
|
31
|
+
"@gridui/loading-surface/styles.css",
|
|
32
|
+
"@gridui/metric/styles.css",
|
|
33
|
+
"@gridui/panel/styles.css",
|
|
34
|
+
"@gridui/metrics-section/styles.css"
|
|
35
|
+
],
|
|
36
|
+
"examples": [
|
|
37
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-landing/metrics-section/stories/metrics-section.stories.tsx"
|
|
38
|
+
]
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/metrics-section",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "GridUI React metrics section",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
-
"README.md"
|
|
9
|
+
"README.md",
|
|
10
|
+
"docs"
|
|
10
11
|
],
|
|
11
12
|
"sideEffects": [
|
|
12
13
|
"**/*.css"
|
|
@@ -26,18 +27,18 @@
|
|
|
26
27
|
"react-dom": "^19.2.0"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@gridui/grid": "^2.
|
|
30
|
-
"@gridui/loading-surface": "^1.
|
|
31
|
-
"@gridui/metric": "^1.0.
|
|
32
|
-
"@gridui/panel": "^1.0.
|
|
33
|
-
"@gridui/style-utils": "^2.
|
|
34
|
-
"@gridui/theme": "^2.
|
|
30
|
+
"@gridui/grid": "^2.3.5",
|
|
31
|
+
"@gridui/loading-surface": "^1.1.2",
|
|
32
|
+
"@gridui/metric": "^1.0.4",
|
|
33
|
+
"@gridui/panel": "^1.0.5",
|
|
34
|
+
"@gridui/style-utils": "^2.2.2",
|
|
35
|
+
"@gridui/theme": "^2.5.3",
|
|
35
36
|
"class-variance-authority": "0.7.1"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
39
40
|
"@jest/globals": "30.5.2",
|
|
40
|
-
"@storybook/react-vite": "10.6.
|
|
41
|
+
"@storybook/react-vite": "10.6.6",
|
|
41
42
|
"@types/jest": "30.0.0",
|
|
42
43
|
"@types/node": "26.6.6",
|
|
43
44
|
"@types/react": "19.3.0",
|