jaci-ui 0.6.2 → 0.7.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/CHANGELOG.md +12 -0
- package/README.md +31 -0
- package/dist/components/alert/alert.cjs +11 -1
- package/dist/components/alert/alert.cjs.map +1 -1
- package/dist/components/alert/alert.d.cts +4 -1
- package/dist/components/alert/alert.d.ts +4 -1
- package/dist/components/alert/alert.js +11 -2
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/index.d.cts +2 -2
- package/dist/components/alert/index.d.ts +2 -2
- package/dist/components/aspect-ratio/aspect-ratio.cjs +23 -0
- package/dist/components/aspect-ratio/aspect-ratio.cjs.map +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.cts +9 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +9 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +23 -0
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -0
- package/dist/components/aspect-ratio/index.d.cts +2 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/card/card.cjs +10 -1
- package/dist/components/card/card.cjs.map +1 -1
- package/dist/components/card/card.d.cts +15 -2
- package/dist/components/card/card.d.ts +15 -2
- package/dist/components/card/card.js +10 -2
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/card/index.d.cts +2 -2
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/code/code.cjs +39 -0
- package/dist/components/code/code.cjs.map +1 -0
- package/dist/components/code/code.d.cts +14 -0
- package/dist/components/code/code.d.ts +14 -0
- package/dist/components/code/code.js +39 -0
- package/dist/components/code/code.js.map +1 -0
- package/dist/components/code/index.d.cts +2 -0
- package/dist/components/code/index.d.ts +2 -0
- package/dist/components/feedback/badge.cjs +6 -3
- package/dist/components/feedback/badge.cjs.map +1 -1
- package/dist/components/feedback/badge.d.cts +1 -0
- package/dist/components/feedback/badge.d.ts +1 -0
- package/dist/components/feedback/badge.js +6 -3
- package/dist/components/feedback/badge.js.map +1 -1
- package/dist/components/figure/figure.cjs +125 -0
- package/dist/components/figure/figure.cjs.map +1 -0
- package/dist/components/figure/figure.d.cts +24 -0
- package/dist/components/figure/figure.d.ts +24 -0
- package/dist/components/figure/figure.js +122 -0
- package/dist/components/figure/figure.js.map +1 -0
- package/dist/components/figure/index.d.cts +2 -0
- package/dist/components/figure/index.d.ts +2 -0
- package/dist/components/image/image.cjs +103 -0
- package/dist/components/image/image.cjs.map +1 -0
- package/dist/components/image/image.d.cts +21 -0
- package/dist/components/image/image.d.ts +21 -0
- package/dist/components/image/image.js +103 -0
- package/dist/components/image/image.js.map +1 -0
- package/dist/components/image/index.d.cts +2 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/kbd/index.d.cts +2 -0
- package/dist/components/kbd/index.d.ts +2 -0
- package/dist/components/kbd/kbd.cjs +23 -0
- package/dist/components/kbd/kbd.cjs.map +1 -0
- package/dist/components/kbd/kbd.d.cts +12 -0
- package/dist/components/kbd/kbd.d.ts +12 -0
- package/dist/components/kbd/kbd.js +23 -0
- package/dist/components/kbd/kbd.js.map +1 -0
- package/dist/components/progress/progress.cjs +19 -7
- package/dist/components/progress/progress.cjs.map +1 -1
- package/dist/components/progress/progress.d.cts +4 -0
- package/dist/components/progress/progress.d.ts +4 -0
- package/dist/components/progress/progress.js +19 -7
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/quote/index.d.cts +2 -0
- package/dist/components/quote/index.d.ts +2 -0
- package/dist/components/quote/quote.cjs +38 -0
- package/dist/components/quote/quote.cjs.map +1 -0
- package/dist/components/quote/quote.d.cts +19 -0
- package/dist/components/quote/quote.d.ts +19 -0
- package/dist/components/quote/quote.js +38 -0
- package/dist/components/quote/quote.js.map +1 -0
- package/dist/components/stat/index.d.cts +2 -0
- package/dist/components/stat/index.d.ts +2 -0
- package/dist/components/stat/stat.cjs +122 -0
- package/dist/components/stat/stat.cjs.map +1 -0
- package/dist/components/stat/stat.d.cts +51 -0
- package/dist/components/stat/stat.d.ts +51 -0
- package/dist/components/stat/stat.js +114 -0
- package/dist/components/stat/stat.js.map +1 -0
- package/dist/components/stat-group/index.d.cts +2 -0
- package/dist/components/stat-group/index.d.ts +2 -0
- package/dist/components/typography/heading.cjs +8 -2
- package/dist/components/typography/heading.cjs.map +1 -1
- package/dist/components/typography/heading.d.cts +8 -1
- package/dist/components/typography/heading.d.ts +8 -1
- package/dist/components/typography/heading.js +8 -2
- package/dist/components/typography/heading.js.map +1 -1
- package/dist/components/typography/index.d.cts +2 -2
- package/dist/components/typography/index.d.ts +2 -2
- package/dist/components/typography/paragraph.cjs +7 -2
- package/dist/components/typography/paragraph.cjs.map +1 -1
- package/dist/components/typography/paragraph.d.cts +8 -2
- package/dist/components/typography/paragraph.d.ts +8 -2
- package/dist/components/typography/paragraph.js +7 -2
- package/dist/components/typography/paragraph.js.map +1 -1
- package/dist/components/typography/text.cjs +6 -2
- package/dist/components/typography/text.cjs.map +1 -1
- package/dist/components/typography/text.d.cts +5 -0
- package/dist/components/typography/text.d.ts +5 -0
- package/dist/components/typography/text.js +6 -2
- package/dist/components/typography/text.js.map +1 -1
- package/dist/index.cjs +27 -0
- package/dist/index.d.cts +19 -4
- package/dist/index.d.ts +19 -4
- package/dist/index.js +10 -3
- package/dist/styled-system/recipes/alert.cjs +2 -1
- package/dist/styled-system/recipes/alert.cjs.map +1 -1
- package/dist/styled-system/recipes/alert.js +2 -1
- package/dist/styled-system/recipes/alert.js.map +1 -1
- package/dist/styled-system/recipes/aspect-ratio-box.cjs +25 -0
- package/dist/styled-system/recipes/aspect-ratio-box.cjs.map +1 -0
- package/dist/styled-system/recipes/aspect-ratio-box.js +25 -0
- package/dist/styled-system/recipes/aspect-ratio-box.js.map +1 -0
- package/dist/styled-system/recipes/badge.cjs +16 -6
- package/dist/styled-system/recipes/badge.cjs.map +1 -1
- package/dist/styled-system/recipes/badge.js +16 -6
- package/dist/styled-system/recipes/badge.js.map +1 -1
- package/dist/styled-system/recipes/code.cjs +33 -0
- package/dist/styled-system/recipes/code.cjs.map +1 -0
- package/dist/styled-system/recipes/code.js +33 -0
- package/dist/styled-system/recipes/code.js.map +1 -0
- package/dist/styled-system/recipes/figure.cjs +42 -0
- package/dist/styled-system/recipes/figure.cjs.map +1 -0
- package/dist/styled-system/recipes/figure.js +42 -0
- package/dist/styled-system/recipes/figure.js.map +1 -0
- package/dist/styled-system/recipes/heading.cjs +34 -9
- package/dist/styled-system/recipes/heading.cjs.map +1 -1
- package/dist/styled-system/recipes/heading.js +34 -9
- package/dist/styled-system/recipes/heading.js.map +1 -1
- package/dist/styled-system/recipes/image.cjs +56 -0
- package/dist/styled-system/recipes/image.cjs.map +1 -0
- package/dist/styled-system/recipes/image.js +56 -0
- package/dist/styled-system/recipes/image.js.map +1 -0
- package/dist/styled-system/recipes/kbd.cjs +39 -0
- package/dist/styled-system/recipes/kbd.cjs.map +1 -0
- package/dist/styled-system/recipes/kbd.js +39 -0
- package/dist/styled-system/recipes/kbd.js.map +1 -0
- package/dist/styled-system/recipes/paragraph.cjs +25 -2
- package/dist/styled-system/recipes/paragraph.cjs.map +1 -1
- package/dist/styled-system/recipes/paragraph.js +25 -2
- package/dist/styled-system/recipes/paragraph.js.map +1 -1
- package/dist/styled-system/recipes/progress.cjs +1 -0
- package/dist/styled-system/recipes/progress.cjs.map +1 -1
- package/dist/styled-system/recipes/progress.js +1 -0
- package/dist/styled-system/recipes/progress.js.map +1 -1
- package/dist/styled-system/recipes/quote.cjs +39 -0
- package/dist/styled-system/recipes/quote.cjs.map +1 -0
- package/dist/styled-system/recipes/quote.js +39 -0
- package/dist/styled-system/recipes/quote.js.map +1 -0
- package/dist/styled-system/recipes/stat-group.cjs +40 -0
- package/dist/styled-system/recipes/stat-group.cjs.map +1 -0
- package/dist/styled-system/recipes/stat-group.js +40 -0
- package/dist/styled-system/recipes/stat-group.js.map +1 -0
- package/dist/styled-system/recipes/stat.cjs +63 -0
- package/dist/styled-system/recipes/stat.cjs.map +1 -0
- package/dist/styled-system/recipes/stat.js +63 -0
- package/dist/styled-system/recipes/stat.js.map +1 -0
- package/dist/styled-system/recipes/text.cjs +23 -2
- package/dist/styled-system/recipes/text.cjs.map +1 -1
- package/dist/styled-system/recipes/text.js +23 -2
- package/dist/styled-system/recipes/text.js.map +1 -1
- package/dist/styles.css +1005 -81
- package/package.json +1 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
const require_cx = require("../../styled-system/css/cx.cjs");
|
|
2
|
+
const require_stat_group = require("../../styled-system/recipes/stat-group.cjs");
|
|
3
|
+
const require_stat = require("../../styled-system/recipes/stat.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
//#region src/components/stat/stat.tsx
|
|
7
|
+
const StatContext = (0, react.createContext)(null);
|
|
8
|
+
function useStatContext() {
|
|
9
|
+
const context = (0, react.useContext)(StatContext);
|
|
10
|
+
if (!context) throw new Error("Stat parts must be rendered inside Stat.Root.");
|
|
11
|
+
return context;
|
|
12
|
+
}
|
|
13
|
+
const StatRoot = (0, react.forwardRef)(function StatRoot({ children, className, size = "md", tone = "neutral", ...props }, ref) {
|
|
14
|
+
const styles = require_stat.stat({
|
|
15
|
+
size,
|
|
16
|
+
tone
|
|
17
|
+
});
|
|
18
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatContext.Provider, {
|
|
19
|
+
value: {
|
|
20
|
+
size,
|
|
21
|
+
styles,
|
|
22
|
+
tone
|
|
23
|
+
},
|
|
24
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("article", {
|
|
25
|
+
...props,
|
|
26
|
+
ref,
|
|
27
|
+
className: require_cx.cx(styles.root, className),
|
|
28
|
+
"data-jaci-component": "stat",
|
|
29
|
+
"data-size": size,
|
|
30
|
+
"data-slot": "stat",
|
|
31
|
+
"data-tone": tone,
|
|
32
|
+
children
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
const StatIcon = (0, react.forwardRef)(function StatIcon({ className, ...props }, ref) {
|
|
37
|
+
const { styles } = useStatContext();
|
|
38
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
39
|
+
...props,
|
|
40
|
+
ref,
|
|
41
|
+
className: require_cx.cx(styles.icon, className),
|
|
42
|
+
"data-slot": "stat-icon"
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
const StatLabel = (0, react.forwardRef)(function StatLabel({ className, ...props }, ref) {
|
|
46
|
+
const { styles } = useStatContext();
|
|
47
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48
|
+
...props,
|
|
49
|
+
ref,
|
|
50
|
+
className: require_cx.cx(styles.label, className),
|
|
51
|
+
"data-slot": "stat-label"
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
const StatValue = (0, react.forwardRef)(function StatValue({ className, ...props }, ref) {
|
|
55
|
+
const { styles } = useStatContext();
|
|
56
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
|
|
57
|
+
...props,
|
|
58
|
+
ref,
|
|
59
|
+
className: require_cx.cx(styles.value, className),
|
|
60
|
+
"data-slot": "stat-value"
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
const StatDescription = (0, react.forwardRef)(function StatDescription({ className, ...props }, ref) {
|
|
64
|
+
const { styles } = useStatContext();
|
|
65
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
66
|
+
...props,
|
|
67
|
+
ref,
|
|
68
|
+
className: require_cx.cx(styles.description, className),
|
|
69
|
+
"data-slot": "stat-description"
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
const StatTrend = (0, react.forwardRef)(function StatTrend({ className, direction = "neutral", ...props }, ref) {
|
|
73
|
+
const { styles } = useStatContext();
|
|
74
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
75
|
+
...props,
|
|
76
|
+
ref,
|
|
77
|
+
className: require_cx.cx(styles.trend, require_stat.stat({ direction }).trend, className),
|
|
78
|
+
"data-direction": direction,
|
|
79
|
+
"data-slot": "stat-trend"
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
const Stat = {
|
|
83
|
+
Root: StatRoot,
|
|
84
|
+
Icon: StatIcon,
|
|
85
|
+
Label: StatLabel,
|
|
86
|
+
Value: StatValue,
|
|
87
|
+
Description: StatDescription,
|
|
88
|
+
Trend: StatTrend
|
|
89
|
+
};
|
|
90
|
+
const StatGroupRoot = (0, react.forwardRef)(function StatGroupRoot({ children, className, columns = 3, gap = "md", responsive = true, style, ...props }, ref) {
|
|
91
|
+
const columnValue = String(columns);
|
|
92
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
93
|
+
...props,
|
|
94
|
+
ref,
|
|
95
|
+
className: require_cx.cx(require_stat_group.statGroup({
|
|
96
|
+
columns: columnValue,
|
|
97
|
+
gap
|
|
98
|
+
}), className),
|
|
99
|
+
"data-columns": columns,
|
|
100
|
+
"data-jaci-component": "stat-group",
|
|
101
|
+
"data-responsive": responsive || void 0,
|
|
102
|
+
"data-slot": "stat-group",
|
|
103
|
+
style: responsive ? style : {
|
|
104
|
+
gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
|
|
105
|
+
...style
|
|
106
|
+
},
|
|
107
|
+
children
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
const StatGroup = { Root: StatGroupRoot };
|
|
111
|
+
//#endregion
|
|
112
|
+
exports.Stat = Stat;
|
|
113
|
+
exports.StatDescription = StatDescription;
|
|
114
|
+
exports.StatGroup = StatGroup;
|
|
115
|
+
exports.StatGroupRoot = StatGroupRoot;
|
|
116
|
+
exports.StatIcon = StatIcon;
|
|
117
|
+
exports.StatLabel = StatLabel;
|
|
118
|
+
exports.StatRoot = StatRoot;
|
|
119
|
+
exports.StatTrend = StatTrend;
|
|
120
|
+
exports.StatValue = StatValue;
|
|
121
|
+
|
|
122
|
+
//# sourceMappingURL=stat.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat.cjs","names":["stat","cx","statGroup"],"sources":["../../../src/components/stat/stat.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { stat, statGroup } from \"../../styled-system/recipes\";\n\nexport type StatTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\nexport type StatSize = \"sm\" | \"md\" | \"lg\";\nexport type StatTrendDirection = \"up\" | \"down\" | \"neutral\";\n\ninterface StatContextValue {\n size: StatSize;\n styles: ReturnType<typeof stat>;\n tone: StatTone;\n}\n\nconst StatContext = createContext<StatContextValue | null>(null);\n\nfunction useStatContext() {\n const context = useContext(StatContext);\n if (!context) {\n throw new Error(\"Stat parts must be rendered inside Stat.Root.\");\n }\n\n return context;\n}\n\nexport interface StatRootProps extends ComponentPropsWithoutRef<\"article\"> {\n size?: StatSize;\n tone?: StatTone;\n}\n\nexport const StatRoot = forwardRef<HTMLElement, StatRootProps>(function StatRoot(\n { children, className, size = \"md\", tone = \"neutral\", ...props },\n ref,\n) {\n const styles = stat({ size, tone });\n\n return (\n <StatContext.Provider value={{ size, styles, tone }}>\n <article\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"stat\"\n data-size={size}\n data-slot=\"stat\"\n data-tone={tone}\n >\n {children}\n </article>\n </StatContext.Provider>\n );\n});\n\nexport type StatIconProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatIcon = forwardRef<HTMLSpanElement, StatIconProps>(function StatIcon(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return <span {...props} ref={ref} className={cx(styles.icon, className)} data-slot=\"stat-icon\" />;\n});\n\nexport type StatLabelProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatLabel = forwardRef<HTMLSpanElement, StatLabelProps>(function StatLabel(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"stat-label\" />\n );\n});\n\nexport type StatValueProps = ComponentPropsWithoutRef<\"strong\">;\nexport const StatValue = forwardRef<HTMLElement, StatValueProps>(function StatValue(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <strong {...props} ref={ref} className={cx(styles.value, className)} data-slot=\"stat-value\" />\n );\n});\n\nexport type StatDescriptionProps = ComponentPropsWithoutRef<\"p\">;\nexport const StatDescription = forwardRef<HTMLParagraphElement, StatDescriptionProps>(\n function StatDescription({ className, ...props }, ref) {\n const { styles } = useStatContext();\n return (\n <p\n {...props}\n ref={ref}\n className={cx(styles.description, className)}\n data-slot=\"stat-description\"\n />\n );\n },\n);\n\nexport interface StatTrendProps extends ComponentPropsWithoutRef<\"span\"> {\n direction?: StatTrendDirection;\n}\n\nexport const StatTrend = forwardRef<HTMLSpanElement, StatTrendProps>(function StatTrend(\n { className, direction = \"neutral\", ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.trend, stat({ direction }).trend, className)}\n data-direction={direction}\n data-slot=\"stat-trend\"\n />\n );\n});\n\nexport const Stat = {\n Root: StatRoot,\n Icon: StatIcon,\n Label: StatLabel,\n Value: StatValue,\n Description: StatDescription,\n Trend: StatTrend,\n};\n\nexport type StatGroupRootProps = ComponentPropsWithoutRef<\"div\"> & {\n columns?: 1 | 2 | 3 | 4;\n gap?: \"sm\" | \"md\" | \"lg\";\n responsive?: boolean;\n};\n\nexport const StatGroupRoot = forwardRef<HTMLDivElement, StatGroupRootProps>(function StatGroupRoot(\n { children, className, columns = 3, gap = \"md\", responsive = true, style, ...props },\n ref,\n) {\n const columnValue = String(columns) as \"1\" | \"2\" | \"3\" | \"4\";\n return (\n <div\n {...props}\n ref={ref}\n className={cx(statGroup({ columns: columnValue, gap }), className)}\n data-columns={columns}\n data-jaci-component=\"stat-group\"\n data-responsive={responsive || undefined}\n data-slot=\"stat-group\"\n style={\n responsive ? style : { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, ...style }\n }\n >\n {children}\n </div>\n );\n});\n\nexport const StatGroup = { Root: StatGroupRoot };\n\nexport type StatGroupProps = StatGroupRootProps;\n\nexport type StatChildren = ReactNode;\n"],"mappings":";;;;;;AAgBA,MAAM,eAAA,GAAA,MAAA,cAAA,CAAqD,IAAI;AAE/D,SAAS,iBAAiB;CACxB,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,WAAW;CACtC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,+CAA+C;CAGjE,OAAO;AACT;AAOA,MAAa,YAAA,GAAA,MAAA,WAAA,CAAkD,SAAS,SACtE,EAAE,UAAU,WAAW,OAAO,MAAM,OAAO,WAAW,GAAG,SACzD,KACA;CACA,MAAM,SAASA,aAAAA,KAAK;EAAE;EAAM;CAAK,CAAC;CAElC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAY,UAAb;EAAsB,OAAO;GAAE;GAAM;GAAQ;EAAK;YAChD,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;GACE,GAAI;GACC;GACL,WAAWC,WAAAA,GAAG,OAAO,MAAM,SAAS;GACpC,uBAAoB;GACpB,aAAW;GACX,aAAU;GACV,aAAW;GAEV;EACM,CAAA;CACW,CAAA;AAE1B,CAAC;AAGD,MAAa,YAAA,GAAA,MAAA,WAAA,CAAsD,SAAS,SAC1E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAWA,WAAAA,GAAG,OAAO,MAAM,SAAS;EAAG,aAAU;CAAa,CAAA;AAClG,CAAC;AAGD,MAAa,aAAA,GAAA,MAAA,WAAA,CAAwD,SAAS,UAC5E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAWA,WAAAA,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAc,CAAA;AAE/F,CAAC;AAGD,MAAa,aAAA,GAAA,MAAA,WAAA,CAAoD,SAAS,UACxE,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EAAQ,GAAI;EAAY;EAAK,WAAWA,WAAAA,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAc,CAAA;AAEjG,CAAC;AAGD,MAAa,mBAAA,GAAA,MAAA,WAAA,CACX,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACE,GAAI;EACC;EACL,WAAWA,WAAAA,GAAG,OAAO,aAAa,SAAS;EAC3C,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,aAAA,GAAA,MAAA,WAAA,CAAwD,SAAS,UAC5E,EAAE,WAAW,YAAY,WAAW,GAAG,SACvC,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EACE,GAAI;EACC;EACL,WAAWA,WAAAA,GAAG,OAAO,OAAOD,aAAAA,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,SAAS;EAChE,kBAAgB;EAChB,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAa,OAAO;CAClB,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;AACT;AAQA,MAAa,iBAAA,GAAA,MAAA,WAAA,CAA+D,SAAS,cACnF,EAAE,UAAU,WAAW,UAAU,GAAG,MAAM,MAAM,aAAa,MAAM,OAAO,GAAG,SAC7E,KACA;CACA,MAAM,cAAc,OAAO,OAAO;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAGC,mBAAAA,UAAU;GAAE,SAAS;GAAa;EAAI,CAAC,GAAG,SAAS;EACjE,gBAAc;EACd,uBAAoB;EACpB,mBAAiB,cAAc,KAAA;EAC/B,aAAU;EACV,OACE,aAAa,QAAQ;GAAE,qBAAqB,UAAU,QAAQ;GAAoB,GAAG;EAAM;EAG5F;CACE,CAAA;AAET,CAAC;AAED,MAAa,YAAY,EAAE,MAAM,cAAc"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
//#region src/components/stat/stat.d.ts
|
|
3
|
+
type StatTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
4
|
+
type StatSize = "sm" | "md" | "lg";
|
|
5
|
+
type StatTrendDirection = "up" | "down" | "neutral";
|
|
6
|
+
interface StatRootProps extends ComponentPropsWithoutRef<"article"> {
|
|
7
|
+
size?: StatSize;
|
|
8
|
+
tone?: StatTone;
|
|
9
|
+
}
|
|
10
|
+
declare const StatRoot: import("react").ForwardRefExoticComponent<StatRootProps & import("react").RefAttributes<HTMLElement>>;
|
|
11
|
+
type StatIconProps = ComponentPropsWithoutRef<"span">;
|
|
12
|
+
declare const StatIcon: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
13
|
+
type StatLabelProps = ComponentPropsWithoutRef<"span">;
|
|
14
|
+
declare const StatLabel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
15
|
+
type StatValueProps = ComponentPropsWithoutRef<"strong">;
|
|
16
|
+
declare const StatValue: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
17
|
+
type StatDescriptionProps = ComponentPropsWithoutRef<"p">;
|
|
18
|
+
declare const StatDescription: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
interface StatTrendProps extends ComponentPropsWithoutRef<"span"> {
|
|
20
|
+
direction?: StatTrendDirection;
|
|
21
|
+
}
|
|
22
|
+
declare const StatTrend: import("react").ForwardRefExoticComponent<StatTrendProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
23
|
+
declare const Stat: {
|
|
24
|
+
Root: import("react").ForwardRefExoticComponent<StatRootProps & import("react").RefAttributes<HTMLElement>>;
|
|
25
|
+
Icon: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
26
|
+
Label: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
27
|
+
Value: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
28
|
+
Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
29
|
+
Trend: import("react").ForwardRefExoticComponent<StatTrendProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
30
|
+
};
|
|
31
|
+
type StatGroupRootProps = ComponentPropsWithoutRef<"div"> & {
|
|
32
|
+
columns?: 1 | 2 | 3 | 4;
|
|
33
|
+
gap?: "sm" | "md" | "lg";
|
|
34
|
+
responsive?: boolean;
|
|
35
|
+
};
|
|
36
|
+
declare const StatGroupRoot: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
37
|
+
columns?: 1 | 2 | 3 | 4;
|
|
38
|
+
gap?: "sm" | "md" | "lg";
|
|
39
|
+
responsive?: boolean;
|
|
40
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
41
|
+
declare const StatGroup: {
|
|
42
|
+
Root: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
43
|
+
columns?: 1 | 2 | 3 | 4;
|
|
44
|
+
gap?: "sm" | "md" | "lg";
|
|
45
|
+
responsive?: boolean;
|
|
46
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
+
};
|
|
48
|
+
type StatGroupProps = StatGroupRootProps;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { Stat, StatDescription, StatDescriptionProps, StatGroup, StatGroupProps, StatGroupRoot, StatGroupRootProps, StatIcon, StatIconProps, StatLabel, StatLabelProps, StatRoot, StatRootProps, StatSize, StatTone, StatTrend, StatTrendDirection, StatTrendProps, StatValue, StatValueProps };
|
|
51
|
+
//# sourceMappingURL=stat.d.cts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
//#region src/components/stat/stat.d.ts
|
|
3
|
+
type StatTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
4
|
+
type StatSize = "sm" | "md" | "lg";
|
|
5
|
+
type StatTrendDirection = "up" | "down" | "neutral";
|
|
6
|
+
interface StatRootProps extends ComponentPropsWithoutRef<"article"> {
|
|
7
|
+
size?: StatSize;
|
|
8
|
+
tone?: StatTone;
|
|
9
|
+
}
|
|
10
|
+
declare const StatRoot: import("react").ForwardRefExoticComponent<StatRootProps & import("react").RefAttributes<HTMLElement>>;
|
|
11
|
+
type StatIconProps = ComponentPropsWithoutRef<"span">;
|
|
12
|
+
declare const StatIcon: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
13
|
+
type StatLabelProps = ComponentPropsWithoutRef<"span">;
|
|
14
|
+
declare const StatLabel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
15
|
+
type StatValueProps = ComponentPropsWithoutRef<"strong">;
|
|
16
|
+
declare const StatValue: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
17
|
+
type StatDescriptionProps = ComponentPropsWithoutRef<"p">;
|
|
18
|
+
declare const StatDescription: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
interface StatTrendProps extends ComponentPropsWithoutRef<"span"> {
|
|
20
|
+
direction?: StatTrendDirection;
|
|
21
|
+
}
|
|
22
|
+
declare const StatTrend: import("react").ForwardRefExoticComponent<StatTrendProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
23
|
+
declare const Stat: {
|
|
24
|
+
Root: import("react").ForwardRefExoticComponent<StatRootProps & import("react").RefAttributes<HTMLElement>>;
|
|
25
|
+
Icon: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
26
|
+
Label: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
27
|
+
Value: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
28
|
+
Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
29
|
+
Trend: import("react").ForwardRefExoticComponent<StatTrendProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
30
|
+
};
|
|
31
|
+
type StatGroupRootProps = ComponentPropsWithoutRef<"div"> & {
|
|
32
|
+
columns?: 1 | 2 | 3 | 4;
|
|
33
|
+
gap?: "sm" | "md" | "lg";
|
|
34
|
+
responsive?: boolean;
|
|
35
|
+
};
|
|
36
|
+
declare const StatGroupRoot: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
37
|
+
columns?: 1 | 2 | 3 | 4;
|
|
38
|
+
gap?: "sm" | "md" | "lg";
|
|
39
|
+
responsive?: boolean;
|
|
40
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
41
|
+
declare const StatGroup: {
|
|
42
|
+
Root: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
43
|
+
columns?: 1 | 2 | 3 | 4;
|
|
44
|
+
gap?: "sm" | "md" | "lg";
|
|
45
|
+
responsive?: boolean;
|
|
46
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
+
};
|
|
48
|
+
type StatGroupProps = StatGroupRootProps;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { Stat, StatDescription, StatDescriptionProps, StatGroup, StatGroupProps, StatGroupRoot, StatGroupRootProps, StatIcon, StatIconProps, StatLabel, StatLabelProps, StatRoot, StatRootProps, StatSize, StatTone, StatTrend, StatTrendDirection, StatTrendProps, StatValue, StatValueProps };
|
|
51
|
+
//# sourceMappingURL=stat.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { cx } from "../../styled-system/css/cx.js";
|
|
2
|
+
import { statGroup } from "../../styled-system/recipes/stat-group.js";
|
|
3
|
+
import { stat } from "../../styled-system/recipes/stat.js";
|
|
4
|
+
import { createContext, forwardRef, useContext } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/stat/stat.tsx
|
|
7
|
+
const StatContext = createContext(null);
|
|
8
|
+
function useStatContext() {
|
|
9
|
+
const context = useContext(StatContext);
|
|
10
|
+
if (!context) throw new Error("Stat parts must be rendered inside Stat.Root.");
|
|
11
|
+
return context;
|
|
12
|
+
}
|
|
13
|
+
const StatRoot = forwardRef(function StatRoot({ children, className, size = "md", tone = "neutral", ...props }, ref) {
|
|
14
|
+
const styles = stat({
|
|
15
|
+
size,
|
|
16
|
+
tone
|
|
17
|
+
});
|
|
18
|
+
return /* @__PURE__ */ jsx(StatContext.Provider, {
|
|
19
|
+
value: {
|
|
20
|
+
size,
|
|
21
|
+
styles,
|
|
22
|
+
tone
|
|
23
|
+
},
|
|
24
|
+
children: /* @__PURE__ */ jsx("article", {
|
|
25
|
+
...props,
|
|
26
|
+
ref,
|
|
27
|
+
className: cx(styles.root, className),
|
|
28
|
+
"data-jaci-component": "stat",
|
|
29
|
+
"data-size": size,
|
|
30
|
+
"data-slot": "stat",
|
|
31
|
+
"data-tone": tone,
|
|
32
|
+
children
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
const StatIcon = forwardRef(function StatIcon({ className, ...props }, ref) {
|
|
37
|
+
const { styles } = useStatContext();
|
|
38
|
+
return /* @__PURE__ */ jsx("span", {
|
|
39
|
+
...props,
|
|
40
|
+
ref,
|
|
41
|
+
className: cx(styles.icon, className),
|
|
42
|
+
"data-slot": "stat-icon"
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
const StatLabel = forwardRef(function StatLabel({ className, ...props }, ref) {
|
|
46
|
+
const { styles } = useStatContext();
|
|
47
|
+
return /* @__PURE__ */ jsx("span", {
|
|
48
|
+
...props,
|
|
49
|
+
ref,
|
|
50
|
+
className: cx(styles.label, className),
|
|
51
|
+
"data-slot": "stat-label"
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
const StatValue = forwardRef(function StatValue({ className, ...props }, ref) {
|
|
55
|
+
const { styles } = useStatContext();
|
|
56
|
+
return /* @__PURE__ */ jsx("strong", {
|
|
57
|
+
...props,
|
|
58
|
+
ref,
|
|
59
|
+
className: cx(styles.value, className),
|
|
60
|
+
"data-slot": "stat-value"
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
const StatDescription = forwardRef(function StatDescription({ className, ...props }, ref) {
|
|
64
|
+
const { styles } = useStatContext();
|
|
65
|
+
return /* @__PURE__ */ jsx("p", {
|
|
66
|
+
...props,
|
|
67
|
+
ref,
|
|
68
|
+
className: cx(styles.description, className),
|
|
69
|
+
"data-slot": "stat-description"
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
const StatTrend = forwardRef(function StatTrend({ className, direction = "neutral", ...props }, ref) {
|
|
73
|
+
const { styles } = useStatContext();
|
|
74
|
+
return /* @__PURE__ */ jsx("span", {
|
|
75
|
+
...props,
|
|
76
|
+
ref,
|
|
77
|
+
className: cx(styles.trend, stat({ direction }).trend, className),
|
|
78
|
+
"data-direction": direction,
|
|
79
|
+
"data-slot": "stat-trend"
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
const Stat = {
|
|
83
|
+
Root: StatRoot,
|
|
84
|
+
Icon: StatIcon,
|
|
85
|
+
Label: StatLabel,
|
|
86
|
+
Value: StatValue,
|
|
87
|
+
Description: StatDescription,
|
|
88
|
+
Trend: StatTrend
|
|
89
|
+
};
|
|
90
|
+
const StatGroupRoot = forwardRef(function StatGroupRoot({ children, className, columns = 3, gap = "md", responsive = true, style, ...props }, ref) {
|
|
91
|
+
const columnValue = String(columns);
|
|
92
|
+
return /* @__PURE__ */ jsx("div", {
|
|
93
|
+
...props,
|
|
94
|
+
ref,
|
|
95
|
+
className: cx(statGroup({
|
|
96
|
+
columns: columnValue,
|
|
97
|
+
gap
|
|
98
|
+
}), className),
|
|
99
|
+
"data-columns": columns,
|
|
100
|
+
"data-jaci-component": "stat-group",
|
|
101
|
+
"data-responsive": responsive || void 0,
|
|
102
|
+
"data-slot": "stat-group",
|
|
103
|
+
style: responsive ? style : {
|
|
104
|
+
gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
|
|
105
|
+
...style
|
|
106
|
+
},
|
|
107
|
+
children
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
const StatGroup = { Root: StatGroupRoot };
|
|
111
|
+
//#endregion
|
|
112
|
+
export { Stat, StatDescription, StatGroup, StatGroupRoot, StatIcon, StatLabel, StatRoot, StatTrend, StatValue };
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=stat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat.js","names":[],"sources":["../../../src/components/stat/stat.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { stat, statGroup } from \"../../styled-system/recipes\";\n\nexport type StatTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\nexport type StatSize = \"sm\" | \"md\" | \"lg\";\nexport type StatTrendDirection = \"up\" | \"down\" | \"neutral\";\n\ninterface StatContextValue {\n size: StatSize;\n styles: ReturnType<typeof stat>;\n tone: StatTone;\n}\n\nconst StatContext = createContext<StatContextValue | null>(null);\n\nfunction useStatContext() {\n const context = useContext(StatContext);\n if (!context) {\n throw new Error(\"Stat parts must be rendered inside Stat.Root.\");\n }\n\n return context;\n}\n\nexport interface StatRootProps extends ComponentPropsWithoutRef<\"article\"> {\n size?: StatSize;\n tone?: StatTone;\n}\n\nexport const StatRoot = forwardRef<HTMLElement, StatRootProps>(function StatRoot(\n { children, className, size = \"md\", tone = \"neutral\", ...props },\n ref,\n) {\n const styles = stat({ size, tone });\n\n return (\n <StatContext.Provider value={{ size, styles, tone }}>\n <article\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"stat\"\n data-size={size}\n data-slot=\"stat\"\n data-tone={tone}\n >\n {children}\n </article>\n </StatContext.Provider>\n );\n});\n\nexport type StatIconProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatIcon = forwardRef<HTMLSpanElement, StatIconProps>(function StatIcon(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return <span {...props} ref={ref} className={cx(styles.icon, className)} data-slot=\"stat-icon\" />;\n});\n\nexport type StatLabelProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatLabel = forwardRef<HTMLSpanElement, StatLabelProps>(function StatLabel(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"stat-label\" />\n );\n});\n\nexport type StatValueProps = ComponentPropsWithoutRef<\"strong\">;\nexport const StatValue = forwardRef<HTMLElement, StatValueProps>(function StatValue(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <strong {...props} ref={ref} className={cx(styles.value, className)} data-slot=\"stat-value\" />\n );\n});\n\nexport type StatDescriptionProps = ComponentPropsWithoutRef<\"p\">;\nexport const StatDescription = forwardRef<HTMLParagraphElement, StatDescriptionProps>(\n function StatDescription({ className, ...props }, ref) {\n const { styles } = useStatContext();\n return (\n <p\n {...props}\n ref={ref}\n className={cx(styles.description, className)}\n data-slot=\"stat-description\"\n />\n );\n },\n);\n\nexport interface StatTrendProps extends ComponentPropsWithoutRef<\"span\"> {\n direction?: StatTrendDirection;\n}\n\nexport const StatTrend = forwardRef<HTMLSpanElement, StatTrendProps>(function StatTrend(\n { className, direction = \"neutral\", ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.trend, stat({ direction }).trend, className)}\n data-direction={direction}\n data-slot=\"stat-trend\"\n />\n );\n});\n\nexport const Stat = {\n Root: StatRoot,\n Icon: StatIcon,\n Label: StatLabel,\n Value: StatValue,\n Description: StatDescription,\n Trend: StatTrend,\n};\n\nexport type StatGroupRootProps = ComponentPropsWithoutRef<\"div\"> & {\n columns?: 1 | 2 | 3 | 4;\n gap?: \"sm\" | \"md\" | \"lg\";\n responsive?: boolean;\n};\n\nexport const StatGroupRoot = forwardRef<HTMLDivElement, StatGroupRootProps>(function StatGroupRoot(\n { children, className, columns = 3, gap = \"md\", responsive = true, style, ...props },\n ref,\n) {\n const columnValue = String(columns) as \"1\" | \"2\" | \"3\" | \"4\";\n return (\n <div\n {...props}\n ref={ref}\n className={cx(statGroup({ columns: columnValue, gap }), className)}\n data-columns={columns}\n data-jaci-component=\"stat-group\"\n data-responsive={responsive || undefined}\n data-slot=\"stat-group\"\n style={\n responsive ? style : { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, ...style }\n }\n >\n {children}\n </div>\n );\n});\n\nexport const StatGroup = { Root: StatGroupRoot };\n\nexport type StatGroupProps = StatGroupRootProps;\n\nexport type StatChildren = ReactNode;\n"],"mappings":";;;;;;AAgBA,MAAM,cAAc,cAAuC,IAAI;AAE/D,SAAS,iBAAiB;CACxB,MAAM,UAAU,WAAW,WAAW;CACtC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,+CAA+C;CAGjE,OAAO;AACT;AAOA,MAAa,WAAW,WAAuC,SAAS,SACtE,EAAE,UAAU,WAAW,OAAO,MAAM,OAAO,WAAW,GAAG,SACzD,KACA;CACA,MAAM,SAAS,KAAK;EAAE;EAAM;CAAK,CAAC;CAElC,OACE,oBAAC,YAAY,UAAb;EAAsB,OAAO;GAAE;GAAM;GAAQ;EAAK;YAChD,oBAAC,WAAD;GACE,GAAI;GACC;GACL,WAAW,GAAG,OAAO,MAAM,SAAS;GACpC,uBAAoB;GACpB,aAAW;GACX,aAAU;GACV,aAAW;GAEV;EACM,CAAA;CACW,CAAA;AAE1B,CAAC;AAGD,MAAa,WAAW,WAA2C,SAAS,SAC1E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OAAO,oBAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAW,GAAG,OAAO,MAAM,SAAS;EAAG,aAAU;CAAa,CAAA;AAClG,CAAC;AAGD,MAAa,YAAY,WAA4C,SAAS,UAC5E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,oBAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAW,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAc,CAAA;AAE/F,CAAC;AAGD,MAAa,YAAY,WAAwC,SAAS,UACxE,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,oBAAC,UAAD;EAAQ,GAAI;EAAY;EAAK,WAAW,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAc,CAAA;AAEjG,CAAC;AAGD,MAAa,kBAAkB,WAC7B,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,oBAAC,KAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,OAAO,aAAa,SAAS;EAC3C,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,YAAY,WAA4C,SAAS,UAC5E,EAAE,WAAW,YAAY,WAAW,GAAG,SACvC,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,oBAAC,QAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,OAAO,OAAO,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,SAAS;EAChE,kBAAgB;EAChB,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAa,OAAO;CAClB,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;AACT;AAQA,MAAa,gBAAgB,WAA+C,SAAS,cACnF,EAAE,UAAU,WAAW,UAAU,GAAG,MAAM,MAAM,aAAa,MAAM,OAAO,GAAG,SAC7E,KACA;CACA,MAAM,cAAc,OAAO,OAAO;CAClC,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,UAAU;GAAE,SAAS;GAAa;EAAI,CAAC,GAAG,SAAS;EACjE,gBAAc;EACd,uBAAoB;EACpB,mBAAiB,cAAc,KAAA;EAC/B,aAAU;EACV,OACE,aAAa,QAAQ;GAAE,qBAAqB,UAAU,QAAQ;GAAoB,GAAG;EAAM;EAG5F;CACE,CAAA;AAET,CAAC;AAED,MAAa,YAAY,EAAE,MAAM,cAAc"}
|
|
@@ -11,13 +11,19 @@ const defaultSizeByElement = {
|
|
|
11
11
|
h5: "sm",
|
|
12
12
|
h6: "xs"
|
|
13
13
|
};
|
|
14
|
-
const Heading = (0, react.forwardRef)(function Heading({ as = "h2", className, size, ...props }, ref) {
|
|
14
|
+
const Heading = (0, react.forwardRef)(function Heading({ as = "h2", className, lineClamp, size, truncate = false, weight, width = "auto", ...props }, ref) {
|
|
15
15
|
const Component = as;
|
|
16
16
|
const resolvedSize = size ?? defaultSizeByElement[as];
|
|
17
17
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
18
18
|
...props,
|
|
19
19
|
ref,
|
|
20
|
-
className: require_cx.cx(require_heading.heading({
|
|
20
|
+
className: require_cx.cx(require_heading.heading({
|
|
21
|
+
lineClamp: lineClamp ? String(lineClamp) : void 0,
|
|
22
|
+
size: resolvedSize,
|
|
23
|
+
truncate,
|
|
24
|
+
weight,
|
|
25
|
+
width
|
|
26
|
+
}), className),
|
|
21
27
|
"data-jaci-component": "heading",
|
|
22
28
|
"data-slot": "heading"
|
|
23
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.cjs","names":["cx","heading"],"sources":["../../../src/components/typography/heading.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementType, ReactElement, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { heading } from \"../../styled-system/recipes\";\n\nexport type HeadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type HeadingElement = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\nconst defaultSizeByElement: Record<HeadingElement, HeadingSize> = {\n h1: \"2xl\",\n h2: \"xl\",\n h3: \"lg\",\n h4: \"md\",\n h5: \"sm\",\n h6: \"xs\",\n};\n\nexport interface HeadingProps extends Omit<ComponentPropsWithoutRef<\"h2\">, \"color\"> {\n as?: HeadingElement;\n size?: HeadingSize;\n}\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function Heading(\n { as = \"h2\", className, size, ...props },\n ref,\n) {\n const Component = as as ElementType;\n const resolvedSize = size ?? defaultSizeByElement[as];\n\n return (\n <Component\n {...props}\n ref={ref as Ref<HTMLElement>}\n className={cx(heading({ size: resolvedSize
|
|
1
|
+
{"version":3,"file":"heading.cjs","names":["cx","heading"],"sources":["../../../src/components/typography/heading.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementType, ReactElement, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { heading } from \"../../styled-system/recipes\";\n\nexport type HeadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type HeadingElement = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\nexport type TypographyWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type TypographyWidth = \"auto\" | \"fit\" | \"full\";\nexport type TypographyLineClamp = 1 | 2 | 3 | 4;\n\nconst defaultSizeByElement: Record<HeadingElement, HeadingSize> = {\n h1: \"2xl\",\n h2: \"xl\",\n h3: \"lg\",\n h4: \"md\",\n h5: \"sm\",\n h6: \"xs\",\n};\n\nexport interface HeadingProps extends Omit<ComponentPropsWithoutRef<\"h2\">, \"color\"> {\n as?: HeadingElement;\n size?: HeadingSize;\n weight?: TypographyWeight;\n truncate?: boolean;\n lineClamp?: TypographyLineClamp;\n width?: TypographyWidth;\n}\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function Heading(\n { as = \"h2\", className, lineClamp, size, truncate = false, weight, width = \"auto\", ...props },\n ref,\n) {\n const Component = as as ElementType;\n const resolvedSize = size ?? defaultSizeByElement[as];\n\n return (\n <Component\n {...props}\n ref={ref as Ref<HTMLElement>}\n className={cx(\n heading({\n lineClamp: lineClamp ? (String(lineClamp) as \"1\" | \"2\" | \"3\" | \"4\") : undefined,\n size: resolvedSize,\n truncate,\n weight,\n width,\n }),\n className,\n )}\n data-jaci-component=\"heading\"\n data-slot=\"heading\"\n />\n ) as ReactElement;\n});\n"],"mappings":";;;;;AAYA,MAAM,uBAA4D;CAChE,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAWA,MAAa,WAAA,GAAA,MAAA,WAAA,CAAuD,SAAS,QAC3E,EAAE,KAAK,MAAM,WAAW,WAAW,MAAM,WAAW,OAAO,QAAQ,QAAQ,QAAQ,GAAG,SACtF,KACA;CACA,MAAM,YAAY;CAClB,MAAM,eAAe,QAAQ,qBAAqB;CAElD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACE,GAAI;EACC;EACL,WAAWA,WAAAA,GACTC,gBAAAA,QAAQ;GACN,WAAW,YAAa,OAAO,SAAS,IAA8B,KAAA;GACtE,MAAM;GACN;GACA;GACA;EACF,CAAC,GACD,SACF;EACA,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CAAC"}
|
|
@@ -2,11 +2,18 @@ import { ComponentPropsWithoutRef } from "react";
|
|
|
2
2
|
//#region src/components/typography/heading.d.ts
|
|
3
3
|
type HeadingSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
4
4
|
type HeadingElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
5
|
+
type TypographyWeight = "normal" | "medium" | "semibold" | "bold";
|
|
6
|
+
type TypographyWidth = "auto" | "fit" | "full";
|
|
7
|
+
type TypographyLineClamp = 1 | 2 | 3 | 4;
|
|
5
8
|
interface HeadingProps extends Omit<ComponentPropsWithoutRef<"h2">, "color"> {
|
|
6
9
|
as?: HeadingElement;
|
|
7
10
|
size?: HeadingSize;
|
|
11
|
+
weight?: TypographyWeight;
|
|
12
|
+
truncate?: boolean;
|
|
13
|
+
lineClamp?: TypographyLineClamp;
|
|
14
|
+
width?: TypographyWidth;
|
|
8
15
|
}
|
|
9
16
|
declare const Heading: import("react").ForwardRefExoticComponent<HeadingProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
10
17
|
//#endregion
|
|
11
|
-
export { Heading, HeadingElement, HeadingProps, HeadingSize };
|
|
18
|
+
export { Heading, HeadingElement, HeadingProps, HeadingSize, TypographyLineClamp, TypographyWeight, TypographyWidth };
|
|
12
19
|
//# sourceMappingURL=heading.d.cts.map
|
|
@@ -2,11 +2,18 @@ import { ComponentPropsWithoutRef } from "react";
|
|
|
2
2
|
//#region src/components/typography/heading.d.ts
|
|
3
3
|
type HeadingSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
4
4
|
type HeadingElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
5
|
+
type TypographyWeight = "normal" | "medium" | "semibold" | "bold";
|
|
6
|
+
type TypographyWidth = "auto" | "fit" | "full";
|
|
7
|
+
type TypographyLineClamp = 1 | 2 | 3 | 4;
|
|
5
8
|
interface HeadingProps extends Omit<ComponentPropsWithoutRef<"h2">, "color"> {
|
|
6
9
|
as?: HeadingElement;
|
|
7
10
|
size?: HeadingSize;
|
|
11
|
+
weight?: TypographyWeight;
|
|
12
|
+
truncate?: boolean;
|
|
13
|
+
lineClamp?: TypographyLineClamp;
|
|
14
|
+
width?: TypographyWidth;
|
|
8
15
|
}
|
|
9
16
|
declare const Heading: import("react").ForwardRefExoticComponent<HeadingProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
10
17
|
//#endregion
|
|
11
|
-
export { Heading, HeadingElement, HeadingProps, HeadingSize };
|
|
18
|
+
export { Heading, HeadingElement, HeadingProps, HeadingSize, TypographyLineClamp, TypographyWeight, TypographyWidth };
|
|
12
19
|
//# sourceMappingURL=heading.d.ts.map
|
|
@@ -11,13 +11,19 @@ const defaultSizeByElement = {
|
|
|
11
11
|
h5: "sm",
|
|
12
12
|
h6: "xs"
|
|
13
13
|
};
|
|
14
|
-
const Heading = forwardRef(function Heading({ as = "h2", className, size, ...props }, ref) {
|
|
14
|
+
const Heading = forwardRef(function Heading({ as = "h2", className, lineClamp, size, truncate = false, weight, width = "auto", ...props }, ref) {
|
|
15
15
|
const Component = as;
|
|
16
16
|
const resolvedSize = size ?? defaultSizeByElement[as];
|
|
17
17
|
return /* @__PURE__ */ jsx(Component, {
|
|
18
18
|
...props,
|
|
19
19
|
ref,
|
|
20
|
-
className: cx(heading({
|
|
20
|
+
className: cx(heading({
|
|
21
|
+
lineClamp: lineClamp ? String(lineClamp) : void 0,
|
|
22
|
+
size: resolvedSize,
|
|
23
|
+
truncate,
|
|
24
|
+
weight,
|
|
25
|
+
width
|
|
26
|
+
}), className),
|
|
21
27
|
"data-jaci-component": "heading",
|
|
22
28
|
"data-slot": "heading"
|
|
23
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.js","names":[],"sources":["../../../src/components/typography/heading.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementType, ReactElement, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { heading } from \"../../styled-system/recipes\";\n\nexport type HeadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type HeadingElement = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\nconst defaultSizeByElement: Record<HeadingElement, HeadingSize> = {\n h1: \"2xl\",\n h2: \"xl\",\n h3: \"lg\",\n h4: \"md\",\n h5: \"sm\",\n h6: \"xs\",\n};\n\nexport interface HeadingProps extends Omit<ComponentPropsWithoutRef<\"h2\">, \"color\"> {\n as?: HeadingElement;\n size?: HeadingSize;\n}\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function Heading(\n { as = \"h2\", className, size, ...props },\n ref,\n) {\n const Component = as as ElementType;\n const resolvedSize = size ?? defaultSizeByElement[as];\n\n return (\n <Component\n {...props}\n ref={ref as Ref<HTMLElement>}\n className={cx(heading({ size: resolvedSize
|
|
1
|
+
{"version":3,"file":"heading.js","names":[],"sources":["../../../src/components/typography/heading.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementType, ReactElement, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { heading } from \"../../styled-system/recipes\";\n\nexport type HeadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type HeadingElement = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\nexport type TypographyWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type TypographyWidth = \"auto\" | \"fit\" | \"full\";\nexport type TypographyLineClamp = 1 | 2 | 3 | 4;\n\nconst defaultSizeByElement: Record<HeadingElement, HeadingSize> = {\n h1: \"2xl\",\n h2: \"xl\",\n h3: \"lg\",\n h4: \"md\",\n h5: \"sm\",\n h6: \"xs\",\n};\n\nexport interface HeadingProps extends Omit<ComponentPropsWithoutRef<\"h2\">, \"color\"> {\n as?: HeadingElement;\n size?: HeadingSize;\n weight?: TypographyWeight;\n truncate?: boolean;\n lineClamp?: TypographyLineClamp;\n width?: TypographyWidth;\n}\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function Heading(\n { as = \"h2\", className, lineClamp, size, truncate = false, weight, width = \"auto\", ...props },\n ref,\n) {\n const Component = as as ElementType;\n const resolvedSize = size ?? defaultSizeByElement[as];\n\n return (\n <Component\n {...props}\n ref={ref as Ref<HTMLElement>}\n className={cx(\n heading({\n lineClamp: lineClamp ? (String(lineClamp) as \"1\" | \"2\" | \"3\" | \"4\") : undefined,\n size: resolvedSize,\n truncate,\n weight,\n width,\n }),\n className,\n )}\n data-jaci-component=\"heading\"\n data-slot=\"heading\"\n />\n ) as ReactElement;\n});\n"],"mappings":";;;;;AAYA,MAAM,uBAA4D;CAChE,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAWA,MAAa,UAAU,WAA6C,SAAS,QAC3E,EAAE,KAAK,MAAM,WAAW,WAAW,MAAM,WAAW,OAAO,QAAQ,QAAQ,QAAQ,GAAG,SACtF,KACA;CACA,MAAM,YAAY;CAClB,MAAM,eAAe,QAAQ,qBAAqB;CAElD,OACE,oBAAC,WAAD;EACE,GAAI;EACC;EACL,WAAW,GACT,QAAQ;GACN,WAAW,YAAa,OAAO,SAAS,IAA8B,KAAA;GACtE,MAAM;GACN;GACA;GACA;EACF,CAAC,GACD,SACF;EACA,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Heading, HeadingElement, HeadingProps, HeadingSize } from "./heading.cjs";
|
|
1
|
+
import { Heading, HeadingElement, HeadingProps, HeadingSize, TypographyLineClamp, TypographyWeight, TypographyWidth } from "./heading.cjs";
|
|
2
2
|
import { Link, LinkProps } from "./link.cjs";
|
|
3
3
|
import { Paragraph, ParagraphProps } from "./paragraph.cjs";
|
|
4
4
|
import { Text, TextElement, TextProps, TextSize, TextTone } from "./text.cjs";
|
|
5
|
-
export { Heading, type HeadingElement, type HeadingProps, type HeadingSize, Link, type LinkProps, Paragraph, type ParagraphProps, Text, type TextElement, type TextProps, type TextSize, type TextTone };
|
|
5
|
+
export { Heading, type HeadingElement, type HeadingProps, type HeadingSize, Link, type LinkProps, Paragraph, type ParagraphProps, Text, type TextElement, type TextProps, type TextSize, type TextTone, type TypographyLineClamp, type TypographyWeight, type TypographyWidth };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Heading, HeadingElement, HeadingProps, HeadingSize } from "./heading.js";
|
|
1
|
+
import { Heading, HeadingElement, HeadingProps, HeadingSize, TypographyLineClamp, TypographyWeight, TypographyWidth } from "./heading.js";
|
|
2
2
|
import { Link, LinkProps } from "./link.js";
|
|
3
3
|
import { Paragraph, ParagraphProps } from "./paragraph.js";
|
|
4
4
|
import { Text, TextElement, TextProps, TextSize, TextTone } from "./text.js";
|
|
5
|
-
export { Heading, type HeadingElement, type HeadingProps, type HeadingSize, Link, type LinkProps, Paragraph, type ParagraphProps, Text, type TextElement, type TextProps, type TextSize, type TextTone };
|
|
5
|
+
export { Heading, type HeadingElement, type HeadingProps, type HeadingSize, Link, type LinkProps, Paragraph, type ParagraphProps, Text, type TextElement, type TextProps, type TextSize, type TextTone, type TypographyLineClamp, type TypographyWeight, type TypographyWidth };
|
|
@@ -3,11 +3,16 @@ const require_paragraph = require("../../styled-system/recipes/paragraph.cjs");
|
|
|
3
3
|
let react = require("react");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
5
|
//#region src/components/typography/paragraph.tsx
|
|
6
|
-
const Paragraph = (0, react.forwardRef)(function Paragraph({ className, ...props }, ref) {
|
|
6
|
+
const Paragraph = (0, react.forwardRef)(function Paragraph({ className, lineClamp, truncate = false, weight, width = "auto", ...props }, ref) {
|
|
7
7
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8
8
|
...props,
|
|
9
9
|
ref,
|
|
10
|
-
className: require_cx.cx(require_paragraph.paragraph(
|
|
10
|
+
className: require_cx.cx(require_paragraph.paragraph({
|
|
11
|
+
lineClamp: lineClamp ? String(lineClamp) : void 0,
|
|
12
|
+
truncate,
|
|
13
|
+
weight,
|
|
14
|
+
width
|
|
15
|
+
}), className),
|
|
11
16
|
"data-jaci-component": "paragraph",
|
|
12
17
|
"data-slot": "paragraph"
|
|
13
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.cjs","names":["cx","paragraph"],"sources":["../../../src/components/typography/paragraph.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { paragraph } from \"../../styled-system/recipes\";\n\nexport
|
|
1
|
+
{"version":3,"file":"paragraph.cjs","names":["cx","paragraph"],"sources":["../../../src/components/typography/paragraph.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { paragraph } from \"../../styled-system/recipes\";\nimport type { TypographyLineClamp, TypographyWeight, TypographyWidth } from \"./heading\";\n\nexport interface ParagraphProps extends ComponentPropsWithoutRef<\"p\"> {\n weight?: TypographyWeight;\n truncate?: boolean;\n lineClamp?: TypographyLineClamp;\n width?: TypographyWidth;\n}\n\nexport const Paragraph = forwardRef<HTMLParagraphElement, ParagraphProps>(function Paragraph(\n { className, lineClamp, truncate = false, weight, width = \"auto\", ...props },\n ref,\n) {\n return (\n <p\n {...props}\n ref={ref}\n className={cx(\n paragraph({\n lineClamp: lineClamp ? (String(lineClamp) as \"1\" | \"2\" | \"3\" | \"4\") : undefined,\n truncate,\n weight,\n width,\n }),\n className,\n )}\n data-jaci-component=\"paragraph\"\n data-slot=\"paragraph\"\n />\n );\n});\n"],"mappings":";;;;;AAcA,MAAa,aAAA,GAAA,MAAA,WAAA,CAA6D,SAAS,UACjF,EAAE,WAAW,WAAW,WAAW,OAAO,QAAQ,QAAQ,QAAQ,GAAG,SACrE,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACE,GAAI;EACC;EACL,WAAWA,WAAAA,GACTC,kBAAAA,UAAU;GACR,WAAW,YAAa,OAAO,SAAS,IAA8B,KAAA;GACtE;GACA;GACA;EACF,CAAC,GACD,SACF;EACA,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CAAC"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { TypographyLineClamp, TypographyWeight, TypographyWidth } from "./heading.cjs";
|
|
1
2
|
import { ComponentPropsWithoutRef } from "react";
|
|
2
3
|
//#region src/components/typography/paragraph.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
interface ParagraphProps extends ComponentPropsWithoutRef<"p"> {
|
|
5
|
+
weight?: TypographyWeight;
|
|
6
|
+
truncate?: boolean;
|
|
7
|
+
lineClamp?: TypographyLineClamp;
|
|
8
|
+
width?: TypographyWidth;
|
|
9
|
+
}
|
|
10
|
+
declare const Paragraph: import("react").ForwardRefExoticComponent<ParagraphProps & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
5
11
|
//#endregion
|
|
6
12
|
export { Paragraph, ParagraphProps };
|
|
7
13
|
//# sourceMappingURL=paragraph.d.cts.map
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { TypographyLineClamp, TypographyWeight, TypographyWidth } from "./heading.js";
|
|
1
2
|
import { ComponentPropsWithoutRef } from "react";
|
|
2
3
|
//#region src/components/typography/paragraph.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
interface ParagraphProps extends ComponentPropsWithoutRef<"p"> {
|
|
5
|
+
weight?: TypographyWeight;
|
|
6
|
+
truncate?: boolean;
|
|
7
|
+
lineClamp?: TypographyLineClamp;
|
|
8
|
+
width?: TypographyWidth;
|
|
9
|
+
}
|
|
10
|
+
declare const Paragraph: import("react").ForwardRefExoticComponent<ParagraphProps & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
5
11
|
//#endregion
|
|
6
12
|
export { Paragraph, ParagraphProps };
|
|
7
13
|
//# sourceMappingURL=paragraph.d.ts.map
|
|
@@ -3,11 +3,16 @@ import { paragraph } from "../../styled-system/recipes/paragraph.js";
|
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/typography/paragraph.tsx
|
|
6
|
-
const Paragraph = forwardRef(function Paragraph({ className, ...props }, ref) {
|
|
6
|
+
const Paragraph = forwardRef(function Paragraph({ className, lineClamp, truncate = false, weight, width = "auto", ...props }, ref) {
|
|
7
7
|
return /* @__PURE__ */ jsx("p", {
|
|
8
8
|
...props,
|
|
9
9
|
ref,
|
|
10
|
-
className: cx(paragraph(
|
|
10
|
+
className: cx(paragraph({
|
|
11
|
+
lineClamp: lineClamp ? String(lineClamp) : void 0,
|
|
12
|
+
truncate,
|
|
13
|
+
weight,
|
|
14
|
+
width
|
|
15
|
+
}), className),
|
|
11
16
|
"data-jaci-component": "paragraph",
|
|
12
17
|
"data-slot": "paragraph"
|
|
13
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.js","names":[],"sources":["../../../src/components/typography/paragraph.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { paragraph } from \"../../styled-system/recipes\";\n\nexport
|
|
1
|
+
{"version":3,"file":"paragraph.js","names":[],"sources":["../../../src/components/typography/paragraph.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { paragraph } from \"../../styled-system/recipes\";\nimport type { TypographyLineClamp, TypographyWeight, TypographyWidth } from \"./heading\";\n\nexport interface ParagraphProps extends ComponentPropsWithoutRef<\"p\"> {\n weight?: TypographyWeight;\n truncate?: boolean;\n lineClamp?: TypographyLineClamp;\n width?: TypographyWidth;\n}\n\nexport const Paragraph = forwardRef<HTMLParagraphElement, ParagraphProps>(function Paragraph(\n { className, lineClamp, truncate = false, weight, width = \"auto\", ...props },\n ref,\n) {\n return (\n <p\n {...props}\n ref={ref}\n className={cx(\n paragraph({\n lineClamp: lineClamp ? (String(lineClamp) as \"1\" | \"2\" | \"3\" | \"4\") : undefined,\n truncate,\n weight,\n width,\n }),\n className,\n )}\n data-jaci-component=\"paragraph\"\n data-slot=\"paragraph\"\n />\n );\n});\n"],"mappings":";;;;;AAcA,MAAa,YAAY,WAAiD,SAAS,UACjF,EAAE,WAAW,WAAW,WAAW,OAAO,QAAQ,QAAQ,QAAQ,GAAG,SACrE,KACA;CACA,OACE,oBAAC,KAAD;EACE,GAAI;EACC;EACL,WAAW,GACT,UAAU;GACR,WAAW,YAAa,OAAO,SAAS,IAA8B,KAAA;GACtE;GACA;GACA;EACF,CAAC,GACD,SACF;EACA,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CAAC"}
|