@mechane-ai/elements 0.33.0 → 0.34.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/ai.js +1 -1
- package/dist/charts/cartesian.js +1 -1
- package/dist/collections.js +1 -1
- package/dist/content/tree.js +1 -1
- package/dist/elements.css +16 -0
- package/dist/forms/dates.js +519 -73
- package/dist/forms-BQQFas9g.js +118 -0
- package/dist/forms.js +3 -1
- package/dist/navigation/commands.js +1 -1
- package/dist/packages/forms/src/dates/calendar.d.ts +2 -5
- package/dist/packages/forms/src/dates/civil.d.ts +28 -0
- package/dist/packages/forms/src/dates/date-inputs.d.ts +20 -0
- package/dist/packages/forms/src/dates/date-picker.d.ts +13 -0
- package/dist/packages/forms/src/dates/date-range-picker.d.ts +14 -12
- package/dist/packages/forms/src/dates/index.d.ts +8 -0
- package/dist/packages/forms/src/dates/month-calendar.d.ts +19 -0
- package/dist/packages/forms/src/dates/month-picker.d.ts +14 -0
- package/dist/packages/forms/src/dates/month-range-picker.d.ts +18 -0
- package/dist/packages/forms/src/dates/picker-popover.d.ts +22 -0
- package/dist/{pierre-tree-Dd5Vd79M.js → pierre-tree-CYCRjdGG.js} +1 -1
- package/dist/{src-CD6veX7n.js → src-BYKjPC-0.js} +278 -387
- 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
|
-
|
|
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,9 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
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 {
|
|
3
|
-
|
|
4
|
-
|
|
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:
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
16
|
-
|
|
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 {
|
|
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";
|