@nori-ui/core 1.0.6 → 1.1.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/chunk-2UXKXUX2.js +286 -0
- package/dist/chunk-2UXKXUX2.js.map +1 -0
- package/dist/{chunk-DDGMLLS3.js → chunk-46OT4PA6.js} +3 -3
- package/dist/{chunk-DDGMLLS3.js.map → chunk-46OT4PA6.js.map} +1 -1
- package/dist/{chunk-SFNDR6DI.js → chunk-5BM6H2CD.js} +3 -3
- package/dist/{chunk-SFNDR6DI.js.map → chunk-5BM6H2CD.js.map} +1 -1
- package/dist/{chunk-EWWQQ5DB.js → chunk-6JVUVBZH.js} +5 -5
- package/dist/{chunk-EWWQQ5DB.js.map → chunk-6JVUVBZH.js.map} +1 -1
- package/dist/{chunk-FT2XBBQJ.js → chunk-6PO2IWB3.js} +8 -5
- package/dist/chunk-6PO2IWB3.js.map +1 -0
- package/dist/{chunk-YNKKEO2A.js → chunk-7D2BHQ6M.js} +3 -3
- package/dist/{chunk-YNKKEO2A.js.map → chunk-7D2BHQ6M.js.map} +1 -1
- package/dist/{chunk-MRJWPRCX.js → chunk-AFQIK6JI.js} +3 -3
- package/dist/{chunk-MRJWPRCX.js.map → chunk-AFQIK6JI.js.map} +1 -1
- package/dist/{chunk-IKLA2CVQ.js → chunk-C6TRLHMW.js} +21 -5
- package/dist/chunk-C6TRLHMW.js.map +1 -0
- package/dist/{chunk-NRYWNOG5.js → chunk-CGQIVFCN.js} +3 -3
- package/dist/{chunk-NRYWNOG5.js.map → chunk-CGQIVFCN.js.map} +1 -1
- package/dist/chunk-EFK7726V.js +104 -0
- package/dist/chunk-EFK7726V.js.map +1 -0
- package/dist/{chunk-3BDDPFCI.js → chunk-FDBQOQMW.js} +3 -3
- package/dist/{chunk-3BDDPFCI.js.map → chunk-FDBQOQMW.js.map} +1 -1
- package/dist/{chunk-XALU6LOT.js → chunk-GELLSU64.js} +3 -3
- package/dist/{chunk-XALU6LOT.js.map → chunk-GELLSU64.js.map} +1 -1
- package/dist/{chunk-BZLT6R62.js → chunk-GRDVE3IR.js} +3 -3
- package/dist/{chunk-BZLT6R62.js.map → chunk-GRDVE3IR.js.map} +1 -1
- package/dist/{chunk-OMU4R4Y5.js → chunk-HTF6FDB6.js} +3 -3
- package/dist/{chunk-OMU4R4Y5.js.map → chunk-HTF6FDB6.js.map} +1 -1
- package/dist/{chunk-X7APG7G2.js → chunk-HZKXPN6B.js} +154 -34
- package/dist/chunk-HZKXPN6B.js.map +1 -0
- package/dist/{chunk-WGT345SV.js → chunk-IGLMPAWE.js} +3 -3
- package/dist/{chunk-WGT345SV.js.map → chunk-IGLMPAWE.js.map} +1 -1
- package/dist/{chunk-5XEGZFG5.js → chunk-LWQZ257T.js} +3 -3
- package/dist/{chunk-5XEGZFG5.js.map → chunk-LWQZ257T.js.map} +1 -1
- package/dist/{chunk-RFW5SRZA.js → chunk-MJ4AGXS7.js} +3 -3
- package/dist/{chunk-RFW5SRZA.js.map → chunk-MJ4AGXS7.js.map} +1 -1
- package/dist/{chunk-PNP7L4TA.js → chunk-RM5TSXVE.js} +3 -3
- package/dist/{chunk-PNP7L4TA.js.map → chunk-RM5TSXVE.js.map} +1 -1
- package/dist/{chunk-MKSDYRWQ.js → chunk-SINLREQV.js} +3 -3
- package/dist/{chunk-MKSDYRWQ.js.map → chunk-SINLREQV.js.map} +1 -1
- package/dist/{chunk-TLS54G6Y.js → chunk-UF5OENHV.js} +3 -3
- package/dist/{chunk-TLS54G6Y.js.map → chunk-UF5OENHV.js.map} +1 -1
- package/dist/{chunk-ZQMNGPLE.js → chunk-UJ5KFRDE.js} +18 -6
- package/dist/chunk-UJ5KFRDE.js.map +1 -0
- package/dist/{chunk-SWC5CNKE.js → chunk-UPVNZPFV.js} +3 -3
- package/dist/{chunk-SWC5CNKE.js.map → chunk-UPVNZPFV.js.map} +1 -1
- package/dist/{chunk-3F4TXKDY.js → chunk-UUXWRDWW.js} +3 -3
- package/dist/chunk-UUXWRDWW.js.map +1 -0
- package/dist/{chunk-7GPDNQSX.js → chunk-V2AWSDDZ.js} +5 -5
- package/dist/{chunk-7GPDNQSX.js.map → chunk-V2AWSDDZ.js.map} +1 -1
- package/dist/{chunk-JQQ3FBN7.js → chunk-VCJF75T2.js} +3 -3
- package/dist/{chunk-JQQ3FBN7.js.map → chunk-VCJF75T2.js.map} +1 -1
- package/dist/{chunk-ZBW3BA5R.js → chunk-VMAGFYHG.js} +39 -4
- package/dist/chunk-VMAGFYHG.js.map +1 -0
- package/dist/{chunk-JZ774T7U.js → chunk-W3HMOOON.js} +3 -3
- package/dist/{chunk-JZ774T7U.js.map → chunk-W3HMOOON.js.map} +1 -1
- package/dist/{chunk-6AD6KCVB.js → chunk-WAKKQROH.js} +3 -3
- package/dist/{chunk-6AD6KCVB.js.map → chunk-WAKKQROH.js.map} +1 -1
- package/dist/{chunk-LVWNMQGR.js → chunk-WDNDTSNX.js} +5 -5
- package/dist/{chunk-LVWNMQGR.js.map → chunk-WDNDTSNX.js.map} +1 -1
- package/dist/chunk-WOF67PKT.js +60 -0
- package/dist/chunk-WOF67PKT.js.map +1 -0
- package/dist/{chunk-QJNV7YQP.js → chunk-WTNDPO2V.js} +39 -4
- package/dist/chunk-WTNDPO2V.js.map +1 -0
- package/dist/{chunk-FEPTH5RV.js → chunk-XP55RZ3D.js} +3 -3
- package/dist/{chunk-FEPTH5RV.js.map → chunk-XP55RZ3D.js.map} +1 -1
- package/dist/{chunk-CCUXO2HN.js → chunk-Y4ZRSW35.js} +3 -3
- package/dist/{chunk-CCUXO2HN.js.map → chunk-Y4ZRSW35.js.map} +1 -1
- package/dist/client.cjs +619 -123
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +40 -38
- package/dist/client.js.map +1 -1
- package/dist/components/Accordion/index.js +2 -2
- package/dist/components/Alert/index.js +2 -2
- package/dist/components/AlertDialog/index.js +2 -2
- package/dist/components/Avatar/index.js +2 -2
- package/dist/components/Badge/index.js +2 -2
- package/dist/components/Box/index.js +4 -4
- package/dist/components/Breadcrumb/index.cjs +6 -3
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.js +5 -5
- package/dist/components/Button/index.js +2 -2
- package/dist/components/Calendar/index.cjs +170 -35
- package/dist/components/Calendar/index.cjs.map +1 -1
- package/dist/components/Calendar/index.js +5 -5
- package/dist/components/Card/index.js +2 -2
- package/dist/components/Checkbox/index.cjs +36 -1
- package/dist/components/Checkbox/index.cjs.map +1 -1
- package/dist/components/Checkbox/index.d.cts +17 -1
- package/dist/components/Checkbox/index.d.ts +17 -1
- package/dist/components/Checkbox/index.js +2 -2
- package/dist/components/Dialog/index.js +2 -2
- package/dist/components/Field/index.cjs +703 -0
- package/dist/components/Field/index.cjs.map +1 -0
- package/dist/components/Field/index.d.cts +51 -0
- package/dist/components/Field/index.d.ts +51 -0
- package/dist/components/Field/index.js +9 -0
- package/dist/components/Field/index.js.map +1 -0
- package/dist/components/FloatButton/index.cjs +6 -3
- package/dist/components/FloatButton/index.cjs.map +1 -1
- package/dist/components/FloatButton/index.js +5 -5
- package/dist/components/HStack/index.js +4 -4
- package/dist/components/InputGroup/index.cjs.map +1 -1
- package/dist/components/InputGroup/index.d.cts +8 -1
- package/dist/components/InputGroup/index.d.ts +8 -1
- package/dist/components/InputGroup/index.js +2 -2
- package/dist/components/Label/index.cjs +458 -0
- package/dist/components/Label/index.cjs.map +1 -0
- package/dist/components/Label/index.d.cts +14 -0
- package/dist/components/Label/index.d.ts +14 -0
- package/dist/components/Label/index.js +8 -0
- package/dist/components/Label/index.js.map +1 -0
- package/dist/components/Pagination/index.cjs +21 -6
- package/dist/components/Pagination/index.cjs.map +1 -1
- package/dist/components/Pagination/index.js +5 -5
- package/dist/components/Popover/index.js +2 -2
- package/dist/components/Progress/index.js +2 -2
- package/dist/components/Radio/index.cjs +18 -2
- package/dist/components/Radio/index.cjs.map +1 -1
- package/dist/components/Radio/index.d.cts +17 -1
- package/dist/components/Radio/index.d.ts +17 -1
- package/dist/components/Radio/index.js +2 -2
- package/dist/components/SegmentedControl/index.js +2 -2
- package/dist/components/Select/index.cjs +15 -3
- package/dist/components/Select/index.cjs.map +1 -1
- package/dist/components/Select/index.d.cts +6 -0
- package/dist/components/Select/index.d.ts +6 -0
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Switch/index.cjs +36 -1
- package/dist/components/Switch/index.cjs.map +1 -1
- package/dist/components/Switch/index.d.cts +17 -1
- package/dist/components/Switch/index.d.ts +17 -1
- package/dist/components/Switch/index.js +2 -2
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Text/index.js +2 -2
- package/dist/components/TextArea/index.cjs +35 -84
- package/dist/components/TextArea/index.cjs.map +1 -1
- package/dist/components/TextArea/index.js +3 -3
- package/dist/components/TextInput/index.cjs +35 -84
- package/dist/components/TextInput/index.cjs.map +1 -1
- package/dist/components/TextInput/index.d.cts +7 -8
- package/dist/components/TextInput/index.d.ts +7 -8
- package/dist/components/TextInput/index.js +2 -2
- package/dist/components/Toggle/index.js +2 -2
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/VStack/index.js +4 -4
- package/dist/i18n/index.cjs +6 -3
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/index.cjs +619 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +37 -35
- package/package.json +8 -1
- package/dist/chunk-3F4TXKDY.js.map +0 -1
- package/dist/chunk-FT2XBBQJ.js.map +0 -1
- package/dist/chunk-IKLA2CVQ.js.map +0 -1
- package/dist/chunk-QJNV7YQP.js.map +0 -1
- package/dist/chunk-X7APG7G2.js.map +0 -1
- package/dist/chunk-ZBW3BA5R.js.map +0 -1
- package/dist/chunk-ZQMNGPLE.js.map +0 -1
- package/dist/chunk-ZRD4FQBT.js +0 -153
- package/dist/chunk-ZRD4FQBT.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Breadcrumb, getBreadcrumbJsonLd } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
1
|
+
export { Breadcrumb, getBreadcrumbJsonLd } from '../../chunk-WDNDTSNX.js';
|
|
2
|
+
import '../../chunk-7D2BHQ6M.js';
|
|
3
|
+
import '../../chunk-MJ4AGXS7.js';
|
|
4
|
+
import '../../chunk-6PO2IWB3.js';
|
|
5
5
|
import '../../chunk-ZIBNLXIV.js';
|
|
6
|
-
import '../../chunk-5A2QOOVN.js';
|
|
7
6
|
import '../../chunk-CHXHRJNZ.js';
|
|
7
|
+
import '../../chunk-5A2QOOVN.js';
|
|
8
8
|
import '../../chunk-R5JMDDCB.js';
|
|
9
9
|
import '../../chunk-WCQVDF3K.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { Button } from '../../chunk-
|
|
1
|
+
export { Button } from '../../chunk-LWQZ257T.js';
|
|
2
2
|
import '../../chunk-ACLHDHX3.js';
|
|
3
3
|
import '../../chunk-ZIBNLXIV.js';
|
|
4
|
-
import '../../chunk-5A2QOOVN.js';
|
|
5
4
|
import '../../chunk-CHXHRJNZ.js';
|
|
5
|
+
import '../../chunk-5A2QOOVN.js';
|
|
6
6
|
import '../../chunk-R5JMDDCB.js';
|
|
7
7
|
import '../../chunk-WCQVDF3K.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -298,6 +298,13 @@ function useThemeColors() {
|
|
|
298
298
|
}
|
|
299
299
|
__name(useThemeColors, "useThemeColors");
|
|
300
300
|
|
|
301
|
+
// src/components/Calendar/scroll/ScrollBody.tsx
|
|
302
|
+
var ScrollBody = /* @__PURE__ */ __name((_props) => {
|
|
303
|
+
throw new Error(
|
|
304
|
+
"[Calendar] ScrollBody: no platform implementation resolved. Ensure your bundler honors *.web.tsx / *.native.tsx extensions."
|
|
305
|
+
);
|
|
306
|
+
}, "ScrollBody");
|
|
307
|
+
|
|
301
308
|
// src/components/Calendar/state/locale-utils.ts
|
|
302
309
|
var getFirstDayOfWeek = /* @__PURE__ */ __name((locale) => {
|
|
303
310
|
try {
|
|
@@ -661,8 +668,8 @@ var defaultDictionary = {
|
|
|
661
668
|
// floatButton
|
|
662
669
|
"floatButton.backToTop": "Back to top",
|
|
663
670
|
// calendar
|
|
664
|
-
"calendar.header.previous": "Previous",
|
|
665
|
-
"calendar.header.next": "Next",
|
|
671
|
+
"calendar.header.previous": "Previous month",
|
|
672
|
+
"calendar.header.next": "Next month",
|
|
666
673
|
"calendar.header.openMonthView": "Open month picker",
|
|
667
674
|
"calendar.header.openYearView": "Open year picker",
|
|
668
675
|
"calendar.header.openDayView": "Open day picker",
|
|
@@ -678,7 +685,10 @@ var defaultDictionary = {
|
|
|
678
685
|
"checkbox.checked": "Checked",
|
|
679
686
|
"checkbox.unchecked": "Unchecked",
|
|
680
687
|
"switch.on": "On",
|
|
681
|
-
"switch.off": "Off"
|
|
688
|
+
"switch.off": "Off",
|
|
689
|
+
// field
|
|
690
|
+
"field.requiredIndicator": "*",
|
|
691
|
+
"field.requiredLabel": "required"
|
|
682
692
|
};
|
|
683
693
|
|
|
684
694
|
// src/i18n/resolve.ts
|
|
@@ -870,9 +880,15 @@ var Select = /* @__PURE__ */ __name((props) => {
|
|
|
870
880
|
itemHeight = DEFAULT_ITEM_HEIGHT,
|
|
871
881
|
maxMenuHeight = DEFAULT_MAX_MENU,
|
|
872
882
|
className,
|
|
873
|
-
testID
|
|
883
|
+
testID,
|
|
884
|
+
id,
|
|
885
|
+
name
|
|
874
886
|
} = props;
|
|
875
887
|
const ariaLabel = props["aria-label"];
|
|
888
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
889
|
+
const ariaDescribedBy = props["aria-describedby"];
|
|
890
|
+
const ariaInvalid = props["aria-invalid"];
|
|
891
|
+
const ariaRequired = props["aria-required"];
|
|
876
892
|
const multiple = props.multiple === true;
|
|
877
893
|
const maxSelected = multiple ? props.maxSelected : void 0;
|
|
878
894
|
const maxChips = multiple ? props.maxChips ?? 3 : void 0;
|
|
@@ -1236,11 +1252,11 @@ var Select = /* @__PURE__ */ __name((props) => {
|
|
|
1236
1252
|
if (!open || searchable || reactNative.Platform.OS !== "web") {
|
|
1237
1253
|
return;
|
|
1238
1254
|
}
|
|
1239
|
-
const
|
|
1255
|
+
const id2 = requestAnimationFrame(() => {
|
|
1240
1256
|
const node = popupRef.current;
|
|
1241
1257
|
node?.focus?.();
|
|
1242
1258
|
});
|
|
1243
|
-
return () => cancelAnimationFrame(
|
|
1259
|
+
return () => cancelAnimationFrame(id2);
|
|
1244
1260
|
}, [open, searchable]);
|
|
1245
1261
|
const onListScroll = react.useCallback(
|
|
1246
1262
|
(event) => {
|
|
@@ -1317,7 +1333,13 @@ var Select = /* @__PURE__ */ __name((props) => {
|
|
|
1317
1333
|
"aria-controls": `${baseId}-listbox`,
|
|
1318
1334
|
"aria-haspopup": "listbox",
|
|
1319
1335
|
tabIndex: disabled ? -1 : 0,
|
|
1336
|
+
...id !== void 0 ? { id, nativeID: id } : {},
|
|
1337
|
+
...name !== void 0 ? { name } : {},
|
|
1320
1338
|
...ariaLabel !== void 0 ? { "aria-label": ariaLabel, accessibilityLabel: ariaLabel } : {},
|
|
1339
|
+
...ariaLabelledBy !== void 0 ? { "aria-labelledby": ariaLabelledBy, accessibilityLabelledBy: ariaLabelledBy } : {},
|
|
1340
|
+
...ariaDescribedBy !== void 0 ? { "aria-describedby": ariaDescribedBy, accessibilityDescribedBy: ariaDescribedBy } : {},
|
|
1341
|
+
...ariaInvalid === true ? { "aria-invalid": true } : {},
|
|
1342
|
+
...ariaRequired === true ? { "aria-required": true } : {},
|
|
1321
1343
|
...disabled ? { "aria-disabled": true, disabled: true } : {}
|
|
1322
1344
|
},
|
|
1323
1345
|
onPress: () => {
|
|
@@ -1991,7 +2013,7 @@ var Caption = /* @__PURE__ */ __name(({
|
|
|
1991
2013
|
alignSelf: "center"
|
|
1992
2014
|
},
|
|
1993
2015
|
children: [
|
|
1994
|
-
/* @__PURE__ */ jsxRuntime.jsx(NavButton, { label: t("calendar.header.previous", { defaultValue: "Previous" }), onPress: onPrev, children: "\u2039" }),
|
|
2016
|
+
/* @__PURE__ */ jsxRuntime.jsx(NavButton, { label: t("calendar.header.previous", { defaultValue: "Previous month" }), onPress: onPrev, children: "\u2039" }),
|
|
1995
2017
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { flexDirection: "row", gap: monthGap, width: titleRowWidth }, children: showMultiTitles ? months.map((m, i) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { width: gridWidth, alignItems: "center" }, children: caption === "dropdown" && view === "day" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1996
2018
|
DropdownPair,
|
|
1997
2019
|
{
|
|
@@ -2037,7 +2059,7 @@ var Caption = /* @__PURE__ */ __name(({
|
|
|
2037
2059
|
drilldown: true
|
|
2038
2060
|
}
|
|
2039
2061
|
) }) }),
|
|
2040
|
-
/* @__PURE__ */ jsxRuntime.jsx(NavButton, { label: t("calendar.header.next", { defaultValue: "Next" }), onPress: onNext, children: "\u203A" })
|
|
2062
|
+
/* @__PURE__ */ jsxRuntime.jsx(NavButton, { label: t("calendar.header.next", { defaultValue: "Next month" }), onPress: onNext, children: "\u203A" })
|
|
2041
2063
|
]
|
|
2042
2064
|
}
|
|
2043
2065
|
);
|
|
@@ -2080,8 +2102,53 @@ var DropdownPair = /* @__PURE__ */ __name(({ month, year, monthOptions, yearOpti
|
|
|
2080
2102
|
] });
|
|
2081
2103
|
}, "DropdownPair");
|
|
2082
2104
|
var CELL_SIZE = 40;
|
|
2083
|
-
var
|
|
2105
|
+
var formatterCache = /* @__PURE__ */ new Map();
|
|
2106
|
+
var RUNTIME_DEFAULT_LOCALE_KEY = "__default__";
|
|
2107
|
+
var getDayFormatter = /* @__PURE__ */ __name((locale) => {
|
|
2108
|
+
const key = locale ?? RUNTIME_DEFAULT_LOCALE_KEY;
|
|
2109
|
+
const cached = formatterCache.get(key);
|
|
2110
|
+
if (cached) {
|
|
2111
|
+
return cached;
|
|
2112
|
+
}
|
|
2113
|
+
try {
|
|
2114
|
+
const fmt = new Intl.DateTimeFormat(locale, {
|
|
2115
|
+
weekday: "long",
|
|
2116
|
+
month: "long",
|
|
2117
|
+
day: "numeric",
|
|
2118
|
+
year: "numeric",
|
|
2119
|
+
timeZone: "UTC"
|
|
2120
|
+
});
|
|
2121
|
+
formatterCache.set(key, fmt);
|
|
2122
|
+
return fmt;
|
|
2123
|
+
} catch {
|
|
2124
|
+
return null;
|
|
2125
|
+
}
|
|
2126
|
+
}, "getDayFormatter");
|
|
2127
|
+
var formatDayLabel = /* @__PURE__ */ __name((ctx, locale) => {
|
|
2128
|
+
const jsDate = new Date(Date.UTC(ctx.date.year, ctx.date.month - 1, ctx.date.day));
|
|
2129
|
+
const fmt = getDayFormatter(locale);
|
|
2130
|
+
const base = fmt ? fmt.format(jsDate) : (
|
|
2131
|
+
// Fallback if the runtime rejects the locale tag.
|
|
2132
|
+
`${ctx.date.month}/${ctx.date.day}/${ctx.date.year}`
|
|
2133
|
+
);
|
|
2134
|
+
const suffixes = [];
|
|
2135
|
+
if (ctx.isToday) {
|
|
2136
|
+
suffixes.push("today");
|
|
2137
|
+
}
|
|
2138
|
+
if (ctx.isSelected || ctx.isRangeStart || ctx.isRangeEnd) {
|
|
2139
|
+
suffixes.push("selected");
|
|
2140
|
+
}
|
|
2141
|
+
if (ctx.isInRange && !ctx.isRangeStart && !ctx.isRangeEnd) {
|
|
2142
|
+
suffixes.push("in range");
|
|
2143
|
+
}
|
|
2144
|
+
if (ctx.isUnavailable) {
|
|
2145
|
+
suffixes.push("unavailable");
|
|
2146
|
+
}
|
|
2147
|
+
return suffixes.length > 0 ? `${base}, ${suffixes.join(", ")}` : base;
|
|
2148
|
+
}, "formatDayLabel");
|
|
2149
|
+
var DayCell = /* @__PURE__ */ __name(({ ctx, onPress, onHoverIn, onHoverOut, renderDay, locale }) => {
|
|
2084
2150
|
const colors = useThemeColors();
|
|
2151
|
+
const accessibilityLabel = formatDayLabel(ctx, locale);
|
|
2085
2152
|
const isSelectedLike = ctx.isSelected || ctx.isRangeStart || ctx.isRangeEnd;
|
|
2086
2153
|
const isInsideRange = ctx.isInRange || ctx.isInPreviewRange;
|
|
2087
2154
|
const isRangeMiddle = isInsideRange && !isSelectedLike;
|
|
@@ -2090,7 +2157,8 @@ var DayCell = /* @__PURE__ */ __name(({ ctx, onPress, onHoverIn, onHoverOut, ren
|
|
|
2090
2157
|
reactNative.Pressable,
|
|
2091
2158
|
{
|
|
2092
2159
|
accessibilityRole: "button",
|
|
2093
|
-
|
|
2160
|
+
accessibilityLabel,
|
|
2161
|
+
accessibilityState: { disabled: ctx.isUnavailable, selected: isSelectedLike },
|
|
2094
2162
|
disabled: ctx.isUnavailable,
|
|
2095
2163
|
onPress,
|
|
2096
2164
|
...onHoverIn ? { onHoverIn } : {},
|
|
@@ -2348,6 +2416,7 @@ var DayGrid = /* @__PURE__ */ __name((props) => {
|
|
|
2348
2416
|
DayCell,
|
|
2349
2417
|
{
|
|
2350
2418
|
ctx,
|
|
2419
|
+
locale,
|
|
2351
2420
|
onPress: () => onDayPress(date),
|
|
2352
2421
|
...onDayHover ? {
|
|
2353
2422
|
onHoverIn: /* @__PURE__ */ __name(() => onDayHover(date), "onHoverIn"),
|
|
@@ -2510,6 +2579,9 @@ var focusDayCell = /* @__PURE__ */ __name((root, date, force) => {
|
|
|
2510
2579
|
if (!root) {
|
|
2511
2580
|
return;
|
|
2512
2581
|
}
|
|
2582
|
+
if (typeof document === "undefined" || typeof root.contains !== "function") {
|
|
2583
|
+
return;
|
|
2584
|
+
}
|
|
2513
2585
|
if (!force && !root.contains(document.activeElement)) {
|
|
2514
2586
|
return;
|
|
2515
2587
|
}
|
|
@@ -2614,8 +2686,13 @@ var SingleOrMultiCalendar = /* @__PURE__ */ __name((props) => {
|
|
|
2614
2686
|
const colors = useThemeColors();
|
|
2615
2687
|
const firstDayOfWeek = props.firstDayOfWeek ?? getFirstDayOfWeek(locale);
|
|
2616
2688
|
const weekendDays = props.weekendDays ?? getWeekendDays(locale);
|
|
2617
|
-
const visibleMonths = pickVisibleMonths(props.visibleMonths, containerWidth);
|
|
2689
|
+
const visibleMonths = props.behavior === "scroll" ? 1 : pickVisibleMonths(props.visibleMonths, containerWidth);
|
|
2618
2690
|
const { innerWidth, gridsRowWidth } = surfaceMetrics(visibleMonths);
|
|
2691
|
+
react.useEffect(() => {
|
|
2692
|
+
if (process.env.NODE_ENV !== "production" && props.behavior === "scroll" && typeof props.visibleMonths === "number" && props.visibleMonths > 1) {
|
|
2693
|
+
console.warn('[Calendar] visibleMonths is ignored when behavior="scroll"; falling back to single column.');
|
|
2694
|
+
}
|
|
2695
|
+
}, [props.behavior, props.visibleMonths]);
|
|
2619
2696
|
const containerRef = react.useRef(null);
|
|
2620
2697
|
const state = useCalendarState({
|
|
2621
2698
|
...props.mode !== void 0 ? { mode: props.mode } : {},
|
|
@@ -2678,6 +2755,8 @@ var SingleOrMultiCalendar = /* @__PURE__ */ __name((props) => {
|
|
|
2678
2755
|
setAnchor((a) => a.add({ years: -10 }));
|
|
2679
2756
|
} else if (state.view === "month") {
|
|
2680
2757
|
setAnchor((a) => a.add({ years: -1 }));
|
|
2758
|
+
} else if (props.behavior === "scroll") {
|
|
2759
|
+
state.moveFocus({ months: -1 });
|
|
2681
2760
|
} else {
|
|
2682
2761
|
setAnchor((a) => a.add({ months: -1 }));
|
|
2683
2762
|
}
|
|
@@ -2687,6 +2766,8 @@ var SingleOrMultiCalendar = /* @__PURE__ */ __name((props) => {
|
|
|
2687
2766
|
setAnchor((a) => a.add({ years: 10 }));
|
|
2688
2767
|
} else if (state.view === "month") {
|
|
2689
2768
|
setAnchor((a) => a.add({ years: 1 }));
|
|
2769
|
+
} else if (props.behavior === "scroll") {
|
|
2770
|
+
state.moveFocus({ months: 1 });
|
|
2690
2771
|
} else {
|
|
2691
2772
|
setAnchor((a) => a.add({ months: 1 }));
|
|
2692
2773
|
}
|
|
@@ -2749,22 +2830,44 @@ var SingleOrMultiCalendar = /* @__PURE__ */ __name((props) => {
|
|
|
2749
2830
|
}
|
|
2750
2831
|
),
|
|
2751
2832
|
/* @__PURE__ */ jsxRuntime.jsxs(FadeIn, { children: [
|
|
2752
|
-
state.view === "day" &&
|
|
2753
|
-
|
|
2833
|
+
state.view === "day" && (props.behavior === "scroll" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2834
|
+
ScrollBody,
|
|
2754
2835
|
{
|
|
2755
|
-
visibleMonth: m,
|
|
2756
|
-
locale,
|
|
2757
2836
|
mode: props.mode ?? "single",
|
|
2758
|
-
|
|
2837
|
+
locale,
|
|
2759
2838
|
focusedDate: state.focusedDate,
|
|
2760
|
-
|
|
2761
|
-
|
|
2839
|
+
onFocusedMonthChange: (next) => setAnchor(next),
|
|
2840
|
+
value: state.value,
|
|
2841
|
+
onSelectDate: (date) => state.selectDate(date, "click"),
|
|
2762
2842
|
firstDayOfWeek,
|
|
2763
|
-
|
|
2843
|
+
weekendDays,
|
|
2844
|
+
...props.minValue !== void 0 ? { minValue: props.minValue } : {},
|
|
2845
|
+
...props.maxValue !== void 0 ? { maxValue: props.maxValue } : {},
|
|
2846
|
+
...props.isDateUnavailable !== void 0 ? { isDateUnavailable: props.isDateUnavailable } : {},
|
|
2764
2847
|
...renderDay ? { renderDay } : {}
|
|
2765
|
-
}
|
|
2766
|
-
|
|
2767
|
-
|
|
2848
|
+
}
|
|
2849
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2850
|
+
reactNative.View,
|
|
2851
|
+
{
|
|
2852
|
+
style: { flexDirection: "row", gap: MONTH_GAP, alignSelf: "center", width: gridsRowWidth },
|
|
2853
|
+
children: months.map((m) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2854
|
+
DayGrid,
|
|
2855
|
+
{
|
|
2856
|
+
visibleMonth: m,
|
|
2857
|
+
locale,
|
|
2858
|
+
mode: props.mode ?? "single",
|
|
2859
|
+
value: state.value,
|
|
2860
|
+
focusedDate: state.focusedDate,
|
|
2861
|
+
isUnavailable: state.isUnavailable,
|
|
2862
|
+
weekendDays,
|
|
2863
|
+
firstDayOfWeek,
|
|
2864
|
+
onDayPress: (date) => state.selectDate(date, "click"),
|
|
2865
|
+
...renderDay ? { renderDay } : {}
|
|
2866
|
+
},
|
|
2867
|
+
`${m.year}-${m.month}`
|
|
2868
|
+
))
|
|
2869
|
+
}
|
|
2870
|
+
)),
|
|
2768
2871
|
state.view === "month" && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { alignItems: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2769
2872
|
MonthGrid,
|
|
2770
2873
|
{
|
|
@@ -2799,8 +2902,13 @@ var RangeCalendar = /* @__PURE__ */ __name((props) => {
|
|
|
2799
2902
|
const colors = useThemeColors();
|
|
2800
2903
|
const firstDayOfWeek = props.firstDayOfWeek ?? getFirstDayOfWeek(locale);
|
|
2801
2904
|
const weekendDays = props.weekendDays ?? getWeekendDays(locale);
|
|
2802
|
-
const visibleMonths = pickVisibleMonths(props.visibleMonths, containerWidth);
|
|
2905
|
+
const visibleMonths = props.behavior === "scroll" ? 1 : pickVisibleMonths(props.visibleMonths, containerWidth);
|
|
2803
2906
|
const { innerWidth, gridsRowWidth } = surfaceMetrics(visibleMonths);
|
|
2907
|
+
react.useEffect(() => {
|
|
2908
|
+
if (process.env.NODE_ENV !== "production" && props.behavior === "scroll" && typeof props.visibleMonths === "number" && props.visibleMonths > 1) {
|
|
2909
|
+
console.warn('[Calendar] visibleMonths is ignored when behavior="scroll"; falling back to single column.');
|
|
2910
|
+
}
|
|
2911
|
+
}, [props.behavior, props.visibleMonths]);
|
|
2804
2912
|
const containerRef = react.useRef(null);
|
|
2805
2913
|
const range = useRangeState({
|
|
2806
2914
|
...props.value !== void 0 ? { value: props.value } : {},
|
|
@@ -2878,6 +2986,8 @@ var RangeCalendar = /* @__PURE__ */ __name((props) => {
|
|
|
2878
2986
|
setAnchor((a) => a.add({ years: -10 }));
|
|
2879
2987
|
} else if (view === "month") {
|
|
2880
2988
|
setAnchor((a) => a.add({ years: -1 }));
|
|
2989
|
+
} else if (props.behavior === "scroll") {
|
|
2990
|
+
setFocusedDate((f) => f.add({ months: -1 }));
|
|
2881
2991
|
} else {
|
|
2882
2992
|
setAnchor((a) => a.add({ months: -1 }));
|
|
2883
2993
|
}
|
|
@@ -2887,6 +2997,8 @@ var RangeCalendar = /* @__PURE__ */ __name((props) => {
|
|
|
2887
2997
|
setAnchor((a) => a.add({ years: 10 }));
|
|
2888
2998
|
} else if (view === "month") {
|
|
2889
2999
|
setAnchor((a) => a.add({ years: 1 }));
|
|
3000
|
+
} else if (props.behavior === "scroll") {
|
|
3001
|
+
setFocusedDate((f) => f.add({ months: 1 }));
|
|
2890
3002
|
} else {
|
|
2891
3003
|
setAnchor((a) => a.add({ months: 1 }));
|
|
2892
3004
|
}
|
|
@@ -2957,24 +3069,47 @@ var RangeCalendar = /* @__PURE__ */ __name((props) => {
|
|
|
2957
3069
|
}
|
|
2958
3070
|
),
|
|
2959
3071
|
/* @__PURE__ */ jsxRuntime.jsxs(FadeIn, { children: [
|
|
2960
|
-
view === "day" &&
|
|
2961
|
-
|
|
3072
|
+
view === "day" && (props.behavior === "scroll" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3073
|
+
ScrollBody,
|
|
2962
3074
|
{
|
|
2963
|
-
visibleMonth: m,
|
|
2964
|
-
locale,
|
|
2965
3075
|
mode: "range",
|
|
3076
|
+
locale,
|
|
3077
|
+
focusedDate,
|
|
3078
|
+
onFocusedMonthChange: (next) => setAnchor(next),
|
|
2966
3079
|
value: range.value,
|
|
2967
3080
|
previewRange: range.previewRange,
|
|
2968
|
-
|
|
2969
|
-
isUnavailable: range.isUnavailable,
|
|
2970
|
-
weekendDays,
|
|
3081
|
+
onSelectDate: (date) => range.selectDate(date),
|
|
2971
3082
|
firstDayOfWeek,
|
|
2972
|
-
|
|
2973
|
-
|
|
3083
|
+
weekendDays,
|
|
3084
|
+
...props.minValue !== void 0 ? { minValue: props.minValue } : {},
|
|
3085
|
+
...props.maxValue !== void 0 ? { maxValue: props.maxValue } : {},
|
|
3086
|
+
...props.isDateUnavailable !== void 0 ? { isDateUnavailable: props.isDateUnavailable } : {},
|
|
2974
3087
|
...renderDay ? { renderDay } : {}
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
|
|
3088
|
+
}
|
|
3089
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3090
|
+
reactNative.View,
|
|
3091
|
+
{
|
|
3092
|
+
style: { flexDirection: "row", gap: MONTH_GAP, alignSelf: "center", width: gridsRowWidth },
|
|
3093
|
+
children: months.map((m) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3094
|
+
DayGrid,
|
|
3095
|
+
{
|
|
3096
|
+
visibleMonth: m,
|
|
3097
|
+
locale,
|
|
3098
|
+
mode: "range",
|
|
3099
|
+
value: range.value,
|
|
3100
|
+
previewRange: range.previewRange,
|
|
3101
|
+
focusedDate,
|
|
3102
|
+
isUnavailable: range.isUnavailable,
|
|
3103
|
+
weekendDays,
|
|
3104
|
+
firstDayOfWeek,
|
|
3105
|
+
onDayPress: (date) => range.selectDate(date),
|
|
3106
|
+
onDayHover: (date) => range.setHoveredDate(date),
|
|
3107
|
+
...renderDay ? { renderDay } : {}
|
|
3108
|
+
},
|
|
3109
|
+
`${m.year}-${m.month}`
|
|
3110
|
+
))
|
|
3111
|
+
}
|
|
3112
|
+
)),
|
|
2978
3113
|
view === "month" && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { alignItems: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2979
3114
|
MonthGrid,
|
|
2980
3115
|
{
|