@orianatech/pire 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/dist/components/data/BarChart.d.cts +32 -0
- package/dist/components/data/BarChart.d.ts +33 -0
- package/dist/components/data/BarChart.d.ts.map +1 -0
- package/dist/components/data/ChartFrame.d.cts +62 -0
- package/dist/components/data/ChartFrame.d.ts +63 -0
- package/dist/components/data/ChartFrame.d.ts.map +1 -0
- package/dist/components/data/DonutChart.d.cts +26 -0
- package/dist/components/data/DonutChart.d.ts +27 -0
- package/dist/components/data/DonutChart.d.ts.map +1 -0
- package/dist/components/data/LineChart.d.cts +29 -0
- package/dist/components/data/LineChart.d.ts +30 -0
- package/dist/components/data/LineChart.d.ts.map +1 -0
- package/dist/components/data/chartGeometry.d.cts +67 -0
- package/dist/components/data/chartGeometry.d.ts +68 -0
- package/dist/components/data/chartGeometry.d.ts.map +1 -0
- package/dist/components/forms/DateRangePicker.d.cts +55 -0
- package/dist/components/forms/DateRangePicker.d.ts +56 -0
- package/dist/components/forms/DateRangePicker.d.ts.map +1 -0
- package/dist/components/forms/Input.d.cts +5 -0
- package/dist/components/forms/Input.d.ts +5 -0
- package/dist/components/forms/Input.d.ts.map +1 -1
- package/dist/components.css +108 -0
- package/dist/i18n/messages.d.cts +8 -0
- package/dist/i18n/messages.d.ts +8 -0
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/index.cjs +913 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +901 -266
- package/dist/index.js.map +1 -1
- package/dist/tokens/colors.css +36 -3
- package/dist/tokens/themes.css +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.cjs';
|
|
3
|
+
export interface BarChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* `horizontal` puts categories down the side, which is what long ERP labels need — product
|
|
6
|
+
* names and account descriptions do not fit under a vertical bar without turning sideways.
|
|
7
|
+
* Use `vertical` when the categories are periods and reading left-to-right means time.
|
|
8
|
+
*/
|
|
9
|
+
orientation?: 'horizontal' | 'vertical';
|
|
10
|
+
/**
|
|
11
|
+
* Stack the series into one bar per category, for parts of a total.
|
|
12
|
+
*
|
|
13
|
+
* Only the first segment and the total are easy to compare across categories, because the
|
|
14
|
+
* middle segments start at different offsets. If the comparison matters more than the total,
|
|
15
|
+
* leave this off and let the bars sit side by side.
|
|
16
|
+
*/
|
|
17
|
+
stacked?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Print each value beside its bar. Defaults on for a single series — where the chart is a
|
|
20
|
+
* ranking and the number is half the answer — and off beyond that, where a label per bar
|
|
21
|
+
* turns into noise. The tooltip and the data table always carry every value.
|
|
22
|
+
*/
|
|
23
|
+
showValues?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Magnitude and ranking — how big, and in what order.
|
|
27
|
+
*
|
|
28
|
+
* Laid out in HTML rather than SVG so category labels are real text: they wrap, truncate and
|
|
29
|
+
* inherit type tokens, none of which survives a scaled `viewBox`. The bar axis always starts at
|
|
30
|
+
* zero, since a bar encodes length, and a truncated axis overstates the difference.
|
|
31
|
+
*/
|
|
32
|
+
export declare function BarChart({ categories, series: rawSeries, title, description, formatValue, height, emptyState, showDataTable, orientation, stacked, showValues, className, style, ...rest }: BarChartProps): React.JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.js';
|
|
3
|
+
export interface BarChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* `horizontal` puts categories down the side, which is what long ERP labels need — product
|
|
6
|
+
* names and account descriptions do not fit under a vertical bar without turning sideways.
|
|
7
|
+
* Use `vertical` when the categories are periods and reading left-to-right means time.
|
|
8
|
+
*/
|
|
9
|
+
orientation?: 'horizontal' | 'vertical';
|
|
10
|
+
/**
|
|
11
|
+
* Stack the series into one bar per category, for parts of a total.
|
|
12
|
+
*
|
|
13
|
+
* Only the first segment and the total are easy to compare across categories, because the
|
|
14
|
+
* middle segments start at different offsets. If the comparison matters more than the total,
|
|
15
|
+
* leave this off and let the bars sit side by side.
|
|
16
|
+
*/
|
|
17
|
+
stacked?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Print each value beside its bar. Defaults on for a single series — where the chart is a
|
|
20
|
+
* ranking and the number is half the answer — and off beyond that, where a label per bar
|
|
21
|
+
* turns into noise. The tooltip and the data table always carry every value.
|
|
22
|
+
*/
|
|
23
|
+
showValues?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Magnitude and ranking — how big, and in what order.
|
|
27
|
+
*
|
|
28
|
+
* Laid out in HTML rather than SVG so category labels are real text: they wrap, truncate and
|
|
29
|
+
* inherit type tokens, none of which survives a scaled `viewBox`. The bar axis always starts at
|
|
30
|
+
* zero, since a bar encodes length, and a truncated axis overstates the difference.
|
|
31
|
+
*/
|
|
32
|
+
export declare function BarChart({ categories, series: rawSeries, title, description, formatValue, height, emptyState, showDataTable, orientation, stacked, showValues, className, style, ...rest }: BarChartProps): React.JSX.Element;
|
|
33
|
+
//# sourceMappingURL=BarChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/components/data/BarChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQnD,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACvB,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,WAAgC,EACnF,MAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAA0B,EAAE,OAAe,EACpF,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EACtC,EAAE,aAAa,qBAoFf"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ChartSeries } from './chartGeometry.cjs';
|
|
3
|
+
/** Props every chart shares. Each chart adds its own encoding options on top. */
|
|
4
|
+
export interface ChartBaseProps {
|
|
5
|
+
/**
|
|
6
|
+
* What the chart shows, in a sentence. Required: a chart with no accessible name is
|
|
7
|
+
* an unlabelled image, and the visible title cannot be relied on — charts are often
|
|
8
|
+
* placed under a heading that already says something different.
|
|
9
|
+
*/
|
|
10
|
+
'aria-label': string;
|
|
11
|
+
/** Category axis labels. `series[].values` line up with these by index. */
|
|
12
|
+
categories: string[];
|
|
13
|
+
series: ChartSeries[];
|
|
14
|
+
/** Shown above the plot. With a single series this is what names it, in place of a legend. */
|
|
15
|
+
title?: React.ReactNode;
|
|
16
|
+
/** Sits under the title in secondary ink — units, period, source. */
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Formats every number that reaches a human: axis ticks, tooltips, the data table.
|
|
20
|
+
* Pire does not format — only the app knows the currency, the locale and the precision.
|
|
21
|
+
*/
|
|
22
|
+
formatValue?: (value: number) => string;
|
|
23
|
+
/** Plot height in pixels. Width always fills the container. */
|
|
24
|
+
height?: number;
|
|
25
|
+
/** Replaces the plot when there is nothing to draw. */
|
|
26
|
+
emptyState?: React.ReactNode;
|
|
27
|
+
/** Renders the underlying table visibly beneath the plot, instead of only for screen readers. */
|
|
28
|
+
showDataTable?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
style?: React.CSSProperties;
|
|
31
|
+
}
|
|
32
|
+
/** One swatch in the legend. What it identifies differs by chart — see `ChartFrameProps.legend`. */
|
|
33
|
+
export interface ChartLegendItem {
|
|
34
|
+
key: string;
|
|
35
|
+
label: string;
|
|
36
|
+
color: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ChartFrameProps extends Pick<ChartBaseProps, 'title' | 'description' | 'categories' | 'series' | 'showDataTable' | 'className' | 'style'> {
|
|
39
|
+
label: string;
|
|
40
|
+
formatValue: (value: number) => string;
|
|
41
|
+
/**
|
|
42
|
+
* Rendered only when there are at least two entries — one thing needs no key to tell it from
|
|
43
|
+
* the others, and the title already names it.
|
|
44
|
+
*
|
|
45
|
+
* The chart decides what an entry stands for: bars and lines colour by series, a donut colours
|
|
46
|
+
* by segment. Passing the list ready-made keeps that decision with the chart that made it.
|
|
47
|
+
*/
|
|
48
|
+
legend?: ChartLegendItem[];
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
}
|
|
51
|
+
/** Legend entries for a chart that colours by series — bars and lines. */
|
|
52
|
+
export declare function seriesLegend(series: ChartSeries[]): ChartLegendItem[];
|
|
53
|
+
/** Falls back to the browser's grouping so large figures stay readable without configuration. */
|
|
54
|
+
export declare const defaultFormatValue: (value: number) => string;
|
|
55
|
+
/**
|
|
56
|
+
* The shell around every Pire chart: heading, legend, plot, and the data table.
|
|
57
|
+
*
|
|
58
|
+
* The table is always in the DOM. A chart summarised in prose tells a screen-reader user what
|
|
59
|
+
* someone else concluded; the table gives them the same numbers everyone else is looking at.
|
|
60
|
+
* `showDataTable` only decides whether it is also visible.
|
|
61
|
+
*/
|
|
62
|
+
export declare function ChartFrame({ label, title, description, categories, series, formatValue, legend, showDataTable, className, style, children, }: ChartFrameProps): React.JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ChartSeries } from './chartGeometry.js';
|
|
3
|
+
/** Props every chart shares. Each chart adds its own encoding options on top. */
|
|
4
|
+
export interface ChartBaseProps {
|
|
5
|
+
/**
|
|
6
|
+
* What the chart shows, in a sentence. Required: a chart with no accessible name is
|
|
7
|
+
* an unlabelled image, and the visible title cannot be relied on — charts are often
|
|
8
|
+
* placed under a heading that already says something different.
|
|
9
|
+
*/
|
|
10
|
+
'aria-label': string;
|
|
11
|
+
/** Category axis labels. `series[].values` line up with these by index. */
|
|
12
|
+
categories: string[];
|
|
13
|
+
series: ChartSeries[];
|
|
14
|
+
/** Shown above the plot. With a single series this is what names it, in place of a legend. */
|
|
15
|
+
title?: React.ReactNode;
|
|
16
|
+
/** Sits under the title in secondary ink — units, period, source. */
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Formats every number that reaches a human: axis ticks, tooltips, the data table.
|
|
20
|
+
* Pire does not format — only the app knows the currency, the locale and the precision.
|
|
21
|
+
*/
|
|
22
|
+
formatValue?: (value: number) => string;
|
|
23
|
+
/** Plot height in pixels. Width always fills the container. */
|
|
24
|
+
height?: number;
|
|
25
|
+
/** Replaces the plot when there is nothing to draw. */
|
|
26
|
+
emptyState?: React.ReactNode;
|
|
27
|
+
/** Renders the underlying table visibly beneath the plot, instead of only for screen readers. */
|
|
28
|
+
showDataTable?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
style?: React.CSSProperties;
|
|
31
|
+
}
|
|
32
|
+
/** One swatch in the legend. What it identifies differs by chart — see `ChartFrameProps.legend`. */
|
|
33
|
+
export interface ChartLegendItem {
|
|
34
|
+
key: string;
|
|
35
|
+
label: string;
|
|
36
|
+
color: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ChartFrameProps extends Pick<ChartBaseProps, 'title' | 'description' | 'categories' | 'series' | 'showDataTable' | 'className' | 'style'> {
|
|
39
|
+
label: string;
|
|
40
|
+
formatValue: (value: number) => string;
|
|
41
|
+
/**
|
|
42
|
+
* Rendered only when there are at least two entries — one thing needs no key to tell it from
|
|
43
|
+
* the others, and the title already names it.
|
|
44
|
+
*
|
|
45
|
+
* The chart decides what an entry stands for: bars and lines colour by series, a donut colours
|
|
46
|
+
* by segment. Passing the list ready-made keeps that decision with the chart that made it.
|
|
47
|
+
*/
|
|
48
|
+
legend?: ChartLegendItem[];
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
}
|
|
51
|
+
/** Legend entries for a chart that colours by series — bars and lines. */
|
|
52
|
+
export declare function seriesLegend(series: ChartSeries[]): ChartLegendItem[];
|
|
53
|
+
/** Falls back to the browser's grouping so large figures stay readable without configuration. */
|
|
54
|
+
export declare const defaultFormatValue: (value: number) => string;
|
|
55
|
+
/**
|
|
56
|
+
* The shell around every Pire chart: heading, legend, plot, and the data table.
|
|
57
|
+
*
|
|
58
|
+
* The table is always in the DOM. A chart summarised in prose tells a screen-reader user what
|
|
59
|
+
* someone else concluded; the table gives them the same numbers everyone else is looking at.
|
|
60
|
+
* `showDataTable` only decides whether it is also visible.
|
|
61
|
+
*/
|
|
62
|
+
export declare function ChartFrame({ label, title, description, categories, series, formatValue, legend, showDataTable, className, style, children, }: ChartFrameProps): React.JSX.Element;
|
|
63
|
+
//# sourceMappingURL=ChartFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartFrame.d.ts","sourceRoot":"","sources":["../../../src/components/data/ChartFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKnD,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,qEA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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.cjs';
|
|
3
|
+
export interface DonutChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* What sits in the hole. Defaults to the total of every segment, which is the number a
|
|
6
|
+
* part-to-whole chart is implicitly about. Hovering a segment replaces it with that segment.
|
|
7
|
+
*/
|
|
8
|
+
centerLabel?: React.ReactNode;
|
|
9
|
+
/** Caption under the centre figure — "Total", "Invoiced", whatever the total means. */
|
|
10
|
+
centerCaption?: React.ReactNode;
|
|
11
|
+
/** Ring thickness in pixels. Thinner reads as a gauge, thicker as a pie. */
|
|
12
|
+
thickness?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Part-to-whole, at a glance.
|
|
16
|
+
*
|
|
17
|
+
* **Use this only when the reader needs the rough shape of a split, not the ranking.** People
|
|
18
|
+
* compare angles far worse than they compare lengths, so any question of the form "which is
|
|
19
|
+
* bigger" or "by how much" is a `BarChart`. Six segments is the ceiling, and it is a ceiling
|
|
20
|
+
* rather than a target: past three or four the small slices stop being readable at all.
|
|
21
|
+
*
|
|
22
|
+
* Unlike the other charts, colour here follows the *segment*, not the series — a donut draws one
|
|
23
|
+
* series, and its categories are what need telling apart. Pass exactly one series; anything after
|
|
24
|
+
* the first is ignored, with a dev warning.
|
|
25
|
+
*/
|
|
26
|
+
export declare function DonutChart({ categories, series, title, description, formatValue, height, emptyState, showDataTable, centerLabel, centerCaption, thickness, className, style, ...rest }: DonutChartProps): React.JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.js';
|
|
3
|
+
export interface DonutChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* What sits in the hole. Defaults to the total of every segment, which is the number a
|
|
6
|
+
* part-to-whole chart is implicitly about. Hovering a segment replaces it with that segment.
|
|
7
|
+
*/
|
|
8
|
+
centerLabel?: React.ReactNode;
|
|
9
|
+
/** Caption under the centre figure — "Total", "Invoiced", whatever the total means. */
|
|
10
|
+
centerCaption?: React.ReactNode;
|
|
11
|
+
/** Ring thickness in pixels. Thinner reads as a gauge, thicker as a pie. */
|
|
12
|
+
thickness?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Part-to-whole, at a glance.
|
|
16
|
+
*
|
|
17
|
+
* **Use this only when the reader needs the rough shape of a split, not the ranking.** People
|
|
18
|
+
* compare angles far worse than they compare lengths, so any question of the form "which is
|
|
19
|
+
* bigger" or "by how much" is a `BarChart`. Six segments is the ceiling, and it is a ceiling
|
|
20
|
+
* rather than a target: past three or four the small slices stop being readable at all.
|
|
21
|
+
*
|
|
22
|
+
* Unlike the other charts, colour here follows the *segment*, not the series — a donut draws one
|
|
23
|
+
* series, and its categories are what need telling apart. Pass exactly one series; anything after
|
|
24
|
+
* the first is ignored, with a dev warning.
|
|
25
|
+
*/
|
|
26
|
+
export declare function DonutChart({ categories, series, title, description, formatValue, height, emptyState, showDataTable, centerLabel, centerCaption, thickness, className, style, ...rest }: DonutChartProps): React.JSX.Element;
|
|
27
|
+
//# sourceMappingURL=DonutChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutChart.d.ts","sourceRoot":"","sources":["../../../src/components/data/DonutChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,cAAc,CAAC;AAKpE,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,uFAAuF;IACvF,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EACzB,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,WAAgC,EAAE,MAAY,EACtF,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,SAAc,EACrE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAC1B,EAAE,eAAe,qBAwFjB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.cjs';
|
|
3
|
+
export interface LineChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* Tint the area under each line. Reads well for one series; with several the fills overlap
|
|
6
|
+
* and the lower ones are read as smaller than they are, so it is ignored past the first.
|
|
7
|
+
*/
|
|
8
|
+
showArea?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Draw a dot at every point. On by default under about twenty points, where the dots show
|
|
11
|
+
* where the real readings are rather than implying data between them.
|
|
12
|
+
*/
|
|
13
|
+
showMarkers?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Let the axis start above zero, so a small movement in a large number stays visible.
|
|
16
|
+
*
|
|
17
|
+
* Legitimate for a line, which encodes change rather than length — but it does exaggerate,
|
|
18
|
+
* so leave it off whenever the size of the number is part of the point.
|
|
19
|
+
*/
|
|
20
|
+
zoomToData?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Change over time.
|
|
24
|
+
*
|
|
25
|
+
* Drawn in SVG at measured pixel coordinates rather than a scaled `viewBox`: scaling a viewBox
|
|
26
|
+
* to fit stretches the type and turns markers into ellipses. Gaps in a series break the line
|
|
27
|
+
* instead of interpolating across them — a missing month is not a straight line through it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function LineChart({ categories, series: rawSeries, title, description, formatValue, height, emptyState, showDataTable, showArea, showMarkers, zoomToData, className, style, ...rest }: LineChartProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.js';
|
|
3
|
+
export interface LineChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* Tint the area under each line. Reads well for one series; with several the fills overlap
|
|
6
|
+
* and the lower ones are read as smaller than they are, so it is ignored past the first.
|
|
7
|
+
*/
|
|
8
|
+
showArea?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Draw a dot at every point. On by default under about twenty points, where the dots show
|
|
11
|
+
* where the real readings are rather than implying data between them.
|
|
12
|
+
*/
|
|
13
|
+
showMarkers?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Let the axis start above zero, so a small movement in a large number stays visible.
|
|
16
|
+
*
|
|
17
|
+
* Legitimate for a line, which encodes change rather than length — but it does exaggerate,
|
|
18
|
+
* so leave it off whenever the size of the number is part of the point.
|
|
19
|
+
*/
|
|
20
|
+
zoomToData?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Change over time.
|
|
24
|
+
*
|
|
25
|
+
* Drawn in SVG at measured pixel coordinates rather than a scaled `viewBox`: scaling a viewBox
|
|
26
|
+
* to fit stretches the type and turns markers into ellipses. Gaps in a series break the line
|
|
27
|
+
* instead of interpolating across them — a missing month is not a straight line through it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function LineChart({ categories, series: rawSeries, title, description, formatValue, height, emptyState, showDataTable, showArea, showMarkers, zoomToData, className, style, ...rest }: LineChartProps): React.JSX.Element;
|
|
30
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../src/components/data/LineChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAOnD,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAoCD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,WAAgC,EACnF,MAAY,EAAE,UAAU,EAAE,aAAa,EAAE,QAAgB,EAAE,WAAW,EAAE,UAAkB,EAC1F,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAC1B,EAAE,cAAc,qBAwIhB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scale maths and slot assignment shared by the chart components.
|
|
3
|
+
*
|
|
4
|
+
* Kept free of React and of the DOM so the arithmetic — which is where charts go quietly
|
|
5
|
+
* wrong — can be tested directly rather than through a rendered SVG.
|
|
6
|
+
*/
|
|
7
|
+
/** One measured thing, drawn across every category. */
|
|
8
|
+
export interface ChartSeries {
|
|
9
|
+
/** Stable across re-renders and across filter changes. Colour follows this, not position. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Shown in the legend, the tooltip and the data table. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** One entry per category, in the same order. `null` is a gap in the data, never a zero. */
|
|
14
|
+
values: (number | null)[];
|
|
15
|
+
/**
|
|
16
|
+
* Pin this series to a specific `--viz` slot, 1–6. Without it slots are handed out in
|
|
17
|
+
* order. Use it when the same entity appears on several charts and must keep one colour.
|
|
18
|
+
*/
|
|
19
|
+
colorIndex?: number;
|
|
20
|
+
}
|
|
21
|
+
/** How many distinct series colours the palette defines. Validated as a set; do not extend. */
|
|
22
|
+
export declare const VIZ_SLOT_COUNT = 6;
|
|
23
|
+
export interface ChartScale {
|
|
24
|
+
min: number;
|
|
25
|
+
max: number;
|
|
26
|
+
/** Ascending, always including `min` and `max`. */
|
|
27
|
+
ticks: number[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A rounded axis covering `values`.
|
|
31
|
+
*
|
|
32
|
+
* `startAtZero` defaults to true because a bar's length is only readable when the axis starts
|
|
33
|
+
* at zero — a truncated bar axis exaggerates differences, which is the commonest way a chart
|
|
34
|
+
* misleads. Lines may pass false, since a line encodes change rather than magnitude.
|
|
35
|
+
*/
|
|
36
|
+
export declare function linearScale(values: (number | null | undefined)[], tickCount?: number, startAtZero?: boolean): ChartScale;
|
|
37
|
+
/** Where `value` sits on `scale`, as 0–1 from the axis minimum. */
|
|
38
|
+
export declare function scalePosition(value: number, scale: ChartScale): number;
|
|
39
|
+
/**
|
|
40
|
+
* The CSS colour for a series.
|
|
41
|
+
*
|
|
42
|
+
* Slots are handed out in declaration order and never cycled: past the sixth, identity by
|
|
43
|
+
* colour alone stops being reliable, so the overflow folds into one "other" neutral instead
|
|
44
|
+
* of inventing a seventh hue. Aggregate upstream when you have more than six.
|
|
45
|
+
*/
|
|
46
|
+
export declare function seriesColor(series: ChartSeries, index: number): string;
|
|
47
|
+
/** Dev-only nudge: more series than the palette can tell apart is a data-shape problem. */
|
|
48
|
+
export declare function warnOnSlotOverflow(series: ChartSeries[], chartLabel: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Dev-only checks specific to a donut, where the failure modes are about shape rather than count.
|
|
51
|
+
*
|
|
52
|
+
* Negative values are the important one: an arc length cannot be negative, so a refund or a
|
|
53
|
+
* reversal silently draws as its own absolute value and the chart reads as confidently wrong.
|
|
54
|
+
*/
|
|
55
|
+
export declare function warnOnDonutShape(series: ChartSeries[], categoryCount: number, chartLabel: string): void;
|
|
56
|
+
/** Sum of a category's values across series, skipping gaps. Used for stacked totals. */
|
|
57
|
+
export declare function stackTotal(series: ChartSeries[], categoryIndex: number): number;
|
|
58
|
+
/** Every plotted number in one flat list — what the scale is derived from. */
|
|
59
|
+
export declare function flatValues(series: ChartSeries[]): (number | null)[];
|
|
60
|
+
/**
|
|
61
|
+
* Trims each series to the category count.
|
|
62
|
+
*
|
|
63
|
+
* A series longer than the axis would otherwise plot points past the last category, stacked on
|
|
64
|
+
* top of each other at an undefined position. Shorter series need no padding — reading past the
|
|
65
|
+
* end already yields `undefined`, which every call site treats as a gap.
|
|
66
|
+
*/
|
|
67
|
+
export declare function alignToCategories(series: ChartSeries[], categoryCount: number): ChartSeries[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scale maths and slot assignment shared by the chart components.
|
|
3
|
+
*
|
|
4
|
+
* Kept free of React and of the DOM so the arithmetic — which is where charts go quietly
|
|
5
|
+
* wrong — can be tested directly rather than through a rendered SVG.
|
|
6
|
+
*/
|
|
7
|
+
/** One measured thing, drawn across every category. */
|
|
8
|
+
export interface ChartSeries {
|
|
9
|
+
/** Stable across re-renders and across filter changes. Colour follows this, not position. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Shown in the legend, the tooltip and the data table. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** One entry per category, in the same order. `null` is a gap in the data, never a zero. */
|
|
14
|
+
values: (number | null)[];
|
|
15
|
+
/**
|
|
16
|
+
* Pin this series to a specific `--viz` slot, 1–6. Without it slots are handed out in
|
|
17
|
+
* order. Use it when the same entity appears on several charts and must keep one colour.
|
|
18
|
+
*/
|
|
19
|
+
colorIndex?: number;
|
|
20
|
+
}
|
|
21
|
+
/** How many distinct series colours the palette defines. Validated as a set; do not extend. */
|
|
22
|
+
export declare const VIZ_SLOT_COUNT = 6;
|
|
23
|
+
export interface ChartScale {
|
|
24
|
+
min: number;
|
|
25
|
+
max: number;
|
|
26
|
+
/** Ascending, always including `min` and `max`. */
|
|
27
|
+
ticks: number[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A rounded axis covering `values`.
|
|
31
|
+
*
|
|
32
|
+
* `startAtZero` defaults to true because a bar's length is only readable when the axis starts
|
|
33
|
+
* at zero — a truncated bar axis exaggerates differences, which is the commonest way a chart
|
|
34
|
+
* misleads. Lines may pass false, since a line encodes change rather than magnitude.
|
|
35
|
+
*/
|
|
36
|
+
export declare function linearScale(values: (number | null | undefined)[], tickCount?: number, startAtZero?: boolean): ChartScale;
|
|
37
|
+
/** Where `value` sits on `scale`, as 0–1 from the axis minimum. */
|
|
38
|
+
export declare function scalePosition(value: number, scale: ChartScale): number;
|
|
39
|
+
/**
|
|
40
|
+
* The CSS colour for a series.
|
|
41
|
+
*
|
|
42
|
+
* Slots are handed out in declaration order and never cycled: past the sixth, identity by
|
|
43
|
+
* colour alone stops being reliable, so the overflow folds into one "other" neutral instead
|
|
44
|
+
* of inventing a seventh hue. Aggregate upstream when you have more than six.
|
|
45
|
+
*/
|
|
46
|
+
export declare function seriesColor(series: ChartSeries, index: number): string;
|
|
47
|
+
/** Dev-only nudge: more series than the palette can tell apart is a data-shape problem. */
|
|
48
|
+
export declare function warnOnSlotOverflow(series: ChartSeries[], chartLabel: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Dev-only checks specific to a donut, where the failure modes are about shape rather than count.
|
|
51
|
+
*
|
|
52
|
+
* Negative values are the important one: an arc length cannot be negative, so a refund or a
|
|
53
|
+
* reversal silently draws as its own absolute value and the chart reads as confidently wrong.
|
|
54
|
+
*/
|
|
55
|
+
export declare function warnOnDonutShape(series: ChartSeries[], categoryCount: number, chartLabel: string): void;
|
|
56
|
+
/** Sum of a category's values across series, skipping gaps. Used for stacked totals. */
|
|
57
|
+
export declare function stackTotal(series: ChartSeries[], categoryIndex: number): number;
|
|
58
|
+
/** Every plotted number in one flat list — what the scale is derived from. */
|
|
59
|
+
export declare function flatValues(series: ChartSeries[]): (number | null)[];
|
|
60
|
+
/**
|
|
61
|
+
* Trims each series to the category count.
|
|
62
|
+
*
|
|
63
|
+
* A series longer than the axis would otherwise plot points past the last category, stacked on
|
|
64
|
+
* top of each other at an undefined position. Shorter series need no padding — reading past the
|
|
65
|
+
* end already yields `undefined`, which every call site treats as a gap.
|
|
66
|
+
*/
|
|
67
|
+
export declare function alignToCategories(series: ChartSeries[], categoryCount: number): ChartSeries[];
|
|
68
|
+
//# sourceMappingURL=chartGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartGeometry.d.ts","sourceRoot":"","sources":["../../../src/components/data/chartGeometry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC1B,6FAA6F;IAC7F,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,+FAA+F;AAC/F,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAYD;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,EAAE,SAAS,SAAI,EAAE,WAAW,UAAO,GACvE,UAAU,CA4BZ;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAGtE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGtE;AAWD,2FAA2F;AAC3F,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CASlF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAC/D,IAAI,CAmBN;AAED,wFAAwF;AACxF,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAE/E;AAED,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAEnE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,WAAW,EAAE,CAI7F"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { DateValue } from 'react-aria-components';
|
|
3
|
+
export interface DateRange {
|
|
4
|
+
start: DateValue;
|
|
5
|
+
end: DateValue;
|
|
6
|
+
}
|
|
7
|
+
export interface DateRangePreset {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
/** The app computes the range: Pire cannot know when a customer's fiscal year starts. */
|
|
11
|
+
range: () => DateRange;
|
|
12
|
+
}
|
|
13
|
+
export interface DateRangePickerProps {
|
|
14
|
+
label?: React.ReactNode;
|
|
15
|
+
value?: DateRange | null;
|
|
16
|
+
defaultValue?: DateRange | null;
|
|
17
|
+
onChange?: (value: DateRange | null) => void;
|
|
18
|
+
minValue?: DateValue;
|
|
19
|
+
maxValue?: DateValue;
|
|
20
|
+
/** Return true for dates that cannot be picked — blocked periods, closed books. */
|
|
21
|
+
isDateUnavailable?: (date: DateValue) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Longest range the caller accepts, in days. Exceeding it marks the field invalid so
|
|
24
|
+
* `errorMessage` shows — the wording is the app's, since only it knows the limit's reason.
|
|
25
|
+
*
|
|
26
|
+
* Days rather than a duration: "12 months" is not a fixed number of days, so pick the bound
|
|
27
|
+
* that matches your rule rather than expecting a calendar-aware one.
|
|
28
|
+
*/
|
|
29
|
+
maxRangeDays?: number;
|
|
30
|
+
/** Shortcuts beside the calendar: "This month", "Last 30 days". */
|
|
31
|
+
presets?: DateRangePreset[];
|
|
32
|
+
description?: React.ReactNode;
|
|
33
|
+
errorMessage?: React.ReactNode;
|
|
34
|
+
isInvalid?: boolean;
|
|
35
|
+
isDisabled?: boolean;
|
|
36
|
+
isReadOnly?: boolean;
|
|
37
|
+
isRequired?: boolean;
|
|
38
|
+
size?: 'sm' | 'md' | 'lg';
|
|
39
|
+
fullWidth?: boolean;
|
|
40
|
+
/** HTML submit names for the two ends. */
|
|
41
|
+
startName?: string;
|
|
42
|
+
endName?: string;
|
|
43
|
+
className?: string;
|
|
44
|
+
style?: React.CSSProperties;
|
|
45
|
+
}
|
|
46
|
+
/** Whole days between the two ends, inclusive of both. */
|
|
47
|
+
export declare function rangeLengthInDays(range: DateRange): number;
|
|
48
|
+
/**
|
|
49
|
+
* Two dates that belong together — the default filter on 24 ERP screens.
|
|
50
|
+
*
|
|
51
|
+
* Built on React Aria's `DateRangePicker`, which supplies the segmented ends, the ordering rules
|
|
52
|
+
* between them, and locale-driven segment order. Wrap the app in `I18nProvider` to pin a locale:
|
|
53
|
+
* `es-PY` reads dd/mm/yyyy and `en-US` mm/dd/yyyy off the same value.
|
|
54
|
+
*/
|
|
55
|
+
export declare function DateRangePicker({ label, description, errorMessage, maxRangeDays, presets, size, fullWidth, startName, endName, className, style, ...rest }: DateRangePickerProps): React.JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { DateValue } from 'react-aria-components';
|
|
3
|
+
export interface DateRange {
|
|
4
|
+
start: DateValue;
|
|
5
|
+
end: DateValue;
|
|
6
|
+
}
|
|
7
|
+
export interface DateRangePreset {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
/** The app computes the range: Pire cannot know when a customer's fiscal year starts. */
|
|
11
|
+
range: () => DateRange;
|
|
12
|
+
}
|
|
13
|
+
export interface DateRangePickerProps {
|
|
14
|
+
label?: React.ReactNode;
|
|
15
|
+
value?: DateRange | null;
|
|
16
|
+
defaultValue?: DateRange | null;
|
|
17
|
+
onChange?: (value: DateRange | null) => void;
|
|
18
|
+
minValue?: DateValue;
|
|
19
|
+
maxValue?: DateValue;
|
|
20
|
+
/** Return true for dates that cannot be picked — blocked periods, closed books. */
|
|
21
|
+
isDateUnavailable?: (date: DateValue) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Longest range the caller accepts, in days. Exceeding it marks the field invalid so
|
|
24
|
+
* `errorMessage` shows — the wording is the app's, since only it knows the limit's reason.
|
|
25
|
+
*
|
|
26
|
+
* Days rather than a duration: "12 months" is not a fixed number of days, so pick the bound
|
|
27
|
+
* that matches your rule rather than expecting a calendar-aware one.
|
|
28
|
+
*/
|
|
29
|
+
maxRangeDays?: number;
|
|
30
|
+
/** Shortcuts beside the calendar: "This month", "Last 30 days". */
|
|
31
|
+
presets?: DateRangePreset[];
|
|
32
|
+
description?: React.ReactNode;
|
|
33
|
+
errorMessage?: React.ReactNode;
|
|
34
|
+
isInvalid?: boolean;
|
|
35
|
+
isDisabled?: boolean;
|
|
36
|
+
isReadOnly?: boolean;
|
|
37
|
+
isRequired?: boolean;
|
|
38
|
+
size?: 'sm' | 'md' | 'lg';
|
|
39
|
+
fullWidth?: boolean;
|
|
40
|
+
/** HTML submit names for the two ends. */
|
|
41
|
+
startName?: string;
|
|
42
|
+
endName?: string;
|
|
43
|
+
className?: string;
|
|
44
|
+
style?: React.CSSProperties;
|
|
45
|
+
}
|
|
46
|
+
/** Whole days between the two ends, inclusive of both. */
|
|
47
|
+
export declare function rangeLengthInDays(range: DateRange): number;
|
|
48
|
+
/**
|
|
49
|
+
* Two dates that belong together — the default filter on 24 ERP screens.
|
|
50
|
+
*
|
|
51
|
+
* Built on React Aria's `DateRangePicker`, which supplies the segmented ends, the ordering rules
|
|
52
|
+
* between them, and locale-driven segment order. Wrap the app in `I18nProvider` to pin a locale:
|
|
53
|
+
* `es-PY` reads dd/mm/yyyy and `en-US` mm/dd/yyyy off the same value.
|
|
54
|
+
*/
|
|
55
|
+
export declare function DateRangePicker({ label, description, errorMessage, maxRangeDays, presets, size, fullWidth, startName, endName, className, style, ...rest }: DateRangePickerProps): React.JSX.Element;
|
|
56
|
+
//# sourceMappingURL=DateRangePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/components/forms/DateRangePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAMpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKvD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,GAAG,EAAE,SAAS,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,yFAAyF;IACzF,KAAK,EAAE,MAAM,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC;IACjD;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,0DAA0D;AAC1D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAG1D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,IAAW,EAAE,SAAgB,EACtF,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAC9C,EAAE,oBAAoB,qBAiFtB"}
|
|
@@ -6,6 +6,11 @@ export interface InputProps {
|
|
|
6
6
|
/** Receives the raw string value. */
|
|
7
7
|
onChange?: (value: string) => void;
|
|
8
8
|
placeholder?: string;
|
|
9
|
+
/**
|
|
10
|
+
* `date` is accepted for compatibility but reaches for the browser's native picker, which
|
|
11
|
+
* ignores the token palette and behaves differently per browser. Use `DatePicker`, or
|
|
12
|
+
* `DateRangePicker` for two ends.
|
|
13
|
+
*/
|
|
9
14
|
type?: 'text' | 'search' | 'email' | 'number' | 'date' | 'password' | 'tel' | 'url';
|
|
10
15
|
/** Leading icon slug — "search", "calendar", "hash". */
|
|
11
16
|
icon?: string;
|
|
@@ -6,6 +6,11 @@ export interface InputProps {
|
|
|
6
6
|
/** Receives the raw string value. */
|
|
7
7
|
onChange?: (value: string) => void;
|
|
8
8
|
placeholder?: string;
|
|
9
|
+
/**
|
|
10
|
+
* `date` is accepted for compatibility but reaches for the browser's native picker, which
|
|
11
|
+
* ignores the token palette and behaves differently per browser. Use `DatePicker`, or
|
|
12
|
+
* `DateRangePicker` for two ends.
|
|
13
|
+
*/
|
|
9
14
|
type?: 'text' | 'search' | 'email' | 'number' | 'date' | 'password' | 'tel' | 'url';
|
|
10
15
|
/** Leading icon slug — "search", "calendar", "hash". */
|
|
11
16
|
icon?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAKpC,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;IACpF,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,wEAAwE;IACxE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE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