17 | );
18 | }
19 | }
20 |
21 | export default MyComponent;
22 |
--------------------------------------------------------------------------------
/examples/advanced/create-react-native-app/ios/Podfile:
--------------------------------------------------------------------------------
1 | require_relative '../node_modules/react-native/scripts/react_native_pods'
2 | require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
3 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
4 |
5 | platform :ios, '10.0'
6 |
7 | target 'createreactnativeapp' do
8 | use_unimodules!
9 | config = use_native_modules!
10 |
11 | use_react_native!(:path => config["reactNativePath"])
12 |
13 | # Uncomment the code below to enable Flipper.
14 | #
15 | # You should not install Flipper in CI environments when creating release
16 | # builds, this will lead to significantly slower build times.
17 | #
18 | # Note that if you have use_frameworks! enabled, Flipper will not work.
19 | #
20 | # use_flipper!
21 | # post_install do |installer|
22 | # flipper_post_install(installer)
23 | # end
24 | end
25 |
--------------------------------------------------------------------------------
/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/util/StringHelper.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 | package com.amazon.styledictionaryexample.util
16 |
17 | object StringHelper {
18 | fun nameToDisplay(str: String): String {
19 | return str.replace("_".toRegex(), " ")
20 | }
21 | }
--------------------------------------------------------------------------------
/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/models/StyleDictionaryNode.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 | package com.amazon.styledictionaryexample.models
16 |
17 | data class StyleDictionaryNode(
18 | val name: String,
19 | val count: Int = 0,
20 | val isLeaf: Boolean = false
21 | )
--------------------------------------------------------------------------------
/examples/advanced/format-helpers/README.md:
--------------------------------------------------------------------------------
1 | ## Format Helpers
2 |
3 | This example shows how to use the format helper methods to create custom formats.
4 |
5 | #### Running the example
6 |
7 | First of all, set up the required dependencies running the command `npm install` in your local CLI environment (if you prefer to use *yarn* update the commands accordingly).
8 |
9 | At this point, if you want to build the tokens you can run `npm run build`. This command will run the Style Dictionary CLI with the **sd.config.js** as the configuration file and will generate the files in the `build` folder.
10 |
11 | #### How does it work?
12 |
13 | Starting in version 3.0, Style Dictionary exposes internal helper methods for formats. In the configuration we are defining custom formats using some of those format helper methods.
14 |
15 | #### What to look at
16 |
17 | The [`sd.config.js`](sd.config.js) file has everything you need to know.
18 |
--------------------------------------------------------------------------------