@lucasromero/matrix-ui 0.9.0 → 0.11.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 +21 -0
- package/README.md +1 -0
- package/dist/components/AreaChart/AreaChart.d.ts +3 -0
- package/dist/components/AreaChart/AreaChart.js +14 -0
- package/dist/components/AreaChart/index.d.ts +1 -0
- package/dist/components/BarChart/BarChart.d.ts +3 -0
- package/dist/components/BarChart/BarChart.js +134 -0
- package/dist/components/BarChart/index.d.ts +1 -0
- package/dist/components/Chart/ChartAxes.d.ts +2 -0
- package/dist/components/Chart/ChartAxes.js +28 -0
- package/dist/components/Chart/ChartFrame.d.ts +7 -0
- package/dist/components/Chart/ChartFrame.js +108 -0
- package/dist/components/Chart/ChartPatterns.d.ts +3 -0
- package/dist/components/Chart/ChartPatterns.js +27 -0
- package/dist/components/Chart/ChartPlot.d.ts +2 -0
- package/dist/components/Chart/ChartPlot.js +101 -0
- package/dist/components/Chart/LinearChart.d.ts +3 -0
- package/dist/components/Chart/LinearChart.js +133 -0
- package/dist/components/Chart/RadialChart.d.ts +20 -0
- package/dist/components/Chart/RadialChart.js +112 -0
- package/dist/components/Chart/index.module.js +38 -0
- package/dist/components/Chart/math.d.ts +19 -0
- package/dist/components/Chart/math.js +82 -0
- package/dist/components/Chart/useChartSize.d.ts +3 -0
- package/dist/components/Chart/useChartSize.js +24 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +2 -0
- package/dist/components/CodeBlock/CodeBlock.js +37 -29
- package/dist/components/CodeBlock/HighlightedCode.d.ts +7 -0
- package/dist/components/CodeBlock/HighlightedCode.js +26 -0
- package/dist/components/CodeBlock/highlight.d.ts +2 -0
- package/dist/components/CodeBlock/highlight.js +104 -0
- package/dist/components/CodeBlock/index.module.js +23 -3
- package/dist/components/DonutChart/DonutChart.d.ts +19 -0
- package/dist/components/DonutChart/DonutChart.js +12 -0
- package/dist/components/DonutChart/index.d.ts +1 -0
- package/dist/components/LineChart/LineChart.d.ts +3 -0
- package/dist/components/LineChart/LineChart.js +14 -0
- package/dist/components/LineChart/index.d.ts +1 -0
- package/dist/components/PieChart/PieChart.d.ts +17 -0
- package/dist/components/PieChart/PieChart.js +12 -0
- package/dist/components/PieChart/index.d.ts +1 -0
- package/dist/components/Sparkline/Sparkline.d.ts +7 -0
- package/dist/components/Sparkline/Sparkline.js +56 -0
- package/dist/components/Sparkline/index.d.ts +1 -0
- package/dist/components/Sparkline/index.module.js +9 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +66 -60
- package/dist/styles.css +1 -1
- package/dist/types/areaChartType.d.ts +5 -0
- package/dist/types/barChartType.d.ts +8 -0
- package/dist/types/chartType.d.ts +156 -0
- package/dist/types/codeBlockType.d.ts +20 -0
- package/dist/types/donutChartType.d.ts +6 -0
- package/dist/types/index.d.ts +8 -1
- package/dist/types/lineChartType.d.ts +5 -0
- package/dist/types/pieChartType.d.ts +2 -0
- package/dist/types/sparklineType.d.ts +14 -0
- package/package.json +3 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { linePath as e, seriesColor as t, splitAtGaps as n, toNumber as r } from "../Chart/math.js";
|
|
2
|
+
import i from "./index.module.js";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
// src/components/Sparkline/Sparkline.tsx
|
|
6
|
+
var c = 100, l = a(({ data: a, label: l, color: u = 1, area: d = !1, height: f = 32, className: p, style: m, ...h }, g) => {
|
|
7
|
+
let _ = a.map(r), v = _.filter((e) => e !== null), y = Math.min(...v), b = Math.max(...v) - y, x = _.map((e, t) => e === null ? null : {
|
|
8
|
+
x: _.length === 1 ? c / 2 : t * c / (_.length - 1),
|
|
9
|
+
y: b === 0 ? f / 2 : f - 4 - (e - y) / b * (f - 8)
|
|
10
|
+
}), S = n(x), C = S[S.length - 1]?.[S[S.length - 1].length - 1];
|
|
11
|
+
return /* @__PURE__ */ o("span", {
|
|
12
|
+
...h,
|
|
13
|
+
ref: g,
|
|
14
|
+
role: "img",
|
|
15
|
+
"aria-label": l,
|
|
16
|
+
className: [i.sparkline, p].filter(Boolean).join(" "),
|
|
17
|
+
style: {
|
|
18
|
+
height: f,
|
|
19
|
+
color: t(u),
|
|
20
|
+
...m
|
|
21
|
+
},
|
|
22
|
+
children: /* @__PURE__ */ s("svg", {
|
|
23
|
+
className: i.svg,
|
|
24
|
+
viewBox: `0 0 ${c} ${f}`,
|
|
25
|
+
preserveAspectRatio: "none",
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
focusable: "false",
|
|
28
|
+
children: [
|
|
29
|
+
d && S.map((t, n) => /* @__PURE__ */ o("path", {
|
|
30
|
+
className: i.area,
|
|
31
|
+
d: `${e([
|
|
32
|
+
...t,
|
|
33
|
+
{
|
|
34
|
+
x: t[t.length - 1].x,
|
|
35
|
+
y: f
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
x: t[0].x,
|
|
39
|
+
y: f
|
|
40
|
+
}
|
|
41
|
+
])}Z`
|
|
42
|
+
}, n)),
|
|
43
|
+
S.map((t, n) => /* @__PURE__ */ o("path", {
|
|
44
|
+
className: i.line,
|
|
45
|
+
d: e(t)
|
|
46
|
+
}, n)),
|
|
47
|
+
C && /* @__PURE__ */ o("path", {
|
|
48
|
+
className: i.end,
|
|
49
|
+
d: `M${C.x},${C.y}h0`
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
l.displayName = "Sparkline";
|
|
56
|
+
export { l as Sparkline };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Sparkline } from "./Sparkline.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/components/Sparkline/index.module.scss
|
|
2
|
+
var e = "matrix-sparkline-sparkline", t = "matrix-sparkline-svg", n = "matrix-sparkline-line", r = "matrix-sparkline-end", i = "matrix-sparkline-area", a = {
|
|
3
|
+
sparkline: e,
|
|
4
|
+
svg: t,
|
|
5
|
+
line: n,
|
|
6
|
+
end: r,
|
|
7
|
+
area: i
|
|
8
|
+
};
|
|
9
|
+
export { i as area, a as default, r as end, n as line, e as sparkline, t as svg };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,16 @@ export { Accordion } from "./components/Accordion/index.js";
|
|
|
2
2
|
export type { AccordionItem, AccordionProps } from "./types/index.js";
|
|
3
3
|
export { Alert } from "./components/Alert/index.js";
|
|
4
4
|
export type { AlertProps, AlertVariant } from "./types/index.js";
|
|
5
|
+
export { AreaChart } from "./components/AreaChart/index.js";
|
|
6
|
+
export type { AreaChartProps, ChartColor, ChartSeries, ChartSlice } from "./types/index.js";
|
|
5
7
|
export { Avatar } from "./components/Avatar/index.js";
|
|
6
8
|
export type { AvatarProps, AvatarSize } from "./types/index.js";
|
|
7
9
|
export { AvatarGroup } from "./components/AvatarGroup/index.js";
|
|
8
10
|
export type { AvatarGroupItem, AvatarGroupProps } from "./types/index.js";
|
|
9
11
|
export { Badge } from "./components/Badge/index.js";
|
|
10
12
|
export type { BadgeProps, BadgeSize, BadgeVariant } from "./types/index.js";
|
|
13
|
+
export { BarChart } from "./components/BarChart/index.js";
|
|
14
|
+
export type { BarChartOrientation, BarChartProps } from "./types/index.js";
|
|
11
15
|
export { Breadcrumbs } from "./components/Breadcrumbs/index.js";
|
|
12
16
|
export type { BreadcrumbItem, BreadcrumbLinkProps, BreadcrumbsProps } from "./types/index.js";
|
|
13
17
|
export { Button, ButtonLink } from "./components/Button/index.js";
|
|
@@ -19,7 +23,7 @@ export type { CheckboxProps } from "./types/index.js";
|
|
|
19
23
|
export { Chip } from "./components/Chip/index.js";
|
|
20
24
|
export type { ChipProps, ChipSize } from "./types/index.js";
|
|
21
25
|
export { CodeBlock } from "./components/CodeBlock/index.js";
|
|
22
|
-
export type { CodeBlockProps } from "./types/index.js";
|
|
26
|
+
export type { CodeBlockColor, CodeBlockLanguage, CodeBlockProps } from "./types/index.js";
|
|
23
27
|
export { Combobox } from "./components/Combobox/index.js";
|
|
24
28
|
export type { ComboboxOption, ComboboxProps } from "./types/index.js";
|
|
25
29
|
export { Container } from "./components/Container/index.js";
|
|
@@ -32,6 +36,8 @@ export { Dialog } from "./components/Dialog/index.js";
|
|
|
32
36
|
export type { DialogCloseReason, DialogProps, DialogSize } from "./types/index.js";
|
|
33
37
|
export { Divider } from "./components/Divider/index.js";
|
|
34
38
|
export type { DividerOrientation, DividerProps } from "./types/index.js";
|
|
39
|
+
export { DonutChart } from "./components/DonutChart/index.js";
|
|
40
|
+
export type { DonutChartProps } from "./types/index.js";
|
|
35
41
|
export { Drawer } from "./components/Drawer/index.js";
|
|
36
42
|
export type { DrawerProps, DrawerSide } from "./types/index.js";
|
|
37
43
|
export { DropdownMenu } from "./components/DropdownMenu/index.js";
|
|
@@ -48,6 +54,8 @@ export { Inline } from "./components/Inline/index.js";
|
|
|
48
54
|
export type { InlineAlign, InlineJustify, InlineProps } from "./types/index.js";
|
|
49
55
|
export { Input } from "./components/Input/index.js";
|
|
50
56
|
export type { InputProps } from "./types/index.js";
|
|
57
|
+
export { LineChart } from "./components/LineChart/index.js";
|
|
58
|
+
export type { LineChartProps } from "./types/index.js";
|
|
51
59
|
export { Link } from "./components/Link/index.js";
|
|
52
60
|
export type { LinkProps } from "./types/index.js";
|
|
53
61
|
export { Navigation, NavigationMenu } from "./components/Navigation/index.js";
|
|
@@ -64,6 +72,8 @@ export { PasswordInput } from "./components/PasswordInput/index.js";
|
|
|
64
72
|
export type { PasswordInputProps } from "./types/index.js";
|
|
65
73
|
export { Phone, formatPhoneNumber } from "./components/Phone/index.js";
|
|
66
74
|
export type { PhoneCountryCode, PhoneProps } from "./types/index.js";
|
|
75
|
+
export { PieChart } from "./components/PieChart/index.js";
|
|
76
|
+
export type { PieChartProps } from "./types/index.js";
|
|
67
77
|
export { Popover } from "./components/Popover/index.js";
|
|
68
78
|
export type { PopoverAlign, PopoverProps, PopoverSide, PopoverTriggerProps, } from "./types/index.js";
|
|
69
79
|
export { Progress } from "./components/Progress/index.js";
|
|
@@ -82,6 +92,8 @@ export { Skeleton } from "./components/Skeleton/index.js";
|
|
|
82
92
|
export type { SkeletonProps, SkeletonVariant } from "./types/index.js";
|
|
83
93
|
export { Slider } from "./components/Slider/index.js";
|
|
84
94
|
export type { SliderProps } from "./types/index.js";
|
|
95
|
+
export { Sparkline } from "./components/Sparkline/index.js";
|
|
96
|
+
export type { SparklineProps } from "./types/index.js";
|
|
85
97
|
export { Spinner } from "./components/Spinner/index.js";
|
|
86
98
|
export type { SpinnerProps, SpinnerSize } from "./types/index.js";
|
|
87
99
|
export { Stack } from "./components/Stack/index.js";
|
package/dist/index.js
CHANGED
|
@@ -1,63 +1,69 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { Accordion as e } from "./components/Accordion/Accordion.js";
|
|
3
3
|
import { Alert as t } from "./components/Alert/Alert.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
|
|
4
|
+
import { AreaChart as n } from "./components/AreaChart/AreaChart.js";
|
|
5
|
+
import { Avatar as r } from "./components/Avatar/Avatar.js";
|
|
6
|
+
import { AvatarGroup as i } from "./components/AvatarGroup/AvatarGroup.js";
|
|
7
|
+
import { Badge as a } from "./components/Badge/Badge.js";
|
|
8
|
+
import { BarChart as o } from "./components/BarChart/BarChart.js";
|
|
9
|
+
import { Breadcrumbs as s } from "./components/Breadcrumbs/Breadcrumbs.js";
|
|
10
|
+
import { Button as c } from "./components/Button/Button.js";
|
|
11
|
+
import { ButtonLink as l } from "./components/Button/ButtonLink.js";
|
|
12
|
+
import { Card as u } from "./components/Card/Card.js";
|
|
13
|
+
import { Checkbox as d } from "./components/Checkbox/Checkbox.js";
|
|
14
|
+
import { Chip as f } from "./components/Chip/Chip.js";
|
|
15
|
+
import { CodeBlock as p } from "./components/CodeBlock/CodeBlock.js";
|
|
16
|
+
import { Combobox as m } from "./components/Combobox/Combobox.js";
|
|
17
|
+
import { Container as h } from "./components/Container/Container.js";
|
|
18
|
+
import { DateInput as g } from "./components/DateInput/DateInput.js";
|
|
19
|
+
import { DescriptionList as _ } from "./components/DescriptionList/DescriptionList.js";
|
|
20
|
+
import { Dialog as v } from "./components/Dialog/Dialog.js";
|
|
21
|
+
import { Divider as y } from "./components/Divider/Divider.js";
|
|
22
|
+
import { DonutChart as b } from "./components/DonutChart/DonutChart.js";
|
|
23
|
+
import { Drawer as x } from "./components/Drawer/Drawer.js";
|
|
24
|
+
import { DropdownMenu as S } from "./components/DropdownMenu/DropdownMenu.js";
|
|
25
|
+
import { EmptyState as C } from "./components/EmptyState/EmptyState.js";
|
|
26
|
+
import { FormField as w } from "./components/FormField/FormField.js";
|
|
27
|
+
import { FileUpload as T } from "./components/FileUpload/FileUpload.js";
|
|
28
|
+
import { Heading as E } from "./components/Heading/Heading.js";
|
|
29
|
+
import { Inline as D } from "./components/Inline/Inline.js";
|
|
30
|
+
import { Input as O } from "./components/Input/Input.js";
|
|
31
|
+
import { LineChart as k } from "./components/LineChart/LineChart.js";
|
|
32
|
+
import { Link as A } from "./components/Link/Link.js";
|
|
33
|
+
import { Navigation as j } from "./components/Navigation/Navigation.js";
|
|
34
|
+
import { NavigationMenu as M } from "./components/Navigation/NavigationMenu.js";
|
|
35
|
+
import { NumberInput as N } from "./components/NumberInput/NumberInput.js";
|
|
36
|
+
import { OtpInput as P } from "./components/OtpInput/OtpInput.js";
|
|
37
|
+
import { PageHeader as F } from "./components/PageHeader/PageHeader.js";
|
|
38
|
+
import { Pagination as I } from "./components/Pagination/Pagination.js";
|
|
39
|
+
import { PasswordInput as L } from "./components/PasswordInput/PasswordInput.js";
|
|
40
|
+
import { Phone as R } from "./components/Phone/Phone.js";
|
|
41
|
+
import { formatPhoneNumber as z } from "./components/Phone/helpers/formatPhoneNumber.js";
|
|
42
|
+
import { PieChart as B } from "./components/PieChart/PieChart.js";
|
|
43
|
+
import { Popover as V } from "./components/Popover/Popover.js";
|
|
44
|
+
import { Progress as H } from "./components/Progress/Progress.js";
|
|
45
|
+
import { Radio as U } from "./components/Radio/Radio.js";
|
|
46
|
+
import { RelatedLinks as W } from "./components/RelatedLinks/RelatedLinks.js";
|
|
47
|
+
import { SearchInput as G } from "./components/SearchInput/SearchInput.js";
|
|
48
|
+
import { Select as K } from "./components/Select/Select.js";
|
|
49
|
+
import { SideNav as q } from "./components/SideNav/SideNav.js";
|
|
50
|
+
import { Skeleton as J } from "./components/Skeleton/Skeleton.js";
|
|
51
|
+
import { Slider as Y } from "./components/Slider/Slider.js";
|
|
52
|
+
import { Sparkline as X } from "./components/Sparkline/Sparkline.js";
|
|
53
|
+
import { Spinner as Z } from "./components/Spinner/Spinner.js";
|
|
54
|
+
import { Stack as Q } from "./components/Stack/Stack.js";
|
|
55
|
+
import { Stepper as $ } from "./components/Stepper/Stepper.js";
|
|
56
|
+
import { Switch as ee } from "./components/Switch/Switch.js";
|
|
57
|
+
import { Table as te } from "./components/Table/Table.js";
|
|
58
|
+
import { Tabs as ne } from "./components/Tabs/Tabs.js";
|
|
59
|
+
import { Text as re } from "./components/Text/Text.js";
|
|
60
|
+
import { TextTag as ie } from "./components/TextTag/TextTag.js";
|
|
61
|
+
import { Textarea as ae } from "./components/Textarea/Textarea.js";
|
|
62
|
+
import { TimeInput as oe } from "./components/TimeInput/TimeInput.js";
|
|
63
|
+
import { Toast as se } from "./components/Toast/Toast.js";
|
|
64
|
+
import { Toggle as ce } from "./components/Toggle/Toggle.js";
|
|
65
|
+
import { Tooltip as le } from "./components/Tooltip/Tooltip.js";
|
|
66
|
+
import { VisuallyHidden as ue } from "./components/VisuallyHidden/VisuallyHidden.js";
|
|
67
|
+
import { useDisclosure as de } from "./hooks/useDisclosure.js";
|
|
68
|
+
import { useMediaQuery as fe } from "./hooks/useMediaQuery.js";
|
|
69
|
+
export { e as Accordion, t as Alert, n as AreaChart, r as Avatar, i as AvatarGroup, a as Badge, o as BarChart, s as Breadcrumbs, c as Button, l as ButtonLink, u as Card, d as Checkbox, f as Chip, p as CodeBlock, m as Combobox, h as Container, g as DateInput, _ as DescriptionList, v as Dialog, y as Divider, b as DonutChart, x as Drawer, S as DropdownMenu, C as EmptyState, T as FileUpload, w as FormField, E as Heading, D as Inline, O as Input, k as LineChart, A as Link, j as Navigation, M as NavigationMenu, N as NumberInput, P as OtpInput, F as PageHeader, I as Pagination, L as PasswordInput, R as Phone, B as PieChart, V as Popover, H as Progress, U as Radio, W as RelatedLinks, G as SearchInput, K as Select, q as SideNav, J as Skeleton, Y as Slider, X as Sparkline, Z as Spinner, Q as Stack, $ as Stepper, ee as Switch, te as Table, ne as Tabs, re as Text, ie as TextTag, ae as Textarea, oe as TimeInput, se as Toast, ce as Toggle, le as Tooltip, ue as VisuallyHidden, z as formatPhoneNumber, de as useDisclosure, fe as useMediaQuery };
|