@nori-ui/core 1.5.0 → 1.7.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/Table.shared-BymRgTnY.d.cts +54 -0
- package/dist/Table.shared-BymRgTnY.d.ts +54 -0
- package/dist/{chunk-7UKRN73P.js → chunk-2XJCLPNH.js} +3 -3
- package/dist/{chunk-7UKRN73P.js.map → chunk-2XJCLPNH.js.map} +1 -1
- package/dist/{chunk-76FZF4GM.js → chunk-3B345SQU.js} +8 -125
- package/dist/chunk-3B345SQU.js.map +1 -0
- package/dist/{chunk-WOF67PKT.js → chunk-3CEJ5TB4.js} +3 -3
- package/dist/{chunk-WOF67PKT.js.map → chunk-3CEJ5TB4.js.map} +1 -1
- package/dist/{chunk-JSAG5YO7.js → chunk-3IIIHZHT.js} +3 -3
- package/dist/{chunk-JSAG5YO7.js.map → chunk-3IIIHZHT.js.map} +1 -1
- package/dist/{chunk-46OT4PA6.js → chunk-3W3XYULK.js} +3 -3
- package/dist/{chunk-46OT4PA6.js.map → chunk-3W3XYULK.js.map} +1 -1
- package/dist/{chunk-6PO2IWB3.js → chunk-4UFAZLSZ.js} +5 -3
- package/dist/chunk-4UFAZLSZ.js.map +1 -0
- package/dist/chunk-5YHT252H.js +145 -0
- package/dist/chunk-5YHT252H.js.map +1 -0
- package/dist/chunk-73CUV7MW.js +125 -0
- package/dist/chunk-73CUV7MW.js.map +1 -0
- package/dist/{chunk-ZMSIYLSI.js → chunk-7FSFJA33.js} +3 -3
- package/dist/{chunk-ZMSIYLSI.js.map → chunk-7FSFJA33.js.map} +1 -1
- package/dist/chunk-C32XGHWO.js +202 -0
- package/dist/chunk-C32XGHWO.js.map +1 -0
- package/dist/{chunk-UUXWRDWW.js → chunk-C5HQPXRI.js} +3 -3
- package/dist/{chunk-UUXWRDWW.js.map → chunk-C5HQPXRI.js.map} +1 -1
- package/dist/{chunk-2UXKXUX2.js → chunk-CPIKN4BX.js} +3 -3
- package/dist/{chunk-2UXKXUX2.js.map → chunk-CPIKN4BX.js.map} +1 -1
- package/dist/{chunk-GELLSU64.js → chunk-EN4CLDGZ.js} +3 -3
- package/dist/{chunk-GELLSU64.js.map → chunk-EN4CLDGZ.js.map} +1 -1
- package/dist/{chunk-WAKKQROH.js → chunk-F5UKI7XD.js} +3 -3
- package/dist/{chunk-WAKKQROH.js.map → chunk-F5UKI7XD.js.map} +1 -1
- package/dist/{chunk-MJ4AGXS7.js → chunk-GJMHNEQ3.js} +3 -3
- package/dist/{chunk-MJ4AGXS7.js.map → chunk-GJMHNEQ3.js.map} +1 -1
- package/dist/chunk-GTAXVTLF.js +43 -0
- package/dist/chunk-GTAXVTLF.js.map +1 -0
- package/dist/{chunk-WTNDPO2V.js → chunk-H2LHWJ52.js} +3 -3
- package/dist/{chunk-WTNDPO2V.js.map → chunk-H2LHWJ52.js.map} +1 -1
- package/dist/{chunk-L5X4SYJ4.js → chunk-HXCETKCC.js} +3 -3
- package/dist/{chunk-L5X4SYJ4.js.map → chunk-HXCETKCC.js.map} +1 -1
- package/dist/chunk-IGBXSBF7.js +71 -0
- package/dist/chunk-IGBXSBF7.js.map +1 -0
- package/dist/{chunk-O4NMS3KB.js → chunk-IIVTPN62.js} +3 -3
- package/dist/{chunk-O4NMS3KB.js.map → chunk-IIVTPN62.js.map} +1 -1
- package/dist/{chunk-RM5TSXVE.js → chunk-ISCJST4P.js} +3 -3
- package/dist/{chunk-RM5TSXVE.js.map → chunk-ISCJST4P.js.map} +1 -1
- package/dist/{chunk-UF5OENHV.js → chunk-IWM2XDXH.js} +3 -3
- package/dist/{chunk-UF5OENHV.js.map → chunk-IWM2XDXH.js.map} +1 -1
- package/dist/chunk-J5LK2XHE.js +118 -0
- package/dist/chunk-J5LK2XHE.js.map +1 -0
- package/dist/chunk-KFFGDET3.js +27 -0
- package/dist/chunk-KFFGDET3.js.map +1 -0
- package/dist/{chunk-AFQIK6JI.js → chunk-L6VYDM7S.js} +3 -3
- package/dist/{chunk-AFQIK6JI.js.map → chunk-L6VYDM7S.js.map} +1 -1
- package/dist/chunk-M4BI63P6.js +188 -0
- package/dist/chunk-M4BI63P6.js.map +1 -0
- package/dist/{chunk-H7MFAFV4.js → chunk-MK57AOTI.js} +4 -4
- package/dist/{chunk-H7MFAFV4.js.map → chunk-MK57AOTI.js.map} +1 -1
- package/dist/{chunk-FDBQOQMW.js → chunk-MOAIQHR7.js} +3 -3
- package/dist/{chunk-FDBQOQMW.js.map → chunk-MOAIQHR7.js.map} +1 -1
- package/dist/{chunk-LWQZ257T.js → chunk-MYBBBLYE.js} +3 -3
- package/dist/{chunk-LWQZ257T.js.map → chunk-MYBBBLYE.js.map} +1 -1
- package/dist/{chunk-F7G6R373.js → chunk-O6M3F7BZ.js} +5 -5
- package/dist/{chunk-F7G6R373.js.map → chunk-O6M3F7BZ.js.map} +1 -1
- package/dist/{chunk-XP55RZ3D.js → chunk-OELY6K44.js} +3 -3
- package/dist/{chunk-XP55RZ3D.js.map → chunk-OELY6K44.js.map} +1 -1
- package/dist/{chunk-GRDVE3IR.js → chunk-OIHX5B4R.js} +3 -3
- package/dist/{chunk-GRDVE3IR.js.map → chunk-OIHX5B4R.js.map} +1 -1
- package/dist/{chunk-4I37QSEM.js → chunk-PGYEIXCO.js} +5 -5
- package/dist/{chunk-4I37QSEM.js.map → chunk-PGYEIXCO.js.map} +1 -1
- package/dist/{chunk-UJ5KFRDE.js → chunk-PJTCO76H.js} +3 -3
- package/dist/{chunk-UJ5KFRDE.js.map → chunk-PJTCO76H.js.map} +1 -1
- package/dist/{chunk-6JVUVBZH.js → chunk-PJXVLE24.js} +5 -5
- package/dist/{chunk-6JVUVBZH.js.map → chunk-PJXVLE24.js.map} +1 -1
- package/dist/{chunk-IGLMPAWE.js → chunk-PLQPBMG2.js} +3 -3
- package/dist/{chunk-IGLMPAWE.js.map → chunk-PLQPBMG2.js.map} +1 -1
- package/dist/{chunk-HTF6FDB6.js → chunk-PQW5LKAI.js} +3 -3
- package/dist/{chunk-HTF6FDB6.js.map → chunk-PQW5LKAI.js.map} +1 -1
- package/dist/{chunk-VMAGFYHG.js → chunk-RI4Y2C5U.js} +3 -3
- package/dist/{chunk-VMAGFYHG.js.map → chunk-RI4Y2C5U.js.map} +1 -1
- package/dist/{chunk-BNDUQNG7.js → chunk-SF6WPUC5.js} +3 -3
- package/dist/{chunk-BNDUQNG7.js.map → chunk-SF6WPUC5.js.map} +1 -1
- package/dist/{chunk-SINLREQV.js → chunk-STX5UKYT.js} +3 -3
- package/dist/{chunk-SINLREQV.js.map → chunk-STX5UKYT.js.map} +1 -1
- package/dist/{chunk-KCLWPSV5.js → chunk-TSWPHJIU.js} +4 -4
- package/dist/{chunk-KCLWPSV5.js.map → chunk-TSWPHJIU.js.map} +1 -1
- package/dist/{chunk-5BM6H2CD.js → chunk-U2ZKY2CP.js} +3 -3
- package/dist/{chunk-5BM6H2CD.js.map → chunk-U2ZKY2CP.js.map} +1 -1
- package/dist/{chunk-C6TRLHMW.js → chunk-UKDDK42K.js} +3 -3
- package/dist/{chunk-C6TRLHMW.js.map → chunk-UKDDK42K.js.map} +1 -1
- package/dist/{chunk-UPVNZPFV.js → chunk-USFXANEU.js} +3 -3
- package/dist/{chunk-UPVNZPFV.js.map → chunk-USFXANEU.js.map} +1 -1
- package/dist/{chunk-Y4ZRSW35.js → chunk-V5QSMDZL.js} +3 -3
- package/dist/{chunk-Y4ZRSW35.js.map → chunk-V5QSMDZL.js.map} +1 -1
- package/dist/{chunk-EFK7726V.js → chunk-V75O7QQO.js} +3 -3
- package/dist/{chunk-EFK7726V.js.map → chunk-V75O7QQO.js.map} +1 -1
- package/dist/{chunk-CGQIVFCN.js → chunk-VL2WNGPF.js} +3 -3
- package/dist/{chunk-CGQIVFCN.js.map → chunk-VL2WNGPF.js.map} +1 -1
- package/dist/{chunk-VCJF75T2.js → chunk-VLZANXRZ.js} +3 -3
- package/dist/{chunk-VCJF75T2.js.map → chunk-VLZANXRZ.js.map} +1 -1
- package/dist/{chunk-ND7MRYW7.js → chunk-VOF3S5I4.js} +4 -4
- package/dist/{chunk-ND7MRYW7.js.map → chunk-VOF3S5I4.js.map} +1 -1
- package/dist/chunk-VP7DRJUZ.js +3 -0
- package/dist/chunk-VP7DRJUZ.js.map +1 -0
- package/dist/chunk-XQNVWHMN.js +60 -0
- package/dist/chunk-XQNVWHMN.js.map +1 -0
- package/dist/{chunk-W3HMOOON.js → chunk-ZGFXKYA5.js} +3 -3
- package/dist/{chunk-W3HMOOON.js.map → chunk-ZGFXKYA5.js.map} +1 -1
- package/dist/client.cjs +935 -156
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +9 -0
- package/dist/client.d.ts +9 -0
- package/dist/client.js +57 -47
- 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/AspectRatio/index.cjs +67 -0
- package/dist/components/AspectRatio/index.cjs.map +1 -0
- package/dist/components/AspectRatio/index.d.cts +30 -0
- package/dist/components/AspectRatio/index.d.ts +30 -0
- package/dist/components/AspectRatio/index.js +5 -0
- package/dist/components/AspectRatio/index.js.map +1 -0
- 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 +3 -1
- 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/ButtonGroup/index.cjs +83 -0
- package/dist/components/ButtonGroup/index.cjs.map +1 -0
- package/dist/components/ButtonGroup/index.d.cts +45 -0
- package/dist/components/ButtonGroup/index.d.ts +45 -0
- package/dist/components/ButtonGroup/index.js +5 -0
- package/dist/components/ButtonGroup/index.js.map +1 -0
- package/dist/components/Calendar/index.cjs +3 -1
- 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.js +2 -2
- package/dist/components/Collapsible/index.cjs +512 -0
- package/dist/components/Collapsible/index.cjs.map +1 -0
- package/dist/components/Collapsible/index.d.cts +50 -0
- package/dist/components/Collapsible/index.d.ts +50 -0
- package/dist/components/Collapsible/index.js +7 -0
- package/dist/components/Collapsible/index.js.map +1 -0
- package/dist/components/Combobox/index.js +3 -3
- package/dist/components/ContextMenu/index.js +4 -4
- package/dist/components/DataTable/index.cjs +770 -0
- package/dist/components/DataTable/index.cjs.map +1 -0
- package/dist/components/DataTable/index.d.cts +53 -0
- package/dist/components/DataTable/index.d.ts +53 -0
- package/dist/components/DataTable/index.js +8 -0
- package/dist/components/DataTable/index.js.map +1 -0
- package/dist/components/DatePicker/index.cjs +3 -1
- package/dist/components/DatePicker/index.cjs.map +1 -1
- package/dist/components/DatePicker/index.js +7 -7
- package/dist/components/Dialog/index.js +2 -2
- package/dist/components/DropdownMenu/index.js +3 -3
- package/dist/components/Empty/index.cjs +385 -0
- package/dist/components/Empty/index.cjs.map +1 -0
- package/dist/components/Empty/index.d.cts +32 -0
- package/dist/components/Empty/index.d.ts +32 -0
- package/dist/components/Empty/index.js +7 -0
- package/dist/components/Empty/index.js.map +1 -0
- package/dist/components/Field/index.cjs +3 -1
- package/dist/components/Field/index.cjs.map +1 -1
- package/dist/components/Field/index.d.cts +2 -2
- package/dist/components/Field/index.d.ts +2 -2
- package/dist/components/Field/index.js +3 -3
- package/dist/components/FloatButton/index.cjs +3 -1
- 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.js +2 -2
- package/dist/components/Item/index.cjs +443 -0
- package/dist/components/Item/index.cjs.map +1 -0
- package/dist/components/Item/index.d.cts +40 -0
- package/dist/components/Item/index.d.ts +40 -0
- package/dist/components/Item/index.js +7 -0
- package/dist/components/Item/index.js.map +1 -0
- package/dist/components/Kbd/index.cjs +396 -0
- package/dist/components/Kbd/index.cjs.map +1 -0
- package/dist/components/Kbd/index.d.cts +22 -0
- package/dist/components/Kbd/index.d.ts +22 -0
- package/dist/components/Kbd/index.js +7 -0
- package/dist/components/Kbd/index.js.map +1 -0
- package/dist/components/Label/index.cjs +3 -1
- package/dist/components/Label/index.cjs.map +1 -1
- package/dist/components/Label/index.js +3 -3
- package/dist/components/Pagination/index.cjs +3 -1
- package/dist/components/Pagination/index.cjs.map +1 -1
- package/dist/components/Pagination/index.js +6 -5
- package/dist/components/Popover/index.js +2 -2
- package/dist/components/Progress/index.js +2 -2
- package/dist/components/Radio/index.js +2 -2
- package/dist/components/SegmentedControl/index.js +2 -2
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Separator/index.js +2 -2
- package/dist/components/Sheet/index.js +2 -2
- package/dist/components/Skeleton/index.js +2 -2
- package/dist/components/Slider/index.js +2 -2
- package/dist/components/Switch/index.js +2 -2
- package/dist/components/Table/index.cjs +461 -0
- package/dist/components/Table/index.cjs.map +1 -0
- package/dist/components/Table/index.d.cts +16 -0
- package/dist/components/Table/index.d.ts +16 -0
- package/dist/components/Table/index.js +7 -0
- package/dist/components/Table/index.js.map +1 -0
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Text/index.js +2 -2
- package/dist/components/TextArea/index.js +3 -3
- 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 +3 -1
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/index.cjs +935 -156
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +54 -44
- package/dist/slot/index.d.cts +2 -2
- package/dist/slot/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/chunk-6PO2IWB3.js.map +0 -1
- package/dist/chunk-76FZF4GM.js.map +0 -1
package/dist/client.cjs
CHANGED
|
@@ -88,7 +88,9 @@ var defaultDictionary = {
|
|
|
88
88
|
"switch.off": "Off",
|
|
89
89
|
// field
|
|
90
90
|
"field.requiredIndicator": "*",
|
|
91
|
-
"field.requiredLabel": "required"
|
|
91
|
+
"field.requiredLabel": "required",
|
|
92
|
+
// table / dataTable
|
|
93
|
+
"table.empty": "No data"
|
|
92
94
|
};
|
|
93
95
|
|
|
94
96
|
// src/i18n/resolve.ts
|
|
@@ -1803,6 +1805,24 @@ var AlertDialog = Object.assign(AlertDialogRoot, {
|
|
|
1803
1805
|
Action: AlertDialogAction,
|
|
1804
1806
|
Cancel: AlertDialogCancel
|
|
1805
1807
|
});
|
|
1808
|
+
var BASE_STYLE = {
|
|
1809
|
+
overflow: "hidden"
|
|
1810
|
+
};
|
|
1811
|
+
var AspectRatio = /* @__PURE__ */ __name(({ ratio, children, className, testID }) => {
|
|
1812
|
+
const containerStyle = {
|
|
1813
|
+
...BASE_STYLE,
|
|
1814
|
+
aspectRatio: ratio
|
|
1815
|
+
};
|
|
1816
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1817
|
+
reactNative.View,
|
|
1818
|
+
{
|
|
1819
|
+
...testID !== void 0 ? { testID } : {},
|
|
1820
|
+
className: cn("overflow-hidden", className),
|
|
1821
|
+
style: containerStyle,
|
|
1822
|
+
children
|
|
1823
|
+
}
|
|
1824
|
+
);
|
|
1825
|
+
}, "AspectRatio");
|
|
1806
1826
|
var SIZE_PX = {
|
|
1807
1827
|
sm: 32,
|
|
1808
1828
|
md: 40,
|
|
@@ -3528,7 +3548,7 @@ var SIZE_KEYS = {
|
|
|
3528
3548
|
md: { padX: "4", font: "md" },
|
|
3529
3549
|
lg: { padX: "5", font: "lg" }
|
|
3530
3550
|
};
|
|
3531
|
-
var
|
|
3551
|
+
var BASE_STYLE2 = {
|
|
3532
3552
|
flexDirection: "row",
|
|
3533
3553
|
alignItems: "center",
|
|
3534
3554
|
justifyContent: "center"
|
|
@@ -3619,7 +3639,7 @@ var Button = /* @__PURE__ */ __name(({
|
|
|
3619
3639
|
};
|
|
3620
3640
|
const sizeFontSize = px(colors.fontSize[sizeKeys.font]);
|
|
3621
3641
|
const inlineBase = [
|
|
3622
|
-
|
|
3642
|
+
BASE_STYLE2,
|
|
3623
3643
|
{ backgroundColor: stateBg },
|
|
3624
3644
|
sizeContainer,
|
|
3625
3645
|
{ opacity: isInoperative ? 0.6 : stateInteractionOpacity }
|
|
@@ -3699,6 +3719,39 @@ var Button = /* @__PURE__ */ __name(({
|
|
|
3699
3719
|
}
|
|
3700
3720
|
);
|
|
3701
3721
|
}, "Button");
|
|
3722
|
+
var ButtonGroup = /* @__PURE__ */ __name(({ children, orientation = "horizontal", size, className, testID }) => {
|
|
3723
|
+
const isHorizontal = orientation === "horizontal";
|
|
3724
|
+
const containerStyle = {
|
|
3725
|
+
flexDirection: isHorizontal ? "row" : "column",
|
|
3726
|
+
// gap: 0 so buttons touch; shared-border effect comes from CSS on web
|
|
3727
|
+
// and from touching edges on native.
|
|
3728
|
+
gap: 0,
|
|
3729
|
+
alignSelf: "flex-start",
|
|
3730
|
+
overflow: "hidden"
|
|
3731
|
+
};
|
|
3732
|
+
const childArray = React.Children.toArray(children).filter(React.isValidElement);
|
|
3733
|
+
const total = childArray.length;
|
|
3734
|
+
const clonedChildren = childArray.map((child, index) => {
|
|
3735
|
+
const position = index === 0 ? "first" : index === total - 1 ? "last" : "middle";
|
|
3736
|
+
const extraProps = {
|
|
3737
|
+
"data-position": position,
|
|
3738
|
+
"data-group-orientation": orientation
|
|
3739
|
+
};
|
|
3740
|
+
if (size !== void 0) {
|
|
3741
|
+
extraProps["data-group-size"] = size;
|
|
3742
|
+
}
|
|
3743
|
+
return React.cloneElement(child, extraProps);
|
|
3744
|
+
});
|
|
3745
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3746
|
+
reactNative.View,
|
|
3747
|
+
{
|
|
3748
|
+
...testID !== void 0 ? { testID } : {},
|
|
3749
|
+
className: cn(isHorizontal ? "flex-row" : "flex-col", "self-start overflow-hidden", className),
|
|
3750
|
+
style: containerStyle,
|
|
3751
|
+
children: clonedChildren
|
|
3752
|
+
}
|
|
3753
|
+
);
|
|
3754
|
+
}, "ButtonGroup");
|
|
3702
3755
|
|
|
3703
3756
|
// src/components/Calendar/scroll/ScrollBody.tsx
|
|
3704
3757
|
var ScrollBody = /* @__PURE__ */ __name((_props) => {
|
|
@@ -6611,6 +6664,182 @@ var Checkbox = /* @__PURE__ */ __name(({
|
|
|
6611
6664
|
}
|
|
6612
6665
|
);
|
|
6613
6666
|
}, "Checkbox");
|
|
6667
|
+
var CollapsibleContext = React.createContext(null);
|
|
6668
|
+
var useCollapsibleContext = /* @__PURE__ */ __name((label) => {
|
|
6669
|
+
const ctx = React.useContext(CollapsibleContext);
|
|
6670
|
+
if (!ctx) {
|
|
6671
|
+
throw new Error(`<${label}> must be rendered inside a <Collapsible>.`);
|
|
6672
|
+
}
|
|
6673
|
+
return ctx;
|
|
6674
|
+
}, "useCollapsibleContext");
|
|
6675
|
+
var CollapsibleRoot = /* @__PURE__ */ __name(({
|
|
6676
|
+
open: controlledOpen,
|
|
6677
|
+
defaultOpen = false,
|
|
6678
|
+
onOpenChange,
|
|
6679
|
+
children,
|
|
6680
|
+
className,
|
|
6681
|
+
testID
|
|
6682
|
+
}) => {
|
|
6683
|
+
const baseId = React.useId();
|
|
6684
|
+
const [innerOpen, setInnerOpen] = React.useState(defaultOpen);
|
|
6685
|
+
const isControlled = controlledOpen !== void 0;
|
|
6686
|
+
const open = isControlled ? controlledOpen : innerOpen;
|
|
6687
|
+
const toggle = React.useCallback(() => {
|
|
6688
|
+
const next = !open;
|
|
6689
|
+
if (!isControlled) {
|
|
6690
|
+
setInnerOpen(next);
|
|
6691
|
+
}
|
|
6692
|
+
onOpenChange?.(next);
|
|
6693
|
+
}, [open, isControlled, onOpenChange]);
|
|
6694
|
+
const ctx = React.useMemo(
|
|
6695
|
+
() => ({
|
|
6696
|
+
open,
|
|
6697
|
+
toggle,
|
|
6698
|
+
contentId: `${baseId}-content`,
|
|
6699
|
+
triggerId: `${baseId}-trigger`
|
|
6700
|
+
}),
|
|
6701
|
+
[open, toggle, baseId]
|
|
6702
|
+
);
|
|
6703
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollapsibleContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6704
|
+
reactNative.View,
|
|
6705
|
+
{
|
|
6706
|
+
...testID !== void 0 ? { testID } : {},
|
|
6707
|
+
className: cn("flex-col", className),
|
|
6708
|
+
style: { flexDirection: "column" },
|
|
6709
|
+
children
|
|
6710
|
+
}
|
|
6711
|
+
) });
|
|
6712
|
+
}, "CollapsibleRoot");
|
|
6713
|
+
var CollapsibleTrigger = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
6714
|
+
const { open, toggle, contentId, triggerId } = useCollapsibleContext("Collapsible.Trigger");
|
|
6715
|
+
const colors = useThemeColors();
|
|
6716
|
+
const triggerStyle = {
|
|
6717
|
+
flexDirection: "row",
|
|
6718
|
+
alignItems: "center",
|
|
6719
|
+
paddingVertical: px(colors.spacing["2"]),
|
|
6720
|
+
paddingHorizontal: px(colors.spacing["1"])
|
|
6721
|
+
};
|
|
6722
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6723
|
+
reactNative.Pressable,
|
|
6724
|
+
{
|
|
6725
|
+
id: triggerId,
|
|
6726
|
+
...testID !== void 0 ? { testID } : {},
|
|
6727
|
+
role: "button",
|
|
6728
|
+
accessibilityRole: "button",
|
|
6729
|
+
"aria-expanded": open,
|
|
6730
|
+
"aria-controls": contentId,
|
|
6731
|
+
onPress: toggle,
|
|
6732
|
+
className: cn("flex-row items-center py-2 px-1", className),
|
|
6733
|
+
style: triggerStyle,
|
|
6734
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6735
|
+
reactNative.Text,
|
|
6736
|
+
{
|
|
6737
|
+
style: {
|
|
6738
|
+
color: colors.semantic.text.default,
|
|
6739
|
+
fontFamily: colors.fontFamily.body,
|
|
6740
|
+
fontSize: px(colors.fontSize.sm),
|
|
6741
|
+
fontWeight: colors.fontWeight.medium
|
|
6742
|
+
},
|
|
6743
|
+
children
|
|
6744
|
+
}
|
|
6745
|
+
) : children
|
|
6746
|
+
}
|
|
6747
|
+
);
|
|
6748
|
+
}, "CollapsibleTrigger");
|
|
6749
|
+
var CollapsibleContent = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
6750
|
+
const { open, contentId, triggerId } = useCollapsibleContext("Collapsible.Content");
|
|
6751
|
+
const wrapperRef = React.useRef(null);
|
|
6752
|
+
const innerRef = React.useRef(null);
|
|
6753
|
+
React.useEffect(() => {
|
|
6754
|
+
if (reactNative.Platform.OS !== "web") {
|
|
6755
|
+
return;
|
|
6756
|
+
}
|
|
6757
|
+
const wrapper = wrapperRef.current;
|
|
6758
|
+
const inner = innerRef.current;
|
|
6759
|
+
if (!wrapper || !inner) {
|
|
6760
|
+
return;
|
|
6761
|
+
}
|
|
6762
|
+
const isFirstPaint = wrapper.dataset.noriPainted !== "1";
|
|
6763
|
+
wrapper.dataset.noriPainted = "1";
|
|
6764
|
+
wrapper.style.overflow = "hidden";
|
|
6765
|
+
wrapper.style.transitionProperty = "max-height, opacity";
|
|
6766
|
+
wrapper.style.transitionDuration = "200ms";
|
|
6767
|
+
wrapper.style.transitionTimingFunction = "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
6768
|
+
if (open) {
|
|
6769
|
+
const target = inner.scrollHeight;
|
|
6770
|
+
if (isFirstPaint) {
|
|
6771
|
+
wrapper.style.maxHeight = `${target}px`;
|
|
6772
|
+
wrapper.style.opacity = "1";
|
|
6773
|
+
return;
|
|
6774
|
+
}
|
|
6775
|
+
wrapper.style.maxHeight = "0px";
|
|
6776
|
+
wrapper.style.opacity = "0";
|
|
6777
|
+
void wrapper.offsetHeight;
|
|
6778
|
+
requestAnimationFrame(() => {
|
|
6779
|
+
wrapper.style.maxHeight = `${target}px`;
|
|
6780
|
+
wrapper.style.opacity = "1";
|
|
6781
|
+
});
|
|
6782
|
+
} else {
|
|
6783
|
+
if (isFirstPaint) {
|
|
6784
|
+
wrapper.style.maxHeight = "0px";
|
|
6785
|
+
wrapper.style.opacity = "0";
|
|
6786
|
+
return;
|
|
6787
|
+
}
|
|
6788
|
+
const current = inner.scrollHeight;
|
|
6789
|
+
wrapper.style.maxHeight = `${current}px`;
|
|
6790
|
+
wrapper.style.opacity = "1";
|
|
6791
|
+
void wrapper.offsetHeight;
|
|
6792
|
+
requestAnimationFrame(() => {
|
|
6793
|
+
wrapper.style.maxHeight = "0px";
|
|
6794
|
+
wrapper.style.opacity = "0";
|
|
6795
|
+
});
|
|
6796
|
+
}
|
|
6797
|
+
}, [open]);
|
|
6798
|
+
if (reactNative.Platform.OS !== "web") {
|
|
6799
|
+
if (!open) {
|
|
6800
|
+
return null;
|
|
6801
|
+
}
|
|
6802
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6803
|
+
reactNative.View,
|
|
6804
|
+
{
|
|
6805
|
+
...testID !== void 0 ? { testID } : {},
|
|
6806
|
+
id: contentId,
|
|
6807
|
+
"aria-labelledby": triggerId,
|
|
6808
|
+
className: cn("flex-col", className),
|
|
6809
|
+
style: { flexDirection: "column" },
|
|
6810
|
+
children
|
|
6811
|
+
}
|
|
6812
|
+
);
|
|
6813
|
+
}
|
|
6814
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6815
|
+
reactNative.View,
|
|
6816
|
+
{
|
|
6817
|
+
ref: (node) => {
|
|
6818
|
+
wrapperRef.current = node;
|
|
6819
|
+
},
|
|
6820
|
+
...testID !== void 0 ? { testID } : {},
|
|
6821
|
+
id: contentId,
|
|
6822
|
+
"aria-labelledby": triggerId,
|
|
6823
|
+
"aria-hidden": !open,
|
|
6824
|
+
className: cn("overflow-hidden", className),
|
|
6825
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6826
|
+
reactNative.View,
|
|
6827
|
+
{
|
|
6828
|
+
ref: (node) => {
|
|
6829
|
+
innerRef.current = node;
|
|
6830
|
+
},
|
|
6831
|
+
className: "flex-col",
|
|
6832
|
+
style: { flexDirection: "column" },
|
|
6833
|
+
children
|
|
6834
|
+
}
|
|
6835
|
+
)
|
|
6836
|
+
}
|
|
6837
|
+
);
|
|
6838
|
+
}, "CollapsibleContent");
|
|
6839
|
+
var Collapsible = Object.assign(CollapsibleRoot, {
|
|
6840
|
+
Trigger: CollapsibleTrigger,
|
|
6841
|
+
Content: CollapsibleContent
|
|
6842
|
+
});
|
|
6614
6843
|
var Combobox = /* @__PURE__ */ __name((props) => {
|
|
6615
6844
|
return /* @__PURE__ */ jsxRuntime.jsx(Select, { searchable: true, ...props });
|
|
6616
6845
|
}, "Combobox");
|
|
@@ -7025,45 +7254,489 @@ var ContextMenu = Object.assign(ContextMenuRoot, {
|
|
|
7025
7254
|
Separator: MenuSeparator,
|
|
7026
7255
|
Label: MenuLabel
|
|
7027
7256
|
});
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
return
|
|
7031
|
-
} catch {
|
|
7032
|
-
return `${date$1.year}-${String(date$1.month).padStart(2, "0")}-${String(date$1.day).padStart(2, "0")}`;
|
|
7257
|
+
var range = /* @__PURE__ */ __name((from, to) => {
|
|
7258
|
+
if (to < from) {
|
|
7259
|
+
return [];
|
|
7033
7260
|
}
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7261
|
+
const out = new Array(to - from + 1);
|
|
7262
|
+
for (let i = 0; i < out.length; i += 1) {
|
|
7263
|
+
out[i] = from + i;
|
|
7264
|
+
}
|
|
7265
|
+
return out;
|
|
7266
|
+
}, "range");
|
|
7267
|
+
function usePagination(args) {
|
|
7268
|
+
const {
|
|
7269
|
+
page: controlledPage,
|
|
7270
|
+
defaultPage = 1,
|
|
7271
|
+
pageCount,
|
|
7272
|
+
siblingCount = 1,
|
|
7273
|
+
boundaryCount = 1,
|
|
7274
|
+
showFirstLast = false,
|
|
7275
|
+
showPrevNext = true,
|
|
7276
|
+
onPageChange
|
|
7277
|
+
} = args;
|
|
7278
|
+
const isControlled = controlledPage !== void 0;
|
|
7279
|
+
const [uncontrolledPage, setUncontrolledPage] = React.useState(defaultPage);
|
|
7280
|
+
const onChangeRef = React.useRef(onPageChange);
|
|
7281
|
+
onChangeRef.current = onPageChange;
|
|
7282
|
+
const safePageCount = Math.max(1, Math.floor(pageCount));
|
|
7283
|
+
const rawPage = isControlled ? controlledPage : uncontrolledPage;
|
|
7284
|
+
const currentPage = Math.min(Math.max(1, Math.floor(rawPage)), safePageCount);
|
|
7285
|
+
const goToPage = React.useCallback(
|
|
7286
|
+
(next2) => {
|
|
7287
|
+
const clamped = Math.min(Math.max(1, Math.floor(next2)), Math.max(1, Math.floor(pageCount)));
|
|
7288
|
+
if (!isControlled) {
|
|
7289
|
+
setUncontrolledPage(clamped);
|
|
7052
7290
|
}
|
|
7291
|
+
onChangeRef.current?.(clamped);
|
|
7292
|
+
},
|
|
7293
|
+
[isControlled, pageCount]
|
|
7294
|
+
);
|
|
7295
|
+
const prev = React.useCallback(() => goToPage(currentPage - 1), [goToPage, currentPage]);
|
|
7296
|
+
const next = React.useCallback(() => goToPage(currentPage + 1), [goToPage, currentPage]);
|
|
7297
|
+
const first = React.useCallback(() => goToPage(1), [goToPage]);
|
|
7298
|
+
const last = React.useCallback(() => goToPage(safePageCount), [goToPage, safePageCount]);
|
|
7299
|
+
const pages = React.useMemo(() => {
|
|
7300
|
+
const items = [];
|
|
7301
|
+
const safeSibling = Math.max(0, Math.floor(siblingCount));
|
|
7302
|
+
const safeBoundary = Math.max(0, Math.floor(boundaryCount));
|
|
7303
|
+
if (showFirstLast) {
|
|
7304
|
+
items.push({ type: "first", disabled: currentPage <= 1 });
|
|
7305
|
+
}
|
|
7306
|
+
if (showPrevNext) {
|
|
7307
|
+
items.push({ type: "prev", disabled: currentPage <= 1 });
|
|
7308
|
+
}
|
|
7309
|
+
const startPages = range(1, Math.min(safeBoundary, safePageCount));
|
|
7310
|
+
const endPages = range(Math.max(safePageCount - safeBoundary + 1, safeBoundary + 1), safePageCount);
|
|
7311
|
+
const siblingsStart = Math.max(
|
|
7312
|
+
Math.min(currentPage - safeSibling, safePageCount - safeBoundary - safeSibling * 2 - 1),
|
|
7313
|
+
safeBoundary + 2
|
|
7053
7314
|
);
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7315
|
+
const siblingsEnd = Math.min(
|
|
7316
|
+
Math.max(currentPage + safeSibling, safeBoundary + safeSibling * 2 + 2),
|
|
7317
|
+
endPages.length > 0 ? endPages[0] - 2 : safePageCount - 1
|
|
7318
|
+
);
|
|
7319
|
+
const middle = [];
|
|
7320
|
+
if (siblingsStart > safeBoundary + 2) {
|
|
7321
|
+
middle.push("ellipsis");
|
|
7322
|
+
} else if (safeBoundary + 1 < safePageCount - safeBoundary) {
|
|
7323
|
+
middle.push(safeBoundary + 1);
|
|
7063
7324
|
}
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7325
|
+
for (const p of range(siblingsStart, siblingsEnd)) {
|
|
7326
|
+
middle.push(p);
|
|
7327
|
+
}
|
|
7328
|
+
if (siblingsEnd < safePageCount - safeBoundary - 1) {
|
|
7329
|
+
middle.push("ellipsis");
|
|
7330
|
+
} else if (safePageCount - safeBoundary > safeBoundary) {
|
|
7331
|
+
middle.push(safePageCount - safeBoundary);
|
|
7332
|
+
}
|
|
7333
|
+
const seen = /* @__PURE__ */ new Set();
|
|
7334
|
+
const pushPage = /* @__PURE__ */ __name((n) => {
|
|
7335
|
+
if (n < 1 || n > safePageCount || seen.has(n)) {
|
|
7336
|
+
return;
|
|
7337
|
+
}
|
|
7338
|
+
seen.add(n);
|
|
7339
|
+
items.push({ type: "page", page: n, selected: n === currentPage });
|
|
7340
|
+
}, "pushPage");
|
|
7341
|
+
for (const n of startPages) {
|
|
7342
|
+
pushPage(n);
|
|
7343
|
+
}
|
|
7344
|
+
for (const m of middle) {
|
|
7345
|
+
if (m === "ellipsis") {
|
|
7346
|
+
items.push({ type: "ellipsis" });
|
|
7347
|
+
} else {
|
|
7348
|
+
pushPage(m);
|
|
7349
|
+
}
|
|
7350
|
+
}
|
|
7351
|
+
for (const n of endPages) {
|
|
7352
|
+
pushPage(n);
|
|
7353
|
+
}
|
|
7354
|
+
if (showPrevNext) {
|
|
7355
|
+
items.push({ type: "next", disabled: currentPage >= safePageCount });
|
|
7356
|
+
}
|
|
7357
|
+
if (showFirstLast) {
|
|
7358
|
+
items.push({ type: "last", disabled: currentPage >= safePageCount });
|
|
7359
|
+
}
|
|
7360
|
+
return items;
|
|
7361
|
+
}, [currentPage, safePageCount, siblingCount, boundaryCount, showFirstLast, showPrevNext]);
|
|
7362
|
+
return {
|
|
7363
|
+
page: currentPage,
|
|
7364
|
+
pages,
|
|
7365
|
+
canPrev: currentPage > 1,
|
|
7366
|
+
canNext: currentPage < safePageCount,
|
|
7367
|
+
goToPage,
|
|
7368
|
+
prev,
|
|
7369
|
+
next,
|
|
7370
|
+
first,
|
|
7371
|
+
last
|
|
7372
|
+
};
|
|
7373
|
+
}
|
|
7374
|
+
__name(usePagination, "usePagination");
|
|
7375
|
+
var TableContext = React.createContext({
|
|
7376
|
+
striped: false,
|
|
7377
|
+
compact: false,
|
|
7378
|
+
bordered: false,
|
|
7379
|
+
rowIndex: 0,
|
|
7380
|
+
setRowIndex: /* @__PURE__ */ __name(() => {
|
|
7381
|
+
}, "setRowIndex")
|
|
7382
|
+
});
|
|
7383
|
+
function buildTableCompound(parts) {
|
|
7384
|
+
return Object.assign(parts.Root, {
|
|
7385
|
+
Header: parts.Header,
|
|
7386
|
+
Body: parts.Body,
|
|
7387
|
+
Footer: parts.Footer,
|
|
7388
|
+
Row: parts.Row,
|
|
7389
|
+
HeaderCell: parts.HeaderCell,
|
|
7390
|
+
Cell: parts.Cell,
|
|
7391
|
+
Caption: parts.Caption
|
|
7392
|
+
});
|
|
7393
|
+
}
|
|
7394
|
+
__name(buildTableCompound, "buildTableCompound");
|
|
7395
|
+
var TableRoot = /* @__PURE__ */ __name(({ striped = false, compact = false, bordered = false, children, className, testID }) => {
|
|
7396
|
+
const [rowIndex, setRowIndex] = React.useState(0);
|
|
7397
|
+
const ctxValue = {
|
|
7398
|
+
striped,
|
|
7399
|
+
compact,
|
|
7400
|
+
bordered,
|
|
7401
|
+
rowIndex,
|
|
7402
|
+
setRowIndex
|
|
7403
|
+
};
|
|
7404
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full overflow-auto", className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7405
|
+
"table",
|
|
7406
|
+
{
|
|
7407
|
+
className: cn(
|
|
7408
|
+
"w-full caption-bottom text-sm",
|
|
7409
|
+
bordered && "border border-semantic-border-default",
|
|
7410
|
+
className
|
|
7411
|
+
),
|
|
7412
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
7413
|
+
children
|
|
7414
|
+
}
|
|
7415
|
+
) }) });
|
|
7416
|
+
}, "TableRoot");
|
|
7417
|
+
var TableHeader = /* @__PURE__ */ __name(({ children, className, testID }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7418
|
+
"thead",
|
|
7419
|
+
{
|
|
7420
|
+
className: cn("[&_tr]:border-b [&_tr]:border-semantic-border-default", className),
|
|
7421
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
7422
|
+
children
|
|
7423
|
+
}
|
|
7424
|
+
), "TableHeader");
|
|
7425
|
+
var TableBody = /* @__PURE__ */ __name(({ children, className, testID }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7426
|
+
"tbody",
|
|
7427
|
+
{
|
|
7428
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
7429
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
7430
|
+
children
|
|
7431
|
+
}
|
|
7432
|
+
), "TableBody");
|
|
7433
|
+
var TableFooter = /* @__PURE__ */ __name(({ children, className, testID }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7434
|
+
"tfoot",
|
|
7435
|
+
{
|
|
7436
|
+
className: cn("border-t border-semantic-border-default font-medium", className),
|
|
7437
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
7438
|
+
children
|
|
7439
|
+
}
|
|
7440
|
+
), "TableFooter");
|
|
7441
|
+
var TableRow = /* @__PURE__ */ __name(({ selected = false, onPress, children, className, testID }) => {
|
|
7442
|
+
const colors = useThemeColors();
|
|
7443
|
+
const handleClick = React.useCallback(() => {
|
|
7444
|
+
onPress?.();
|
|
7445
|
+
}, [onPress]);
|
|
7446
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7447
|
+
"tr",
|
|
7448
|
+
{
|
|
7449
|
+
className: cn(
|
|
7450
|
+
"border-b border-semantic-border-default transition-colors",
|
|
7451
|
+
onPress && "cursor-pointer hover:bg-semantic-background-subtle",
|
|
7452
|
+
selected && "bg-semantic-background-subtle",
|
|
7453
|
+
className
|
|
7454
|
+
),
|
|
7455
|
+
style: selected ? { backgroundColor: colors.semantic.background.subtle } : void 0,
|
|
7456
|
+
onClick: onPress ? handleClick : void 0,
|
|
7457
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
7458
|
+
children
|
|
7459
|
+
}
|
|
7460
|
+
);
|
|
7461
|
+
}, "TableRow");
|
|
7462
|
+
var TableHeaderCell = /* @__PURE__ */ __name(({ align = "left", colSpan, children, className, testID }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7463
|
+
"th",
|
|
7464
|
+
{
|
|
7465
|
+
className: cn(
|
|
7466
|
+
"h-10 px-4 font-medium text-semantic-text-secondary",
|
|
7467
|
+
align === "right" && "text-right",
|
|
7468
|
+
align === "center" && "text-center",
|
|
7469
|
+
align === "left" && "text-left",
|
|
7470
|
+
className
|
|
7471
|
+
),
|
|
7472
|
+
colSpan,
|
|
7473
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
7474
|
+
children
|
|
7475
|
+
}
|
|
7476
|
+
), "TableHeaderCell");
|
|
7477
|
+
var TableCell = /* @__PURE__ */ __name(({ align = "left", colSpan, children, className, testID }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7478
|
+
"td",
|
|
7479
|
+
{
|
|
7480
|
+
className: cn(
|
|
7481
|
+
"p-4 align-middle",
|
|
7482
|
+
align === "right" && "text-right",
|
|
7483
|
+
align === "center" && "text-center",
|
|
7484
|
+
align === "left" && "text-left",
|
|
7485
|
+
className
|
|
7486
|
+
),
|
|
7487
|
+
colSpan,
|
|
7488
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
7489
|
+
children
|
|
7490
|
+
}
|
|
7491
|
+
), "TableCell");
|
|
7492
|
+
var TableCaption = /* @__PURE__ */ __name(({ children, className, testID }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7493
|
+
"caption",
|
|
7494
|
+
{
|
|
7495
|
+
className: cn("mt-4 text-sm text-semantic-text-secondary", className),
|
|
7496
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
7497
|
+
children
|
|
7498
|
+
}
|
|
7499
|
+
), "TableCaption");
|
|
7500
|
+
var Table = buildTableCompound({
|
|
7501
|
+
Root: TableRoot,
|
|
7502
|
+
Header: TableHeader,
|
|
7503
|
+
Body: TableBody,
|
|
7504
|
+
Footer: TableFooter,
|
|
7505
|
+
Row: TableRow,
|
|
7506
|
+
HeaderCell: TableHeaderCell,
|
|
7507
|
+
Cell: TableCell,
|
|
7508
|
+
Caption: TableCaption
|
|
7509
|
+
});
|
|
7510
|
+
function sortData(data, sort) {
|
|
7511
|
+
if (!sort) {
|
|
7512
|
+
return data;
|
|
7513
|
+
}
|
|
7514
|
+
const key = sort.id;
|
|
7515
|
+
return [...data].sort((a, b) => {
|
|
7516
|
+
const av = a[key];
|
|
7517
|
+
const bv = b[key];
|
|
7518
|
+
if (av == null && bv == null) {
|
|
7519
|
+
return 0;
|
|
7520
|
+
}
|
|
7521
|
+
if (av == null) {
|
|
7522
|
+
return 1;
|
|
7523
|
+
}
|
|
7524
|
+
if (bv == null) {
|
|
7525
|
+
return -1;
|
|
7526
|
+
}
|
|
7527
|
+
const cmp2 = av < bv ? -1 : av > bv ? 1 : 0;
|
|
7528
|
+
return sort.direction === "asc" ? cmp2 : -cmp2;
|
|
7529
|
+
});
|
|
7530
|
+
}
|
|
7531
|
+
__name(sortData, "sortData");
|
|
7532
|
+
function SortIndicator({ direction }) {
|
|
7533
|
+
if (direction === void 0) {
|
|
7534
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { marginLeft: 4, opacity: 0.3 }, children: "\u21C5" });
|
|
7535
|
+
}
|
|
7536
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { marginLeft: 4 }, children: direction === "asc" ? "\u2191" : "\u2193" });
|
|
7537
|
+
}
|
|
7538
|
+
__name(SortIndicator, "SortIndicator");
|
|
7539
|
+
function DataTable({
|
|
7540
|
+
data,
|
|
7541
|
+
columns,
|
|
7542
|
+
pageSize = 10,
|
|
7543
|
+
defaultSort,
|
|
7544
|
+
onRowPress,
|
|
7545
|
+
emptyState,
|
|
7546
|
+
striped,
|
|
7547
|
+
compact,
|
|
7548
|
+
bordered,
|
|
7549
|
+
testID,
|
|
7550
|
+
className
|
|
7551
|
+
}) {
|
|
7552
|
+
const [sort, setSort] = React.useState(defaultSort ?? null);
|
|
7553
|
+
const sorted = React.useMemo(() => sortData(data, sort), [data, sort]);
|
|
7554
|
+
const pageCount = Math.max(1, Math.ceil(sorted.length / pageSize));
|
|
7555
|
+
const { page, goToPage, canPrev, canNext } = usePagination({ pageCount, defaultPage: 1 });
|
|
7556
|
+
const pageSlice = React.useMemo(() => {
|
|
7557
|
+
const start = (page - 1) * pageSize;
|
|
7558
|
+
return sorted.slice(start, start + pageSize);
|
|
7559
|
+
}, [sorted, page, pageSize]);
|
|
7560
|
+
const handleSort = /* @__PURE__ */ __name((colId) => {
|
|
7561
|
+
setSort((prev) => {
|
|
7562
|
+
if (prev?.id !== colId) {
|
|
7563
|
+
goToPage(1);
|
|
7564
|
+
return { id: colId, direction: "asc" };
|
|
7565
|
+
}
|
|
7566
|
+
if (prev.direction === "asc") {
|
|
7567
|
+
return { id: colId, direction: "desc" };
|
|
7568
|
+
}
|
|
7569
|
+
goToPage(1);
|
|
7570
|
+
return null;
|
|
7571
|
+
});
|
|
7572
|
+
}, "handleSort");
|
|
7573
|
+
const tableProps = {};
|
|
7574
|
+
if (striped !== void 0) {
|
|
7575
|
+
tableProps.striped = striped;
|
|
7576
|
+
}
|
|
7577
|
+
if (compact !== void 0) {
|
|
7578
|
+
tableProps.compact = compact;
|
|
7579
|
+
}
|
|
7580
|
+
if (bordered !== void 0) {
|
|
7581
|
+
tableProps.bordered = bordered;
|
|
7582
|
+
}
|
|
7583
|
+
if (testID !== void 0) {
|
|
7584
|
+
tableProps.testID = testID;
|
|
7585
|
+
}
|
|
7586
|
+
if (className !== void 0) {
|
|
7587
|
+
tableProps.className = className;
|
|
7588
|
+
}
|
|
7589
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: { width: "100%" }, children: [
|
|
7590
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Table, { ...tableProps, children: [
|
|
7591
|
+
/* @__PURE__ */ jsxRuntime.jsx(Table.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(Table.Row, { children: columns.map((col) => {
|
|
7592
|
+
const align = col.align;
|
|
7593
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Table.HeaderCell, { ...align !== void 0 ? { align } : {}, children: col.sortable ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7594
|
+
reactNative.Pressable,
|
|
7595
|
+
{
|
|
7596
|
+
accessibilityRole: "button",
|
|
7597
|
+
accessibilityLabel: `Sort by ${col.id}`,
|
|
7598
|
+
"aria-label": `Sort by ${col.id}`,
|
|
7599
|
+
onPress: () => handleSort(col.id),
|
|
7600
|
+
style: { flexDirection: "row", alignItems: "center" },
|
|
7601
|
+
children: [
|
|
7602
|
+
typeof col.header === "string" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { children: col.header }) : col.header,
|
|
7603
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7604
|
+
SortIndicator,
|
|
7605
|
+
{
|
|
7606
|
+
...sort?.id === col.id ? { direction: sort.direction } : {}
|
|
7607
|
+
}
|
|
7608
|
+
)
|
|
7609
|
+
]
|
|
7610
|
+
}
|
|
7611
|
+
) : col.header }, col.id);
|
|
7612
|
+
}) }) }),
|
|
7613
|
+
/* @__PURE__ */ jsxRuntime.jsx(Table.Body, { children: pageSlice.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(Table.Row, { children: /* @__PURE__ */ jsxRuntime.jsx(Table.Cell, { colSpan: columns.length, children: /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { children: emptyState ?? "No data" }) }) }) : pageSlice.map((row, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7614
|
+
Table.Row,
|
|
7615
|
+
{
|
|
7616
|
+
...onRowPress !== void 0 ? { onPress: /* @__PURE__ */ __name(() => onRowPress(row), "onPress") } : {},
|
|
7617
|
+
children: columns.map((col) => {
|
|
7618
|
+
const colAlign = col.align;
|
|
7619
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7620
|
+
Table.Cell,
|
|
7621
|
+
{
|
|
7622
|
+
...colAlign !== void 0 ? { align: colAlign } : {},
|
|
7623
|
+
children: col.cell(row)
|
|
7624
|
+
},
|
|
7625
|
+
col.id
|
|
7626
|
+
);
|
|
7627
|
+
})
|
|
7628
|
+
},
|
|
7629
|
+
i
|
|
7630
|
+
)) })
|
|
7631
|
+
] }),
|
|
7632
|
+
pageCount > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7633
|
+
PaginationControls,
|
|
7634
|
+
{
|
|
7635
|
+
page,
|
|
7636
|
+
pageCount,
|
|
7637
|
+
canPrev,
|
|
7638
|
+
canNext,
|
|
7639
|
+
goToPage
|
|
7640
|
+
}
|
|
7641
|
+
)
|
|
7642
|
+
] });
|
|
7643
|
+
}
|
|
7644
|
+
__name(DataTable, "DataTable");
|
|
7645
|
+
function EmptyState({ children }) {
|
|
7646
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { paddingVertical: 32, alignItems: "center" }, children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: "#888", fontSize: 14 }, children }) : children });
|
|
7647
|
+
}
|
|
7648
|
+
__name(EmptyState, "EmptyState");
|
|
7649
|
+
function PaginationControls({
|
|
7650
|
+
page,
|
|
7651
|
+
pageCount,
|
|
7652
|
+
canPrev,
|
|
7653
|
+
canNext,
|
|
7654
|
+
goToPage
|
|
7655
|
+
}) {
|
|
7656
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7657
|
+
reactNative.View,
|
|
7658
|
+
{
|
|
7659
|
+
style: {
|
|
7660
|
+
flexDirection: "row",
|
|
7661
|
+
justifyContent: "flex-end",
|
|
7662
|
+
alignItems: "center",
|
|
7663
|
+
paddingVertical: 8,
|
|
7664
|
+
gap: 8
|
|
7665
|
+
},
|
|
7666
|
+
children: [
|
|
7667
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7668
|
+
reactNative.Pressable,
|
|
7669
|
+
{
|
|
7670
|
+
onPress: canPrev ? () => goToPage(page - 1) : void 0,
|
|
7671
|
+
accessibilityRole: "button",
|
|
7672
|
+
accessibilityLabel: "Previous page",
|
|
7673
|
+
"aria-label": "Previous page",
|
|
7674
|
+
"aria-disabled": !canPrev,
|
|
7675
|
+
style: { opacity: canPrev ? 1 : 0.4, paddingHorizontal: 8 },
|
|
7676
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { fontSize: 14 }, children: "\u2039 Prev" })
|
|
7677
|
+
}
|
|
7678
|
+
),
|
|
7679
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: { fontSize: 14 }, "aria-live": "polite", children: [
|
|
7680
|
+
page,
|
|
7681
|
+
" / ",
|
|
7682
|
+
pageCount
|
|
7683
|
+
] }),
|
|
7684
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7685
|
+
reactNative.Pressable,
|
|
7686
|
+
{
|
|
7687
|
+
onPress: canNext ? () => goToPage(page + 1) : void 0,
|
|
7688
|
+
accessibilityRole: "button",
|
|
7689
|
+
accessibilityLabel: "Next page",
|
|
7690
|
+
"aria-label": "Next page",
|
|
7691
|
+
"aria-disabled": !canNext,
|
|
7692
|
+
style: { opacity: canNext ? 1 : 0.4, paddingHorizontal: 8 },
|
|
7693
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { fontSize: 14 }, children: "Next \u203A" })
|
|
7694
|
+
}
|
|
7695
|
+
)
|
|
7696
|
+
]
|
|
7697
|
+
}
|
|
7698
|
+
);
|
|
7699
|
+
}
|
|
7700
|
+
__name(PaginationControls, "PaginationControls");
|
|
7701
|
+
function formatDate(date$1, locale) {
|
|
7702
|
+
try {
|
|
7703
|
+
return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(date$1.toDate(date.getLocalTimeZone()));
|
|
7704
|
+
} catch {
|
|
7705
|
+
return `${date$1.year}-${String(date$1.month).padStart(2, "0")}-${String(date$1.day).padStart(2, "0")}`;
|
|
7706
|
+
}
|
|
7707
|
+
}
|
|
7708
|
+
__name(formatDate, "formatDate");
|
|
7709
|
+
function CalendarIcon({ size = 16, color = "currentColor" }) {
|
|
7710
|
+
const colors = useThemeColors();
|
|
7711
|
+
if (reactNative.Platform.OS === "web") {
|
|
7712
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7713
|
+
"svg",
|
|
7714
|
+
{
|
|
7715
|
+
width: size,
|
|
7716
|
+
height: size,
|
|
7717
|
+
viewBox: "0 0 24 24",
|
|
7718
|
+
fill: "none",
|
|
7719
|
+
stroke: color,
|
|
7720
|
+
strokeWidth: "2",
|
|
7721
|
+
strokeLinecap: "round",
|
|
7722
|
+
strokeLinejoin: "round",
|
|
7723
|
+
"aria-hidden": "true",
|
|
7724
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z" })
|
|
7725
|
+
}
|
|
7726
|
+
);
|
|
7727
|
+
}
|
|
7728
|
+
const resolvedColor = color === "currentColor" ? colors.semantic.text.muted : color;
|
|
7729
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7730
|
+
reactNative.Text,
|
|
7731
|
+
{
|
|
7732
|
+
accessibilityElementsHidden: true,
|
|
7733
|
+
importantForAccessibility: "no-hide-descendants",
|
|
7734
|
+
style: { fontSize: size, lineHeight: size, color: resolvedColor },
|
|
7735
|
+
children: "\u{1F4C5}"
|
|
7736
|
+
}
|
|
7737
|
+
);
|
|
7738
|
+
}
|
|
7739
|
+
__name(CalendarIcon, "CalendarIcon");
|
|
7067
7740
|
function buildCalendarOptional(minValue, maxValue, isDateUnavailable, firstDayOfWeek) {
|
|
7068
7741
|
const out = {};
|
|
7069
7742
|
if (minValue !== void 0) {
|
|
@@ -7765,6 +8438,55 @@ var Dialog = Object.assign(DialogRoot, {
|
|
|
7765
8438
|
Footer: DialogFooter,
|
|
7766
8439
|
Close: DialogClose
|
|
7767
8440
|
});
|
|
8441
|
+
var Empty = /* @__PURE__ */ __name(({ icon, title, description, action, className, testID }) => {
|
|
8442
|
+
const colors = useThemeColors();
|
|
8443
|
+
const containerStyle = {
|
|
8444
|
+
flexDirection: "column",
|
|
8445
|
+
alignItems: "center",
|
|
8446
|
+
justifyContent: "center",
|
|
8447
|
+
gap: px(colors.spacing["3"]),
|
|
8448
|
+
paddingVertical: px(colors.spacing["8"]),
|
|
8449
|
+
paddingHorizontal: px(colors.spacing["4"])
|
|
8450
|
+
};
|
|
8451
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8452
|
+
reactNative.View,
|
|
8453
|
+
{
|
|
8454
|
+
...testID !== void 0 ? { testID } : {},
|
|
8455
|
+
className: cn("flex-col items-center justify-center gap-3 py-8 px-4", className),
|
|
8456
|
+
style: containerStyle,
|
|
8457
|
+
children: [
|
|
8458
|
+
icon != null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginBottom: px(colors.spacing["1"]) }, children: icon }) : null,
|
|
8459
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8460
|
+
reactNative.Text,
|
|
8461
|
+
{
|
|
8462
|
+
style: {
|
|
8463
|
+
color: colors.semantic.text.default,
|
|
8464
|
+
fontFamily: colors.fontFamily.body,
|
|
8465
|
+
fontSize: px(colors.fontSize.md),
|
|
8466
|
+
fontWeight: colors.fontWeight.semibold,
|
|
8467
|
+
textAlign: "center"
|
|
8468
|
+
},
|
|
8469
|
+
children: title
|
|
8470
|
+
}
|
|
8471
|
+
),
|
|
8472
|
+
description != null ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8473
|
+
reactNative.Text,
|
|
8474
|
+
{
|
|
8475
|
+
style: {
|
|
8476
|
+
color: colors.semantic.text.muted,
|
|
8477
|
+
fontFamily: colors.fontFamily.body,
|
|
8478
|
+
fontSize: px(colors.fontSize.sm),
|
|
8479
|
+
lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),
|
|
8480
|
+
textAlign: "center"
|
|
8481
|
+
},
|
|
8482
|
+
children: description
|
|
8483
|
+
}
|
|
8484
|
+
) : null,
|
|
8485
|
+
action != null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginTop: px(colors.spacing["1"]) }, children: action }) : null
|
|
8486
|
+
]
|
|
8487
|
+
}
|
|
8488
|
+
);
|
|
8489
|
+
}, "Empty");
|
|
7768
8490
|
var FieldContext = React.createContext(null);
|
|
7769
8491
|
var useFieldContextStrict = /* @__PURE__ */ __name((caller) => {
|
|
7770
8492
|
const ctx = React.useContext(FieldContext);
|
|
@@ -9048,6 +9770,173 @@ var InputGroup = Object.assign(InputGroupRoot, {
|
|
|
9048
9770
|
Addon: InputGroupAddon,
|
|
9049
9771
|
Input: InputGroupInput
|
|
9050
9772
|
});
|
|
9773
|
+
var Item = /* @__PURE__ */ __name(({
|
|
9774
|
+
leading,
|
|
9775
|
+
title,
|
|
9776
|
+
description,
|
|
9777
|
+
trailing,
|
|
9778
|
+
chevron = false,
|
|
9779
|
+
onPress,
|
|
9780
|
+
disabled = false,
|
|
9781
|
+
className,
|
|
9782
|
+
testID
|
|
9783
|
+
}) => {
|
|
9784
|
+
const colors = useThemeColors();
|
|
9785
|
+
const isTappable = onPress !== void 0;
|
|
9786
|
+
const rowStyle = {
|
|
9787
|
+
flexDirection: "row",
|
|
9788
|
+
alignItems: "center",
|
|
9789
|
+
gap: px(colors.spacing["3"]),
|
|
9790
|
+
paddingVertical: px(colors.spacing["3"]),
|
|
9791
|
+
paddingHorizontal: px(colors.spacing["4"]),
|
|
9792
|
+
minHeight: 52,
|
|
9793
|
+
opacity: disabled ? 0.5 : 1
|
|
9794
|
+
};
|
|
9795
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9796
|
+
leading != null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { flexShrink: 0 }, children: leading }) : null,
|
|
9797
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: { flex: 1, flexDirection: "column", gap: 2 }, children: [
|
|
9798
|
+
typeof title === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9799
|
+
reactNative.Text,
|
|
9800
|
+
{
|
|
9801
|
+
style: {
|
|
9802
|
+
color: colors.semantic.text.default,
|
|
9803
|
+
fontFamily: colors.fontFamily.body,
|
|
9804
|
+
fontSize: px(colors.fontSize.sm),
|
|
9805
|
+
fontWeight: colors.fontWeight.medium
|
|
9806
|
+
},
|
|
9807
|
+
numberOfLines: 1,
|
|
9808
|
+
children: title
|
|
9809
|
+
}
|
|
9810
|
+
) : title,
|
|
9811
|
+
description != null ? typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9812
|
+
reactNative.Text,
|
|
9813
|
+
{
|
|
9814
|
+
style: {
|
|
9815
|
+
color: colors.semantic.text.muted,
|
|
9816
|
+
fontFamily: colors.fontFamily.body,
|
|
9817
|
+
fontSize: px(colors.fontSize.xs)
|
|
9818
|
+
},
|
|
9819
|
+
numberOfLines: 1,
|
|
9820
|
+
children: description
|
|
9821
|
+
}
|
|
9822
|
+
) : description : null
|
|
9823
|
+
] }),
|
|
9824
|
+
trailing != null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { flexShrink: 0 }, children: trailing }) : null,
|
|
9825
|
+
chevron ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9826
|
+
reactNative.View,
|
|
9827
|
+
{
|
|
9828
|
+
style: { flexShrink: 0 },
|
|
9829
|
+
"aria-hidden": true,
|
|
9830
|
+
testID: testID != null ? `${testID}-chevron` : void 0,
|
|
9831
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9832
|
+
reactNative.Text,
|
|
9833
|
+
{
|
|
9834
|
+
accessibilityElementsHidden: true,
|
|
9835
|
+
importantForAccessibility: "no-hide-descendants",
|
|
9836
|
+
style: {
|
|
9837
|
+
fontSize: 14,
|
|
9838
|
+
lineHeight: 16,
|
|
9839
|
+
color: colors.semantic.text.muted,
|
|
9840
|
+
// On web rn-web passes style through — transform
|
|
9841
|
+
// with a rotate is the lightest-weight approach
|
|
9842
|
+
// that avoids importing the full SVG icon set.
|
|
9843
|
+
transform: [{ rotate: "-90deg" }]
|
|
9844
|
+
},
|
|
9845
|
+
children: "\u2304"
|
|
9846
|
+
}
|
|
9847
|
+
)
|
|
9848
|
+
}
|
|
9849
|
+
) : null
|
|
9850
|
+
] });
|
|
9851
|
+
if (isTappable) {
|
|
9852
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9853
|
+
reactNative.Pressable,
|
|
9854
|
+
{
|
|
9855
|
+
...testID !== void 0 ? { testID } : {},
|
|
9856
|
+
role: "button",
|
|
9857
|
+
accessibilityRole: "button",
|
|
9858
|
+
disabled,
|
|
9859
|
+
onPress: disabled ? void 0 : onPress,
|
|
9860
|
+
className: cn(
|
|
9861
|
+
"flex-row items-center",
|
|
9862
|
+
disabled ? "opacity-50" : "hover:bg-semantic-background-subtle active:bg-semantic-border-default",
|
|
9863
|
+
className
|
|
9864
|
+
),
|
|
9865
|
+
style: rowStyle,
|
|
9866
|
+
children: content
|
|
9867
|
+
}
|
|
9868
|
+
);
|
|
9869
|
+
}
|
|
9870
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9871
|
+
reactNative.View,
|
|
9872
|
+
{
|
|
9873
|
+
...testID !== void 0 ? { testID } : {},
|
|
9874
|
+
className: cn("flex-row items-center", className),
|
|
9875
|
+
style: rowStyle,
|
|
9876
|
+
children: content
|
|
9877
|
+
}
|
|
9878
|
+
);
|
|
9879
|
+
}, "Item");
|
|
9880
|
+
var Kbd = /* @__PURE__ */ __name(({ children, className }) => {
|
|
9881
|
+
const colors = useThemeColors();
|
|
9882
|
+
const isDark = useColorScheme() === "dark";
|
|
9883
|
+
const bgColor = isDark ? colors.color.neutral["800"] : colors.color.neutral["100"];
|
|
9884
|
+
const borderColor = isDark ? colors.color.neutral["600"] : colors.color.neutral["300"];
|
|
9885
|
+
const textColor = isDark ? colors.color.neutral["200"] : colors.color.neutral["700"];
|
|
9886
|
+
const containerStyle = {
|
|
9887
|
+
display: "flex",
|
|
9888
|
+
flexDirection: "row",
|
|
9889
|
+
alignItems: "center",
|
|
9890
|
+
justifyContent: "center",
|
|
9891
|
+
alignSelf: "center",
|
|
9892
|
+
backgroundColor: bgColor,
|
|
9893
|
+
borderWidth: 1,
|
|
9894
|
+
borderColor,
|
|
9895
|
+
borderRadius: px(colors.radius.sm),
|
|
9896
|
+
paddingHorizontal: px(colors.spacing["1"]),
|
|
9897
|
+
paddingVertical: 2,
|
|
9898
|
+
// Subtle bottom shadow gives the classic key look.
|
|
9899
|
+
...reactNative.Platform.OS === "web" ? {
|
|
9900
|
+
boxShadow: `0 1px 0 ${borderColor}`,
|
|
9901
|
+
display: "inline-flex"
|
|
9902
|
+
} : {}
|
|
9903
|
+
};
|
|
9904
|
+
const textStyle = {
|
|
9905
|
+
color: textColor,
|
|
9906
|
+
// Monospace font for key labels.
|
|
9907
|
+
fontFamily: colors.fontFamily.mono ?? "monospace",
|
|
9908
|
+
fontSize: px(colors.fontSize.xs),
|
|
9909
|
+
fontWeight: colors.fontWeight.medium,
|
|
9910
|
+
lineHeight: px(colors.fontSize.xs) * Number(colors.lineHeight.normal)
|
|
9911
|
+
};
|
|
9912
|
+
const extraWebProps = reactNative.Platform.OS === "web" ? {
|
|
9913
|
+
// rn-web: 'none' skips the role attribute so the outer
|
|
9914
|
+
// View is just a plain <div>; we rely on the inner
|
|
9915
|
+
// <span> with data-kbd for semantic annotation.
|
|
9916
|
+
accessibilityRole: "none"
|
|
9917
|
+
} : {};
|
|
9918
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9919
|
+
reactNative.View,
|
|
9920
|
+
{
|
|
9921
|
+
...extraWebProps,
|
|
9922
|
+
className: cn(
|
|
9923
|
+
"inline-flex flex-row items-center rounded-sm border px-1 py-0.5",
|
|
9924
|
+
isDark ? "bg-neutral-800 border-neutral-600 text-neutral-200" : "bg-neutral-100 border-neutral-300 text-neutral-700",
|
|
9925
|
+
className
|
|
9926
|
+
),
|
|
9927
|
+
style: containerStyle,
|
|
9928
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9929
|
+
reactNative.Text,
|
|
9930
|
+
{
|
|
9931
|
+
...reactNative.Platform.OS === "web" ? { "data-kbd": "" } : {},
|
|
9932
|
+
accessibilityRole: "none",
|
|
9933
|
+
style: textStyle,
|
|
9934
|
+
children
|
|
9935
|
+
}
|
|
9936
|
+
)
|
|
9937
|
+
}
|
|
9938
|
+
);
|
|
9939
|
+
}, "Kbd");
|
|
9051
9940
|
var Label = /* @__PURE__ */ __name(({ htmlFor, required = false, disabled = false, children, className, testID }) => {
|
|
9052
9941
|
const colors = useThemeColors();
|
|
9053
9942
|
const { t } = useTranslation();
|
|
@@ -9097,124 +9986,6 @@ var Label = /* @__PURE__ */ __name(({ htmlFor, required = false, disabled = fals
|
|
|
9097
9986
|
}
|
|
9098
9987
|
);
|
|
9099
9988
|
}, "Label");
|
|
9100
|
-
var range = /* @__PURE__ */ __name((from, to) => {
|
|
9101
|
-
if (to < from) {
|
|
9102
|
-
return [];
|
|
9103
|
-
}
|
|
9104
|
-
const out = new Array(to - from + 1);
|
|
9105
|
-
for (let i = 0; i < out.length; i += 1) {
|
|
9106
|
-
out[i] = from + i;
|
|
9107
|
-
}
|
|
9108
|
-
return out;
|
|
9109
|
-
}, "range");
|
|
9110
|
-
function usePagination(args) {
|
|
9111
|
-
const {
|
|
9112
|
-
page: controlledPage,
|
|
9113
|
-
defaultPage = 1,
|
|
9114
|
-
pageCount,
|
|
9115
|
-
siblingCount = 1,
|
|
9116
|
-
boundaryCount = 1,
|
|
9117
|
-
showFirstLast = false,
|
|
9118
|
-
showPrevNext = true,
|
|
9119
|
-
onPageChange
|
|
9120
|
-
} = args;
|
|
9121
|
-
const isControlled = controlledPage !== void 0;
|
|
9122
|
-
const [uncontrolledPage, setUncontrolledPage] = React.useState(defaultPage);
|
|
9123
|
-
const onChangeRef = React.useRef(onPageChange);
|
|
9124
|
-
onChangeRef.current = onPageChange;
|
|
9125
|
-
const safePageCount = Math.max(1, Math.floor(pageCount));
|
|
9126
|
-
const rawPage = isControlled ? controlledPage : uncontrolledPage;
|
|
9127
|
-
const currentPage = Math.min(Math.max(1, Math.floor(rawPage)), safePageCount);
|
|
9128
|
-
const goToPage = React.useCallback(
|
|
9129
|
-
(next2) => {
|
|
9130
|
-
const clamped = Math.min(Math.max(1, Math.floor(next2)), Math.max(1, Math.floor(pageCount)));
|
|
9131
|
-
if (!isControlled) {
|
|
9132
|
-
setUncontrolledPage(clamped);
|
|
9133
|
-
}
|
|
9134
|
-
onChangeRef.current?.(clamped);
|
|
9135
|
-
},
|
|
9136
|
-
[isControlled, pageCount]
|
|
9137
|
-
);
|
|
9138
|
-
const prev = React.useCallback(() => goToPage(currentPage - 1), [goToPage, currentPage]);
|
|
9139
|
-
const next = React.useCallback(() => goToPage(currentPage + 1), [goToPage, currentPage]);
|
|
9140
|
-
const first = React.useCallback(() => goToPage(1), [goToPage]);
|
|
9141
|
-
const last = React.useCallback(() => goToPage(safePageCount), [goToPage, safePageCount]);
|
|
9142
|
-
const pages = React.useMemo(() => {
|
|
9143
|
-
const items = [];
|
|
9144
|
-
const safeSibling = Math.max(0, Math.floor(siblingCount));
|
|
9145
|
-
const safeBoundary = Math.max(0, Math.floor(boundaryCount));
|
|
9146
|
-
if (showFirstLast) {
|
|
9147
|
-
items.push({ type: "first", disabled: currentPage <= 1 });
|
|
9148
|
-
}
|
|
9149
|
-
if (showPrevNext) {
|
|
9150
|
-
items.push({ type: "prev", disabled: currentPage <= 1 });
|
|
9151
|
-
}
|
|
9152
|
-
const startPages = range(1, Math.min(safeBoundary, safePageCount));
|
|
9153
|
-
const endPages = range(Math.max(safePageCount - safeBoundary + 1, safeBoundary + 1), safePageCount);
|
|
9154
|
-
const siblingsStart = Math.max(
|
|
9155
|
-
Math.min(currentPage - safeSibling, safePageCount - safeBoundary - safeSibling * 2 - 1),
|
|
9156
|
-
safeBoundary + 2
|
|
9157
|
-
);
|
|
9158
|
-
const siblingsEnd = Math.min(
|
|
9159
|
-
Math.max(currentPage + safeSibling, safeBoundary + safeSibling * 2 + 2),
|
|
9160
|
-
endPages.length > 0 ? endPages[0] - 2 : safePageCount - 1
|
|
9161
|
-
);
|
|
9162
|
-
const middle = [];
|
|
9163
|
-
if (siblingsStart > safeBoundary + 2) {
|
|
9164
|
-
middle.push("ellipsis");
|
|
9165
|
-
} else if (safeBoundary + 1 < safePageCount - safeBoundary) {
|
|
9166
|
-
middle.push(safeBoundary + 1);
|
|
9167
|
-
}
|
|
9168
|
-
for (const p of range(siblingsStart, siblingsEnd)) {
|
|
9169
|
-
middle.push(p);
|
|
9170
|
-
}
|
|
9171
|
-
if (siblingsEnd < safePageCount - safeBoundary - 1) {
|
|
9172
|
-
middle.push("ellipsis");
|
|
9173
|
-
} else if (safePageCount - safeBoundary > safeBoundary) {
|
|
9174
|
-
middle.push(safePageCount - safeBoundary);
|
|
9175
|
-
}
|
|
9176
|
-
const seen = /* @__PURE__ */ new Set();
|
|
9177
|
-
const pushPage = /* @__PURE__ */ __name((n) => {
|
|
9178
|
-
if (n < 1 || n > safePageCount || seen.has(n)) {
|
|
9179
|
-
return;
|
|
9180
|
-
}
|
|
9181
|
-
seen.add(n);
|
|
9182
|
-
items.push({ type: "page", page: n, selected: n === currentPage });
|
|
9183
|
-
}, "pushPage");
|
|
9184
|
-
for (const n of startPages) {
|
|
9185
|
-
pushPage(n);
|
|
9186
|
-
}
|
|
9187
|
-
for (const m of middle) {
|
|
9188
|
-
if (m === "ellipsis") {
|
|
9189
|
-
items.push({ type: "ellipsis" });
|
|
9190
|
-
} else {
|
|
9191
|
-
pushPage(m);
|
|
9192
|
-
}
|
|
9193
|
-
}
|
|
9194
|
-
for (const n of endPages) {
|
|
9195
|
-
pushPage(n);
|
|
9196
|
-
}
|
|
9197
|
-
if (showPrevNext) {
|
|
9198
|
-
items.push({ type: "next", disabled: currentPage >= safePageCount });
|
|
9199
|
-
}
|
|
9200
|
-
if (showFirstLast) {
|
|
9201
|
-
items.push({ type: "last", disabled: currentPage >= safePageCount });
|
|
9202
|
-
}
|
|
9203
|
-
return items;
|
|
9204
|
-
}, [currentPage, safePageCount, siblingCount, boundaryCount, showFirstLast, showPrevNext]);
|
|
9205
|
-
return {
|
|
9206
|
-
page: currentPage,
|
|
9207
|
-
pages,
|
|
9208
|
-
canPrev: currentPage > 1,
|
|
9209
|
-
canNext: currentPage < safePageCount,
|
|
9210
|
-
goToPage,
|
|
9211
|
-
prev,
|
|
9212
|
-
next,
|
|
9213
|
-
first,
|
|
9214
|
-
last
|
|
9215
|
-
};
|
|
9216
|
-
}
|
|
9217
|
-
__name(usePagination, "usePagination");
|
|
9218
9989
|
var PAGINATION_COMPACT_BREAKPOINT = 480;
|
|
9219
9990
|
var PaginationContext = React.createContext(null);
|
|
9220
9991
|
var usePaginationContext = /* @__PURE__ */ __name((label) => {
|
|
@@ -13455,26 +14226,33 @@ __name(NoriProvider, "NoriProvider");
|
|
|
13455
14226
|
exports.Accordion = Accordion;
|
|
13456
14227
|
exports.Alert = Alert;
|
|
13457
14228
|
exports.AlertDialog = AlertDialog;
|
|
14229
|
+
exports.AspectRatio = AspectRatio;
|
|
13458
14230
|
exports.Avatar = Avatar;
|
|
13459
14231
|
exports.Badge = Badge;
|
|
13460
14232
|
exports.Box = Box;
|
|
13461
14233
|
exports.Breadcrumb = Breadcrumb;
|
|
13462
14234
|
exports.Button = Button;
|
|
14235
|
+
exports.ButtonGroup = ButtonGroup;
|
|
13463
14236
|
exports.Calendar = Calendar;
|
|
13464
14237
|
exports.Card = Card;
|
|
13465
14238
|
exports.Checkbox = Checkbox;
|
|
14239
|
+
exports.Collapsible = Collapsible;
|
|
13466
14240
|
exports.Combobox = Combobox;
|
|
13467
14241
|
exports.ContextMenu = ContextMenu;
|
|
14242
|
+
exports.DataTable = DataTable;
|
|
13468
14243
|
exports.DatePicker = DatePicker;
|
|
13469
14244
|
exports.Dialog = Dialog;
|
|
13470
14245
|
exports.Drawer = Drawer;
|
|
13471
14246
|
exports.DropdownMenu = DropdownMenu;
|
|
14247
|
+
exports.Empty = Empty;
|
|
13472
14248
|
exports.Field = Field;
|
|
13473
14249
|
exports.FloatButton = FloatButton;
|
|
13474
14250
|
exports.HStack = HStack;
|
|
13475
14251
|
exports.I18nProvider = I18nProvider;
|
|
13476
14252
|
exports.Icon = Icon;
|
|
13477
14253
|
exports.InputGroup = InputGroup;
|
|
14254
|
+
exports.Item = Item;
|
|
14255
|
+
exports.Kbd = Kbd;
|
|
13478
14256
|
exports.Label = Label;
|
|
13479
14257
|
exports.LocaleProvider = LocaleProvider;
|
|
13480
14258
|
exports.MenuContent = MenuContent;
|
|
@@ -13506,6 +14284,7 @@ exports.SliderGestureProvider = SliderGestureProvider;
|
|
|
13506
14284
|
exports.Slot = Slot;
|
|
13507
14285
|
exports.Spinner = Spinner;
|
|
13508
14286
|
exports.Switch = Switch;
|
|
14287
|
+
exports.Table = Table;
|
|
13509
14288
|
exports.Tabs = Tabs;
|
|
13510
14289
|
exports.Text = Text;
|
|
13511
14290
|
exports.TextArea = TextArea;
|