Skip to content

Infra/assets internal new structure #3635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
627ecbb
Add internal assets module with icons and images
adids1221 Mar 16, 2025
09884c2
Refactor icon imports to use internal assets for consistency
adids1221 Mar 16, 2025
517b077
Refactor asset imports to use internal structure and remove assets.ic…
adids1221 Mar 16, 2025
2219ccb
Add xSmall icon and update ChipsInput to use internal assets
adids1221 Mar 16, 2025
bf5b253
Add transparentSwatch icon and update ColorSwatch component to use it
adids1221 Mar 16, 2025
9c59698
Add dropdown to icons and update useFieldType to utilize internal assets
adids1221 Mar 16, 2025
76d7e03
Add hintTip icons and update Hint component to use internal assets
adids1221 Mar 16, 2025
c25d1e5
Add checkMarkSmall and exclamationSmall icons, update WizardStates to…
adids1221 Mar 16, 2025
1224520
Add gradient overlay images and update Overlay component to use inter…
adids1221 Mar 16, 2025
5bac3cf
Add gradientOverlay image and update ScrollBar component to use it
adids1221 Mar 16, 2025
893c73e
move hint, swatch assets to internal.images
adids1221 Mar 17, 2025
656b0ac
Rename icons.dropdown to icons.chevronDown
adids1221 Mar 17, 2025
d9168a8
Add icons.demo and update references in components screens
adids1221 Mar 17, 2025
f5099c3
rename checkSmall icon file and update icons - index.js reference
adids1221 Mar 17, 2025
64e5930
Merge branch 'master' into infra/Assets_internal
adids1221 Mar 17, 2025
94b12f8
Update ColorSwatch to use internal.images for transparentSwatch
adids1221 Mar 18, 2025
9857ed7
Refactor icon and image exports to include URI and dimensions
adids1221 Mar 18, 2025
e8c0415
Refactor image handling to extract image source and apply dimensions …
adids1221 Mar 18, 2025
730a5c9
Update snapshots to reflect changes in image in Avatar, TextField, Bu…
adids1221 Mar 18, 2025
50761fa
remove unnecessary default export in check icon
adids1221 Mar 18, 2025
121d646
Add script to extract image dimensions and update package.json
adids1221 Mar 18, 2025
33629c6
Merge branch 'master' into infra/Assets_internal_new_strucure
adids1221 Mar 19, 2025
fde6928
Revert new structure, split into index.web filesÏ
adids1221 Mar 19, 2025
c7e17a0
Merge branch 'master' into infra/Assets_internal
adids1221 Mar 19, 2025
52fdada
Merge branch 'infra/Assets_internal' into infra/Assets_internal_new_s…
adids1221 Mar 19, 2025
c21c826
Icon remove DEFAULT_WEB_ICON_SIZE
adids1221 Mar 19, 2025
9aee276
Stepper local assets remove, move to Assets
adids1221 Mar 19, 2025
fd939f3
Merge branch 'infra/Assets_internal' into infra/Assets_internal_new_s…
adids1221 Mar 19, 2025
0c88600
Add new icon variants: minusOutline, minusOutlineSmall, plusOutline, …
adids1221 Mar 19, 2025
0caa8d2
Update asset imports to use .default for images and icons
adids1221 Mar 19, 2025
7dc1ac4
Remove esModule option from url-loader configuration in webpack
adids1221 Mar 19, 2025
267e930
Remove docuilib configurations from ReactLiveScope
adids1221 Mar 19, 2025
06f0d96
Bump version to 3.14.0 in package.json
adids1221 Mar 19, 2025
4d64cbf
Refactor icon asset loading to use the new web assets structure
adids1221 Mar 20, 2025
4adb167
Rename update-web-assets script to updateWebAssets in package.json
adids1221 Mar 20, 2025
34b9e07
changed extract-dimensions script to use console.error
adids1221 Mar 20, 2025
e81cd7e
Update file filtering in createIndexFile to exclude sized assets
adids1221 Mar 20, 2025
ae1eff4
rename extract-dimensions script
adids1221 Mar 20, 2025
58eb45c
Merge branch 'master' into infra/Assets_internal_new_strucure
adids1221 Mar 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes
File renamed without changes
File renamed without changes
5 changes: 4 additions & 1 deletion demo/src/configurations.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export const loadDemoConfigurations = () => {
settings: require('./assets/icons/settings.png'),
share: require('./assets/icons/share.png'),
info: require('./assets/icons/info.png'),
exclamation: require('./assets/icons/exclamationFillSmall.png')
exclamation: require('./assets/icons/exclamationFillSmall.png'),
check: require('./assets/icons/check.png'),
x: require('./assets/icons/x.png'),
minus: require('./assets/icons/minusSmall.png')
});

Assets.loadAssetsGroup('images.demo', {
Expand Down
40 changes: 40 additions & 0 deletions demo/src/screens/__tests__/__snapshots__/AvatarScreen.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,10 @@ exports[`AvatarScreen renders screen 1`] = `
}
style={
[
{
"height": undefined,
"width": undefined,
},
undefined,
undefined,
{
Expand Down Expand Up @@ -1194,6 +1198,10 @@ exports[`AvatarScreen renders screen 1`] = `
}
style={
[
{
"height": undefined,
"width": undefined,
},
undefined,
undefined,
{
Expand Down Expand Up @@ -1465,6 +1473,10 @@ exports[`AvatarScreen renders screen 1`] = `
}
style={
[
{
"height": undefined,
"width": undefined,
},
undefined,
undefined,
{
Expand Down Expand Up @@ -1659,6 +1671,10 @@ exports[`AvatarScreen renders screen 1`] = `
}
style={
[
{
"height": undefined,
"width": undefined,
},
undefined,
undefined,
{
Expand Down Expand Up @@ -1916,6 +1932,10 @@ exports[`AvatarScreen renders screen 1`] = `
}
style={
[
{
"height": undefined,
"width": undefined,
},
undefined,
undefined,
{
Expand Down Expand Up @@ -2046,6 +2066,10 @@ exports[`AvatarScreen renders screen 1`] = `
}
style={
[
{
"height": undefined,
"width": undefined,
},
null,
undefined,
undefined,
Expand Down Expand Up @@ -2218,6 +2242,10 @@ exports[`AvatarScreen renders screen 1`] = `
}
style={
[
{
"height": undefined,
"width": undefined,
},
undefined,
undefined,
{
Expand Down Expand Up @@ -2448,6 +2476,10 @@ exports[`AvatarScreen renders screen 1`] = `
}
style={
[
{
"height": undefined,
"width": undefined,
},
undefined,
undefined,
{
Expand Down Expand Up @@ -2678,6 +2710,10 @@ exports[`AvatarScreen renders screen 1`] = `
}
style={
[
{
"height": undefined,
"width": undefined,
},
undefined,
undefined,
{
Expand Down Expand Up @@ -2866,6 +2902,10 @@ exports[`AvatarScreen renders screen 1`] = `
}
style={
[
{
"height": undefined,
"width": undefined,
},
undefined,
undefined,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3294,6 +3294,7 @@ exports[`TextField Screen renders screen 1`] = `
}
style={
[
{},
undefined,
{
"height": 16,
Expand Down Expand Up @@ -3933,11 +3934,19 @@ exports[`TextField Screen renders screen 1`] = `
accessible={false}
source={
{
"testUri": "../../../src/assets/icons/xFlat.png",
"height": 16,
"uri": {
"testUri": "../../../src/assets/internal/icons/xFlat.png",
},
"width": 16,
}
}
style={
[
{
"height": 16,
"width": 16,
},
undefined,
undefined,
undefined,
Expand Down Expand Up @@ -3966,6 +3975,7 @@ exports[`TextField Screen renders screen 1`] = `
}
style={
[
{},
undefined,
undefined,
undefined,
Expand Down Expand Up @@ -4662,6 +4672,7 @@ exports[`TextField Screen renders screen 1`] = `
}
style={
[
{},
undefined,
undefined,
undefined,
Expand Down Expand Up @@ -6854,6 +6865,7 @@ exports[`TextField Screen renders screen 1`] = `
}
style={
[
{},
{
"marginLeft": 4,
},
Expand Down Expand Up @@ -7787,6 +7799,7 @@ exports[`TextField Screen renders screen 1`] = `
}
style={
[
{},
undefined,
undefined,
undefined,
Expand Down
2 changes: 1 addition & 1 deletion demo/src/screens/componentScreens/CheckboxScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class CheckboxScreen extends Component {
borderRadius={2}
size={30}
color={Colors.purple30}
selectedIcon={Assets.icons.x}
selectedIcon={Assets.icons.demo.x}
marginL-s5
/>

Expand Down
2 changes: 1 addition & 1 deletion demo/src/screens/componentScreens/IconScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const IconScreen = () => {
<Icon
size={customSize ? size : undefined}
tintColor={customColor ? (color as string) : undefined}
source={Assets.icons.search}
source={Assets.icons.demo.search}
badgeProps={
useBadge
? {
Expand Down
2 changes: 1 addition & 1 deletion demo/src/screens/componentScreens/ModalScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default class ModalScreen extends Component<ModalScreenProps, State> {
]}
leftButtons={[
{
icon: Assets.icons.x,
icon: Assets.icons.demo.x,
onPress: () => Alert.alert('back'),
buttonProps: {hitSlop: BUTTONS_HIT_SLOP, iconStyle: {tintColor: Colors.yellow10}}
}
Expand Down
2 changes: 1 addition & 1 deletion demo/src/screens/componentScreens/PickerScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const renderContact = (contactValue: any, props: any) => {
{contact?.name}
</Text>
</View>
{props.isSelected && <Icon source={Assets.icons.check} tintColor={Colors.$iconDefault}/>}
{props.isSelected && <Icon source={Assets.icons.demo.check} tintColor={Colors.$iconDefault}/>}
</View>
);
};
Expand Down
4 changes: 2 additions & 2 deletions demo/src/screens/componentScreens/RadioButtonScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export default class RadioButtonScreen extends Component {
Yes or No?
</Text>
<View row>
{this.renderRadioButtonWithImage('yes', Assets.icons.check, {tintColor: 'green'})}
{this.renderRadioButtonWithImage('no', Assets.icons.x, {tintColor: 'red'})}
{this.renderRadioButtonWithImage('yes', Assets.icons.demo.check, {tintColor: 'green'})}
{this.renderRadioButtonWithImage('no', Assets.icons.demo.x, {tintColor: 'red'})}
</View>
<Text marginT-10>You chose: {this.state.value}</Text>
</RadioGroup>
Expand Down
24 changes: 20 additions & 4 deletions demo/src/screens/componentScreens/SegmentedControlScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import React, {useCallback, useState} from 'react';
import {StyleSheet} from 'react-native';
import {Text, View, Colors, SegmentedControl, Assets, Spacings, BorderRadiuses, Typography, SegmentedControlItemProps} from 'react-native-ui-lib';
import {
Text,
View,
Colors,
SegmentedControl,
Assets,
Spacings,
BorderRadiuses,
Typography,
SegmentedControlItemProps
} from 'react-native-ui-lib';

const segments: Record<string, Array<SegmentedControlItemProps>> = {
first: [{label: 'Default'}, {label: 'Form'}],
second: [{label: '1'}, {label: '2'}, {label: '3'}, {label: Assets.emojis.airplane}, {label: '5'}],
third: [
{
label: 'Very Long Label with icon',
iconSource: Assets.icons.search,
iconSource: Assets.icons.demo.search,
iconStyle: {marginLeft: Spacings.s1, width: 16, height: 16},
iconOnRight: true
},
Expand All @@ -18,7 +28,11 @@ const segments: Record<string, Array<SegmentedControlItemProps>> = {
fifth: [{label: 'Full'}, {label: 'Width'}],
sixth: [{label: 'Full'}, {label: 'Width'}, {label: 'With'}, {label: 'A'}, {label: 'Very Long Segment'}],
seventh: [{label: '$'}, {label: '%'}],
eighth: [{label: 'Plus', iconSource: Assets.icons.plusSmall}, {label: 'Minus', iconSource: Assets.icons.minusSmall}, {label: 'Check', iconSource: Assets.icons.checkSmall}],
eighth: [
{label: 'Plus', iconSource: Assets.icons.demo.plus},
{label: 'Minus', iconSource: Assets.icons.demo.minus},
{label: 'Check', iconSource: Assets.icons.demo.check}
],
ninth: [{label: 'with'}, {label: 'a'}, {label: 'label'}]
};

Expand Down Expand Up @@ -72,7 +86,9 @@ const SegmentedControlScreen = () => {
segmentLabelStyle={styles.customTypography}
preset={screenPreset}
/>
<Text center marginT-s4>With Icons</Text>
<Text center marginT-s4>
With Icons
</Text>
<SegmentedControl segments={segments.eighth} preset={screenPreset}/>
<Text marginT-s4 center>
Custom Styling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Tab1 extends Component {
round
style={{width: 50}}
size={Button.sizes.small}
iconSource={Assets.icons.search}
iconSource={Assets.icons.demo.search}
white
/>
</View>
Expand Down
2 changes: 1 addition & 1 deletion demo/src/screens/componentScreens/ToastsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default class ToastsScreen extends Component {
onDismiss={this.dismissTopToast}
// autoDismiss={3000}
showDismiss={showDismiss}
// action={{iconSource: Assets.icons.x, onPress: () => console.log('dismiss')}}
// action={{iconSource: Assets.icons.demo.x, onPress: () => console.log('dismiss')}}
showLoader={showLoader}
/>
<Toast
Expand Down
2 changes: 1 addition & 1 deletion demo/src/screens/realExamples/ListActions/ActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export default class ActionsList extends Component {
size={'xSmall'}
round
backgroundColor="transparent"
iconSource={Assets.icons.x}
iconSource={Assets.icons.demo.x}
iconStyle={{tintColor: Colors.white}}
onPress={() => {
// console.warn('dismiss press');
Expand Down
2 changes: 1 addition & 1 deletion expoDemo/MainScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function MainScreen({navigation}) {
preset={null}
text70
fieldStyle={styles.fieldStyle}
leadingAccessory={<Icon source={Assets.icons.search} marginH-s2/>}
leadingAccessory={<Icon source={Assets.internal.icons.search} marginH-s2/>}
/>
}
sections={sections}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"releaseDemo": "./scripts/release/releaseDemo.sh",
"releaseDocs": "./scripts/release/releaseDocs.sh",
"releaseEslint": "./scripts/release/releaseEslint.sh",
"releaseNative": "./scripts/release/releaseNative.sh"
"releaseNative": "./scripts/release/releaseNative.sh",
"update-web-assets": "node scripts/assets/extract-dimensions.js"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateWebAssets - let's follow the other scripts' naming convention

},
"dependencies": {
"babel-plugin-transform-inline-environment-variables": "^0.0.2",
Expand Down
Loading