fluent-styles 1.62.4 → 1.62.6
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/lib/commonjs/badge/index.js +13 -8
- package/lib/commonjs/badge/index.js.map +1 -1
- package/lib/commonjs/button/index.js +4 -3
- package/lib/commonjs/button/index.js.map +1 -1
- package/lib/commonjs/card/index.js +23 -15
- package/lib/commonjs/card/index.js.map +1 -1
- package/lib/commonjs/checkBox/index.js +5 -3
- package/lib/commonjs/checkBox/index.js.map +1 -1
- package/lib/commonjs/dropdown/index.js +10 -6
- package/lib/commonjs/dropdown/index.js.map +1 -1
- package/lib/commonjs/header/index.js +59 -55
- package/lib/commonjs/header/index.js.map +1 -1
- package/lib/commonjs/image/index.js +5 -3
- package/lib/commonjs/image/index.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/input/index.js +5 -3
- package/lib/commonjs/input/index.js.map +1 -1
- package/lib/commonjs/page/index.js +20 -4
- package/lib/commonjs/page/index.js.map +1 -1
- package/lib/commonjs/safeAreaView/index.js +4 -0
- package/lib/commonjs/safeAreaView/index.js.map +1 -1
- package/lib/commonjs/seperator/index.js +5 -3
- package/lib/commonjs/seperator/index.js.map +1 -1
- package/lib/commonjs/shape/cycle.js +5 -3
- package/lib/commonjs/shape/cycle.js.map +1 -1
- package/lib/commonjs/shape/index.js +6 -3
- package/lib/commonjs/shape/index.js.map +1 -1
- package/lib/commonjs/spinner/index.js +17 -11
- package/lib/commonjs/spinner/index.js.map +1 -1
- package/lib/commonjs/utiles/styled.js +14 -32
- package/lib/commonjs/utiles/styled.js.map +1 -1
- package/lib/module/badge/index.js +10 -8
- package/lib/module/badge/index.js.map +1 -1
- package/lib/module/button/index.js +4 -3
- package/lib/module/button/index.js.map +1 -1
- package/lib/module/card/index.js +20 -15
- package/lib/module/card/index.js.map +1 -1
- package/lib/module/checkBox/index.js +5 -4
- package/lib/module/checkBox/index.js.map +1 -1
- package/lib/module/dropdown/index.js +9 -7
- package/lib/module/dropdown/index.js.map +1 -1
- package/lib/module/header/index.js +52 -48
- package/lib/module/header/index.js.map +1 -1
- package/lib/module/image/index.js +4 -3
- package/lib/module/image/index.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/input/index.js +5 -4
- package/lib/module/input/index.js.map +1 -1
- package/lib/module/page/index.js +21 -4
- package/lib/module/page/index.js.map +1 -1
- package/lib/module/safeAreaView/index.js +4 -0
- package/lib/module/safeAreaView/index.js.map +1 -1
- package/lib/module/seperator/index.js +4 -3
- package/lib/module/seperator/index.js.map +1 -1
- package/lib/module/shape/cycle.js +4 -3
- package/lib/module/shape/cycle.js.map +1 -1
- package/lib/module/shape/index.js +6 -3
- package/lib/module/shape/index.js.map +1 -1
- package/lib/module/spinner/index.js +13 -10
- package/lib/module/spinner/index.js.map +1 -1
- package/lib/module/utiles/styled.js +13 -31
- package/lib/module/utiles/styled.js.map +1 -1
- package/lib/typescript/badge/index.d.ts +13 -6
- package/lib/typescript/badge/index.d.ts.map +1 -1
- package/lib/typescript/button/index.d.ts +12 -8
- package/lib/typescript/button/index.d.ts.map +1 -1
- package/lib/typescript/card/index.d.ts +37 -10
- package/lib/typescript/card/index.d.ts.map +1 -1
- package/lib/typescript/checkBox/index.d.ts +12 -1
- package/lib/typescript/checkBox/index.d.ts.map +1 -1
- package/lib/typescript/dialog/index.d.ts +6 -3
- package/lib/typescript/dialog/index.d.ts.map +1 -1
- package/lib/typescript/divider/index.d.ts +6 -3
- package/lib/typescript/divider/index.d.ts.map +1 -1
- package/lib/typescript/dropdown/index.d.ts +12 -2
- package/lib/typescript/dropdown/index.d.ts.map +1 -1
- package/lib/typescript/header/index.d.ts +6 -8
- package/lib/typescript/header/index.d.ts.map +1 -1
- package/lib/typescript/image/index.d.ts +9 -4
- package/lib/typescript/image/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/input/index.d.ts +12 -1
- package/lib/typescript/input/index.d.ts.map +1 -1
- package/lib/typescript/page/index.d.ts +17 -7
- package/lib/typescript/page/index.d.ts.map +1 -1
- package/lib/typescript/pressable/index.d.ts +6 -3
- package/lib/typescript/pressable/index.d.ts.map +1 -1
- package/lib/typescript/safeAreaProvider/index.d.ts +6 -3
- package/lib/typescript/safeAreaProvider/index.d.ts.map +1 -1
- package/lib/typescript/safeAreaView/index.d.ts +6 -3
- package/lib/typescript/safeAreaView/index.d.ts.map +1 -1
- package/lib/typescript/scrollView/index.d.ts +6 -3
- package/lib/typescript/scrollView/index.d.ts.map +1 -1
- package/lib/typescript/seperator/index.d.ts +7 -2
- package/lib/typescript/seperator/index.d.ts.map +1 -1
- package/lib/typescript/shape/cycle.d.ts +12 -4
- package/lib/typescript/shape/cycle.d.ts.map +1 -1
- package/lib/typescript/shape/index.d.ts +7 -4
- package/lib/typescript/shape/index.d.ts.map +1 -1
- package/lib/typescript/spacer/index.d.ts +6 -3
- package/lib/typescript/spacer/index.d.ts.map +1 -1
- package/lib/typescript/spinner/index.d.ts +18 -3
- package/lib/typescript/spinner/index.d.ts.map +1 -1
- package/lib/typescript/stack/index.d.ts +18 -9
- package/lib/typescript/stack/index.d.ts.map +1 -1
- package/lib/typescript/text/index.d.ts +6 -3
- package/lib/typescript/text/index.d.ts.map +1 -1
- package/lib/typescript/utiles/styled.d.ts +7 -4
- package/lib/typescript/utiles/styled.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/badge/index.tsx +7 -17
- package/src/button/index.tsx +7 -12
- package/src/card/index.tsx +21 -23
- package/src/checkBox/index.tsx +16 -21
- package/src/dropdown/index.tsx +59 -67
- package/src/header/index.tsx +119 -112
- package/src/image/index.tsx +2 -2
- package/src/index.ts +1 -1
- package/src/input/index.tsx +56 -59
- package/src/page/index.tsx +21 -3
- package/src/safeAreaView/index.tsx +6 -2
- package/src/seperator/index.tsx +4 -10
- package/src/shape/cycle.tsx +10 -12
- package/src/shape/index.tsx +7 -3
- package/src/spinner/index.tsx +49 -55
- package/src/utiles/styled.tsx +14 -27
package/src/badge/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Text, TextProps, TextStyle } from "react-native";
|
|
2
2
|
import { styled } from "../utiles/styled";
|
|
3
3
|
import { theme } from "../utiles/theme";
|
|
4
|
-
import {
|
|
4
|
+
import React, { ReactNode } from "react";
|
|
5
5
|
import { Stack } from "../stack";
|
|
6
6
|
|
|
7
7
|
type TextVariants = {
|
|
@@ -68,10 +68,7 @@ interface BadgeWithIconProps extends StyledBadgeProps {
|
|
|
68
68
|
iconRight?: ReactNode;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
const BadgeWithIcon =
|
|
72
|
-
ElementRef<typeof StyledBadge>,
|
|
73
|
-
BadgeWithIconProps
|
|
74
|
-
>(({ title, iconLeft, iconRight, ...rest }, ref) => {
|
|
71
|
+
const BadgeWithIcon = ({ title, iconLeft, iconRight, ref, ...rest }: BadgeWithIconProps & { ref?: React.Ref<any> }) => {
|
|
75
72
|
const {
|
|
76
73
|
color,
|
|
77
74
|
fontSize,
|
|
@@ -112,7 +109,7 @@ const BadgeWithIcon = forwardRef<
|
|
|
112
109
|
{iconRight && <>{iconRight}</>}
|
|
113
110
|
</Stack>
|
|
114
111
|
);
|
|
115
|
-
}
|
|
112
|
+
};
|
|
116
113
|
|
|
117
114
|
interface BadgeIconProps extends StyledBadgeProps {
|
|
118
115
|
char?: string;
|
|
@@ -124,12 +121,7 @@ interface BadgeIconProps extends StyledBadgeProps {
|
|
|
124
121
|
size?: number;
|
|
125
122
|
}
|
|
126
123
|
|
|
127
|
-
const BadgeIcon =
|
|
128
|
-
ElementRef<typeof StyledBadge>,
|
|
129
|
-
BadgeIconProps
|
|
130
|
-
>(
|
|
131
|
-
(
|
|
132
|
-
{
|
|
124
|
+
const BadgeIcon = ({
|
|
133
125
|
icon,
|
|
134
126
|
char,
|
|
135
127
|
top = -6,
|
|
@@ -140,9 +132,8 @@ const BadgeIcon = forwardRef<
|
|
|
140
132
|
bottom,
|
|
141
133
|
left,
|
|
142
134
|
size = 16,
|
|
143
|
-
|
|
144
|
-
ref
|
|
145
|
-
) => {
|
|
135
|
+
ref,
|
|
136
|
+
}: BadgeIconProps & { ref?: React.Ref<any> }) => {
|
|
146
137
|
return (
|
|
147
138
|
<Stack
|
|
148
139
|
flex={1}
|
|
@@ -172,8 +163,7 @@ const BadgeIcon = forwardRef<
|
|
|
172
163
|
</Stack>
|
|
173
164
|
</Stack>
|
|
174
165
|
);
|
|
175
|
-
}
|
|
176
|
-
);
|
|
166
|
+
};
|
|
177
167
|
|
|
178
168
|
export { BadgeIcon };
|
|
179
169
|
export type { BadgeIconProps };
|
package/src/button/index.tsx
CHANGED
|
@@ -91,11 +91,9 @@ export interface StyledButtonProps extends ButtonProps {
|
|
|
91
91
|
rightIcon?: React.ReactNode
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
interface RefExoticComponent
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
> {
|
|
98
|
-
Text: typeof StyledText
|
|
94
|
+
interface RefExoticComponent {
|
|
95
|
+
(props: StyledButtonProps & { ref?: React.Ref<React.ComponentRef<typeof ButtonBase>> }): React.ReactNode;
|
|
96
|
+
Text: typeof StyledText;
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
// ─── Base styled component ────────────────────────────────────────────────────
|
|
@@ -287,10 +285,7 @@ function spinnerColor(props: StyledButtonProps): string {
|
|
|
287
285
|
|
|
288
286
|
// ─── Button ──────────────────────────────────────────────────────────────────
|
|
289
287
|
|
|
290
|
-
const Button = React.
|
|
291
|
-
React.ComponentPropsWithRef<typeof ButtonBase>,
|
|
292
|
-
StyledButtonProps
|
|
293
|
-
>(({ children, loading, leftIcon, rightIcon, disabled, ...rest }, ref) => {
|
|
288
|
+
const Button = ({ children, loading, leftIcon, rightIcon, disabled, ref, ...rest }: StyledButtonProps & { ref?: React.Ref<React.ComponentRef<typeof ButtonBase>> }) => {
|
|
294
289
|
const isDisabled = disabled || loading
|
|
295
290
|
|
|
296
291
|
return (
|
|
@@ -319,12 +314,12 @@ const Button = React.forwardRef<
|
|
|
319
314
|
{/* Right icon slot */}
|
|
320
315
|
{!loading && rightIcon ? rightIcon : null}
|
|
321
316
|
</ButtonBase>
|
|
322
|
-
)
|
|
323
|
-
}
|
|
317
|
+
);
|
|
318
|
+
};
|
|
324
319
|
|
|
325
320
|
Button.displayName = 'StyledButton'
|
|
326
321
|
|
|
327
|
-
const StyledButton = Button as RefExoticComponent
|
|
322
|
+
const StyledButton = Button as unknown as RefExoticComponent
|
|
328
323
|
StyledButton.Text = StyledText
|
|
329
324
|
|
|
330
325
|
export { StyledButton }
|
package/src/card/index.tsx
CHANGED
|
@@ -117,16 +117,15 @@ const CardBase = styled<CardComponentProps>(View, {
|
|
|
117
117
|
* Flexible layout container with shadow variants
|
|
118
118
|
* Can be wrapped in Pressable for interactive behavior
|
|
119
119
|
*/
|
|
120
|
-
const CardComponent =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
) => {
|
|
120
|
+
const CardComponent = (
|
|
121
|
+
{
|
|
122
|
+
children,
|
|
123
|
+
pressable = false,
|
|
124
|
+
pressableProps,
|
|
125
|
+
ref,
|
|
126
|
+
...rest
|
|
127
|
+
}: StyledCardProps & { ref?: React.Ref<React.ComponentRef<typeof CardBase>> }
|
|
128
|
+
) => {
|
|
130
129
|
const cardContent = (
|
|
131
130
|
<CardBase ref={ref} {...rest}>
|
|
132
131
|
{children}
|
|
@@ -138,20 +137,19 @@ const CardComponent = React.forwardRef<React.ComponentRef<typeof CardBase>, Styl
|
|
|
138
137
|
}
|
|
139
138
|
|
|
140
139
|
return cardContent;
|
|
141
|
-
|
|
142
|
-
);
|
|
140
|
+
};
|
|
143
141
|
|
|
144
142
|
interface HeaderProps extends StackProps {
|
|
145
143
|
children: React.ReactNode;
|
|
146
144
|
}
|
|
147
145
|
|
|
148
|
-
const StyledHeader = React.
|
|
146
|
+
const StyledHeader = ({ children, ref, ...rest }: HeaderProps & { ref?: React.Ref<React.ComponentRef<typeof Stack>> }) => {
|
|
149
147
|
return (
|
|
150
148
|
<Stack borderBottomWidth={1} borderBottomColor={theme.colors.gray[100]} ref={ref} {...rest}>
|
|
151
149
|
{children}
|
|
152
150
|
</Stack>
|
|
153
151
|
);
|
|
154
|
-
}
|
|
152
|
+
};
|
|
155
153
|
|
|
156
154
|
StyledHeader.displayName = 'StyledHeader';
|
|
157
155
|
|
|
@@ -159,13 +157,13 @@ interface ImageProps extends StyledImageBackgroundProps {
|
|
|
159
157
|
children?: React.ReactNode;
|
|
160
158
|
}
|
|
161
159
|
|
|
162
|
-
const StyledImage = React.
|
|
160
|
+
const StyledImage = ({ children, ref, ...rest }: ImageProps & { ref?: React.Ref<React.ComponentRef<typeof StyledImageBackground>> }) => {
|
|
163
161
|
return (
|
|
164
162
|
<StyledImageBackground ref={ref} {...rest}>
|
|
165
163
|
{children}
|
|
166
164
|
</StyledImageBackground>
|
|
167
165
|
);
|
|
168
|
-
}
|
|
166
|
+
};
|
|
169
167
|
|
|
170
168
|
StyledImage.displayName = 'StyledImage';
|
|
171
169
|
|
|
@@ -173,13 +171,13 @@ interface ContentProps extends StackProps {
|
|
|
173
171
|
children: React.ReactNode;
|
|
174
172
|
}
|
|
175
173
|
|
|
176
|
-
const StyledContent= React.
|
|
174
|
+
const StyledContent = ({ children, ref, ...rest }: ContentProps & { ref?: React.Ref<React.ComponentRef<typeof Stack>> }) => {
|
|
177
175
|
return (
|
|
178
176
|
<Stack ref={ref} {...rest}>
|
|
179
177
|
{children}
|
|
180
178
|
</Stack>
|
|
181
179
|
);
|
|
182
|
-
}
|
|
180
|
+
};
|
|
183
181
|
|
|
184
182
|
StyledContent.displayName = 'StyledContent';
|
|
185
183
|
|
|
@@ -187,24 +185,24 @@ interface FooterProps extends StackProps {
|
|
|
187
185
|
children: React.ReactNode;
|
|
188
186
|
}
|
|
189
187
|
|
|
190
|
-
const StyledFooter = React.
|
|
188
|
+
const StyledFooter = ({ children, ref, ...rest }: FooterProps & { ref?: React.Ref<React.ComponentRef<typeof Stack>> }) => {
|
|
191
189
|
return (
|
|
192
190
|
<Stack borderTopWidth={1} borderTopColor={theme.colors.gray[100]} ref={ref} {...rest}>
|
|
193
191
|
{children}
|
|
194
192
|
</Stack>
|
|
195
193
|
);
|
|
196
|
-
}
|
|
194
|
+
};
|
|
197
195
|
|
|
198
196
|
|
|
199
197
|
StyledFooter.displayName = 'StyledFooter';
|
|
200
198
|
|
|
201
|
-
interface Card
|
|
202
|
-
StyledCardProps & React.
|
|
203
|
-
> {
|
|
199
|
+
interface Card {
|
|
200
|
+
(props: StyledCardProps & { ref?: React.Ref<React.ComponentRef<typeof CardBase>> }): React.ReactNode;
|
|
204
201
|
Header: typeof StyledHeader;
|
|
205
202
|
Footer: typeof StyledFooter;
|
|
206
203
|
Image: typeof StyledImage;
|
|
207
204
|
Content: typeof StyledContent;
|
|
205
|
+
displayName?: string;
|
|
208
206
|
}
|
|
209
207
|
|
|
210
208
|
const StyledCard = CardComponent as Card;
|
package/src/checkBox/index.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import {
|
|
3
3
|
TouchableOpacity,
|
|
4
4
|
TouchableOpacityProps,
|
|
@@ -82,25 +82,21 @@ const CheckBoxBase = styled<CheckBoxProps>(TouchableOpacity, {
|
|
|
82
82
|
} as any,
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
const StyledCheckBox =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
size = 24,
|
|
97
|
-
disabled = false,
|
|
98
|
-
iconProps,
|
|
99
|
-
iconSize = size * 0.6,
|
|
100
|
-
...rest
|
|
101
|
-
},
|
|
85
|
+
const StyledCheckBox = (
|
|
86
|
+
{
|
|
87
|
+
checked = false,
|
|
88
|
+
onCheck,
|
|
89
|
+
checkedColor,
|
|
90
|
+
uncheckedColor,
|
|
91
|
+
checkMarkColor = theme.colors.gray[400],
|
|
92
|
+
size = 24,
|
|
93
|
+
disabled = false,
|
|
94
|
+
iconProps,
|
|
95
|
+
iconSize = size * 0.6,
|
|
102
96
|
ref,
|
|
103
|
-
|
|
97
|
+
...rest
|
|
98
|
+
}: StyledCheckBoxProps & { ref?: React.Ref<React.ComponentRef<typeof CheckBoxBase>> },
|
|
99
|
+
) => {
|
|
104
100
|
const [internalChecked, setInternalChecked] = useState(checked);
|
|
105
101
|
|
|
106
102
|
useEffect(() => {
|
|
@@ -130,8 +126,7 @@ const StyledCheckBox = forwardRef<
|
|
|
130
126
|
)}
|
|
131
127
|
</CheckBoxBase>
|
|
132
128
|
);
|
|
133
|
-
|
|
134
|
-
);
|
|
129
|
+
};
|
|
135
130
|
|
|
136
131
|
StyledCheckBox.displayName = "StyledCheckBox";
|
|
137
132
|
export { StyledCheckBox, type StyledCheckBoxProps };
|
package/src/dropdown/index.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, {
|
|
2
|
-
forwardRef,
|
|
3
2
|
useCallback,
|
|
4
3
|
useEffect,
|
|
5
4
|
useMemo,
|
|
@@ -787,35 +786,34 @@ const MetaRow: React.FC<{
|
|
|
787
786
|
// ─── StyledDropdown (single-select) ──────────────────────────────────────────
|
|
788
787
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
789
788
|
|
|
790
|
-
export const StyledDropdown =
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
groupBy,
|
|
815
|
-
...rest
|
|
816
|
-
},
|
|
789
|
+
export const StyledDropdown = (
|
|
790
|
+
{
|
|
791
|
+
data,
|
|
792
|
+
onChange,
|
|
793
|
+
placeholder,
|
|
794
|
+
placeholderTextColor = theme.colors.gray[400],
|
|
795
|
+
value,
|
|
796
|
+
defaultValue,
|
|
797
|
+
disabled = false,
|
|
798
|
+
maxHeight = 260,
|
|
799
|
+
size = "md",
|
|
800
|
+
variant = "outline",
|
|
801
|
+
leftIcon,
|
|
802
|
+
label,
|
|
803
|
+
helperText,
|
|
804
|
+
errorMessage,
|
|
805
|
+
error = false,
|
|
806
|
+
searchable = false,
|
|
807
|
+
searchPlaceholder,
|
|
808
|
+
clearable = false,
|
|
809
|
+
loading = false,
|
|
810
|
+
emptyText = "No options found",
|
|
811
|
+
focusColor = theme.colors.indigo?.[500] ?? "#6366f1",
|
|
812
|
+
groupBy,
|
|
817
813
|
ref,
|
|
818
|
-
|
|
814
|
+
...rest
|
|
815
|
+
}: StyledDropdownProps & { ref?: React.Ref<any> },
|
|
816
|
+
) => {
|
|
819
817
|
const [open, setOpen] = useState(false);
|
|
820
818
|
const [internalValue, setInternalValue] = useState(defaultValue ?? "");
|
|
821
819
|
const { triggerRef, pos, measure, updatePanelHeight } =
|
|
@@ -910,8 +908,7 @@ export const StyledDropdown = forwardRef<any, StyledDropdownProps>(
|
|
|
910
908
|
)}
|
|
911
909
|
</Stack>
|
|
912
910
|
);
|
|
913
|
-
|
|
914
|
-
);
|
|
911
|
+
};
|
|
915
912
|
|
|
916
913
|
StyledDropdown.displayName = "StyledDropdown";
|
|
917
914
|
|
|
@@ -919,41 +916,37 @@ StyledDropdown.displayName = "StyledDropdown";
|
|
|
919
916
|
// ─── StyledMultiSelectDropdown ────────────────────────────────────────────────
|
|
920
917
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
921
918
|
|
|
922
|
-
export const StyledMultiSelectDropdown =
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
groupBy,
|
|
950
|
-
separator = ", ",
|
|
951
|
-
maxDisplay = 3,
|
|
952
|
-
selectAll = false,
|
|
953
|
-
...rest
|
|
954
|
-
},
|
|
919
|
+
export const StyledMultiSelectDropdown = (
|
|
920
|
+
{
|
|
921
|
+
data,
|
|
922
|
+
onChange,
|
|
923
|
+
placeholder,
|
|
924
|
+
placeholderTextColor = theme.colors.gray[400],
|
|
925
|
+
value,
|
|
926
|
+
defaultValue,
|
|
927
|
+
disabled = false,
|
|
928
|
+
maxHeight = 300,
|
|
929
|
+
size = "md",
|
|
930
|
+
variant = "outline",
|
|
931
|
+
leftIcon,
|
|
932
|
+
label,
|
|
933
|
+
helperText,
|
|
934
|
+
errorMessage,
|
|
935
|
+
error = false,
|
|
936
|
+
searchable = false,
|
|
937
|
+
searchPlaceholder,
|
|
938
|
+
clearable = false,
|
|
939
|
+
loading = false,
|
|
940
|
+
emptyText = "No options found",
|
|
941
|
+
focusColor = theme.colors.indigo?.[500] ?? "#6366f1",
|
|
942
|
+
groupBy,
|
|
943
|
+
separator = ", ",
|
|
944
|
+
maxDisplay = 3,
|
|
945
|
+
selectAll = false,
|
|
955
946
|
ref,
|
|
956
|
-
|
|
947
|
+
...rest
|
|
948
|
+
}: StyledMultiSelectDropdownProps & { ref?: React.Ref<any> },
|
|
949
|
+
) => {
|
|
957
950
|
const [open, setOpen] = useState(false);
|
|
958
951
|
const [internalKeys, setInternalKeys] = useState<string[]>(
|
|
959
952
|
defaultValue ?? [],
|
|
@@ -1075,7 +1068,6 @@ export const StyledMultiSelectDropdown = forwardRef<
|
|
|
1075
1068
|
)}
|
|
1076
1069
|
</Stack>
|
|
1077
1070
|
);
|
|
1078
|
-
|
|
1079
|
-
);
|
|
1071
|
+
};
|
|
1080
1072
|
|
|
1081
1073
|
StyledMultiSelectDropdown.displayName = "StyledMultiSelectDropdown";
|