ionbase-ui 0.59.0 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AgentActivity.d.ts +2 -1
- package/dist/components/AgentActivity.d.ts.map +1 -1
- package/dist/components/AgentActivity.js +4 -17
- package/dist/components/AgentActivity.js.map +1 -1
- package/dist/components/Calendar.d.ts +20 -0
- package/dist/components/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar.js +151 -0
- package/dist/components/Calendar.js.map +1 -0
- package/dist/components/CalendarPopover.d.ts +26 -0
- package/dist/components/CalendarPopover.d.ts.map +1 -0
- package/dist/components/CalendarPopover.js +45 -0
- package/dist/components/CalendarPopover.js.map +1 -0
- package/dist/components/DateField.d.ts +15 -0
- package/dist/components/DateField.d.ts.map +1 -0
- package/dist/components/DateField.js +74 -0
- package/dist/components/DateField.js.map +1 -0
- package/dist/components/DatePicker.d.ts +81 -0
- package/dist/components/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker.js +102 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/DateRangePicker.d.ts +117 -0
- package/dist/components/DateRangePicker.d.ts.map +1 -0
- package/dist/components/DateRangePicker.js +152 -0
- package/dist/components/DateRangePicker.js.map +1 -0
- package/dist/components/Header.d.ts +10 -0
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/Header.js +18 -3
- package/dist/components/Header.js.map +1 -1
- package/dist/components/NumberInput.d.ts +63 -0
- package/dist/components/NumberInput.d.ts.map +1 -0
- package/dist/components/NumberInput.js +102 -0
- package/dist/components/NumberInput.js.map +1 -0
- package/dist/components/PromptInput.d.ts +89 -0
- package/dist/components/PromptInput.d.ts.map +1 -0
- package/dist/components/PromptInput.js +130 -0
- package/dist/components/PromptInput.js.map +1 -0
- package/dist/components/ScrollProgress.d.ts +6 -0
- package/dist/components/ScrollProgress.d.ts.map +1 -1
- package/dist/components/ScrollProgress.js +2 -2
- package/dist/components/ScrollProgress.js.map +1 -1
- package/dist/components/SegmentedControl.d.ts +63 -0
- package/dist/components/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl.js +79 -0
- package/dist/components/SegmentedControl.js.map +1 -0
- package/dist/components/Sidebar.d.ts +109 -0
- package/dist/components/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar.js +106 -0
- package/dist/components/Sidebar.js.map +1 -0
- package/dist/components/Stepper.d.ts +73 -0
- package/dist/components/Stepper.d.ts.map +1 -0
- package/dist/components/Stepper.js +82 -0
- package/dist/components/Stepper.js.map +1 -0
- package/dist/components/Toast.d.ts +8 -1
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +2 -2
- package/dist/components/Toast.js.map +1 -1
- package/dist/components/ToolCall.d.ts +66 -0
- package/dist/components/ToolCall.d.ts.map +1 -0
- package/dist/components/ToolCall.js +78 -0
- package/dist/components/ToolCall.js.map +1 -0
- package/dist/components/agent-status.d.ts +14 -0
- package/dist/components/agent-status.d.ts.map +1 -0
- package/dist/components/agent-status.js +16 -0
- package/dist/components/agent-status.js.map +1 -0
- package/dist/components/index.d.ts +18 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +8 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/iso-date.d.ts +53 -0
- package/dist/components/iso-date.d.ts.map +1 -0
- package/dist/components/iso-date.js +102 -0
- package/dist/components/iso-date.js.map +1 -0
- package/dist/figma-descriptions.json +107 -52
- package/dist/figma-map.json +735 -2
- package/dist/meta/AgentActivityStep.json +2 -2
- package/dist/meta/DatePicker.json +270 -0
- package/dist/meta/DateRangePicker.json +284 -0
- package/dist/meta/Header.json +32 -2
- package/dist/meta/NumberInput.json +407 -0
- package/dist/meta/PromptInput.json +212 -0
- package/dist/meta/ScrollProgress.json +26 -1
- package/dist/meta/SegmentedControl.json +217 -0
- package/dist/meta/SegmentedControlItem.json +122 -0
- package/dist/meta/Sidebar.json +150 -0
- package/dist/meta/SidebarItem.json +184 -0
- package/dist/meta/SidebarSection.json +131 -0
- package/dist/meta/Stepper.json +135 -0
- package/dist/meta/StepperStep.json +148 -0
- package/dist/meta/Tabs.json +5 -0
- package/dist/meta/ToastProvider.json +9 -2
- package/dist/meta/ToolCall.json +192 -0
- package/dist/meta/components.json +5812 -3293
- package/dist/meta/contrast.json +7776 -2478
- package/dist/meta/index.json +145 -3
- package/dist/meta/patterns/AgentRun.json +27 -0
- package/dist/meta/patterns/Form.json +9 -0
- package/dist/meta/patterns/PageShell.json +43 -3
- package/dist/meta/patterns/Wizard.json +20 -1
- package/dist/meta/patterns/index.json +10 -1
- package/dist/styles/date-picker.css +420 -0
- package/dist/styles/date-range-picker.css +280 -0
- package/dist/styles/header.css +26 -0
- package/dist/styles/index.css +15 -0
- package/dist/styles/number-input.css +83 -0
- package/dist/styles/prompt-input.css +127 -0
- package/dist/styles/scroll-progress.css +42 -4
- package/dist/styles/segmented-control.css +182 -0
- package/dist/styles/sidebar.css +307 -0
- package/dist/styles/stepper.css +250 -0
- package/dist/styles/table.css +9 -0
- package/dist/styles/tool-call.css +202 -0
- package/llms.txt +2 -2
- package/package.json +20 -19
- package/LICENSE +0 -21
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useId, useState } from 'react';
|
|
4
|
+
import { STATUS_GLYPHS, STATUS_TEXT } from './agent-status.js';
|
|
5
|
+
const Chevron = () => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "m6 9 6 6 6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
6
|
+
function formatPayload(value) {
|
|
7
|
+
if (typeof value === 'string')
|
|
8
|
+
return value;
|
|
9
|
+
try {
|
|
10
|
+
return JSON.stringify(value, null, 2) ?? String(value);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
// Circular structures and BigInt both throw. Showing something beats
|
|
14
|
+
// taking the whole thread down with it.
|
|
15
|
+
return String(value);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function formatDuration(ms) {
|
|
19
|
+
return ms < 1000 ? `${Math.round(ms)}ms` : `${(ms / 1000).toFixed(1)}s`;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* ToolCall — the evidence behind one step of an agent run.
|
|
23
|
+
*
|
|
24
|
+
* AgentActivityStep says what the agent did in the user's language. ToolCall
|
|
25
|
+
* is where the person checking that account goes next: which tool, with what
|
|
26
|
+
* arguments, and what came back. The title is still plain language and still
|
|
27
|
+
* required, so the technical detail supplements the account rather than
|
|
28
|
+
* replacing it.
|
|
29
|
+
*
|
|
30
|
+
* COLLAPSED BY DEFAULT, EXCEPT THE FAILURE
|
|
31
|
+
*
|
|
32
|
+
* A run makes dozens of calls, and a thread of expanded JSON is unreadable.
|
|
33
|
+
* But `errorMessage` renders outside the disclosure: evidence that takes a
|
|
34
|
+
* click to reach is evidence nobody reads, and a failure is the one thing in
|
|
35
|
+
* the call a reader must not miss.
|
|
36
|
+
*
|
|
37
|
+
* THE DETAILS ARE UNMOUNTED WHEN CLOSED — unlike Accordion, deliberately.
|
|
38
|
+
* Accordion keeps collapsed panels for the form state inside them; a tool call
|
|
39
|
+
* holds no user state, and its payloads can be megabytes of JSON multiplied by
|
|
40
|
+
* every call in the thread.
|
|
41
|
+
*
|
|
42
|
+
* A CALL WITH NOTHING TO SHOW IS NOT A BUTTON. With no input and no output the
|
|
43
|
+
* header renders as text: a disclosure that discloses nothing announces as
|
|
44
|
+
* expandable and does nothing.
|
|
45
|
+
*
|
|
46
|
+
* THE PAYLOADS ARE FOCUSABLE. Each is a scroll container capped in height, and
|
|
47
|
+
* a scroll container a keyboard user cannot focus is one they cannot scroll.
|
|
48
|
+
*
|
|
49
|
+
* It does not announce status changes. AgentActivity owns the run's live
|
|
50
|
+
* region; a second one here would talk over it.
|
|
51
|
+
*/
|
|
52
|
+
export const ToolCall = forwardRef(({ title, name, status = 'pending', input, output, errorMessage, durationMs, defaultExpanded = false, isExpanded: isExpandedProp, onExpandedChange, className, ...rest }, ref) => {
|
|
53
|
+
const [internal, setInternal] = useState(defaultExpanded);
|
|
54
|
+
const isControlled = isExpandedProp !== undefined;
|
|
55
|
+
const isExpanded = isControlled ? isExpandedProp : internal;
|
|
56
|
+
const bodyId = useId();
|
|
57
|
+
const hasInput = input !== undefined;
|
|
58
|
+
const hasOutput = output !== undefined;
|
|
59
|
+
const hasDetails = hasInput || hasOutput;
|
|
60
|
+
const Glyph = STATUS_GLYPHS[status];
|
|
61
|
+
const toggle = () => {
|
|
62
|
+
const next = !isExpanded;
|
|
63
|
+
if (!isControlled)
|
|
64
|
+
setInternal(next);
|
|
65
|
+
onExpandedChange?.(next);
|
|
66
|
+
};
|
|
67
|
+
const header = (_jsxs(_Fragment, { children: [_jsx("span", { className: "ion-tool-call__glyph", "aria-hidden": "true", children: _jsx(Glyph, {}) }), _jsxs("span", { className: "ion-tool-call__heading", children: [_jsx("span", { className: "ion-tool-call__title", children: title }), name && _jsx("code", { className: "ion-tool-call__name", children: name })] }), _jsx("span", { className: "ion-visually-hidden", children: `, ${STATUS_TEXT[status]}` }), durationMs !== undefined && (_jsx("span", { className: "ion-tool-call__duration", children: formatDuration(durationMs) })), hasDetails && (_jsx("span", { className: "ion-tool-call__chevron", "aria-hidden": "true", children: _jsx(Chevron, {}) }))] }));
|
|
68
|
+
return (_jsxs("div", { ...rest, ref: ref, className: [
|
|
69
|
+
'ion-tool-call',
|
|
70
|
+
`ion-tool-call--${status}`,
|
|
71
|
+
isExpanded && hasDetails ? 'ion-tool-call--expanded' : '',
|
|
72
|
+
className || '',
|
|
73
|
+
]
|
|
74
|
+
.filter(Boolean)
|
|
75
|
+
.join(' '), children: [hasDetails ? (_jsx("button", { type: "button", className: "ion-tool-call__header", "aria-expanded": isExpanded, "aria-controls": isExpanded ? bodyId : undefined, onClick: toggle, children: header })) : (_jsx("div", { className: "ion-tool-call__header", children: header })), status === 'failed' && errorMessage && (_jsx("div", { className: "ion-tool-call__error", children: errorMessage })), hasDetails && isExpanded && (_jsxs("div", { id: bodyId, className: "ion-tool-call__body", children: [hasInput && (_jsxs("div", { className: "ion-tool-call__section", children: [_jsx("span", { className: "ion-tool-call__label", children: "Input" }), _jsx("pre", { className: "ion-tool-call__payload", tabIndex: 0, "aria-label": `Input to ${name ?? title}`, children: _jsx("code", { children: formatPayload(input) }) })] })), hasOutput && (_jsxs("div", { className: "ion-tool-call__section", children: [_jsx("span", { className: "ion-tool-call__label", children: "Output" }), _jsx("pre", { className: "ion-tool-call__payload", tabIndex: 0, "aria-label": `Output from ${name ?? title}`, children: _jsx("code", { children: formatPayload(output) }) })] }))] }))] }));
|
|
76
|
+
});
|
|
77
|
+
ToolCall.displayName = 'ToolCall';
|
|
78
|
+
//# sourceMappingURL=ToolCall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolCall.js","sourceRoot":"","sources":["../../src/components/ToolCall.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAsC/D,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CACpB,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,EAAC,SAAS,EAAC,OAAO,YACvE,eACE,CAAC,EAAC,cAAc,EAChB,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,CACP,CAAC;AAEF,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KA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EAAE,MAAM,YAEd,MAAM,GACA,CACV,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAC,uBAAuB,YAAE,MAAM,GAAO,CACtD,EAEA,MAAM,KAAK,QAAQ,IAAI,YAAY,IAAI,CACtC,cAAK,SAAS,EAAC,sBAAsB,YAAE,YAAY,GAAO,CAC3D,EAEA,UAAU,IAAI,UAAU,IAAI,CAC3B,eAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAC,qBAAqB,aAC7C,QAAQ,IAAI,CACX,eAAK,SAAS,EAAC,wBAAwB,aACrC,eAAM,SAAS,EAAC,sBAAsB,sBAAa,EACnD,cACE,SAAS,EAAC,wBAAwB,EAClC,QAAQ,EAAE,CAAC,gBACC,YAAY,IAAI,IAAI,KAAK,EAAE,YAEvC,yBAAO,aAAa,CAAC,KAAK,CAAC,GAAQ,GAC/B,IACF,CACP,EACA,SAAS,IAAI,CACZ,eAAK,SAAS,EAAC,wBAAwB,aACrC,eAAM,SAAS,EAAC,sBAAsB,uBAAc,EACpD,cACE,SAAS,EAAC,wBAAwB,EAClC,QAAQ,EAAE,CAAC,gBACC,eAAe,IAAI,IAAI,KAAK,EAAE,YAE1C,yBAAO,aAAa,CAAC,MAAM,CAAC,GAAQ,GAChC,IACF,CACP,IACG,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The status vocabulary the agentic tier shares: one union, one name per
|
|
3
|
+
* status, one glyph per status. AgentActivityStep and ToolCall both read from
|
|
4
|
+
* here, so a step and the tool call behind it can never disagree about what
|
|
5
|
+
* "failed" looks like or is called.
|
|
6
|
+
*
|
|
7
|
+
* The glyphs differ in SHAPE, not only in the colour a stylesheet gives them,
|
|
8
|
+
* so status survives greyscale and forced-colours mode (WCAG 1.4.1).
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export type AgentActivityStatus = 'pending' | 'active' | 'done' | 'failed' | 'skipped';
|
|
12
|
+
export declare const STATUS_TEXT: Record<AgentActivityStatus, string>;
|
|
13
|
+
export declare const STATUS_GLYPHS: Record<AgentActivityStatus, () => React.ReactElement>;
|
|
14
|
+
//# sourceMappingURL=agent-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-status.d.ts","sourceRoot":"","sources":["../../src/components/agent-status.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,mBAAmB,GAC7B,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEvD,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAM3D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAChC,mBAAmB,EACnB,MAAM,KAAK,CAAC,YAAY,CA2DzB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const STATUS_TEXT = {
|
|
3
|
+
pending: 'Not started',
|
|
4
|
+
active: 'In progress',
|
|
5
|
+
done: 'Done',
|
|
6
|
+
failed: 'Failed',
|
|
7
|
+
skipped: 'Skipped',
|
|
8
|
+
};
|
|
9
|
+
export const STATUS_GLYPHS = {
|
|
10
|
+
pending: () => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2" }) })),
|
|
11
|
+
active: () => (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: [_jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2", opacity: "0.3" }), _jsx("path", { d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })] })),
|
|
12
|
+
done: () => (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: [_jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "m8.5 12 2.5 2.5 4.5-5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] })),
|
|
13
|
+
failed: () => (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: [_jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "m9 9 6 6M15 9l-6 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })] })),
|
|
14
|
+
skipped: () => (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: [_jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "M8.5 12h7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })] })),
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=agent-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-status.js","sourceRoot":"","sources":["../../src/components/agent-status.tsx"],"names":[],"mappings":";AAcA,MAAM,CAAC,MAAM,WAAW,GAAwC;IAC9D,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAGtB;IACF,OAAO,EAAE,GAAG,EAAE,CAAC,CACb,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,EAAC,SAAS,EAAC,OAAO,YACvE,iBAAQ,EAAE,EAAC,IAAI,EAA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,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,GACrB,IACE,CACP;IACD,OAAO,EAAE,GAAG,EAAE,CAAC,CACb,eAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,EAAC,SAAS,EAAC,OAAO,aACvE,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,GAAG,EACtE,eACE,CAAC,EAAC,WAAW,EACb,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,GACrB,IACE,CACP;CACF,CAAC"}
|
|
@@ -49,7 +49,7 @@ export type { NavItemProps } from './NavItem.js';
|
|
|
49
49
|
export { Table, TableHead, TableBody, TableRow, TableCell } from './Table.js';
|
|
50
50
|
export type { TableProps, TableDensity, TableRowProps, TableRowSelection, TableCellProps, TableCellAlign, TableCellScope, } from './Table.js';
|
|
51
51
|
export { ScrollProgress } from './ScrollProgress.js';
|
|
52
|
-
export type { ScrollProgressProps, ScrollProgressSection, } from './ScrollProgress.js';
|
|
52
|
+
export type { ScrollProgressProps, ScrollProgressSection, ScrollProgressPlacement, } from './ScrollProgress.js';
|
|
53
53
|
export { FullCard } from './FullCard.js';
|
|
54
54
|
export type { FullCardProps, FullCardAlignment, FullCardHeadingLevel, } from './FullCard.js';
|
|
55
55
|
export { AgentStop } from './AgentStop.js';
|
|
@@ -70,6 +70,18 @@ export { Accordion, AccordionItem } from './Accordion.js';
|
|
|
70
70
|
export type { AccordionProps, AccordionItemProps, AccordionHeadingLevel, } from './Accordion.js';
|
|
71
71
|
export { Drawer } from './Drawer.js';
|
|
72
72
|
export type { DrawerProps, DrawerPlacement, DrawerSize } from './Drawer.js';
|
|
73
|
+
export { Sidebar, SidebarSection, SidebarItem } from './Sidebar.js';
|
|
74
|
+
export type { SidebarProps, SidebarSectionProps, SidebarItemProps, } from './Sidebar.js';
|
|
75
|
+
export { SegmentedControl, SegmentedControlItem } from './SegmentedControl.js';
|
|
76
|
+
export type { SegmentedControlProps, SegmentedControlItemProps, SegmentedControlSize, } from './SegmentedControl.js';
|
|
77
|
+
export { NumberInput } from './NumberInput.js';
|
|
78
|
+
export type { NumberInputProps, NumberInputSize } from './NumberInput.js';
|
|
79
|
+
export { ToolCall } from './ToolCall.js';
|
|
80
|
+
export type { ToolCallProps } from './ToolCall.js';
|
|
81
|
+
export { PromptInput } from './PromptInput.js';
|
|
82
|
+
export type { PromptInputProps, PromptInputSubmitKey } from './PromptInput.js';
|
|
83
|
+
export { Stepper, StepperStep } from './Stepper.js';
|
|
84
|
+
export type { StepperProps, StepperStepProps, StepperOrientation, StepperStepStatus, } from './Stepper.js';
|
|
73
85
|
export { Spinner } from './Spinner.js';
|
|
74
86
|
export type { SpinnerProps, SpinnerSize } from './Spinner.js';
|
|
75
87
|
export { ProgressBar } from './ProgressBar.js';
|
|
@@ -82,4 +94,9 @@ export { FileUpload } from './FileUpload.js';
|
|
|
82
94
|
export type { FileUploadProps, FileUploadSize, RejectedFile, } from './FileUpload.js';
|
|
83
95
|
export { Combobox } from './Combobox.js';
|
|
84
96
|
export type { ComboboxProps, ComboboxSize, ComboboxOption, } from './Combobox.js';
|
|
97
|
+
export { DatePicker } from './DatePicker.js';
|
|
98
|
+
export type { DatePickerProps, DatePickerSize } from './DatePicker.js';
|
|
99
|
+
export { DateRangePicker } from './DateRangePicker.js';
|
|
100
|
+
export type { DateRangePickerProps, DateRangePickerSize, DateRange, DateRangePreset, } from './DateRangePicker.js';
|
|
101
|
+
export type { IsoDate } from './iso-date.js';
|
|
85
102
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,WAAW,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AAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EACV,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAQ9B,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -34,10 +34,18 @@ export { ConfidenceIndicator } from './ConfidenceIndicator.js';
|
|
|
34
34
|
export { Breadcrumb, BreadcrumbItem } from './Breadcrumb.js';
|
|
35
35
|
export { Accordion, AccordionItem } from './Accordion.js';
|
|
36
36
|
export { Drawer } from './Drawer.js';
|
|
37
|
+
export { Sidebar, SidebarSection, SidebarItem } from './Sidebar.js';
|
|
38
|
+
export { SegmentedControl, SegmentedControlItem } from './SegmentedControl.js';
|
|
39
|
+
export { NumberInput } from './NumberInput.js';
|
|
40
|
+
export { ToolCall } from './ToolCall.js';
|
|
41
|
+
export { PromptInput } from './PromptInput.js';
|
|
42
|
+
export { Stepper, StepperStep } from './Stepper.js';
|
|
37
43
|
export { Spinner } from './Spinner.js';
|
|
38
44
|
export { ProgressBar } from './ProgressBar.js';
|
|
39
45
|
export { Skeleton } from './Skeleton.js';
|
|
40
46
|
export { EmptyState } from './EmptyState.js';
|
|
41
47
|
export { FileUpload } from './FileUpload.js';
|
|
42
48
|
export { Combobox } from './Combobox.js';
|
|
49
|
+
export { DatePicker } from './DatePicker.js';
|
|
50
|
+
export { DateRangePicker } from './DateRangePicker.js';
|
|
43
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAOnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAOnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAO/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,O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} from '@internationalized/date';
|
|
2
|
+
import type { DateValue } from '@internationalized/date';
|
|
3
|
+
/**
|
|
4
|
+
* A calendar date as `YYYY-MM-DD` — no time, no timezone, no offset.
|
|
5
|
+
*
|
|
6
|
+
* This is an alias for `string`, so it documents rather than enforces. The
|
|
7
|
+
* runtime enforcement is in `toCalendarDate`, which throws on a malformed
|
|
8
|
+
* value instead of silently rendering an empty field.
|
|
9
|
+
*/
|
|
10
|
+
export type IsoDate = string;
|
|
11
|
+
/**
|
|
12
|
+
* ISO string in, `CalendarDate` out. Throws on anything else.
|
|
13
|
+
*
|
|
14
|
+
* THROWING IS THE POINT. The tempting alternative is to return `null` for an
|
|
15
|
+
* unparseable value, and the first version did. A caller who passed a
|
|
16
|
+
* `Date`, a timestamp or `'04/12/2026'` then got a date picker that rendered
|
|
17
|
+
* perfectly with nothing in it, and no indication anywhere that the value it
|
|
18
|
+
* was handed had been dropped on the floor. An exception names the prop and the
|
|
19
|
+
* value, which is the difference between a five-second fix and an afternoon.
|
|
20
|
+
*
|
|
21
|
+
* `parseDate` is also stricter than it looks: it rejects `2026-02-30` and
|
|
22
|
+
* `2026-13-01`, so a date that is well-formed but does not exist fails here
|
|
23
|
+
* too rather than being quietly rounded into a neighbouring month.
|
|
24
|
+
*/
|
|
25
|
+
export declare function toCalendarDate(value: IsoDate | null | undefined, prop: string): CalendarDate | null;
|
|
26
|
+
/**
|
|
27
|
+
* `CalendarDate` out, ISO string back.
|
|
28
|
+
*
|
|
29
|
+
* `toString()` is NOT used, and this is not a stylistic preference. A value
|
|
30
|
+
* that came from a non-Gregorian calendar stringifies WITH its calendar
|
|
31
|
+
* annotation — `2569-05-30[u-ca-buddhist]` — which is a correct ISO 8601-2
|
|
32
|
+
* string and is not what any caller expecting `YYYY-MM-DD` will do anything
|
|
33
|
+
* sensible with. Building the string from the parts of the Gregorian
|
|
34
|
+
* projection is what keeps the wire format one shape in every locale.
|
|
35
|
+
*
|
|
36
|
+
* The projection to Gregorian happens here rather than being assumed. In
|
|
37
|
+
* practice react-aria hands back the calendar it was given — `useCalendarState`
|
|
38
|
+
* converts through `toCalendar` on the way out — so a Gregorian value in is a
|
|
39
|
+
* Gregorian value out, and this is a no-op. It is written anyway because the
|
|
40
|
+
* one path where it is NOT a no-op is an unavailable-date predicate being
|
|
41
|
+
* offered a cell from the DISPLAY calendar, which is the reader's, not ours.
|
|
42
|
+
*/
|
|
43
|
+
export declare function toIso(date: DateValue): IsoDate;
|
|
44
|
+
/**
|
|
45
|
+
* Wraps an `isDateUnavailable` predicate so the caller receives an ISO string
|
|
46
|
+
* rather than a `CalendarDate`.
|
|
47
|
+
*
|
|
48
|
+
* Returned as `undefined` when there is no predicate, rather than as a function
|
|
49
|
+
* that always returns false. react-aria checks for the prop's presence in more
|
|
50
|
+
* than one place, and a no-op function is present.
|
|
51
|
+
*/
|
|
52
|
+
export declare function wrapUnavailable(fn: ((date: IsoDate) => boolean) | undefined): ((date: DateValue) => boolean) | undefined;
|
|
53
|
+
//# sourceMappingURL=iso-date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iso-date.d.ts","sourceRoot":"","sources":["../../src/components/iso-date.ts"],"names":[],"mappings":"AAmCA,OAAO,EACL,YAAY,EAIb,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAK7B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACjC,IAAI,EAAE,MAAM,GACX,YAAY,GAAG,IAAI,CAerB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAO9C;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,SAAS,GAC3C,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,GAAG,SAAS,CAG5C"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The ISO boundary. Every conversion between the public API and react-aria's
|
|
3
|
+
* date objects happens here and nowhere else.
|
|
4
|
+
*
|
|
5
|
+
* WHY THE PUBLIC API IS A STRING AND NOT A `CalendarDate`
|
|
6
|
+
*
|
|
7
|
+
* react-aria's date hooks speak `@internationalized/date`. Exposing that type
|
|
8
|
+
* on the props would make it a peer dependency: every consumer would have to
|
|
9
|
+
* install the package and write `parseDate('2026-04-12')` to pass a literal
|
|
10
|
+
* date. That is a real cost for a real benefit — non-Gregorian calendar systems
|
|
11
|
+
* survive the round trip untouched — and the benefit is not the one this system
|
|
12
|
+
* is optimising for.
|
|
13
|
+
*
|
|
14
|
+
* IonBase is written on the premise that the caller is an agent with no
|
|
15
|
+
* developer reviewing the output. An agent can write `value="2026-04-12"` and
|
|
16
|
+
* be right; it cannot forget to install a package it was never told about, or
|
|
17
|
+
* pass a `Date` where a `CalendarDate` was wanted and get a type error it has
|
|
18
|
+
* no way to act on. `@internationalized/date` stays a dependency of this
|
|
19
|
+
* package, imported here, and never appears in a consumer's import list.
|
|
20
|
+
*
|
|
21
|
+
* WHAT IS GIVEN UP, STATED PLAINLY
|
|
22
|
+
*
|
|
23
|
+
* The VALUE is always a Gregorian ISO calendar date. The DISPLAY is not — the
|
|
24
|
+
* field and the grid are rendered in the user's locale and calendar system via
|
|
25
|
+
* `createCalendar`, so a Hijri or Buddhist reader sees their own calendar and
|
|
26
|
+
* the value still comes back as `YYYY-MM-DD`. That is the same split the HTML
|
|
27
|
+
* `<input type="date">` makes, and it is the one almost every backend wants.
|
|
28
|
+
*
|
|
29
|
+
* WHAT THIS IS NOT
|
|
30
|
+
*
|
|
31
|
+
* Not a `Date`. `new Date('2026-04-12')` parses as UTC midnight and then prints
|
|
32
|
+
* as the 11th for anyone west of Greenwich — the single most common date bug
|
|
33
|
+
* there is. A calendar date has no time and no zone, so it cannot have that
|
|
34
|
+
* bug, and keeping the string as the wire format is what preserves that.
|
|
35
|
+
*/
|
|
36
|
+
import { CalendarDate, GregorianCalendar, parseDate, toCalendar, } from '@internationalized/date';
|
|
37
|
+
/** Matches exactly `YYYY-MM-DD`. Deliberately not a full ISO 8601 parse. */
|
|
38
|
+
const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
39
|
+
/**
|
|
40
|
+
* ISO string in, `CalendarDate` out. Throws on anything else.
|
|
41
|
+
*
|
|
42
|
+
* THROWING IS THE POINT. The tempting alternative is to return `null` for an
|
|
43
|
+
* unparseable value, and the first version did. A caller who passed a
|
|
44
|
+
* `Date`, a timestamp or `'04/12/2026'` then got a date picker that rendered
|
|
45
|
+
* perfectly with nothing in it, and no indication anywhere that the value it
|
|
46
|
+
* was handed had been dropped on the floor. An exception names the prop and the
|
|
47
|
+
* value, which is the difference between a five-second fix and an afternoon.
|
|
48
|
+
*
|
|
49
|
+
* `parseDate` is also stricter than it looks: it rejects `2026-02-30` and
|
|
50
|
+
* `2026-13-01`, so a date that is well-formed but does not exist fails here
|
|
51
|
+
* too rather than being quietly rounded into a neighbouring month.
|
|
52
|
+
*/
|
|
53
|
+
export function toCalendarDate(value, prop) {
|
|
54
|
+
if (value == null || value === '')
|
|
55
|
+
return null;
|
|
56
|
+
if (typeof value !== 'string' || !ISO_DATE.test(value)) {
|
|
57
|
+
throw new TypeError(`${prop}: expected a YYYY-MM-DD string, received ${JSON.stringify(value)}. ` +
|
|
58
|
+
`Date pickers in ionbase-ui take ISO calendar dates, not Date objects or timestamps.`);
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
return parseDate(value);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
throw new RangeError(`${prop}: ${JSON.stringify(value)} is well-formed but is not a real date.`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* `CalendarDate` out, ISO string back.
|
|
69
|
+
*
|
|
70
|
+
* `toString()` is NOT used, and this is not a stylistic preference. A value
|
|
71
|
+
* that came from a non-Gregorian calendar stringifies WITH its calendar
|
|
72
|
+
* annotation — `2569-05-30[u-ca-buddhist]` — which is a correct ISO 8601-2
|
|
73
|
+
* string and is not what any caller expecting `YYYY-MM-DD` will do anything
|
|
74
|
+
* sensible with. Building the string from the parts of the Gregorian
|
|
75
|
+
* projection is what keeps the wire format one shape in every locale.
|
|
76
|
+
*
|
|
77
|
+
* The projection to Gregorian happens here rather than being assumed. In
|
|
78
|
+
* practice react-aria hands back the calendar it was given — `useCalendarState`
|
|
79
|
+
* converts through `toCalendar` on the way out — so a Gregorian value in is a
|
|
80
|
+
* Gregorian value out, and this is a no-op. It is written anyway because the
|
|
81
|
+
* one path where it is NOT a no-op is an unavailable-date predicate being
|
|
82
|
+
* offered a cell from the DISPLAY calendar, which is the reader's, not ours.
|
|
83
|
+
*/
|
|
84
|
+
export function toIso(date) {
|
|
85
|
+
const g = toCalendar(new CalendarDate(date.calendar, date.era, date.year, date.month, date.day), new GregorianCalendar());
|
|
86
|
+
const pad = (n, width) => String(n).padStart(width, '0');
|
|
87
|
+
return `${pad(g.year, 4)}-${pad(g.month, 2)}-${pad(g.day, 2)}`;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Wraps an `isDateUnavailable` predicate so the caller receives an ISO string
|
|
91
|
+
* rather than a `CalendarDate`.
|
|
92
|
+
*
|
|
93
|
+
* Returned as `undefined` when there is no predicate, rather than as a function
|
|
94
|
+
* that always returns false. react-aria checks for the prop's presence in more
|
|
95
|
+
* than one place, and a no-op function is present.
|
|
96
|
+
*/
|
|
97
|
+
export function wrapUnavailable(fn) {
|
|
98
|
+
if (!fn)
|
|
99
|
+
return undefined;
|
|
100
|
+
return (date) => fn(toIso(date));
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=iso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