@mechane-ai/elements 0.44.0 → 0.46.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.
Files changed (117) hide show
  1. package/README.md +48 -18
  2. package/bin/mechane-elements-catalog.mjs +42 -4
  3. package/dist/ai.js +268 -202
  4. package/dist/catalog.json +95 -31
  5. package/dist/categorical-values-BXi-rJuv.js +74 -0
  6. package/dist/chart-cursor-1mFd48Jc.js +23 -0
  7. package/dist/chart-data-CIJVWCYt.js +21 -0
  8. package/dist/chart-frame-BaxKn_MB.js +236 -0
  9. package/dist/{chart-input-B6_HXFDP.js → chart-input-Bm82_9Rd.js} +2 -2
  10. package/dist/chart-theme-4zprJ3rW.js +404 -0
  11. package/dist/charts/cartesian.js +1624 -1442
  12. package/dist/charts/distribution.js +486 -409
  13. package/dist/charts/graph.js +383 -358
  14. package/dist/charts/hierarchy.js +103 -94
  15. package/dist/charts/matrix.js +340 -333
  16. package/dist/charts/timeline.js +167 -134
  17. package/dist/charts.js +3 -3
  18. package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
  19. package/dist/collections.js +1648 -1188
  20. package/dist/{constants.stylex-CaVa9yGN.js → constants.stylex-CqhVl0uU.js} +9 -9
  21. package/dist/content/code.js +1 -1
  22. package/dist/content/diff.js +67 -66
  23. package/dist/content/link.js +1 -1
  24. package/dist/content/markdown.js +2 -2
  25. package/dist/content/tree.js +3 -3
  26. package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
  27. package/dist/content.js +1 -1
  28. package/dist/csp.js +6 -11
  29. package/dist/feedback.js +1 -1
  30. package/dist/forms/dates.js +274 -214
  31. package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
  32. package/dist/forms.js +3 -3
  33. package/dist/index.js +1 -1
  34. package/dist/layout.js +207 -207
  35. package/dist/navigation.js +4 -3
  36. package/dist/packages/ai/src/conversation.d.ts +2 -0
  37. package/dist/packages/ai/src/prompt-input.d.ts +7 -2
  38. package/dist/packages/charts/src/cartesian/composition-bars.d.ts +2 -2
  39. package/dist/packages/charts/src/cartesian/index.d.ts +3 -2
  40. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +8 -2
  41. package/dist/packages/charts/src/cartesian/time-series.d.ts +11 -1
  42. package/dist/packages/charts/src/categorical-values.d.ts +14 -9
  43. package/dist/packages/charts/src/chart-frame.d.ts +7 -9
  44. package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
  45. package/dist/packages/charts/src/chart-range.d.ts +33 -0
  46. package/dist/packages/charts/src/chart-rows.d.ts +20 -0
  47. package/dist/packages/charts/src/chart-theme.d.ts +25 -1
  48. package/dist/packages/charts/src/chart.d.ts +81 -0
  49. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +6 -4
  50. package/dist/packages/charts/src/index.d.ts +2 -1
  51. package/dist/packages/charts/src/matrix/matrix-strip.d.ts +3 -3
  52. package/dist/packages/charts/src/plot-width.d.ts +0 -1
  53. package/dist/packages/charts/src/timeline/index.d.ts +1 -1
  54. package/dist/packages/charts/src/timeline/waterfall.d.ts +6 -2
  55. package/dist/packages/collections/src/collection-controls.d.ts +5 -1
  56. package/dist/packages/collections/src/collection-filters.d.ts +4 -1
  57. package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
  58. package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
  59. package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
  60. package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
  61. package/dist/packages/collections/src/data-table-text.d.ts +13 -0
  62. package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
  63. package/dist/packages/collections/src/data-table.d.ts +3 -85
  64. package/dist/packages/collections/src/index.d.ts +11 -6
  65. package/dist/packages/collections/src/query-controls.d.ts +6 -2
  66. package/dist/packages/collections/src/table-results.d.ts +47 -13
  67. package/dist/packages/collections/src/timeline.d.ts +1 -0
  68. package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
  69. package/dist/packages/collections/src/use-table-window.d.ts +25 -0
  70. package/dist/packages/content/src/viewer.d.ts +8 -0
  71. package/dist/packages/core/src/disclosure.d.ts +9 -1
  72. package/dist/packages/core/src/index.d.ts +1 -0
  73. package/dist/packages/core/src/route-link.d.ts +11 -0
  74. package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
  75. package/dist/packages/forms/src/file-picker.d.ts +15 -0
  76. package/dist/packages/forms/src/form-controls.d.ts +1 -6
  77. package/dist/packages/forms/src/forms.d.ts +4 -1
  78. package/dist/packages/forms/src/index.d.ts +4 -2
  79. package/dist/packages/forms/src/selection.d.ts +14 -0
  80. package/dist/packages/foundations/src/chart-tones.d.ts +5 -0
  81. package/dist/packages/foundations/src/csp/index.d.ts +1 -1
  82. package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
  83. package/dist/packages/navigation/src/index.d.ts +1 -1
  84. package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
  85. package/dist/plot-width-v2c_rA20.js +63 -0
  86. package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
  87. package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
  88. package/dist/src-CGc_hjxJ.js +409 -0
  89. package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
  90. package/dist/{src-CDp1JtwC.js → src-DVHlknB6.js} +135 -120
  91. package/dist/styles2.css +167 -132
  92. package/dist/tokens.js +1 -1
  93. package/package.json +1 -4
  94. package/packages/foundations/src/constants.stylex.ts +9 -9
  95. package/packages/foundations/src/tokens.stylex.ts +9 -9
  96. package/skills/extend-elements/SKILL.md +74 -0
  97. package/skills/review-elements/SKILL.md +76 -0
  98. package/skills/upgrade-elements/SKILL.md +34 -0
  99. package/skills/upgrade-elements/references/releases.md +58 -0
  100. package/skills/use-elements/SKILL.md +64 -13
  101. package/skills/use-elements/references/agent.md +57 -0
  102. package/skills/use-elements/references/charts.md +63 -0
  103. package/skills/use-elements/references/collections.md +89 -0
  104. package/skills/use-elements/references/conversations.md +47 -0
  105. package/skills/use-elements/references/forms.md +81 -0
  106. package/skills/use-elements/references/reports.md +6 -4
  107. package/skills/use-elements/references/styling.md +70 -0
  108. package/skills/use-elements/references/workspace.md +3 -3
  109. package/dist/categorical-values-ByvFLaNE.js +0 -59
  110. package/dist/chart-frame-Bcd9Tpt5.js +0 -251
  111. package/dist/chart-navigation-BAbb5PV9.js +0 -154
  112. package/dist/header-styles-COxCYFZx.js +0 -90
  113. package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
  114. package/dist/packages/charts/src/chart-surface.d.ts +0 -27
  115. package/dist/packages/navigation/src/route-link.d.ts +0 -2
  116. package/dist/plot-width-8cXdAjoD.js +0 -96
  117. package/dist/src-Bk7M67zy.js +0 -396
@@ -1,10 +1,14 @@
1
+ import type { ChangeDetails } from '@ui-sdk/core';
1
2
  import type { PartProps } from '@ui-sdk/react/primitive';
2
3
  import type { ComponentType } from 'react';
3
4
  import type { CollectionFilter } from './collection-filters.tsx';
5
+ /** Why a search term changed: typing, the close button, Escape, a form reset, or a call such as an agent's step. */
6
+ export type CollectionSearchDetails = ChangeDetails<'input-change' | 'clear-press' | 'escape-key' | 'reset' | 'imperative'>;
7
+ export type CollectionSubmitDetails = ChangeDetails<'enter-key' | 'imperative'>;
4
8
  export type CollectionSearch = {
5
9
  readonly value: string;
6
- readonly onChange: (value: string) => void;
7
- readonly onSubmit?: () => void;
10
+ readonly onChange: (value: string, details: CollectionSearchDetails) => void;
11
+ readonly onSubmit?: (value: string, details: CollectionSubmitDetails) => void;
8
12
  readonly label?: string;
9
13
  readonly placeholder?: string;
10
14
  };
@@ -1,26 +1,60 @@
1
+ import type { ChangeDetails } from '@ui-sdk/core';
1
2
  import type { PartProps } from '@ui-sdk/react/primitive';
2
- import type { ComponentType } from 'react';
3
+ import type { ComponentType, ReactNode } from 'react';
3
4
  import type { CollectionPaginationProps } from './collection-controls.tsx';
4
5
  export type DataTableSort = {
5
6
  readonly columnId: string;
6
7
  readonly direction: 'ascending' | 'descending';
7
8
  };
9
+ /** Why the sort wants to change: a press on a header, or a call such as an agent's step. */
10
+ export type DataTableSortDetails = ChangeDetails<'trigger-press' | 'imperative'>;
11
+ /** Why the selection wants to change: a press on a row's checkbox or on the one for every row, or a call. */
12
+ export type DataTableSelectionDetails = ChangeDetails<'item-press' | 'imperative'>;
8
13
  export type TableResultStatus = 'ready' | 'pending' | 'failed';
9
- type ResultOptions = {
14
+ export type TableResultOptions = {
10
15
  readonly status: TableResultStatus;
11
- readonly sort: DataTableSort | undefined;
16
+ readonly sort: DataTableSort | null;
17
+ readonly onSortChange: ((sort: DataTableSort | null, details: DataTableSortDetails) => void) | undefined;
18
+ /** The columns the application's query can order by. */
19
+ readonly sortable: ReadonlyArray<{
20
+ readonly id: string;
21
+ readonly label: string;
22
+ }>;
23
+ /** The selected row IDs, or null for a table without selection. */
24
+ readonly selected: ReadonlyArray<string> | null;
25
+ readonly onSelectedChange: ((selected: Array<string>, details: DataTableSelectionDetails) => void) | undefined;
12
26
  readonly pagination: CollectionPaginationProps | undefined;
13
- readonly captionElement: {
14
- readonly current: HTMLTableCaptionElement | null;
15
- };
27
+ /** Every supplied row's ID in the supplied order, including rows a window has not rendered. */
28
+ readonly rowIds: ReadonlyArray<string>;
29
+ /** A row's name from its data, for a row a window has not rendered. */
30
+ readonly rowLabel: (row: number) => string | undefined;
31
+ /** Whether each row has an action a reader can use now. */
32
+ readonly isActionable: boolean;
33
+ /** Brings a row a window has not rendered into view. */
34
+ readonly reveal: (row: number) => void;
35
+ /** Uses a row's action as a press does. */
36
+ readonly onOpen: (row: number) => void;
16
37
  readonly isPlaceholder: boolean;
17
38
  };
18
- export declare const TableResultCaption: ComponentType<Omit<PartProps<'caption'>, 'id'> & ResultOptions>;
19
- type RecordOptions = {
20
- readonly recordId: string;
21
- readonly collection: string;
39
+ /** What a table's own controls call on its results. */
40
+ export type TableResultsApi = {
41
+ readonly focusRow: (row: number) => boolean;
42
+ readonly toggleSort: (columnId: string, event: Event) => boolean;
43
+ readonly toggleRow: (id: string, event: Event | undefined) => void;
44
+ readonly toggleAll: (event: Event | undefined) => void;
22
45
  };
23
- type RecordTrigger<Tag extends 'a' | 'button'> = ComponentType<Omit<PartProps<Tag>, 'id'> & RecordOptions>;
24
- export declare const RecordLink: RecordTrigger<'a'>;
25
- export declare const RecordButton: RecordTrigger<'button'>;
46
+ /** Creates a table's results and renders its `table` element, whose props can call the results. */
47
+ export declare function useTableResults(options: TableResultOptions, table: (api: TableResultsApi) => PartProps<'table'>): {
48
+ readonly api: TableResultsApi;
49
+ readonly element: ReactNode;
50
+ };
51
+ type TriggerPart<Tag extends 'a' | 'button'> = ComponentType<Omit<PartProps<Tag>, 'id' | 'value'> & {
52
+ readonly value: string;
53
+ readonly row: number;
54
+ readonly col: number;
55
+ }>;
56
+ /** A row's link action, keyed by its row's ID. The rows' actions share one Tab stop. */
57
+ export declare const TableRowLink: TriggerPart<'a'>;
58
+ /** A row's button action, keyed by its row's ID. */
59
+ export declare const TableRowButton: TriggerPart<'button'>;
26
60
  export {};
@@ -17,6 +17,7 @@ export type TimelineItemProps = {
17
17
  readonly details: ReactNode;
18
18
  readonly defaultOpen?: boolean;
19
19
  });
20
+ /** An ordered list of dated events on the UI SDK timeline: one Tab stop, and arrow keys move between events. */
20
21
  declare function TimelineRoot({ label, children }: TimelineProps): ReactNode;
21
22
  declare function TimelineItem({ icon, title, time, metadata, children, details, defaultOpen, }: TimelineItemProps): ReactNode;
22
23
  export declare const Timeline: {
@@ -1,4 +1,5 @@
1
1
  import type { KeyboardEvent, ReactNode } from 'react';
2
+ import type { FilterRemoveDetails } from './collection-controls.tsx';
2
3
  import type { CollectionFilter } from './collection-filters.tsx';
3
4
  import type { CollectionSearch } from './query-controls.tsx';
4
5
  export type CollectionControlsProps = {
@@ -9,7 +10,7 @@ export type CollectionControlsProps = {
9
10
  readonly chips?: ReadonlyArray<{
10
11
  readonly id: string;
11
12
  readonly label: string;
12
- readonly onRemove: () => void;
13
+ readonly onRemove: (details: FilterRemoveDetails) => void;
13
14
  }>;
14
15
  readonly viewActions?: ReactNode;
15
16
  readonly display?: ReactNode;
@@ -0,0 +1,25 @@
1
+ import type { VirtualItem } from '@ui-sdk/core';
2
+ import type { RefObject } from 'react';
3
+ type TableWindowOptions = {
4
+ readonly isEnabled: boolean;
5
+ readonly viewport: RefObject<HTMLElement | null>;
6
+ readonly count: number;
7
+ readonly keyOf: (index: number) => string;
8
+ /** A row's height before it is measured. A fixed row keeps it. */
9
+ readonly estimate: number;
10
+ /** The height of the caption and header above the first row. */
11
+ readonly margin: number;
12
+ /** Rows to render wherever the viewport is, such as the one with focus. */
13
+ readonly keep: () => ReadonlyArray<number>;
14
+ readonly onEnd: (() => void) | undefined;
15
+ };
16
+ type MeasureRef = (element: HTMLElement | null) => () => void;
17
+ /** Renders only the rows in view, on the UI SDK virtualizer. Each item's `start` is measured from the first row. */
18
+ export declare function useTableWindow(options: TableWindowOptions): {
19
+ items: readonly VirtualItem[];
20
+ size: number;
21
+ scrollToIndex: (index: number) => void;
22
+ /** A stable ref for a content-sized row, so its height is measured now and whenever it changes. */
23
+ measure(index: number): MeasureRef;
24
+ };
25
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { PartProps } from '@ui-sdk/react/primitive';
2
+ import type { ComponentType } from 'react';
3
+ type ViewerKind = 'code' | 'diff' | 'json' | 'log' | 'stack-trace';
4
+ /** A read-only viewer's frame. An agent finds it by its label and kind; its content stays out of the snapshot. */
5
+ export declare const Viewer: ComponentType<Omit<PartProps<'section'>, 'id'> & {
6
+ readonly kind: ViewerKind;
7
+ }>;
8
+ export {};
@@ -2,7 +2,15 @@ import * as SdkAccordion from '@ui-sdk/react/accordion';
2
2
  import * as SdkCollapsible from '@ui-sdk/react/collapsible';
3
3
  import type { ComponentProps, ReactNode } from 'react';
4
4
  import type { OpenStateProperties, ValueStateProperties } from '../../foundations/src/control-state.ts';
5
- type AccordionRootProps<Value extends string> = Omit<ComponentProps<typeof SdkAccordion.Accordion<Value>>, 'value' | 'defaultValue' | 'onValueChange'> & ValueStateProperties<Array<Value>, NonNullable<ComponentProps<typeof SdkAccordion.Accordion<Value>>['onValueChange']>>;
5
+ /** Names the group of sections, so a reader and an agent can tell one accordion from another. */
6
+ type AccordionName = {
7
+ readonly 'aria-label': string;
8
+ readonly 'aria-labelledby'?: undefined;
9
+ } | {
10
+ readonly 'aria-labelledby': string;
11
+ readonly 'aria-label'?: undefined;
12
+ };
13
+ type AccordionRootProps<Value extends string> = Omit<ComponentProps<typeof SdkAccordion.Accordion<Value>>, 'value' | 'defaultValue' | 'onValueChange' | 'aria-label' | 'aria-labelledby'> & AccordionName & ValueStateProperties<Array<Value>, NonNullable<ComponentProps<typeof SdkAccordion.Accordion<Value>>['onValueChange']>>;
6
14
  type AccordionItemProps = ComponentProps<typeof SdkAccordion.AccordionItem<string>>;
7
15
  type AccordionHeaderProps = ComponentProps<typeof SdkAccordion.AccordionHeader>;
8
16
  type AccordionTriggerProps = Omit<ComponentProps<typeof SdkAccordion.AccordionTrigger>, 'children'> & {
@@ -7,6 +7,7 @@ export { agentAvatarShapes } from './agent-avatar-glyphs.tsx';
7
7
  export type { AgentAppearance, AgentAvatarColor, AgentAvatarProps, AgentAvatarSize } from './agent-avatar.tsx';
8
8
  export { AgentAvatar, agentAppearance, agentAvatarColors } from './agent-avatar.tsx';
9
9
  export { CopyValue } from './copy-value.tsx';
10
+ export { RouteLink } from './route-link.tsx';
10
11
  export { Accordion, Collapsible } from './disclosure.tsx';
11
12
  export { Panel, SurfaceLink, Row, Stack, Columns, Divider } from './surfaces.tsx';
12
13
  export { SectionHeading } from './section-heading.tsx';
@@ -0,0 +1,11 @@
1
+ import type { PartProps } from '@ui-sdk/react/primitive';
2
+ import type { ComponentProps, ComponentType, ReactNode } from 'react';
3
+ type LinkOptions = {
4
+ readonly destination: string | undefined;
5
+ readonly current: ComponentProps<'a'>['aria-current'];
6
+ };
7
+ /** The anchor behind every Elements link. An agent reads its destination and whether it is current, and follows it. */
8
+ export declare const Link: ComponentType<Omit<PartProps<'a'>, 'id'> & LinkOptions>;
9
+ /** A native anchor for an application's routes. Without a destination it stays a plain anchor. */
10
+ export declare function RouteLink(props: ComponentProps<'a'>): ReactNode;
11
+ export {};
@@ -1,11 +1,13 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { CalendarDate } from './calendar.tsx';
3
3
  import type { CalendarMonth } from './civil.ts';
4
- export declare function DateInput({ label, value, minimum, maximum, onValueChange, }: {
4
+ /** A typed date on the UI SDK date input: one segment per unit in the locale's order, stepped with the arrow keys. */
5
+ export declare function DateInput({ label, value, minimum, maximum, locale, onValueChange, }: {
5
6
  readonly label: string;
6
7
  readonly value: CalendarDate | undefined;
7
8
  readonly minimum?: CalendarDate | undefined;
8
9
  readonly maximum?: CalendarDate | undefined;
10
+ readonly locale: string;
9
11
  readonly onValueChange: (value: CalendarDate | undefined) => void;
10
12
  }): ReactNode;
11
13
  export declare function MonthInput({ label, value, minimum, maximum, onValueChange, }: {
@@ -0,0 +1,15 @@
1
+ import { FileInput } from '@ui-sdk/react/file-input';
2
+ import type { ComponentProps, ReactNode } from 'react';
3
+ import type { ControlDensity } from '../../foundations/src/control-density.ts';
4
+ import type { PlacementStyle } from '../../foundations/src/style-composition.ts';
5
+ type SdkFileInputProps = ComponentProps<typeof FileInput>;
6
+ export type FilePickerProps = Omit<SdkFileInputProps, 'children' | 'className' | 'style' | 'render'> & {
7
+ readonly density?: ControlDensity;
8
+ readonly xstyle?: PlacementStyle;
9
+ };
10
+ /**
11
+ * Chooses files on the UI SDK file input: a button opens the picker, and the field also takes dropped and pasted files.
12
+ * It lists the chosen files with a remove action and says why a file was refused. It never uploads or reads.
13
+ */
14
+ export declare function FilePicker({ density, xstyle, multiple, onValueChange, onReject, ...props }: FilePickerProps): ReactNode;
15
+ export {};
@@ -1,4 +1,4 @@
1
- import { FieldControl as SdkFieldControl, FieldLabel as SdkFieldLabel, FieldLegend as SdkFieldLegend, FieldSet as SdkFieldSet } from '@ui-sdk/react/field';
1
+ import { FieldLabel as SdkFieldLabel, FieldLegend as SdkFieldLegend, FieldSet as SdkFieldSet } from '@ui-sdk/react/field';
2
2
  import { InputGroup as SdkInputGroup } from '@ui-sdk/react/input';
3
3
  import { NumberInputControl, NumberInputDecrement, NumberInputGroup, NumberInputIncrement, NumberInput as SdkNumberInput } from '@ui-sdk/react/number-input';
4
4
  import { Slider as SdkSlider, SliderControl as SdkSliderControl, SliderIndicator as SdkSliderIndicator, SliderThumb as SdkSliderThumb, SliderTrack as SdkSliderTrack, SliderValue as SdkSliderValue } from '@ui-sdk/react/slider';
@@ -38,10 +38,6 @@ type SliderIndicatorProps = ComponentProps<typeof SdkSliderIndicator>;
38
38
  type SliderThumbProps = ComponentProps<typeof SdkSliderThumb>;
39
39
  type SliderLabelProps = ComponentProps<typeof SdkFieldLabel>;
40
40
  type SliderValueProps = ComponentProps<typeof SdkSliderValue>;
41
- type FilePickerProps = Omit<ComponentProps<typeof SdkFieldControl>, 'type' | 'value' | 'defaultValue' | 'onValueChange'> & {
42
- readonly density?: ControlDensity;
43
- readonly xstyle?: PlacementStyle;
44
- };
45
41
  declare function FieldsetRoot({ className, style, xstyle, ...props }: FieldsetRootProps): ReactNode;
46
42
  declare function FieldsetLegend({ className, style, ...props }: FieldsetLegendProps): ReactNode;
47
43
  declare function InputGroupRoot({ density, className, style, xstyle, ...props }: InputGroupRootProps): ReactNode;
@@ -59,7 +55,6 @@ declare function SliderIndicator({ className, style, ...props }: SliderIndicator
59
55
  declare function SliderThumb({ className, style, ...props }: SliderThumbProps): ReactNode;
60
56
  declare function SliderLabel({ className, style, ...props }: SliderLabelProps): ReactNode;
61
57
  declare function SliderValue({ className, style, ...props }: SliderValueProps): ReactNode;
62
- export declare function FilePicker({ density, className, style, xstyle, ...props }: FilePickerProps): ReactNode;
63
58
  export declare const Fieldset: {
64
59
  Root: typeof FieldsetRoot;
65
60
  Legend: typeof FieldsetLegend;
@@ -1,4 +1,5 @@
1
1
  import { Field as SdkField, FieldDescription as SdkFieldDescription, FieldError as SdkFieldError, FieldLabel as SdkFieldLabel } from '@ui-sdk/react/field';
2
+ import { Input as SdkInput } from '@ui-sdk/react/input';
2
3
  import type { ComponentProps, ReactNode } from 'react';
3
4
  import type { ControlDensity } from '../../foundations/src/control-density.ts';
4
5
  import type { TextValueProperties } from '../../foundations/src/control-state.ts';
@@ -12,7 +13,9 @@ type FieldRootProps = ComponentProps<typeof SdkField> & {
12
13
  type FieldLabelProps = ComponentProps<typeof SdkFieldLabel>;
13
14
  type FieldDescriptionProps = ComponentProps<typeof SdkFieldDescription>;
14
15
  type FieldErrorProps = ComponentProps<typeof SdkFieldError>;
15
- type TextControlProps<Tag extends 'input' | 'textarea'> = Omit<ComponentProps<Tag>, 'value' | 'defaultValue' | 'onChange' | 'readOnly' | 'size' | 'onSelect' | 'onSubmit'> & TextValueProperties<string | number, NonNullable<ComponentProps<Tag>['onChange']>, (value: string) => void> & {
16
+ /** The new text, then the SDK's change details: the reason, the event and who caused it. */
17
+ type TextValueChange = NonNullable<ComponentProps<typeof SdkInput>['onValueChange']>;
18
+ type TextControlProps<Tag extends 'input' | 'textarea'> = Omit<ComponentProps<Tag>, 'value' | 'defaultValue' | 'onChange' | 'readOnly' | 'size' | 'onSelect' | 'onSubmit'> & TextValueProperties<string | number, NonNullable<ComponentProps<Tag>['onChange']>, TextValueChange> & {
16
19
  /** Keep credentials and other private text out of the UI SDK runtime. Password inputs always use this mode. */
17
20
  readonly isSensitive?: boolean;
18
21
  readonly xstyle?: PlacementStyle;
@@ -1,7 +1,9 @@
1
1
  export { Combobox } from './combobox.tsx';
2
2
  export type { AgentAvatarPickerProps } from './agent-avatar-picker.tsx';
3
3
  export { AgentAvatarPicker } from './agent-avatar-picker.tsx';
4
- export { FilePicker, Fieldset, InputGroup, NumberField, Slider } from './form-controls.tsx';
4
+ export { Fieldset, InputGroup, NumberField, Slider } from './form-controls.tsx';
5
+ export type { FilePickerProps } from './file-picker.tsx';
6
+ export { FilePicker } from './file-picker.tsx';
5
7
  export type { FormActionsProps } from './form-actions.tsx';
6
8
  export { FormActions } from './form-actions.tsx';
7
9
  export { FormStatus } from './form-status.tsx';
@@ -10,7 +12,7 @@ export { Field, Input, Textarea } from './forms.tsx';
10
12
  export { Select } from './select.tsx';
11
13
  export type { SelectControlProps, SelectOption } from './select-control.tsx';
12
14
  export { SelectControl } from './select-control.tsx';
13
- export { Checkbox, RadioGroup, Switch, ToggleGroup } from './selection.tsx';
15
+ export { Checkbox, RadioGroup, SegmentedControl, Switch, ToggleGroup } from './selection.tsx';
14
16
  export type { SettingsRowProps } from './settings-row.tsx';
15
17
  export { SettingsRow } from './settings-row.tsx';
16
18
  export type { SettingsSectionProps } from './settings-section.tsx';
@@ -1,5 +1,6 @@
1
1
  import { Checkbox as SdkCheckbox, CheckboxIndicator as SdkCheckboxIndicator } from '@ui-sdk/react/checkbox';
2
2
  import { Radio as SdkRadio, RadioGroup as SdkRadioGroup, RadioIndicator as SdkRadioIndicator } from '@ui-sdk/react/radio';
3
+ import { SegmentedControl as SdkSegmentedControl, SegmentedControlItem as SdkSegmentedControlItem } from '@ui-sdk/react/segmented-control';
3
4
  import { Switch as SdkSwitch, SwitchThumb as SdkSwitchThumb } from '@ui-sdk/react/switch';
4
5
  import { Toggle as SdkToggle, ToggleGroup as SdkToggleGroup } from '@ui-sdk/react/toggle';
5
6
  import type { ComponentProps, ReactNode } from 'react';
@@ -30,6 +31,12 @@ type ToggleGroupRootProps<Value extends string> = Omit<ComponentProps<typeof Sdk
30
31
  type ToggleItemProps<Value extends string> = Omit<ComponentProps<typeof SdkToggle>, 'value' | 'pressed' | 'defaultPressed' | 'onPressedChange'> & {
31
32
  readonly value: Value;
32
33
  };
34
+ type SegmentChange<Value extends string> = NonNullable<ComponentProps<typeof SdkSegmentedControl<Value>>['onValueChange']>;
35
+ type SegmentedControlRootProps<Value extends string> = Omit<ComponentProps<typeof SdkSegmentedControl<Value>>, 'value' | 'defaultValue' | 'onValueChange' | 'children'> & ValueStateProperties<Value, (value: Value, details: Parameters<SegmentChange<Value>>[1]) => void> & {
36
+ readonly children?: ReactNode;
37
+ readonly xstyle?: PlacementStyle;
38
+ };
39
+ type SegmentedControlItemProps = ComponentProps<typeof SdkSegmentedControlItem>;
33
40
  declare function CheckboxRoot({ className, style, xstyle, indeterminate, checked, defaultChecked, onCheckedChange, ...props }: CheckboxRootProps): ReactNode;
34
41
  declare function CheckboxIndicator({ children, className, style, ...props }: CheckboxIndicatorProps): ReactNode;
35
42
  declare function RadioGroupRoot<Value extends string>({ className, style, xstyle, onValueChange, ...props }: RadioGroupRootProps<Value>): ReactNode;
@@ -39,6 +46,9 @@ declare function SwitchRoot({ className, style, xstyle, ...props }: SwitchRootPr
39
46
  declare function SwitchThumb({ className, style, ...props }: SwitchThumbProps): ReactNode;
40
47
  declare function ToggleGroupRoot<Value extends string>({ className, style, xstyle, value, defaultValue, ...props }: ToggleGroupRootProps<Value>): ReactNode;
41
48
  declare function ToggleItem<Value extends string>({ className, style, ...props }: ToggleItemProps<Value>): ReactNode;
49
+ /** One choice from a short row, on the UI SDK segmented control: a radio group drawn as buttons, with one Tab stop. */
50
+ declare function SegmentedControlRoot<Value extends string>({ className, style, xstyle, children, onValueChange, ...props }: SegmentedControlRootProps<Value>): ReactNode;
51
+ declare function SegmentedControlItem({ className, style, ...props }: SegmentedControlItemProps): ReactNode;
42
52
  export declare const Checkbox: {
43
53
  Root: typeof CheckboxRoot;
44
54
  Indicator: typeof CheckboxIndicator;
@@ -56,4 +66,8 @@ export declare const ToggleGroup: {
56
66
  Root: typeof ToggleGroupRoot;
57
67
  Item: typeof ToggleItem;
58
68
  };
69
+ export declare const SegmentedControl: {
70
+ Root: typeof SegmentedControlRoot;
71
+ Item: typeof SegmentedControlItem;
72
+ };
59
73
  export {};
@@ -1,2 +1,7 @@
1
1
  export type ChartTone = 'series1' | 'series2' | 'series3' | 'series4' | 'series5' | 'series6' | 'positive' | 'negative' | 'neutral';
2
2
  export declare const chartToneColors: Readonly<Record<ChartTone, string>>;
3
+ /**
4
+ * The edge drawn around a filled mark: its tone mixed toward the ink color. A bar reads as a crisp box on a light
5
+ * surface and keeps a lighter rim on a dark one.
6
+ */
7
+ export declare const chartToneOutlines: Readonly<Record<ChartTone, string>>;
@@ -1,2 +1,2 @@
1
1
  export { CSPProvider } from './provider.tsx';
2
- export type { CSPProviderProps } from '@base-ui/react/csp-provider';
2
+ export type { CSPProviderProps } from './provider.tsx';
@@ -1,3 +1,8 @@
1
- import type { CSPProviderProps } from '@base-ui/react/csp-provider';
2
1
  import type { ReactNode } from 'react';
3
- export declare function CSPProvider({ children, nonce, ...props }: CSPProviderProps): ReactNode;
2
+ export type CSPProviderProps = {
3
+ /** The request nonce in the application's Content Security Policy. */
4
+ readonly nonce?: string | undefined;
5
+ readonly children?: ReactNode;
6
+ };
7
+ /** Gives UI SDK the policy's nonce through the `csp-nonce` meta tag, which it reads before adding its styles. */
8
+ export declare function CSPProvider({ children, nonce }: CSPProviderProps): ReactNode;
@@ -1,7 +1,7 @@
1
1
  export { Kbd, Breadcrumb } from './navigation.tsx';
2
2
  export type { PageNavigationItem, PageNavigationProps, PageNavigationPlaceholderProps } from './page-navigation.tsx';
3
3
  export { PageNavigation, PageNavigationPlaceholder } from './page-navigation.tsx';
4
- export { RouteLink } from './route-link.tsx';
4
+ export { RouteLink } from '../../core/src/index.ts';
5
5
  export { SkipLink } from './skip-link.tsx';
6
6
  export { Tabs } from './tabs.tsx';
7
7
  export { ContentTabs } from './content-tabs.tsx';
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./use-scroll-tab-index-Dxpdh4W7.js";
2
- import { n as t, r as n } from "./code-block-Cpfr7B6a.js";
2
+ import { n as t, r as n } from "./code-block-DioAM2bZ.js";
3
3
  import { t as r } from "./viewer-styles-DsFYri4K.js";
4
4
  import * as i from "@stylexjs/stylex";
5
5
  import { useCallback as a, useState as o } from "react";
@@ -0,0 +1,63 @@
1
+ import { t as e } from "./accessibility-P89UG9-r.js";
2
+ import { i as t, l as n, r, s as i } from "./chart-theme-4zprJ3rW.js";
3
+ import * as a from "@stylexjs/stylex";
4
+ import { useEffect as o, useId as s, useState as c } from "react";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ // packages/charts/src/chart-rows.tsx
7
+ function d({ title: r, items: o, view: c, children: d }) {
8
+ let f = s();
9
+ return c === void 0 ? d : /* @__PURE__ */ u(t, {
10
+ role: "group",
11
+ "aria-label": n({
12
+ title: r,
13
+ marks: "rows",
14
+ isSelectable: !0
15
+ }),
16
+ "aria-describedby": f,
17
+ className: "xeuugli x1t137rt x-default-marker",
18
+ children: [d, /* @__PURE__ */ l("span", {
19
+ id: f,
20
+ ...a.props(e.hidden),
21
+ children: i(o, c.inspected)
22
+ })]
23
+ });
24
+ }
25
+ function f({ id: e, label: t, view: n, children: i }) {
26
+ if (n === void 0) return /* @__PURE__ */ l("div", {
27
+ className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli x17tes2r x17oiadl x9f619 xh8yej3 xc342km x1hmw7ec x5g2kb4 x1hz01jw xtqrqnz xj57cvi x1778rvt x1yc453h xj0a0fe xbixft xpvm0e4 xss6m8b",
28
+ children: i
29
+ });
30
+ let a = n.selected === e;
31
+ return /* @__PURE__ */ l(r, {
32
+ value: e,
33
+ render: /* @__PURE__ */ l("button", {
34
+ type: "button",
35
+ tabIndex: -1,
36
+ "aria-label": t,
37
+ "aria-pressed": a
38
+ }),
39
+ ...{
40
+ 0: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli x17tes2r x17oiadl x9f619 xh8yej3 xc342km x1hmw7ec x5g2kb4 x1hz01jw xtqrqnz xj57cvi x1778rvt x1yc453h xj0a0fe xbixft xpvm0e4 xss6m8b x1ypdohk x1t137rt xif5pkx x1ecmtor" },
41
+ 2: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli x17tes2r x17oiadl x9f619 xh8yej3 xc342km x1hmw7ec x5g2kb4 x1hz01jw xtqrqnz xj57cvi x1778rvt x1yc453h xj0a0fe xbixft xss6m8b x1ypdohk x1t137rt xif5pkx x1ecmtor x1r7kqkb xh3r7i3" },
42
+ 1: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli x17tes2r x17oiadl x9f619 xh8yej3 xc342km x1hmw7ec x5g2kb4 x1hz01jw xtqrqnz xj57cvi x1778rvt x1yc453h xj0a0fe xbixft xpvm0e4 xss6m8b x1ypdohk xif5pkx x1ecmtor xx9gdjd x1x84bn5 x12ei19c x1t137rt xyevt74 x2ssjo2" },
43
+ 3: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli x17tes2r x17oiadl x9f619 xh8yej3 xc342km x1hmw7ec x5g2kb4 x1hz01jw xtqrqnz xj57cvi x1778rvt x1yc453h xj0a0fe xbixft xss6m8b x1ypdohk xif5pkx x1ecmtor x1r7kqkb xh3r7i3 xx9gdjd x1x84bn5 x12ei19c x1t137rt xyevt74 x2ssjo2" }
44
+ }[!!a << 1 | n.cursor === e],
45
+ children: i
46
+ });
47
+ }
48
+ // packages/charts/src/plot-width.ts
49
+ var p = 640;
50
+ function m() {
51
+ let [e, t] = c(null), [n, r] = c(p);
52
+ return o(() => {
53
+ if (e === null) return;
54
+ let t = new ResizeObserver(([e]) => {
55
+ e !== void 0 && e.contentRect.width > 0 && r(e.contentRect.width);
56
+ });
57
+ return t.observe(e), () => t.disconnect();
58
+ }, [e]), {
59
+ ref: t,
60
+ width: n
61
+ };
62
+ }
63
+ export { f as n, d as r, m as t };