@causw/core 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Avatar/Avatar.d.cts +2 -2
- package/dist/components/Avatar/Avatar.styles.d.cts +3 -3
- package/dist/components/BottomNavigation/BottomNavigation.cjs +78 -0
- package/dist/components/BottomNavigation/BottomNavigation.d.cts +48 -0
- package/dist/components/BottomNavigation/BottomNavigation.d.cts.map +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.d.mts +49 -0
- package/dist/components/BottomNavigation/BottomNavigation.d.mts.map +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.mjs +78 -0
- package/dist/components/BottomNavigation/BottomNavigation.mjs.map +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.styles.cjs +26 -0
- package/dist/components/BottomNavigation/BottomNavigation.styles.d.cts +57 -0
- package/dist/components/BottomNavigation/BottomNavigation.styles.d.cts.map +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.styles.d.mts +57 -0
- package/dist/components/BottomNavigation/BottomNavigation.styles.d.mts.map +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.styles.mjs +26 -0
- package/dist/components/BottomNavigation/BottomNavigation.styles.mjs.map +1 -0
- package/dist/components/BottomNavigation/hooks/useBottomNavigationContext.cjs +22 -0
- package/dist/components/BottomNavigation/hooks/useBottomNavigationContext.mjs +19 -0
- package/dist/components/BottomNavigation/hooks/useBottomNavigationContext.mjs.map +1 -0
- package/dist/components/BottomNavigation/index.d.mts +1 -0
- package/dist/components/BottomSheet/BottomSheet.cjs +94 -0
- package/dist/components/BottomSheet/BottomSheet.d.cts +69 -0
- package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.d.mts +69 -0
- package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.mjs +93 -0
- package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.styles.cjs +21 -0
- package/dist/components/BottomSheet/BottomSheet.styles.d.cts +54 -0
- package/dist/components/BottomSheet/BottomSheet.styles.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.styles.d.mts +54 -0
- package/dist/components/BottomSheet/BottomSheet.styles.d.mts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.styles.mjs +21 -0
- package/dist/components/BottomSheet/BottomSheet.styles.mjs.map +1 -0
- package/dist/components/BottomSheet/index.d.mts +1 -0
- package/dist/components/Button/Button.d.cts +2 -2
- package/dist/components/Button/Button.d.mts +2 -2
- package/dist/components/Button/Button.d.mts.map +1 -1
- package/dist/components/Button/Button.styles.d.cts +3 -3
- package/dist/components/Button/Button.styles.d.mts +3 -3
- package/dist/components/CTAButton/CTAButton.d.cts +2 -2
- package/dist/components/CTAButton/CTAButton.d.mts +2 -2
- package/dist/components/CTAButton/CTAButton.styles.d.cts +3 -3
- package/dist/components/CTAButton/CTAButton.styles.d.mts +3 -3
- package/dist/components/Calendar/Calendar.cjs +191 -0
- package/dist/components/Calendar/Calendar.d.cts +40 -0
- package/dist/components/Calendar/Calendar.d.cts.map +1 -0
- package/dist/components/Calendar/Calendar.d.mts +40 -0
- package/dist/components/Calendar/Calendar.d.mts.map +1 -0
- package/dist/components/Calendar/Calendar.mjs +190 -0
- package/dist/components/Calendar/Calendar.mjs.map +1 -0
- package/dist/components/Calendar/Calendar.styles.cjs +121 -0
- package/dist/components/Calendar/Calendar.styles.d.cts +269 -0
- package/dist/components/Calendar/Calendar.styles.d.cts.map +1 -0
- package/dist/components/Calendar/Calendar.styles.d.mts +269 -0
- package/dist/components/Calendar/Calendar.styles.d.mts.map +1 -0
- package/dist/components/Calendar/Calendar.styles.mjs +120 -0
- package/dist/components/Calendar/Calendar.styles.mjs.map +1 -0
- package/dist/components/Calendar/index.d.mts +1 -0
- package/dist/components/Checkbox/Checkbox.d.cts +4 -4
- package/dist/components/Checkbox/Checkbox.d.mts +4 -4
- package/dist/components/Checkbox/Checkbox.styles.d.cts +3 -3
- package/dist/components/Checkbox/Checkbox.styles.d.mts +3 -3
- package/dist/components/Chip/Chip.d.cts +2 -2
- package/dist/components/Chip/Chip.styles.d.cts +3 -3
- package/dist/components/Dialog/Dialog.d.cts +5 -5
- package/dist/components/Dialog/Dialog.d.mts +5 -5
- package/dist/components/Dialog/Dialog.styles.d.cts +3 -3
- package/dist/components/Dialog/Dialog.styles.d.cts.map +1 -1
- package/dist/components/Dialog/Dialog.styles.d.mts +3 -3
- package/dist/components/Drawer/Drawer.cjs +41 -0
- package/dist/components/Drawer/Drawer.d.cts +29 -0
- package/dist/components/Drawer/Drawer.d.cts.map +1 -0
- package/dist/components/Drawer/Drawer.d.mts +29 -0
- package/dist/components/Drawer/Drawer.d.mts.map +1 -0
- package/dist/components/Drawer/Drawer.mjs +40 -0
- package/dist/components/Drawer/Drawer.mjs.map +1 -0
- package/dist/components/Drawer/Drawer.styles.cjs +23 -0
- package/dist/components/Drawer/Drawer.styles.d.cts +36 -0
- package/dist/components/Drawer/Drawer.styles.d.cts.map +1 -0
- package/dist/components/Drawer/Drawer.styles.d.mts +36 -0
- package/dist/components/Drawer/Drawer.styles.d.mts.map +1 -0
- package/dist/components/Drawer/Drawer.styles.mjs +23 -0
- package/dist/components/Drawer/Drawer.styles.mjs.map +1 -0
- package/dist/components/Drawer/index.d.mts +1 -0
- package/dist/components/Dropdown/Dropdown.d.cts +3 -3
- package/dist/components/Dropdown/Dropdown.d.mts +3 -3
- package/dist/components/Dropdown/Dropdown.styles.d.cts +3 -3
- package/dist/components/Dropdown/Dropdown.styles.d.mts +3 -3
- package/dist/components/Field/Field.d.mts +5 -5
- package/dist/components/Float/Float.styles.d.cts +3 -3
- package/dist/components/Float/Float.styles.d.mts +3 -3
- package/dist/components/FloatingActionButton/FloatingActionButton.d.cts +2 -2
- package/dist/components/FloatingActionButton/FloatingActionButton.d.mts +2 -2
- package/dist/components/FloatingActionButton/FloatingActionButton.styles.d.cts +3 -3
- package/dist/components/Grid/Grid.styles.d.cts +3 -3
- package/dist/components/Grid/Grid.styles.d.mts +3 -3
- package/dist/components/HStack/HStack.d.cts +2 -2
- package/dist/components/Modal/Modal.d.cts +7 -7
- package/dist/components/Modal/Modal.styles.d.cts +3 -3
- package/dist/components/Primitive/Primitive.d.cts +16 -16
- package/dist/components/Radio/Radio.d.cts +3 -3
- package/dist/components/Radio/Radio.d.mts +3 -3
- package/dist/components/Radio/Radio.d.mts.map +1 -1
- package/dist/components/RatioChart/RatioChart.d.cts +5 -5
- package/dist/components/RatioChart/RatioChart.d.mts +5 -5
- package/dist/components/RatioChart/RatioChartEditor.d.cts +2 -2
- package/dist/components/RatioChart/RatioChartEditor.d.mts +2 -2
- package/dist/components/Select/Select.d.cts +5 -5
- package/dist/components/Select/Select.d.mts +5 -5
- package/dist/components/Select/Select.styles.d.cts +3 -3
- package/dist/components/Sidebar/Sidebar.cjs +95 -0
- package/dist/components/Sidebar/Sidebar.d.cts +64 -0
- package/dist/components/Sidebar/Sidebar.d.cts.map +1 -0
- package/dist/components/Sidebar/Sidebar.d.mts +65 -0
- package/dist/components/Sidebar/Sidebar.d.mts.map +1 -0
- package/dist/components/Sidebar/Sidebar.mjs +95 -0
- package/dist/components/Sidebar/Sidebar.mjs.map +1 -0
- package/dist/components/Sidebar/Sidebar.styles.cjs +32 -0
- package/dist/components/Sidebar/Sidebar.styles.d.cts +75 -0
- package/dist/components/Sidebar/Sidebar.styles.d.cts.map +1 -0
- package/dist/components/Sidebar/Sidebar.styles.d.mts +75 -0
- package/dist/components/Sidebar/Sidebar.styles.d.mts.map +1 -0
- package/dist/components/Sidebar/Sidebar.styles.mjs +32 -0
- package/dist/components/Sidebar/Sidebar.styles.mjs.map +1 -0
- package/dist/components/Sidebar/hooks/useSidebarContext.cjs +22 -0
- package/dist/components/Sidebar/hooks/useSidebarContext.d.cts +5 -0
- package/dist/components/Sidebar/hooks/useSidebarContext.d.cts.map +1 -0
- package/dist/components/Sidebar/hooks/useSidebarContext.d.mts +7 -0
- package/dist/components/Sidebar/hooks/useSidebarContext.d.mts.map +1 -0
- package/dist/components/Sidebar/hooks/useSidebarContext.mjs +19 -0
- package/dist/components/Sidebar/hooks/useSidebarContext.mjs.map +1 -0
- package/dist/components/Sidebar/index.d.mts +2 -0
- package/dist/components/Spacer/Spacer.styles.d.cts +3 -3
- package/dist/components/Spacer/Spacer.styles.d.cts.map +1 -1
- package/dist/components/Tab/Tab.d.cts +6 -6
- package/dist/components/Tab/Tab.styles.d.cts +3 -3
- package/dist/components/Text/Text.d.cts +1 -1
- package/dist/components/Text/Text.d.mts +1 -1
- package/dist/components/Text/Text.styles.d.mts +3 -3
- package/dist/components/TextArea/TextArea.d.cts +4 -4
- package/dist/components/TextArea/TextArea.styles.d.mts +3 -3
- package/dist/components/TextInput/TextInput.d.mts +2 -2
- package/dist/components/TextInput/TextInput.styles.d.mts +3 -3
- package/dist/components/Toast/Toast.d.cts +3 -3
- package/dist/components/Toast/Toast.styles.d.cts +3 -3
- package/dist/components/Toggle/Toggle.d.cts +4 -4
- package/dist/components/Toggle/Toggle.d.mts +4 -4
- package/dist/components/Toggle/Toggle.styles.d.cts +3 -3
- package/dist/components/Toggle/Toggle.styles.d.mts +3 -3
- package/dist/components/VStack/VStack.d.cts +2 -2
- package/dist/components/index.d.mts +12 -1
- package/dist/hooks/bottomSheet/useBottomSheet.cjs +15 -0
- package/dist/hooks/bottomSheet/useBottomSheet.mjs +13 -0
- package/dist/hooks/bottomSheet/useBottomSheet.mjs.map +1 -0
- package/dist/index.cjs +10 -0
- package/dist/index.d.cts +7 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.mjs +6 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PrimitiveProps } from "../Primitive/Primitive.cjs";
|
|
2
2
|
import { AvatarVariants } from "./Avatar.styles.cjs";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime41 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/Avatar/Avatar.d.ts
|
|
7
7
|
interface AvatarProps extends Omit<React$1.ComponentPropsWithoutRef<'span'>, 'alt'>, PrimitiveProps, AvatarVariants {
|
|
@@ -17,7 +17,7 @@ declare const Avatar: {
|
|
|
17
17
|
className,
|
|
18
18
|
fallback,
|
|
19
19
|
...props
|
|
20
|
-
}: AvatarProps):
|
|
20
|
+
}: AvatarProps): react_jsx_runtime41.JSX.Element;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
23
23
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as tailwind_variants21 from "tailwind-variants";
|
|
2
2
|
import { VariantProps } from "tailwind-variants";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Avatar/Avatar.styles.d.ts
|
|
5
|
-
declare const avatar:
|
|
5
|
+
declare const avatar: tailwind_variants21.TVReturnType<{
|
|
6
6
|
size: {
|
|
7
7
|
xs: {
|
|
8
8
|
root: string;
|
|
@@ -46,7 +46,7 @@ declare const avatar: tailwind_variants25.TVReturnType<{
|
|
|
46
46
|
root: string;
|
|
47
47
|
image: string;
|
|
48
48
|
fallback: string;
|
|
49
|
-
},
|
|
49
|
+
}, tailwind_variants21.TVReturnType<{
|
|
50
50
|
size: {
|
|
51
51
|
xs: {
|
|
52
52
|
root: string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
4
|
+
const require_Primitive = require('../Primitive/Primitive.cjs');
|
|
5
|
+
const require_BottomNavigation_styles = require('./BottomNavigation.styles.cjs');
|
|
6
|
+
const require_useBottomNavigationContext = require('./hooks/useBottomNavigationContext.cjs');
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
|
|
9
|
+
//#region src/components/BottomNavigation/BottomNavigation.tsx
|
|
10
|
+
const BottomNavigationRoot = ({ children, selected, onSelectChange, ...props }) => {
|
|
11
|
+
const { root } = require_BottomNavigation_styles.bottomNavigation();
|
|
12
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_useBottomNavigationContext.BottomNavigationContext.Provider, {
|
|
13
|
+
value: {
|
|
14
|
+
selected,
|
|
15
|
+
onSelectChange
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Primitive.Primitive.nav, {
|
|
18
|
+
className: root(),
|
|
19
|
+
...props,
|
|
20
|
+
children
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const BottomNavigationItem = ({ selected, value, children, onClick, ...props }) => {
|
|
25
|
+
const rootContext = require_useBottomNavigationContext.useBottomNavigationContext();
|
|
26
|
+
const isSelected = selected ?? (rootContext.selected !== void 0 && value !== void 0 ? rootContext.selected === value : false);
|
|
27
|
+
const { item } = require_BottomNavigation_styles.bottomNavigation({
|
|
28
|
+
selected: isSelected,
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
const handleClick = (e) => {
|
|
32
|
+
onClick?.(e);
|
|
33
|
+
if (!e.defaultPrevented && rootContext.onSelectChange && value !== void 0) rootContext.onSelectChange(value);
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_useBottomNavigationContext.BottomNavigationItemContext.Provider, {
|
|
36
|
+
value: { selected: isSelected },
|
|
37
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Primitive.Primitive.button, {
|
|
38
|
+
type: "button",
|
|
39
|
+
className: item(),
|
|
40
|
+
onClick: handleClick,
|
|
41
|
+
...props,
|
|
42
|
+
children
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const BottomNavigationIcon = ({ children, selected, ...props }) => {
|
|
47
|
+
const itemContext = require_useBottomNavigationContext.useBottomNavigationItemContext();
|
|
48
|
+
const { icon } = require_BottomNavigation_styles.bottomNavigation({
|
|
49
|
+
selected: selected ?? itemContext.selected,
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Primitive.Primitive.svg, {
|
|
53
|
+
asChild: true,
|
|
54
|
+
className: icon(),
|
|
55
|
+
...props,
|
|
56
|
+
children
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const BottomNavigationLabel = ({ children, selected, ...props }) => {
|
|
60
|
+
const itemContext = require_useBottomNavigationContext.useBottomNavigationItemContext();
|
|
61
|
+
const { label } = require_BottomNavigation_styles.bottomNavigation({
|
|
62
|
+
selected: selected ?? itemContext.selected,
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Primitive.Primitive.span, {
|
|
66
|
+
className: label(),
|
|
67
|
+
...props,
|
|
68
|
+
children
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const BottomNavigation = Object.assign(BottomNavigationRoot, {
|
|
72
|
+
Item: BottomNavigationItem,
|
|
73
|
+
Icon: BottomNavigationIcon,
|
|
74
|
+
Label: BottomNavigationLabel
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
exports.BottomNavigation = BottomNavigation;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PrimitiveProps } from "../Primitive/Primitive.cjs";
|
|
2
|
+
import { BottomNavigationVariants } from "./BottomNavigation.styles.cjs";
|
|
3
|
+
import { ComponentProps, SVGProps } from "react";
|
|
4
|
+
import * as react_jsx_runtime72 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/BottomNavigation/BottomNavigation.d.ts
|
|
7
|
+
interface BottomNavigationRootProps extends ComponentProps<'nav'>, PrimitiveProps {
|
|
8
|
+
selected?: string;
|
|
9
|
+
onSelectChange?: (value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
interface BottomNavigationItemProps extends ComponentProps<'button'>, PrimitiveProps, Omit<BottomNavigationVariants, 'selected'> {
|
|
12
|
+
value?: string;
|
|
13
|
+
selected?: boolean;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
interface BottomNavigationIconProps extends SVGProps<SVGSVGElement>, PrimitiveProps, BottomNavigationVariants {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
interface BottomNavigationLabelProps extends ComponentProps<'span'>, PrimitiveProps, BottomNavigationVariants {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare const BottomNavigation: (({
|
|
23
|
+
children,
|
|
24
|
+
selected,
|
|
25
|
+
onSelectChange,
|
|
26
|
+
...props
|
|
27
|
+
}: BottomNavigationRootProps) => react_jsx_runtime72.JSX.Element) & {
|
|
28
|
+
Item: ({
|
|
29
|
+
selected,
|
|
30
|
+
value,
|
|
31
|
+
children,
|
|
32
|
+
onClick,
|
|
33
|
+
...props
|
|
34
|
+
}: BottomNavigationItemProps) => react_jsx_runtime72.JSX.Element;
|
|
35
|
+
Icon: ({
|
|
36
|
+
children,
|
|
37
|
+
selected,
|
|
38
|
+
...props
|
|
39
|
+
}: BottomNavigationIconProps) => react_jsx_runtime72.JSX.Element;
|
|
40
|
+
Label: ({
|
|
41
|
+
children,
|
|
42
|
+
selected,
|
|
43
|
+
...props
|
|
44
|
+
}: BottomNavigationLabelProps) => react_jsx_runtime72.JSX.Element;
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
export { BottomNavigation };
|
|
48
|
+
//# sourceMappingURL=BottomNavigation.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomNavigation.d.cts","names":[],"sources":["../../../src/components/BottomNavigation/BottomNavigation.tsx"],"mappings":";;;;;;UAgBiB,yBAAA,SACP,cAAA,SAAuB,cAAA;EAC/B,QAAA;EACA,cAAA,IAAkB,KAAA;AAAA;AAAA,UAmBV,yBAAA,SAEN,cAAA,YACA,cAAA,EACA,IAAA,CAAK,wBAAA;EACP,KAAA;EACA,QAAA;EACA,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,UA6CR,yBAAA,SACA,QAAA,CAAS,aAAA,GAAgB,cAAA,EAAgB,wBAAA;EACjD,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,UAoBR,0BAAA,SACA,cAAA,UAAwB,cAAA,EAAgB,wBAAA;EAChD,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,cAoBL,gBAAA;EAAgB,QAAA;EAAA,QAAA;EAAA,cAAA;EAAA,GAAA;AAAA,GA3G1B,yBAAA,KAAyB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;KA2BzB,yBAAA,KAAyB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;;KA6CzB,yBAAA,KAAyB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;;KAsBzB,0BAAA,KAA0B,mBAAA,CAAA,GAAA,CAAA,OAAA;AAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PrimitiveProps } from "../Primitive/Primitive.mjs";
|
|
2
|
+
import "../Primitive/index.mjs";
|
|
3
|
+
import { BottomNavigationVariants } from "./BottomNavigation.styles.mjs";
|
|
4
|
+
import { ComponentProps, SVGProps } from "react";
|
|
5
|
+
import * as react_jsx_runtime73 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/BottomNavigation/BottomNavigation.d.ts
|
|
8
|
+
interface BottomNavigationRootProps extends ComponentProps<'nav'>, PrimitiveProps {
|
|
9
|
+
selected?: string;
|
|
10
|
+
onSelectChange?: (value: string) => void;
|
|
11
|
+
}
|
|
12
|
+
interface BottomNavigationItemProps extends ComponentProps<'button'>, PrimitiveProps, Omit<BottomNavigationVariants, 'selected'> {
|
|
13
|
+
value?: string;
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
interface BottomNavigationIconProps extends SVGProps<SVGSVGElement>, PrimitiveProps, BottomNavigationVariants {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
interface BottomNavigationLabelProps extends ComponentProps<'span'>, PrimitiveProps, BottomNavigationVariants {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare const BottomNavigation: (({
|
|
24
|
+
children,
|
|
25
|
+
selected,
|
|
26
|
+
onSelectChange,
|
|
27
|
+
...props
|
|
28
|
+
}: BottomNavigationRootProps) => react_jsx_runtime73.JSX.Element) & {
|
|
29
|
+
Item: ({
|
|
30
|
+
selected,
|
|
31
|
+
value,
|
|
32
|
+
children,
|
|
33
|
+
onClick,
|
|
34
|
+
...props
|
|
35
|
+
}: BottomNavigationItemProps) => react_jsx_runtime73.JSX.Element;
|
|
36
|
+
Icon: ({
|
|
37
|
+
children,
|
|
38
|
+
selected,
|
|
39
|
+
...props
|
|
40
|
+
}: BottomNavigationIconProps) => react_jsx_runtime73.JSX.Element;
|
|
41
|
+
Label: ({
|
|
42
|
+
children,
|
|
43
|
+
selected,
|
|
44
|
+
...props
|
|
45
|
+
}: BottomNavigationLabelProps) => react_jsx_runtime73.JSX.Element;
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { BottomNavigation };
|
|
49
|
+
//# sourceMappingURL=BottomNavigation.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomNavigation.d.mts","names":[],"sources":["../../../src/components/BottomNavigation/BottomNavigation.tsx"],"mappings":";;;;;;;UAgBiB,yBAAA,SACP,cAAA,SAAuB,cAAA;EAC/B,QAAA;EACA,cAAA,IAAkB,KAAA;AAAA;AAAA,UAmBV,yBAAA,SAEN,cAAA,YACA,cAAA,EACA,IAAA,CAAK,wBAAA;EACP,KAAA;EACA,QAAA;EACA,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,UA6CR,yBAAA,SACA,QAAA,CAAS,aAAA,GAAgB,cAAA,EAAgB,wBAAA;EACjD,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,UAoBR,0BAAA,SACA,cAAA,UAAwB,cAAA,EAAgB,wBAAA;EAChD,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,cAoBL,gBAAA;EAAgB,QAAA;EAAA,QAAA;EAAA,cAAA;EAAA,GAAA;AAAA,GA3G1B,yBAAA,KAAyB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;KA2BzB,yBAAA,KAAyB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;;KA6CzB,yBAAA,KAAyB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;;KAsBzB,0BAAA,KAA0B,mBAAA,CAAA,GAAA,CAAA,OAAA;AAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Primitive } from "../Primitive/Primitive.mjs";
|
|
4
|
+
import { bottomNavigation } from "./BottomNavigation.styles.mjs";
|
|
5
|
+
import { BottomNavigationContext, BottomNavigationItemContext, useBottomNavigationContext, useBottomNavigationItemContext } from "./hooks/useBottomNavigationContext.mjs";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/BottomNavigation/BottomNavigation.tsx
|
|
9
|
+
const BottomNavigationRoot = ({ children, selected, onSelectChange, ...props }) => {
|
|
10
|
+
const { root } = bottomNavigation();
|
|
11
|
+
return /* @__PURE__ */ jsx(BottomNavigationContext.Provider, {
|
|
12
|
+
value: {
|
|
13
|
+
selected,
|
|
14
|
+
onSelectChange
|
|
15
|
+
},
|
|
16
|
+
children: /* @__PURE__ */ jsx(Primitive.nav, {
|
|
17
|
+
className: root(),
|
|
18
|
+
...props,
|
|
19
|
+
children
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
const BottomNavigationItem = ({ selected, value, children, onClick, ...props }) => {
|
|
24
|
+
const rootContext = useBottomNavigationContext();
|
|
25
|
+
const isSelected = selected ?? (rootContext.selected !== void 0 && value !== void 0 ? rootContext.selected === value : false);
|
|
26
|
+
const { item } = bottomNavigation({
|
|
27
|
+
selected: isSelected,
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
const handleClick = (e) => {
|
|
31
|
+
onClick?.(e);
|
|
32
|
+
if (!e.defaultPrevented && rootContext.onSelectChange && value !== void 0) rootContext.onSelectChange(value);
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ jsx(BottomNavigationItemContext.Provider, {
|
|
35
|
+
value: { selected: isSelected },
|
|
36
|
+
children: /* @__PURE__ */ jsx(Primitive.button, {
|
|
37
|
+
type: "button",
|
|
38
|
+
className: item(),
|
|
39
|
+
onClick: handleClick,
|
|
40
|
+
...props,
|
|
41
|
+
children
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
const BottomNavigationIcon = ({ children, selected, ...props }) => {
|
|
46
|
+
const itemContext = useBottomNavigationItemContext();
|
|
47
|
+
const { icon } = bottomNavigation({
|
|
48
|
+
selected: selected ?? itemContext.selected,
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
return /* @__PURE__ */ jsx(Primitive.svg, {
|
|
52
|
+
asChild: true,
|
|
53
|
+
className: icon(),
|
|
54
|
+
...props,
|
|
55
|
+
children
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
const BottomNavigationLabel = ({ children, selected, ...props }) => {
|
|
59
|
+
const itemContext = useBottomNavigationItemContext();
|
|
60
|
+
const { label } = bottomNavigation({
|
|
61
|
+
selected: selected ?? itemContext.selected,
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
65
|
+
className: label(),
|
|
66
|
+
...props,
|
|
67
|
+
children
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
const BottomNavigation = Object.assign(BottomNavigationRoot, {
|
|
71
|
+
Item: BottomNavigationItem,
|
|
72
|
+
Icon: BottomNavigationIcon,
|
|
73
|
+
Label: BottomNavigationLabel
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
export { BottomNavigation };
|
|
78
|
+
//# sourceMappingURL=BottomNavigation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomNavigation.mjs","names":[],"sources":["../../../src/components/BottomNavigation/BottomNavigation.tsx"],"sourcesContent":["'use client';\n\nimport { ComponentProps, SVGProps } from 'react';\nimport {\n bottomNavigation,\n BottomNavigationVariants,\n} from './BottomNavigation.styles';\nimport { Primitive, PrimitiveProps } from '../Primitive';\n\nimport {\n BottomNavigationContext,\n useBottomNavigationContext,\n BottomNavigationItemContext,\n useBottomNavigationItemContext,\n} from './hooks/useBottomNavigationContext';\n\nexport interface BottomNavigationRootProps\n extends ComponentProps<'nav'>, PrimitiveProps {\n selected?: string;\n onSelectChange?: (value: string) => void;\n}\n\nconst BottomNavigationRoot = ({\n children,\n selected,\n onSelectChange,\n ...props\n}: BottomNavigationRootProps) => {\n const { root } = bottomNavigation();\n return (\n <BottomNavigationContext.Provider value={{ selected, onSelectChange }}>\n <Primitive.nav className={root()} {...props}>\n {children}\n </Primitive.nav>\n </BottomNavigationContext.Provider>\n );\n};\n\ninterface BottomNavigationItemProps\n extends\n ComponentProps<'button'>,\n PrimitiveProps,\n Omit<BottomNavigationVariants, 'selected'> {\n value?: string;\n selected?: boolean;\n children: React.ReactNode;\n}\n\nconst BottomNavigationItem = ({\n selected,\n value,\n children,\n onClick,\n ...props\n}: BottomNavigationItemProps) => {\n const rootContext = useBottomNavigationContext();\n\n const isSelected =\n selected ??\n (rootContext.selected !== undefined && value !== undefined\n ? rootContext.selected === value\n : false);\n\n const { item } = bottomNavigation({ selected: isSelected, ...props });\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n if (\n !e.defaultPrevented &&\n rootContext.onSelectChange &&\n value !== undefined\n ) {\n rootContext.onSelectChange(value);\n }\n };\n\n return (\n <BottomNavigationItemContext.Provider value={{ selected: isSelected }}>\n <Primitive.button\n type=\"button\"\n className={item()}\n onClick={handleClick}\n {...props}\n >\n {children}\n </Primitive.button>\n </BottomNavigationItemContext.Provider>\n );\n};\n\ninterface BottomNavigationIconProps\n extends SVGProps<SVGSVGElement>, PrimitiveProps, BottomNavigationVariants {\n children: React.ReactNode;\n}\n\nconst BottomNavigationIcon = ({\n children,\n selected,\n ...props\n}: BottomNavigationIconProps) => {\n const itemContext = useBottomNavigationItemContext();\n const isSelected = selected ?? itemContext.selected;\n\n const { icon } = bottomNavigation({ selected: isSelected, ...props });\n\n return (\n <Primitive.svg asChild className={icon()} {...props}>\n {children}\n </Primitive.svg>\n );\n};\n\ninterface BottomNavigationLabelProps\n extends ComponentProps<'span'>, PrimitiveProps, BottomNavigationVariants {\n children: React.ReactNode;\n}\n\nconst BottomNavigationLabel = ({\n children,\n selected,\n ...props\n}: BottomNavigationLabelProps) => {\n const itemContext = useBottomNavigationItemContext();\n const isSelected = selected ?? itemContext.selected;\n\n const { label } = bottomNavigation({ selected: isSelected, ...props });\n\n return (\n <Primitive.span className={label()} {...props}>\n {children}\n </Primitive.span>\n );\n};\n\nexport const BottomNavigation = Object.assign(BottomNavigationRoot, {\n Item: BottomNavigationItem,\n Icon: BottomNavigationIcon,\n Label: BottomNavigationLabel,\n});\n"],"mappings":";;;;;;;;AAsBA,MAAM,wBAAwB,EAC5B,UACA,UACA,gBACA,GAAG,YAC4B;CAC/B,MAAM,EAAE,SAAS,kBAAkB;AACnC,QACE,oBAAC,wBAAwB;EAAS,OAAO;GAAE;GAAU;GAAgB;YACnE,oBAAC,UAAU;GAAI,WAAW,MAAM;GAAE,GAAI;GACnC;IACa;GACiB;;AAcvC,MAAM,wBAAwB,EAC5B,UACA,OACA,UACA,SACA,GAAG,YAC4B;CAC/B,MAAM,cAAc,4BAA4B;CAEhD,MAAM,aACJ,aACC,YAAY,aAAa,UAAa,UAAU,SAC7C,YAAY,aAAa,QACzB;CAEN,MAAM,EAAE,SAAS,iBAAiB;EAAE,UAAU;EAAY,GAAG;EAAO,CAAC;CAErE,MAAM,eAAe,MAA2C;AAC9D,YAAU,EAAE;AACZ,MACE,CAAC,EAAE,oBACH,YAAY,kBACZ,UAAU,OAEV,aAAY,eAAe,MAAM;;AAIrC,QACE,oBAAC,4BAA4B;EAAS,OAAO,EAAE,UAAU,YAAY;YACnE,oBAAC,UAAU;GACT,MAAK;GACL,WAAW,MAAM;GACjB,SAAS;GACT,GAAI;GAEH;IACgB;GACkB;;AAS3C,MAAM,wBAAwB,EAC5B,UACA,UACA,GAAG,YAC4B;CAC/B,MAAM,cAAc,gCAAgC;CAGpD,MAAM,EAAE,SAAS,iBAAiB;EAAE,UAFjB,YAAY,YAAY;EAEe,GAAG;EAAO,CAAC;AAErE,QACE,oBAAC,UAAU;EAAI;EAAQ,WAAW,MAAM;EAAE,GAAI;EAC3C;GACa;;AASpB,MAAM,yBAAyB,EAC7B,UACA,UACA,GAAG,YAC6B;CAChC,MAAM,cAAc,gCAAgC;CAGpD,MAAM,EAAE,UAAU,iBAAiB;EAAE,UAFlB,YAAY,YAAY;EAEgB,GAAG;EAAO,CAAC;AAEtE,QACE,oBAAC,UAAU;EAAK,WAAW,OAAO;EAAE,GAAI;EACrC;GACc;;AAIrB,MAAa,mBAAmB,OAAO,OAAO,sBAAsB;CAClE,MAAM;CACN,MAAM;CACN,OAAO;CACR,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let tailwind_variants = require("tailwind-variants");
|
|
3
|
+
|
|
4
|
+
//#region src/components/BottomNavigation/BottomNavigation.styles.ts
|
|
5
|
+
const bottomNavigation = (0, tailwind_variants.tv)({
|
|
6
|
+
slots: {
|
|
7
|
+
root: "fixed right-0 bottom-0 left-0 z-sticky flex h-15 items-center justify-between border-t border-gray-200 px-12 py-2 pb-safe",
|
|
8
|
+
item: "group flex flex-1 flex-col items-center justify-center gap-1 text-xs transition-colors",
|
|
9
|
+
icon: "w-5 h-5",
|
|
10
|
+
label: "typo-caption-12-semibold text-center"
|
|
11
|
+
},
|
|
12
|
+
variants: { selected: {
|
|
13
|
+
true: {
|
|
14
|
+
icon: "fill-gray-700",
|
|
15
|
+
label: "text-gray-600"
|
|
16
|
+
},
|
|
17
|
+
false: {
|
|
18
|
+
icon: "fill-gray-300 group-hover:fill-gray-500 group-active:fill-gray-500",
|
|
19
|
+
label: "text-gray-300 group-hover:text-gray-500 group-active:text-gray-500"
|
|
20
|
+
}
|
|
21
|
+
} },
|
|
22
|
+
defaultVariants: { selected: false }
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.bottomNavigation = bottomNavigation;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as tailwind_variants45 from "tailwind-variants";
|
|
2
|
+
import { VariantProps } from "tailwind-variants";
|
|
3
|
+
|
|
4
|
+
//#region src/components/BottomNavigation/BottomNavigation.styles.d.ts
|
|
5
|
+
declare const bottomNavigation: tailwind_variants45.TVReturnType<{
|
|
6
|
+
selected: {
|
|
7
|
+
true: {
|
|
8
|
+
icon: string;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
false: {
|
|
12
|
+
icon: string;
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
root: string;
|
|
18
|
+
item: string;
|
|
19
|
+
icon: string;
|
|
20
|
+
label: string;
|
|
21
|
+
}, undefined, {
|
|
22
|
+
selected: {
|
|
23
|
+
true: {
|
|
24
|
+
icon: string;
|
|
25
|
+
label: string;
|
|
26
|
+
};
|
|
27
|
+
false: {
|
|
28
|
+
icon: string;
|
|
29
|
+
label: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
root: string;
|
|
34
|
+
item: string;
|
|
35
|
+
icon: string;
|
|
36
|
+
label: string;
|
|
37
|
+
}, tailwind_variants45.TVReturnType<{
|
|
38
|
+
selected: {
|
|
39
|
+
true: {
|
|
40
|
+
icon: string;
|
|
41
|
+
label: string;
|
|
42
|
+
};
|
|
43
|
+
false: {
|
|
44
|
+
icon: string;
|
|
45
|
+
label: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}, {
|
|
49
|
+
root: string;
|
|
50
|
+
item: string;
|
|
51
|
+
icon: string;
|
|
52
|
+
label: string;
|
|
53
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
54
|
+
type BottomNavigationVariants = VariantProps<typeof bottomNavigation>;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { BottomNavigationVariants };
|
|
57
|
+
//# sourceMappingURL=BottomNavigation.styles.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomNavigation.styles.d.cts","names":[],"sources":["../../../src/components/BottomNavigation/BottomNavigation.styles.ts"],"mappings":";;;;cAEa,gBAAA,EAuBX,mBAAA,CAvB2B,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuB3B,mBAAA,CAAA,YAAA;;;;;;;;;;;;;;;;;KAEU,wBAAA,GAA2B,YAAA,QAAoB,gBAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as tailwind_variants47 from "tailwind-variants";
|
|
2
|
+
import { VariantProps } from "tailwind-variants";
|
|
3
|
+
|
|
4
|
+
//#region src/components/BottomNavigation/BottomNavigation.styles.d.ts
|
|
5
|
+
declare const bottomNavigation: tailwind_variants47.TVReturnType<{
|
|
6
|
+
selected: {
|
|
7
|
+
true: {
|
|
8
|
+
icon: string;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
false: {
|
|
12
|
+
icon: string;
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
root: string;
|
|
18
|
+
item: string;
|
|
19
|
+
icon: string;
|
|
20
|
+
label: string;
|
|
21
|
+
}, undefined, {
|
|
22
|
+
selected: {
|
|
23
|
+
true: {
|
|
24
|
+
icon: string;
|
|
25
|
+
label: string;
|
|
26
|
+
};
|
|
27
|
+
false: {
|
|
28
|
+
icon: string;
|
|
29
|
+
label: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
root: string;
|
|
34
|
+
item: string;
|
|
35
|
+
icon: string;
|
|
36
|
+
label: string;
|
|
37
|
+
}, tailwind_variants47.TVReturnType<{
|
|
38
|
+
selected: {
|
|
39
|
+
true: {
|
|
40
|
+
icon: string;
|
|
41
|
+
label: string;
|
|
42
|
+
};
|
|
43
|
+
false: {
|
|
44
|
+
icon: string;
|
|
45
|
+
label: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}, {
|
|
49
|
+
root: string;
|
|
50
|
+
item: string;
|
|
51
|
+
icon: string;
|
|
52
|
+
label: string;
|
|
53
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
54
|
+
type BottomNavigationVariants = VariantProps<typeof bottomNavigation>;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { BottomNavigationVariants };
|
|
57
|
+
//# sourceMappingURL=BottomNavigation.styles.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomNavigation.styles.d.mts","names":[],"sources":["../../../src/components/BottomNavigation/BottomNavigation.styles.ts"],"mappings":";;;;cAEa,gBAAA,EAuBX,mBAAA,CAvB2B,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuB3B,mBAAA,CAAA,YAAA;;;;;;;;;;;;;;;;;KAEU,wBAAA,GAA2B,YAAA,QAAoB,gBAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
|
|
3
|
+
//#region src/components/BottomNavigation/BottomNavigation.styles.ts
|
|
4
|
+
const bottomNavigation = tv({
|
|
5
|
+
slots: {
|
|
6
|
+
root: "fixed right-0 bottom-0 left-0 z-sticky flex h-15 items-center justify-between border-t border-gray-200 px-12 py-2 pb-safe",
|
|
7
|
+
item: "group flex flex-1 flex-col items-center justify-center gap-1 text-xs transition-colors",
|
|
8
|
+
icon: "w-5 h-5",
|
|
9
|
+
label: "typo-caption-12-semibold text-center"
|
|
10
|
+
},
|
|
11
|
+
variants: { selected: {
|
|
12
|
+
true: {
|
|
13
|
+
icon: "fill-gray-700",
|
|
14
|
+
label: "text-gray-600"
|
|
15
|
+
},
|
|
16
|
+
false: {
|
|
17
|
+
icon: "fill-gray-300 group-hover:fill-gray-500 group-active:fill-gray-500",
|
|
18
|
+
label: "text-gray-300 group-hover:text-gray-500 group-active:text-gray-500"
|
|
19
|
+
}
|
|
20
|
+
} },
|
|
21
|
+
defaultVariants: { selected: false }
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { bottomNavigation };
|
|
26
|
+
//# sourceMappingURL=BottomNavigation.styles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomNavigation.styles.mjs","names":[],"sources":["../../../src/components/BottomNavigation/BottomNavigation.styles.ts"],"sourcesContent":["import { tv, VariantProps } from 'tailwind-variants';\n\nexport const bottomNavigation = tv({\n slots: {\n root: 'fixed right-0 bottom-0 left-0 z-sticky flex h-15 items-center justify-between border-t border-gray-200 px-12 py-2 pb-safe',\n item: 'group flex flex-1 flex-col items-center justify-center gap-1 text-xs transition-colors',\n icon: 'w-5 h-5',\n label: 'typo-caption-12-semibold text-center',\n },\n variants: {\n selected: {\n true: {\n icon: 'fill-gray-700',\n label: 'text-gray-600',\n },\n false: {\n icon: 'fill-gray-300 group-hover:fill-gray-500 group-active:fill-gray-500',\n label:\n 'text-gray-300 group-hover:text-gray-500 group-active:text-gray-500',\n },\n },\n },\n defaultVariants: {\n selected: false,\n },\n});\n\nexport type BottomNavigationVariants = VariantProps<typeof bottomNavigation>;\n"],"mappings":";;;AAEA,MAAa,mBAAmB,GAAG;CACjC,OAAO;EACL,MAAM;EACN,MAAM;EACN,MAAM;EACN,OAAO;EACR;CACD,UAAU,EACR,UAAU;EACR,MAAM;GACJ,MAAM;GACN,OAAO;GACR;EACD,OAAO;GACL,MAAM;GACN,OACE;GACH;EACF,EACF;CACD,iBAAiB,EACf,UAAU,OACX;CACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
|
|
4
|
+
//#region src/components/BottomNavigation/hooks/useBottomNavigationContext.ts
|
|
5
|
+
const BottomNavigationContext = (0, react.createContext)(null);
|
|
6
|
+
const useBottomNavigationContext = () => {
|
|
7
|
+
const context = (0, react.useContext)(BottomNavigationContext);
|
|
8
|
+
if (!context) throw new Error("BottomNavigation compound components must be used within BottomNavigation");
|
|
9
|
+
return context;
|
|
10
|
+
};
|
|
11
|
+
const BottomNavigationItemContext = (0, react.createContext)(null);
|
|
12
|
+
const useBottomNavigationItemContext = () => {
|
|
13
|
+
const context = (0, react.useContext)(BottomNavigationItemContext);
|
|
14
|
+
if (!context) throw new Error("BottomNavigation Item compound components must be used within BottomNavigation.Item");
|
|
15
|
+
return context;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.BottomNavigationContext = BottomNavigationContext;
|
|
20
|
+
exports.BottomNavigationItemContext = BottomNavigationItemContext;
|
|
21
|
+
exports.useBottomNavigationContext = useBottomNavigationContext;
|
|
22
|
+
exports.useBottomNavigationItemContext = useBottomNavigationItemContext;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/BottomNavigation/hooks/useBottomNavigationContext.ts
|
|
4
|
+
const BottomNavigationContext = createContext(null);
|
|
5
|
+
const useBottomNavigationContext = () => {
|
|
6
|
+
const context = useContext(BottomNavigationContext);
|
|
7
|
+
if (!context) throw new Error("BottomNavigation compound components must be used within BottomNavigation");
|
|
8
|
+
return context;
|
|
9
|
+
};
|
|
10
|
+
const BottomNavigationItemContext = createContext(null);
|
|
11
|
+
const useBottomNavigationItemContext = () => {
|
|
12
|
+
const context = useContext(BottomNavigationItemContext);
|
|
13
|
+
if (!context) throw new Error("BottomNavigation Item compound components must be used within BottomNavigation.Item");
|
|
14
|
+
return context;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { BottomNavigationContext, BottomNavigationItemContext, useBottomNavigationContext, useBottomNavigationItemContext };
|
|
19
|
+
//# sourceMappingURL=useBottomNavigationContext.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBottomNavigationContext.mjs","names":[],"sources":["../../../../src/components/BottomNavigation/hooks/useBottomNavigationContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport interface BottomNavigationContextValue {\n selected?: string;\n onSelectChange?: (value: string) => void;\n}\n\nexport const BottomNavigationContext =\n createContext<BottomNavigationContextValue | null>(null);\n\nexport const useBottomNavigationContext = () => {\n const context = useContext(BottomNavigationContext);\n if (!context) {\n throw new Error(\n 'BottomNavigation compound components must be used within BottomNavigation',\n );\n }\n return context;\n};\n\n// Item Context (for styling children)\nexport interface BottomNavigationItemContextValue {\n selected: boolean;\n}\n\nexport const BottomNavigationItemContext =\n createContext<BottomNavigationItemContextValue | null>(null);\n\nexport const useBottomNavigationItemContext = () => {\n const context = useContext(BottomNavigationItemContext);\n if (!context) {\n throw new Error(\n 'BottomNavigation Item compound components must be used within BottomNavigation.Item',\n );\n }\n return context;\n};\n"],"mappings":";;;AAOA,MAAa,0BACX,cAAmD,KAAK;AAE1D,MAAa,mCAAmC;CAC9C,MAAM,UAAU,WAAW,wBAAwB;AACnD,KAAI,CAAC,QACH,OAAM,IAAI,MACR,4EACD;AAEH,QAAO;;AAQT,MAAa,8BACX,cAAuD,KAAK;AAE9D,MAAa,uCAAuC;CAClD,MAAM,UAAU,WAAW,4BAA4B;AACvD,KAAI,CAAC,QACH,OAAM,IAAI,MACR,sFACD;AAEH,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { BottomNavigation } from "./BottomNavigation.mjs";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_Text = require('../Text/Text.cjs');
|
|
3
|
+
const require_useBottomSheet = require('../../hooks/bottomSheet/useBottomSheet.cjs');
|
|
4
|
+
const require_Drawer = require('../Drawer/Drawer.cjs');
|
|
5
|
+
const require_BottomSheet_styles = require('./BottomSheet.styles.cjs');
|
|
6
|
+
let react = require("react");
|
|
7
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
|
|
10
|
+
//#region src/components/BottomSheet/BottomSheet.tsx
|
|
11
|
+
const BottomSheetRoot = ({ children, open: controlledOpen, defaultOpen = false, onOpenChange, headerAlign = "left" }) => {
|
|
12
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, react.useState)(defaultOpen);
|
|
13
|
+
const isControlled = controlledOpen !== void 0;
|
|
14
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
15
|
+
const handleOpenChange = (newOpen) => {
|
|
16
|
+
if (!isControlled) setUncontrolledOpen(newOpen);
|
|
17
|
+
onOpenChange?.(newOpen);
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_useBottomSheet.BottomSheetContext.Provider, {
|
|
20
|
+
value: {
|
|
21
|
+
headerAlign,
|
|
22
|
+
isOpen,
|
|
23
|
+
onOpen: () => handleOpenChange(true),
|
|
24
|
+
onClose: () => handleOpenChange(false)
|
|
25
|
+
},
|
|
26
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Drawer.Drawer.Root, {
|
|
27
|
+
open: isOpen,
|
|
28
|
+
onOpenChange: handleOpenChange,
|
|
29
|
+
children
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const BottomSheetTrigger = require_Drawer.Drawer.Trigger;
|
|
34
|
+
const BottomSheetHandle = () => {
|
|
35
|
+
const { handle } = require_BottomSheet_styles.bottomSheet();
|
|
36
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: handle() });
|
|
37
|
+
};
|
|
38
|
+
const BottomSheetContent = ({ children, className, ...props }) => {
|
|
39
|
+
const { content } = require_BottomSheet_styles.bottomSheet();
|
|
40
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Drawer.Drawer.Portal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Drawer.Drawer.Overlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Drawer.Drawer.Content, {
|
|
41
|
+
className: content({ className }),
|
|
42
|
+
...props,
|
|
43
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BottomSheetHandle, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
44
|
+
className: "w-full",
|
|
45
|
+
children
|
|
46
|
+
})]
|
|
47
|
+
})] });
|
|
48
|
+
};
|
|
49
|
+
const BottomSheetHeader = ({ title, className }) => {
|
|
50
|
+
const { headerAlign } = require_useBottomSheet.useBottomSheet();
|
|
51
|
+
const { header } = require_BottomSheet_styles.bottomSheet({ headerAlign });
|
|
52
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
53
|
+
className: header({ className }),
|
|
54
|
+
children: title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Drawer.Drawer.Title, {
|
|
55
|
+
asChild: true,
|
|
56
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
57
|
+
as: "h2",
|
|
58
|
+
typography: "subtitle-18-bold",
|
|
59
|
+
children: title
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const BottomSheetBody = ({ className, children, maxHeight }) => {
|
|
65
|
+
const { body } = require_BottomSheet_styles.bottomSheet();
|
|
66
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
67
|
+
className: body({ className }),
|
|
68
|
+
style: { maxHeight },
|
|
69
|
+
children
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
const BottomSheetFooter = ({ className, children }) => {
|
|
73
|
+
const { footer } = require_BottomSheet_styles.bottomSheet();
|
|
74
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
75
|
+
className: footer({ className }),
|
|
76
|
+
children
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const BottomSheet = Object.assign(BottomSheetRoot, {
|
|
80
|
+
Trigger: BottomSheetTrigger,
|
|
81
|
+
Content: BottomSheetContent,
|
|
82
|
+
Header: BottomSheetHeader,
|
|
83
|
+
Body: BottomSheetBody,
|
|
84
|
+
Footer: BottomSheetFooter
|
|
85
|
+
});
|
|
86
|
+
BottomSheetRoot.displayName = "BottomSheet";
|
|
87
|
+
BottomSheetTrigger.displayName = "BottomSheet.Trigger";
|
|
88
|
+
BottomSheetContent.displayName = "BottomSheet.Content";
|
|
89
|
+
BottomSheetHeader.displayName = "BottomSheet.Header";
|
|
90
|
+
BottomSheetBody.displayName = "BottomSheet.Body";
|
|
91
|
+
BottomSheetFooter.displayName = "BottomSheet.Footer";
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
exports.BottomSheet = BottomSheet;
|