-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(theme): making all component tokens optional (#3129)
- Loading branch information
1 parent
24d40f0
commit 0377bcc
Showing
15 changed files
with
185 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@aws-amplify/ui": patch | ||
"@aws-amplify/ui-react": patch | ||
--- | ||
|
||
fix(theme): making all component tokens optional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import { Theme } from '../index'; | ||
|
||
describe('Amplify UI Theme', () => { | ||
describe('components', () => { | ||
it('should allow empty components', () => { | ||
const theme: Theme = { | ||
name: 'test', | ||
tokens: { | ||
components: { | ||
alert: {}, | ||
authenticator: {}, | ||
autocomplete: {}, | ||
badge: {}, | ||
button: {}, | ||
card: {}, | ||
checkbox: {}, | ||
checkboxfield: {}, | ||
collection: {}, | ||
copy: {}, | ||
divider: {}, | ||
expander: {}, | ||
field: {}, | ||
fieldcontrol: {}, | ||
fieldgroup: {}, | ||
fieldmessages: {}, | ||
fileuploader: {}, | ||
flex: {}, | ||
heading: {}, | ||
highlightmatch: {}, | ||
icon: {}, | ||
image: {}, | ||
inappmessaging: {}, | ||
link: {}, | ||
loader: {}, | ||
menu: {}, | ||
pagination: {}, | ||
passwordfield: {}, | ||
phonenumberfield: {}, | ||
placeholder: {}, | ||
radio: {}, | ||
radiogroup: {}, | ||
rating: {}, | ||
searchfield: {}, | ||
select: {}, | ||
selectfield: {}, | ||
sliderfield: {}, | ||
stepperfield: {}, | ||
switchfield: {}, | ||
table: {}, | ||
tabs: {}, | ||
text: {}, | ||
textareafield: {}, | ||
textfield: {}, | ||
togglebutton: {}, | ||
togglebuttongroup: {}, | ||
}, | ||
}, | ||
}; | ||
// This test doesn't test anything, but | ||
// if there is a TS error it will fail | ||
expect(theme).toMatchInlineSnapshot(` | ||
Object { | ||
"name": "test", | ||
"tokens": Object { | ||
"components": Object { | ||
"alert": Object {}, | ||
"authenticator": Object {}, | ||
"autocomplete": Object {}, | ||
"badge": Object {}, | ||
"button": Object {}, | ||
"card": Object {}, | ||
"checkbox": Object {}, | ||
"checkboxfield": Object {}, | ||
"collection": Object {}, | ||
"copy": Object {}, | ||
"divider": Object {}, | ||
"expander": Object {}, | ||
"field": Object {}, | ||
"fieldcontrol": Object {}, | ||
"fieldgroup": Object {}, | ||
"fieldmessages": Object {}, | ||
"fileuploader": Object {}, | ||
"flex": Object {}, | ||
"heading": Object {}, | ||
"highlightmatch": Object {}, | ||
"icon": Object {}, | ||
"image": Object {}, | ||
"inappmessaging": Object {}, | ||
"link": Object {}, | ||
"loader": Object {}, | ||
"menu": Object {}, | ||
"pagination": Object {}, | ||
"passwordfield": Object {}, | ||
"phonenumberfield": Object {}, | ||
"placeholder": Object {}, | ||
"radio": Object {}, | ||
"radiogroup": Object {}, | ||
"rating": Object {}, | ||
"searchfield": Object {}, | ||
"select": Object {}, | ||
"selectfield": Object {}, | ||
"sliderfield": Object {}, | ||
"stepperfield": Object {}, | ||
"switchfield": Object {}, | ||
"table": Object {}, | ||
"tabs": Object {}, | ||
"text": Object {}, | ||
"textareafield": Object {}, | ||
"textfield": Object {}, | ||
"togglebutton": Object {}, | ||
"togglebuttongroup": Object {}, | ||
}, | ||
}, | ||
} | ||
`); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters