@hero-design/rn 8.74.0 → 8.75.0
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 -3
- package/CHANGELOG.md +14 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +635 -522
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +635 -521
- package/package.json +4 -4
- package/src/components/BottomSheet/index.tsx +13 -14
- package/src/components/FloatingIsland/StyledFloatingIsland.tsx +32 -0
- package/src/components/FloatingIsland/__tests__/__snapshots__/index.spec.tsx.snap +561 -0
- package/src/components/FloatingIsland/__tests__/index.spec.tsx +67 -0
- package/src/components/FloatingIsland/index.tsx +94 -0
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +4 -0
- package/src/index.ts +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +30 -0
- package/src/theme/components/floatingIsland.ts +31 -0
- package/src/theme/getTheme.ts +3 -0
- package/stats/8.74.1/rn-stats.html +4842 -0
- package/stats/8.75.0/rn-stats.html +4844 -0
- package/types/components/FloatingIsland/StyledFloatingIsland.d.ts +19 -0
- package/types/components/FloatingIsland/index.d.ts +23 -0
- 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/TextInput/index.d.ts +3 -3
- package/types/index.d.ts +2 -1
- package/types/theme/components/floatingIsland.d.ts +32 -0
- package/types/theme/getTheme.d.ts +2 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { fireEvent } from '@testing-library/react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import FloatingIsland from '..';
|
|
4
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
5
|
+
import Typography from '../../Typography';
|
|
6
|
+
|
|
7
|
+
const Content = () => <Typography.Body>Content</Typography.Body>;
|
|
8
|
+
|
|
9
|
+
describe('FloatingIsland', () => {
|
|
10
|
+
it('renders correctly', () => {
|
|
11
|
+
const { toJSON, getByText } = renderWithTheme(
|
|
12
|
+
<FloatingIsland>
|
|
13
|
+
<Content />
|
|
14
|
+
</FloatingIsland>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
expect(toJSON()).toMatchSnapshot();
|
|
18
|
+
expect(getByText('Content')).toBeDefined();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('calls onPress correctly', () => {
|
|
22
|
+
const onPress = jest.fn();
|
|
23
|
+
const { getByText } = renderWithTheme(
|
|
24
|
+
<FloatingIsland onPress={onPress}>
|
|
25
|
+
<Content />
|
|
26
|
+
</FloatingIsland>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
fireEvent.press(getByText('Content'));
|
|
30
|
+
|
|
31
|
+
expect(onPress).toHaveBeenCalled();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('renders icons as prefix and suffix correctly', () => {
|
|
35
|
+
const { toJSON, getByTestId } = renderWithTheme(
|
|
36
|
+
<FloatingIsland prefix="calendar" suffix="cancel">
|
|
37
|
+
<Content />
|
|
38
|
+
</FloatingIsland>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
expect(toJSON()).toMatchSnapshot();
|
|
42
|
+
expect(getByTestId('floating-island-prefix-icon')).toBeDefined();
|
|
43
|
+
expect(getByTestId('floating-island-suffix-icon')).toBeDefined();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('renders prefix correctly', () => {
|
|
47
|
+
const { toJSON, getByText } = renderWithTheme(
|
|
48
|
+
<FloatingIsland prefix={<Typography.Body>Prefix</Typography.Body>}>
|
|
49
|
+
<Content />
|
|
50
|
+
</FloatingIsland>
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
expect(toJSON()).toMatchSnapshot();
|
|
54
|
+
expect(getByText('Prefix')).toBeDefined();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('renders suffix correctly', () => {
|
|
58
|
+
const { toJSON, getByText } = renderWithTheme(
|
|
59
|
+
<FloatingIsland suffix={<Typography.Body>Suffix</Typography.Body>}>
|
|
60
|
+
<Content />
|
|
61
|
+
</FloatingIsland>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
expect(toJSON()).toMatchSnapshot();
|
|
65
|
+
expect(getByText('Content')).toBeDefined();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { LayoutChangeEvent, ViewProps } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
StyledWrapper,
|
|
5
|
+
StyledPrefixWrapper,
|
|
6
|
+
StyledSuffixWrapper,
|
|
7
|
+
StyledIcon,
|
|
8
|
+
} from './StyledFloatingIsland';
|
|
9
|
+
import { IconName } from '../Icon';
|
|
10
|
+
|
|
11
|
+
export interface FloatingIslandProps extends ViewProps {
|
|
12
|
+
/**
|
|
13
|
+
* Callback that is called when the floating island is pressed.
|
|
14
|
+
*/
|
|
15
|
+
onPress?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Children of the floating island.
|
|
18
|
+
*/
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Prefix element that is displayed before the children.
|
|
22
|
+
*/
|
|
23
|
+
prefix?: IconName | ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Suffix element that is displayed after the children.
|
|
26
|
+
*/
|
|
27
|
+
suffix?: IconName | ReactNode;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const getPrefixOrSuffix = ({
|
|
31
|
+
element,
|
|
32
|
+
isPrefix = true,
|
|
33
|
+
}: {
|
|
34
|
+
element: IconName | ReactNode;
|
|
35
|
+
isPrefix: boolean;
|
|
36
|
+
}) => {
|
|
37
|
+
const Wrapper = isPrefix ? StyledPrefixWrapper : StyledSuffixWrapper;
|
|
38
|
+
if (typeof element === 'string') {
|
|
39
|
+
return (
|
|
40
|
+
<Wrapper>
|
|
41
|
+
<StyledIcon
|
|
42
|
+
testID={`floating-island-${isPrefix ? 'prefix' : 'suffix'}-icon`}
|
|
43
|
+
size="small"
|
|
44
|
+
icon={element as IconName}
|
|
45
|
+
/>
|
|
46
|
+
</Wrapper>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return <Wrapper>{element}</Wrapper>;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const FloatingIsland = ({
|
|
54
|
+
onPress,
|
|
55
|
+
onLayout,
|
|
56
|
+
style,
|
|
57
|
+
children,
|
|
58
|
+
prefix,
|
|
59
|
+
suffix,
|
|
60
|
+
...props
|
|
61
|
+
}: FloatingIslandProps) => {
|
|
62
|
+
const [width, setWidth] = React.useState(0);
|
|
63
|
+
|
|
64
|
+
const onWrapperLayout = (event: LayoutChangeEvent) => {
|
|
65
|
+
setWidth(event.nativeEvent.layout.width);
|
|
66
|
+
|
|
67
|
+
onLayout?.(event);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<StyledWrapper
|
|
72
|
+
{...props}
|
|
73
|
+
onLayout={onWrapperLayout}
|
|
74
|
+
disabled={!onPress}
|
|
75
|
+
onPress={onPress}
|
|
76
|
+
style={[
|
|
77
|
+
style,
|
|
78
|
+
width > 0
|
|
79
|
+
? {
|
|
80
|
+
transform: [{ translateX: -width / 2 }],
|
|
81
|
+
}
|
|
82
|
+
: undefined,
|
|
83
|
+
]}
|
|
84
|
+
>
|
|
85
|
+
{prefix && getPrefixOrSuffix({ element: prefix, isPrefix: true })}
|
|
86
|
+
|
|
87
|
+
{children}
|
|
88
|
+
|
|
89
|
+
{suffix && getPrefixOrSuffix({ element: suffix, isPrefix: false })}
|
|
90
|
+
</StyledWrapper>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export default FloatingIsland;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"activate":59000,"add-emoji":59001,"add-person":59002,"adjustment":59003,"alignment":59004,"antenna":59005,"archive":59006,"assignment-warning":59007,"bank":59008,"bell":59009,"billing":59010,"bolt":59011,"bookmark-added":59012,"bookmark":59013,"box-check":59014,"box":59015,"bpay":59016,"buildings":59017,"cake":59018,"calendar-clock":59019,"calendar":59020,"candy-box-menu":59021,"caret-down-small":59022,"caret-down":59023,"caret-left-small":59024,"caret-left":59025,"caret-right-small":59026,"caret-right":59027,"caret-up-small":59028,"caret-up":59029,"check-radio":59030,"circle-add":59031,"circle-cancel":59032,"circle-check":59033,"circle-down":59034,"circle-info":59035,"circle-left":59036,"circle-ok":59037,"circle-pencil":59038,"circle-question":59039,"circle-remove":59040,"circle-right":59041,"circle-up":59042,"circle-warning":59043,"clock-3":59044,"clock":59045,"cloud-download":59046,"cloud-upload":59047,"cog":59048,"coin":59049,"contacts":59050,"credit-card":59051,"diamond":59052,"direction-arrows":59053,"directory":59054,"document":59055,"dollar-coin-shine":59056,"double-buildings":
|
|
1
|
+
{"activate":59000,"add-emoji":59001,"add-person":59002,"adjustment":59003,"alignment":59004,"antenna":59005,"archive":59006,"assignment-warning":59007,"bank":59008,"bell":59009,"billing":59010,"bolt":59011,"bookmark-added":59012,"bookmark":59013,"box-check":59014,"box":59015,"bpay":59016,"buildings":59017,"cake":59018,"calendar-clock":59019,"calendar":59020,"candy-box-menu":59021,"caret-down-small":59022,"caret-down":59023,"caret-left-small":59024,"caret-left":59025,"caret-right-small":59026,"caret-right":59027,"caret-up-small":59028,"caret-up":59029,"check-radio":59030,"circle-add":59031,"circle-cancel":59032,"circle-check":59033,"circle-down":59034,"circle-info":59035,"circle-left":59036,"circle-ok":59037,"circle-pencil":59038,"circle-question":59039,"circle-remove":59040,"circle-right":59041,"circle-up":59042,"circle-warning":59043,"clock-3":59044,"clock":59045,"cloud-download":59046,"cloud-upload":59047,"cog":59048,"coin":59049,"contacts":59050,"credit-card":59051,"diamond":59052,"direction-arrows":59053,"directory":59054,"document":59055,"dollar-coin-shine":59056,"dot-filled":59057,"double-buildings":59058,"edit-template":59059,"envelope":59060,"exclude":59061,"expand-content":59062,"expense":59063,"explore_nearby":59064,"eye-circle":59065,"eye-invisible":59066,"eye":59067,"face-meh":59068,"face-sad":59069,"face-smiley":59070,"feed":59071,"feedbacks":59072,"file-certified":59073,"file-clone":59074,"file-copy":59075,"file-csv":59076,"file-dispose":59077,"file-doc":59078,"file-excel":59079,"file-export":59080,"file-lock":59081,"file-pdf":59082,"file-powerpoint":59083,"file-search":59084,"file-secured":59085,"file-sheets":59086,"file-slide":59087,"file-verified":59088,"file-word":59089,"file":59090,"filter":59091,"folder-user":59092,"folder":59093,"format-bold":59094,"format-heading1":59095,"format-heading2":59096,"format-italic":59097,"format-list-bulleted":59098,"format-list-numbered":59099,"format-underlined":59100,"funnel-filter":59101,"global-dollar":59102,"globe":59103,"graduation-cap":59104,"graph":59105,"happy-sun":59106,"health-bag":59107,"heart":59108,"hero-points":59109,"home":59110,"image":59111,"import":59112,"incident-siren":59113,"instapay-daily":59114,"instapay-now":59115,"instapay":59116,"list":59117,"loading-2":59118,"loading":59119,"location-on":59120,"location":59121,"lock":59122,"looks-one":59123,"looks-two":59124,"media-content":59125,"menu":59126,"money-notes":59127,"moneybag":59128,"moon":59129,"multiple-stars":59130,"multiple-users":59131,"near-me":59132,"node":59133,"open-folder":59134,"paperclip":59135,"payment-summary":59136,"pencil":59137,"phone":59138,"piggy-bank":59139,"plane-up":59140,"plane":59141,"play-circle":59142,"print":59143,"raising-hands":59144,"reply-arrow":59145,"reply":59146,"reschedule":59147,"rostering":59148,"salary-sacrifice":59149,"save":59150,"schedule-send":59151,"schedule":59152,"search-person":59153,"send":59154,"speaker-active":59155,"speaker":59156,"star-award":59157,"star-badge":59158,"star-circle":59159,"star-medal":59160,"star":59161,"steps-circle":59162,"stopwatch":59163,"suitcase":59164,"surfing":59165,"survey":59166,"swag-pillar-benefit":59167,"swag-pillar-career":59168,"swag-pillar-money":59169,"swag-pillar-work":59170,"swag":59171,"swipe-right":59172,"switch":59173,"tag":59174,"target":59175,"teams":59176,"timesheet":59177,"touch-id":59178,"trash-bin":59179,"unlock":59180,"user":59181,"video-1":59182,"video-2":59183,"wallet":59184,"warning":59185,"activate-outlined":59186,"add-credit-card-outlined":59187,"add-person-outlined":59188,"add-section-outlined":59189,"add-time-outlined":59190,"add":59191,"adjustment-outlined":59192,"afternoon-outlined":59193,"ai-outlined":59194,"alignment-2-outlined":59195,"alignment-outlined":59196,"all-caps":59197,"application-outlined":59198,"arrow-down":59199,"arrow-downwards":59200,"arrow-left":59201,"arrow-leftwards":59202,"arrow-right":59203,"arrow-rightwards":59204,"arrow-up":59205,"arrow-upwards":59206,"article-outlined":59207,"at-sign":59208,"auto-graph-outlined":59209,"beer-outlined":59210,"bell-active-outlined":59211,"bell-outlined":59212,"bell-slash-outlined":59213,"bill-management-outlined":59214,"billing-outlined":59215,"body-outlined":59216,"bold":59217,"bolt-outlined":59218,"book-outlined":59219,"bookmark-added-outlined":59220,"bookmark-outlined":59221,"box-check-outlined":59222,"box-outlined":59223,"bullet-points":59224,"cake-outlined":59225,"calendar-dates-outlined":59226,"calendar-star-outlined":59227,"call-outlined":59228,"call-split-outlined":59229,"camera-outlined":59230,"cancel":59231,"car-forward-outlined":59232,"cashback-outlined":59233,"charging-station-outlined":59234,"chat-bubble-outlined":59235,"chat-unread-outlined":59236,"checkmark":59237,"circle-add-outlined":59238,"circle-cancel-outlined":59239,"circle-down-outlined":59240,"circle-info-outlined":59241,"circle-left-outlined":59242,"circle-ok-outlined":59243,"circle-question-outlined":59244,"circle-remove-outlined":59245,"circle-right-outlined":59246,"circle-up-outlined":59247,"circle-warning-outlined":59248,"clock-2-outlined":59249,"clock-in-outlined":59250,"clock-out-outlined":59251,"clock-outlined":59252,"cog-outlined":59253,"coin-outlined":59254,"coin-super-outlined":59255,"comment-outlined":59256,"contacts-outlined":59257,"contacts-user-outlined":59258,"credit-card-outlined":59259,"cup-outlined":59260,"dentistry-outlined":59261,"direction-arrows-outlined":59262,"directory-outlined":59263,"document-outlined":59264,"dollar-box-outlined":59265,"dollar-card-outlined":59266,"dollar-coin-shine-outlined":59267,"dollar-credit-card-outlined":59268,"dollar-sign":59269,"double-buildings-outlined":59270,"double-left-arrows":59271,"double-right-arrows":59272,"download-box-outlined":59273,"download-outlined":59274,"edit-template-outlined":59275,"email-outlined":59276,"end-break-outlined":59277,"enter-arrow":59278,"envelope-outlined":59279,"evening-outlined":59280,"expense-approval-outlined":59281,"expense-outlined":59282,"explore-outlined":59283,"extension-outlined":59284,"external-link":59285,"eye-invisible-outlined":59286,"eye-outlined":59287,"face-id":59288,"face-meh-outlined":59289,"face-open-smiley-outlined":59290,"face-sad-outlined":59291,"face-smiley-outlined":59292,"fastfood-outlined":59293,"feed-outlined":59294,"file-certified-outlined":59295,"file-clone-outlined":59296,"file-copy-outlined":59297,"file-dispose-outlined":59298,"file-dollar-certified-outlined":59299,"file-dollar-outlined":59300,"file-download-outlined":59301,"file-export-outlined":59302,"file-lock-outlined":59303,"file-outlined":59304,"file-search-outlined":59305,"file-secured-outlined":59306,"file-statutory-outlined":59307,"file-verified-outlined":59308,"filter-outlined":59309,"folder-outlined":59310,"folder-user-outlined":59311,"form-outlined":59312,"funnel-filter-outline":59313,"goal-outlined":59314,"graph-outlined":59315,"hand-holding-user-outlined":59316,"happy-sun-outlined":59317,"health-bag-outlined":59318,"heart-outlined":59319,"home-active-outlined":59320,"home-outlined":59321,"id-card-outlined":59322,"image-outlined":59323,"import-outlined":59324,"instapay-outlined":59325,"italic":59326,"job-search-outlined":59327,"leave-approval-outlined":59328,"link-1":59329,"link-2":59330,"list-outlined":59331,"live-help-outlined":59332,"local_mall_outlined":59333,"location-on-outlined":59334,"location-outlined":59335,"lock-outlined":59336,"locked-file-outlined":59337,"log-out":59338,"mail-outlined":59339,"map-outlined":59340,"media-content-outlined":59341,"menu-close":59342,"menu-expand":59343,"menu-fold-outlined":59344,"menu-unfold-outlined":59345,"moneybag-outlined":59346,"moon-outlined":59347,"more-horizontal":59348,"more-vertical":59349,"morning-outlined":59350,"multiple-folders-outlined":59351,"multiple-users-outlined":59352,"near-me-outlined":59353,"node-outlined":59354,"number-points":59355,"number":59356,"overview-outlined":59357,"payment-summary-outlined":59358,"payslip-outlined":59359,"pencil-outlined":59360,"percentage":59361,"phone-outlined":59362,"piggy-bank-outlined":59363,"plane-outlined":59364,"play-circle-outlined":59365,"print-outlined":59366,"propane-tank-outlined":59367,"qr-code-outlined":59368,"qualification-outlined":59369,"re-assign":59370,"redeem":59371,"refresh":59372,"remove":59373,"reply-outlined":59374,"restart":59375,"resume-outlined":59376,"return-arrow":59377,"rostering-outlined":59378,"safety-outlined":59379,"save-outlined":59380,"schedule-outlined":59381,"search-outlined":59382,"search-secured-outlined":59383,"send-outlined":59384,"share-1":59385,"share-2":59386,"share-outlined-2":59387,"share-outlined":59388,"shopping_basket_outlined":59389,"show-chart-outlined":59390,"single-down-arrow":59391,"single-left-arrow":59392,"single-right-arrow":59393,"single-up-arrow":59394,"smart-match-outlined":59395,"sparkle-outlined":59396,"speaker-active-outlined":59397,"speaker-outlined":59398,"star-circle-outlined":59399,"star-outlined":59400,"start-break-outlined":59401,"stash-outlined":59402,"stopwatch-outlined":59403,"strikethrough":59404,"styler-outlined":59405,"suitcase-clock-outlined":59406,"suitcase-outlined":59407,"survey-outlined":59408,"switch-outlined":59409,"sync":59410,"tag-outlined":59411,"target-outlined":59412,"tennis-outlined":59413,"ticket-outlined":59414,"timesheet-outlined":59415,"timesheets-outlined":59416,"today-outlined":59417,"transfer":59418,"trash-bin-outlined":59419,"umbrela-outlined":59420,"unavailability-outlined":59421,"unavailable":59422,"underline":59423,"union-outlined":59424,"unlock-outlined":59425,"upload-outlined":59426,"user-circle-outlined":59427,"user-gear-outlined":59428,"user-outlined":59429,"user-rectangle-outlined":59430,"video-1-outlined":59431,"video-2-outlined":59432,"volunteer-outlined":59433,"wallet-outlined":59434,"wellness-outlined":59435}
|
|
@@ -57,6 +57,7 @@ const IconList = [
|
|
|
57
57
|
'directory',
|
|
58
58
|
'document',
|
|
59
59
|
'dollar-coin-shine',
|
|
60
|
+
'dot-filled',
|
|
60
61
|
'double-buildings',
|
|
61
62
|
'edit-template',
|
|
62
63
|
'envelope',
|
|
@@ -192,6 +193,7 @@ const IconList = [
|
|
|
192
193
|
'add-time-outlined',
|
|
193
194
|
'add',
|
|
194
195
|
'adjustment-outlined',
|
|
196
|
+
'afternoon-outlined',
|
|
195
197
|
'ai-outlined',
|
|
196
198
|
'alignment-2-outlined',
|
|
197
199
|
'alignment-outlined',
|
|
@@ -278,6 +280,7 @@ const IconList = [
|
|
|
278
280
|
'end-break-outlined',
|
|
279
281
|
'enter-arrow',
|
|
280
282
|
'envelope-outlined',
|
|
283
|
+
'evening-outlined',
|
|
281
284
|
'expense-approval-outlined',
|
|
282
285
|
'expense-outlined',
|
|
283
286
|
'explore-outlined',
|
|
@@ -347,6 +350,7 @@ const IconList = [
|
|
|
347
350
|
'moon-outlined',
|
|
348
351
|
'more-horizontal',
|
|
349
352
|
'more-vertical',
|
|
353
|
+
'morning-outlined',
|
|
350
354
|
'multiple-folders-outlined',
|
|
351
355
|
'multiple-users-outlined',
|
|
352
356
|
'near-me-outlined',
|
package/src/index.ts
CHANGED
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
FlatListWithFAB,
|
|
72
72
|
} from './components/AnimatedScroller';
|
|
73
73
|
import Search from './components/Search';
|
|
74
|
+
import FloatingIsland from './components/FloatingIsland';
|
|
74
75
|
|
|
75
76
|
export {
|
|
76
77
|
theme,
|
|
@@ -143,6 +144,7 @@ export {
|
|
|
143
144
|
Rate,
|
|
144
145
|
RefreshControl,
|
|
145
146
|
RichTextEditor,
|
|
147
|
+
FloatingIsland,
|
|
146
148
|
};
|
|
147
149
|
|
|
148
150
|
export * from './types';
|
|
@@ -590,6 +590,36 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
590
590
|
"titleMarginHorizontal": 8,
|
|
591
591
|
},
|
|
592
592
|
},
|
|
593
|
+
"floatingIsland": {
|
|
594
|
+
"colors": {
|
|
595
|
+
"wrapperBackground": "#ffffff",
|
|
596
|
+
},
|
|
597
|
+
"fontSizes": {
|
|
598
|
+
"iconSize": 14,
|
|
599
|
+
},
|
|
600
|
+
"radii": {
|
|
601
|
+
"wrapper": 999,
|
|
602
|
+
},
|
|
603
|
+
"shadows": {
|
|
604
|
+
"wrapper": {
|
|
605
|
+
"elevation": 3,
|
|
606
|
+
"shadowColor": "#001f23",
|
|
607
|
+
"shadowOffset": {
|
|
608
|
+
"height": 2,
|
|
609
|
+
"width": 0,
|
|
610
|
+
},
|
|
611
|
+
"shadowOpacity": 0.12,
|
|
612
|
+
"shadowRadius": 4,
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
"space": {
|
|
616
|
+
"iconPadding": 12,
|
|
617
|
+
"prefixMarginRight": 8,
|
|
618
|
+
"suffixMarginLeft": 16,
|
|
619
|
+
"wrapperPadding": 8,
|
|
620
|
+
"wrapperTop": 12,
|
|
621
|
+
},
|
|
622
|
+
},
|
|
593
623
|
"icon": {
|
|
594
624
|
"colors": {
|
|
595
625
|
"danger": "#cb300a",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
|
+
|
|
3
|
+
const getFloatingIslandTheme = (theme: GlobalTheme) => {
|
|
4
|
+
const colors = {
|
|
5
|
+
wrapperBackground: theme.colors.defaultGlobalSurface,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const radii = {
|
|
9
|
+
wrapper: theme.radii.rounded,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const shadows = {
|
|
13
|
+
wrapper: theme.shadows.default,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const space = {
|
|
17
|
+
wrapperPadding: theme.space.small,
|
|
18
|
+
wrapperTop: theme.space.smallMedium,
|
|
19
|
+
prefixMarginRight: theme.space.small,
|
|
20
|
+
suffixMarginLeft: theme.space.medium,
|
|
21
|
+
iconPadding: theme.space.smallMedium,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const fontSizes = {
|
|
25
|
+
iconSize: theme.fontSizes.medium,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return { colors, radii, shadows, space, fontSizes };
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default getFloatingIslandTheme;
|
package/src/theme/getTheme.ts
CHANGED
|
@@ -50,6 +50,7 @@ import getTypographyTheme from './components/typography';
|
|
|
50
50
|
import type { GlobalTheme, Scale, SystemPalette } from './global';
|
|
51
51
|
import getSearchTheme from './components/search';
|
|
52
52
|
import getMapPinTheme from './components/mapPin';
|
|
53
|
+
import getFloatingIslandTheme from './components/floatingIsland';
|
|
53
54
|
|
|
54
55
|
type Theme = GlobalTheme & {
|
|
55
56
|
__hd__: {
|
|
@@ -101,6 +102,7 @@ type Theme = GlobalTheme & {
|
|
|
101
102
|
toast: ReturnType<typeof getToastTheme>;
|
|
102
103
|
toolbar: ReturnType<typeof getToolbarTheme>;
|
|
103
104
|
typography: ReturnType<typeof getTypographyTheme>;
|
|
105
|
+
floatingIsland: ReturnType<typeof getFloatingIslandTheme>;
|
|
104
106
|
};
|
|
105
107
|
};
|
|
106
108
|
|
|
@@ -160,6 +162,7 @@ const getTheme = (
|
|
|
160
162
|
toast: getToastTheme(globalTheme),
|
|
161
163
|
toolbar: getToolbarTheme(globalTheme),
|
|
162
164
|
typography: getTypographyTheme(globalTheme),
|
|
165
|
+
floatingIsland: getFloatingIslandTheme(globalTheme),
|
|
163
166
|
},
|
|
164
167
|
};
|
|
165
168
|
};
|