@bysages/solid 0.4.1 → 0.4.3
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/ai-prompt-input/index.mjs +37 -35
- package/dist/components/angle-slider/index.d.mts +15 -1
- package/dist/components/angle-slider/index.mjs +57 -2
- package/dist/components/calendar/index.d.mts +19 -7
- package/dist/components/calendar/index.mjs +212 -138
- package/dist/components/carousel/index.d.mts +15 -1
- package/dist/components/carousel/index.mjs +68 -4
- package/dist/components/checkbox/index.d.mts +16 -1
- package/dist/components/checkbox/index.mjs +53 -2
- package/dist/components/checkbox-group/index.d.mts +10 -3
- package/dist/components/checkbox-group/index.mjs +2 -2
- package/dist/components/chip/index.d.mts +1 -1
- package/dist/components/clipboard/index.d.mts +14 -1
- package/dist/components/clipboard/index.mjs +57 -2
- package/dist/components/date-input/index.d.mts +16 -2
- package/dist/components/date-input/index.mjs +51 -2
- package/dist/components/date-picker/index.d.mts +27 -2
- package/dist/components/date-picker/index.mjs +152 -3
- package/dist/components/editable/index.d.mts +17 -1
- package/dist/components/editable/index.mjs +80 -2
- package/dist/components/field/index.d.mts +16 -1
- package/dist/components/field/index.mjs +52 -4
- package/dist/components/fieldset/index.d.mts +15 -3
- package/dist/components/fieldset/index.mjs +46 -4
- package/dist/components/file-upload/index.d.mts +21 -1
- package/dist/components/file-upload/index.mjs +65 -2
- package/dist/components/floating-panel/index.d.mts +15 -3
- package/dist/components/floating-panel/index.mjs +112 -4
- package/dist/components/form/index.d.mts +44 -2
- package/dist/components/image-cropper/index.d.mts +8 -1
- package/dist/components/image-cropper/index.mjs +42 -4
- package/dist/components/json-tree-view/index.d.mts +11 -2
- package/dist/components/json-tree-view/index.mjs +16 -1
- package/dist/components/listbox/index.d.mts +21 -1
- package/dist/components/listbox/index.mjs +58 -3
- package/dist/components/marquee/index.d.mts +12 -1
- package/dist/components/marquee/index.mjs +45 -4
- package/dist/components/navigation-menu/index.d.mts +17 -1
- package/dist/components/navigation-menu/index.mjs +65 -5
- package/dist/components/number-input/index.d.mts +20 -1
- package/dist/components/number-input/index.mjs +71 -2
- package/dist/components/pagination/index.d.mts +22 -2
- package/dist/components/pagination/index.mjs +104 -5
- package/dist/components/password-input/index.d.mts +18 -1
- package/dist/components/password-input/index.mjs +56 -2
- package/dist/components/pin-input/index.d.mts +18 -1
- package/dist/components/pin-input/index.mjs +54 -2
- package/dist/components/progress/index.d.mts +19 -1
- package/dist/components/progress/index.mjs +105 -6
- package/dist/components/qr-code/index.d.mts +8 -1
- package/dist/components/qr-code/index.mjs +21 -4
- package/dist/components/radio-group/index.d.mts +23 -1
- package/dist/components/radio-group/index.mjs +65 -2
- package/dist/components/rating-group/index.d.mts +15 -1
- package/dist/components/rating-group/index.mjs +51 -2
- package/dist/components/scroll-area/index.d.mts +11 -3
- package/dist/components/scroll-area/index.mjs +36 -4
- package/dist/components/segment-group/index.d.mts +27 -4
- package/dist/components/segment-group/index.mjs +65 -6
- package/dist/components/signature-pad/index.d.mts +16 -1
- package/dist/components/signature-pad/index.mjs +63 -4
- package/dist/components/slider/index.d.mts +20 -1
- package/dist/components/slider/index.mjs +66 -2
- package/dist/components/splitter/index.d.mts +15 -1
- package/dist/components/splitter/index.mjs +57 -4
- package/dist/components/steps/index.d.mts +5 -1
- package/dist/components/steps/index.mjs +9 -2
- package/dist/components/swap/index.d.mts +11 -3
- package/dist/components/swap/index.mjs +34 -4
- package/dist/components/switch/index.d.mts +16 -1
- package/dist/components/switch/index.mjs +47 -2
- package/dist/components/table/index.d.mts +2 -0
- package/dist/components/table/index.mjs +13 -11
- package/dist/components/tag/index.d.mts +29 -0
- package/dist/components/tag/index.mjs +121 -0
- package/dist/components/tags-input/index.d.mts +18 -1
- package/dist/components/tags-input/index.mjs +82 -2
- package/dist/components/timer/index.d.mts +12 -1
- package/dist/components/timer/index.mjs +56 -4
- package/dist/components/toast/index.d.mts +10 -5
- package/dist/components/toast/index.mjs +37 -5
- package/dist/components/toc/index.d.mts +2 -11
- package/dist/components/toc/index.mjs +1 -1
- package/dist/components/toggle/index.d.mts +8 -1
- package/dist/components/toggle/index.mjs +26 -4
- package/dist/components/toggle-group/index.d.mts +23 -1
- package/dist/components/toggle-group/index.mjs +57 -3
- package/dist/components/tree-view/index.d.mts +32 -2
- package/dist/components/tree-view/index.mjs +93 -4
- package/dist/components/user/index.mjs +8 -2
- package/dist/generative/index.d.mts +47 -0
- package/dist/generative/index.mjs +942 -0
- package/dist/index-BU5U5w04.d.mts +35 -0
- package/dist/index.d.mts +43 -42
- package/dist/index.mjs +3 -2
- package/dist/toc-DRHr8_eD.mjs +88 -0
- package/package.json +2 -2
- package/dist/index-B1-quIrl.d.mts +0 -1815
- package/dist/toc-CqvGOp34.mjs +0 -31
|
@@ -2,84 +2,252 @@ import { t as defineFamily } from "../../family-Cmd8HEyK.mjs";
|
|
|
2
2
|
import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
|
|
3
3
|
import { t as useElementId } from "../../id-2ygNzPHF.mjs";
|
|
4
4
|
import { DatePicker as DatePicker$1 } from "../date-picker/index.mjs";
|
|
5
|
-
import { createComponent, insert, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
5
|
+
import { createComponent, delegateEvents, insert, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
6
6
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
7
|
-
import { For,
|
|
7
|
+
import { For, splitProps } from "solid-js";
|
|
8
8
|
import { DatePicker } from "@ark-ui/solid/date-picker";
|
|
9
9
|
//#region src/components/calendar/index.tsx
|
|
10
|
-
var _tmpl$ = /* @__PURE__ */ template(`<
|
|
11
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<div
|
|
10
|
+
var _tmpl$ = /* @__PURE__ */ template(`<button type=button data-scope=calendar data-part=today-trigger>Today`);
|
|
11
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div data-scope=calendar data-part=header>`);
|
|
12
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
|
|
12
13
|
function chevron(dir) {
|
|
13
14
|
return iconNode(dir === "left" ? "chevron-left" : "chevron-right", {
|
|
14
15
|
width: "16",
|
|
15
16
|
height: "16"
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
/** The date-picker's
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* are the shared machinery — value, range selection, and focus ride
|
|
22
|
-
* Ark's own contract. */
|
|
19
|
+
/** The date-picker's grid standing on the page. Compact is the popup's
|
|
20
|
+
* quiet card; full opens it into a dashboard calendar. Year mode starts
|
|
21
|
+
* on a month overview; choosing a month drills into its day grid. */
|
|
23
22
|
function CalendarImpl(props) {
|
|
24
23
|
injectComponentStyle("calendar");
|
|
25
24
|
injectComponentStyle("date-picker");
|
|
26
25
|
const [own, rest] = splitProps(props, [
|
|
27
26
|
"id",
|
|
28
27
|
"value",
|
|
28
|
+
"defaultValue",
|
|
29
29
|
"min",
|
|
30
30
|
"max",
|
|
31
|
+
"variant",
|
|
32
|
+
"mode",
|
|
33
|
+
"selectionMode",
|
|
34
|
+
"startOfWeek",
|
|
35
|
+
"fixedWeeks",
|
|
36
|
+
"showWeekNumbers",
|
|
37
|
+
"outsideDaySelectable",
|
|
38
|
+
"closeOnSelect",
|
|
39
|
+
"minView",
|
|
40
|
+
"maxView",
|
|
31
41
|
"onValueChange"
|
|
32
42
|
]);
|
|
33
43
|
const id = useElementId("calendar", () => own.id);
|
|
34
44
|
const title = (dp) => {
|
|
35
45
|
const api = dp();
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
38
|
-
if (api.view === "
|
|
46
|
+
const date = api.focusedValue;
|
|
47
|
+
if (!date) return "";
|
|
48
|
+
if (api.view === "month") return api.format(date, { year: "numeric" });
|
|
49
|
+
if (api.view === "day") return api.format(date, {
|
|
39
50
|
month: "long",
|
|
40
51
|
year: "numeric"
|
|
41
52
|
});
|
|
42
|
-
|
|
43
|
-
const decade = Math.floor(d.year / 10) * 10;
|
|
53
|
+
const decade = Math.floor(date.year / 10) * 10;
|
|
44
54
|
return `${decade} - ${decade + 9}`;
|
|
45
55
|
};
|
|
46
|
-
const
|
|
56
|
+
const todayTrigger = (dp) => (() => {
|
|
47
57
|
var _el$ = _tmpl$();
|
|
48
|
-
|
|
58
|
+
_el$._$$click = () => {
|
|
59
|
+
const api = dp();
|
|
60
|
+
api.selectToday();
|
|
61
|
+
if ((own.mode ?? "month") === "year" && api.view === "month") api.setView("day");
|
|
62
|
+
};
|
|
63
|
+
return _el$;
|
|
64
|
+
})();
|
|
65
|
+
const header = (dp) => (() => {
|
|
66
|
+
var _el$2 = _tmpl$2();
|
|
67
|
+
insert(_el$2, createComponent(DatePicker.ViewControl, { get children() {
|
|
49
68
|
return [
|
|
50
69
|
createComponent(DatePicker.PrevTrigger, { get children() {
|
|
51
70
|
return chevron("left");
|
|
52
71
|
} }),
|
|
53
|
-
createComponent(DatePicker.Context, { children: (
|
|
54
|
-
return title(
|
|
72
|
+
createComponent(DatePicker.Context, { children: (context) => createComponent(DatePicker.ViewTrigger, { get children() {
|
|
73
|
+
return title(context);
|
|
55
74
|
} }) }),
|
|
75
|
+
memo(() => {
|
|
76
|
+
return memo(() => {
|
|
77
|
+
return !!(own.variant === "full" && dp);
|
|
78
|
+
})() ? todayTrigger(dp) : null;
|
|
79
|
+
}),
|
|
56
80
|
createComponent(DatePicker.NextTrigger, { get children() {
|
|
57
81
|
return chevron("right");
|
|
58
82
|
} })
|
|
59
83
|
];
|
|
60
84
|
} }));
|
|
61
|
-
return _el
|
|
85
|
+
return _el$2;
|
|
62
86
|
})();
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
87
|
+
const dayTable = (_dp) => createComponent(DatePicker.Table, { get children() {
|
|
88
|
+
return [createComponent(DatePicker.TableHead, { get children() {
|
|
89
|
+
return createComponent(DatePicker.TableRow, { get children() {
|
|
90
|
+
return [memo(() => {
|
|
91
|
+
return memo(() => {
|
|
92
|
+
return !!own.showWeekNumbers;
|
|
93
|
+
})() ? createComponent(DatePicker.WeekNumberHeaderCell, { children: "Wk" }) : null;
|
|
94
|
+
}), createComponent(DatePicker.Context, { children: (context) => createComponent(For, {
|
|
95
|
+
get each() {
|
|
96
|
+
return context().weekDays;
|
|
97
|
+
},
|
|
98
|
+
children: (day) => createComponent(DatePicker.TableHeader, {
|
|
99
|
+
get "aria-label"() {
|
|
100
|
+
return day.long;
|
|
101
|
+
},
|
|
102
|
+
get children() {
|
|
103
|
+
return day.narrow;
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
}) })];
|
|
107
|
+
} });
|
|
108
|
+
} }), createComponent(DatePicker.TableBody, { get children() {
|
|
109
|
+
return createComponent(DatePicker.Context, { children: (context) => createComponent(For, {
|
|
110
|
+
get each() {
|
|
111
|
+
return context().weeks;
|
|
112
|
+
},
|
|
113
|
+
children: (week, weekIndex) => createComponent(DatePicker.TableRow, { get children() {
|
|
114
|
+
return [memo(() => {
|
|
115
|
+
return memo(() => {
|
|
116
|
+
return !!own.showWeekNumbers;
|
|
117
|
+
})() ? createComponent(DatePicker.WeekNumberCell, {
|
|
118
|
+
get weekIndex() {
|
|
119
|
+
return weekIndex();
|
|
120
|
+
},
|
|
121
|
+
week,
|
|
122
|
+
get children() {
|
|
123
|
+
return context().getWeekNumber(week);
|
|
124
|
+
}
|
|
125
|
+
}) : null;
|
|
126
|
+
}), createComponent(For, {
|
|
127
|
+
each: week,
|
|
128
|
+
children: (day) => createComponent(DatePicker.TableCell, {
|
|
129
|
+
value: day,
|
|
130
|
+
get children() {
|
|
131
|
+
return createComponent(DatePicker.TableCellTrigger, { get children() {
|
|
132
|
+
return day.day;
|
|
133
|
+
} });
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
})];
|
|
137
|
+
} })
|
|
138
|
+
}) });
|
|
139
|
+
} })];
|
|
140
|
+
} });
|
|
141
|
+
const monthGrid = (_dp, columns) => createComponent(DatePicker.Table, {
|
|
142
|
+
columns,
|
|
143
|
+
get children() {
|
|
144
|
+
return createComponent(DatePicker.TableBody, { get children() {
|
|
145
|
+
return createComponent(DatePicker.Context, { children: (context) => createComponent(For, {
|
|
146
|
+
get each() {
|
|
147
|
+
return context().getMonthsGrid({
|
|
148
|
+
columns,
|
|
149
|
+
format: columns === 4 ? "short" : "long"
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
children: (months) => createComponent(DatePicker.TableRow, { get children() {
|
|
153
|
+
return createComponent(For, {
|
|
154
|
+
each: months,
|
|
155
|
+
children: (month) => createComponent(DatePicker.TableCell, {
|
|
156
|
+
get value() {
|
|
157
|
+
return month.value;
|
|
158
|
+
},
|
|
159
|
+
columns,
|
|
160
|
+
get children() {
|
|
161
|
+
return createComponent(DatePicker.TableCellTrigger, { get children() {
|
|
162
|
+
return month.label;
|
|
163
|
+
} });
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
});
|
|
167
|
+
} })
|
|
168
|
+
}) });
|
|
169
|
+
} });
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const yearGrid = (_dp) => createComponent(DatePicker.Table, {
|
|
173
|
+
columns: 3,
|
|
174
|
+
get children() {
|
|
175
|
+
return createComponent(DatePicker.TableBody, { get children() {
|
|
176
|
+
return createComponent(DatePicker.Context, { children: (context) => createComponent(For, {
|
|
177
|
+
get each() {
|
|
178
|
+
return context().getYearsGrid({ columns: 3 });
|
|
179
|
+
},
|
|
180
|
+
children: (years) => createComponent(DatePicker.TableRow, { get children() {
|
|
181
|
+
return createComponent(For, {
|
|
182
|
+
each: years,
|
|
183
|
+
children: (year) => createComponent(DatePicker.TableCell, {
|
|
184
|
+
get value() {
|
|
185
|
+
return year.value;
|
|
186
|
+
},
|
|
187
|
+
columns: 3,
|
|
188
|
+
get children() {
|
|
189
|
+
return createComponent(DatePicker.TableCellTrigger, { get children() {
|
|
190
|
+
return year.label;
|
|
191
|
+
} });
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
});
|
|
195
|
+
} })
|
|
196
|
+
}) });
|
|
197
|
+
} });
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
var _el$3 = _tmpl$3();
|
|
201
|
+
spread(_el$3, [rest, {
|
|
202
|
+
get id() {
|
|
203
|
+
return id();
|
|
204
|
+
},
|
|
67
205
|
"data-scope": "calendar",
|
|
68
|
-
"data-part": "root"
|
|
206
|
+
"data-part": "root",
|
|
207
|
+
get "data-variant"() {
|
|
208
|
+
return own.variant ?? "compact";
|
|
209
|
+
},
|
|
210
|
+
get "data-mode"() {
|
|
211
|
+
return own.mode ?? "month";
|
|
212
|
+
}
|
|
69
213
|
}], true);
|
|
70
|
-
insert(_el$
|
|
214
|
+
insert(_el$3, createComponent(DatePicker.Root, mergeProps({
|
|
71
215
|
get id() {
|
|
72
|
-
return id()
|
|
216
|
+
return `${id()}:date-picker`;
|
|
73
217
|
},
|
|
74
218
|
open: true,
|
|
75
|
-
|
|
76
|
-
|
|
219
|
+
inline: true,
|
|
220
|
+
get closeOnSelect() {
|
|
221
|
+
return own.closeOnSelect ?? true;
|
|
222
|
+
},
|
|
223
|
+
get outsideDaySelectable() {
|
|
224
|
+
return own.outsideDaySelectable ?? true;
|
|
225
|
+
}
|
|
77
226
|
}, () => {
|
|
78
227
|
return own.value !== void 0 ? { value: own.value } : {};
|
|
228
|
+
}, () => {
|
|
229
|
+
return own.defaultValue !== void 0 ? { defaultValue: own.defaultValue } : {};
|
|
79
230
|
}, () => {
|
|
80
231
|
return own.min !== void 0 ? { min: own.min } : {};
|
|
81
232
|
}, () => {
|
|
82
233
|
return own.max !== void 0 ? { max: own.max } : {};
|
|
234
|
+
}, () => {
|
|
235
|
+
return own.selectionMode !== void 0 ? { selectionMode: own.selectionMode } : {};
|
|
236
|
+
}, () => {
|
|
237
|
+
return own.startOfWeek !== void 0 ? { startOfWeek: own.startOfWeek } : {};
|
|
238
|
+
}, () => {
|
|
239
|
+
return own.fixedWeeks || own.variant === "full" ? { fixedWeeks: true } : {};
|
|
240
|
+
}, () => {
|
|
241
|
+
return own.showWeekNumbers ? { showWeekNumbers: true } : {};
|
|
242
|
+
}, () => {
|
|
243
|
+
return own.minView !== void 0 ? { minView: own.minView } : {};
|
|
244
|
+
}, () => {
|
|
245
|
+
return own.maxView !== void 0 ? { maxView: own.maxView } : {};
|
|
246
|
+
}, () => {
|
|
247
|
+
return own.mode === "year" ? {
|
|
248
|
+
defaultView: "month",
|
|
249
|
+
maxView: "month"
|
|
250
|
+
} : {};
|
|
83
251
|
}, {
|
|
84
252
|
onValueChange: (details) => own.onValueChange?.(details.value),
|
|
85
253
|
get children() {
|
|
@@ -89,44 +257,7 @@ function CalendarImpl(props) {
|
|
|
89
257
|
get children() {
|
|
90
258
|
return [memo(() => {
|
|
91
259
|
return header();
|
|
92
|
-
}), createComponent(DatePicker.
|
|
93
|
-
return [createComponent(DatePicker.TableHead, { get children() {
|
|
94
|
-
return createComponent(DatePicker.TableRow, { get children() {
|
|
95
|
-
return createComponent(DatePicker.Context, { children: (dp) => createComponent(For, {
|
|
96
|
-
get each() {
|
|
97
|
-
return dp().weekDays;
|
|
98
|
-
},
|
|
99
|
-
children: (day) => createComponent(DatePicker.TableHeader, {
|
|
100
|
-
get "aria-label"() {
|
|
101
|
-
return day.long;
|
|
102
|
-
},
|
|
103
|
-
get children() {
|
|
104
|
-
return day.narrow;
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
}) });
|
|
108
|
-
} });
|
|
109
|
-
} }), createComponent(DatePicker.TableBody, { get children() {
|
|
110
|
-
return createComponent(DatePicker.Context, { children: (dp) => createComponent(For, {
|
|
111
|
-
get each() {
|
|
112
|
-
return dp().weeks;
|
|
113
|
-
},
|
|
114
|
-
children: (week) => createComponent(DatePicker.TableRow, { get children() {
|
|
115
|
-
return createComponent(For, {
|
|
116
|
-
each: week,
|
|
117
|
-
children: (day) => createComponent(DatePicker.TableCell, {
|
|
118
|
-
value: day,
|
|
119
|
-
get children() {
|
|
120
|
-
return createComponent(DatePicker.TableCellTrigger, { get children() {
|
|
121
|
-
return day.day;
|
|
122
|
-
} });
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
});
|
|
126
|
-
} })
|
|
127
|
-
}) });
|
|
128
|
-
} })];
|
|
129
|
-
} })];
|
|
260
|
+
}), createComponent(DatePicker.Context, { children: (dp) => dayTable(dp) })];
|
|
130
261
|
}
|
|
131
262
|
}),
|
|
132
263
|
createComponent(DatePicker.View, {
|
|
@@ -134,84 +265,27 @@ function CalendarImpl(props) {
|
|
|
134
265
|
get children() {
|
|
135
266
|
return [memo(() => {
|
|
136
267
|
return header();
|
|
137
|
-
}), createComponent(DatePicker.
|
|
138
|
-
columns: 3,
|
|
139
|
-
get children() {
|
|
140
|
-
return createComponent(DatePicker.TableBody, { get children() {
|
|
141
|
-
return createComponent(DatePicker.Context, { children: (dp) => createComponent(For, {
|
|
142
|
-
get each() {
|
|
143
|
-
return dp().getMonthsGrid({ columns: 3 });
|
|
144
|
-
},
|
|
145
|
-
children: (months) => createComponent(DatePicker.TableRow, { get children() {
|
|
146
|
-
return createComponent(For, {
|
|
147
|
-
each: months,
|
|
148
|
-
children: (month) => createComponent(DatePicker.TableCell, {
|
|
149
|
-
get value() {
|
|
150
|
-
return month.value;
|
|
151
|
-
},
|
|
152
|
-
columns: 3,
|
|
153
|
-
get children() {
|
|
154
|
-
return createComponent(DatePicker.TableCellTrigger, { get children() {
|
|
155
|
-
return month.label;
|
|
156
|
-
} });
|
|
157
|
-
}
|
|
158
|
-
})
|
|
159
|
-
});
|
|
160
|
-
} })
|
|
161
|
-
}) });
|
|
162
|
-
} });
|
|
163
|
-
}
|
|
164
|
-
})];
|
|
268
|
+
}), createComponent(DatePicker.Context, { children: (dp) => monthGrid(dp, own.mode === "year" ? 4 : 3) })];
|
|
165
269
|
}
|
|
166
270
|
}),
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
return dp().getYearsGrid({ columns: 3 });
|
|
179
|
-
},
|
|
180
|
-
children: (years) => createComponent(DatePicker.TableRow, { get children() {
|
|
181
|
-
return createComponent(For, {
|
|
182
|
-
each: years,
|
|
183
|
-
children: (year) => createComponent(DatePicker.TableCell, {
|
|
184
|
-
get value() {
|
|
185
|
-
return year.value;
|
|
186
|
-
},
|
|
187
|
-
columns: 3,
|
|
188
|
-
get children() {
|
|
189
|
-
return createComponent(DatePicker.TableCellTrigger, { get children() {
|
|
190
|
-
return year.label;
|
|
191
|
-
} });
|
|
192
|
-
}
|
|
193
|
-
})
|
|
194
|
-
});
|
|
195
|
-
} })
|
|
196
|
-
}) });
|
|
197
|
-
} });
|
|
198
|
-
}
|
|
199
|
-
})];
|
|
200
|
-
}
|
|
271
|
+
memo(() => {
|
|
272
|
+
return memo(() => {
|
|
273
|
+
return (own.mode ?? "month") === "month";
|
|
274
|
+
})() ? createComponent(DatePicker.View, {
|
|
275
|
+
view: "year",
|
|
276
|
+
get children() {
|
|
277
|
+
return [memo(() => {
|
|
278
|
+
return header();
|
|
279
|
+
}), createComponent(DatePicker.Context, { children: (dp) => yearGrid(dp) })];
|
|
280
|
+
}
|
|
281
|
+
}) : null;
|
|
201
282
|
})
|
|
202
283
|
];
|
|
203
284
|
}
|
|
204
|
-
}))
|
|
205
|
-
|
|
206
|
-
get when() {
|
|
207
|
-
return rest.children;
|
|
208
|
-
},
|
|
209
|
-
get children() {
|
|
210
|
-
return rest.children;
|
|
211
|
-
}
|
|
212
|
-
}), _el$4);
|
|
213
|
-
return _el$2;
|
|
285
|
+
})));
|
|
286
|
+
return _el$3;
|
|
214
287
|
}
|
|
215
288
|
const Calendar = defineFamily(CalendarImpl, DatePicker$1);
|
|
289
|
+
delegateEvents(["click"]);
|
|
216
290
|
//#endregion
|
|
217
291
|
export { Calendar };
|
|
@@ -7,7 +7,21 @@ import { Carousel as Carousel$1 } from "@ark-ui/solid/carousel";
|
|
|
7
7
|
* Control, PrevTrigger, NextTrigger, ItemGroup, Item, IndicatorGroup,
|
|
8
8
|
* Indicator, AutoplayTrigger, ProgressText. */
|
|
9
9
|
declare function CarouselRoot(props: ComponentProps<typeof Carousel$1.Root>): import("solid-js").JSX.Element;
|
|
10
|
-
|
|
10
|
+
type CarouselSlide = string | {
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
export interface CarouselFacadeProps {
|
|
14
|
+
value?: number;
|
|
15
|
+
defaultValue?: number;
|
|
16
|
+
items: CarouselSlide[];
|
|
17
|
+
spacing?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
onValueChange?: (value: number) => void;
|
|
20
|
+
}
|
|
21
|
+
/** The complete carousel behind a slide list: arrows, progress, items, and
|
|
22
|
+
* indicators use the common lane. Custom slides remain anatomy work. */
|
|
23
|
+
declare function CarouselFacade(props: CarouselFacadeProps): import("solid-js").JSX.Element;
|
|
24
|
+
export declare const Carousel: typeof CarouselFacade & Omit<typeof Carousel$1, "Root"> & {
|
|
11
25
|
Root: typeof CarouselRoot;
|
|
12
26
|
};
|
|
13
27
|
//#endregion
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { t as defineFamily } from "../../family-Cmd8HEyK.mjs";
|
|
2
|
+
import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
|
|
2
3
|
import { t as useElementId } from "../../id-2ygNzPHF.mjs";
|
|
4
|
+
import { createComponent } from "@solidjs/web";
|
|
3
5
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
|
-
import { createComponent, mergeProps } from "solid-js";
|
|
6
|
+
import { For, createComponent as createComponent$1, mergeProps as mergeProps$1 } from "solid-js";
|
|
5
7
|
import { Carousel as Carousel$1 } from "@ark-ui/solid/carousel";
|
|
6
|
-
//#region src/components/carousel/index.
|
|
8
|
+
//#region src/components/carousel/index.tsx
|
|
7
9
|
/** Ark's Carousel, dressed in the paper-and-ink system: slides ride in one
|
|
8
10
|
* hairline-clipped lane, the triggers are quiet outline controls, and the
|
|
9
11
|
* current indicator alone carries the ink. The API is Ark's own — Root,
|
|
@@ -11,11 +13,73 @@ import { Carousel as Carousel$1 } from "@ark-ui/solid/carousel";
|
|
|
11
13
|
* Indicator, AutoplayTrigger, ProgressText. */
|
|
12
14
|
function CarouselRoot(props) {
|
|
13
15
|
const id = useElementId("carousel", () => props.id);
|
|
14
|
-
return createComponent(Carousel$1.Root, mergeProps(props, { get id() {
|
|
16
|
+
return createComponent$1(Carousel$1.Root, mergeProps$1(props, { get id() {
|
|
15
17
|
return id();
|
|
16
18
|
} }));
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
/** The complete carousel behind a slide list: arrows, progress, items, and
|
|
21
|
+
* indicators use the common lane. Custom slides remain anatomy work. */
|
|
22
|
+
function CarouselFacade(props) {
|
|
23
|
+
injectComponentStyle("carousel");
|
|
24
|
+
const slides = () => props.items.map((item) => typeof item === "string" ? item : item.label);
|
|
25
|
+
return createComponent(CarouselRoot, {
|
|
26
|
+
get "aria-label"() {
|
|
27
|
+
return props.label;
|
|
28
|
+
},
|
|
29
|
+
get slideCount() {
|
|
30
|
+
return slides().length;
|
|
31
|
+
},
|
|
32
|
+
get defaultPage() {
|
|
33
|
+
return props.defaultValue;
|
|
34
|
+
},
|
|
35
|
+
get page() {
|
|
36
|
+
return props.value;
|
|
37
|
+
},
|
|
38
|
+
get spacing() {
|
|
39
|
+
return props.spacing;
|
|
40
|
+
},
|
|
41
|
+
onPageChange: (page) => props.onValueChange?.(page.page),
|
|
42
|
+
get children() {
|
|
43
|
+
return [
|
|
44
|
+
createComponent(Carousel$1.Control, { get children() {
|
|
45
|
+
return [
|
|
46
|
+
createComponent(Carousel$1.PrevTrigger, { get children() {
|
|
47
|
+
return iconNode("chevron-left");
|
|
48
|
+
} }),
|
|
49
|
+
createComponent(Carousel$1.ProgressText, {}),
|
|
50
|
+
createComponent(Carousel$1.NextTrigger, { get children() {
|
|
51
|
+
return iconNode("chevron-right");
|
|
52
|
+
} })
|
|
53
|
+
];
|
|
54
|
+
} }),
|
|
55
|
+
createComponent(Carousel$1.ItemGroup, { get children() {
|
|
56
|
+
return createComponent(For, {
|
|
57
|
+
get each() {
|
|
58
|
+
return slides();
|
|
59
|
+
},
|
|
60
|
+
children: (slide, index) => createComponent(Carousel$1.Item, {
|
|
61
|
+
get index() {
|
|
62
|
+
return index();
|
|
63
|
+
},
|
|
64
|
+
children: slide
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
} }),
|
|
68
|
+
createComponent(Carousel$1.IndicatorGroup, { get children() {
|
|
69
|
+
return createComponent(For, {
|
|
70
|
+
get each() {
|
|
71
|
+
return slides();
|
|
72
|
+
},
|
|
73
|
+
children: (_, index) => createComponent(Carousel$1.Indicator, { get index() {
|
|
74
|
+
return index();
|
|
75
|
+
} })
|
|
76
|
+
});
|
|
77
|
+
} })
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const Carousel = defineFamily(CarouselFacade, {
|
|
19
83
|
...Carousel$1,
|
|
20
84
|
Root: CarouselRoot
|
|
21
85
|
});
|
|
@@ -9,7 +9,22 @@ type CheckboxOwnProps = {
|
|
|
9
9
|
size?: "sm" | "md" | "lg";
|
|
10
10
|
};
|
|
11
11
|
declare function CheckboxRoot(props: CheckboxRootProps & CheckboxOwnProps): import("solid-js").JSX.Element;
|
|
12
|
-
|
|
12
|
+
/** The complete checkbox behind one checked state and its label. */
|
|
13
|
+
export interface CheckboxFacadeProps {
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
defaultValue?: boolean;
|
|
16
|
+
label?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
invalid?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
/** One rung for the control's box: the tick scales with it. */
|
|
22
|
+
size?: "sm" | "md" | "lg";
|
|
23
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
24
|
+
}
|
|
25
|
+
declare function CheckboxFacade(props: CheckboxFacadeProps): import("solid-js").JSX.Element;
|
|
26
|
+
type CheckboxParts = Omit<typeof Checkbox$1, "Root"> & {
|
|
13
27
|
Root: typeof CheckboxRoot;
|
|
14
28
|
};
|
|
29
|
+
export declare const Checkbox: typeof CheckboxFacade & CheckboxParts;
|
|
15
30
|
//#endregion
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as defineFamily } from "../../family-Cmd8HEyK.mjs";
|
|
2
|
+
import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
|
|
2
3
|
import { t as useElementId } from "../../id-2ygNzPHF.mjs";
|
|
3
4
|
import { createComponent, mergeProps } from "@solidjs/web";
|
|
4
5
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
5
|
-
import { splitProps } from "solid-js";
|
|
6
|
+
import { Show, splitProps } from "solid-js";
|
|
6
7
|
import { Checkbox as Checkbox$1 } from "@ark-ui/solid/checkbox";
|
|
7
8
|
//#region src/components/checkbox/index.tsx
|
|
8
9
|
function CheckboxRoot(props) {
|
|
@@ -17,7 +18,57 @@ function CheckboxRoot(props) {
|
|
|
17
18
|
}
|
|
18
19
|
}));
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
function CheckboxFacade(props) {
|
|
22
|
+
injectComponentStyle("checkbox");
|
|
23
|
+
return createComponent(CheckboxRoot, mergeProps({
|
|
24
|
+
get size() {
|
|
25
|
+
return props.size ?? "md";
|
|
26
|
+
},
|
|
27
|
+
get disabled() {
|
|
28
|
+
return props.disabled;
|
|
29
|
+
},
|
|
30
|
+
get invalid() {
|
|
31
|
+
return props.invalid;
|
|
32
|
+
},
|
|
33
|
+
get readOnly() {
|
|
34
|
+
return props.readOnly;
|
|
35
|
+
},
|
|
36
|
+
get required() {
|
|
37
|
+
return props.required;
|
|
38
|
+
},
|
|
39
|
+
get defaultChecked() {
|
|
40
|
+
return props.defaultValue ?? false;
|
|
41
|
+
}
|
|
42
|
+
}, () => {
|
|
43
|
+
return props.checked === void 0 ? {} : { checked: props.checked };
|
|
44
|
+
}, {
|
|
45
|
+
onCheckedChange: (details) => props.onCheckedChange?.(details.checked === true),
|
|
46
|
+
get children() {
|
|
47
|
+
return [
|
|
48
|
+
createComponent(Checkbox$1.Control, { get children() {
|
|
49
|
+
return createComponent(Checkbox$1.Indicator, { get children() {
|
|
50
|
+
return iconNode("check", {
|
|
51
|
+
width: 14,
|
|
52
|
+
height: 14
|
|
53
|
+
});
|
|
54
|
+
} });
|
|
55
|
+
} }),
|
|
56
|
+
createComponent(Show, {
|
|
57
|
+
get when() {
|
|
58
|
+
return props.label;
|
|
59
|
+
},
|
|
60
|
+
get children() {
|
|
61
|
+
return createComponent(Checkbox$1.Label, { get children() {
|
|
62
|
+
return props.label;
|
|
63
|
+
} });
|
|
64
|
+
}
|
|
65
|
+
}),
|
|
66
|
+
createComponent(Checkbox$1.HiddenInput, {})
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
const Checkbox = defineFamily(CheckboxFacade, {
|
|
21
72
|
...Checkbox$1,
|
|
22
73
|
Root: CheckboxRoot
|
|
23
74
|
});
|
|
@@ -6,7 +6,14 @@ export interface CheckboxOption {
|
|
|
6
6
|
value: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* One question, many answers: a labelled stack (or row) of the seal-cut
|
|
11
|
+
* checkboxes bound to a single array. Ark's group owns selection, form
|
|
12
|
+
* wiring, and limits; the facade maps an options list onto it. Inside a
|
|
13
|
+
* `Field.Root` the group picks up the field context, so invalid and
|
|
14
|
+
* disabled states dress every box at once.
|
|
15
|
+
*/
|
|
16
|
+
export interface CheckboxGroupFacadeProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
10
17
|
value?: string[];
|
|
11
18
|
defaultValue?: string[];
|
|
12
19
|
options: CheckboxOption[];
|
|
@@ -18,6 +25,6 @@ export interface CheckboxGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
|
18
25
|
disabled?: boolean;
|
|
19
26
|
onValueChange?: (value: string[]) => void;
|
|
20
27
|
}
|
|
21
|
-
declare function
|
|
22
|
-
export declare const CheckboxGroup: typeof
|
|
28
|
+
declare function CheckboxGroupFacade(props: CheckboxGroupFacadeProps): JSX.Element;
|
|
29
|
+
export declare const CheckboxGroup: typeof CheckboxGroupFacade & typeof Checkbox;
|
|
23
30
|
//#endregion
|
|
@@ -11,7 +11,7 @@ import { Checkbox } from "@ark-ui/solid/checkbox";
|
|
|
11
11
|
function checkIcon() {
|
|
12
12
|
return iconNode("check");
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function CheckboxGroupFacade(props) {
|
|
15
15
|
injectComponentStyle("checkbox-group");
|
|
16
16
|
injectComponentStyle("checkbox");
|
|
17
17
|
const field = useFieldContext();
|
|
@@ -89,6 +89,6 @@ function CheckboxGroupImpl(props) {
|
|
|
89
89
|
}
|
|
90
90
|
}));
|
|
91
91
|
}
|
|
92
|
-
const CheckboxGroup = defineFamily(
|
|
92
|
+
const CheckboxGroup = defineFamily(CheckboxGroupFacade, Checkbox$1);
|
|
93
93
|
//#endregion
|
|
94
94
|
export { CheckboxGroup };
|
|
@@ -5,7 +5,7 @@ import { JSX } from "solid-js";
|
|
|
5
5
|
export interface ChipProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
6
6
|
value: number;
|
|
7
7
|
max?: number;
|
|
8
|
-
tone?: "ink" | "
|
|
8
|
+
tone?: "ink" | "primary" | "success" | "warning" | "danger" | "info";
|
|
9
9
|
variant?: "solid" | "subtle" | "outline";
|
|
10
10
|
}
|
|
11
11
|
export declare const Chip: ((props: ChipProps) => JSX.Element) & {
|