@uoguelph/react-components 1.6.0-rc.7 → 1.6.0-rc.8
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.
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
export type StatisticsProps = PropsWithChildren<{
|
|
3
|
+
id: string;
|
|
3
4
|
/** The variant of the statistics */
|
|
4
5
|
variant: 'solid-colors-full' | 'solid-colors-no-gap' | 'solid-colors' | 'light-grey' | 'left-border';
|
|
5
6
|
/** Additional classes to apply to the statistics */
|
|
6
7
|
className?: string;
|
|
7
8
|
}>;
|
|
8
9
|
/** The Statistic component is used to display a list of statistics in a grid layout. */
|
|
9
|
-
export declare function Statistics({ children, variant, className }: StatisticsProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function Statistics({ id, children, variant, className }: StatisticsProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export declare namespace Statistics {
|
|
11
12
|
var displayName: string;
|
|
12
13
|
}
|
package/dist/statistics.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
import { tv as
|
|
6
|
-
import { u as
|
|
7
|
-
import { StatisticsContext as
|
|
8
|
-
import { StatisticsItem as
|
|
9
|
-
import { StatisticsItemImage as
|
|
10
|
-
import { StatisticsItemRepresents as
|
|
11
|
-
import { StatisticsItemValue as
|
|
12
|
-
function
|
|
13
|
-
const [i,
|
|
3
|
+
import { useState as f } from "react";
|
|
4
|
+
import { twMerge as g } from "tailwind-merge";
|
|
5
|
+
import { tv as n } from "tailwind-variants";
|
|
6
|
+
import { u as p } from "./use-resize-observer-DmddO4OQ.js";
|
|
7
|
+
import { StatisticsContext as v } from "./statistics-context.js";
|
|
8
|
+
import { StatisticsItem as C } from "./statistics-item.js";
|
|
9
|
+
import { StatisticsItemImage as R } from "./statistics-item-image.js";
|
|
10
|
+
import { StatisticsItemRepresents as V } from "./statistics-item-represents.js";
|
|
11
|
+
import { StatisticsItemValue as z } from "./statistics-item-value.js";
|
|
12
|
+
function b({ id: o, children: r, variant: s, className: l }) {
|
|
13
|
+
const [i, c] = f(0), [d, e] = p(), a = n({
|
|
14
14
|
base: "mx-auto my-0 flex flex-col flex-wrap sm:flex-row",
|
|
15
15
|
variants: {
|
|
16
16
|
divisibleByTwo: {
|
|
@@ -47,42 +47,43 @@ function v({ children: o, variant: s, className: r }) {
|
|
|
47
47
|
class: "grid grid-cols-1 sm:grid-cols-3"
|
|
48
48
|
}
|
|
49
49
|
]
|
|
50
|
-
}),
|
|
51
|
-
|
|
50
|
+
}), m = g(
|
|
51
|
+
a({
|
|
52
52
|
variant: s,
|
|
53
53
|
divisibleByTwo: i % 2 === 0,
|
|
54
54
|
divisibleByThree: i % 3 === 0,
|
|
55
55
|
divisibleByFour: i % 4 === 0
|
|
56
56
|
}),
|
|
57
|
-
|
|
57
|
+
l
|
|
58
58
|
);
|
|
59
59
|
return /* @__PURE__ */ t(
|
|
60
|
-
|
|
60
|
+
v.Provider,
|
|
61
61
|
{
|
|
62
62
|
value: {
|
|
63
63
|
variant: s,
|
|
64
|
-
incrementCount: () =>
|
|
64
|
+
incrementCount: () => c((u) => u + 1)
|
|
65
65
|
},
|
|
66
66
|
children: /* @__PURE__ */ t(
|
|
67
67
|
"dl",
|
|
68
68
|
{
|
|
69
|
-
|
|
69
|
+
id: o,
|
|
70
|
+
className: `uofg-statistics ${m}`,
|
|
70
71
|
style: (
|
|
71
72
|
/* @ts-expect-error TypeScript doesn't like CSS Variables */
|
|
72
73
|
s === "solid-colors-full" ? { "--statistic-bg-width": (e == null ? void 0 : e.contentRect.width) + "px" } : void 0
|
|
73
74
|
),
|
|
74
|
-
ref:
|
|
75
|
-
children:
|
|
75
|
+
ref: d,
|
|
76
|
+
children: r
|
|
76
77
|
}
|
|
77
78
|
)
|
|
78
79
|
}
|
|
79
80
|
);
|
|
80
81
|
}
|
|
81
|
-
|
|
82
|
+
b.displayName = "Statistics";
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
b as Statistics,
|
|
85
|
+
C as StatisticsItem,
|
|
86
|
+
R as StatisticsItemImage,
|
|
87
|
+
V as StatisticsItemRepresents,
|
|
88
|
+
z as StatisticsItemValue
|
|
88
89
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uoguelph/react-components",
|
|
3
|
-
"version": "1.6.0-rc.
|
|
3
|
+
"version": "1.6.0-rc.8",
|
|
4
4
|
"description": "University of Guelph React Components Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"bugs": {
|
|
79
79
|
"url": "https://github.com/ccswbs/uofg-components/issues"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "b9fa3bb5ce330c529ac073bf6683226de313be6a"
|
|
82
82
|
}
|