@mechane-ai/elements 0.11.0 → 0.13.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 (69) hide show
  1. package/README.md +23 -4
  2. package/dist/ai.js +167 -141
  3. package/dist/{categorical-values-FYc43JCa.js → categorical-values-DwobbjBq.js} +2 -2
  4. package/dist/{chart-frame-Bczk5sWj.js → chart-frame-DAxsgMyl.js} +4 -4
  5. package/dist/{chart-input-CbzVN76m.js → chart-input-B0snxbMH.js} +2 -2
  6. package/dist/charts/cartesian.js +6 -6
  7. package/dist/charts/distribution.js +2 -2
  8. package/dist/charts/graph.js +3 -3
  9. package/dist/charts/hierarchy.js +3 -3
  10. package/dist/charts/matrix.js +2 -2
  11. package/dist/charts/timeline.js +4 -4
  12. package/dist/charts.js +1 -1
  13. package/dist/{code-block-B7xzM3tD.js → code-block-VwrOHz5j.js} +2 -2
  14. package/dist/collections.js +402 -267
  15. package/dist/content/code.js +1 -1
  16. package/dist/content/diff.js +3 -3
  17. package/dist/content/link.js +1 -1
  18. package/dist/content/markdown.js +2 -2
  19. package/dist/content/tree.js +2 -2
  20. package/dist/{content-link-CatGOrbo.js → content-link-Oj-MtNYi.js} +1 -1
  21. package/dist/content.js +3 -4
  22. package/dist/elements.css +141 -96
  23. package/dist/feedback.js +1 -1
  24. package/dist/forms/dates.js +22 -23
  25. package/dist/forms.js +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/layout.js +223 -237
  28. package/dist/navigation/commands.js +3 -3
  29. package/dist/navigation.js +26 -12
  30. package/dist/overlays.js +1 -1
  31. package/dist/packages/ai/src/index.d.ts +2 -2
  32. package/dist/packages/ai/src/prompt-input.d.ts +4 -0
  33. package/dist/packages/collections/src/collection-controls.d.ts +1 -1
  34. package/dist/packages/collections/src/data-table.d.ts +24 -6
  35. package/dist/packages/collections/src/index.d.ts +2 -2
  36. package/dist/packages/core/src/actions.d.ts +5 -8
  37. package/dist/packages/feedback/src/async-region.d.ts +15 -9
  38. package/dist/packages/feedback/src/control-placeholders.d.ts +21 -0
  39. package/dist/packages/feedback/src/index.d.ts +4 -3
  40. package/dist/packages/forms/src/field-styles.d.ts +2 -74
  41. package/dist/packages/forms/src/form-actions.d.ts +11 -0
  42. package/dist/packages/forms/src/form-controls.d.ts +1 -1
  43. package/dist/packages/forms/src/forms.d.ts +3 -3
  44. package/dist/packages/forms/src/index.d.ts +2 -0
  45. package/dist/packages/forms/src/select.d.ts +2 -2
  46. package/dist/packages/forms/src/selection-styles.d.ts +0 -13
  47. package/dist/packages/foundations/src/control-styles.d.ts +122 -0
  48. package/dist/packages/foundations/src/style-composition.d.ts +0 -2
  49. package/dist/packages/foundations/src/tokens.stylex.d.ts +13 -2
  50. package/dist/packages/layout/src/frame.stylex.d.ts +0 -1
  51. package/dist/packages/layout/src/index.d.ts +2 -0
  52. package/dist/packages/layout/src/page-content.d.ts +5 -0
  53. package/dist/packages/layout/src/page-toolbar.d.ts +1 -1
  54. package/dist/packages/layout/src/sidebar.d.ts +3 -3
  55. package/dist/packages/navigation/src/index.d.ts +2 -2
  56. package/dist/packages/navigation/src/page-navigation.d.ts +5 -0
  57. package/dist/{pierre-diff--zsiHCCB.js → pierre-diff-sUAU-xeL.js} +1 -1
  58. package/dist/{pierre-theme-D9hnHv3Z.js → pierre-theme-CBAncKdH.js} +1 -1
  59. package/dist/{pierre-tree-D47uA7lb.js → pierre-tree-Db1yaDM2.js} +3 -3
  60. package/dist/src-B0UTwpOz.js +1003 -0
  61. package/dist/{src-D05isEh_.js → src-BNlyCwOr.js} +141 -69
  62. package/dist/{src-Cs0dRc4X.js → src-CVlgjAlw.js} +1 -1
  63. package/dist/src-DMsnWyru.js +1184 -0
  64. package/dist/tokens.js +18 -8
  65. package/package.json +1 -1
  66. package/packages/foundations/src/tokens.stylex.ts +15 -5
  67. package/dist/packages/feedback/src/loading.d.ts +0 -7
  68. package/dist/src-C_heP5kL.js +0 -1264
  69. package/dist/src-DXsGTJgv.js +0 -969
@@ -0,0 +1,122 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ export declare const controlStyles: Readonly<{
3
+ readonly base: Readonly<{
4
+ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
5
+ readonly minHeight: stylex.StyleXClassNameFor<"minHeight", string>;
6
+ readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", string>;
7
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
8
+ readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 1>;
9
+ readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "solid">;
10
+ readonly borderColor: stylex.StyleXClassNameFor<"borderColor", string>;
11
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
12
+ readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
13
+ readonly WebkitFontSmoothing: stylex.StyleXClassNameFor<"WebkitFontSmoothing", "antialiased">;
14
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
15
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
16
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
17
+ }>;
18
+ readonly button: Readonly<{
19
+ readonly display: stylex.StyleXClassNameFor<"display", "inline-flex">;
20
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
21
+ readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "center">;
22
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
23
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
24
+ readonly maxWidth: stylex.StyleXClassNameFor<"maxWidth", "100%">;
25
+ readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
26
+ readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "center">;
27
+ }>;
28
+ readonly iconButton: Readonly<{
29
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", string>;
30
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 0>;
31
+ }>;
32
+ readonly field: Readonly<{
33
+ readonly display: stylex.StyleXClassNameFor<"display", "block">;
34
+ readonly width: stylex.StyleXClassNameFor<"width", "100%">;
35
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
36
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
37
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
38
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
39
+ }>;
40
+ readonly fieldRoot: Readonly<{
41
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
42
+ readonly flexDirection: stylex.StyleXClassNameFor<"flexDirection", "column">;
43
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
44
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
45
+ readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
46
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
47
+ readonly WebkitFontSmoothing: stylex.StyleXClassNameFor<"WebkitFontSmoothing", "antialiased">;
48
+ }>;
49
+ readonly label: Readonly<{
50
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
51
+ readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
52
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
53
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
54
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
55
+ readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
56
+ }>;
57
+ readonly description: Readonly<{
58
+ readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
59
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
60
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
61
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
62
+ readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
63
+ }>;
64
+ readonly textarea: Readonly<{
65
+ readonly minHeight: stylex.StyleXClassNameFor<"minHeight", 144>;
66
+ readonly resize: stylex.StyleXClassNameFor<"resize", "vertical">;
67
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
68
+ }>;
69
+ readonly plainTextarea: Readonly<{
70
+ readonly minHeight: stylex.StyleXClassNameFor<"minHeight", string>;
71
+ readonly maxHeight: stylex.StyleXClassNameFor<"maxHeight", "30dvh">;
72
+ readonly fieldSizing: stylex.StyleXClassNameFor<"fieldSizing", "content">;
73
+ readonly resize: stylex.StyleXClassNameFor<"resize", "none">;
74
+ readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
75
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 0>;
76
+ readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 0>;
77
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 0>;
78
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent">;
79
+ readonly ':focus-visible': stylex.StyleXClassNameFor<":focus-visible", {
80
+ readonly outlineStyle: "none";
81
+ }>;
82
+ readonly ':disabled': stylex.StyleXClassNameFor<":disabled", {
83
+ readonly backgroundColor: "transparent";
84
+ }>;
85
+ }>;
86
+ readonly group: Readonly<{
87
+ readonly position: stylex.StyleXClassNameFor<"position", "relative">;
88
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
89
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "stretch">;
90
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
91
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
92
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
93
+ readonly '::after': stylex.StyleXClassNameFor<"::after", {
94
+ readonly content: "\"\"";
95
+ readonly position: "absolute";
96
+ readonly inset: 0;
97
+ readonly pointerEvents: "none";
98
+ readonly borderWidth: 1;
99
+ readonly borderStyle: "solid";
100
+ readonly borderColor: stylex.StyleXVar<string>;
101
+ readonly borderRadius: stylex.StyleXVar<string>;
102
+ }>;
103
+ readonly ':has(input[aria-invalid="true"])': stylex.StyleXClassNameFor<":has(input[aria-invalid=\"true\"])", {
104
+ readonly '::after': {
105
+ borderColor: stylex.StyleXVar<string>;
106
+ };
107
+ }>;
108
+ }>;
109
+ readonly embedded: Readonly<{
110
+ readonly flex: stylex.StyleXClassNameFor<"flex", 1>;
111
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
112
+ readonly width: stylex.StyleXClassNameFor<"width", 0>;
113
+ readonly borderColor: stylex.StyleXClassNameFor<"borderColor", "transparent">;
114
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent">;
115
+ readonly ':is([data-invalid], [aria-invalid="true"])': stylex.StyleXClassNameFor<":is([data-invalid], [aria-invalid=\"true\"])", {
116
+ readonly borderColor: "transparent";
117
+ }>;
118
+ readonly ':focus-visible': stylex.StyleXClassNameFor<":focus-visible", {
119
+ readonly outlineOffset: `calc(0px - ${stylex.StyleXVar<string>})`;
120
+ }>;
121
+ }>;
122
+ }>;
@@ -1,12 +1,10 @@
1
1
  import type { StyleXStyles } from '@stylexjs/stylex';
2
2
  import type { CSSProperties } from 'react';
3
3
  type PlacementProperties = Pick<CSSProperties, 'alignSelf' | 'flex' | 'flexGrow' | 'flexShrink' | 'gridArea' | 'gridColumn' | 'gridRow' | 'margin' | 'marginBlock' | 'marginInline' | 'marginBlockStart' | 'marginBlockEnd' | 'marginInlineStart' | 'marginInlineEnd' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'width' | 'maxWidth' | 'minWidth'>;
4
- type ControlGeometry = Pick<CSSProperties, 'height' | 'minHeight' | 'maxHeight' | 'padding' | 'paddingBlock' | 'paddingInline' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'borderRadius' | 'justifyContent' | 'alignItems' | 'gap'>;
5
4
  type DefinedProperties<Properties> = {
6
5
  readonly [Key in keyof Properties]?: Exclude<Properties[Key], undefined>;
7
6
  };
8
7
  export type PlacementStyle = StyleXStyles<DefinedProperties<PlacementProperties>>;
9
- export type ControlStyle = StyleXStyles<DefinedProperties<PlacementProperties & ControlGeometry>>;
10
8
  type StyleProperties<State> = {
11
9
  readonly className?: string | ((state: State) => string | undefined) | undefined;
12
10
  readonly style?: CSSProperties | ((state: State) => CSSProperties | undefined) | undefined;
@@ -158,8 +158,7 @@ export declare const typography: stylex.VarGroup<Readonly<{
158
158
  headingTracking: string;
159
159
  }>, symbol>;
160
160
  export declare const controls: stylex.VarGroup<Readonly<{
161
- smHeight: string;
162
- mdHeight: string;
161
+ height: string;
163
162
  coarseTarget: string;
164
163
  iconSize: string;
165
164
  paddingInline: string;
@@ -168,6 +167,11 @@ export declare const controls: stylex.VarGroup<Readonly<{
168
167
  focusWidth: string;
169
168
  disabledOpacity: string;
170
169
  }>, symbol>;
170
+ export declare const pageGeometry: stylex.VarGroup<Readonly<{
171
+ inset: string;
172
+ toolbarHeight: string;
173
+ sectionGap: string;
174
+ }>, symbol>;
171
175
  export declare const radii: stylex.VarGroup<Readonly<{
172
176
  sm: string;
173
177
  md: string;
@@ -178,13 +182,20 @@ export declare const motion: stylex.VarGroup<Readonly<{
178
182
  drawerDuration: string;
179
183
  drawerEasing: string;
180
184
  }>, symbol>;
185
+ export declare const loading: {
186
+ delaySeconds: number;
187
+ revealMs: number;
188
+ placeholderMs: number;
189
+ };
181
190
  export declare const shadows: stylex.VarGroup<Readonly<{
182
191
  popup: string;
192
+ selection: string;
183
193
  }>, symbol>;
184
194
  export declare const darkShadows: {
185
195
  popup: string;
186
196
  };
187
197
  export declare const layers: {
198
+ sticky: string;
188
199
  backdrop: string;
189
200
  dialog: string;
190
201
  popup: string;
@@ -1,7 +1,6 @@
1
1
  import * as stylex from '@stylexjs/stylex';
2
2
  export declare const frame: stylex.VarGroup<Readonly<{
3
3
  sidebarWidth: string;
4
- toolbarHeight: string;
5
4
  navigationHeight: string;
6
5
  navigationInset: string;
7
6
  navigationPadding: string;
@@ -4,6 +4,8 @@ export { FocusPage } from './focus-page.tsx';
4
4
  export { Workbench, WorkbenchScroll, WorkbenchFooter } from './workbench.tsx';
5
5
  export { ViewStack } from './view-stack.tsx';
6
6
  export { PageToolbar, ToolbarAction } from './page-toolbar.tsx';
7
+ export type { PageContentProps } from './page-content.tsx';
8
+ export { PageContent } from './page-content.tsx';
7
9
  export type { RecordPageRootProps, RecordPageToolbarProps, RecordPageBodyProps, RecordPageHeaderProps, RecordPageContentProps, RecordPageAsideProps, } from './record-page.tsx';
8
10
  export { RecordPage } from './record-page.tsx';
9
11
  export type { ResizableRootProps, ResizablePaneProps, ResizableHandleProps } from './resizable.tsx';
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from 'react';
2
+ export type PageContentProps = {
3
+ readonly children: ReactNode;
4
+ };
5
+ export declare function PageContent({ children }: PageContentProps): ReactNode;
@@ -8,7 +8,7 @@ type PageToolbarProps = {
8
8
  readonly views?: ReactNode;
9
9
  readonly leading?: ReactNode;
10
10
  };
11
- type ToolbarActionProps = Omit<ComponentProps<typeof Button>, 'variant' | 'size' | 'xstyle'> & {
11
+ type ToolbarActionProps = Omit<ComponentProps<typeof Button>, 'variant' | 'xstyle'> & {
12
12
  readonly icon?: ReactNode;
13
13
  };
14
14
  export declare function PageToolbar({ title, actions, breadcrumb, navigation, views, leading, }: PageToolbarProps): ReactNode;
@@ -1,5 +1,5 @@
1
+ import { Button as BaseButton } from '@base-ui/react/button';
1
2
  import type { ComponentProps, ReactNode, RefObject } from 'react';
2
- import { Button } from '../../core/src/index.ts';
3
3
  import { Drawer } from '../../overlays/src/index.ts';
4
4
  type SidebarState = {
5
5
  readonly isExpanded: boolean;
@@ -21,7 +21,7 @@ type NavigationProps = {
21
21
  readonly children: ReactNode;
22
22
  readonly label?: string;
23
23
  };
24
- type NavigationItemProps = Omit<ComponentProps<typeof Button>, 'variant' | 'tone' | 'size' | 'xstyle'> & {
24
+ type NavigationItemProps = ComponentProps<typeof BaseButton> & {
25
25
  readonly icon?: ReactNode;
26
26
  readonly selected?: boolean;
27
27
  };
@@ -45,7 +45,7 @@ export declare function NavigationSection({ children, label, }: {
45
45
  readonly children: ReactNode;
46
46
  readonly label: string;
47
47
  }): ReactNode;
48
- export declare function NavigationItem({ children, icon, selected, onClick, ...props }: NavigationItemProps): ReactNode;
48
+ export declare function NavigationItem({ children, icon, selected, onClick, className, style, ...props }: NavigationItemProps): ReactNode;
49
49
  export declare function NavigationLink({ children, icon, selected, onClick, className, style, ...props }: NavigationLinkProps): ReactNode;
50
50
  export declare function SidebarLabel({ children, grow }: SidebarLabelProps): ReactNode;
51
51
  export declare function SidebarFooter({ children, layout }: SidebarFooterProps): ReactNode;
@@ -1,5 +1,5 @@
1
1
  export { Kbd, Breadcrumb } from './navigation.tsx';
2
- export type { PageNavigationItem, PageNavigationProps } from './page-navigation.tsx';
3
- export { PageNavigation } from './page-navigation.tsx';
2
+ export type { PageNavigationItem, PageNavigationProps, PageNavigationPlaceholderProps } from './page-navigation.tsx';
3
+ export { PageNavigation, PageNavigationPlaceholder } from './page-navigation.tsx';
4
4
  export { SkipLink } from './skip-link.tsx';
5
5
  export { Tabs } from './tabs.tsx';
@@ -11,4 +11,9 @@ export type PageNavigationProps<ItemId extends string = string> = {
11
11
  readonly label?: string;
12
12
  readonly embedded?: boolean;
13
13
  };
14
+ export type PageNavigationPlaceholderProps = {
15
+ readonly items: ReadonlyArray<Pick<PageNavigationItem, 'id' | 'label'>>;
16
+ readonly embedded?: boolean;
17
+ };
18
+ export declare function PageNavigationPlaceholder({ items, embedded }: PageNavigationPlaceholderProps): ReactNode;
14
19
  export declare function PageNavigation<ItemId extends string>({ items, selectedId, onNavigate, label, embedded, }: PageNavigationProps<ItemId>): ReactNode;
@@ -1,4 +1,4 @@
1
- import { n as e, t } from "./pierre-theme-D9hnHv3Z.js";
1
+ import { n as e, t } from "./pierre-theme-CBAncKdH.js";
2
2
  import { t as n } from "./viewer-styles-CpHqp5Qv.js";
3
3
  import * as r from "@stylexjs/stylex";
4
4
  import { useCallback as i, useState as a } from "react";
@@ -62,7 +62,7 @@ var o = {
62
62
  pre { font-family: ${a.monoFamily}; font-size: ${a.captionSize}; line-height: ${a.bodyLineHeight}; }
63
63
  [data-line-number] { color: ${e.muted}; }
64
64
  [data-diffs-header] {
65
- min-height: ${n.mdHeight};
65
+ min-height: ${n.height};
66
66
  padding-block: ${r.sm};
67
67
  padding-inline: ${r.md};
68
68
  border-bottom: 1px solid ${e.line};
@@ -1,7 +1,7 @@
1
- import { c as e } from "./src-D05isEh_.js";
2
- import { l as t } from "./src-C_heP5kL.js";
1
+ import { c as e } from "./src-BNlyCwOr.js";
2
+ import { l as t } from "./src-DMsnWyru.js";
3
3
  import { conditions as n } from "./tokens.js";
4
- import { r } from "./pierre-theme-D9hnHv3Z.js";
4
+ import { r } from "./pierre-theme-CBAncKdH.js";
5
5
  import * as i from "@stylexjs/stylex";
6
6
  import { useEffect as a, useId as o, useRef as s, useState as c } from "react";
7
7
  import { jsx as l, jsxs as u } from "react/jsx-runtime";