@causw/core 0.0.11 → 0.0.13
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.d.mts +2 -2
- package/dist/components/Avatar/Avatar.styles.d.cts +3 -3
- package/dist/components/Avatar/Avatar.styles.d.cts.map +1 -1
- package/dist/components/Avatar/Avatar.styles.d.mts +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/Box/Box.styles.d.cts +3 -3
- package/dist/components/Box/Box.styles.d.cts.map +1 -1
- package/dist/components/Button/Button.d.cts +2 -2
- package/dist/components/Button/Button.styles.d.mts +3 -3
- package/dist/components/CTAButton/CTAButton.d.cts +2 -2
- 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.cts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.mts +4 -4
- package/dist/components/Checkbox/Checkbox.d.mts.map +1 -1
- 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.d.mts +2 -2
- package/dist/components/Chip/Chip.styles.d.cts +3 -3
- package/dist/components/Chip/Chip.styles.d.cts.map +1 -1
- package/dist/components/Chip/Chip.styles.d.mts +3 -3
- package/dist/components/Dialog/Dialog.d.cts +13 -13
- 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.cts +5 -5
- package/dist/components/Field/Field.d.cts.map +1 -1
- 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/FloatingActionButton/FloatingActionButton.styles.d.mts +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/HStack/HStack.d.mts +2 -2
- package/dist/components/Modal/Modal.d.cts +7 -7
- package/dist/components/Modal/Modal.d.mts +7 -7
- package/dist/components/Modal/Modal.styles.d.cts +3 -3
- package/dist/components/Modal/Modal.styles.d.mts +3 -3
- package/dist/components/Primitive/Primitive.d.cts +16 -16
- package/dist/components/Radio/Radio.d.cts +3 -3
- 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/Select/Select.styles.d.mts +3 -3
- package/dist/components/Select/Select.styles.d.mts.map +1 -1
- package/dist/components/Separator/Separator.styles.d.cts +3 -3
- package/dist/components/Separator/Separator.styles.d.mts +3 -3
- package/dist/components/Separator/Separator.styles.d.mts.map +1 -1
- 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.mts +3 -3
- package/dist/components/Stack/Stack.styles.d.cts +3 -3
- package/dist/components/Stack/Stack.styles.d.cts.map +1 -1
- package/dist/components/Tab/Tab.d.cts +6 -6
- package/dist/components/Tab/Tab.d.mts +6 -6
- package/dist/components/Tab/Tab.styles.d.cts +3 -3
- package/dist/components/Tab/Tab.styles.d.mts +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.d.mts +4 -4
- package/dist/components/TextArea/TextArea.styles.d.mts +3 -3
- package/dist/components/TextInput/TextInput.d.cts +2 -2
- 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 +5 -5
- package/dist/components/Toast/Toast.d.cts.map +1 -1
- package/dist/components/Toast/Toast.d.mts +3 -3
- package/dist/components/Toast/Toast.styles.d.cts +3 -3
- package/dist/components/Toast/Toast.styles.d.mts +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.d.mts.map +1 -1
- package/dist/components/Toggle/Toggle.styles.d.mts +3 -3
- package/dist/components/VStack/VStack.d.cts +2 -2
- package/dist/components/VStack/VStack.d.mts +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,6 +1,6 @@
|
|
|
1
1
|
import { SelectVariants } from "./Select.styles.cjs";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
4
4
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
5
5
|
|
|
6
6
|
//#region src/components/Select/Select.d.ts
|
|
@@ -25,7 +25,7 @@ declare const Select: React$1.FC<SelectPrimitive.SelectProps> & {
|
|
|
25
25
|
children,
|
|
26
26
|
error,
|
|
27
27
|
...props
|
|
28
|
-
}: SelectTriggerProps):
|
|
28
|
+
}: SelectTriggerProps): react_jsx_runtime25.JSX.Element;
|
|
29
29
|
displayName: string | undefined;
|
|
30
30
|
};
|
|
31
31
|
Content: {
|
|
@@ -36,14 +36,14 @@ declare const Select: React$1.FC<SelectPrimitive.SelectProps> & {
|
|
|
36
36
|
sideOffset,
|
|
37
37
|
maxHeight,
|
|
38
38
|
...props
|
|
39
|
-
}: SelectContentProps):
|
|
39
|
+
}: SelectContentProps): react_jsx_runtime25.JSX.Element;
|
|
40
40
|
displayName: string | undefined;
|
|
41
41
|
};
|
|
42
42
|
Label: {
|
|
43
43
|
({
|
|
44
44
|
className,
|
|
45
45
|
...props
|
|
46
|
-
}: SelectLabelProps):
|
|
46
|
+
}: SelectLabelProps): react_jsx_runtime25.JSX.Element;
|
|
47
47
|
displayName: string | undefined;
|
|
48
48
|
};
|
|
49
49
|
Item: {
|
|
@@ -51,7 +51,7 @@ declare const Select: React$1.FC<SelectPrimitive.SelectProps> & {
|
|
|
51
51
|
className,
|
|
52
52
|
children,
|
|
53
53
|
...props
|
|
54
|
-
}: SelectItemProps):
|
|
54
|
+
}: SelectItemProps): react_jsx_runtime25.JSX.Element;
|
|
55
55
|
displayName: string | undefined;
|
|
56
56
|
};
|
|
57
57
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SelectVariants } from "./Select.styles.mjs";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
4
4
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
5
5
|
|
|
6
6
|
//#region src/components/Select/Select.d.ts
|
|
@@ -25,7 +25,7 @@ declare const Select: React$1.FC<SelectPrimitive.SelectProps> & {
|
|
|
25
25
|
children,
|
|
26
26
|
error,
|
|
27
27
|
...props
|
|
28
|
-
}: SelectTriggerProps):
|
|
28
|
+
}: SelectTriggerProps): react_jsx_runtime25.JSX.Element;
|
|
29
29
|
displayName: string | undefined;
|
|
30
30
|
};
|
|
31
31
|
Content: {
|
|
@@ -36,14 +36,14 @@ declare const Select: React$1.FC<SelectPrimitive.SelectProps> & {
|
|
|
36
36
|
sideOffset,
|
|
37
37
|
maxHeight,
|
|
38
38
|
...props
|
|
39
|
-
}: SelectContentProps):
|
|
39
|
+
}: SelectContentProps): react_jsx_runtime25.JSX.Element;
|
|
40
40
|
displayName: string | undefined;
|
|
41
41
|
};
|
|
42
42
|
Label: {
|
|
43
43
|
({
|
|
44
44
|
className,
|
|
45
45
|
...props
|
|
46
|
-
}: SelectLabelProps):
|
|
46
|
+
}: SelectLabelProps): react_jsx_runtime25.JSX.Element;
|
|
47
47
|
displayName: string | undefined;
|
|
48
48
|
};
|
|
49
49
|
Item: {
|
|
@@ -51,7 +51,7 @@ declare const Select: React$1.FC<SelectPrimitive.SelectProps> & {
|
|
|
51
51
|
className,
|
|
52
52
|
children,
|
|
53
53
|
...props
|
|
54
|
-
}: SelectItemProps):
|
|
54
|
+
}: SelectItemProps): react_jsx_runtime25.JSX.Element;
|
|
55
55
|
displayName: string | undefined;
|
|
56
56
|
};
|
|
57
57
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as tailwind_variants11 from "tailwind-variants";
|
|
2
2
|
import { VariantProps } from "tailwind-variants";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Select/Select.styles.d.ts
|
|
5
|
-
declare const select:
|
|
5
|
+
declare const select: tailwind_variants11.TVReturnType<{
|
|
6
6
|
error: {
|
|
7
7
|
true: {
|
|
8
8
|
trigger: string;
|
|
@@ -44,7 +44,7 @@ declare const select: tailwind_variants13.TVReturnType<{
|
|
|
44
44
|
item: string[];
|
|
45
45
|
label: string;
|
|
46
46
|
viewport: string;
|
|
47
|
-
},
|
|
47
|
+
}, tailwind_variants11.TVReturnType<{
|
|
48
48
|
error: {
|
|
49
49
|
true: {
|
|
50
50
|
trigger: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as tailwind_variants11 from "tailwind-variants";
|
|
2
2
|
import { VariantProps } from "tailwind-variants";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Select/Select.styles.d.ts
|
|
5
|
-
declare const select:
|
|
5
|
+
declare const select: tailwind_variants11.TVReturnType<{
|
|
6
6
|
error: {
|
|
7
7
|
true: {
|
|
8
8
|
trigger: string;
|
|
@@ -44,7 +44,7 @@ declare const select: tailwind_variants7.TVReturnType<{
|
|
|
44
44
|
item: string[];
|
|
45
45
|
label: string;
|
|
46
46
|
viewport: string;
|
|
47
|
-
},
|
|
47
|
+
}, tailwind_variants11.TVReturnType<{
|
|
48
48
|
error: {
|
|
49
49
|
true: {
|
|
50
50
|
trigger: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.styles.d.mts","names":[],"sources":["../../../src/components/Select/Select.styles.ts"],"mappings":";;;;cAEa,MAAA,EA+CX,
|
|
1
|
+
{"version":3,"file":"Select.styles.d.mts","names":[],"sources":["../../../src/components/Select/Select.styles.ts"],"mappings":";;;;cAEa,MAAA,EA+CX,mBAAA,CA/CiB,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CjB,mBAAA,CAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;KAEU,cAAA,GAAiB,YAAA,QAAoB,MAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as tailwind_variants7 from "tailwind-variants";
|
|
2
2
|
import { VariantProps } from "tailwind-variants";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Separator/Separator.styles.d.ts
|
|
5
|
-
declare const separator:
|
|
5
|
+
declare const separator: tailwind_variants7.TVReturnType<{
|
|
6
6
|
orientation: {
|
|
7
7
|
horizontal: string;
|
|
8
8
|
vertical: string;
|
|
@@ -12,7 +12,7 @@ declare const separator: tailwind_variants3.TVReturnType<{
|
|
|
12
12
|
horizontal: string;
|
|
13
13
|
vertical: string;
|
|
14
14
|
};
|
|
15
|
-
}, undefined,
|
|
15
|
+
}, undefined, tailwind_variants7.TVReturnType<{
|
|
16
16
|
orientation: {
|
|
17
17
|
horizontal: string;
|
|
18
18
|
vertical: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as tailwind_variants9 from "tailwind-variants";
|
|
2
2
|
import { VariantProps } from "tailwind-variants";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Separator/Separator.styles.d.ts
|
|
5
|
-
declare const separator:
|
|
5
|
+
declare const separator: tailwind_variants9.TVReturnType<{
|
|
6
6
|
orientation: {
|
|
7
7
|
horizontal: string;
|
|
8
8
|
vertical: string;
|
|
@@ -12,7 +12,7 @@ declare const separator: tailwind_variants11.TVReturnType<{
|
|
|
12
12
|
horizontal: string;
|
|
13
13
|
vertical: string;
|
|
14
14
|
};
|
|
15
|
-
}, undefined,
|
|
15
|
+
}, undefined, tailwind_variants9.TVReturnType<{
|
|
16
16
|
orientation: {
|
|
17
17
|
horizontal: string;
|
|
18
18
|
vertical: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Separator.styles.d.mts","names":[],"sources":["../../../src/components/Separator/Separator.styles.ts"],"mappings":";;;;cAEa,SAAA,EAWX,
|
|
1
|
+
{"version":3,"file":"Separator.styles.d.mts","names":[],"sources":["../../../src/components/Separator/Separator.styles.ts"],"mappings":";;;;cAEa,SAAA,EAWX,kBAAA,CAXoB,YAAA;;;;;;;;;;cAWpB,kBAAA,CAAA,YAAA;;;;;;KAEU,iBAAA,GAAoB,YAAA,QAAoB,SAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
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_Sidebar_styles = require('./Sidebar.styles.cjs');
|
|
6
|
+
const require_useSidebarContext = require('./hooks/useSidebarContext.cjs');
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
|
|
9
|
+
//#region src/components/Sidebar/Sidebar.tsx
|
|
10
|
+
const SidebarRoot = ({ children, selected, onSelectChange, ...props }) => {
|
|
11
|
+
const { root } = require_Sidebar_styles.sidebar();
|
|
12
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_useSidebarContext.SidebarContext.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 SidebarHeader = ({ children, ...props }) => {
|
|
25
|
+
const { header } = require_Sidebar_styles.sidebar();
|
|
26
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Primitive.Primitive.div, {
|
|
27
|
+
className: header(),
|
|
28
|
+
...props,
|
|
29
|
+
children
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const SidebarContent = ({ children, ...props }) => {
|
|
33
|
+
const { content } = require_Sidebar_styles.sidebar();
|
|
34
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Primitive.Primitive.div, {
|
|
35
|
+
className: content(),
|
|
36
|
+
...props,
|
|
37
|
+
children
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
const SidebarItem = ({ selected, value, children, onClick, ...props }) => {
|
|
41
|
+
const rootContext = require_useSidebarContext.useSidebarContext();
|
|
42
|
+
const isSelected = selected ?? (rootContext.selected !== void 0 && value !== void 0 ? rootContext.selected === value : false);
|
|
43
|
+
const { item } = require_Sidebar_styles.sidebar({ selected: isSelected });
|
|
44
|
+
const handleClick = (e) => {
|
|
45
|
+
onClick?.(e);
|
|
46
|
+
if (!e.defaultPrevented && rootContext.onSelectChange && value !== void 0) rootContext.onSelectChange(value);
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_useSidebarContext.SidebarItemContext.Provider, {
|
|
49
|
+
value: { selected: isSelected },
|
|
50
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Primitive.Primitive.button, {
|
|
51
|
+
type: "button",
|
|
52
|
+
className: item(),
|
|
53
|
+
onClick: handleClick,
|
|
54
|
+
...props,
|
|
55
|
+
children
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const SidebarItemIcon = ({ children, ...props }) => {
|
|
60
|
+
const { icon } = require_Sidebar_styles.sidebar({ selected: require_useSidebarContext.useSidebarItemContext().selected });
|
|
61
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Primitive.Primitive.svg, {
|
|
62
|
+
asChild: true,
|
|
63
|
+
className: icon(),
|
|
64
|
+
...props,
|
|
65
|
+
children
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const SidebarItemText = ({ children, ...props }) => {
|
|
69
|
+
const { text } = require_Sidebar_styles.sidebar({ selected: require_useSidebarContext.useSidebarItemContext().selected });
|
|
70
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Primitive.Primitive.span, {
|
|
71
|
+
className: text(),
|
|
72
|
+
...props,
|
|
73
|
+
children
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
const SidebarFooter = ({ children, ...props }) => {
|
|
77
|
+
const { footer } = require_Sidebar_styles.sidebar();
|
|
78
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Primitive.Primitive.div, {
|
|
79
|
+
className: footer(),
|
|
80
|
+
...props,
|
|
81
|
+
children
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
const sidebarBadgeClassName = require_Sidebar_styles.sidebar().badge();
|
|
85
|
+
const Sidebar = Object.assign(SidebarRoot, {
|
|
86
|
+
Header: SidebarHeader,
|
|
87
|
+
Content: SidebarContent,
|
|
88
|
+
Item: SidebarItem,
|
|
89
|
+
ItemIcon: SidebarItemIcon,
|
|
90
|
+
ItemText: SidebarItemText,
|
|
91
|
+
Footer: SidebarFooter
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
//#endregion
|
|
95
|
+
exports.Sidebar = Sidebar;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { PrimitiveProps } from "../Primitive/Primitive.cjs";
|
|
2
|
+
import { SidebarVariants } from "./Sidebar.styles.cjs";
|
|
3
|
+
import { SidebarValue } from "./hooks/useSidebarContext.cjs";
|
|
4
|
+
import { ComponentProps, SVGProps } from "react";
|
|
5
|
+
import * as react_jsx_runtime67 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Sidebar/Sidebar.d.ts
|
|
8
|
+
interface SidebarProps extends ComponentProps<'nav'>, PrimitiveProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
selected?: SidebarValue;
|
|
11
|
+
onSelectChange?: (value: SidebarValue) => void;
|
|
12
|
+
}
|
|
13
|
+
interface SidebarHeaderProps extends ComponentProps<'div'>, PrimitiveProps {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
interface SidebarContentProps extends ComponentProps<'div'>, PrimitiveProps {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
interface SidebarItemProps extends ComponentProps<'button'>, PrimitiveProps, Omit<SidebarVariants, 'selected'> {
|
|
20
|
+
value?: SidebarValue;
|
|
21
|
+
selected?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface SidebarItemIconProps extends SVGProps<SVGSVGElement>, PrimitiveProps {}
|
|
24
|
+
interface SidebarItemTextProps extends ComponentProps<'span'>, PrimitiveProps {}
|
|
25
|
+
interface SidebarFooterProps extends ComponentProps<'div'>, PrimitiveProps {
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
declare const Sidebar: (({
|
|
29
|
+
children,
|
|
30
|
+
selected,
|
|
31
|
+
onSelectChange,
|
|
32
|
+
...props
|
|
33
|
+
}: SidebarProps) => react_jsx_runtime67.JSX.Element) & {
|
|
34
|
+
Header: ({
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}: SidebarHeaderProps) => react_jsx_runtime67.JSX.Element;
|
|
38
|
+
Content: ({
|
|
39
|
+
children,
|
|
40
|
+
...props
|
|
41
|
+
}: SidebarContentProps) => react_jsx_runtime67.JSX.Element;
|
|
42
|
+
Item: ({
|
|
43
|
+
selected,
|
|
44
|
+
value,
|
|
45
|
+
children,
|
|
46
|
+
onClick,
|
|
47
|
+
...props
|
|
48
|
+
}: SidebarItemProps) => react_jsx_runtime67.JSX.Element;
|
|
49
|
+
ItemIcon: ({
|
|
50
|
+
children,
|
|
51
|
+
...props
|
|
52
|
+
}: SidebarItemIconProps) => react_jsx_runtime67.JSX.Element;
|
|
53
|
+
ItemText: ({
|
|
54
|
+
children,
|
|
55
|
+
...props
|
|
56
|
+
}: SidebarItemTextProps) => react_jsx_runtime67.JSX.Element;
|
|
57
|
+
Footer: ({
|
|
58
|
+
children,
|
|
59
|
+
...props
|
|
60
|
+
}: SidebarFooterProps) => react_jsx_runtime67.JSX.Element;
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { Sidebar };
|
|
64
|
+
//# sourceMappingURL=Sidebar.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.d.cts","names":[],"sources":["../../../src/components/Sidebar/Sidebar.tsx"],"mappings":";;;;;;;UAgBiB,YAAA,SAAqB,cAAA,SAAuB,cAAA;EAC3D,QAAA,EAAU,KAAA,CAAM,SAAA;EAChB,QAAA,GAAW,YAAA;EACX,cAAA,IAAkB,KAAA,EAAO,YAAA;AAAA;AAAA,UAmBV,kBAAA,SACP,cAAA,SAAuB,cAAA;EAC/B,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,UAaR,mBAAA,SAA4B,cAAA,SAAuB,cAAA;EAC3D,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,UAaR,gBAAA,SAEN,cAAA,YACA,cAAA,EACA,IAAA,CAAK,eAAA;EACP,KAAA,GAAQ,YAAA;EACR,QAAA;AAAA;AAAA,UA4CQ,oBAAA,SACA,QAAA,CAAS,aAAA,GAAgB,cAAA;AAAA,UAWzB,oBAAA,SAA6B,cAAA,UAAwB,cAAA;AAAA,UAYrD,kBAAA,SAA2B,cAAA,SAAuB,cAAA;EAC1D,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,cAaL,OAAA;EAAO,QAAA;EAAA,QAAA;EAAA,cAAA;EAAA,GAAA;AAAA,GAjIjB,YAAA,KAAY,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;KAgBgC,kBAAA,KAAkB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;KAejB,mBAAA,KAAmB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;KAwBhE,gBAAA,KAAgB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;KAsC8B,oBAAA,KAAoB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;KAWpB,oBAAA,KAAoB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;KActB,kBAAA,KAAkB,mBAAA,CAAA,GAAA,CAAA,OAAA;AAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { PrimitiveProps } from "../Primitive/Primitive.mjs";
|
|
2
|
+
import "../Primitive/index.mjs";
|
|
3
|
+
import { SidebarVariants } from "./Sidebar.styles.mjs";
|
|
4
|
+
import { SidebarValue } from "./hooks/useSidebarContext.mjs";
|
|
5
|
+
import { ComponentProps, SVGProps } from "react";
|
|
6
|
+
import * as react_jsx_runtime65 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/Sidebar/Sidebar.d.ts
|
|
9
|
+
interface SidebarProps extends ComponentProps<'nav'>, PrimitiveProps {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
selected?: SidebarValue;
|
|
12
|
+
onSelectChange?: (value: SidebarValue) => void;
|
|
13
|
+
}
|
|
14
|
+
interface SidebarHeaderProps extends ComponentProps<'div'>, PrimitiveProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
interface SidebarContentProps extends ComponentProps<'div'>, PrimitiveProps {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
interface SidebarItemProps extends ComponentProps<'button'>, PrimitiveProps, Omit<SidebarVariants, 'selected'> {
|
|
21
|
+
value?: SidebarValue;
|
|
22
|
+
selected?: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface SidebarItemIconProps extends SVGProps<SVGSVGElement>, PrimitiveProps {}
|
|
25
|
+
interface SidebarItemTextProps extends ComponentProps<'span'>, PrimitiveProps {}
|
|
26
|
+
interface SidebarFooterProps extends ComponentProps<'div'>, PrimitiveProps {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
declare const Sidebar: (({
|
|
30
|
+
children,
|
|
31
|
+
selected,
|
|
32
|
+
onSelectChange,
|
|
33
|
+
...props
|
|
34
|
+
}: SidebarProps) => react_jsx_runtime65.JSX.Element) & {
|
|
35
|
+
Header: ({
|
|
36
|
+
children,
|
|
37
|
+
...props
|
|
38
|
+
}: SidebarHeaderProps) => react_jsx_runtime65.JSX.Element;
|
|
39
|
+
Content: ({
|
|
40
|
+
children,
|
|
41
|
+
...props
|
|
42
|
+
}: SidebarContentProps) => react_jsx_runtime65.JSX.Element;
|
|
43
|
+
Item: ({
|
|
44
|
+
selected,
|
|
45
|
+
value,
|
|
46
|
+
children,
|
|
47
|
+
onClick,
|
|
48
|
+
...props
|
|
49
|
+
}: SidebarItemProps) => react_jsx_runtime65.JSX.Element;
|
|
50
|
+
ItemIcon: ({
|
|
51
|
+
children,
|
|
52
|
+
...props
|
|
53
|
+
}: SidebarItemIconProps) => react_jsx_runtime65.JSX.Element;
|
|
54
|
+
ItemText: ({
|
|
55
|
+
children,
|
|
56
|
+
...props
|
|
57
|
+
}: SidebarItemTextProps) => react_jsx_runtime65.JSX.Element;
|
|
58
|
+
Footer: ({
|
|
59
|
+
children,
|
|
60
|
+
...props
|
|
61
|
+
}: SidebarFooterProps) => react_jsx_runtime65.JSX.Element;
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { Sidebar };
|
|
65
|
+
//# sourceMappingURL=Sidebar.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.d.mts","names":[],"sources":["../../../src/components/Sidebar/Sidebar.tsx"],"mappings":";;;;;;;;UAgBiB,YAAA,SAAqB,cAAA,SAAuB,cAAA;EAC3D,QAAA,EAAU,KAAA,CAAM,SAAA;EAChB,QAAA,GAAW,YAAA;EACX,cAAA,IAAkB,KAAA,EAAO,YAAA;AAAA;AAAA,UAmBV,kBAAA,SACP,cAAA,SAAuB,cAAA;EAC/B,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,UAaR,mBAAA,SAA4B,cAAA,SAAuB,cAAA;EAC3D,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,UAaR,gBAAA,SAEN,cAAA,YACA,cAAA,EACA,IAAA,CAAK,eAAA;EACP,KAAA,GAAQ,YAAA;EACR,QAAA;AAAA;AAAA,UA4CQ,oBAAA,SACA,QAAA,CAAS,aAAA,GAAgB,cAAA;AAAA,UAWzB,oBAAA,SAA6B,cAAA,UAAwB,cAAA;AAAA,UAYrD,kBAAA,SAA2B,cAAA,SAAuB,cAAA;EAC1D,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,cAaL,OAAA;EAAO,QAAA;EAAA,QAAA;EAAA,cAAA;EAAA,GAAA;AAAA,GAjIjB,YAAA,KAAY,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;KAgBgC,kBAAA,KAAkB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;KAejB,mBAAA,KAAmB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;KAwBhE,gBAAA,KAAgB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;KAsC8B,oBAAA,KAAoB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;KAWpB,oBAAA,KAAoB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;KActB,kBAAA,KAAkB,mBAAA,CAAA,GAAA,CAAA,OAAA;AAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Primitive } from "../Primitive/Primitive.mjs";
|
|
4
|
+
import { sidebar } from "./Sidebar.styles.mjs";
|
|
5
|
+
import { SidebarContext, SidebarItemContext, useSidebarContext, useSidebarItemContext } from "./hooks/useSidebarContext.mjs";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/Sidebar/Sidebar.tsx
|
|
9
|
+
const SidebarRoot = ({ children, selected, onSelectChange, ...props }) => {
|
|
10
|
+
const { root } = sidebar();
|
|
11
|
+
return /* @__PURE__ */ jsx(SidebarContext.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 SidebarHeader = ({ children, ...props }) => {
|
|
24
|
+
const { header } = sidebar();
|
|
25
|
+
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
26
|
+
className: header(),
|
|
27
|
+
...props,
|
|
28
|
+
children
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const SidebarContent = ({ children, ...props }) => {
|
|
32
|
+
const { content } = sidebar();
|
|
33
|
+
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
34
|
+
className: content(),
|
|
35
|
+
...props,
|
|
36
|
+
children
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
const SidebarItem = ({ selected, value, children, onClick, ...props }) => {
|
|
40
|
+
const rootContext = useSidebarContext();
|
|
41
|
+
const isSelected = selected ?? (rootContext.selected !== void 0 && value !== void 0 ? rootContext.selected === value : false);
|
|
42
|
+
const { item } = sidebar({ selected: isSelected });
|
|
43
|
+
const handleClick = (e) => {
|
|
44
|
+
onClick?.(e);
|
|
45
|
+
if (!e.defaultPrevented && rootContext.onSelectChange && value !== void 0) rootContext.onSelectChange(value);
|
|
46
|
+
};
|
|
47
|
+
return /* @__PURE__ */ jsx(SidebarItemContext.Provider, {
|
|
48
|
+
value: { selected: isSelected },
|
|
49
|
+
children: /* @__PURE__ */ jsx(Primitive.button, {
|
|
50
|
+
type: "button",
|
|
51
|
+
className: item(),
|
|
52
|
+
onClick: handleClick,
|
|
53
|
+
...props,
|
|
54
|
+
children
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
const SidebarItemIcon = ({ children, ...props }) => {
|
|
59
|
+
const { icon } = sidebar({ selected: useSidebarItemContext().selected });
|
|
60
|
+
return /* @__PURE__ */ jsx(Primitive.svg, {
|
|
61
|
+
asChild: true,
|
|
62
|
+
className: icon(),
|
|
63
|
+
...props,
|
|
64
|
+
children
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const SidebarItemText = ({ children, ...props }) => {
|
|
68
|
+
const { text } = sidebar({ selected: useSidebarItemContext().selected });
|
|
69
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
70
|
+
className: text(),
|
|
71
|
+
...props,
|
|
72
|
+
children
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
const SidebarFooter = ({ children, ...props }) => {
|
|
76
|
+
const { footer } = sidebar();
|
|
77
|
+
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
78
|
+
className: footer(),
|
|
79
|
+
...props,
|
|
80
|
+
children
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
const sidebarBadgeClassName = sidebar().badge();
|
|
84
|
+
const Sidebar = Object.assign(SidebarRoot, {
|
|
85
|
+
Header: SidebarHeader,
|
|
86
|
+
Content: SidebarContent,
|
|
87
|
+
Item: SidebarItem,
|
|
88
|
+
ItemIcon: SidebarItemIcon,
|
|
89
|
+
ItemText: SidebarItemText,
|
|
90
|
+
Footer: SidebarFooter
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
export { Sidebar };
|
|
95
|
+
//# sourceMappingURL=Sidebar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.mjs","names":[],"sources":["../../../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["'use client';\n\nimport { ComponentProps, SVGProps } from 'react';\nimport { sidebar, SidebarVariants } from './Sidebar.styles';\nimport { Primitive, PrimitiveProps } from '../Primitive';\n\n// Root\nimport {\n SidebarContext,\n useSidebarContext,\n SidebarItemContext,\n useSidebarItemContext,\n SidebarValue,\n} from './hooks/useSidebarContext';\n\n// Root\nexport interface SidebarProps extends ComponentProps<'nav'>, PrimitiveProps {\n children: React.ReactNode;\n selected?: SidebarValue;\n onSelectChange?: (value: SidebarValue) => void;\n}\nconst SidebarRoot = ({\n children,\n selected,\n onSelectChange,\n ...props\n}: SidebarProps) => {\n const { root } = sidebar();\n return (\n <SidebarContext.Provider value={{ selected, onSelectChange }}>\n <Primitive.nav className={root()} {...props}>\n {children}\n </Primitive.nav>\n </SidebarContext.Provider>\n );\n};\n\n// Header\nexport interface SidebarHeaderProps\n extends ComponentProps<'div'>, PrimitiveProps {\n children: React.ReactNode;\n}\nconst SidebarHeader = ({ children, ...props }: SidebarHeaderProps) => {\n const { header } = sidebar();\n return (\n <Primitive.div className={header()} {...props}>\n {children}\n </Primitive.div>\n );\n};\n\n// Content\n\ninterface SidebarContentProps extends ComponentProps<'div'>, PrimitiveProps {\n children: React.ReactNode;\n}\n\nconst SidebarContent = ({ children, ...props }: SidebarContentProps) => {\n const { content } = sidebar();\n return (\n <Primitive.div className={content()} {...props}>\n {children}\n </Primitive.div>\n );\n};\n\n// Item\ninterface SidebarItemProps\n extends\n ComponentProps<'button'>,\n PrimitiveProps,\n Omit<SidebarVariants, 'selected'> {\n value?: SidebarValue;\n selected?: boolean;\n}\nconst SidebarItem = ({\n selected,\n value,\n children,\n onClick,\n ...props\n}: SidebarItemProps) => {\n const rootContext = useSidebarContext();\n\n const isSelected =\n selected ??\n (rootContext.selected !== undefined && value !== undefined\n ? rootContext.selected === value\n : false);\n\n const { item } = sidebar({ selected: isSelected });\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 <SidebarItemContext.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 </SidebarItemContext.Provider>\n );\n};\n\ninterface SidebarItemIconProps\n extends SVGProps<SVGSVGElement>, PrimitiveProps {}\nconst SidebarItemIcon = ({ children, ...props }: SidebarItemIconProps) => {\n const itemContext = useSidebarItemContext();\n const { icon } = sidebar({ selected: itemContext.selected });\n return (\n <Primitive.svg asChild className={icon()} {...props}>\n {children}\n </Primitive.svg>\n );\n};\n\ninterface SidebarItemTextProps extends ComponentProps<'span'>, PrimitiveProps {}\nconst SidebarItemText = ({ children, ...props }: SidebarItemTextProps) => {\n const itemContext = useSidebarItemContext();\n const { text } = sidebar({ selected: itemContext.selected });\n return (\n <Primitive.span className={text()} {...props}>\n {children}\n </Primitive.span>\n );\n};\n\n// Footer\ninterface SidebarFooterProps extends ComponentProps<'div'>, PrimitiveProps {\n children: React.ReactNode;\n}\nconst SidebarFooter = ({ children, ...props }: SidebarFooterProps) => {\n const { footer } = sidebar();\n return (\n <Primitive.div className={footer()} {...props}>\n {children}\n </Primitive.div>\n );\n};\n\nexport const sidebarBadgeClassName = sidebar().badge();\n\nexport const Sidebar = Object.assign(SidebarRoot, {\n Header: SidebarHeader,\n Content: SidebarContent,\n Item: SidebarItem,\n ItemIcon: SidebarItemIcon,\n ItemText: SidebarItemText,\n Footer: SidebarFooter,\n});\n"],"mappings":";;;;;;;;AAqBA,MAAM,eAAe,EACnB,UACA,UACA,gBACA,GAAG,YACe;CAClB,MAAM,EAAE,SAAS,SAAS;AAC1B,QACE,oBAAC,eAAe;EAAS,OAAO;GAAE;GAAU;GAAgB;YAC1D,oBAAC,UAAU;GAAI,WAAW,MAAM;GAAE,GAAI;GACnC;IACa;GACQ;;AAS9B,MAAM,iBAAiB,EAAE,UAAU,GAAG,YAAgC;CACpE,MAAM,EAAE,WAAW,SAAS;AAC5B,QACE,oBAAC,UAAU;EAAI,WAAW,QAAQ;EAAE,GAAI;EACrC;GACa;;AAUpB,MAAM,kBAAkB,EAAE,UAAU,GAAG,YAAiC;CACtE,MAAM,EAAE,YAAY,SAAS;AAC7B,QACE,oBAAC,UAAU;EAAI,WAAW,SAAS;EAAE,GAAI;EACtC;GACa;;AAapB,MAAM,eAAe,EACnB,UACA,OACA,UACA,SACA,GAAG,YACmB;CACtB,MAAM,cAAc,mBAAmB;CAEvC,MAAM,aACJ,aACC,YAAY,aAAa,UAAa,UAAU,SAC7C,YAAY,aAAa,QACzB;CAEN,MAAM,EAAE,SAAS,QAAQ,EAAE,UAAU,YAAY,CAAC;CAElD,MAAM,eAAe,MAA2C;AAC9D,YAAU,EAAE;AACZ,MACE,CAAC,EAAE,oBACH,YAAY,kBACZ,UAAU,OAEV,aAAY,eAAe,MAAM;;AAIrC,QACE,oBAAC,mBAAmB;EAAS,OAAO,EAAE,UAAU,YAAY;YAC1D,oBAAC,UAAU;GACT,MAAK;GACL,WAAW,MAAM;GACjB,SAAS;GACT,GAAI;GAEH;IACgB;GACS;;AAMlC,MAAM,mBAAmB,EAAE,UAAU,GAAG,YAAkC;CAExE,MAAM,EAAE,SAAS,QAAQ,EAAE,UADP,uBAAuB,CACM,UAAU,CAAC;AAC5D,QACE,oBAAC,UAAU;EAAI;EAAQ,WAAW,MAAM;EAAE,GAAI;EAC3C;GACa;;AAKpB,MAAM,mBAAmB,EAAE,UAAU,GAAG,YAAkC;CAExE,MAAM,EAAE,SAAS,QAAQ,EAAE,UADP,uBAAuB,CACM,UAAU,CAAC;AAC5D,QACE,oBAAC,UAAU;EAAK,WAAW,MAAM;EAAE,GAAI;EACpC;GACc;;AAQrB,MAAM,iBAAiB,EAAE,UAAU,GAAG,YAAgC;CACpE,MAAM,EAAE,WAAW,SAAS;AAC5B,QACE,oBAAC,UAAU;EAAI,WAAW,QAAQ;EAAE,GAAI;EACrC;GACa;;AAIpB,MAAa,wBAAwB,SAAS,CAAC,OAAO;AAEtD,MAAa,UAAU,OAAO,OAAO,aAAa;CAChD,QAAQ;CACR,SAAS;CACT,MAAM;CACN,UAAU;CACV,UAAU;CACV,QAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let tailwind_variants = require("tailwind-variants");
|
|
3
|
+
|
|
4
|
+
//#region src/components/Sidebar/Sidebar.styles.ts
|
|
5
|
+
const sidebar = (0, tailwind_variants.tv)({
|
|
6
|
+
slots: {
|
|
7
|
+
root: "flex h-screen w-65 flex-col bg-white border-r border-gray-100",
|
|
8
|
+
header: "px-2.5 py-8",
|
|
9
|
+
content: "flex-1 overflow-y-auto px-2.5 py-2",
|
|
10
|
+
footer: "border-t border-gray-100 px-4 py-4",
|
|
11
|
+
item: "group w-full flex items-center gap-2 px-4.5 py-2 rounded-sm text-md transition-colors",
|
|
12
|
+
badge: "ml-auto px-2 py-0.5 text-sm rounded-sm bg-red-100 text-red-400",
|
|
13
|
+
icon: "w-4.5 h-4.5",
|
|
14
|
+
text: "text-md"
|
|
15
|
+
},
|
|
16
|
+
variants: { selected: {
|
|
17
|
+
true: {
|
|
18
|
+
item: "bg-gray-100",
|
|
19
|
+
text: "text-gray-700 typo-subtitle-16-bold",
|
|
20
|
+
icon: "fill-gray-600"
|
|
21
|
+
},
|
|
22
|
+
false: {
|
|
23
|
+
item: "hover:bg-gray-50 active:bg-gray-50",
|
|
24
|
+
text: "typo-body-16-medium text-gray-500 group-hover:text-gray-700 group-active:text-gray-700",
|
|
25
|
+
icon: "fill-gray-300 group-hover:fill-gray-600 group-active:fill-gray-600"
|
|
26
|
+
}
|
|
27
|
+
} },
|
|
28
|
+
defaultVariants: { selected: false }
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.sidebar = sidebar;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as tailwind_variants27 from "tailwind-variants";
|
|
2
|
+
import { VariantProps } from "tailwind-variants";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Sidebar/Sidebar.styles.d.ts
|
|
5
|
+
declare const sidebar: tailwind_variants27.TVReturnType<{
|
|
6
|
+
selected: {
|
|
7
|
+
true: {
|
|
8
|
+
item: string;
|
|
9
|
+
text: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
};
|
|
12
|
+
false: {
|
|
13
|
+
item: string;
|
|
14
|
+
text: string;
|
|
15
|
+
icon: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
root: string;
|
|
20
|
+
header: string;
|
|
21
|
+
content: string;
|
|
22
|
+
footer: string;
|
|
23
|
+
item: string;
|
|
24
|
+
badge: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
text: string;
|
|
27
|
+
}, undefined, {
|
|
28
|
+
selected: {
|
|
29
|
+
true: {
|
|
30
|
+
item: string;
|
|
31
|
+
text: string;
|
|
32
|
+
icon: string;
|
|
33
|
+
};
|
|
34
|
+
false: {
|
|
35
|
+
item: string;
|
|
36
|
+
text: string;
|
|
37
|
+
icon: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
root: string;
|
|
42
|
+
header: string;
|
|
43
|
+
content: string;
|
|
44
|
+
footer: string;
|
|
45
|
+
item: string;
|
|
46
|
+
badge: string;
|
|
47
|
+
icon: string;
|
|
48
|
+
text: string;
|
|
49
|
+
}, tailwind_variants27.TVReturnType<{
|
|
50
|
+
selected: {
|
|
51
|
+
true: {
|
|
52
|
+
item: string;
|
|
53
|
+
text: string;
|
|
54
|
+
icon: string;
|
|
55
|
+
};
|
|
56
|
+
false: {
|
|
57
|
+
item: string;
|
|
58
|
+
text: string;
|
|
59
|
+
icon: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
root: string;
|
|
64
|
+
header: string;
|
|
65
|
+
content: string;
|
|
66
|
+
footer: string;
|
|
67
|
+
item: string;
|
|
68
|
+
badge: string;
|
|
69
|
+
icon: string;
|
|
70
|
+
text: string;
|
|
71
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
72
|
+
type SidebarVariants = VariantProps<typeof sidebar>;
|
|
73
|
+
//#endregion
|
|
74
|
+
export { SidebarVariants };
|
|
75
|
+
//# sourceMappingURL=Sidebar.styles.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.styles.d.cts","names":[],"sources":["../../../src/components/Sidebar/Sidebar.styles.ts"],"mappings":";;;;cAEa,OAAA,EA4BX,mBAAA,CA5BkB,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BlB,mBAAA,CAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;KAEU,eAAA,GAAkB,YAAA,QAAoB,OAAA"}
|