@hero-design/rn 8.78.1 → 8.79.1
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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +14 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +18 -6
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +18 -6
- package/package.json +1 -1
- package/src/components/BottomSheet/index.tsx +1 -1
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +1 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +1729 -0
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +35 -0
- package/src/components/Select/MultiSelect/index.tsx +5 -1
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +1617 -0
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +33 -0
- package/src/components/Select/SingleSelect/index.tsx +5 -1
- package/src/components/Select/types.ts +8 -0
- package/src/theme/global/colors/__tests__/__snapshots__/swagLightJobs.spec.ts.snap +1 -0
- package/src/theme/global/colors/swagLightJobs.ts +1 -0
- package/src/theme/global/colors/types.ts +1 -0
- package/stats/8.79.0/rn-stats.html +4844 -0
- package/stats/8.79.1/rn-stats.html +4844 -0
- package/types/components/BottomSheet/index.d.ts +1 -1
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/Search/utils.d.ts +2 -2
- package/types/components/Select/MultiSelect/index.d.ts +1 -1
- package/types/components/Select/SingleSelect/index.d.ts +1 -1
- package/types/components/Select/index.d.ts +1 -1
- package/types/components/Select/types.d.ts +8 -0
- package/types/components/TextInput/index.d.ts +3 -3
- package/types/theme/global/colors/swagLightJobs.d.ts +1 -0
- package/types/theme/global/colors/types.d.ts +1 -0
- package/types/theme/global/index.d.ts +1 -0
|
@@ -306,6 +306,41 @@ describe('rendering', () => {
|
|
|
306
306
|
expect(getByText('Clear all')).toBeTruthy();
|
|
307
307
|
expect(getByText('Save')).toBeTruthy();
|
|
308
308
|
});
|
|
309
|
+
|
|
310
|
+
it('renders correct custom bottom sheet header', () => {
|
|
311
|
+
const { getByText, getByTestId } = renderWithTheme(
|
|
312
|
+
<MultiSelect
|
|
313
|
+
label="Allow notifications"
|
|
314
|
+
options={options}
|
|
315
|
+
value={['mon']}
|
|
316
|
+
onConfirm={jest.fn()}
|
|
317
|
+
bottomSheetConfig={{
|
|
318
|
+
header: <Typography.Body>Custom header</Typography.Body>,
|
|
319
|
+
}}
|
|
320
|
+
footerLabel="Confirm"
|
|
321
|
+
/>
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
fireEvent.press(getByTestId('text-input'));
|
|
325
|
+
expect(getByText('Custom header')).toBeTruthy();
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it('renders correct floating bottom sheet variant', () => {
|
|
329
|
+
const { toJSON, getByTestId, getByText } = renderWithTheme(
|
|
330
|
+
<MultiSelect
|
|
331
|
+
label="Allow notifications"
|
|
332
|
+
options={options}
|
|
333
|
+
value={['mon']}
|
|
334
|
+
onConfirm={jest.fn()}
|
|
335
|
+
bottomSheetConfig={{ variant: 'floating' }}
|
|
336
|
+
footerLabel="Confirm"
|
|
337
|
+
/>
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
fireEvent.press(getByTestId('text-input'));
|
|
341
|
+
expect(getByText('Monday')).toBeTruthy();
|
|
342
|
+
expect(toJSON()).toMatchSnapshot();
|
|
343
|
+
});
|
|
309
344
|
});
|
|
310
345
|
|
|
311
346
|
describe('behavior', () => {
|
|
@@ -74,6 +74,7 @@ function MultiSelect<V, T extends OptionType<V>>({
|
|
|
74
74
|
testID,
|
|
75
75
|
value,
|
|
76
76
|
supportedOrientations = ['portrait'],
|
|
77
|
+
bottomSheetConfig = {},
|
|
77
78
|
}: MultiSelectProps<V, T>) {
|
|
78
79
|
const { isKeyboardVisible, keyboardHeight } = useKeyboard();
|
|
79
80
|
const [open, setOpen] = useState(false);
|
|
@@ -86,6 +87,8 @@ function MultiSelect<V, T extends OptionType<V>>({
|
|
|
86
87
|
.map((opt) => opt.text)
|
|
87
88
|
.join(', ');
|
|
88
89
|
const rawValue = value.length > 0 ? value.join(', ') : '';
|
|
90
|
+
const { variant: bottomSheetVariant, header: bottomSheetHeader } =
|
|
91
|
+
bottomSheetConfig;
|
|
89
92
|
|
|
90
93
|
useEffect(() => {
|
|
91
94
|
setSelectingValue(value);
|
|
@@ -126,12 +129,13 @@ function MultiSelect<V, T extends OptionType<V>>({
|
|
|
126
129
|
</TouchableOpacity>
|
|
127
130
|
</View>
|
|
128
131
|
<BottomSheet
|
|
132
|
+
variant={bottomSheetVariant || 'fixed'}
|
|
129
133
|
open={open}
|
|
130
134
|
onRequestClose={() => {
|
|
131
135
|
onDismiss?.();
|
|
132
136
|
setOpen(false);
|
|
133
137
|
}}
|
|
134
|
-
header={label}
|
|
138
|
+
header={bottomSheetHeader || label}
|
|
135
139
|
style={{
|
|
136
140
|
paddingBottom: isKeyboardVisible ? keyboardHeight : 0,
|
|
137
141
|
}}
|