@nori-ui/core 1.6.0 → 1.8.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-7UKRN73P.js → chunk-2XJCLPNH.js} +3 -3
- package/dist/{chunk-7UKRN73P.js.map → chunk-2XJCLPNH.js.map} +1 -1
- package/dist/{chunk-5PSC5HT4.js → chunk-3B345SQU.js} +5 -5
- package/dist/{chunk-5PSC5HT4.js.map → chunk-3B345SQU.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-DDGMLLS3.js → chunk-3W3XYULK.js} +3 -3
- package/dist/{chunk-DDGMLLS3.js.map → chunk-3W3XYULK.js.map} +1 -1
- package/dist/{chunk-WYPGQVDV.js → chunk-5YHT252H.js} +3 -3
- package/dist/{chunk-WYPGQVDV.js.map → chunk-5YHT252H.js.map} +1 -1
- 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-BOMPFNM4.js +165 -0
- package/dist/chunk-BOMPFNM4.js.map +1 -0
- package/dist/chunk-BVLOX4A3.js +256 -0
- package/dist/chunk-BVLOX4A3.js.map +1 -0
- package/dist/{chunk-YZ27OS2R.js → chunk-C32XGHWO.js} +3 -3
- package/dist/{chunk-YZ27OS2R.js.map → chunk-C32XGHWO.js.map} +1 -1
- package/dist/{chunk-UJWCEGQY.js → chunk-C5HQPXRI.js} +3 -3
- package/dist/{chunk-UJWCEGQY.js.map → chunk-C5HQPXRI.js.map} +1 -1
- package/dist/{chunk-XALU6LOT.js → chunk-EN4CLDGZ.js} +3 -3
- package/dist/{chunk-XALU6LOT.js.map → chunk-EN4CLDGZ.js.map} +1 -1
- package/dist/{chunk-6AD6KCVB.js → chunk-F5UKI7XD.js} +3 -3
- package/dist/{chunk-6AD6KCVB.js.map → chunk-F5UKI7XD.js.map} +1 -1
- package/dist/chunk-GTAXVTLF.js +43 -0
- package/dist/chunk-GTAXVTLF.js.map +1 -0
- package/dist/{chunk-NNFJKRXZ.js → chunk-H2LHWJ52.js} +3 -3
- package/dist/{chunk-NNFJKRXZ.js.map → chunk-H2LHWJ52.js.map} +1 -1
- package/dist/{chunk-PZS4A4VQ.js → chunk-HXCETKCC.js} +3 -3
- package/dist/{chunk-PZS4A4VQ.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-JXLEMBDB.js → chunk-IIVTPN62.js} +3 -3
- package/dist/{chunk-JXLEMBDB.js.map → chunk-IIVTPN62.js.map} +1 -1
- package/dist/{chunk-PNP7L4TA.js → chunk-ISCJST4P.js} +3 -3
- package/dist/{chunk-PNP7L4TA.js.map → chunk-ISCJST4P.js.map} +1 -1
- package/dist/{chunk-TLS54G6Y.js → chunk-IWM2XDXH.js} +3 -3
- package/dist/{chunk-TLS54G6Y.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-MRJWPRCX.js → chunk-L6VYDM7S.js} +3 -3
- package/dist/{chunk-MRJWPRCX.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-RUWD35UI.js → chunk-MK57AOTI.js} +4 -4
- package/dist/{chunk-RUWD35UI.js.map → chunk-MK57AOTI.js.map} +1 -1
- package/dist/{chunk-3BDDPFCI.js → chunk-MOAIQHR7.js} +3 -3
- package/dist/{chunk-3BDDPFCI.js.map → chunk-MOAIQHR7.js.map} +1 -1
- package/dist/{chunk-5XEGZFG5.js → chunk-MYBBBLYE.js} +3 -3
- package/dist/{chunk-5XEGZFG5.js.map → chunk-MYBBBLYE.js.map} +1 -1
- package/dist/{chunk-WP2Z2ATO.js → chunk-O6M3F7BZ.js} +5 -5
- package/dist/{chunk-WP2Z2ATO.js.map → chunk-O6M3F7BZ.js.map} +1 -1
- package/dist/{chunk-FEPTH5RV.js → chunk-OELY6K44.js} +3 -3
- package/dist/{chunk-FEPTH5RV.js.map → chunk-OELY6K44.js.map} +1 -1
- package/dist/{chunk-BZLT6R62.js → chunk-OIHX5B4R.js} +3 -3
- package/dist/{chunk-BZLT6R62.js.map → chunk-OIHX5B4R.js.map} +1 -1
- package/dist/{chunk-QJVS2VXS.js → chunk-PGYEIXCO.js} +4 -4
- package/dist/{chunk-QJVS2VXS.js.map → chunk-PGYEIXCO.js.map} +1 -1
- package/dist/{chunk-UZD77M3J.js → chunk-PJTCO76H.js} +3 -3
- package/dist/{chunk-UZD77M3J.js.map → chunk-PJTCO76H.js.map} +1 -1
- package/dist/{chunk-4PUPKWEP.js → chunk-PJXVLE24.js} +4 -4
- package/dist/{chunk-4PUPKWEP.js.map → chunk-PJXVLE24.js.map} +1 -1
- package/dist/{chunk-WGT345SV.js → chunk-PLQPBMG2.js} +3 -3
- package/dist/{chunk-WGT345SV.js.map → chunk-PLQPBMG2.js.map} +1 -1
- package/dist/{chunk-OMU4R4Y5.js → chunk-PQW5LKAI.js} +3 -3
- package/dist/{chunk-OMU4R4Y5.js.map → chunk-PQW5LKAI.js.map} +1 -1
- package/dist/{chunk-Y5TJ7CAX.js → chunk-RI4Y2C5U.js} +3 -3
- package/dist/{chunk-Y5TJ7CAX.js.map → chunk-RI4Y2C5U.js.map} +1 -1
- package/dist/{chunk-3OIWAS2P.js → chunk-SF6WPUC5.js} +3 -3
- package/dist/{chunk-3OIWAS2P.js.map → chunk-SF6WPUC5.js.map} +1 -1
- package/dist/{chunk-MKSDYRWQ.js → chunk-STX5UKYT.js} +3 -3
- package/dist/{chunk-MKSDYRWQ.js.map → chunk-STX5UKYT.js.map} +1 -1
- package/dist/{chunk-2RL6WCFC.js → chunk-TSWPHJIU.js} +4 -4
- package/dist/{chunk-2RL6WCFC.js.map → chunk-TSWPHJIU.js.map} +1 -1
- package/dist/{chunk-SFNDR6DI.js → chunk-U2ZKY2CP.js} +3 -3
- package/dist/{chunk-SFNDR6DI.js.map → chunk-U2ZKY2CP.js.map} +1 -1
- package/dist/{chunk-PABG3IJ6.js → chunk-UKDDK42K.js} +3 -3
- package/dist/{chunk-PABG3IJ6.js.map → chunk-UKDDK42K.js.map} +1 -1
- package/dist/{chunk-VYRJ7OE5.js → chunk-USFXANEU.js} +3 -3
- package/dist/{chunk-VYRJ7OE5.js.map → chunk-USFXANEU.js.map} +1 -1
- package/dist/{chunk-CCUXO2HN.js → chunk-V5QSMDZL.js} +3 -3
- package/dist/{chunk-CCUXO2HN.js.map → chunk-V5QSMDZL.js.map} +1 -1
- package/dist/{chunk-NF7XG2FG.js → chunk-V75O7QQO.js} +3 -3
- package/dist/{chunk-NF7XG2FG.js.map → chunk-V75O7QQO.js.map} +1 -1
- package/dist/chunk-VFUV6XJR.js +257 -0
- package/dist/chunk-VFUV6XJR.js.map +1 -0
- package/dist/{chunk-NRYWNOG5.js → chunk-VL2WNGPF.js} +3 -3
- package/dist/{chunk-NRYWNOG5.js.map → chunk-VL2WNGPF.js.map} +1 -1
- package/dist/{chunk-JQQ3FBN7.js → chunk-VLZANXRZ.js} +3 -3
- package/dist/{chunk-JQQ3FBN7.js.map → chunk-VLZANXRZ.js.map} +1 -1
- package/dist/{chunk-2HMQDJ22.js → chunk-VOF3S5I4.js} +3 -3
- package/dist/{chunk-2HMQDJ22.js.map → chunk-VOF3S5I4.js.map} +1 -1
- package/dist/chunk-XQNVWHMN.js +60 -0
- package/dist/chunk-XQNVWHMN.js.map +1 -0
- package/dist/{chunk-JZ774T7U.js → chunk-ZGFXKYA5.js} +3 -3
- package/dist/{chunk-JZ774T7U.js.map → chunk-ZGFXKYA5.js.map} +1 -1
- package/dist/client.cjs +1106 -7
- 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 +56 -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.js +3 -3
- 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.js +3 -3
- package/dist/components/Card/index.js +2 -2
- package/dist/components/Carousel/index.cjs +297 -0
- package/dist/components/Carousel/index.cjs.map +1 -0
- package/dist/components/Carousel/index.d.cts +67 -0
- package/dist/components/Carousel/index.d.ts +67 -0
- package/dist/components/Carousel/index.js +5 -0
- package/dist/components/Carousel/index.js.map +1 -0
- 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.js +3 -3
- package/dist/components/DatePicker/index.js +5 -5
- 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/FloatButton/index.js +3 -3
- package/dist/components/HStack/index.js +4 -4
- package/dist/components/HoverCard/index.cjs +894 -0
- package/dist/components/HoverCard/index.cjs.map +1 -0
- package/dist/components/HoverCard/index.d.cts +66 -0
- package/dist/components/HoverCard/index.d.ts +66 -0
- package/dist/components/HoverCard/index.js +9 -0
- package/dist/components/HoverCard/index.js.map +1 -0
- package/dist/components/InputGroup/index.js +2 -2
- package/dist/components/InputOTP/index.cjs +580 -0
- package/dist/components/InputOTP/index.cjs.map +1 -0
- package/dist/components/InputOTP/index.d.cts +49 -0
- package/dist/components/InputOTP/index.d.ts +49 -0
- package/dist/components/InputOTP/index.js +7 -0
- package/dist/components/InputOTP/index.js.map +1 -0
- 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/Pagination/index.js +4 -4
- 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.js +2 -2
- 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/index.cjs +1106 -7
- 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 -45
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type ButtonGroupOrientation = 'horizontal' | 'vertical';
|
|
5
|
+
type ButtonGroupSize = 'sm' | 'md' | 'lg';
|
|
6
|
+
type ButtonGroupProps = {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** Flex direction for the group. @defaultValue 'horizontal' */
|
|
9
|
+
orientation?: ButtonGroupOrientation;
|
|
10
|
+
/**
|
|
11
|
+
* Size hint passed to children via `data-group-size`. Buttons inside
|
|
12
|
+
* the group can read this to self-size consistently. When omitted, each
|
|
13
|
+
* Button retains its own `size` prop.
|
|
14
|
+
*/
|
|
15
|
+
size?: ButtonGroupSize;
|
|
16
|
+
className?: string;
|
|
17
|
+
testID?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Joins multiple buttons in a visually connected row (or column). Middle
|
|
21
|
+
* buttons lose outer edge radius; adjacent borders merge so the group looks
|
|
22
|
+
* like a single segmented control.
|
|
23
|
+
*
|
|
24
|
+
* The radius treatment is implemented by injecting `data-position` attributes
|
|
25
|
+
* (first / middle / last) onto each direct child. A companion CSS rule in the
|
|
26
|
+
* nori preset (or a Tailwind variant) can target `[data-position=first]`,
|
|
27
|
+
* `[data-position=middle]`, and `[data-position=last]` to strip the
|
|
28
|
+
* appropriate border-radius corners. When using Button from `@nori-ui/core`,
|
|
29
|
+
* no extra setup is needed — the tokens preset ships the rules.
|
|
30
|
+
*
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <ButtonGroup>
|
|
33
|
+
* <Button variant="secondary">Day</Button>
|
|
34
|
+
* <Button variant="secondary">Week</Button>
|
|
35
|
+
* <Button variant="secondary">Month</Button>
|
|
36
|
+
* </ButtonGroup>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* > **v2 note:** Corner-radius stripping is applied via CSS data-attribute
|
|
40
|
+
* > selectors on web. On native, middle-button radius adjustment is a future
|
|
41
|
+
* > enhancement (currently the group renders with standard per-button radius).
|
|
42
|
+
*/
|
|
43
|
+
declare const ButtonGroup: ({ children, orientation, size, className, testID }: ButtonGroupProps) => react_jsx_runtime.JSX.Element;
|
|
44
|
+
|
|
45
|
+
export { ButtonGroup, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonGroupSize };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { Calendar, useCalendarCaption } from '../../chunk-
|
|
1
|
+
export { Calendar, useCalendarCaption } from '../../chunk-VOF3S5I4.js';
|
|
2
|
+
import '../../chunk-PJTCO76H.js';
|
|
2
3
|
import '../../chunk-GJMHNEQ3.js';
|
|
3
4
|
import '../../chunk-4UFAZLSZ.js';
|
|
4
|
-
import '../../chunk-UZD77M3J.js';
|
|
5
5
|
import '../../chunk-7Z4NMNX6.js';
|
|
6
6
|
import '../../chunk-5A2QOOVN.js';
|
|
7
|
-
import '../../chunk-CHXHRJNZ.js';
|
|
8
7
|
import '../../chunk-R5JMDDCB.js';
|
|
8
|
+
import '../../chunk-CHXHRJNZ.js';
|
|
9
9
|
import '../../chunk-WCQVDF3K.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { Card } from '../../chunk-
|
|
1
|
+
export { Card } from '../../chunk-PQW5LKAI.js';
|
|
2
2
|
import '../../chunk-5A2QOOVN.js';
|
|
3
|
-
import '../../chunk-CHXHRJNZ.js';
|
|
4
3
|
import '../../chunk-R5JMDDCB.js';
|
|
4
|
+
import '../../chunk-CHXHRJNZ.js';
|
|
5
5
|
import '../../chunk-WCQVDF3K.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var jsxRuntime = require('nativewind/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
|
|
9
|
+
// src/utils/cn.ts
|
|
10
|
+
function cn(...inputs) {
|
|
11
|
+
const out = [];
|
|
12
|
+
for (const input of inputs) {
|
|
13
|
+
append(out, input);
|
|
14
|
+
}
|
|
15
|
+
return out.join(" ");
|
|
16
|
+
}
|
|
17
|
+
__name(cn, "cn");
|
|
18
|
+
function append(out, input) {
|
|
19
|
+
if (!input) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (typeof input === "string") {
|
|
23
|
+
if (input.length > 0) {
|
|
24
|
+
out.push(input);
|
|
25
|
+
}
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (typeof input === "number") {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (Array.isArray(input)) {
|
|
32
|
+
for (const inner of input) {
|
|
33
|
+
append(out, inner);
|
|
34
|
+
}
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (typeof input === "object") {
|
|
38
|
+
for (const key of Object.keys(input)) {
|
|
39
|
+
if (input[key]) {
|
|
40
|
+
out.push(key);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
__name(append, "append");
|
|
46
|
+
var CarouselContext = react.createContext(null);
|
|
47
|
+
function useCarouselContext(caller) {
|
|
48
|
+
const ctx = react.useContext(CarouselContext);
|
|
49
|
+
if (!ctx) {
|
|
50
|
+
throw new Error(`<${caller}> must be rendered inside <Carousel>.`);
|
|
51
|
+
}
|
|
52
|
+
return ctx;
|
|
53
|
+
}
|
|
54
|
+
__name(useCarouselContext, "useCarouselContext");
|
|
55
|
+
var CarouselRoot = /* @__PURE__ */ __name(({
|
|
56
|
+
index: controlledIndex,
|
|
57
|
+
defaultIndex = 0,
|
|
58
|
+
onIndexChange,
|
|
59
|
+
loop = false,
|
|
60
|
+
orientation = "horizontal",
|
|
61
|
+
children,
|
|
62
|
+
className,
|
|
63
|
+
testID
|
|
64
|
+
}) => {
|
|
65
|
+
const [inner, setInner] = react.useState(defaultIndex);
|
|
66
|
+
const isControlled = controlledIndex !== void 0;
|
|
67
|
+
const index = isControlled ? controlledIndex : inner;
|
|
68
|
+
const [count, setCount] = react.useState(0);
|
|
69
|
+
const listRef = react.useRef(null);
|
|
70
|
+
const id = react.useId();
|
|
71
|
+
const setIndex = react.useCallback(
|
|
72
|
+
(next2) => {
|
|
73
|
+
if (!isControlled) {
|
|
74
|
+
setInner(next2);
|
|
75
|
+
}
|
|
76
|
+
onIndexChange?.(next2);
|
|
77
|
+
},
|
|
78
|
+
[isControlled, onIndexChange]
|
|
79
|
+
);
|
|
80
|
+
const scrollTo = react.useCallback(
|
|
81
|
+
(idx) => {
|
|
82
|
+
const list = listRef.current;
|
|
83
|
+
if (!list) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const item = list.children[idx];
|
|
87
|
+
if (!item) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
item.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
91
|
+
setIndex(idx);
|
|
92
|
+
},
|
|
93
|
+
[setIndex]
|
|
94
|
+
);
|
|
95
|
+
const next = react.useCallback(() => {
|
|
96
|
+
if (count === 0) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (index < count - 1) {
|
|
100
|
+
scrollTo(index + 1);
|
|
101
|
+
} else if (loop) {
|
|
102
|
+
scrollTo(0);
|
|
103
|
+
}
|
|
104
|
+
}, [index, count, loop, scrollTo]);
|
|
105
|
+
const prev = react.useCallback(() => {
|
|
106
|
+
if (count === 0) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (index > 0) {
|
|
110
|
+
scrollTo(index - 1);
|
|
111
|
+
} else if (loop) {
|
|
112
|
+
scrollTo(count - 1);
|
|
113
|
+
}
|
|
114
|
+
}, [index, count, loop, scrollTo]);
|
|
115
|
+
react.useEffect(() => {
|
|
116
|
+
const list = listRef.current;
|
|
117
|
+
if (!list) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const handleScroll = /* @__PURE__ */ __name(() => {
|
|
121
|
+
const { scrollLeft, scrollTop, offsetWidth, offsetHeight } = list;
|
|
122
|
+
const pos = orientation === "horizontal" ? scrollLeft : scrollTop;
|
|
123
|
+
const size = orientation === "horizontal" ? offsetWidth : offsetHeight;
|
|
124
|
+
if (size === 0) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const newIdx = Math.round(pos / size);
|
|
128
|
+
if (newIdx !== index) {
|
|
129
|
+
setIndex(newIdx);
|
|
130
|
+
}
|
|
131
|
+
}, "handleScroll");
|
|
132
|
+
list.addEventListener("scroll", handleScroll, { passive: true });
|
|
133
|
+
return () => list.removeEventListener("scroll", handleScroll);
|
|
134
|
+
}, [orientation, index, setIndex]);
|
|
135
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
136
|
+
CarouselContext.Provider,
|
|
137
|
+
{
|
|
138
|
+
value: { index, count, loop, orientation, scrollTo, next, prev, listRef, setCount, id },
|
|
139
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
140
|
+
"section",
|
|
141
|
+
{
|
|
142
|
+
"aria-label": testID ?? "Carousel",
|
|
143
|
+
className: cn("relative overflow-hidden", className),
|
|
144
|
+
"data-testid": testID,
|
|
145
|
+
children
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}, "CarouselRoot");
|
|
151
|
+
var CarouselContent = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
152
|
+
const ctx = useCarouselContext("Carousel.Content");
|
|
153
|
+
const childCount = react.Children.count(children);
|
|
154
|
+
react.useEffect(() => {
|
|
155
|
+
ctx.setCount(childCount);
|
|
156
|
+
}, [childCount, ctx.setCount]);
|
|
157
|
+
const isHorizontal = ctx.orientation === "horizontal";
|
|
158
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
ref: ctx.listRef,
|
|
162
|
+
"data-testid": testID,
|
|
163
|
+
className: cn(
|
|
164
|
+
"flex",
|
|
165
|
+
isHorizontal ? "flex-row overflow-x-auto overflow-y-hidden" : "flex-col overflow-y-auto overflow-x-hidden",
|
|
166
|
+
className
|
|
167
|
+
),
|
|
168
|
+
style: {
|
|
169
|
+
scrollSnapType: isHorizontal ? "x mandatory" : "y mandatory",
|
|
170
|
+
scrollBehavior: "smooth",
|
|
171
|
+
WebkitOverflowScrolling: "touch",
|
|
172
|
+
// Hide scrollbar
|
|
173
|
+
scrollbarWidth: "none",
|
|
174
|
+
msOverflowStyle: "none"
|
|
175
|
+
},
|
|
176
|
+
children
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
}, "CarouselContent");
|
|
180
|
+
var CarouselItem = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
181
|
+
const ctx = useCarouselContext("Carousel.Item");
|
|
182
|
+
const isHorizontal = ctx.orientation === "horizontal";
|
|
183
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
"data-testid": testID,
|
|
187
|
+
className: cn("shrink-0", isHorizontal ? "w-full" : "h-full", className),
|
|
188
|
+
style: {
|
|
189
|
+
scrollSnapAlign: "start",
|
|
190
|
+
minWidth: isHorizontal ? "100%" : void 0,
|
|
191
|
+
minHeight: !isHorizontal ? "100%" : void 0
|
|
192
|
+
},
|
|
193
|
+
children
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
}, "CarouselItem");
|
|
197
|
+
var CarouselPrevious = /* @__PURE__ */ __name(({ className, testID, children }) => {
|
|
198
|
+
const ctx = useCarouselContext("Carousel.Previous");
|
|
199
|
+
const disabled = !ctx.loop && ctx.index === 0;
|
|
200
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
201
|
+
"button",
|
|
202
|
+
{
|
|
203
|
+
type: "button",
|
|
204
|
+
"aria-label": "Previous slide",
|
|
205
|
+
disabled,
|
|
206
|
+
"data-testid": testID,
|
|
207
|
+
onClick: ctx.prev,
|
|
208
|
+
className: cn(
|
|
209
|
+
"absolute left-2 top-1/2 z-10 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-full bg-white/80 shadow hover:bg-white disabled:opacity-40",
|
|
210
|
+
className
|
|
211
|
+
),
|
|
212
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
213
|
+
"svg",
|
|
214
|
+
{
|
|
215
|
+
viewBox: "0 0 24 24",
|
|
216
|
+
fill: "none",
|
|
217
|
+
stroke: "currentColor",
|
|
218
|
+
strokeWidth: 2,
|
|
219
|
+
className: "h-4 w-4",
|
|
220
|
+
"aria-hidden": "true",
|
|
221
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 18l-6-6 6-6", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
}, "CarouselPrevious");
|
|
227
|
+
var CarouselNext = /* @__PURE__ */ __name(({ className, testID, children }) => {
|
|
228
|
+
const ctx = useCarouselContext("Carousel.Next");
|
|
229
|
+
const disabled = !ctx.loop && ctx.index >= ctx.count - 1;
|
|
230
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
231
|
+
"button",
|
|
232
|
+
{
|
|
233
|
+
type: "button",
|
|
234
|
+
"aria-label": "Next slide",
|
|
235
|
+
disabled,
|
|
236
|
+
"data-testid": testID,
|
|
237
|
+
onClick: ctx.next,
|
|
238
|
+
className: cn(
|
|
239
|
+
"absolute right-2 top-1/2 z-10 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-full bg-white/80 shadow hover:bg-white disabled:opacity-40",
|
|
240
|
+
className
|
|
241
|
+
),
|
|
242
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
243
|
+
"svg",
|
|
244
|
+
{
|
|
245
|
+
viewBox: "0 0 24 24",
|
|
246
|
+
fill: "none",
|
|
247
|
+
stroke: "currentColor",
|
|
248
|
+
strokeWidth: 2,
|
|
249
|
+
className: "h-4 w-4",
|
|
250
|
+
"aria-hidden": "true",
|
|
251
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 18l6-6-6-6", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}, "CarouselNext");
|
|
257
|
+
var CarouselDots = /* @__PURE__ */ __name(({ className, testID }) => {
|
|
258
|
+
const ctx = useCarouselContext("Carousel.Dots");
|
|
259
|
+
if (ctx.count === 0) {
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
263
|
+
"div",
|
|
264
|
+
{
|
|
265
|
+
role: "tablist",
|
|
266
|
+
"aria-label": "Slide navigation",
|
|
267
|
+
"data-testid": testID,
|
|
268
|
+
className: cn("absolute bottom-3 left-0 right-0 flex items-center justify-center gap-1.5", className),
|
|
269
|
+
children: Array.from({ length: ctx.count }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
270
|
+
"button",
|
|
271
|
+
{
|
|
272
|
+
type: "button",
|
|
273
|
+
role: "tab",
|
|
274
|
+
"aria-selected": i === ctx.index,
|
|
275
|
+
"aria-label": `Go to slide ${i + 1}`,
|
|
276
|
+
onClick: () => ctx.scrollTo(i),
|
|
277
|
+
className: cn(
|
|
278
|
+
"h-1.5 w-1.5 rounded-full transition-all",
|
|
279
|
+
i === ctx.index ? "w-3 bg-white" : "bg-white/50 hover:bg-white/75"
|
|
280
|
+
)
|
|
281
|
+
},
|
|
282
|
+
i
|
|
283
|
+
))
|
|
284
|
+
}
|
|
285
|
+
);
|
|
286
|
+
}, "CarouselDots");
|
|
287
|
+
var Carousel = Object.assign(CarouselRoot, {
|
|
288
|
+
Content: CarouselContent,
|
|
289
|
+
Item: CarouselItem,
|
|
290
|
+
Previous: CarouselPrevious,
|
|
291
|
+
Next: CarouselNext,
|
|
292
|
+
Dots: CarouselDots
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
exports.Carousel = Carousel;
|
|
296
|
+
//# sourceMappingURL=index.cjs.map
|
|
297
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/components/Carousel/Carousel.web.tsx"],"names":["createContext","useContext","useState","useRef","useId","useCallback","next","useEffect","jsx","Children"],"mappings":";;;;;;;;;AAeO,SAAS,MAAM,MAAA,EAA8B;AAChD,EAAA,MAAM,MAAgB,EAAC;AACvB,EAAA,KAAA,MAAW,SAAS,MAAA,EAAQ;AACxB,IAAA,MAAA,CAAO,KAAK,KAAK,CAAA;AAAA,EACrB;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AA,CAAI,KAAA;AAAA,UACzB,YAAA,EAAY,CAAA,YAAA,EAAe,CAAA,GAAI,CAAC,CAAA,CAAA;AAAA,UAChC,OAAA,EAAS,MAAM,GAAA,CAAI,QAAA,CAAS,CAAC,CAAA;AAAA,UAC7B,SAAA,EAAW,EAAA;AAAA,YACP,yCAAA;AAAA,YACA,CAAA,KAAM,GAAA,CAAI,KAAA,GAAQ,cAAA,GAAiB;AAAA;AACvC,SAAA;AAAA,QATK;AAAA,OAWZ;AAAA;AAAA,GACL;AAER,CAAA,EA7BqB,cAAA,CAAA;AAwDd,IAAM,QAAA,GAAW,MAAA,CAAO,MAAA,CAAO,YAAA,EAAc;AAAA,EAChD,OAAA,EAAS,eAAA;AAAA,EACT,IAAA,EAAM,YAAA;AAAA,EACN,QAAA,EAAU,gBAAA;AAAA,EACV,IAAA,EAAM,YAAA;AAAA,EACN,IAAA,EAAM;AACV,CAAC","file":"index.cjs","sourcesContent":["// cn — class-name merger. clsx-compatible shape.\n//\n// Intentionally does NOT deduplicate Tailwind conflicts (e.g. \"text-sm text-lg\").\n// That's `tailwind-merge`'s job; we defer adding it until a component actually\n// needs it, to keep the core tree-shakable and the runtime zero-dep.\n\nexport type ClassInput =\n | string\n | number\n | boolean\n | null\n | undefined\n | ClassInput[]\n | Record<string, boolean | number | null | undefined>;\n\nexport function cn(...inputs: ClassInput[]): string {\n const out: string[] = [];\n for (const input of inputs) {\n append(out, input);\n }\n return out.join(' ');\n}\n\nfunction append(out: string[], input: ClassInput): void {\n if (!input) {\n return;\n }\n if (typeof input === 'string') {\n if (input.length > 0) {\n out.push(input);\n }\n return;\n }\n if (typeof input === 'number') {\n return; // numbers are never class names\n }\n if (Array.isArray(input)) {\n for (const inner of input) {\n append(out, inner);\n }\n return;\n }\n if (typeof input === 'object') {\n for (const key of Object.keys(input)) {\n if (input[key]) {\n out.push(key);\n }\n }\n }\n}\n","'use client';\n\nimport {\n Children,\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\ntype CarouselContextValue = {\n index: number;\n count: number;\n loop: boolean;\n orientation: 'horizontal' | 'vertical';\n scrollTo: (idx: number) => void;\n next: () => void;\n prev: () => void;\n listRef: React.RefObject<HTMLDivElement | null>;\n setCount: (n: number) => void;\n id: string;\n};\n\nconst CarouselContext = createContext<CarouselContextValue | null>(null);\n\nfunction useCarouselContext(caller: string): CarouselContextValue {\n const ctx = useContext(CarouselContext);\n if (!ctx) {\n throw new Error(`<${caller}> must be rendered inside <Carousel>.`);\n }\n return ctx;\n}\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\nexport type CarouselProps = {\n /** Controlled current index. */\n index?: number;\n /** Initial index (uncontrolled). @defaultValue 0 */\n defaultIndex?: number;\n /** Fires with the new index. */\n onIndexChange?: (index: number) => void;\n /** Whether navigation wraps from last to first and vice-versa. @defaultValue false */\n loop?: boolean;\n /** Scroll axis. @defaultValue 'horizontal' */\n orientation?: 'horizontal' | 'vertical';\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nconst CarouselRoot = ({\n index: controlledIndex,\n defaultIndex = 0,\n onIndexChange,\n loop = false,\n orientation = 'horizontal',\n children,\n className,\n testID,\n}: CarouselProps) => {\n const [inner, setInner] = useState(defaultIndex);\n const isControlled = controlledIndex !== undefined;\n const index = isControlled ? (controlledIndex as number) : inner;\n const [count, setCount] = useState(0);\n const listRef = useRef<HTMLDivElement | null>(null);\n const id = useId();\n\n const setIndex = useCallback(\n (next: number) => {\n if (!isControlled) {\n setInner(next);\n }\n onIndexChange?.(next);\n },\n [isControlled, onIndexChange]\n );\n\n const scrollTo = useCallback(\n (idx: number) => {\n const list = listRef.current;\n if (!list) {\n return;\n }\n const item = list.children[idx] as HTMLElement | undefined;\n if (!item) {\n return;\n }\n item.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });\n setIndex(idx);\n },\n [setIndex]\n );\n\n const next = useCallback(() => {\n if (count === 0) {\n return;\n }\n if (index < count - 1) {\n scrollTo(index + 1);\n } else if (loop) {\n scrollTo(0);\n }\n }, [index, count, loop, scrollTo]);\n\n const prev = useCallback(() => {\n if (count === 0) {\n return;\n }\n if (index > 0) {\n scrollTo(index - 1);\n } else if (loop) {\n scrollTo(count - 1);\n }\n }, [index, count, loop, scrollTo]);\n\n // Keep index in sync if external scroll happens\n useEffect(() => {\n const list = listRef.current;\n if (!list) {\n return;\n }\n const handleScroll = () => {\n const { scrollLeft, scrollTop, offsetWidth, offsetHeight } = list;\n const pos = orientation === 'horizontal' ? scrollLeft : scrollTop;\n const size = orientation === 'horizontal' ? offsetWidth : offsetHeight;\n if (size === 0) {\n return;\n }\n const newIdx = Math.round(pos / size);\n if (newIdx !== index) {\n setIndex(newIdx);\n }\n };\n list.addEventListener('scroll', handleScroll, { passive: true });\n return () => list.removeEventListener('scroll', handleScroll);\n }, [orientation, index, setIndex]);\n\n return (\n <CarouselContext.Provider\n value={{ index, count, loop, orientation, scrollTo, next, prev, listRef, setCount, id }}\n >\n <section\n aria-label={testID ?? 'Carousel'}\n className={cn('relative overflow-hidden', className)}\n data-testid={testID}\n >\n {children}\n </section>\n </CarouselContext.Provider>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Content — the scroll container\n// ---------------------------------------------------------------------------\n\nexport type CarouselContentProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nconst CarouselContent = ({ children, className, testID }: CarouselContentProps) => {\n const ctx = useCarouselContext('Carousel.Content');\n\n // Count items\n const childCount = Children.count(children);\n useEffect(() => {\n ctx.setCount(childCount);\n }, [childCount, ctx.setCount]);\n\n const isHorizontal = ctx.orientation === 'horizontal';\n\n return (\n <div\n ref={ctx.listRef}\n data-testid={testID}\n className={cn(\n 'flex',\n isHorizontal\n ? 'flex-row overflow-x-auto overflow-y-hidden'\n : 'flex-col overflow-y-auto overflow-x-hidden',\n className\n )}\n style={{\n scrollSnapType: isHorizontal ? 'x mandatory' : 'y mandatory',\n scrollBehavior: 'smooth',\n WebkitOverflowScrolling: 'touch',\n // Hide scrollbar\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n {children}\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Item\n// ---------------------------------------------------------------------------\n\nexport type CarouselItemProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nconst CarouselItem = ({ children, className, testID }: CarouselItemProps) => {\n const ctx = useCarouselContext('Carousel.Item');\n const isHorizontal = ctx.orientation === 'horizontal';\n return (\n <div\n data-testid={testID}\n className={cn('shrink-0', isHorizontal ? 'w-full' : 'h-full', className)}\n style={{\n scrollSnapAlign: 'start',\n minWidth: isHorizontal ? '100%' : undefined,\n minHeight: !isHorizontal ? '100%' : undefined,\n }}\n >\n {children}\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Previous / Next buttons\n// ---------------------------------------------------------------------------\n\nexport type CarouselButtonProps = {\n className?: string;\n testID?: string;\n children?: ReactNode;\n};\n\nconst CarouselPrevious = ({ className, testID, children }: CarouselButtonProps) => {\n const ctx = useCarouselContext('Carousel.Previous');\n const disabled = !ctx.loop && ctx.index === 0;\n return (\n <button\n type=\"button\"\n aria-label=\"Previous slide\"\n disabled={disabled}\n data-testid={testID}\n onClick={ctx.prev}\n className={cn(\n 'absolute left-2 top-1/2 z-10 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-full bg-white/80 shadow hover:bg-white disabled:opacity-40',\n className\n )}\n >\n {children ?? (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n className=\"h-4 w-4\"\n aria-hidden=\"true\"\n >\n <path d=\"M15 18l-6-6 6-6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )}\n </button>\n );\n};\n\nconst CarouselNext = ({ className, testID, children }: CarouselButtonProps) => {\n const ctx = useCarouselContext('Carousel.Next');\n const disabled = !ctx.loop && ctx.index >= ctx.count - 1;\n return (\n <button\n type=\"button\"\n aria-label=\"Next slide\"\n disabled={disabled}\n data-testid={testID}\n onClick={ctx.next}\n className={cn(\n 'absolute right-2 top-1/2 z-10 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-full bg-white/80 shadow hover:bg-white disabled:opacity-40',\n className\n )}\n >\n {children ?? (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n className=\"h-4 w-4\"\n aria-hidden=\"true\"\n >\n <path d=\"M9 18l6-6-6-6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )}\n </button>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Dots\n// ---------------------------------------------------------------------------\n\nexport type CarouselDotsProps = {\n className?: string;\n testID?: string;\n};\n\nconst CarouselDots = ({ className, testID }: CarouselDotsProps) => {\n const ctx = useCarouselContext('Carousel.Dots');\n if (ctx.count === 0) {\n return null;\n }\n return (\n <div\n role=\"tablist\"\n aria-label=\"Slide navigation\"\n data-testid={testID}\n className={cn('absolute bottom-3 left-0 right-0 flex items-center justify-center gap-1.5', className)}\n >\n {Array.from({ length: ctx.count }, (_, i) => (\n <button\n // biome-ignore lint/suspicious/noArrayIndexKey: dot index IS its stable identity\n key={i}\n type=\"button\"\n role=\"tab\"\n aria-selected={i === ctx.index}\n aria-label={`Go to slide ${i + 1}`}\n onClick={() => ctx.scrollTo(i)}\n className={cn(\n 'h-1.5 w-1.5 rounded-full transition-all',\n i === ctx.index ? 'w-3 bg-white' : 'bg-white/50 hover:bg-white/75'\n )}\n />\n ))}\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Public compound export\n// ---------------------------------------------------------------------------\n\n/**\n * Paged horizontal (or vertical) slider with CSS scroll-snap.\n *\n * Composition:\n * - `Carousel.Content` — the scroll container\n * - `Carousel.Item` — each slide\n * - `Carousel.Previous` / `Carousel.Next` — navigation buttons\n * - `Carousel.Dots` — dot pagination indicators\n *\n * ```tsx\n * <Carousel>\n * <Carousel.Content>\n * <Carousel.Item><img src=\"a.jpg\" /></Carousel.Item>\n * <Carousel.Item><img src=\"b.jpg\" /></Carousel.Item>\n * </Carousel.Content>\n * <Carousel.Previous />\n * <Carousel.Next />\n * <Carousel.Dots />\n * </Carousel>\n * ```\n */\nexport const Carousel = Object.assign(CarouselRoot, {\n Content: CarouselContent,\n Item: CarouselItem,\n Previous: CarouselPrevious,\n Next: CarouselNext,\n Dots: CarouselDots,\n});\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type CarouselProps = {
|
|
5
|
+
/** Controlled current index. */
|
|
6
|
+
index?: number;
|
|
7
|
+
/** Initial index (uncontrolled). @defaultValue 0 */
|
|
8
|
+
defaultIndex?: number;
|
|
9
|
+
/** Fires with the new index. */
|
|
10
|
+
onIndexChange?: (index: number) => void;
|
|
11
|
+
/** Whether navigation wraps from last to first and vice-versa. @defaultValue false */
|
|
12
|
+
loop?: boolean;
|
|
13
|
+
/** Scroll axis. @defaultValue 'horizontal' */
|
|
14
|
+
orientation?: 'horizontal' | 'vertical';
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
testID?: string;
|
|
18
|
+
};
|
|
19
|
+
type CarouselContentProps = {
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
testID?: string;
|
|
23
|
+
};
|
|
24
|
+
type CarouselItemProps = {
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
testID?: string;
|
|
28
|
+
};
|
|
29
|
+
type CarouselButtonProps = {
|
|
30
|
+
className?: string;
|
|
31
|
+
testID?: string;
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
};
|
|
34
|
+
type CarouselDotsProps = {
|
|
35
|
+
className?: string;
|
|
36
|
+
testID?: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Paged horizontal (or vertical) slider with CSS scroll-snap.
|
|
40
|
+
*
|
|
41
|
+
* Composition:
|
|
42
|
+
* - `Carousel.Content` — the scroll container
|
|
43
|
+
* - `Carousel.Item` — each slide
|
|
44
|
+
* - `Carousel.Previous` / `Carousel.Next` — navigation buttons
|
|
45
|
+
* - `Carousel.Dots` — dot pagination indicators
|
|
46
|
+
*
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <Carousel>
|
|
49
|
+
* <Carousel.Content>
|
|
50
|
+
* <Carousel.Item><img src="a.jpg" /></Carousel.Item>
|
|
51
|
+
* <Carousel.Item><img src="b.jpg" /></Carousel.Item>
|
|
52
|
+
* </Carousel.Content>
|
|
53
|
+
* <Carousel.Previous />
|
|
54
|
+
* <Carousel.Next />
|
|
55
|
+
* <Carousel.Dots />
|
|
56
|
+
* </Carousel>
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare const Carousel: (({ index: controlledIndex, defaultIndex, onIndexChange, loop, orientation, children, className, testID, }: CarouselProps) => react_jsx_runtime.JSX.Element) & {
|
|
60
|
+
Content: ({ children, className, testID }: CarouselContentProps) => react_jsx_runtime.JSX.Element;
|
|
61
|
+
Item: ({ children, className, testID }: CarouselItemProps) => react_jsx_runtime.JSX.Element;
|
|
62
|
+
Previous: ({ className, testID, children }: CarouselButtonProps) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
Next: ({ className, testID, children }: CarouselButtonProps) => react_jsx_runtime.JSX.Element;
|
|
64
|
+
Dots: ({ className, testID }: CarouselDotsProps) => react_jsx_runtime.JSX.Element | null;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { Carousel, type CarouselButtonProps, type CarouselContentProps, type CarouselDotsProps, type CarouselItemProps, type CarouselProps };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type CarouselProps = {
|
|
5
|
+
/** Controlled current index. */
|
|
6
|
+
index?: number;
|
|
7
|
+
/** Initial index (uncontrolled). @defaultValue 0 */
|
|
8
|
+
defaultIndex?: number;
|
|
9
|
+
/** Fires with the new index. */
|
|
10
|
+
onIndexChange?: (index: number) => void;
|
|
11
|
+
/** Whether navigation wraps from last to first and vice-versa. @defaultValue false */
|
|
12
|
+
loop?: boolean;
|
|
13
|
+
/** Scroll axis. @defaultValue 'horizontal' */
|
|
14
|
+
orientation?: 'horizontal' | 'vertical';
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
testID?: string;
|
|
18
|
+
};
|
|
19
|
+
type CarouselContentProps = {
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
testID?: string;
|
|
23
|
+
};
|
|
24
|
+
type CarouselItemProps = {
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
testID?: string;
|
|
28
|
+
};
|
|
29
|
+
type CarouselButtonProps = {
|
|
30
|
+
className?: string;
|
|
31
|
+
testID?: string;
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
};
|
|
34
|
+
type CarouselDotsProps = {
|
|
35
|
+
className?: string;
|
|
36
|
+
testID?: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Paged horizontal (or vertical) slider with CSS scroll-snap.
|
|
40
|
+
*
|
|
41
|
+
* Composition:
|
|
42
|
+
* - `Carousel.Content` — the scroll container
|
|
43
|
+
* - `Carousel.Item` — each slide
|
|
44
|
+
* - `Carousel.Previous` / `Carousel.Next` — navigation buttons
|
|
45
|
+
* - `Carousel.Dots` — dot pagination indicators
|
|
46
|
+
*
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <Carousel>
|
|
49
|
+
* <Carousel.Content>
|
|
50
|
+
* <Carousel.Item><img src="a.jpg" /></Carousel.Item>
|
|
51
|
+
* <Carousel.Item><img src="b.jpg" /></Carousel.Item>
|
|
52
|
+
* </Carousel.Content>
|
|
53
|
+
* <Carousel.Previous />
|
|
54
|
+
* <Carousel.Next />
|
|
55
|
+
* <Carousel.Dots />
|
|
56
|
+
* </Carousel>
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare const Carousel: (({ index: controlledIndex, defaultIndex, onIndexChange, loop, orientation, children, className, testID, }: CarouselProps) => react_jsx_runtime.JSX.Element) & {
|
|
60
|
+
Content: ({ children, className, testID }: CarouselContentProps) => react_jsx_runtime.JSX.Element;
|
|
61
|
+
Item: ({ children, className, testID }: CarouselItemProps) => react_jsx_runtime.JSX.Element;
|
|
62
|
+
Previous: ({ className, testID, children }: CarouselButtonProps) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
Next: ({ className, testID, children }: CarouselButtonProps) => react_jsx_runtime.JSX.Element;
|
|
64
|
+
Dots: ({ className, testID }: CarouselDotsProps) => react_jsx_runtime.JSX.Element | null;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { Carousel, type CarouselButtonProps, type CarouselContentProps, type CarouselDotsProps, type CarouselItemProps, type CarouselProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { Checkbox } from '../../chunk-
|
|
1
|
+
export { Checkbox } from '../../chunk-H2LHWJ52.js';
|
|
2
2
|
import '../../chunk-7Z4NMNX6.js';
|
|
3
3
|
import '../../chunk-ZIBNLXIV.js';
|
|
4
4
|
import '../../chunk-5A2QOOVN.js';
|
|
5
|
-
import '../../chunk-CHXHRJNZ.js';
|
|
6
5
|
import '../../chunk-R5JMDDCB.js';
|
|
6
|
+
import '../../chunk-CHXHRJNZ.js';
|
|
7
7
|
import '../../chunk-WCQVDF3K.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
9
9
|
//# sourceMappingURL=index.js.map
|