@lt-three/love3 0.1.0 → 0.1.1
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/README.md +40 -40
- package/dist/native/analytics/animation.d.ts +1 -1
- package/dist/native/analytics/animation.js +1 -1
- package/dist/native/analytics/chart.types.d.ts +3 -3
- package/dist/native/analytics/metric-card.d.ts +3 -3
- package/dist/native/analytics/metric-card.js +3 -3
- package/dist/native/analytics/multi-line-chart.d.ts +9 -8
- package/dist/native/analytics/multi-line-chart.js +14 -13
- package/dist/native/analytics/pie-chart.d.ts +7 -7
- package/dist/native/analytics/pie-chart.js +8 -8
- package/dist/native/analytics/single-number.d.ts +4 -4
- package/dist/native/analytics/single-number.js +2 -2
- package/dist/native/atom/avatar.d.ts +6 -6
- package/dist/native/atom/avatar.js +2 -2
- package/dist/native/atom/badge.d.ts +5 -5
- package/dist/native/atom/button.d.ts +12 -12
- package/dist/native/atom/button.js +8 -8
- package/dist/native/atom/checkbox.d.ts +4 -4
- package/dist/native/atom/checkbox.js +2 -2
- package/dist/native/atom/colored-value.d.ts +4 -4
- package/dist/native/atom/colored-value.js +4 -4
- package/dist/native/atom/image.d.ts +7 -7
- package/dist/native/atom/image.js +2 -2
- package/dist/native/atom/label.d.ts +5 -5
- package/dist/native/atom/label.js +2 -2
- package/dist/native/atom/link.d.ts +5 -5
- package/dist/native/atom/link.js +5 -5
- package/dist/native/atom/readout.d.ts +7 -7
- package/dist/native/atom/readout.js +3 -3
- package/dist/native/atom/search-input.d.ts +2 -2
- package/dist/native/atom/search-input.js +2 -2
- package/dist/native/atom/select.d.ts +14 -14
- package/dist/native/atom/select.js +8 -8
- package/dist/native/atom/separator.d.ts +2 -3
- package/dist/native/atom/separator.js +2 -3
- package/dist/native/atom/skeleton.d.ts +3 -3
- package/dist/native/atom/skeleton.js +3 -3
- package/dist/native/atom/slider.d.ts +6 -6
- package/dist/native/atom/slider.js +3 -3
- package/dist/native/atom/spinner.d.ts +4 -4
- package/dist/native/atom/spinner.js +2 -2
- package/dist/native/atom/switch.d.ts +4 -4
- package/dist/native/atom/switch.js +3 -3
- package/dist/native/atom/symbol.d.ts +7 -7
- package/dist/native/atom/symbol.js +7 -7
- package/dist/native/atom/symbol.types.d.ts +8 -8
- package/dist/native/atom/symbol.types.js +7 -7
- package/dist/native/atom/text-field.d.ts +15 -15
- package/dist/native/atom/text-field.js +5 -5
- package/dist/native/atom/theme-toggle.d.ts +7 -7
- package/dist/native/atom/theme-toggle.js +4 -4
- package/dist/native/atom/timezone-select.d.ts +5 -5
- package/dist/native/atom/timezone-select.js +4 -4
- package/dist/native/atom/typography.d.ts +2 -2
- package/dist/native/atom/typography.js +2 -2
- package/dist/native/base/button.d.ts +13 -13
- package/dist/native/base/button.js +4 -4
- package/dist/native/base/form.d.ts +15 -15
- package/dist/native/base/form.js +11 -11
- package/dist/native/base/glass-card.d.ts +3 -3
- package/dist/native/base/glass-card.js +3 -3
- package/dist/native/base/input.d.ts +8 -8
- package/dist/native/base/input.js +7 -7
- package/dist/native/base/sheet.d.ts +27 -27
- package/dist/native/base/sheet.js +15 -15
- package/dist/native/form/checkbox.d.ts +3 -3
- package/dist/native/form/checkbox.js +2 -2
- package/dist/native/form/date-picker.d.ts +9 -9
- package/dist/native/form/date-picker.js +9 -9
- package/dist/native/form/form.d.ts +5 -6
- package/dist/native/form/form.js +4 -5
- package/dist/native/form/radio-group.d.ts +5 -5
- package/dist/native/form/radio-group.js +4 -4
- package/dist/native/form/select.d.ts +2 -2
- package/dist/native/form/select.js +2 -2
- package/dist/native/form/slider.d.ts +2 -2
- package/dist/native/form/slider.js +2 -2
- package/dist/native/form/switch.d.ts +2 -2
- package/dist/native/form/switch.js +2 -2
- package/dist/native/form/text-area.d.ts +2 -2
- package/dist/native/form/text-area.js +1 -1
- package/dist/native/form/text-input.d.ts +5 -5
- package/dist/native/form/text-input.js +8 -8
- package/dist/native/layout/accordion.d.ts +5 -5
- package/dist/native/layout/accordion.js +2 -2
- package/dist/native/layout/card.d.ts +8 -8
- package/dist/native/layout/card.js +3 -3
- package/dist/native/layout/description.d.ts +2 -2
- package/dist/native/layout/description.js +2 -2
- package/dist/native/layout/error.d.ts +5 -5
- package/dist/native/layout/error.js +2 -2
- package/dist/native/layout/information.d.ts +4 -4
- package/dist/native/layout/information.js +3 -3
- package/dist/native/layout/locked.d.ts +15 -15
- package/dist/native/layout/locked.js +7 -7
- package/dist/native/layout/modal.d.ts +8 -8
- package/dist/native/layout/modal.js +5 -5
- package/dist/native/layout/not-found.d.ts +4 -4
- package/dist/native/layout/not-found.js +3 -3
- package/dist/native/layout/page-frame.d.ts +8 -8
- package/dist/native/layout/page-frame.js +3 -3
- package/dist/native/layout/panel.d.ts +5 -5
- package/dist/native/layout/panel.js +5 -5
- package/dist/native/layout/reorderable-list.d.ts +14 -14
- package/dist/native/layout/reorderable-list.js +10 -10
- package/dist/native/layout/sheet.d.ts +10 -10
- package/dist/native/layout/sheet.js +4 -4
- package/dist/native/layout/simple-dialog.d.ts +3 -3
- package/dist/native/layout/simple-dialog.js +2 -2
- package/dist/native/layout/simple-table.d.ts +18 -18
- package/dist/native/layout/simple-table.js +1 -1
- package/dist/native/layout/tab-bar.d.ts +10 -10
- package/dist/native/layout/tab-bar.js +4 -4
- package/dist/native/layout/tabs.d.ts +6 -6
- package/dist/native/layout/tabs.js +4 -4
- package/dist/native/layout/tuning-panel.d.ts +10 -10
- package/dist/native/layout/tuning-panel.js +15 -15
- package/dist/native/lib/autocomplete.d.ts +1 -1
- package/dist/native/lib/autocomplete.js +1 -1
- package/dist/native/lib/breakpoints.d.ts +3 -3
- package/dist/native/lib/breakpoints.js +3 -3
- package/dist/native/lib/chart-palette.d.ts +2 -2
- package/dist/native/lib/chart-palette.js +2 -2
- package/dist/native/lib/confirm.d.ts +15 -16
- package/dist/native/lib/confirm.js +9 -10
- package/dist/native/lib/control.d.ts +9 -9
- package/dist/native/lib/external-store.d.ts +4 -5
- package/dist/native/lib/keyboard.d.ts +7 -7
- package/dist/native/lib/keyboard.js +7 -7
- package/dist/native/lib/labels.d.ts +6 -6
- package/dist/native/lib/labels.js +6 -6
- package/dist/native/lib/loading.d.ts +3 -3
- package/dist/native/lib/loading.js +3 -3
- package/dist/native/lib/network.d.ts +5 -6
- package/dist/native/lib/network.js +5 -6
- package/dist/native/lib/scheme.d.ts +7 -7
- package/dist/native/lib/scheme.js +3 -3
- package/dist/native/lib/snackbar.d.ts +12 -13
- package/dist/native/lib/snackbar.js +7 -8
- package/dist/native/lib/theme.d.ts +15 -15
- package/dist/native/lib/theme.js +15 -15
- package/dist/native/lib/timezone.d.ts +13 -13
- package/dist/native/lib/timezone.js +13 -13
- package/dist/native/lib/token-color.d.ts +1 -1
- package/dist/native/lib/token-color.js +1 -1
- package/dist/native/lib/tuning-context.d.ts +2 -2
- package/dist/native/lib/tuning.d.ts +10 -10
- package/dist/native/lib/tuning.js +8 -8
- package/dist/native/lib/typography.d.ts +3 -3
- package/dist/native/lib/typography.js +3 -3
- package/dist/native/lib/utils.d.ts +3 -3
- package/dist/native/lib/utils.js +3 -3
- package/dist/native/once/confirm.d.ts +2 -2
- package/dist/native/once/confirm.js +2 -2
- package/dist/native/once/error-boundary.d.ts +3 -3
- package/dist/native/once/error-boundary.js +2 -2
- package/dist/native/once/loading-lock.d.ts +3 -3
- package/dist/native/once/loading-lock.js +3 -3
- package/dist/native/once/offline-banner.d.ts +6 -6
- package/dist/native/once/offline-banner.js +5 -5
- package/dist/native/once/snackbar.d.ts +7 -7
- package/dist/native/once/snackbar.js +5 -5
- package/dist/native/styles.css +21 -21
- package/dist/shared/analytics.d.ts +23 -23
- package/dist/shared/button.d.ts +1 -1
- package/dist/shared/form.d.ts +7 -7
- package/dist/shared/form.js +2 -2
- package/dist/tokens/contrast-pairs.d.ts +9 -9
- package/dist/tokens/contrast-pairs.js +10 -10
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/styles.gen.css +87 -87
- package/dist/tokens/tokens.gen.d.ts +2 -2
- package/dist/tokens/tokens.gen.js +2 -2
- package/dist/tuning/catalog.d.ts +8 -8
- package/dist/tuning/catalog.js +9 -9
- package/dist/tuning/color.d.ts +4 -4
- package/dist/tuning/color.js +5 -5
- package/dist/tuning/css.d.ts +13 -13
- package/dist/tuning/css.js +17 -17
- package/dist/tuning/model.d.ts +11 -11
- package/dist/tuning/model.js +11 -11
- package/dist/tuning/native.d.ts +18 -18
- package/dist/tuning/native.js +18 -18
- package/dist/tuning/schema.d.ts +15 -15
- package/dist/tuning/schema.js +22 -22
- package/dist/tuning/types.d.ts +25 -25
- package/dist/tuning/types.js +6 -6
- package/dist/web/analytics/line-chart.d.ts +6 -6
- package/dist/web/analytics/line-chart.js +3 -3
- package/dist/web/analytics/metric-card.d.ts +6 -6
- package/dist/web/analytics/metric-card.js +5 -5
- package/dist/web/analytics/multi-line-chart.d.ts +23 -23
- package/dist/web/analytics/multi-line-chart.js +33 -33
- package/dist/web/atom/avatar.d.ts +1 -1
- package/dist/web/atom/checkbox.d.ts +6 -6
- package/dist/web/atom/checkbox.js +2 -2
- package/dist/web/atom/colored-value.d.ts +4 -4
- package/dist/web/atom/colored-value.js +4 -4
- package/dist/web/atom/help.d.ts +1 -1
- package/dist/web/atom/segmented-control.d.ts +13 -14
- package/dist/web/atom/segmented-control.js +6 -7
- package/dist/web/atom/select.d.ts +7 -7
- package/dist/web/atom/select.js +5 -5
- package/dist/web/atom/slider.d.ts +3 -3
- package/dist/web/atom/slider.js +2 -2
- package/dist/web/atom/switch.d.ts +3 -3
- package/dist/web/atom/text-area.d.ts +9 -8
- package/dist/web/atom/text-area.js +9 -8
- package/dist/web/atom/text-field.d.ts +5 -4
- package/dist/web/atom/text-field.js +5 -4
- package/dist/web/atom/toggle-chip.d.ts +6 -6
- package/dist/web/atom/toggle-chip.js +4 -4
- package/dist/web/atom/tooltip.d.ts +6 -6
- package/dist/web/atom/tooltip.js +2 -2
- package/dist/web/base/accordion.js +1 -1
- package/dist/web/base/breadcrumb.d.ts +1 -1
- package/dist/web/base/breadcrumb.js +1 -1
- package/dist/web/base/card.d.ts +3 -3
- package/dist/web/base/card.js +2 -2
- package/dist/web/base/dialog.d.ts +1 -1
- package/dist/web/base/dialog.js +1 -1
- package/dist/web/base/form.d.ts +7 -7
- package/dist/web/base/form.js +5 -5
- package/dist/web/base/pagination.d.ts +5 -5
- package/dist/web/base/pagination.js +1 -1
- package/dist/web/base/sheet.d.ts +1 -1
- package/dist/web/base/sheet.js +1 -1
- package/dist/web/base/slider.d.ts +1 -1
- package/dist/web/base/sonner.d.ts +2 -2
- package/dist/web/base/sonner.js +2 -2
- package/dist/web/base/spinner.js +1 -1
- package/dist/web/form/checkbox.d.ts +8 -8
- package/dist/web/form/checkbox.js +3 -3
- package/dist/web/form/radio-group.js +3 -3
- package/dist/web/form/select.js +1 -1
- package/dist/web/form/slider.d.ts +3 -3
- package/dist/web/form/slider.js +3 -3
- package/dist/web/form/switch.d.ts +3 -3
- package/dist/web/form/switch.js +4 -4
- package/dist/web/form/text-area.js +1 -1
- package/dist/web/form/text-input.d.ts +1 -1
- package/dist/web/form/text-input.js +1 -1
- package/dist/web/layout/accordion.d.ts +5 -5
- package/dist/web/layout/accordion.js +2 -2
- package/dist/web/layout/alert-modal.d.ts +11 -11
- package/dist/web/layout/alert-modal.js +7 -7
- package/dist/web/layout/card.d.ts +1 -1
- package/dist/web/layout/information.d.ts +9 -9
- package/dist/web/layout/information.js +7 -7
- package/dist/web/layout/modal.d.ts +1 -1
- package/dist/web/layout/page-frame.d.ts +14 -14
- package/dist/web/layout/page-frame.js +7 -7
- package/dist/web/layout/scroll-area.d.ts +1 -1
- package/dist/web/layout/sheet.d.ts +4 -4
- package/dist/web/layout/simple-table.d.ts +18 -18
- package/dist/web/layout/simple-table.js +2 -2
- package/dist/web/layout/tabs.d.ts +4 -4
- package/dist/web/layout/titled-modal.d.ts +10 -11
- package/dist/web/layout/titled-modal.js +7 -8
- package/dist/web/lib/css-vars.d.ts +6 -6
- package/dist/web/lib/css-vars.js +5 -5
- package/dist/web/lib/dialog.d.ts +4 -4
- package/dist/web/lib/labels.d.ts +8 -8
- package/dist/web/lib/labels.js +8 -8
- package/dist/web/lib/modal-open-focus.d.ts +7 -7
- package/dist/web/lib/modal-open-focus.js +9 -9
- package/dist/web/lib/restore-focus.d.ts +4 -4
- package/dist/web/lib/restore-focus.js +4 -4
- package/dist/web/styles.css +33 -33
- package/package.json +2 -2
|
@@ -2,38 +2,38 @@ import { ChartCommonProps, MultiLineChartSharedProps } from "../../shared/analyt
|
|
|
2
2
|
import { CSSProperties } from "react";
|
|
3
3
|
//#region src/web/analytics/multi-line-chart.d.ts
|
|
4
4
|
export type MultiLineChartProps = ChartCommonProps & MultiLineChartSharedProps & {
|
|
5
|
-
/**
|
|
5
|
+
/** Style passed to the outer element (corresponds to native's `style: ViewStyle`). */
|
|
6
6
|
style?: CSSProperties;
|
|
7
7
|
className?: string;
|
|
8
|
-
/**
|
|
8
|
+
/** Whether to show the legend (shown by default. Native's `MultiLineChart` shows it even for a single series). */
|
|
9
9
|
legend?: boolean;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* Whether to show the hidden table for screen readers (series, label, value) (shown by default).
|
|
12
|
+
* The name of the figure (`accessibilityLabel`) alone cannot convey the exact values, so the same values are also held in an HTML table.
|
|
13
|
+
* Values go through the same formatting as `formatValue`. **When a series has more than 60 points, 60 are sampled at even intervals so the DOM does not grow**,
|
|
14
|
+
* and a sentence before the table says so (if you need the exact value of every point, provide your own table or a CSV).
|
|
15
15
|
*/
|
|
16
16
|
table?: boolean;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* A multi-series line chart. Same API as native's `analytics/multi-line-chart` (`shared/analytics.ts`).
|
|
20
|
+
* It is drawn with `@tanstack/charts` (SVG). Grid lines are thin 1px lines, the colours are `--chart-1` to `--chart-5`, and the tooltip is an overlay surface + a shadow.
|
|
21
21
|
*
|
|
22
|
-
* -
|
|
23
|
-
*
|
|
24
|
-
* -
|
|
25
|
-
*
|
|
26
|
-
* -
|
|
27
|
-
*
|
|
28
|
-
* -
|
|
29
|
-
* - `formatValue`
|
|
30
|
-
*
|
|
31
|
-
* `series`
|
|
32
|
-
* -
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* -
|
|
36
|
-
* -
|
|
22
|
+
* - **Non-numeric points are dropped**: points whose `y` (or `t`) is not finite (NaN, Infinity) are removed before building
|
|
23
|
+
* (they are not in the table for screen readers either, and the number removed is noted with the table). If everything is removed, `emptyText`
|
|
24
|
+
* - When every series has `t`, **the horizontal position is decided by time**. If even one lacks it, each series is placed at even intervals in its own order
|
|
25
|
+
* (that is fine for a single series; when overlaying series with different steps, provide `t`). A series with a single point is drawn as a dot
|
|
26
|
+
* - There are at most three x-axis ticks, at the first, middle and last positions (a number that does not overlap when there are few points). **The label comes from the nearest point of the first series**
|
|
27
|
+
* (when placing by time, a time that exists only in the second or later series does not become a label). It is placed at the point's position
|
|
28
|
+
* - There are three y-axis ticks, top, middle and bottom. So the line does not collapse even when all points have the same value, it is moved up and down only when the range is zero
|
|
29
|
+
* - The default of `formatValue` has **a number of digits that depends on the data's range** (ticks can be told apart even for values from 0 to 1). Ticks, the tooltip and the table for screen readers
|
|
30
|
+
* go through the same formatting. When you pass one, **keep the function reference stable** (a new function every time rebuilds the chart on every render and closes the tooltip).
|
|
31
|
+
* The same goes for `series` (pass a reference the parent does not recreate)
|
|
32
|
+
* - On hover and focus, the tooltip shows the value of each series' point at that position (arrow keys also move it by keyboard), with the series name and colour.
|
|
33
|
+
* **Outside the range where a series has points (up to half the point spacing at the ends), no row is shown for that series** (so a far-away point's value does not look like the value at that position).
|
|
34
|
+
* When the point's label differs from the title, it is added to the row
|
|
35
|
+
* - Reading: the figure is `role="img"` named by `accessibilityLabel` (a summary). The exact values are also held in a hidden table (`table`)
|
|
36
|
+
* - **Series are not told apart by colour alone**: the legend has the series names, and secondary series can be dashed
|
|
37
37
|
*/
|
|
38
38
|
export declare function MultiLineChart({ series, height, formatValue, emptyText, accessibilityLabel, style, className, legend, table }: MultiLineChartProps): import("react").JSX.Element;
|
|
39
39
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
1
2
|
import { LINE_CHART_DEFAULT_LABEL, LINE_CHART_EMPTY_TEXT, LINE_CHART_TABLE_POINT_LABEL, LINE_CHART_TABLE_SERIES_LABEL, LINE_CHART_TABLE_VALUE_LABEL, lineChartTableDropped, lineChartTableThinned } from "../lib/labels.js";
|
|
2
3
|
import { cssVars } from "../lib/css-vars.js";
|
|
3
|
-
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { defineChart, dot, lineY } from "@tanstack/charts";
|
|
@@ -10,7 +10,7 @@ import { tooltip } from "@tanstack/charts/tooltip";
|
|
|
10
10
|
|
|
11
11
|
//#region src/web/analytics/multi-line-chart.tsx
|
|
12
12
|
const DEFAULT_HEIGHT = 220;
|
|
13
|
-
/**
|
|
13
|
+
/** The maximum number of rows per series in the table for screen readers. */
|
|
14
14
|
const MAX_TABLE_ROWS_PER_SERIES = 60;
|
|
15
15
|
const THEME = {
|
|
16
16
|
foreground: "var(--foreground)",
|
|
@@ -25,21 +25,21 @@ const THEME = {
|
|
|
25
25
|
"var(--chart-5)"
|
|
26
26
|
]
|
|
27
27
|
};
|
|
28
|
-
/**
|
|
28
|
+
/** Grid lines are thin 1px lines (`--line`). The library's default opacity of 0.11 is not applied, and the token colour is used as is. */
|
|
29
29
|
const GRID_LINE = {
|
|
30
30
|
stroke: "var(--line)",
|
|
31
31
|
strokeOpacity: 1,
|
|
32
32
|
strokeWidth: 1
|
|
33
33
|
};
|
|
34
|
-
/**
|
|
34
|
+
/** The axis baseline is one step darker than the grid lines (`--line-strong`). */
|
|
35
35
|
const AXIS_LINE = {
|
|
36
36
|
stroke: "var(--line-strong)",
|
|
37
37
|
strokeOpacity: 1,
|
|
38
38
|
strokeWidth: 1
|
|
39
39
|
};
|
|
40
|
-
/**
|
|
40
|
+
/** Do not fade tick label text (the default is 0.68). */
|
|
41
41
|
const TICK_LABELS = { opacity: 1 };
|
|
42
|
-
/**
|
|
42
|
+
/** Focus when entering the figure (`svg tabindex=0`) by keyboard is the same opaque ring as other components (no low alpha; 2px offset). */
|
|
43
43
|
const FOCUS_RING = "[&_svg:focus-visible]:rounded-control [&_svg:focus-visible]:ring-2 [&_svg:focus-visible]:ring-ring [&_svg:focus-visible]:ring-offset-2 [&_svg:focus-visible]:ring-offset-background [&_svg:focus-visible]:outline-none";
|
|
44
44
|
const TOOLTIP_VARS = cssVars({
|
|
45
45
|
"--ts-chart-tooltip-background": "var(--overlay)",
|
|
@@ -51,24 +51,24 @@ const TOOLTIP_VARS = cssVars({
|
|
|
51
51
|
"--ts-chart-tooltip-font": "400 12px/16px var(--font-sans)"
|
|
52
52
|
});
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
54
|
+
* A multi-series line chart. Same API as native's `analytics/multi-line-chart` (`shared/analytics.ts`).
|
|
55
|
+
* It is drawn with `@tanstack/charts` (SVG). Grid lines are thin 1px lines, the colours are `--chart-1` to `--chart-5`, and the tooltip is an overlay surface + a shadow.
|
|
56
56
|
*
|
|
57
|
-
* -
|
|
58
|
-
*
|
|
59
|
-
* -
|
|
60
|
-
*
|
|
61
|
-
* -
|
|
62
|
-
*
|
|
63
|
-
* -
|
|
64
|
-
* - `formatValue`
|
|
65
|
-
*
|
|
66
|
-
* `series`
|
|
67
|
-
* -
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* -
|
|
71
|
-
* -
|
|
57
|
+
* - **Non-numeric points are dropped**: points whose `y` (or `t`) is not finite (NaN, Infinity) are removed before building
|
|
58
|
+
* (they are not in the table for screen readers either, and the number removed is noted with the table). If everything is removed, `emptyText`
|
|
59
|
+
* - When every series has `t`, **the horizontal position is decided by time**. If even one lacks it, each series is placed at even intervals in its own order
|
|
60
|
+
* (that is fine for a single series; when overlaying series with different steps, provide `t`). A series with a single point is drawn as a dot
|
|
61
|
+
* - There are at most three x-axis ticks, at the first, middle and last positions (a number that does not overlap when there are few points). **The label comes from the nearest point of the first series**
|
|
62
|
+
* (when placing by time, a time that exists only in the second or later series does not become a label). It is placed at the point's position
|
|
63
|
+
* - There are three y-axis ticks, top, middle and bottom. So the line does not collapse even when all points have the same value, it is moved up and down only when the range is zero
|
|
64
|
+
* - The default of `formatValue` has **a number of digits that depends on the data's range** (ticks can be told apart even for values from 0 to 1). Ticks, the tooltip and the table for screen readers
|
|
65
|
+
* go through the same formatting. When you pass one, **keep the function reference stable** (a new function every time rebuilds the chart on every render and closes the tooltip).
|
|
66
|
+
* The same goes for `series` (pass a reference the parent does not recreate)
|
|
67
|
+
* - On hover and focus, the tooltip shows the value of each series' point at that position (arrow keys also move it by keyboard), with the series name and colour.
|
|
68
|
+
* **Outside the range where a series has points (up to half the point spacing at the ends), no row is shown for that series** (so a far-away point's value does not look like the value at that position).
|
|
69
|
+
* When the point's label differs from the title, it is added to the row
|
|
70
|
+
* - Reading: the figure is `role="img"` named by `accessibilityLabel` (a summary). The exact values are also held in a hidden table (`table`)
|
|
71
|
+
* - **Series are not told apart by colour alone**: the legend has the series names, and secondary series can be dashed
|
|
72
72
|
*/
|
|
73
73
|
function MultiLineChart({ series, height = DEFAULT_HEIGHT, formatValue, emptyText = LINE_CHART_EMPTY_TEXT, accessibilityLabel, style, className, legend = true, table = true }) {
|
|
74
74
|
const label = accessibilityLabel ?? defaultLabel(series);
|
|
@@ -119,19 +119,19 @@ function MultiLineChart({ series, height = DEFAULT_HEIGHT, formatValue, emptyTex
|
|
|
119
119
|
]
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
/**
|
|
122
|
+
/** The name when there is no summary. It lists the series names. */
|
|
123
123
|
function defaultLabel(series) {
|
|
124
124
|
const names = series.map((entry) => entry.label).filter((name) => name !== "");
|
|
125
125
|
return names.length === 0 ? LINE_CHART_DEFAULT_LABEL : `${names.join("・")}の${LINE_CHART_DEFAULT_LABEL}`;
|
|
126
126
|
}
|
|
127
|
-
/**
|
|
127
|
+
/** Samples at even intervals down to at most `limit` items (the first and the last are always kept). */
|
|
128
128
|
function thin(items, limit) {
|
|
129
129
|
if (items.length <= limit) return [...items];
|
|
130
130
|
const picked = /* @__PURE__ */ new Set();
|
|
131
131
|
for (let i = 0; i < limit; i += 1) picked.add(Math.round(i * (items.length - 1) / (limit - 1)));
|
|
132
132
|
return [...picked].sort((a, b) => a - b).flatMap((index) => items[index] === void 0 ? [] : [items[index]]);
|
|
133
133
|
}
|
|
134
|
-
/**
|
|
134
|
+
/** The table hidden for screen readers. It is not shown on screen (sr-only). Values go through the same formatting as the figure's ticks. */
|
|
135
135
|
function DataTable({ caption, model }) {
|
|
136
136
|
const total = model.series.reduce((sum, entry) => sum + entry.points.length, 0);
|
|
137
137
|
const shownSeries = model.series.map((entry) => ({
|
|
@@ -173,7 +173,7 @@ function DataTable({ caption, model }) {
|
|
|
173
173
|
]
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
/** `y
|
|
176
|
+
/** Draws only points whose `y` (and `t`) are finite. NaN and Infinity break the scale, so they are dropped before building. */
|
|
177
177
|
function isUsable(point) {
|
|
178
178
|
return Number.isFinite(point.y) && (point.t === void 0 || Number.isFinite(point.t));
|
|
179
179
|
}
|
|
@@ -194,18 +194,18 @@ function buildModel(series, formatValue) {
|
|
|
194
194
|
format: built.format
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
|
-
/**
|
|
197
|
+
/** The point nearest to a position. */
|
|
198
198
|
function nearestRow(entry, position) {
|
|
199
199
|
let best;
|
|
200
200
|
for (const row of entry) if (best === void 0 || Math.abs(row.x - position) < Math.abs(best.x - position)) best = row;
|
|
201
201
|
return best;
|
|
202
202
|
}
|
|
203
|
-
/**
|
|
203
|
+
/** When every series has `t`, place by time. */
|
|
204
204
|
function isTimed(series) {
|
|
205
205
|
const times = series.flatMap((entry) => entry.points.map((point) => point.t));
|
|
206
206
|
return times.length > 0 && times.every((time) => time !== void 0);
|
|
207
207
|
}
|
|
208
|
-
/**
|
|
208
|
+
/** The horizontal position of a point (by time when there is time, otherwise its order within the series, mapped to 0 to 1). */
|
|
209
209
|
function positionOf(timed, index, count, point) {
|
|
210
210
|
if (timed && point.t !== void 0) return point.t;
|
|
211
211
|
return count === 1 ? .5 : index / (count - 1);
|
|
@@ -220,15 +220,15 @@ function extent(values) {
|
|
|
220
220
|
return [min, max];
|
|
221
221
|
}
|
|
222
222
|
/**
|
|
223
|
-
*
|
|
224
|
-
* 0
|
|
223
|
+
* The default formatting. It takes the number of digits that lets the tick spacing (half the range, since there are three ticks, top, middle and bottom) be told apart, and adds one more digit (0 to 6 digits).
|
|
224
|
+
* Values from 0 to 1 get 2 digits, and a range of 100 or more gives integers. The tooltip and the table for screen readers use the same formatting.
|
|
225
225
|
*/
|
|
226
226
|
function autoFormat(low, high) {
|
|
227
227
|
const step = (high - low) / 2;
|
|
228
228
|
const digits = step > 0 && Number.isFinite(step) ? Math.min(6, Math.max(0, Math.ceil(-Math.log10(step)) + 1)) : 0;
|
|
229
229
|
return (value) => (value === 0 ? 0 : value).toFixed(digits);
|
|
230
230
|
}
|
|
231
|
-
/**
|
|
231
|
+
/** How far outside a series' point range its row is still shown (half the point spacing; for a single point, 2% of the x-axis width). */
|
|
232
232
|
function reachOf(entry, domainWidth) {
|
|
233
233
|
if (entry.length < 2) return domainWidth * .02;
|
|
234
234
|
const [min, max] = extent(entry.map((row) => row.x));
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
//#region src/web/atom/avatar.d.ts
|
|
3
3
|
export type AvatarProps = {
|
|
4
4
|
src?: string;
|
|
5
|
-
/**
|
|
5
|
+
/** Alt text for the image. Empty by default (decorative; assumes the name is shown next to it). For a standalone face with no name, pass the person's name */
|
|
6
6
|
alt?: string;
|
|
7
7
|
fallback?: React.ReactNode;
|
|
8
8
|
className?: string;
|
|
@@ -2,18 +2,18 @@ import { Checkbox as Checkbox$1 } from "../base/checkbox.js";
|
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
3
|
//#region src/web/atom/checkbox.d.ts
|
|
4
4
|
export type CheckboxProps = Omit<ComponentProps<typeof Checkbox$1>, "checked" | "onCheckedChange"> & {
|
|
5
|
-
/**
|
|
5
|
+
/** Checked state (controlled mode) */
|
|
6
6
|
checked: boolean;
|
|
7
|
-
/**
|
|
7
|
+
/** Called when the value changes */
|
|
8
8
|
onCheckedChange: (checked: boolean) => void;
|
|
9
|
-
/**
|
|
9
|
+
/** Label shown to the right of the checkbox */
|
|
10
10
|
label?: ReactNode;
|
|
11
|
-
/**
|
|
11
|
+
/** Extra class for the wrapper */
|
|
12
12
|
wrapperClassName?: string;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* `label`
|
|
15
|
+
* A simple Checkbox that does not depend on a form context.
|
|
16
|
+
* Passing `label` adds a clickable label on the right.
|
|
17
17
|
*/
|
|
18
18
|
export declare function Checkbox({ checked, onCheckedChange, label, wrapperClassName, id, ...rest }: CheckboxProps): import("react").JSX.Element;
|
|
19
19
|
//#endregion
|
|
@@ -6,8 +6,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
//#region src/web/atom/checkbox.tsx
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* `label`
|
|
9
|
+
* A simple Checkbox that does not depend on a form context.
|
|
10
|
+
* Passing `label` adds a clickable label on the right.
|
|
11
11
|
*/
|
|
12
12
|
function Checkbox({ checked, onCheckedChange, label, wrapperClassName, id, ...rest }) {
|
|
13
13
|
const generated = useId();
|
|
@@ -3,11 +3,11 @@ import { ReactNode } from "react";
|
|
|
3
3
|
//#region src/web/atom/colored-value.d.ts
|
|
4
4
|
export type ColoredValueProps<TValue> = ColoredValueSharedProps<TValue>;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* A number whose colour changes with its sign. Same API as native's `atom/colored-value` (`shared/analytics.ts`).
|
|
7
|
+
* The default colours are the tokens `state-success` / `state-error` (4.5:1 or more in light and dark), not a fixed Tailwind palette.
|
|
8
|
+
* It is a number, so it is drawn monospaced (tabular).
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* **Do not convey meaning by colour alone.** `format` puts the sign (`+` / `−`) into the value, so the direction is clear even to people who cannot see the colour.
|
|
11
11
|
*/
|
|
12
12
|
export declare function ColoredValue<TValue>({ value, format, isPositive, isNegative, positiveColor, negativeColor, className }: ColoredValueProps<TValue>): ReactNode;
|
|
13
13
|
//#endregion
|
|
@@ -3,11 +3,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
//#region src/web/atom/colored-value.tsx
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* A number whose colour changes with its sign. Same API as native's `atom/colored-value` (`shared/analytics.ts`).
|
|
7
|
+
* The default colours are the tokens `state-success` / `state-error` (4.5:1 or more in light and dark), not a fixed Tailwind palette.
|
|
8
|
+
* It is a number, so it is drawn monospaced (tabular).
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* **Do not convey meaning by colour alone.** `format` puts the sign (`+` / `−`) into the value, so the direction is clear even to people who cannot see the colour.
|
|
11
11
|
*/
|
|
12
12
|
function ColoredValue({ value, format, isPositive, isNegative, positiveColor = "text-state-success", negativeColor = "text-state-error", className }) {
|
|
13
13
|
const formatted = format ? format(value) : String(value);
|
package/dist/web/atom/help.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
//#region src/web/atom/help.d.ts
|
|
3
3
|
type Props = {
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
-
/**
|
|
5
|
+
/** Accessible name of the trigger (it is shown as an icon only, so the name is given here) */
|
|
6
6
|
label?: string;
|
|
7
7
|
};
|
|
8
8
|
export declare function Help({ children, label }: Props): React.JSX.Element;
|
|
@@ -4,7 +4,7 @@ export type SegmentedOption<T extends string | number> = {
|
|
|
4
4
|
value: T;
|
|
5
5
|
label: ReactNode;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
-
/** DEV-E2E: e2e
|
|
7
|
+
/** DEV-E2E: ID used by e2e to identify individual segments */
|
|
8
8
|
testId?: string;
|
|
9
9
|
};
|
|
10
10
|
export type SegmentedControlProps<T extends string | number> = {
|
|
@@ -12,29 +12,28 @@ export type SegmentedControlProps<T extends string | number> = {
|
|
|
12
12
|
onValueChange: (value: T) => void;
|
|
13
13
|
options: SegmentedOption<T>[];
|
|
14
14
|
/**
|
|
15
|
-
* - `joined
|
|
16
|
-
* - `separate`
|
|
17
|
-
* - `underline`
|
|
18
|
-
* - `solid`
|
|
15
|
+
* - `joined` (default) ... share a single border, with a 1px divider between segments
|
|
16
|
+
* - `separate` ... each segment has its own independent border
|
|
17
|
+
* - `underline` ... no border; tabs where only the selected one gets an underline
|
|
18
|
+
* - `solid` ... each segment has a 1px border and the borders overlap with neighbours. The selected one is filled with indigo
|
|
19
19
|
*/
|
|
20
20
|
variant?: "joined" | "separate" | "underline" | "solid";
|
|
21
|
-
/** `md`
|
|
21
|
+
/** `md` is the body size (16/26, pad 9/16). */
|
|
22
22
|
size?: "xs" | "sm" | "md";
|
|
23
|
-
/**
|
|
23
|
+
/** Divide the full width equally among the segments */
|
|
24
24
|
fill?: boolean;
|
|
25
25
|
className?: string;
|
|
26
26
|
"aria-label"?: string;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Horizontal exclusive selection (tabs, mode picker, interval picker, filter kinds).
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
* `role="radiogroup"`
|
|
33
|
-
*
|
|
31
|
+
* The selected segment gets the indigo (action) fill with white text (corner radius is the control step).
|
|
32
|
+
* It sets `role="radiogroup"` and `aria-checked` on each segment, so callers
|
|
33
|
+
* do not have to assemble aria themselves.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* 少しずつ違っていたため、1 つにまとめている。
|
|
35
|
+
* Hand-rolled versions (`.map` over `<button>` with a ternary className) tend to drift in
|
|
36
|
+
* dividers, selected-state styling and keyboard handling, so they are consolidated here.
|
|
38
37
|
*/
|
|
39
38
|
export declare function SegmentedControl<T extends string | number>({ value, onValueChange, options, variant, size, fill, className, "aria-label": ariaLabel }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
40
39
|
//#endregion
|
|
@@ -8,15 +8,14 @@ const SIZE = {
|
|
|
8
8
|
md: "px-4 py-[9px] text-base leading-[26px]"
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Horizontal exclusive selection (tabs, mode picker, interval picker, filter kinds).
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
* `role="radiogroup"`
|
|
15
|
-
*
|
|
13
|
+
* The selected segment gets the indigo (action) fill with white text (corner radius is the control step).
|
|
14
|
+
* It sets `role="radiogroup"` and `aria-checked` on each segment, so callers
|
|
15
|
+
* do not have to assemble aria themselves.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* 少しずつ違っていたため、1 つにまとめている。
|
|
17
|
+
* Hand-rolled versions (`.map` over `<button>` with a ternary className) tend to drift in
|
|
18
|
+
* dividers, selected-state styling and keyboard handling, so they are consolidated here.
|
|
20
19
|
*/
|
|
21
20
|
function SegmentedControl({ value, onValueChange, options, variant = "joined", size = "sm", fill, className, "aria-label": ariaLabel }) {
|
|
22
21
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4,7 +4,7 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
4
4
|
export type SelectOption = {
|
|
5
5
|
value: string;
|
|
6
6
|
label: ReactNode;
|
|
7
|
-
/**
|
|
7
|
+
/** For text search (specify when label is a ReactNode) */
|
|
8
8
|
textValue?: string;
|
|
9
9
|
};
|
|
10
10
|
export type SelectOptionGroup = {
|
|
@@ -24,19 +24,19 @@ export type SelectProps = {
|
|
|
24
24
|
wrapperClassName?: string;
|
|
25
25
|
disabled?: boolean;
|
|
26
26
|
size?: "xs" | "sm" | "default";
|
|
27
|
-
/** open
|
|
27
|
+
/** Controls the open state (inline editing, etc.) */
|
|
28
28
|
open?: boolean;
|
|
29
29
|
onOpenChange?: (open: boolean) => void;
|
|
30
|
-
/**
|
|
30
|
+
/** DOM props passed straight to the Trigger (autoFocus, onBlur, etc.) */
|
|
31
31
|
triggerProps?: ComponentProps<typeof SelectTrigger>;
|
|
32
|
-
/** form
|
|
32
|
+
/** Slot for the form side to insert an error */
|
|
33
33
|
errorSlot?: ReactNode;
|
|
34
34
|
invalid?: boolean;
|
|
35
|
-
/** DEV-E2E: e2e
|
|
35
|
+
/** DEV-E2E: ID used by e2e to identify the trigger button */
|
|
36
36
|
"data-testid"?: string;
|
|
37
|
-
/**
|
|
37
|
+
/** DOM id of the trigger. Use it to pair with an outer `<label htmlFor>`. */
|
|
38
38
|
id?: string;
|
|
39
|
-
/**
|
|
39
|
+
/** Accessible name when there is no visible label. Not needed when `label` is passed. */
|
|
40
40
|
"aria-label"?: string;
|
|
41
41
|
};
|
|
42
42
|
export declare function Select({ value, onValueChange, options, placeholder, label, required, description, helpText, className, wrapperClassName, disabled, size, open, onOpenChange, triggerProps, errorSlot, invalid, id, "aria-label": ariaLabel, "data-testid": testId }: SelectProps): import("react").JSX.Element;
|
package/dist/web/atom/select.js
CHANGED
|
@@ -7,12 +7,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
//#region src/web/atom/select.tsx
|
|
8
8
|
const EMPTY_SENTINEL = "__atom_select_empty__";
|
|
9
9
|
/**
|
|
10
|
-
* `""`
|
|
10
|
+
* Whether `""` may be treated as "not selected yet" rather than "an empty choice".
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* `<SelectValue placeholder>`
|
|
14
|
-
*
|
|
15
|
-
* placeholder
|
|
12
|
+
* When it is replaced by the sentinel, Radix interprets it as **a value is selected**, so
|
|
13
|
+
* `<SelectValue placeholder>` is not rendered at all (the value is not among the options, so the
|
|
14
|
+
* content is empty too, and the trigger becomes a **silently empty button**). When there is no
|
|
15
|
+
* empty option, draw the placeholder yourself so that it reads as "not selected".
|
|
16
16
|
*/
|
|
17
17
|
function hasEmptyOption(options) {
|
|
18
18
|
return options.some((o) => isOptionGroup(o) ? o.options.some((x) => x.value === "") : o.value === "");
|
|
@@ -14,7 +14,7 @@ type CommonProps = {
|
|
|
14
14
|
min?: number;
|
|
15
15
|
max: number;
|
|
16
16
|
step?: number;
|
|
17
|
-
/**
|
|
17
|
+
/** Formatted string shown to the right of the value. If not given, the raw number is shown (a range is separated by ` / `) */
|
|
18
18
|
formattedValue?: ReactNode;
|
|
19
19
|
} & Omit<ComponentProps<typeof Slider$1>, "value" | "onValueChange" | "defaultValue" | "min" | "max" | "step" | "disabled" | "className">;
|
|
20
20
|
export type SliderProps = ({
|
|
@@ -25,8 +25,8 @@ export type SliderProps = ({
|
|
|
25
25
|
onValueChange: (value: number[]) => void;
|
|
26
26
|
} & CommonProps);
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
* Radix Slider
|
|
28
|
+
* A controlled-only Slider. Accepts both a single value (`number`) and a range (`number[]`).
|
|
29
|
+
* Radix Slider handles `number[]` internally, so a `number` input is turned into an array at runtime.
|
|
30
30
|
*/
|
|
31
31
|
export declare function Slider(props: SliderProps): import("react").JSX.Element;
|
|
32
32
|
//#endregion
|
package/dist/web/atom/slider.js
CHANGED
|
@@ -9,8 +9,8 @@ function isRange(props) {
|
|
|
9
9
|
return Array.isArray(props.value);
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* Radix Slider
|
|
12
|
+
* A controlled-only Slider. Accepts both a single value (`number`) and a range (`number[]`).
|
|
13
|
+
* Radix Slider handles `number[]` internally, so a `number` input is turned into an array at runtime.
|
|
14
14
|
*/
|
|
15
15
|
function Slider(props) {
|
|
16
16
|
const { label, required, description, helpText, className, wrapperClassName, errorSlot, invalid, "aria-invalid": ariaInvalid, min, max, step, disabled, formattedValue, value, onValueChange: _onValueChange, ...rest } = props;
|
|
@@ -2,9 +2,9 @@ import { Switch as Switch$1 } from "../base/switch.js";
|
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
//#region src/web/atom/switch.d.ts
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* `form/switch.tsx`
|
|
7
|
-
*
|
|
5
|
+
* A controlled Switch that works outside a form.
|
|
6
|
+
* `form/switch.tsx` depends on TanStack Form's field context,
|
|
7
|
+
* so use this one for a standalone ON/OFF toggle.
|
|
8
8
|
*/
|
|
9
9
|
export type SwitchProps = ComponentProps<typeof Switch$1>;
|
|
10
10
|
export declare function Switch(props: SwitchProps): import("react").JSX.Element;
|
|
@@ -7,16 +7,17 @@ export type TextAreaProps = Omit<ComponentProps<"textarea">, "value" | "onChange
|
|
|
7
7
|
onValueChange: (value: string) => void;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* A plain multi-line input. Use it directly from screens that do not use TanStack Form
|
|
11
|
+
* (settings, small edit fields, read-only output). Apps are expected not to import
|
|
12
|
+
* `base/textarea` directly, so this is the entry point for it. A multi-line version
|
|
13
|
+
* of `atom/text-field`.
|
|
13
14
|
*
|
|
14
|
-
*
|
|
15
|
-
* default
|
|
16
|
-
* `<3`
|
|
17
|
-
* block
|
|
15
|
+
* The variants match `atom/text-field`:
|
|
16
|
+
* default ... a field with a 1px border
|
|
17
|
+
* `<3` ... an underline-only field that attaches to an existing row
|
|
18
|
+
* block ... a field with no border that reads as body text (an always-editable row)
|
|
18
19
|
*
|
|
19
|
-
*
|
|
20
|
+
* When you need form integration, use `form/text-area` (it uses the same `base/textarea` inside).
|
|
20
21
|
*/
|
|
21
22
|
export declare function TextArea({ value, onValueChange, ...props }: TextAreaProps): import("react").JSX.Element;
|
|
22
23
|
//#endregion
|
|
@@ -3,16 +3,17 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
//#region src/web/atom/text-area.tsx
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* A plain multi-line input. Use it directly from screens that do not use TanStack Form
|
|
7
|
+
* (settings, small edit fields, read-only output). Apps are expected not to import
|
|
8
|
+
* `base/textarea` directly, so this is the entry point for it. A multi-line version
|
|
9
|
+
* of `atom/text-field`.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
* default
|
|
12
|
-
* `<3`
|
|
13
|
-
* block
|
|
11
|
+
* The variants match `atom/text-field`:
|
|
12
|
+
* default ... a field with a 1px border
|
|
13
|
+
* `<3` ... an underline-only field that attaches to an existing row
|
|
14
|
+
* block ... a field with no border that reads as body text (an always-editable row)
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
+
* When you need form integration, use `form/text-area` (it uses the same `base/textarea` inside).
|
|
16
17
|
*/
|
|
17
18
|
function TextArea({ value, onValueChange, ...props }) {
|
|
18
19
|
return /* @__PURE__ */ jsx(Textarea, {
|
|
@@ -7,11 +7,12 @@ export type TextFieldProps = Omit<ComponentProps<"input">, "value" | "onChange">
|
|
|
7
7
|
onValueChange: (value: string) => void;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* A plain text input. Use it directly from screens that do not use TanStack Form
|
|
11
|
+
* (settings, search filters, small edit fields). Apps are expected not to import
|
|
12
|
+
* `base/input` directly, so this is the entry point for it.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
* native
|
|
14
|
+
* When you need form integration, use `form/text-input` (it uses the same `base/input` inside).
|
|
15
|
+
* It pairs with native's `atom/text-field`.
|
|
15
16
|
*/
|
|
16
17
|
export declare function TextField({ value, onValueChange, ...props }: TextFieldProps): import("react").JSX.Element;
|
|
17
18
|
//#endregion
|
|
@@ -3,11 +3,12 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
//#region src/web/atom/text-field.tsx
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* A plain text input. Use it directly from screens that do not use TanStack Form
|
|
7
|
+
* (settings, search filters, small edit fields). Apps are expected not to import
|
|
8
|
+
* `base/input` directly, so this is the entry point for it.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
* native
|
|
10
|
+
* When you need form integration, use `form/text-input` (it uses the same `base/input` inside).
|
|
11
|
+
* It pairs with native's `atom/text-field`.
|
|
11
12
|
*/
|
|
12
13
|
function TextField({ value, onValueChange, ...props }) {
|
|
13
14
|
return /* @__PURE__ */ jsx(Input, {
|