@omni-design/components 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/types/components/Accordion/Accordion.d.ts +2 -1
- package/dist/types/components/Alert/Alert.d.ts +2 -1
- package/dist/types/components/Box/Box.d.ts +2 -25
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +2 -1
- package/dist/types/components/Charts/BarChart.d.ts +33 -0
- package/dist/types/components/Charts/LineChart.d.ts +40 -0
- package/dist/types/components/Charts/PieChart.d.ts +38 -0
- package/dist/types/components/Charts/a11y.d.ts +65 -0
- package/dist/types/components/Charts/geometry.d.ts +72 -0
- package/dist/types/components/Charts/index.d.ts +5 -0
- package/dist/types/components/Charts/tokens.d.ts +37 -0
- package/dist/types/components/Input/Input.d.ts +103 -1
- package/dist/types/components/Snackbar/Snackbar.d.ts +2 -1
- package/dist/types/components/TextField/TextField.d.ts +24 -10
- package/dist/types/components/TreeView/TreeView.d.ts +2 -1
- package/dist/types/components/_shadows.d.ts +5 -5
- package/dist/types/components/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export function AccordionGroup({ children, variant, color, size, spacing, className, sx, ...props }: {
|
|
1
|
+
export function AccordionGroup({ children, variant, surface, color, size, spacing, className, sx, ...props }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
children: any;
|
|
4
4
|
variant?: string;
|
|
5
|
+
surface: any;
|
|
5
6
|
color?: string;
|
|
6
7
|
size?: string;
|
|
7
8
|
spacing?: number;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export function Alert({ children, variant, color, size, startDecorator, endDecorator, className, sx, ...props }: {
|
|
1
|
+
export function Alert({ children, variant, surface, color, size, startDecorator, endDecorator, className, sx, ...props }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
children: any;
|
|
4
4
|
variant?: string;
|
|
5
|
+
surface: any;
|
|
5
6
|
color?: string;
|
|
6
7
|
size?: string;
|
|
7
8
|
startDecorator: any;
|
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* Box Component — bare layout primitive.
|
|
3
|
-
*
|
|
4
|
-
* A theme-aware container with no visual styling of its own. Use it when you
|
|
5
|
-
* need a slot that participates in the design-system cascade (data-theme /
|
|
6
|
-
* data-surface) without inheriting any of the chrome that Ratio or Card
|
|
7
|
-
* would bring. No border-radius, no padding, no data-theme of its own —
|
|
8
|
-
* it inherits theme from its parent unless you pass `theme`.
|
|
9
|
-
*
|
|
10
|
-
* Props:
|
|
11
|
-
* theme — optional data-theme override for everything inside
|
|
12
|
-
* surface — optional data-surface override (Surface | Container | Container-Low | etc.)
|
|
13
|
-
* elevation — 0–5. When > 0, the Box renders an OUTER wrapper that carries
|
|
14
|
-
* the layered shadow but sets NO surface, so the shadow color
|
|
15
|
-
* resolves from the PARENT surface (the surface the box sits on,
|
|
16
|
-
* physically where the shadow falls) rather than the box's own.
|
|
17
|
-
* The inner element paints `surface` and fills the wrapper.
|
|
18
|
-
* component — root element tag (default: 'div')
|
|
19
|
-
* children, className, sx, ...props — forwarded
|
|
20
|
-
*
|
|
21
|
-
* For a themed shell with border + shadow + padding, use <Ratio> (sized) or
|
|
22
|
-
* <Card> (with header/actions). Box is intentionally bare so that nested
|
|
23
|
-
* tokens resolve correctly without competing styling.
|
|
24
|
-
*/
|
|
25
|
-
export function Box({ children, theme, surface, elevation, component, className, sx, style, ...props }: {
|
|
1
|
+
export function Box({ children, theme, surface, radius, elevation, component, className, sx, style, ...props }: {
|
|
26
2
|
[x: string]: any;
|
|
27
3
|
children: any;
|
|
28
4
|
theme: any;
|
|
29
5
|
surface: any;
|
|
6
|
+
radius?: string;
|
|
30
7
|
elevation?: number;
|
|
31
8
|
component?: string;
|
|
32
9
|
className?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function ButtonGroup({ variant, color, size, disabled, orientation, spacing, fit, fullWidth, equalWidth, value: controlledValue, defaultValue, onChange, children, className, sx, "aria-label": ariaLabel, ...props }: {
|
|
1
|
+
export function ButtonGroup({ variant, color, size, disabled, orientation, spacing, fit, fullWidth, equalWidth, multiple, value: controlledValue, defaultValue, onChange, children, className, sx, "aria-label": ariaLabel, ...props }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
variant?: string;
|
|
4
4
|
color?: string;
|
|
@@ -9,6 +9,7 @@ export function ButtonGroup({ variant, color, size, disabled, orientation, spaci
|
|
|
9
9
|
fit: any;
|
|
10
10
|
fullWidth?: boolean;
|
|
11
11
|
equalWidth?: boolean;
|
|
12
|
+
multiple?: boolean;
|
|
12
13
|
value: any;
|
|
13
14
|
defaultValue: any;
|
|
14
15
|
onChange: any;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BarChart — single-series bars in a track.
|
|
3
|
+
*
|
|
4
|
+
* COLOURS (all surface-paired, so the chart re-themes with its container):
|
|
5
|
+
* filled bar var(--Icons-Primary)
|
|
6
|
+
* track var(--Border-Variant)
|
|
7
|
+
* hover slot var(--Hover)
|
|
8
|
+
* labels var(--Text) / var(--Quiet) for categories
|
|
9
|
+
*
|
|
10
|
+
* MOTION Bars grow from the baseline on mount, over the brand's own
|
|
11
|
+
* --Motion-Duration-Slow / --Motion-Easing-Enter. Because that is CSS reading
|
|
12
|
+
* a token, prefers-reduced-motion collapses it to 0s automatically.
|
|
13
|
+
*
|
|
14
|
+
* ACCESS The SVG is aria-hidden and the data ships as a visually-hidden table,
|
|
15
|
+
* so a screen reader gets the numbers rather than a picture of them. Bars are
|
|
16
|
+
* focusable, so the hover readout is reachable from the keyboard.
|
|
17
|
+
*/
|
|
18
|
+
export function BarChart({ data, showTrack, rounded, showValues, showLabels, animate, interactive, height, gapRatio, label, className, sx, ...props }: {
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
data?: any[];
|
|
21
|
+
showTrack?: boolean;
|
|
22
|
+
rounded?: boolean;
|
|
23
|
+
showValues?: boolean;
|
|
24
|
+
showLabels?: boolean;
|
|
25
|
+
animate?: boolean;
|
|
26
|
+
interactive?: boolean;
|
|
27
|
+
height?: number;
|
|
28
|
+
gapRatio?: number;
|
|
29
|
+
label: any;
|
|
30
|
+
className?: string;
|
|
31
|
+
sx?: {};
|
|
32
|
+
}): JSX.Element;
|
|
33
|
+
export default BarChart;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LineChart — one series, straight or curved, with an optional area fill.
|
|
3
|
+
*
|
|
4
|
+
* The curve is Catmull-Rom, so it passes THROUGH every data point rather than
|
|
5
|
+
* near it (see geometry.js). `curve="smooth"` is the shape in the reference
|
|
6
|
+
* design; `curve="straight"` is a plain polyline.
|
|
7
|
+
*
|
|
8
|
+
* COLOURS
|
|
9
|
+
* line var(--Icons-Primary)
|
|
10
|
+
* area var(--Icons-Primary-Variant), fading to transparent at the base
|
|
11
|
+
* gridlines var(--Border-Variant)
|
|
12
|
+
* labels var(--Text) / var(--Quiet)
|
|
13
|
+
*
|
|
14
|
+
* PROPS
|
|
15
|
+
* data number[] or { value, label }[]
|
|
16
|
+
* curve 'smooth' | 'straight' (default 'smooth')
|
|
17
|
+
* gradient fill the area under the line (default true)
|
|
18
|
+
* fromZero anchor the value axis at zero (default false — a line encodes
|
|
19
|
+
* shape, so a floating baseline is honest here in a way it is not
|
|
20
|
+
* for bars)
|
|
21
|
+
* showGrid horizontal gridlines at round values (default false)
|
|
22
|
+
*/
|
|
23
|
+
export function LineChart({ data, curve, gradient, fromZero, showGrid, showLabels, animate, interactive, height, strokeWidth, tension, label, className, sx, ...props }: {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
data?: any[];
|
|
26
|
+
curve?: string;
|
|
27
|
+
gradient?: boolean;
|
|
28
|
+
fromZero?: boolean;
|
|
29
|
+
showGrid?: boolean;
|
|
30
|
+
showLabels?: boolean;
|
|
31
|
+
animate?: boolean;
|
|
32
|
+
interactive?: boolean;
|
|
33
|
+
height?: number;
|
|
34
|
+
strokeWidth?: number;
|
|
35
|
+
tension?: number;
|
|
36
|
+
label: any;
|
|
37
|
+
className?: string;
|
|
38
|
+
sx?: {};
|
|
39
|
+
}): JSX.Element;
|
|
40
|
+
export default LineChart;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PieChart — parts of a whole. Pass `donut` for a ring.
|
|
3
|
+
*
|
|
4
|
+
* COLOURING
|
|
5
|
+
* Wedges cycle the icon palettes — var(--Icons-Primary), -Secondary,
|
|
6
|
+
* -Tertiary, -Neutral, then the states. Unlike the bar and line charts,
|
|
7
|
+
* which are single-series and use one accent, a pie's categories have to be
|
|
8
|
+
* told apart, and hue does that better than anything else.
|
|
9
|
+
*
|
|
10
|
+
* Each wedge is separated by a stroke in var(--Background) — the SURFACE's
|
|
11
|
+
* own background, so the gap reads as a gap on any surface, in either mode,
|
|
12
|
+
* rather than as a grey line that happens to look like a gap on white.
|
|
13
|
+
*
|
|
14
|
+
* Wedge labels use var(--Icons-On-<palette>), the token generated to clear
|
|
15
|
+
* 4.5:1 against that exact fill, so a label never has to be contrast-checked
|
|
16
|
+
* by hand.
|
|
17
|
+
*
|
|
18
|
+
* COLOURS
|
|
19
|
+
* wedges var(--Icons-{Primary,Secondary,…})
|
|
20
|
+
* separator var(--Background)
|
|
21
|
+
* labels var(--Icons-On-{…}) inside a wedge, var(--Text) outside
|
|
22
|
+
*/
|
|
23
|
+
export function PieChart({ data, donut, donutRatio, colors, separatorWidth, size, showLabels, animate, interactive, label, className, sx, ...props }: {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
data?: any[];
|
|
26
|
+
donut?: boolean;
|
|
27
|
+
donutRatio?: number;
|
|
28
|
+
colors?: string[];
|
|
29
|
+
separatorWidth?: number;
|
|
30
|
+
size?: number;
|
|
31
|
+
showLabels?: boolean;
|
|
32
|
+
animate?: boolean;
|
|
33
|
+
interactive?: boolean;
|
|
34
|
+
label: any;
|
|
35
|
+
className?: string;
|
|
36
|
+
sx?: {};
|
|
37
|
+
}): JSX.Element;
|
|
38
|
+
export default PieChart;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export function ChartTable({ caption, labels, values, valueHeader }: {
|
|
2
|
+
caption: any;
|
|
3
|
+
labels: any;
|
|
4
|
+
values: any;
|
|
5
|
+
valueHeader?: string;
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* Hover + keyboard state for a set of marks.
|
|
9
|
+
*
|
|
10
|
+
* Keyboard is not an afterthought here: the marks carry tabIndex, so the same
|
|
11
|
+
* readout a mouse gets on hover is what a keyboard gets on focus. A chart whose
|
|
12
|
+
* detail is mouse-only is a chart half its readers cannot interrogate.
|
|
13
|
+
*/
|
|
14
|
+
export function useChartHover(count: any): {
|
|
15
|
+
active: any;
|
|
16
|
+
setActive: any;
|
|
17
|
+
handlers: any;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Focusable hit targets, as real <button>s OUTSIDE the SVG.
|
|
21
|
+
*
|
|
22
|
+
* They cannot live inside the <svg>, because the SVG is aria-hidden — and a
|
|
23
|
+
* focusable element inside an aria-hidden subtree is invalid ARIA: a keyboard
|
|
24
|
+
* user can land on something a screen reader will not announce. Positioning
|
|
25
|
+
* them as an absolute overlay keeps them in the accessibility tree, gives
|
|
26
|
+
* them real button semantics for free, and means the hover readout is
|
|
27
|
+
* reachable by keyboard as well as pointer.
|
|
28
|
+
*
|
|
29
|
+
* Percentages, not pixels: the SVG scales to its container, so the overlay has
|
|
30
|
+
* to scale with it.
|
|
31
|
+
*/
|
|
32
|
+
export function ChartHitTargets({ count, width, centres, bandWidth, labels, values, handlers }: {
|
|
33
|
+
count: any;
|
|
34
|
+
width: any;
|
|
35
|
+
centres: any;
|
|
36
|
+
bandWidth: any;
|
|
37
|
+
labels: any;
|
|
38
|
+
values: any;
|
|
39
|
+
handlers: any;
|
|
40
|
+
}): JSX.Element;
|
|
41
|
+
/** In-SVG readout for the hovered mark — no portal, so nothing can be clipped
|
|
42
|
+
* by an ancestor's overflow, and nothing needs a popover the lib lacks. */
|
|
43
|
+
export function ChartReadout({ x, y, text, width, tokens }: {
|
|
44
|
+
x: any;
|
|
45
|
+
y: any;
|
|
46
|
+
text: any;
|
|
47
|
+
width: any;
|
|
48
|
+
tokens: any;
|
|
49
|
+
}): JSX.Element;
|
|
50
|
+
export namespace VISUALLY_HIDDEN {
|
|
51
|
+
let position: string;
|
|
52
|
+
let width: string;
|
|
53
|
+
let height: string;
|
|
54
|
+
let padding: number;
|
|
55
|
+
let margin: string;
|
|
56
|
+
let overflow: string;
|
|
57
|
+
let clip: string;
|
|
58
|
+
let clipPath: string;
|
|
59
|
+
let whiteSpace: string;
|
|
60
|
+
let border: number;
|
|
61
|
+
}
|
|
62
|
+
export namespace CHART_MOTION {
|
|
63
|
+
let grow: string;
|
|
64
|
+
let hover: string;
|
|
65
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The value axis. Bar charts start at zero so bar LENGTH stays proportional to
|
|
3
|
+
* value — a bar chart with a clipped baseline misreports its own data, which is
|
|
4
|
+
* the single most common way a chart lies. Line charts may float, since a line
|
|
5
|
+
* encodes shape rather than magnitude.
|
|
6
|
+
*/
|
|
7
|
+
export function extent(values: any, { fromZero }?: {
|
|
8
|
+
fromZero?: boolean;
|
|
9
|
+
}): {
|
|
10
|
+
min: number;
|
|
11
|
+
max: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Evenly spaced band centres across a width — the x position of bar i or
|
|
15
|
+
* point i. `inset` keeps the first and last from touching the plot edge.
|
|
16
|
+
*/
|
|
17
|
+
export function bands(count: any, left: any, width: any, { inset }?: {
|
|
18
|
+
inset?: number;
|
|
19
|
+
}): any[];
|
|
20
|
+
/** Band centres and a bar width, for charts whose marks occupy a slot. */
|
|
21
|
+
export function slots(count: any, left: any, width: any, { gapRatio }?: {
|
|
22
|
+
gapRatio?: number;
|
|
23
|
+
}): {
|
|
24
|
+
centres: any[];
|
|
25
|
+
bandWidth: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A smooth path through the points — Catmull-Rom converted to cubic Béziers.
|
|
29
|
+
*
|
|
30
|
+
* Catmull-Rom is used rather than a plain bezier smoothing because it passes
|
|
31
|
+
* THROUGH every point. A curve that merely approaches its data points is
|
|
32
|
+
* drawing something other than the data. `tension` 0 gives the standard
|
|
33
|
+
* uniform spline; higher values flatten it toward straight segments.
|
|
34
|
+
*/
|
|
35
|
+
export function smoothPath(points: any, { tension }?: {
|
|
36
|
+
tension?: number;
|
|
37
|
+
}): any;
|
|
38
|
+
/**
|
|
39
|
+
* One pie/donut slice as SVG path data.
|
|
40
|
+
*
|
|
41
|
+
* Angles are in radians measured clockwise from twelve o'clock, which is where
|
|
42
|
+
* a reader's eye starts. `innerR` of 0 gives a pie; anything larger gives a
|
|
43
|
+
* donut ring.
|
|
44
|
+
*/
|
|
45
|
+
export function arcPath(cx: any, cy: any, innerR: any, outerR: any, startAngle: any, endAngle: any): any;
|
|
46
|
+
/**
|
|
47
|
+
* Slice angles for a set of values.
|
|
48
|
+
*
|
|
49
|
+
* Negative values are dropped rather than mirrored: a pie encodes parts of a
|
|
50
|
+
* whole, and a negative part of a whole has no meaning. Callers get the count
|
|
51
|
+
* back so they can say so rather than silently showing a different total.
|
|
52
|
+
*/
|
|
53
|
+
export function sliceAngles(values: any, { startAngle }?: {
|
|
54
|
+
startAngle?: number;
|
|
55
|
+
}): {
|
|
56
|
+
slices: any;
|
|
57
|
+
total: any;
|
|
58
|
+
dropped: any;
|
|
59
|
+
};
|
|
60
|
+
/** Round tick values across a range, for gridlines and axis labels. */
|
|
61
|
+
export function ticks({ min, max }: {
|
|
62
|
+
min: any;
|
|
63
|
+
max: any;
|
|
64
|
+
}, count?: number): number[];
|
|
65
|
+
export function toNumbers(data: any): any;
|
|
66
|
+
export function toLabels(data: any): any;
|
|
67
|
+
export function scaleY(value: any, { min, max }: {
|
|
68
|
+
min: any;
|
|
69
|
+
max: any;
|
|
70
|
+
}, top: any, height: any): number;
|
|
71
|
+
export function linePath(points: any): any;
|
|
72
|
+
export function areaPath(d: any, points: any, baselineY: any): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./geometry";
|
|
2
|
+
export { BarChart, default as BarChartDefault } from "./BarChart";
|
|
3
|
+
export { LineChart, default as LineChartDefault } from "./LineChart";
|
|
4
|
+
export { PieChart, default as PieChartDefault } from "./PieChart";
|
|
5
|
+
export { CHART_TOKENS, CHART_LABEL_TYPE } from "./tokens";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export namespace CHART_TOKENS {
|
|
2
|
+
let fill: string;
|
|
3
|
+
let track: string;
|
|
4
|
+
let line: string;
|
|
5
|
+
let quietLabel: string;
|
|
6
|
+
let label: string;
|
|
7
|
+
let gradient: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Label type. SVG <text> cannot host a lib Typography component, so the chart
|
|
11
|
+
* reads the same tokens Typography would rather than picking sizes by hand —
|
|
12
|
+
* a brand that re-picks its body face moves its chart labels with it.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The icon palettes a pie's wedges cycle through.
|
|
16
|
+
*
|
|
17
|
+
* Brand accents lead, because a category has no inherent meaning and should
|
|
18
|
+
* not borrow one — a green wedge next to a red one reads as pass/fail whether
|
|
19
|
+
* or not that is what the data says. The state colours are still available for
|
|
20
|
+
* charts with more categories than accents, and a caller can pass its own
|
|
21
|
+
* subset (or reorder it) via the `colors` prop when the categories DO carry
|
|
22
|
+
* semantics: `colors={['Success', 'Warning', 'Error']}`.
|
|
23
|
+
*
|
|
24
|
+
* Every entry has a matching --Icons-On-<name> at 4.5:1, so a wedge label can
|
|
25
|
+
* sit on its own fill without anyone checking contrast by hand.
|
|
26
|
+
*/
|
|
27
|
+
export const CHART_PALETTES: string[];
|
|
28
|
+
export function paletteTokens(name: any): {
|
|
29
|
+
fill: string;
|
|
30
|
+
onFill: string;
|
|
31
|
+
};
|
|
32
|
+
export namespace CHART_LABEL_TYPE {
|
|
33
|
+
let fontFamily: string;
|
|
34
|
+
let fontSize: string;
|
|
35
|
+
let fontWeight: string;
|
|
36
|
+
let letterSpacing: string;
|
|
37
|
+
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function floatingLabelGeometry(sizeConfig: any, hasStartAdornment: any): {
|
|
2
|
+
labelX: any;
|
|
3
|
+
restingY: number;
|
|
4
|
+
shrunkY: number;
|
|
5
|
+
};
|
|
6
|
+
export function Input({ variant, size, label, labelPosition, placeholder, helperText, validation, validationMessage, disabled, id: idProp, value, defaultValue, onChange, name, type, multiline, rows, maxRows, resize, startAdornment, endAdornment, fullWidth, className, sx, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-required": ariaRequired, "aria-invalid": ariaInvalid, inputProps: inputPropsProp, ...props }: {
|
|
2
7
|
[x: string]: any;
|
|
3
8
|
variant?: string;
|
|
4
9
|
size?: string;
|
|
@@ -9,6 +14,7 @@ export function Input({ variant, size, label, labelPosition, placeholder, helper
|
|
|
9
14
|
validation: any;
|
|
10
15
|
validationMessage: any;
|
|
11
16
|
disabled?: boolean;
|
|
17
|
+
id: any;
|
|
12
18
|
value: any;
|
|
13
19
|
defaultValue: any;
|
|
14
20
|
onChange: any;
|
|
@@ -17,6 +23,7 @@ export function Input({ variant, size, label, labelPosition, placeholder, helper
|
|
|
17
23
|
multiline?: boolean;
|
|
18
24
|
rows: any;
|
|
19
25
|
maxRows: any;
|
|
26
|
+
resize?: string;
|
|
20
27
|
startAdornment: any;
|
|
21
28
|
endAdornment: any;
|
|
22
29
|
fullWidth?: boolean;
|
|
@@ -29,6 +36,101 @@ export function Input({ variant, size, label, labelPosition, placeholder, helper
|
|
|
29
36
|
"aria-invalid": any;
|
|
30
37
|
inputProps?: {};
|
|
31
38
|
}): JSX.Element;
|
|
39
|
+
export namespace FLOATING_SIZE_MAP {
|
|
40
|
+
namespace small {
|
|
41
|
+
let height: string;
|
|
42
|
+
let fontSize: string;
|
|
43
|
+
let labelSize: string;
|
|
44
|
+
let padding: string;
|
|
45
|
+
let padTop: number;
|
|
46
|
+
let padBottom: number;
|
|
47
|
+
let leftPad: number;
|
|
48
|
+
let iconSize: number;
|
|
49
|
+
}
|
|
50
|
+
namespace medium {
|
|
51
|
+
let height_1: string;
|
|
52
|
+
export { height_1 as height };
|
|
53
|
+
let fontSize_1: string;
|
|
54
|
+
export { fontSize_1 as fontSize };
|
|
55
|
+
let labelSize_1: string;
|
|
56
|
+
export { labelSize_1 as labelSize };
|
|
57
|
+
let padding_1: string;
|
|
58
|
+
export { padding_1 as padding };
|
|
59
|
+
let padTop_1: number;
|
|
60
|
+
export { padTop_1 as padTop };
|
|
61
|
+
let padBottom_1: number;
|
|
62
|
+
export { padBottom_1 as padBottom };
|
|
63
|
+
let leftPad_1: number;
|
|
64
|
+
export { leftPad_1 as leftPad };
|
|
65
|
+
let iconSize_1: number;
|
|
66
|
+
export { iconSize_1 as iconSize };
|
|
67
|
+
}
|
|
68
|
+
namespace large {
|
|
69
|
+
let height_2: string;
|
|
70
|
+
export { height_2 as height };
|
|
71
|
+
let fontSize_2: string;
|
|
72
|
+
export { fontSize_2 as fontSize };
|
|
73
|
+
let labelSize_2: string;
|
|
74
|
+
export { labelSize_2 as labelSize };
|
|
75
|
+
let padding_2: string;
|
|
76
|
+
export { padding_2 as padding };
|
|
77
|
+
let padTop_2: number;
|
|
78
|
+
export { padTop_2 as padTop };
|
|
79
|
+
let padBottom_2: number;
|
|
80
|
+
export { padBottom_2 as padBottom };
|
|
81
|
+
let leftPad_2: number;
|
|
82
|
+
export { leftPad_2 as leftPad };
|
|
83
|
+
let iconSize_2: number;
|
|
84
|
+
export { iconSize_2 as iconSize };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Floating-label geometry.
|
|
89
|
+
*
|
|
90
|
+
* Exported and pure so the arithmetic can be tested directly. The rendered
|
|
91
|
+
* transform cannot be: jsdom reports MUI's own base rule rather than the
|
|
92
|
+
* emotion override, so a DOM assertion here would pass whatever these values
|
|
93
|
+
* were — which is exactly how the constants survived.
|
|
94
|
+
*
|
|
95
|
+
* X — the resting label must start where the input TEXT starts, or it jumps
|
|
96
|
+
* sideways as it shrinks. With a start adornment the text begins after it, so
|
|
97
|
+
* the label clears what the adornment actually occupies: marginLeft + icon +
|
|
98
|
+
* gap. This was a flat +32, which is 8px too far at large and 12px at small —
|
|
99
|
+
* the error grew as the icon got SMALLER.
|
|
100
|
+
*
|
|
101
|
+
* Y — the resting label is centred in the field. This was a flat 16px, which
|
|
102
|
+
* centred `small` and left `large` 4px high — the error grew as the field got
|
|
103
|
+
* TALLER. Two constants, two errors, running in opposite directions.
|
|
104
|
+
*/
|
|
105
|
+
export const LABEL_LINE_HEIGHT: 1.4375;
|
|
106
|
+
export namespace FLOATING_LABEL_STYLE {
|
|
107
|
+
export namespace small_1 {
|
|
108
|
+
let resting: string;
|
|
109
|
+
let shrunk: string;
|
|
110
|
+
}
|
|
111
|
+
export { small_1 as small };
|
|
112
|
+
export namespace medium_1 {
|
|
113
|
+
let resting_1: string;
|
|
114
|
+
export { resting_1 as resting };
|
|
115
|
+
let shrunk_1: string;
|
|
116
|
+
export { shrunk_1 as shrunk };
|
|
117
|
+
}
|
|
118
|
+
export { medium_1 as medium };
|
|
119
|
+
export namespace large_1 {
|
|
120
|
+
let resting_2: string;
|
|
121
|
+
export { resting_2 as resting };
|
|
122
|
+
let shrunk_2: string;
|
|
123
|
+
export { shrunk_2 as shrunk };
|
|
124
|
+
}
|
|
125
|
+
export { large_1 as large };
|
|
126
|
+
}
|
|
127
|
+
/** Space between a start adornment and the text after it.
|
|
128
|
+
*
|
|
129
|
+
* Load-bearing in two places that must agree: the adornment's marginRight and
|
|
130
|
+
* the label's x offset. Split across two numbers (a 4px margin plus a 4px
|
|
131
|
+
* input padding) they drifted apart — the label sat 4px off the text it is
|
|
132
|
+
* supposed to be the label FOR. One constant, used by both. */
|
|
133
|
+
export const ADORNMENT_GAP: 8;
|
|
32
134
|
export function PrimaryOutlineInput(p: any): JSX.Element;
|
|
33
135
|
export function SecondaryOutlineInput(p: any): JSX.Element;
|
|
34
136
|
export function TertiaryOutlineInput(p: any): JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export function Snackbar({ children, open, onClose, variant, color, size, anchor, autoHideDuration, startDecorator, endDecorator, action, className, sx, ...props }: {
|
|
1
|
+
export function Snackbar({ children, open, onClose, variant, surface, color, size, anchor, autoHideDuration, startDecorator, endDecorator, action, className, sx, ...props }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
children: any;
|
|
4
4
|
open?: boolean;
|
|
5
5
|
onClose: any;
|
|
6
6
|
variant?: string;
|
|
7
|
+
surface: any;
|
|
7
8
|
color?: string;
|
|
8
9
|
size?: string;
|
|
9
10
|
anchor?: string;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* @param {object} sx - Additional MUI sx props
|
|
22
22
|
* @param {object} ...props - Other MUI TextField props
|
|
23
23
|
*/
|
|
24
|
-
export function TextField({ label, value, onChange, placeholder, error, errorMessage, disabled, helperText, variant, size, type, required, fullWidth, startAdornment, endAdornment, sx, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }: string): JSX.Element;
|
|
24
|
+
export function TextField({ label, value, onChange, placeholder, error, errorMessage, disabled, helperText, variant, size, type, required, fullWidth, startAdornment, endAdornment, sx, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, onFocus: onFocusProp, onBlur: onBlurProp, ...props }: string): JSX.Element;
|
|
25
25
|
/**
|
|
26
26
|
* Email TextField
|
|
27
27
|
* Pre-configured for email input with validation
|
|
@@ -77,20 +77,34 @@ export function URLTextField({ label, placeholder, ...props }: {
|
|
|
77
77
|
* Textarea Component
|
|
78
78
|
* Multi-line text input
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
/**
|
|
81
|
+
* TextArea — Input, multiline.
|
|
82
|
+
*
|
|
83
|
+
* A thin delegation, not a component. It used to be a second implementation
|
|
84
|
+
* wrapping MUI's TextField directly, and the two had drifted apart in every
|
|
85
|
+
* way that matters:
|
|
86
|
+
*
|
|
87
|
+
* - No borderRadius at all, so it inherited MUI's corner instead of
|
|
88
|
+
* --Input-Radius. A TextArea beside a TextInput had a visibly different
|
|
89
|
+
* corner, and the STUDIO ships a CSS override to paper over it
|
|
90
|
+
* (libRadiusOverrideCSS) whose own comment says "the real fix is for the
|
|
91
|
+
* lib to read the token". This is that fix — the override can go.
|
|
92
|
+
* - error / errorMessage where Input has validation / validationMessage, so
|
|
93
|
+
* the same state was spelled two ways depending on which control you
|
|
94
|
+
* reached for.
|
|
95
|
+
* - No size, no variant, no colour, no adornments, no floating label.
|
|
96
|
+
*
|
|
97
|
+
* Input already takes multiline / rows / maxRows and renders a <textarea>, so
|
|
98
|
+
* there was never a second thing to build — only a second thing to maintain.
|
|
99
|
+
* The export stays so callers do not break; everything it can do is now
|
|
100
|
+
* everything Input can do.
|
|
101
|
+
*/
|
|
102
|
+
export function TextArea({ error, errorMessage, rows, fullWidth, ...props }: {
|
|
81
103
|
[x: string]: any;
|
|
82
|
-
label: any;
|
|
83
|
-
value?: string;
|
|
84
|
-
onChange: any;
|
|
85
|
-
placeholder: any;
|
|
86
104
|
error?: boolean;
|
|
87
105
|
errorMessage?: string;
|
|
88
|
-
disabled?: boolean;
|
|
89
|
-
helperText?: string;
|
|
90
106
|
rows?: number;
|
|
91
|
-
required?: boolean;
|
|
92
107
|
fullWidth?: boolean;
|
|
93
|
-
sx?: {};
|
|
94
108
|
}): JSX.Element;
|
|
95
109
|
/**
|
|
96
110
|
* TextFieldGroup Component
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export function OmniTreeView({ color, variant, density, animation, selectionStyle, items, selectionMode, checkboxSelection, disableSelection, disabledItemsFocusable, defaultExpandedItems, expandedItems, onExpandedItemsChange, selectedItems, onSelectedItemsChange, onItemExpansionToggle, onItemSelectionToggle, slots, "aria-label": ariaLabel, className, sx, ...props }: {
|
|
1
|
+
export function OmniTreeView({ color, variant, surface, density, animation, selectionStyle, items, selectionMode, checkboxSelection, disableSelection, disabledItemsFocusable, defaultExpandedItems, expandedItems, onExpandedItemsChange, selectedItems, onSelectedItemsChange, onItemExpansionToggle, onItemSelectionToggle, slots, "aria-label": ariaLabel, className, sx, ...props }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
color?: string;
|
|
4
4
|
variant?: string;
|
|
5
|
+
surface: any;
|
|
5
6
|
density?: string;
|
|
6
7
|
animation?: string;
|
|
7
8
|
selectionStyle: any;
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export function bevelShadow(color: any, size: any): string;
|
|
15
15
|
export const SHADOW_LEVEL_0: "none";
|
|
16
|
-
export const SHADOW_LEVEL_1:
|
|
17
|
-
export const SHADOW_LEVEL_2:
|
|
18
|
-
export const SHADOW_LEVEL_3:
|
|
19
|
-
export const SHADOW_LEVEL_4:
|
|
20
|
-
export const SHADOW_LEVEL_5:
|
|
16
|
+
export const SHADOW_LEVEL_1: string;
|
|
17
|
+
export const SHADOW_LEVEL_2: string;
|
|
18
|
+
export const SHADOW_LEVEL_3: string;
|
|
19
|
+
export const SHADOW_LEVEL_4: string;
|
|
20
|
+
export const SHADOW_LEVEL_5: string;
|
|
21
21
|
export const SHADOWS: {
|
|
22
22
|
0: string;
|
|
23
23
|
1: string;
|
|
@@ -26,6 +26,7 @@ declare const _default: {};
|
|
|
26
26
|
export default _default;
|
|
27
27
|
export { OmniStack as DynoStack } from "./Stack/Stack";
|
|
28
28
|
export { OmniTreeView as DynoTreeView } from "./TreeView/TreeView";
|
|
29
|
+
export * as chartGeometry from "./Charts/geometry";
|
|
29
30
|
export { Typography, CAP_HEIGHT_TRIM, Heading, DisplayLarge, DisplayMedium, DisplaySmall, H1, H2, H3, H4, H5, H6, Body, Body1, Body2, BodySemibold, BodyBold, BodySmall, BodySmallSemibold, BodySmallBold, BodyLarge, BodyLargeSemibold, BodyLargeBold, Caption, CaptionBold, Subtitle, Subtitle1, Subtitle2, SubtitleSmall, SubtitleMedium, SubtitleLarge, Legal, LegalSemibold, Label, LabelExtraSmall, LabelSmall, LabelLarge, Eyebrow, EyebrowSmall, EyebrowMedium, EyebrowLarge, Overline, OverlineSmall, OverlineMedium, OverlineLarge, NumberSmall, NumberMedium, NumberLarge, Button as ButtonText, ButtonSmall } from "./Typography";
|
|
30
31
|
export { Icon, IconShowcase } from "./Icon";
|
|
31
32
|
export { Fab, FabShowcase } from "./Fab";
|
|
@@ -72,3 +73,4 @@ export { Accordion, AccordionSummary, AccordionDetails, AccordionGroup } from ".
|
|
|
72
73
|
export { OmniTreeView, SolidTreeView, LightTreeView, DEFAULT_ITEMS, TreeBranch, TreeViewShowcase } from "./TreeView";
|
|
73
74
|
export { OmniDesignProvider, useOmniDesign, ThemedZone, Surfaced } from "../OmniDesignProvider";
|
|
74
75
|
export { CodeBlock, CopyButton } from "./CodeBlock/CodeBlock";
|
|
76
|
+
export { BarChart, LineChart, PieChart, CHART_TOKENS, CHART_LABEL_TYPE } from "./Charts";
|
package/package.json
CHANGED