@mechane-ai/elements 0.33.0 → 0.35.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 (35) hide show
  1. package/README.md +3 -1
  2. package/dist/ai.js +2 -2
  3. package/dist/{categorical-values-bWZBzMpX.js → categorical-values-DpnNvPkc.js} +2 -2
  4. package/dist/{chart-frame-Cr4P6MF5.js → chart-frame-BV0IPZtQ.js} +1 -1
  5. package/dist/{chart-input-3wX0JoPE.js → chart-input-CN8PMrni.js} +2 -2
  6. package/dist/charts/cartesian.js +539 -565
  7. package/dist/charts/distribution.js +2 -2
  8. package/dist/charts/graph.js +2 -2
  9. package/dist/charts/hierarchy.js +3 -3
  10. package/dist/charts/matrix.js +2 -2
  11. package/dist/charts/timeline.js +2 -2
  12. package/dist/charts.js +1 -1
  13. package/dist/collections.js +2 -2
  14. package/dist/content/tree.js +1 -1
  15. package/dist/elements.css +28 -0
  16. package/dist/feedback.js +1 -1
  17. package/dist/forms/dates.js +519 -73
  18. package/dist/forms-BQQFas9g.js +118 -0
  19. package/dist/forms.js +3 -1
  20. package/dist/navigation/commands.js +1 -1
  21. package/dist/packages/charts/src/chart-data.d.ts +1 -2
  22. package/dist/packages/forms/src/dates/calendar.d.ts +2 -5
  23. package/dist/packages/forms/src/dates/civil.d.ts +28 -0
  24. package/dist/packages/forms/src/dates/date-inputs.d.ts +20 -0
  25. package/dist/packages/forms/src/dates/date-picker.d.ts +13 -0
  26. package/dist/packages/forms/src/dates/date-range-picker.d.ts +14 -12
  27. package/dist/packages/forms/src/dates/index.d.ts +8 -0
  28. package/dist/packages/forms/src/dates/month-calendar.d.ts +19 -0
  29. package/dist/packages/forms/src/dates/month-picker.d.ts +14 -0
  30. package/dist/packages/forms/src/dates/month-range-picker.d.ts +18 -0
  31. package/dist/packages/forms/src/dates/picker-popover.d.ts +22 -0
  32. package/dist/{pierre-tree-Dd5Vd79M.js → pierre-tree-CYCRjdGG.js} +1 -1
  33. package/dist/{src-BOZsJ8td.js → src-BHllGfI8.js} +4 -4
  34. package/dist/{src-CD6veX7n.js → src-BYKjPC-0.js} +278 -387
  35. package/package.json +1 -1
@@ -0,0 +1,118 @@
1
+ import { A as e, N as t, j as n } from "./src-C-Sx37kz.js";
2
+ import { t as r } from "./style-composition-uYlczSsB.js";
3
+ import * as i from "@stylexjs/stylex";
4
+ import { jsx as a } from "react/jsx-runtime";
5
+ import { Input as o } from "@base-ui/react/input";
6
+ import { Field as s } from "@base-ui/react/field";
7
+ // packages/forms/src/field-styles.ts
8
+ var c = {
9
+ error: {
10
+ kMwMTN: "xr5kp14",
11
+ kGuDYH: "xy8obcc",
12
+ kLWn49: "xas2l8k",
13
+ kHjlTd: "xj0a0fe",
14
+ $$css: !0
15
+ },
16
+ input: {
17
+ kPJHz1: "x13qnu6",
18
+ k7shQP: "x9v5kkp",
19
+ kZs9gx: "x19rmrnh",
20
+ kiEn40: "x13iak60",
21
+ kr7hW5: "x76gt29",
22
+ kWC4TW: "x19mxcj1",
23
+ kD2jPA: "x19kzkq0",
24
+ kYPGJ8: "x1s07b3s",
25
+ k8Qsv1: "xz7023x",
26
+ $$css: !0
27
+ },
28
+ compactTextarea: {
29
+ kAzted: "xseoqlg",
30
+ kskxy: "x1y3glee",
31
+ $$css: !0
32
+ },
33
+ growingTextarea: {
34
+ kAzted: "x2lwn1j",
35
+ kskxy: "xp8lc2p",
36
+ kOwNse: "x5f5z56",
37
+ kHenm0: "xtt52l0",
38
+ $$css: !0
39
+ }
40
+ }, l = {
41
+ field: { field: { $$css: !0 } }.field,
42
+ plain: n.plainTextarea
43
+ };
44
+ // packages/forms/src/forms.tsx
45
+ function u({ className: e, style: t, xstyle: o, ...c }) {
46
+ return /* @__PURE__ */ a(s.Root, {
47
+ ...c,
48
+ ...r({
49
+ className: e,
50
+ style: t,
51
+ styles: i.props(n.fieldRoot, o)
52
+ })
53
+ });
54
+ }
55
+ function d({ className: e, style: t, ...o }) {
56
+ return /* @__PURE__ */ a(s.Label, {
57
+ ...o,
58
+ ...r({
59
+ className: e,
60
+ style: t,
61
+ styles: i.props(n.label)
62
+ })
63
+ });
64
+ }
65
+ function f({ className: e, style: t, ...o }) {
66
+ return /* @__PURE__ */ a(s.Description, {
67
+ ...o,
68
+ ...r({
69
+ className: e,
70
+ style: t,
71
+ styles: i.props(n.description)
72
+ })
73
+ });
74
+ }
75
+ function p({ className: e, style: t, ...n }) {
76
+ return /* @__PURE__ */ a(s.Error, {
77
+ ...n,
78
+ ...r({
79
+ className: e,
80
+ style: t,
81
+ styles: i.props(c.error)
82
+ })
83
+ });
84
+ }
85
+ var m = {
86
+ Root: u,
87
+ Label: d,
88
+ Description: f,
89
+ Error: p
90
+ };
91
+ function h({ density: s = "standard", className: l, style: u, xstyle: d, ...f }) {
92
+ return /* @__PURE__ */ a(o, {
93
+ ...f,
94
+ ...r({
95
+ className: l,
96
+ style: u,
97
+ styles: i.props(n.base, n.field, n.singleLineField, c.input, e[s], t[s], d)
98
+ })
99
+ });
100
+ }
101
+ function g({ isCompact: e = !1, shouldGrow: t = !1, appearance: o = "field", value: u, defaultValue: d, onValueChange: f, name: p, disabled: m, readOnly: h, required: g, className: _, style: v, xstyle: y, ...b }) {
102
+ return /* @__PURE__ */ a(s.Control, {
103
+ value: u,
104
+ defaultValue: d,
105
+ onValueChange: f,
106
+ name: p,
107
+ disabled: m,
108
+ readOnly: h,
109
+ required: g,
110
+ render: /* @__PURE__ */ a("textarea", { ...b }),
111
+ ...r({
112
+ className: _,
113
+ style: v,
114
+ styles: i.props(n.base, n.field, c.input, n.textarea, e && c.compactTextarea, t && c.growingTextarea, l[o], y)
115
+ })
116
+ });
117
+ }
118
+ export { c as i, h as n, g as r, m as t };
package/dist/forms.js CHANGED
@@ -1 +1,3 @@
1
- export { _ as AgentAvatarPicker, r as Checkbox, v as Combobox, c as Field, f as Fieldset, p as FilePicker, d as FormActions, l as Input, m as InputGroup, h as NumberField, i as RadioGroup, s as Select, n as SettingsRow, t as SettingsSection, g as Slider, a as Switch, u as Textarea, o as ToggleGroup } from "./src-CD6veX7n.js";
1
+ import { n as e, r as t, t as n } from "./forms-BQQFas9g.js";
2
+ import { a as r, c as i, d as a, f as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _ } from "./src-BYKjPC-0.js";
3
+ export { u as AgentAvatarPicker, m as Checkbox, s as Combobox, n as Field, l as Fieldset, _ as FilePicker, i as FormActions, e as Input, a as InputGroup, o as NumberField, c as RadioGroup, h as Select, d as SettingsRow, g as SettingsSection, p as Slider, r as Switch, t as Textarea, f as ToggleGroup };
@@ -1,4 +1,4 @@
1
- import { l as e } from "../src-CD6veX7n.js";
1
+ import { n as e } from "../forms-BQQFas9g.js";
2
2
  import { s as t } from "../src-d7EAi61b.js";
3
3
  import { n } from "../navigation-D2_sGy3C.js";
4
4
  import "@stylexjs/stylex";
@@ -1,5 +1,4 @@
1
1
  import type { ReactNode } from 'react';
2
- export declare function ChartData({ title, children }: {
3
- readonly title: string;
2
+ export declare function ChartData({ children }: {
4
3
  readonly children: ReactNode;
5
4
  }): ReactNode;
@@ -1,9 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
- export type CalendarDate = {
3
- readonly year: number;
4
- readonly month: number;
5
- readonly day: number;
6
- };
2
+ import type { CalendarDate } from './civil.ts';
3
+ export type { CalendarDate } from './civil.ts';
7
4
  export type CalendarRange = {
8
5
  readonly from: CalendarDate;
9
6
  readonly to?: CalendarDate | undefined;
@@ -0,0 +1,28 @@
1
+ export type CalendarDate = {
2
+ readonly year: number;
3
+ readonly month: number;
4
+ readonly day: number;
5
+ };
6
+ export type CalendarMonth = {
7
+ readonly year: number;
8
+ readonly month: number;
9
+ };
10
+ export type DateRange = {
11
+ readonly from: CalendarDate;
12
+ readonly to: CalendarDate;
13
+ };
14
+ export type MonthRange = {
15
+ readonly from: CalendarMonth;
16
+ readonly to: CalendarMonth;
17
+ };
18
+ export declare function isMonth(value: CalendarMonth): boolean;
19
+ export declare function isDate(value: CalendarDate): boolean;
20
+ export declare function monthOrder(value: CalendarMonth): number;
21
+ export declare function dateInput(value: CalendarDate): string;
22
+ export declare function monthInput(value: CalendarMonth): string;
23
+ export declare function parseDate(value: string): CalendarDate | undefined;
24
+ export declare function parseMonth(value: string): CalendarMonth | undefined;
25
+ export declare function formatDate(value: CalendarDate, locale: string): string;
26
+ export declare function formatMonth(value: CalendarMonth, locale: string): string;
27
+ export declare function dateValidation(value: CalendarDate, minimum?: CalendarDate, maximum?: CalendarDate): string | undefined;
28
+ export declare function monthValidation(value: CalendarMonth, minimum?: CalendarMonth, maximum?: CalendarMonth): string | undefined;
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { CalendarDate } from './calendar.tsx';
3
+ import type { CalendarMonth } from './civil.ts';
4
+ export declare function DateInput({ label, value, minimum, maximum, onValueChange, }: {
5
+ readonly label: string;
6
+ readonly value: CalendarDate | undefined;
7
+ readonly minimum?: CalendarDate | undefined;
8
+ readonly maximum?: CalendarDate | undefined;
9
+ readonly onValueChange: (value: CalendarDate | undefined) => void;
10
+ }): ReactNode;
11
+ export declare function MonthInput({ label, value, minimum, maximum, onValueChange, }: {
12
+ readonly label: string;
13
+ readonly value: CalendarMonth | undefined;
14
+ readonly minimum?: CalendarMonth | undefined;
15
+ readonly maximum?: CalendarMonth | undefined;
16
+ readonly onValueChange: (value: CalendarMonth | undefined) => void;
17
+ }): ReactNode;
18
+ export declare function RangeInputs({ children }: {
19
+ readonly children: ReactNode;
20
+ }): ReactNode;
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ControlDensity } from '../../../foundations/src/control-density.ts';
3
+ import type { CalendarDate, CalendarEnvironment } from './calendar.tsx';
4
+ export type DatePickerProps = CalendarEnvironment & {
5
+ readonly label: string;
6
+ readonly value: CalendarDate | undefined;
7
+ readonly onValueChange: (value: CalendarDate | undefined) => void;
8
+ readonly formatValue?: (value: CalendarDate) => string;
9
+ readonly density?: ControlDensity;
10
+ readonly disabled?: boolean;
11
+ readonly isClearable?: boolean;
12
+ };
13
+ export declare function DatePicker({ label, value, onValueChange, formatValue, density, disabled, isClearable, ...environment }: DatePickerProps): ReactNode;
@@ -1,16 +1,18 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { CalendarEnvironment, CalendarRange } from './calendar.tsx';
3
- export type DateRangePreset = {
4
- readonly id: string;
2
+ import type { ControlDensity } from '../../../foundations/src/control-density.ts';
3
+ import type { CalendarEnvironment } from './calendar.tsx';
4
+ import type { DateRange } from './civil.ts';
5
+ import type { PickerPreset } from './picker-popover.tsx';
6
+ export type DateRangePreset = PickerPreset<DateRange>;
7
+ export type DateRangePickerProps = CalendarEnvironment & {
5
8
  readonly label: string;
6
- readonly value: CalendarRange;
7
- };
8
- export type DateRangePickerProps = {
9
- readonly label: string;
10
- readonly value: CalendarRange | undefined;
11
- readonly onValueChange: (value: CalendarRange | undefined) => void;
12
- readonly formatValue: (value: CalendarRange) => string;
9
+ readonly value: DateRange | undefined;
10
+ readonly onValueChange: (value: DateRange | undefined) => void;
11
+ readonly formatValue?: (value: DateRange) => string;
13
12
  readonly presets?: ReadonlyArray<DateRangePreset>;
13
+ readonly validateRange?: (value: DateRange) => string | undefined;
14
+ readonly density?: ControlDensity;
14
15
  readonly disabled?: boolean;
15
- } & CalendarEnvironment;
16
- export declare function DateRangePicker({ label, value, onValueChange, formatValue, presets, disabled, ...environment }: DateRangePickerProps): ReactNode;
16
+ readonly isClearable?: boolean;
17
+ };
18
+ export declare function DateRangePicker({ label, value, onValueChange, formatValue, presets, validateRange, density, disabled, isClearable, ...environment }: DateRangePickerProps): ReactNode;
@@ -1,4 +1,12 @@
1
1
  export type { CalendarDate, CalendarRange, CalendarEnvironment, CalendarProps } from './calendar.tsx';
2
2
  export { Calendar } from './calendar.tsx';
3
+ export type { CalendarMonth, DateRange, MonthRange } from './civil.ts';
4
+ export type { DatePickerProps } from './date-picker.tsx';
5
+ export { DatePicker } from './date-picker.tsx';
3
6
  export type { DateRangePreset, DateRangePickerProps } from './date-range-picker.tsx';
4
7
  export { DateRangePicker } from './date-range-picker.tsx';
8
+ export type { MonthEnvironment } from './month-calendar.tsx';
9
+ export type { MonthPickerProps } from './month-picker.tsx';
10
+ export { MonthPicker } from './month-picker.tsx';
11
+ export type { MonthRangePickerProps, MonthRangePreset } from './month-range-picker.tsx';
12
+ export { MonthRangePicker } from './month-range-picker.tsx';
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { CalendarMonth } from './civil.ts';
3
+ export type MonthEnvironment = {
4
+ readonly locale: string;
5
+ readonly timeZone: string;
6
+ readonly today: CalendarMonth;
7
+ readonly initialMonth: CalendarMonth;
8
+ readonly minimum?: CalendarMonth;
9
+ readonly maximum?: CalendarMonth;
10
+ };
11
+ export type MonthDraft = {
12
+ readonly from: CalendarMonth;
13
+ readonly to?: CalendarMonth | undefined;
14
+ };
15
+ export declare function MonthCalendar({ label, selection, onSelect, locale, today, initialMonth, minimum, maximum, }: MonthEnvironment & {
16
+ readonly label: string;
17
+ readonly selection: MonthDraft | undefined;
18
+ readonly onSelect: (value: CalendarMonth) => void;
19
+ }): ReactNode;
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ControlDensity } from '../../../foundations/src/control-density.ts';
3
+ import type { CalendarMonth } from './civil.ts';
4
+ import type { MonthEnvironment } from './month-calendar.tsx';
5
+ export type MonthPickerProps = MonthEnvironment & {
6
+ readonly label: string;
7
+ readonly value: CalendarMonth | undefined;
8
+ readonly onValueChange: (value: CalendarMonth | undefined) => void;
9
+ readonly formatValue?: (value: CalendarMonth) => string;
10
+ readonly density?: ControlDensity;
11
+ readonly disabled?: boolean;
12
+ readonly isClearable?: boolean;
13
+ };
14
+ export declare function MonthPicker({ label, value, onValueChange, formatValue, density, disabled, isClearable, ...environment }: MonthPickerProps): ReactNode;
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ControlDensity } from '../../../foundations/src/control-density.ts';
3
+ import type { MonthRange } from './civil.ts';
4
+ import type { MonthEnvironment } from './month-calendar.tsx';
5
+ import type { PickerPreset } from './picker-popover.tsx';
6
+ export type MonthRangePreset = PickerPreset<MonthRange>;
7
+ export type MonthRangePickerProps = MonthEnvironment & {
8
+ readonly label: string;
9
+ readonly value: MonthRange | undefined;
10
+ readonly onValueChange: (value: MonthRange | undefined) => void;
11
+ readonly formatValue?: (value: MonthRange) => string;
12
+ readonly presets?: ReadonlyArray<MonthRangePreset>;
13
+ readonly validateRange?: (value: MonthRange) => string | undefined;
14
+ readonly density?: ControlDensity;
15
+ readonly disabled?: boolean;
16
+ readonly isClearable?: boolean;
17
+ };
18
+ export declare function MonthRangePicker({ label, value, onValueChange, formatValue, presets, validateRange, density, disabled, isClearable, ...environment }: MonthRangePickerProps): ReactNode;
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ControlDensity } from '../../../foundations/src/control-density.ts';
3
+ export type PickerPreset<Value> = {
4
+ readonly id: string;
5
+ readonly label: string;
6
+ readonly value: Value;
7
+ };
8
+ type PickerPopoverProps<Value> = {
9
+ readonly label: string;
10
+ readonly value: Value | undefined;
11
+ readonly onValueChange: (value: Value | undefined) => void;
12
+ readonly formatValue: (value: Value) => string;
13
+ readonly validateValue: (value: Value) => string | undefined;
14
+ readonly presets?: ReadonlyArray<PickerPreset<Value>> | undefined;
15
+ readonly density?: ControlDensity | undefined;
16
+ readonly disabled?: boolean | undefined;
17
+ readonly isClearable?: boolean | undefined;
18
+ readonly timeZone: string;
19
+ readonly children: (value: Value | undefined, onValueChange: (value: Value | undefined) => void) => ReactNode;
20
+ };
21
+ export declare function PickerPopover<Value>({ label, value, onValueChange, formatValue, validateValue, presets, density, disabled, isClearable, timeZone, children, }: PickerPopoverProps<Value>): ReactNode;
22
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { c as e } from "./src-C-Sx37kz.js";
2
- import { l as t } from "./src-CD6veX7n.js";
2
+ import { n as t } from "./forms-BQQFas9g.js";
3
3
  import { p as n } from "./tokens.stylex-CJbIDPB9.js";
4
4
  import { r } from "./pierre-theme-BpNaWn1x.js";
5
5
  import * as i from "@stylexjs/stylex";
@@ -893,10 +893,10 @@ function Te({ closeButton: e = !0, closeButtonAriaLabel: t = "Dismiss notificati
893
893
  closeButtonAriaLabel: t,
894
894
  style: { transitionProperty: "opacity, transform" },
895
895
  classNames: {
896
- toast: { className: "x1bl4301 x78zum5 x1a02dak x6s0dn4 x1hnptsi x1c8xbx5 xx4ccz x1l38xx4 xmkeg23 x1y0btm7 x1ey3b81 xy32g2j xpvm0e4 xbixft x16hm2kh x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi x7kce61 xkwcdv0 x19hn9gq x350ok5 x1dknavn x1qgcmqu x19j7ixz xgam3oh x7s97pk x-default-marker" }.className ?? "",
897
- title: { className: "xk4h15q" }.className ?? "",
898
- description: { className: "x153jb6y" }.className ?? "",
899
- content: { className: "x78zum5 xdt5ytf x1slnebi xeuugli xfko13i x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
896
+ toast: { className: "x1bl4301 x78zum5 x1a02dak x6s0dn4 x1hnptsi x1mvvolr xx4ccz x1l38xx4 xmkeg23 x1y0btm7 x1ey3b81 xy32g2j xpvm0e4 xbixft x16hm2kh x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi x7kce61 xkwcdv0 x19hn9gq x350ok5 x1dknavn x1qgcmqu x19j7ixz xgam3oh x7s97pk x-default-marker" }.className ?? "",
897
+ title: { className: "xk4h15q x104kibb x1ua5tub x1h7i4cw xb3r6kr xj0a0fe" }.className ?? "",
898
+ description: { className: "x153jb6y x104kibb x1ua5tub x1h7i4cw xb3r6kr xj0a0fe" }.className ?? "",
899
+ content: { className: "x78zum5 xdt5ytf x148l3ej xeuugli xfko13i x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
900
900
  icon: { className: "x78zum5 x1n2onr6 x2lah0s xtwnzbg x18utl2x x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
901
901
  loader: { className: "x7kce61 xkwcdv0 x19hn9gq x350ok5 x1dknavn" }.className ?? "",
902
902
  actionButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 xeuugli x193iq5w x17tes2r x17oiadl x1hmw7ec x1atzlso xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x1pt885t x1ymx3u3 xmn6lam x1eou8nq x1qgcmqu x19j7ixz xgam3oh x7s97pk x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",