@xaui/native 0.0.21 → 0.0.24
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/README.md +195 -2
- package/dist/alert/index.js +1 -2
- package/dist/app-bar/index.cjs +217 -0
- package/dist/app-bar/index.d.cts +52 -0
- package/dist/app-bar/index.d.ts +52 -0
- package/dist/app-bar/index.js +142 -0
- package/dist/autocomplete/index.js +48 -36
- package/dist/avatar/index.js +1 -2
- package/dist/badge/index.js +1 -2
- package/dist/bottom-sheet/index.js +1 -2
- package/dist/bottom-tab-bar/index.cjs +571 -0
- package/dist/bottom-tab-bar/index.d.cts +211 -0
- package/dist/bottom-tab-bar/index.d.ts +211 -0
- package/dist/bottom-tab-bar/index.js +497 -0
- package/dist/button/index.d.cts +102 -5
- package/dist/button/index.d.ts +102 -5
- package/dist/button/index.js +2 -3
- package/dist/button.type-j1ZdkkSl.d.cts +4 -0
- package/dist/button.type-j1ZdkkSl.d.ts +4 -0
- package/dist/card/index.cjs +2 -0
- package/dist/card/index.d.cts +6 -1
- package/dist/card/index.d.ts +6 -1
- package/dist/card/index.js +4 -2
- package/dist/carousel/index.js +1 -1
- package/dist/chart/index.cjs +1067 -0
- package/dist/chart/index.d.cts +218 -0
- package/dist/chart/index.d.ts +218 -0
- package/dist/chart/index.js +1026 -0
- package/dist/checkbox/index.js +1 -2
- package/dist/chip/index.js +1 -2
- package/dist/chunk-3XSXTM3G.js +661 -0
- package/dist/chunk-4KSZLONZ.js +79 -0
- package/dist/{chunk-DXXNBF5P.js → chunk-CZFDZPAS.js} +0 -5
- package/dist/{chunk-LTKYHG5V.js → chunk-GHCVNQET.js} +12 -5
- package/dist/chunk-I4V5Y5GD.js +76 -0
- package/dist/{chunk-F7WH4DMG.js → chunk-UI5L26KD.js} +1 -1
- package/dist/{chunk-LUBWRVI2.js → chunk-ULJSCNPE.js} +1 -1
- package/dist/chunk-URBEEDFX.js +79 -0
- package/dist/core/index.js +3 -5
- package/dist/datepicker/index.js +1 -2
- package/dist/divider/index.js +2 -3
- package/dist/drawer/index.cjs +310 -0
- package/dist/drawer/index.d.cts +58 -0
- package/dist/drawer/index.d.ts +58 -0
- package/dist/drawer/index.js +236 -0
- package/dist/{accordion → expansion-panel}/index.cjs +45 -45
- package/dist/{accordion → expansion-panel}/index.d.cts +30 -30
- package/dist/{accordion → expansion-panel}/index.d.ts +30 -30
- package/dist/{accordion → expansion-panel}/index.js +40 -41
- package/dist/fab/index.d.cts +3 -3
- package/dist/fab/index.d.ts +3 -3
- package/dist/fab/index.js +3 -4
- package/dist/fab-menu/index.d.cts +2 -2
- package/dist/fab-menu/index.d.ts +2 -2
- package/dist/fab-menu/index.js +3 -4
- package/dist/{fab.type-Ba0QMprb.d.ts → fab.type-CgIYqQlT.d.ts} +1 -1
- package/dist/{fab.type-U09H8B7D.d.cts → fab.type-l2vjG8-p.d.cts} +1 -1
- package/dist/feature-discovery/index.cjs +531 -0
- package/dist/feature-discovery/index.d.cts +82 -0
- package/dist/feature-discovery/index.d.ts +82 -0
- package/dist/feature-discovery/index.js +464 -0
- package/dist/indicator/index.js +2 -3
- package/dist/input/index.cjs +258 -164
- package/dist/input/index.d.cts +15 -1
- package/dist/input/index.d.ts +15 -1
- package/dist/input/index.js +219 -126
- package/dist/list/index.js +1 -2
- package/dist/menu/index.js +2 -2
- package/dist/menubox/index.cjs +369 -0
- package/dist/menubox/index.d.cts +98 -0
- package/dist/menubox/index.d.ts +98 -0
- package/dist/menubox/index.js +296 -0
- package/dist/pager/index.cjs +243 -0
- package/dist/pager/index.d.cts +93 -0
- package/dist/pager/index.d.ts +93 -0
- package/dist/pager/index.js +205 -0
- package/dist/progress/index.js +1 -2
- package/dist/radio/index.cjs +537 -0
- package/dist/radio/index.d.cts +145 -0
- package/dist/radio/index.d.ts +145 -0
- package/dist/radio/index.js +464 -0
- package/dist/segment-button/index.js +2 -2
- package/dist/select/index.js +22 -10
- package/dist/skeleton/index.js +2 -2
- package/dist/slider/index.cjs +655 -0
- package/dist/slider/index.d.cts +171 -0
- package/dist/slider/index.d.ts +171 -0
- package/dist/slider/index.js +575 -0
- package/dist/stepper/index.cjs +624 -0
- package/dist/stepper/index.d.cts +137 -0
- package/dist/stepper/index.d.ts +137 -0
- package/dist/stepper/index.js +549 -0
- package/dist/switch/index.js +1 -2
- package/dist/tabs/index.cjs +523 -0
- package/dist/tabs/index.d.cts +176 -0
- package/dist/tabs/index.d.ts +176 -0
- package/dist/tabs/index.js +438 -0
- package/dist/timepicker/index.cjs +1280 -0
- package/dist/timepicker/index.d.cts +215 -0
- package/dist/timepicker/index.d.ts +215 -0
- package/dist/timepicker/index.js +1181 -0
- package/dist/toolbar/index.cjs +395 -0
- package/dist/toolbar/index.d.cts +100 -0
- package/dist/toolbar/index.d.ts +100 -0
- package/dist/toolbar/index.js +325 -0
- package/dist/typography/index.js +1 -2
- package/dist/view/index.cjs +16 -2
- package/dist/view/index.js +16 -2
- package/package.json +73 -8
- package/dist/button.type-D8tzEBo7.d.ts +0 -104
- package/dist/button.type-ikaWzhIg.d.cts +0 -104
- package/dist/chunk-GBHQCAKW.js +0 -19
- package/dist/chunk-JEGEPGVU.js +0 -287
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
type
|
|
4
|
+
type ExpansionPanelVariant = 'light' | 'bordered' | 'splitted';
|
|
5
|
+
type ExpansionPanelSelectionMode = 'toggle' | 'multiple';
|
|
6
|
+
type ExpansionPanelEvents = {
|
|
7
7
|
onSelectionChange?: (selectedKeys: string[]) => void;
|
|
8
8
|
};
|
|
9
|
-
type
|
|
9
|
+
type ExpansionPanelCustomAppearance = {
|
|
10
10
|
/**
|
|
11
11
|
* Custom styles for the container
|
|
12
12
|
*/
|
|
@@ -16,25 +16,25 @@ type AccordionCustomAppearance = {
|
|
|
16
16
|
*/
|
|
17
17
|
item?: ViewStyle;
|
|
18
18
|
};
|
|
19
|
-
type
|
|
19
|
+
type ExpansionPanelProps = {
|
|
20
20
|
/**
|
|
21
|
-
* List of
|
|
21
|
+
* List of ExpansionPanelItem components
|
|
22
22
|
*/
|
|
23
23
|
children: ReactNode;
|
|
24
24
|
/**
|
|
25
|
-
* Visual variant of the
|
|
25
|
+
* Visual variant of the expansion-panel
|
|
26
26
|
* @default 'light'
|
|
27
27
|
*/
|
|
28
|
-
variant?:
|
|
28
|
+
variant?: ExpansionPanelVariant;
|
|
29
29
|
/**
|
|
30
30
|
* Selection behavior mode
|
|
31
|
-
* - toggle: Only one
|
|
32
|
-
* - multiple: Multiple
|
|
31
|
+
* - toggle: Only one expansion-panel item can be expanded at a time
|
|
32
|
+
* - multiple: Multiple expansion-panel items can be expanded simultaneously
|
|
33
33
|
* @default 'toggle'
|
|
34
34
|
*/
|
|
35
|
-
selectionMode?:
|
|
35
|
+
selectionMode?: ExpansionPanelSelectionMode;
|
|
36
36
|
/**
|
|
37
|
-
* Show dividers between
|
|
37
|
+
* Show dividers between expansion-panel items
|
|
38
38
|
* @default false
|
|
39
39
|
*/
|
|
40
40
|
showDivider?: boolean;
|
|
@@ -44,7 +44,7 @@ type AccordionProps = {
|
|
|
44
44
|
*/
|
|
45
45
|
hideIndicator?: boolean;
|
|
46
46
|
/**
|
|
47
|
-
* Whether the
|
|
47
|
+
* Whether the expansion-panel should take full width
|
|
48
48
|
* @default true
|
|
49
49
|
*/
|
|
50
50
|
fullWidth?: boolean;
|
|
@@ -58,7 +58,7 @@ type AccordionProps = {
|
|
|
58
58
|
*/
|
|
59
59
|
defaultExpandedKeys?: string[];
|
|
60
60
|
/**
|
|
61
|
-
* Keys of disabled
|
|
61
|
+
* Keys of disabled expansion-panel items
|
|
62
62
|
*/
|
|
63
63
|
disabledKeys?: string[];
|
|
64
64
|
/**
|
|
@@ -67,22 +67,22 @@ type AccordionProps = {
|
|
|
67
67
|
*/
|
|
68
68
|
disableAnimation?: boolean;
|
|
69
69
|
/**
|
|
70
|
-
* Make the
|
|
70
|
+
* Make the expansion-panel items more compact
|
|
71
71
|
* @default false
|
|
72
72
|
*/
|
|
73
73
|
isCompact?: boolean;
|
|
74
74
|
/**
|
|
75
|
-
* Custom appearance styles for all
|
|
75
|
+
* Custom appearance styles for all expansion-panel parts
|
|
76
76
|
*/
|
|
77
|
-
customAppearance?:
|
|
78
|
-
} &
|
|
77
|
+
customAppearance?: ExpansionPanelCustomAppearance;
|
|
78
|
+
} & ExpansionPanelEvents;
|
|
79
79
|
|
|
80
|
-
declare const
|
|
80
|
+
declare const ExpansionPanel: React.FC<ExpansionPanelProps>;
|
|
81
81
|
|
|
82
|
-
type
|
|
82
|
+
type ExpansionPanelItemEvents = {
|
|
83
83
|
onSelected?: (isSelected: boolean) => void;
|
|
84
84
|
};
|
|
85
|
-
type
|
|
85
|
+
type ExpansionPanelItemCustomAppearance = {
|
|
86
86
|
/**
|
|
87
87
|
* Custom styles for the base container
|
|
88
88
|
*/
|
|
@@ -116,17 +116,17 @@ type AccordionItemCustomAppearance = {
|
|
|
116
116
|
*/
|
|
117
117
|
indicator?: ViewStyle;
|
|
118
118
|
};
|
|
119
|
-
type
|
|
119
|
+
type ExpansionPanelItemProps = {
|
|
120
120
|
/**
|
|
121
|
-
* Unique key for the
|
|
121
|
+
* Unique key for the expansion-panel item
|
|
122
122
|
*/
|
|
123
123
|
itemKey?: string;
|
|
124
124
|
/**
|
|
125
|
-
* Content to display when
|
|
125
|
+
* Content to display when expansion-panel item is expanded
|
|
126
126
|
*/
|
|
127
127
|
children: ReactNode;
|
|
128
128
|
/**
|
|
129
|
-
* Title displayed in the
|
|
129
|
+
* Title displayed in the expansion-panel header
|
|
130
130
|
*/
|
|
131
131
|
title: ReactNode;
|
|
132
132
|
/**
|
|
@@ -143,11 +143,11 @@ type AccordionItemProps = {
|
|
|
143
143
|
*/
|
|
144
144
|
indicator?: ReactNode;
|
|
145
145
|
/**
|
|
146
|
-
* Custom appearance styles for all
|
|
146
|
+
* Custom appearance styles for all expansion-panel item parts
|
|
147
147
|
*/
|
|
148
|
-
customAppearance?:
|
|
149
|
-
} &
|
|
148
|
+
customAppearance?: ExpansionPanelItemCustomAppearance;
|
|
149
|
+
} & ExpansionPanelItemEvents;
|
|
150
150
|
|
|
151
|
-
declare const
|
|
151
|
+
declare const ExpansionPanelItem: React.FC<ExpansionPanelItemProps>;
|
|
152
152
|
|
|
153
|
-
export {
|
|
153
|
+
export { ExpansionPanel, ExpansionPanelItem };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
type
|
|
4
|
+
type ExpansionPanelVariant = 'light' | 'bordered' | 'splitted';
|
|
5
|
+
type ExpansionPanelSelectionMode = 'toggle' | 'multiple';
|
|
6
|
+
type ExpansionPanelEvents = {
|
|
7
7
|
onSelectionChange?: (selectedKeys: string[]) => void;
|
|
8
8
|
};
|
|
9
|
-
type
|
|
9
|
+
type ExpansionPanelCustomAppearance = {
|
|
10
10
|
/**
|
|
11
11
|
* Custom styles for the container
|
|
12
12
|
*/
|
|
@@ -16,25 +16,25 @@ type AccordionCustomAppearance = {
|
|
|
16
16
|
*/
|
|
17
17
|
item?: ViewStyle;
|
|
18
18
|
};
|
|
19
|
-
type
|
|
19
|
+
type ExpansionPanelProps = {
|
|
20
20
|
/**
|
|
21
|
-
* List of
|
|
21
|
+
* List of ExpansionPanelItem components
|
|
22
22
|
*/
|
|
23
23
|
children: ReactNode;
|
|
24
24
|
/**
|
|
25
|
-
* Visual variant of the
|
|
25
|
+
* Visual variant of the expansion-panel
|
|
26
26
|
* @default 'light'
|
|
27
27
|
*/
|
|
28
|
-
variant?:
|
|
28
|
+
variant?: ExpansionPanelVariant;
|
|
29
29
|
/**
|
|
30
30
|
* Selection behavior mode
|
|
31
|
-
* - toggle: Only one
|
|
32
|
-
* - multiple: Multiple
|
|
31
|
+
* - toggle: Only one expansion-panel item can be expanded at a time
|
|
32
|
+
* - multiple: Multiple expansion-panel items can be expanded simultaneously
|
|
33
33
|
* @default 'toggle'
|
|
34
34
|
*/
|
|
35
|
-
selectionMode?:
|
|
35
|
+
selectionMode?: ExpansionPanelSelectionMode;
|
|
36
36
|
/**
|
|
37
|
-
* Show dividers between
|
|
37
|
+
* Show dividers between expansion-panel items
|
|
38
38
|
* @default false
|
|
39
39
|
*/
|
|
40
40
|
showDivider?: boolean;
|
|
@@ -44,7 +44,7 @@ type AccordionProps = {
|
|
|
44
44
|
*/
|
|
45
45
|
hideIndicator?: boolean;
|
|
46
46
|
/**
|
|
47
|
-
* Whether the
|
|
47
|
+
* Whether the expansion-panel should take full width
|
|
48
48
|
* @default true
|
|
49
49
|
*/
|
|
50
50
|
fullWidth?: boolean;
|
|
@@ -58,7 +58,7 @@ type AccordionProps = {
|
|
|
58
58
|
*/
|
|
59
59
|
defaultExpandedKeys?: string[];
|
|
60
60
|
/**
|
|
61
|
-
* Keys of disabled
|
|
61
|
+
* Keys of disabled expansion-panel items
|
|
62
62
|
*/
|
|
63
63
|
disabledKeys?: string[];
|
|
64
64
|
/**
|
|
@@ -67,22 +67,22 @@ type AccordionProps = {
|
|
|
67
67
|
*/
|
|
68
68
|
disableAnimation?: boolean;
|
|
69
69
|
/**
|
|
70
|
-
* Make the
|
|
70
|
+
* Make the expansion-panel items more compact
|
|
71
71
|
* @default false
|
|
72
72
|
*/
|
|
73
73
|
isCompact?: boolean;
|
|
74
74
|
/**
|
|
75
|
-
* Custom appearance styles for all
|
|
75
|
+
* Custom appearance styles for all expansion-panel parts
|
|
76
76
|
*/
|
|
77
|
-
customAppearance?:
|
|
78
|
-
} &
|
|
77
|
+
customAppearance?: ExpansionPanelCustomAppearance;
|
|
78
|
+
} & ExpansionPanelEvents;
|
|
79
79
|
|
|
80
|
-
declare const
|
|
80
|
+
declare const ExpansionPanel: React.FC<ExpansionPanelProps>;
|
|
81
81
|
|
|
82
|
-
type
|
|
82
|
+
type ExpansionPanelItemEvents = {
|
|
83
83
|
onSelected?: (isSelected: boolean) => void;
|
|
84
84
|
};
|
|
85
|
-
type
|
|
85
|
+
type ExpansionPanelItemCustomAppearance = {
|
|
86
86
|
/**
|
|
87
87
|
* Custom styles for the base container
|
|
88
88
|
*/
|
|
@@ -116,17 +116,17 @@ type AccordionItemCustomAppearance = {
|
|
|
116
116
|
*/
|
|
117
117
|
indicator?: ViewStyle;
|
|
118
118
|
};
|
|
119
|
-
type
|
|
119
|
+
type ExpansionPanelItemProps = {
|
|
120
120
|
/**
|
|
121
|
-
* Unique key for the
|
|
121
|
+
* Unique key for the expansion-panel item
|
|
122
122
|
*/
|
|
123
123
|
itemKey?: string;
|
|
124
124
|
/**
|
|
125
|
-
* Content to display when
|
|
125
|
+
* Content to display when expansion-panel item is expanded
|
|
126
126
|
*/
|
|
127
127
|
children: ReactNode;
|
|
128
128
|
/**
|
|
129
|
-
* Title displayed in the
|
|
129
|
+
* Title displayed in the expansion-panel header
|
|
130
130
|
*/
|
|
131
131
|
title: ReactNode;
|
|
132
132
|
/**
|
|
@@ -143,11 +143,11 @@ type AccordionItemProps = {
|
|
|
143
143
|
*/
|
|
144
144
|
indicator?: ReactNode;
|
|
145
145
|
/**
|
|
146
|
-
* Custom appearance styles for all
|
|
146
|
+
* Custom appearance styles for all expansion-panel item parts
|
|
147
147
|
*/
|
|
148
|
-
customAppearance?:
|
|
149
|
-
} &
|
|
148
|
+
customAppearance?: ExpansionPanelItemCustomAppearance;
|
|
149
|
+
} & ExpansionPanelItemEvents;
|
|
150
150
|
|
|
151
|
-
declare const
|
|
151
|
+
declare const ExpansionPanelItem: React.FC<ExpansionPanelItemProps>;
|
|
152
152
|
|
|
153
|
-
export {
|
|
153
|
+
export { ExpansionPanel, ExpansionPanelItem };
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Divider
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-DXXNBF5P.js";
|
|
3
|
+
} from "../chunk-ULJSCNPE.js";
|
|
5
4
|
import {
|
|
6
5
|
useXUIPalette,
|
|
7
6
|
useXUITheme
|
|
8
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-GHCVNQET.js";
|
|
9
8
|
|
|
10
|
-
// src/components/
|
|
9
|
+
// src/components/expansion-panel/expansion-panel.tsx
|
|
11
10
|
import React4 from "react";
|
|
12
11
|
import { View as View2 } from "react-native";
|
|
13
12
|
|
|
14
|
-
// src/components/
|
|
13
|
+
// src/components/expansion-panel/expansion-panel-context.ts
|
|
15
14
|
import { createContext, useContext } from "react";
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
);
|
|
19
|
-
var useAccordionContext = () => {
|
|
20
|
-
const context = useContext(AccordionContext);
|
|
15
|
+
var ExpansionPanelContext = createContext(void 0);
|
|
16
|
+
var useExpansionPanelContext = () => {
|
|
17
|
+
const context = useContext(ExpansionPanelContext);
|
|
21
18
|
if (!context) {
|
|
22
|
-
throw new Error(
|
|
19
|
+
throw new Error(
|
|
20
|
+
"ExpansionPanelItem must be used within an ExpansionPanel component"
|
|
21
|
+
);
|
|
23
22
|
}
|
|
24
23
|
return context;
|
|
25
24
|
};
|
|
26
25
|
|
|
27
|
-
// src/components/
|
|
26
|
+
// src/components/expansion-panel/expansion-panel.hook.ts
|
|
28
27
|
import { useState, useCallback, useMemo } from "react";
|
|
29
|
-
var
|
|
28
|
+
var useExpansionPanelStyles = ({
|
|
30
29
|
variant,
|
|
31
30
|
fullWidth
|
|
32
31
|
}) => {
|
|
@@ -52,7 +51,7 @@ var useAccordionStyles = ({
|
|
|
52
51
|
const dividerOpacity = variant === "bordered" ? 1 : 0.2;
|
|
53
52
|
return { containerStyles, dividerColor, dividerOpacity };
|
|
54
53
|
};
|
|
55
|
-
var
|
|
54
|
+
var useExpansionPanelSelection = ({
|
|
56
55
|
selectionMode,
|
|
57
56
|
expandedKeys,
|
|
58
57
|
defaultExpandedKeys,
|
|
@@ -74,8 +73,8 @@ var useAccordionSelection = ({
|
|
|
74
73
|
);
|
|
75
74
|
return { currentExpandedKeys, toggleItem };
|
|
76
75
|
};
|
|
77
|
-
var
|
|
78
|
-
const { currentExpandedKeys, toggleItem } =
|
|
76
|
+
var useExpansionPanelContextValue = (config) => {
|
|
77
|
+
const { currentExpandedKeys, toggleItem } = useExpansionPanelSelection({
|
|
79
78
|
selectionMode: config.selectionMode,
|
|
80
79
|
expandedKeys: config.expandedKeys,
|
|
81
80
|
defaultExpandedKeys: config.defaultExpandedKeys,
|
|
@@ -105,11 +104,11 @@ var useAccordionContextValue = (config) => {
|
|
|
105
104
|
);
|
|
106
105
|
};
|
|
107
106
|
|
|
108
|
-
// src/components/
|
|
107
|
+
// src/components/expansion-panel/expansion-panel-item.tsx
|
|
109
108
|
import React2 from "react";
|
|
110
109
|
import { View, Text, Pressable, Animated as Animated2 } from "react-native";
|
|
111
110
|
|
|
112
|
-
// src/components/
|
|
111
|
+
// src/components/expansion-panel/expansion-panel-item.style.ts
|
|
113
112
|
import { StyleSheet } from "react-native";
|
|
114
113
|
var styles = StyleSheet.create({
|
|
115
114
|
startContent: {
|
|
@@ -133,7 +132,7 @@ var styles = StyleSheet.create({
|
|
|
133
132
|
}
|
|
134
133
|
});
|
|
135
134
|
|
|
136
|
-
// src/components/
|
|
135
|
+
// src/components/expansion-panel/expansion-panel-item.hook.ts
|
|
137
136
|
import { useRef, useEffect, useState as useState2, useMemo as useMemo2, useCallback as useCallback2 } from "react";
|
|
138
137
|
import {
|
|
139
138
|
Animated,
|
|
@@ -141,8 +140,8 @@ import {
|
|
|
141
140
|
} from "react-native";
|
|
142
141
|
import { colors as palette } from "@xaui/core/palette";
|
|
143
142
|
import { withOpacity } from "@xaui/core";
|
|
144
|
-
var
|
|
145
|
-
const context =
|
|
143
|
+
var useExpansionPanelItemState = (itemKey) => {
|
|
144
|
+
const context = useExpansionPanelContext();
|
|
146
145
|
const resolvedItemKey = itemKey ?? "";
|
|
147
146
|
const isExpanded = resolvedItemKey ? context.expandedKeys.includes(resolvedItemKey) : false;
|
|
148
147
|
const isDisabled = resolvedItemKey ? context.disabledKeys.includes(resolvedItemKey) : false;
|
|
@@ -152,7 +151,7 @@ var useAccordionItemState = (itemKey) => {
|
|
|
152
151
|
}, [isDisabled, resolvedItemKey, context]);
|
|
153
152
|
return { ...context, resolvedItemKey, isExpanded, isDisabled, handlePress };
|
|
154
153
|
};
|
|
155
|
-
var
|
|
154
|
+
var useExpansionPanelItemAnimation = (isExpanded, disableAnimation) => {
|
|
156
155
|
const [contentHeight, setContentHeight] = useState2(0);
|
|
157
156
|
const [isMeasured, setIsMeasured] = useState2(false);
|
|
158
157
|
const animatedHeight = useRef(new Animated.Value(isExpanded ? 1 : 0)).current;
|
|
@@ -289,7 +288,7 @@ var useForegroundColor = () => {
|
|
|
289
288
|
return theme.colors.foreground;
|
|
290
289
|
};
|
|
291
290
|
|
|
292
|
-
// src/components/
|
|
291
|
+
// src/components/expansion-panel/chevron-right-icon.tsx
|
|
293
292
|
import React from "react";
|
|
294
293
|
import Svg, { Path } from "react-native-svg";
|
|
295
294
|
var ChevronRightIcon = ({
|
|
@@ -308,8 +307,8 @@ var ChevronRightIcon = ({
|
|
|
308
307
|
));
|
|
309
308
|
};
|
|
310
309
|
|
|
311
|
-
// src/components/
|
|
312
|
-
var
|
|
310
|
+
// src/components/expansion-panel/expansion-panel-item.tsx
|
|
311
|
+
var ExpansionPanelItem = ({
|
|
313
312
|
itemKey,
|
|
314
313
|
children,
|
|
315
314
|
title,
|
|
@@ -327,12 +326,12 @@ var AccordionItem = ({
|
|
|
327
326
|
isExpanded,
|
|
328
327
|
isDisabled,
|
|
329
328
|
handlePress: togglePress
|
|
330
|
-
} =
|
|
329
|
+
} = useExpansionPanelItemState(itemKey);
|
|
331
330
|
const handlePress = () => {
|
|
332
331
|
togglePress();
|
|
333
332
|
onSelected?.(!isExpanded);
|
|
334
333
|
};
|
|
335
|
-
const { onContentLayout, heightInterpolation, rotationInterpolation } =
|
|
334
|
+
const { onContentLayout, heightInterpolation, rotationInterpolation } = useExpansionPanelItemAnimation(isExpanded, disableAnimation);
|
|
336
335
|
const baseStyles = useBaseStyles(variant, isDisabled);
|
|
337
336
|
const triggerStyles = useTriggerStyles(variant, isCompact);
|
|
338
337
|
const titleTextStyle = useTitleTextStyle(isCompact);
|
|
@@ -379,9 +378,9 @@ var AccordionItem = ({
|
|
|
379
378
|
/* @__PURE__ */ React2.createElement(View, { style: [contentContainerStyle, customAppearance?.content] }, children)
|
|
380
379
|
));
|
|
381
380
|
};
|
|
382
|
-
|
|
381
|
+
ExpansionPanelItem.displayName = "ExpansionPanelItem";
|
|
383
382
|
|
|
384
|
-
// src/components/
|
|
383
|
+
// src/components/expansion-panel/expansion-panel.utils.ts
|
|
385
384
|
import React3 from "react";
|
|
386
385
|
var getItemKey = (value, fallback) => {
|
|
387
386
|
if (value === null || value === void 0) return String(fallback);
|
|
@@ -392,8 +391,8 @@ var normalizeElementKey = (value) => {
|
|
|
392
391
|
if (typeof value !== "string") return value;
|
|
393
392
|
return value.startsWith(".$") ? value.slice(2) : value.startsWith(".") ? value.slice(1) : value;
|
|
394
393
|
};
|
|
395
|
-
var
|
|
396
|
-
var
|
|
394
|
+
var isExpansionPanelItem = (value) => React3.isValidElement(value) && (value.type === ExpansionPanelItem || typeof value.type === "function" && value.type.displayName === "ExpansionPanelItem");
|
|
395
|
+
var buildExpansionPanelContextParams = (props) => {
|
|
397
396
|
return {
|
|
398
397
|
variant: props.variant || "light",
|
|
399
398
|
hideIndicator: Boolean(props.hideIndicator),
|
|
@@ -408,8 +407,8 @@ var buildAccordionContextParams = (props) => {
|
|
|
408
407
|
};
|
|
409
408
|
};
|
|
410
409
|
|
|
411
|
-
// src/components/
|
|
412
|
-
var
|
|
410
|
+
// src/components/expansion-panel/expansion-panel.tsx
|
|
411
|
+
var ExpansionPanel = (props) => {
|
|
413
412
|
const {
|
|
414
413
|
children,
|
|
415
414
|
variant = "light",
|
|
@@ -417,27 +416,27 @@ var Accordion = (props) => {
|
|
|
417
416
|
fullWidth = true,
|
|
418
417
|
customAppearance
|
|
419
418
|
} = props;
|
|
420
|
-
const { containerStyles, dividerColor } =
|
|
419
|
+
const { containerStyles, dividerColor } = useExpansionPanelStyles({
|
|
421
420
|
variant,
|
|
422
421
|
fullWidth
|
|
423
422
|
});
|
|
424
|
-
const contextParams =
|
|
425
|
-
const contextValue =
|
|
423
|
+
const contextParams = buildExpansionPanelContextParams(props);
|
|
424
|
+
const contextValue = useExpansionPanelContextValue(contextParams);
|
|
426
425
|
const childrenArray = React4.Children.toArray(children);
|
|
427
|
-
return /* @__PURE__ */ React4.createElement(
|
|
426
|
+
return /* @__PURE__ */ React4.createElement(ExpansionPanelContext.Provider, { value: contextValue }, /* @__PURE__ */ React4.createElement(View2, { style: [containerStyles, customAppearance?.container] }, childrenArray.map((child, index) => {
|
|
428
427
|
const isLast = index === childrenArray.length - 1;
|
|
429
428
|
const showBottomDivider = (showDivider || variant === "bordered") && !isLast && variant !== "splitted";
|
|
430
|
-
const resolvedChildKey =
|
|
429
|
+
const resolvedChildKey = isExpansionPanelItem(child) ? getItemKey(
|
|
431
430
|
child.props.itemKey ?? normalizeElementKey(child.key),
|
|
432
431
|
index
|
|
433
432
|
) : getItemKey(
|
|
434
433
|
React4.isValidElement(child) ? normalizeElementKey(child.key) : void 0,
|
|
435
434
|
index
|
|
436
435
|
);
|
|
437
|
-
return /* @__PURE__ */ React4.createElement(View2, { key: resolvedChildKey, style: customAppearance?.item },
|
|
436
|
+
return /* @__PURE__ */ React4.createElement(View2, { key: resolvedChildKey, style: customAppearance?.item }, isExpansionPanelItem(child) ? React4.cloneElement(child, { itemKey: resolvedChildKey }) : child, showBottomDivider && /* @__PURE__ */ React4.createElement(Divider, { color: dividerColor, size: 2 }));
|
|
438
437
|
})));
|
|
439
438
|
};
|
|
440
439
|
export {
|
|
441
|
-
|
|
442
|
-
|
|
440
|
+
ExpansionPanel,
|
|
441
|
+
ExpansionPanelItem
|
|
443
442
|
};
|
package/dist/fab/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { F as FabProps } from '../fab.type-
|
|
3
|
-
export { b as FabSize, a as FabVariant } from '../fab.type-
|
|
2
|
+
import { F as FabProps } from '../fab.type-l2vjG8-p.cjs';
|
|
3
|
+
export { b as FabSize, a as FabVariant } from '../fab.type-l2vjG8-p.cjs';
|
|
4
4
|
import 'react-native';
|
|
5
5
|
import '../index-BOw6tbkc.cjs';
|
|
6
|
-
import '../button.type-
|
|
6
|
+
import '../button.type-j1ZdkkSl.cjs';
|
|
7
7
|
|
|
8
8
|
declare const Fab: React.FC<FabProps>;
|
|
9
9
|
|
package/dist/fab/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { F as FabProps } from '../fab.type-
|
|
3
|
-
export { b as FabSize, a as FabVariant } from '../fab.type-
|
|
2
|
+
import { F as FabProps } from '../fab.type-CgIYqQlT.js';
|
|
3
|
+
export { b as FabSize, a as FabVariant } from '../fab.type-CgIYqQlT.js';
|
|
4
4
|
import 'react-native';
|
|
5
5
|
import '../index-BOw6tbkc.js';
|
|
6
|
-
import '../button.type-
|
|
6
|
+
import '../button.type-j1ZdkkSl.js';
|
|
7
7
|
|
|
8
8
|
declare const Fab: React.FC<FabProps>;
|
|
9
9
|
|
package/dist/fab/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Fab
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-LTKYHG5V.js";
|
|
3
|
+
} from "../chunk-3XSXTM3G.js";
|
|
4
|
+
import "../chunk-CZFDZPAS.js";
|
|
5
|
+
import "../chunk-I4V5Y5GD.js";
|
|
7
6
|
export {
|
|
8
7
|
Fab
|
|
9
8
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, GestureResponderEvent } from 'react-native';
|
|
3
3
|
import { T as ThemeColor } from '../index-BOw6tbkc.cjs';
|
|
4
|
-
import { a as FabVariant, b as FabSize } from '../fab.type-
|
|
5
|
-
import { B as ButtonRadius, E as ElevationLevel } from '../button.type-
|
|
4
|
+
import { a as FabVariant, b as FabSize } from '../fab.type-l2vjG8-p.cjs';
|
|
5
|
+
import { B as ButtonRadius, E as ElevationLevel } from '../button.type-j1ZdkkSl.cjs';
|
|
6
6
|
|
|
7
7
|
type FabMenuItemProps = {
|
|
8
8
|
/**
|
package/dist/fab-menu/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, GestureResponderEvent } from 'react-native';
|
|
3
3
|
import { T as ThemeColor } from '../index-BOw6tbkc.js';
|
|
4
|
-
import { a as FabVariant, b as FabSize } from '../fab.type-
|
|
5
|
-
import { B as ButtonRadius, E as ElevationLevel } from '../button.type-
|
|
4
|
+
import { a as FabVariant, b as FabSize } from '../fab.type-CgIYqQlT.js';
|
|
5
|
+
import { B as ButtonRadius, E as ElevationLevel } from '../button.type-j1ZdkkSl.js';
|
|
6
6
|
|
|
7
7
|
type FabMenuItemProps = {
|
|
8
8
|
/**
|
package/dist/fab-menu/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Fab
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-DXXNBF5P.js";
|
|
3
|
+
} from "../chunk-3XSXTM3G.js";
|
|
4
|
+
import "../chunk-CZFDZPAS.js";
|
|
6
5
|
import {
|
|
7
6
|
Portal,
|
|
8
7
|
useXUITheme
|
|
9
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-I4V5Y5GD.js";
|
|
10
9
|
|
|
11
10
|
// src/components/fab-menu/fab-menu.tsx
|
|
12
11
|
import React from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, GestureResponderEvent } from 'react-native';
|
|
3
3
|
import { T as ThemeColor } from './index-BOw6tbkc.js';
|
|
4
|
-
import { B as ButtonRadius, E as ElevationLevel } from './button.type-
|
|
4
|
+
import { B as ButtonRadius, E as ElevationLevel } from './button.type-j1ZdkkSl.js';
|
|
5
5
|
|
|
6
6
|
type FabVariant = 'solid' | 'flat' | 'outlined';
|
|
7
7
|
type FabSize = 'sm' | 'md' | 'lg';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, GestureResponderEvent } from 'react-native';
|
|
3
3
|
import { T as ThemeColor } from './index-BOw6tbkc.cjs';
|
|
4
|
-
import { B as ButtonRadius, E as ElevationLevel } from './button.type-
|
|
4
|
+
import { B as ButtonRadius, E as ElevationLevel } from './button.type-j1ZdkkSl.cjs';
|
|
5
5
|
|
|
6
6
|
type FabVariant = 'solid' | 'flat' | 'outlined';
|
|
7
7
|
type FabSize = 'sm' | 'md' | 'lg';
|