material-plus-ui 1.8.0 → 1.9.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/README.md +8 -4
- package/dist/a2ui/catalog.d.ts +104 -0
- package/dist/a2ui/catalog.js +1 -0
- package/dist/a2ui/components/MPA2uiAudioPlayer.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiAudioPlayer.js +2 -0
- package/dist/a2ui/components/MPA2uiButton.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiButton.js +2 -0
- package/dist/a2ui/components/MPA2uiCard.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiCard.js +2 -0
- package/dist/a2ui/components/MPA2uiCheckBox.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiCheckBox.js +2 -0
- package/dist/a2ui/components/MPA2uiChoicePicker.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiChoicePicker.js +2 -0
- package/dist/a2ui/components/MPA2uiColumn.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiColumn.js +2 -0
- package/dist/a2ui/components/MPA2uiDateTimeInput.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiDateTimeInput.js +2 -0
- package/dist/a2ui/components/MPA2uiDivider.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiDivider.js +2 -0
- package/dist/a2ui/components/MPA2uiIcon.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiIcon.js +2 -0
- package/dist/a2ui/components/MPA2uiImage.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiImage.js +2 -0
- package/dist/a2ui/components/MPA2uiList.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiList.js +2 -0
- package/dist/a2ui/components/MPA2uiModal.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiModal.js +2 -0
- package/dist/a2ui/components/MPA2uiRow.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiRow.js +2 -0
- package/dist/a2ui/components/MPA2uiSlider.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiSlider.js +2 -0
- package/dist/a2ui/components/MPA2uiTabs.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiTabs.js +2 -0
- package/dist/a2ui/components/MPA2uiText.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiText.js +2 -0
- package/dist/a2ui/components/MPA2uiTextField.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiTextField.js +2 -0
- package/dist/a2ui/components/MPA2uiVideo.d.ts +1 -0
- package/dist/a2ui/components/MPA2uiVideo.js +2 -0
- package/dist/a2ui/extended/MPA2uiBarChart.d.ts +1 -0
- package/dist/a2ui/extended/MPA2uiBarChart.js +2 -0
- package/dist/a2ui/extended/MPA2uiDataTable.d.ts +1 -0
- package/dist/a2ui/extended/MPA2uiDataTable.js +2 -0
- package/dist/a2ui/extended/MPA2uiLineChart.d.ts +1 -0
- package/dist/a2ui/extended/MPA2uiLineChart.js +2 -0
- package/dist/a2ui/extended/MPA2uiPieChart.d.ts +1 -0
- package/dist/a2ui/extended/MPA2uiPieChart.js +2 -0
- package/dist/a2ui/extended/MPA2uiStatistic.d.ts +1 -0
- package/dist/a2ui/extended/MPA2uiStatistic.js +2 -0
- package/dist/a2ui/extended/api.d.ts +1436 -0
- package/dist/a2ui/extended/api.js +1 -0
- package/dist/a2ui/extended/chart.d.ts +26 -0
- package/dist/a2ui/extended/chart.js +1 -0
- package/dist/a2ui/index.d.ts +103 -0
- package/dist/a2ui/index.js +1 -0
- package/dist/a2ui/internal/children.d.ts +28 -0
- package/dist/a2ui/internal/children.js +1 -0
- package/dist/a2ui/internal/common.d.ts +113 -0
- package/dist/a2ui/internal/common.js +1 -0
- package/dist/a2ui/internal/icons.d.ts +3 -0
- package/dist/a2ui/internal/icons.js +1 -0
- package/dist/components/alert/MPAlert.d.ts +1 -1
- package/dist/components/animate-grow/MPAnimateGrow.d.ts +1 -1
- package/dist/components/animate-slide/MPAnimateSlide.d.ts +1 -1
- package/dist/components/animate-zoom/MPAnimateZoom.d.ts +2 -2
- package/dist/components/area-chart/MPAreaChart.d.ts +18 -3
- package/dist/components/area-chart/MPAreaChart.js +1 -1
- package/dist/components/avatar/MPAvatar.d.ts +1 -1
- package/dist/components/bar-chart/MPBarChart.d.ts +15 -5
- package/dist/components/bar-chart/MPBarChart.js +1 -1
- package/dist/components/blockquote/MPBlockquote.d.ts +1 -1
- package/dist/components/box/MPBox.d.ts +1 -1
- package/dist/components/chip/MPChip.d.ts +1 -1
- package/dist/components/empty/MPEmpty.d.ts +1 -1
- package/dist/components/heatmap-chart/MPHeatmapChart.d.ts +12 -3
- package/dist/components/heatmap-chart/MPHeatmapChart.js +1 -1
- package/dist/components/line-chart/MPLineChart.d.ts +20 -2
- package/dist/components/line-chart/MPLineChart.js +1 -1
- package/dist/components/pie-chart/MPPieChart.d.ts +23 -1
- package/dist/components/pie-chart/MPPieChart.js +1 -1
- package/dist/components/scatter-chart/MPScatterChart.d.ts +5 -1
- package/dist/components/sparkline/MPSparkline.d.ts +14 -1
- package/dist/components/sparkline/MPSparkline.js +1 -1
- package/dist/components/timeline-chart/MPTimelineChart.d.ts +6 -2
- package/dist/components/typography/MPTypography.d.ts +1 -1
- package/dist/internal/ChartChrome.d.ts +63 -13
- package/dist/internal/ChartChrome.js +1 -1
- package/dist/internal/ChartFrame.d.ts +24 -4
- package/dist/internal/ChartFrame.js +1 -1
- package/dist/internal/chart.d.ts +91 -3
- package/dist/internal/chart.js +1 -1
- package/dist/internal/i18n.d.ts +4 -0
- package/dist/internal/messages/chart.d.ts +1 -1
- package/dist/internal/messages/chart.js +1 -1
- package/dist/locales/ar.js +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/hi.js +1 -1
- package/dist/locales/id.js +1 -1
- package/dist/locales/it.js +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/nl.js +1 -1
- package/dist/locales/pl.js +1 -1
- package/dist/locales/pt.js +1 -1
- package/dist/locales/ru.js +1 -1
- package/dist/locales/th.js +1 -1
- package/dist/locales/tr.js +1 -1
- package/dist/locales/vi.js +1 -1
- package/dist/locales/zh-hans.js +1 -1
- package/dist/locales/zh-hant.js +1 -1
- package/dist/styles/area-chart.css +1 -1
- package/dist/styles/bar-chart.css +1 -1
- package/dist/styles/gauge-chart.css +1 -1
- package/dist/styles/heatmap-chart.css +1 -1
- package/dist/styles/line-chart.css +1 -1
- package/dist/styles/pie-chart.css +1 -1
- package/dist/styles/scatter-chart.css +1 -1
- package/dist/styles/sparkline.css +1 -1
- package/dist/styles/statistic.css +1 -1
- package/dist/styles/timeline-chart.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/types.d.ts +208 -1
- package/package.json +25 -4
package/README.md
CHANGED
|
@@ -34,6 +34,7 @@ Everything is documented at **[material-plus.cdget.com](https://material-plus.cd
|
|
|
34
34
|
| --- | --- |
|
|
35
35
|
| [**Getting started**](https://material-plus.cdget.com/guide/getting-started) | Install and setup, end to end. |
|
|
36
36
|
| [**All components**](https://material-plus.cdget.com/components/) | Every component, one page each: live previews and the full props table. |
|
|
37
|
+
| [**A2UI catalog**](https://material-plus.cdget.com/guide/a2ui) | Rendering an agent's interface: A2UI's basic catalog, drawn as Material Design 3. |
|
|
37
38
|
| [**Browser support**](https://material-plus.cdget.com/browser-support) | Which browsers and versions it runs in, and what is reduced in the older ones. |
|
|
38
39
|
| [**Changelog**](https://material-plus.cdget.com/changelog) | What changed in each release. |
|
|
39
40
|
|
|
@@ -51,13 +52,16 @@ pnpm add material-plus-ui
|
|
|
51
52
|
|
|
52
53
|
### Peer dependencies
|
|
53
54
|
|
|
54
|
-
| Package
|
|
55
|
-
|
|
|
56
|
-
| `@base-ui/react`
|
|
57
|
-
| `react`, `react-dom`
|
|
55
|
+
| Package | Versions | Required |
|
|
56
|
+
| ------------------------------- | -------- | -------------------------------- |
|
|
57
|
+
| `@base-ui/react` | 1 | Yes |
|
|
58
|
+
| `react`, `react-dom` | 18 or 19 | Yes |
|
|
59
|
+
| `@a2ui/react`, `@a2ui/web_core` | 0.11 | Only for `material-plus-ui/a2ui` |
|
|
58
60
|
|
|
59
61
|
`@base-ui/react` is a peer rather than a dependency because it carries React context: a `Form` of yours has to be able to see a field of ours, and that only works with one copy in the tree.
|
|
60
62
|
|
|
63
|
+
The two `@a2ui` packages are optional and only needed to render an agent's interface — see [the A2UI catalog](https://material-plus.cdget.com/guide/a2ui). Install nothing extra and the rest of the library is unaffected.
|
|
64
|
+
|
|
61
65
|
### Setup
|
|
62
66
|
|
|
63
67
|
Add one line to your app's CSS entry point:
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The catalog: the eighteen components, under the id whose contract they keep.
|
|
3
|
+
*
|
|
4
|
+
* ## Why the id is the specification's own
|
|
5
|
+
*
|
|
6
|
+
* A `catalogId` is a promise about *schemas* — these component names, these props,
|
|
7
|
+
* these types — and says nothing about how any of it is drawn. The schemas here
|
|
8
|
+
* are not modelled on the basic catalog's, they **are** the basic catalog's: every
|
|
9
|
+
* implementation is built from the `…Api` object the protocol publishes, so the
|
|
10
|
+
* contract is kept by construction and cannot drift from it.
|
|
11
|
+
*
|
|
12
|
+
* That makes this catalog a drop-in. An agent already targeting the basic catalog
|
|
13
|
+
* needs no change, and no new schema has to be hosted anywhere for a client to
|
|
14
|
+
* announce it in `supportedCatalogIds`.
|
|
15
|
+
*
|
|
16
|
+
* A project extending the vocabulary — its own components, its own names — needs
|
|
17
|
+
* an id of its own, because that is a different contract. `createMPA2uiCatalog`
|
|
18
|
+
* is for exactly that: mint a URI you control, add your implementations, and the
|
|
19
|
+
* eighteen here come along.
|
|
20
|
+
*/
|
|
21
|
+
import type { ReactComponentImplementation } from '@a2ui/react/v0_9';
|
|
22
|
+
import { BASIC_FUNCTIONS, Catalog } from '@a2ui/web_core/v0_9';
|
|
23
|
+
/**
|
|
24
|
+
* The id of A2UI's basic catalog, which is the contract this package implements.
|
|
25
|
+
*
|
|
26
|
+
* The path says `v0_9` and holds the v0.9.1 schemas, which is the protocol's own
|
|
27
|
+
* spelling rather than a mistake here. Written out rather than imported, because
|
|
28
|
+
* the only module that exports it is the one that also registers the reference
|
|
29
|
+
* renderer's eighteen custom elements as a side effect of being loaded.
|
|
30
|
+
*
|
|
31
|
+
* Exported because an agent has to send this exact string for a surface to
|
|
32
|
+
* resolve, and a client has to announce it in `supportedCatalogIds`. A URI that
|
|
33
|
+
* has to match in two places is not a string to retype in either of them.
|
|
34
|
+
*/
|
|
35
|
+
export declare const A2UI_BASIC_CATALOG_ID = "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json";
|
|
36
|
+
/** The eighteen implementations, in the order the specification lists them. */
|
|
37
|
+
export declare const MP_A2UI_COMPONENTS: ReactComponentImplementation[];
|
|
38
|
+
/**
|
|
39
|
+
* The id of this library's own catalog, which is the basic vocabulary plus the
|
|
40
|
+
* five components under `a2ui/extended`.
|
|
41
|
+
*
|
|
42
|
+
* A URI, and one that answers: the schema is generated from the implementations
|
|
43
|
+
* and served at this address by the documentation site. An agent does not have to
|
|
44
|
+
* fetch it — a `catalogId` is an identifier rather than a download — but an agent
|
|
45
|
+
* that was never told what this catalog holds can read it there, which is the
|
|
46
|
+
* whole reason to mint an id instead of borrowing one.
|
|
47
|
+
*
|
|
48
|
+
* Its own id because it is its own contract. These five components are this
|
|
49
|
+
* library's, so a surface that uses one is not a surface the basic catalog can
|
|
50
|
+
* draw, and saying otherwise with the basic id would be a promise to any other
|
|
51
|
+
* renderer that it could.
|
|
52
|
+
*/
|
|
53
|
+
export declare const MP_A2UI_CATALOG_ID = "https://material-plus.cdget.com/a2ui/v0_9/catalog.json";
|
|
54
|
+
/**
|
|
55
|
+
* The components this library adds to the protocol's vocabulary: a table, three
|
|
56
|
+
* charts and a figure.
|
|
57
|
+
*
|
|
58
|
+
* Their schemas are `extended/api.ts`, which is where the reasoning about what an
|
|
59
|
+
* agent may and may not state lives.
|
|
60
|
+
*/
|
|
61
|
+
export declare const MP_A2UI_EXTENDED_COMPONENTS: ReactComponentImplementation[];
|
|
62
|
+
/**
|
|
63
|
+
* A catalog of these components under an id of your own, with your own
|
|
64
|
+
* components and functions alongside them.
|
|
65
|
+
*
|
|
66
|
+
* ```ts
|
|
67
|
+
* const catalog = createMPA2uiCatalog({
|
|
68
|
+
* id: 'https://example.com/catalogs/orders/v1/catalog.json',
|
|
69
|
+
* components: [OrderTable]
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* A name given twice is the later one: pass an implementation called `Button` and
|
|
74
|
+
* it replaces the one here, which is how a single component is swapped without
|
|
75
|
+
* rebuilding the list.
|
|
76
|
+
*/
|
|
77
|
+
export declare const createMPA2uiCatalog: ({ id, components, functions }?: {
|
|
78
|
+
/** The URI this catalog answers to. Defaults to the basic catalog's. */
|
|
79
|
+
id?: string;
|
|
80
|
+
/** Implementations to add, or to override one of the eighteen with. */
|
|
81
|
+
components?: ReactComponentImplementation[];
|
|
82
|
+
/** The functions an agent may call. Defaults to the basic catalog's. */
|
|
83
|
+
functions?: typeof BASIC_FUNCTIONS;
|
|
84
|
+
}) => Catalog<ReactComponentImplementation, import("@a2ui/web_core/v0_9").FunctionImplementation>;
|
|
85
|
+
/**
|
|
86
|
+
* The basic catalog, drawn as Material Plus.
|
|
87
|
+
*
|
|
88
|
+
* ```ts
|
|
89
|
+
* const processor = new MessageProcessor([mpA2uiCatalog]);
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare const mpA2uiCatalog: Catalog<ReactComponentImplementation, import("@a2ui/web_core/v0_9").FunctionImplementation>;
|
|
93
|
+
/**
|
|
94
|
+
* The same, plus the five components the basic catalog has no way to express.
|
|
95
|
+
*
|
|
96
|
+
* Register both and an agent can choose per surface: the basic id for anything
|
|
97
|
+
* another renderer might also have to draw, and this one when the surface is a
|
|
98
|
+
* table or a chart.
|
|
99
|
+
*
|
|
100
|
+
* ```ts
|
|
101
|
+
* const processor = new MessageProcessor([mpA2uiCatalog, mpA2uiExtendedCatalog]);
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export declare const mpA2uiExtendedCatalog: Catalog<ReactComponentImplementation, import("@a2ui/web_core/v0_9").FunctionImplementation>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BASIC_FUNCTIONS as o,Catalog as t}from"@a2ui/web_core/v0_9";import{MPA2uiBarChart as i}from"./extended/MPA2uiBarChart.js";import{MPA2uiDataTable as m}from"./extended/MPA2uiDataTable.js";import{MPA2uiLineChart as e}from"./extended/MPA2uiLineChart.js";import{MPA2uiPieChart as r}from"./extended/MPA2uiPieChart.js";import{MPA2uiStatistic as n}from"./extended/MPA2uiStatistic.js";import{MPA2uiAudioPlayer as s}from"./components/MPA2uiAudioPlayer.js";import{MPA2uiButton as p}from"./components/MPA2uiButton.js";import{MPA2uiCard as A}from"./components/MPA2uiCard.js";import{MPA2uiCheckBox as c}from"./components/MPA2uiCheckBox.js";import{MPA2uiChoicePicker as a}from"./components/MPA2uiChoicePicker.js";import{MPA2uiColumn as P}from"./components/MPA2uiColumn.js";import{MPA2uiDateTimeInput as u}from"./components/MPA2uiDateTimeInput.js";import{MPA2uiDivider as M}from"./components/MPA2uiDivider.js";import{MPA2uiIcon as f}from"./components/MPA2uiIcon.js";import{MPA2uiImage as _}from"./components/MPA2uiImage.js";import{MPA2uiList as j}from"./components/MPA2uiList.js";import{MPA2uiModal as d}from"./components/MPA2uiModal.js";import{MPA2uiRow as C}from"./components/MPA2uiRow.js";import{MPA2uiSlider as I}from"./components/MPA2uiSlider.js";import{MPA2uiTabs as l}from"./components/MPA2uiTabs.js";import{MPA2uiText as x}from"./components/MPA2uiText.js";import{MPA2uiTextField as T}from"./components/MPA2uiTextField.js";import{MPA2uiVideo as O}from"./components/MPA2uiVideo.js";export const A2UI_BASIC_CATALOG_ID="https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json";export const MP_A2UI_COMPONENTS=[x,_,f,O,s,C,P,j,A,l,d,M,p,T,c,a,I,u];export const MP_A2UI_CATALOG_ID="https://material-plus.cdget.com/a2ui/v0_9/catalog.json";export const MP_A2UI_EXTENDED_COMPONENTS=[m,i,e,r,n];export const createMPA2uiCatalog=({id:i=A2UI_BASIC_CATALOG_ID,components:m=[],functions:e=o}={})=>new t(i,[...MP_A2UI_COMPONENTS,...m],e);export const mpA2uiCatalog=/*@__PURE__*/createMPA2uiCatalog();export const mpA2uiExtendedCatalog=/*@__PURE__*/createMPA2uiCatalog({id:MP_A2UI_CATALOG_ID,components:MP_A2UI_EXTENDED_COMPONENTS});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiAudioPlayer: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as o,jsxs as r}from"react/jsx-runtime";import{createComponentImplementation as i}from"@a2ui/react/v0_9";import{AudioPlayerApi as e}from"@a2ui/web_core/v0_9";import{MPFlex as t}from"../../components/flex/MPFlex.js";import{MPTypography as a}from"../../components/typography/MPTypography.js";import{asText as s,weightStyle as l}from"../internal/common.js";export const MPA2uiAudioPlayer=/*@__PURE__*/i(e,({props:i})=>r(t,{direction:"column",gap:4,style:l(i.weight),children:[i.description?o(a,{level:"caption",children:i.description}):null,o("audio",{src:i.url,controls:!0,preload:"metadata","aria-label":s(i.accessibility?.label)??i.description,style:{width:"100%"}})]}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiButton: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{createComponentImplementation as i}from"@a2ui/react/v0_9";import{ButtonApi as o}from"@a2ui/web_core/v0_9";import{MPButton as r}from"../../components/button/MPButton.js";import{accessibilityAttributes as e,weightStyle as l}from"../internal/common.js";const n={default:"outlined",primary:"filled",borderless:"text"};export const MPA2uiButton=/*@__PURE__*/i(o,({props:i,buildChild:o})=>t(r,{variant:n[i.variant??"default"]??"outlined",onClick:i.action,disabled:!1===i.isValid,style:l(i.weight),...e(i.accessibility),children:i.child?o(i.child):null}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiCard: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as r}from"react/jsx-runtime";import{createComponentImplementation as i}from"@a2ui/react/v0_9";import{CardApi as o}from"@a2ui/web_core/v0_9";import{MPCard as t}from"../../components/card/MPCard.js";import{accessibilityAttributes as m,weightStyle as c}from"../internal/common.js";export const MPA2uiCard=/*@__PURE__*/i(o,({props:i,buildChild:o})=>r(t,{style:c(i.weight),...m(i.accessibility),children:i.child?o(i.child):null}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiCheckBox: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createComponentImplementation as o}from"@a2ui/react/v0_9";import{CheckBoxApi as r}from"@a2ui/web_core/v0_9";import{MPCheckbox as t}from"../../components/checkbox/MPCheckbox.js";import{weightStyle as a}from"../internal/common.js";export const MPA2uiCheckBox=/*@__PURE__*/o(r,({props:o})=>e(t,{checked:!0===o.value,onCheckedChange:o.setValue,label:o.label,errorMessage:o.validationErrors?.[0],style:a(o.weight)}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiChoicePicker: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createComponentImplementation as l}from"@a2ui/react/v0_9";import{ChoicePickerApi as r}from"@a2ui/web_core/v0_9";import{MPCheckbox as a}from"../../components/checkbox/MPCheckbox.js";import{MPChip as o}from"../../components/chip/MPChip.js";import{MPCombobox as t}from"../../components/combobox/MPCombobox.js";import{MPFieldset as i}from"../../components/fieldset/MPFieldset.js";import{MPFlex as n}from"../../components/flex/MPFlex.js";import{MPRadio as s,MPRadioGroup as u}from"../../components/radio-group/MPRadioGroup.js";import{asText as m,weightStyle as c}from"../internal/common.js";export const MPA2uiChoicePicker=/*@__PURE__*/l(r,({props:l})=>{const r=l.options??[],p=Array.isArray(l.value)?l.value.map(String):[],b="mutuallyExclusive"===(l.variant??"mutuallyExclusive"),g=l.validationErrors?.[0],d=c(l.weight),v=(e,r)=>{b?l.setValue(r?[e]:[]):l.setValue(r?[...p.filter(l=>l!==e),e]:p.filter(l=>l!==e))};if(l.filterable){const a=r.map(e=>({value:String(e.value),label:m(e.label)??String(e.value)}));return e(t,b?{items:a,value:p[0]??null,onValueChange:e=>l.setValue(null===e?[]:[String(e)]),label:l.label,errorMessage:g,clearable:!0,style:d}:{multiple:!0,items:a,value:p,onValueChange:e=>l.setValue(e.map(String)),label:l.label,errorMessage:g,style:d})}return b&&"chips"!==l.displayStyle?e(u,{value:p[0]??null,onValueChange:e=>l.setValue([e]),label:l.label,errorMessage:g,style:d,children:r.map(l=>e(s,{value:String(l.value),label:m(l.label)??String(l.value)},String(l.value)))}):e(i,{legend:l.label,description:g,style:d,children:"chips"===l.displayStyle?e(n,{wrap:!0,gap:8,children:r.map(l=>{const r=String(l.value),a=p.includes(r);return e(o,{variant:a?"tonal":"outlined",selected:a,onClick:()=>v(r,!a),children:m(l.label)??r},r)})}):e(n,{direction:"column",gap:4,children:r.map(l=>{const r=String(l.value);return e(a,{checked:p.includes(r),onCheckedChange:e=>v(r,e),label:m(l.label)??r},r)})})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiColumn: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as r}from"react/jsx-runtime";import*as t from"react";import{createComponentImplementation as i}from"@a2ui/react/v0_9";import{ColumnApi as o}from"@a2ui/web_core/v0_9";import{MPFlex as e}from"../../components/flex/MPFlex.js";import{childNodes as m}from"../internal/children.js";import{FLEX_ALIGN as n,FLEX_JUSTIFY as s,accessibilityAttributes as a,weightStyle as c}from"../internal/common.js";export const MPA2uiColumn=/*@__PURE__*/i(o,({props:i,buildChild:o})=>r(e,{direction:"column",justify:s[i.justify??"start"]??"start",align:n[i.align??"stretch"]??"stretch",gap:8,style:c(i.weight),...a(i.accessibility),children:m(i.children,o).map(({key:i,node:o})=>r(t.Fragment,{children:o},i))}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiDateTimeInput: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createComponentImplementation as t}from"@a2ui/react/v0_9";import{DateTimeInputApi as i}from"@a2ui/web_core/v0_9";import{MPDatePicker as a}from"../../components/date-picker/MPDatePicker.js";import{MPDateTimePicker as m}from"../../components/date-time-picker/MPDateTimePicker.js";import{MPTimePicker as o}from"../../components/time-picker/MPTimePicker.js";import{formatIsoValue as r,parseIsoValue as n,weightStyle as s}from"../internal/common.js";export const MPA2uiDateTimeInput=/*@__PURE__*/t(i,({props:t})=>{const i=!0===t.enableTime,p=!0===t.enableDate||!i,l=n("string"==typeof t.value?t.value:void 0),c=n("string"==typeof t.min?t.min:void 0),u=n("string"==typeof t.max?t.max:void 0),v={label:t.label,errorMessage:t.validationErrors?.[0],style:s(t.weight)},f=e=>t.setValue(r(e,{withDate:p,withTime:i}));return p&&i?e(m,{value:l,onValueChange:f,minDate:c,maxDate:u,...v}):i?e(o,{value:l,onValueChange:f,minTime:c,maxTime:u,...v}):e(a,{value:l,onValueChange:f,minDate:c,maxDate:u,...v})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiDivider: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as i}from"react/jsx-runtime";import{createComponentImplementation as r}from"@a2ui/react/v0_9";import{DividerApi as o}from"@a2ui/web_core/v0_9";import{MPDivider as t}from"../../components/divider/MPDivider.js";import{accessibilityAttributes as e,weightStyle as m}from"../internal/common.js";export const MPA2uiDivider=/*@__PURE__*/r(o,({props:r})=>i(t,{orientation:"vertical"===r.axis?"vertical":"horizontal",style:m(r.weight),...e(r.accessibility)}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiIcon: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as i}from"react/jsx-runtime";import{createComponentImplementation as o}from"@a2ui/react/v0_9";import{IconApi as t}from"@a2ui/web_core/v0_9";import{MPIcon as r}from"../../components/icon/MPIcon.js";import{A2UI_ICONS as e}from"../internal/icons.js";import{asText as n,weightStyle as c}from"../internal/common.js";export const MPA2uiIcon=/*@__PURE__*/o(t,({props:o})=>{const t=o.name,s={style:c(o.weight),label:n(o.accessibility?.label),title:n(o.accessibility?.description)};if(t&&"object"==typeof t&&"svgPath"in t)return i(r,{icon:i("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"currentColor",children:i("path",{d:String(t.svgPath)})}),...s});const m="string"==typeof t?e[t]:void 0;return m?i(r,{icon:m,...s}):null});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiImage: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createComponentImplementation as r}from"@a2ui/react/v0_9";import{ImageApi as i}from"@a2ui/web_core/v0_9";import{MPImage as t}from"../../components/image/MPImage.js";import{accessibilityAttributes as a,weightStyle as o}from"../internal/common.js";const m={contain:"contain",cover:"cover",fill:"fill",none:"none",scaleDown:"scale-down"},n={icon:{width:24,height:24},avatar:{width:40,height:40,borderRadius:"var(--mp-sys-shape-corner-full, 9999px)"},smallFeature:{maxWidth:100},mediumFeature:{},largeFeature:{maxHeight:400},header:{width:"100%",height:200}};export const MPA2uiImage=/*@__PURE__*/r(i,({props:r})=>{const i=r.variant??"mediumFeature";return e(t,{src:r.url,alt:r.description??"",fit:"header"===i?"cover":m[r.fit??"fill"]??"fill",style:{...n[i],...o(r.weight)},...a(r.accessibility)})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiList: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as i}from"react/jsx-runtime";import{createComponentImplementation as e}from"@a2ui/react/v0_9";import{ListApi as t}from"@a2ui/web_core/v0_9";import{MPFlex as r}from"../../components/flex/MPFlex.js";import{childNodes as o}from"../internal/children.js";import{FLEX_ALIGN as l,accessibilityAttributes as n,weightStyle as s}from"../internal/common.js";const d={ordered:"decimal",unordered:"disc"};export const MPA2uiList=/*@__PURE__*/e(t,({props:e,buildChild:t})=>{const m=e.listStyle?d[e.listStyle]:void 0;return i(r,{render:"ordered"===e.listStyle?i("ol",{}):i("ul",{}),direction:"horizontal"===e.direction?"row":"column",align:l[e.align??"stretch"]??"stretch",gap:8,style:{margin:0,paddingInlineStart:m?"1.25em":0,listStyleType:m??"none",listStylePosition:"inside",...s(e.weight)},...n(e.accessibility),children:o(e.children,t).map(({key:e,node:t})=>i("li",{style:{display:m?"list-item":"block",minWidth:0},children:t},e))})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiModal: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as i,Fragment as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{createComponentImplementation as o}from"@a2ui/react/v0_9";import{ModalApi as n}from"@a2ui/web_core/v0_9";import{MPDialog as s}from"../../components/dialog/MPDialog.js";import{asText as l,weightStyle as a}from"../internal/common.js";export const MPA2uiModal=/*@__PURE__*/o(n,({props:o,buildChild:n})=>{const[c,m]=r.useState(!1);return t(e,{children:[i("span",{onClick:()=>m(!0),style:{display:"inline-flex",...a(o.weight)},children:o.trigger?n(o.trigger):null}),i(s,{open:c,onOpenChange:m,title:l(o.accessibility?.label),description:l(o.accessibility?.description),children:o.content?n(o.content):null})]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiRow: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as r}from"react/jsx-runtime";import*as t from"react";import{createComponentImplementation as i}from"@a2ui/react/v0_9";import{RowApi as o}from"@a2ui/web_core/v0_9";import{MPFlex as e}from"../../components/flex/MPFlex.js";import{childNodes as m}from"../internal/children.js";import{FLEX_ALIGN as s,FLEX_JUSTIFY as n,accessibilityAttributes as a,weightStyle as c}from"../internal/common.js";export const MPA2uiRow=/*@__PURE__*/i(o,({props:i,buildChild:o})=>r(e,{direction:"row",justify:n[i.justify??"start"]??"start",align:s[i.align??"stretch"]??"stretch",gap:8,style:c(i.weight),...a(i.accessibility),children:m(i.children,o).map(({key:i,node:o})=>r(t.Fragment,{children:o},i))}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiSlider: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as r}from"react/jsx-runtime";import{createComponentImplementation as e}from"@a2ui/react/v0_9";import{SliderApi as o}from"@a2ui/web_core/v0_9";import{MPSlider as a}from"../../components/slider/MPSlider.js";import{weightStyle as i}from"../internal/common.js";export const MPA2uiSlider=/*@__PURE__*/e(o,({props:e})=>{const o=e.min??0;return r(a,{value:"number"==typeof e.value?e.value:o,onValueChange:r=>e.setValue(Array.isArray(r)?r[0]:r),min:o,max:e.max,label:e.label,description:e.validationErrors?.[0],showValue:!0,style:i(e.weight)})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiTabs: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as i,jsxs as l}from"react/jsx-runtime";import*as e from"react";import{createComponentImplementation as t}from"@a2ui/react/v0_9";import{TabsApi as a}from"@a2ui/web_core/v0_9";import{MPTab as r,MPTabPanel as s,MPTabs as o}from"../../components/tabs/MPTabs.js";import{asText as c,weightStyle as m}from"../internal/common.js";export const MPA2uiTabs=/*@__PURE__*/t(a,({props:t,buildChild:a})=>{const n=t.tabs??[],[p,u]=e.useState(null),d=null!==p&&n.some(i=>i.child===p)?p:n[0]?.child??null;return l(o,{value:d,onValueChange:u,"aria-label":c(t.accessibility?.label),title:c(t.accessibility?.description),style:m(t.weight),children:[n.map((l,e)=>i(r,{value:l.child,children:c(l.title)},`tab-${l.child}-${e}`)),n.map((l,e)=>i(s,{value:l.child,children:a(l.child)},`panel-${l.child}-${e}`))]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiText: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import*as r from"react";import{createComponentImplementation as o,useMarkdownRenderer as e}from"@a2ui/react/v0_9";import{TextApi as n}from"@a2ui/web_core/v0_9";import{MPTypography as i}from"../../components/typography/MPTypography.js";import{accessibilityAttributes as a,weightStyle as s}from"../internal/common.js";const h={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",caption:"caption",body:"body"},c=new Set(["h1","h2","h3","h4","h5","caption"]);export const MPA2uiText=/*@__PURE__*/o(n,({props:o})=>{const n=o.variant??"body",l="string"==typeof o.text?o.text:String(o.text??""),p=((t,o)=>{const n=e(),[i,a]=r.useState(null);return r.useEffect(()=>{if(!n||!o)return void a(null);let r=!0;return(async()=>{try{const o=await n(t);r&&a("string"==typeof o?o:null)}catch{r&&a(null)}})(),()=>{r=!1}},[n,o,t]),i})(l,!c.has(n)),m={level:h[n]??"body",style:s(o.weight),...a(o.accessibility)};return t(i,null===p?{...m,children:l}:{...m,dangerouslySetInnerHTML:{__html:p}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiTextField: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createComponentImplementation as r}from"@a2ui/react/v0_9";import{TextFieldApi as t}from"@a2ui/web_core/v0_9";import{MPNumberField as o}from"../../components/number-field/MPNumberField.js";import{MPTextField as l}from"../../components/text-field/MPTextField.js";import{weightStyle as i}from"../internal/common.js";export const MPA2uiTextField=/*@__PURE__*/r(t,({props:r})=>{const t=r.variant??"shortText",s=r.validationErrors?.[0],n="string"==typeof r.value?r.value:"";if("number"===t){const t=Number(n);return e(o,{value:""!==n&&Number.isFinite(t)?t:null,onValueChange:e=>r.setValue(null===e?"":String(e)),label:r.label,errorMessage:s,style:i(r.weight)})}return e(l,{value:n,onChange:r.setValue,type:"obscured"===t?"password":"text",rows:"longText"===t?4:void 0,resizable:"longText"===t,label:r.label,errorMessage:s,style:i(r.weight)})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiVideo: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as i}from"react/jsx-runtime";import{createComponentImplementation as r}from"@a2ui/react/v0_9";import{VideoApi as e}from"@a2ui/web_core/v0_9";import{asText as o,weightStyle as t}from"../internal/common.js";export const MPA2uiVideo=/*@__PURE__*/r(e,({props:r})=>i("video",{src:r.url,controls:!0,preload:"metadata","aria-label":o(r.accessibility?.label),title:o(r.accessibility?.description),style:{display:"block",width:"100%",height:"auto",borderRadius:"var(--mp-sys-shape-corner-medium, 12px)",...t(r.weight)}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiBarChart: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as r}from"react/jsx-runtime";import{createComponentImplementation as e}from"@a2ui/react/v0_9";import{MPBarChart as t}from"../../components/bar-chart/MPBarChart.js";import{BarChartApi as i}from"./api.js";import{toAxis as o,toCategories as s,toSeries as a}from"./chart.js";import{accessibilityAttributes as m,weightStyle as c}from"../internal/common.js";export const MPA2uiBarChart=/*@__PURE__*/e(i,({props:e})=>r(t,{series:a(e.series),categories:s(e.categories),label:e.label,xAxis:o(e.xAxisLabel),yAxis:o(e.yAxisLabel),height:e.height,legend:e.legend,stacked:e.stacked,horizontal:e.horizontal,style:c(e.weight),...m(e.accessibility)}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiDataTable: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createComponentImplementation as r}from"@a2ui/react/v0_9";import{MPDataTable as t}from"../../components/data-table/MPDataTable.js";import{DataTableApi as a}from"./api.js";import{accessibilityAttributes as s,asText as o,weightStyle as i}from"../internal/common.js";export const MPA2uiDataTable=/*@__PURE__*/r(a,({props:r})=>{const a=Array.isArray(r.rows)?r.rows:[],l=r.columns??[],n=r.selection??"none",c=Array.isArray(r.selectedKeys)?r.selectedKeys.map(String):[],p=l.map(e=>({key:e.key,label:o(e.label)??e.key,align:e.align,sortable:e.sortable,searchable:e.searchable,width:e.width,value:r=>r[e.key],render:r=>{return null==(t=r[e.key])?"":"object"==typeof t?JSON.stringify(t):String(t);var t}}));return e(t,{headers:p,items:a,getRowKey:(e,t)=>{if(!r.rowKey)return t;const a=e[r.rowKey];return null==a?t:String(a)},caption:r.caption,searchable:r.searchable,sortable:r.sortable??!0,paged:r.paged,pageSize:r.pageSize,selectionMode:n,checkboxes:"multiple"===n,selected:"none"===n?void 0:c,onSelectedChange:e=>r.setSelectedKeys(e.map(String)),striped:r.striped,style:i(r.weight),...s(r.accessibility)})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiLineChart: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createComponentImplementation as r}from"@a2ui/react/v0_9";import{MPLineChart as i}from"../../components/line-chart/MPLineChart.js";import{LineChartApi as s}from"./api.js";import{toAxis as t,toCategories as o,toSeries as a}from"./chart.js";import{accessibilityAttributes as m,weightStyle as c}from"../internal/common.js";export const MPA2uiLineChart=/*@__PURE__*/r(s,({props:r})=>e(i,{series:a(r.series),categories:o(r.categories),label:r.label,xAxis:t(r.xAxisLabel),yAxis:t(r.yAxisLabel),height:r.height,legend:r.legend,curve:r.curve,markers:void 0===r.markers?"auto":r.markers,style:c(r.weight),...m(r.accessibility)}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiPieChart: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createComponentImplementation as t}from"@a2ui/react/v0_9";import{MPPieChart as r}from"../../components/pie-chart/MPPieChart.js";import{PieChartApi as i}from"./api.js";import{toCategories as a,toData as o}from"./chart.js";import{accessibilityAttributes as s,weightStyle as m}from"../internal/common.js";export const MPA2uiPieChart=/*@__PURE__*/t(i,({props:t})=>e(r,{data:o(t.data),categories:a(t.categories),label:t.label,shape:t.shape,height:t.height,legend:t.legend,style:m(t.weight),...s(t.accessibility)}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MPA2uiStatistic: import("@a2ui/react/v0_9").ReactComponentImplementation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{createComponentImplementation as e}from"@a2ui/react/v0_9";import{MPStatistic as i}from"../../components/statistic/MPStatistic.js";import{StatisticApi as o}from"./api.js";import{accessibilityAttributes as a,weightStyle as r}from"../internal/common.js";export const MPA2uiStatistic=/*@__PURE__*/e(o,({props:e})=>t(i,{value:"number"==typeof e.value?e.value:String(e.value??""),label:e.label,previousValue:e.previousValue,delta:void 0===e.previousValue?"none":e.delta,betterWhen:e.betterWhen,unit:e.unit,prefix:e.prefix,period:e.period,caption:e.caption,compact:e.compact,align:e.align,style:r(e.weight),...a(e.accessibility)}));
|