rizzo-next
Version:
The next generation of Lonely Planet's style guide and pattern library.
1,510 lines (1,509 loc) • 155 kB
JSON
{
"type": "Program",
"start": 0,
"end": 1417,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 59,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 26
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"name": "React"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 18,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 25
}
},
"value": "react",
"rawValue": "react",
"raw": "\"react\""
}
},
{
"type": "ImportDeclaration",
"start": 27,
"end": 63,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 36
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 34,
"end": 44,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
},
"local": {
"type": "Identifier",
"start": 34,
"end": 44,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
},
"name": "MapActions"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 50,
"end": 62,
"loc": {
"start": {
"line": 2,
"column": 23
},
"end": {
"line": 2,
"column": 35
}
},
"value": "../actions",
"rawValue": "../actions",
"raw": "\"../actions\""
}
},
{
"type": "ImportDeclaration",
"start": 64,
"end": 96,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 32
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 71,
"end": 79,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 15
}
},
"local": {
"type": "Identifier",
"start": 71,
"end": 79,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 15
}
},
"name": "MapState"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 85,
"end": 95,
"loc": {
"start": {
"line": 3,
"column": 21
},
"end": {
"line": 3,
"column": 31
}
},
"value": "../state",
"rawValue": "../state",
"raw": "\"../state\""
}
},
{
"type": "ImportDeclaration",
"start": 97,
"end": 132,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 35
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 104,
"end": 110,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 104,
"end": 110,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 13
}
},
"name": "titles"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 116,
"end": 131,
"loc": {
"start": {
"line": 4,
"column": 19
},
"end": {
"line": 4,
"column": 34
}
},
"value": "../tab_titles",
"rawValue": "../tab_titles",
"raw": "\"../tab_titles\""
}
},
{
"type": "ExportDefaultDeclaration",
"start": 134,
"end": 1416,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 58,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 149,
"end": 1416,
"loc": {
"start": {
"line": 6,
"column": 15
},
"end": {
"line": 58,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 155,
"end": 170,
"loc": {
"start": {
"line": 6,
"column": 21
},
"end": {
"line": 6,
"column": 36
}
},
"name": "SidebarDropdown"
},
"superClass": {
"type": "MemberExpression",
"start": 179,
"end": 194,
"loc": {
"start": {
"line": 6,
"column": 45
},
"end": {
"line": 6,
"column": 60
}
},
"object": {
"type": "Identifier",
"start": 179,
"end": 184,
"loc": {
"start": {
"line": 6,
"column": 45
},
"end": {
"line": 6,
"column": 50
}
},
"name": "React"
},
"property": {
"type": "Identifier",
"start": 185,
"end": 194,
"loc": {
"start": {
"line": 6,
"column": 51
},
"end": {
"line": 6,
"column": 60
}
},
"name": "Component"
},
"computed": false
},
"body": {
"type": "ClassBody",
"start": 195,
"end": 1416,
"loc": {
"start": {
"line": 6,
"column": 61
},
"end": {
"line": 58,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 199,
"end": 278,
"loc": {
"start": {
"line": 7,
"column": 2
},
"end": {
"line": 11,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 199,
"end": 210,
"loc": {
"start": {
"line": 7,
"column": 2
},
"end": {
"line": 7,
"column": 13
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 210,
"end": 278,
"loc": {
"start": {
"line": 7,
"column": 13
},
"end": {
"line": 11,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 211,
"end": 215,
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 18
}
},
"name": "data"
}
],
"body": {
"type": "BlockStatement",
"start": 217,
"end": 278,
"loc": {
"start": {
"line": 7,
"column": 20
},
"end": {
"line": 11,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 223,
"end": 235,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 16
}
},
"expression": {
"type": "CallExpression",
"start": 223,
"end": 234,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 15
}
},
"callee": {
"type": "Super",
"start": 223,
"end": 228,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 9
}
}
},
"arguments": [
{
"type": "Identifier",
"start": 229,
"end": 233,
"loc": {
"start": {
"line": 8,
"column": 10
},
"end": {
"line": 8,
"column": 14
}
},
"name": "data"
}
]
}
},
{
"type": "ExpressionStatement",
"start": 241,
"end": 274,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 37
}
},
"expression": {
"type": "AssignmentExpression",
"start": 241,
"end": 273,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 36
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 241,
"end": 251,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 14
}
},
"object": {
"type": "ThisExpression",
"start": 241,
"end": 245,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 246,
"end": 251,
"loc": {
"start": {
"line": 10,
"column": 9
},
"end": {
"line": 10,
"column": 14
}
},
"name": "state"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 254,
"end": 273,
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 36
}
},
"callee": {
"type": "MemberExpression",
"start": 254,
"end": 271,
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 34
}
},
"object": {
"type": "Identifier",
"start": 254,
"end": 262,
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 25
}
},
"name": "MapState"
},
"property": {
"type": "Identifier",
"start": 263,
"end": 271,
"loc": {
"start": {
"line": 10,
"column": 26
},
"end": {
"line": 10,
"column": 34
}
},
"name": "getState"
},
"computed": false
},
"arguments": []
}
}
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 282,
"end": 417,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 16,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 282,
"end": 299,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 13,
"column": 19
}
},
"name": "componentDidMount"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 299,
"end": 417,
"loc": {
"start": {
"line": 13,
"column": 19
},
"end": {
"line": 16,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 302,
"end": 417,
"loc": {
"start": {
"line": 13,
"column": 22
},
"end": {
"line": 16,
"column": 3
}
},
"body": [
{
"type": "IfStatement",
"start": 308,
"end": 413,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 15,
"column": 73
}
},
"test": {
"type": "UnaryExpression",
"start": 312,
"end": 337,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 33
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "MemberExpression",
"start": 313,
"end": 337,
"loc": {
"start": {
"line": 14,
"column": 9
},
"end": {
"line": 14,
"column": 33
}
},
"object": {
"type": "CallExpression",
"start": 313,
"end": 330,
"loc": {
"start": {
"line": 14,
"column": 9
},
"end": {
"line": 14,
"column": 26
}
},
"callee": {
"type": "Identifier",
"start": 313,
"end": 314,
"loc": {
"start": {
"line": 14,
"column": 9
},
"end": {
"line": 14,
"column": 10
}
},
"name": "$"
},
"arguments": [
{
"type": "Literal",
"start": 315,
"end": 329,
"loc": {
"start": {
"line": 14,
"column": 11
},
"end": {
"line": 14,
"column": 25
}
},
"value": ".is-selected",
"rawValue": ".is-selected",
"raw": "\".is-selected\""
}
]
},
"property": {
"type": "Identifier",
"start": 331,
"end": 337,
"loc": {
"start": {
"line": 14,
"column": 27
},
"end": {
"line": 14,
"column": 33
}
},
"name": "length"
},
"computed": false
}
},
"consequent": {
"type": "ExpressionStatement",
"start": 346,
"end": 413,
"loc": {
"start": {
"line": 15,
"column": 6
},
"end": {
"line": 15,
"column": 73
}
},
"expression": {
"type": "CallExpression",
"start": 346,
"end": 412,
"loc": {
"start": {
"line": 15,
"column": 6
},
"end": {
"line": 15,
"column": 72
}
},
"callee": {
"type": "MemberExpression",
"start": 346,
"end": 397,
"loc": {
"start": {
"line": 15,
"column": 6
},
"end": {
"line": 15,
"column": 57
}
},
"object": {
"type": "CallExpression",
"start": 346,
"end": 388,
"loc": {
"start": {
"line": 15,
"column": 6
},
"end": {
"line": 15,
"column": 48
}
},
"callee": {
"type": "Identifier",
"start": 346,
"end": 347,
"loc": {
"start": {
"line": 15,
"column": 6
},
"end": {
"line": 15,
"column": 7
}
},
"name": "$"
},
"arguments": [
{
"type": "Literal",
"start": 348,
"end": 387,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 47
}
},
"value": ".tab__sub-nav__list--item:first-child",
"rawValue": ".tab__sub-nav__list--item:first-child",
"raw": "\".tab__sub-nav__list--item:first-child\""
}
]
},
"property": {
"type": "Identifier",
"start": 389,
"end": 397,
"loc": {
"start": {
"line": 15,
"column": 49
},
"end": {
"line": 15,
"column": 57
}
},
"name": "addClass"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 398,
"end": 411,
"loc": {
"start": {
"line": 15,
"column": 58
},
"end": {
"line": 15,
"column": 71
}
},
"value": "is-selected",
"rawValue": "is-selected",
"raw": "\"is-selected\""
}
]
}
},
"alternate": null
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 421,
"end": 708,
"loc": {
"start": {
"line": 18,
"column": 2
},
"end": {
"line": 27,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 421,
"end": 432,
"loc": {
"start": {
"line": 18,
"column": 2
},
"end": {
"line": 18,
"column": 13
}
},
"name": "changeTopic"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 432,
"end": 708,
"loc": {
"start": {
"line": 18,
"column": 13
},
"end": {
"line": 27,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 433,
"end": 438,
"loc": {
"start": {
"line": 18,
"column": 14
},
"end": {
"line": 18,
"column": 19
}
},
"name": "event"
}
],
"body": {
"type": "BlockStatement",
"start": 440,
"end": 708,
"loc": {
"start": {
"line": 18,
"column": 21
},
"end": {
"line": 27,
"column": 3
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 446,
"end": 494,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 19,
"column": 52
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 450,
"end": 493,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 51
}
},
"id": {
"type": "Identifier",
"start": 450,
"end": 455,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 13
}
},
"name": "topic"
},
"init": {
"type": "CallExpression",
"start": 458,
"end": 493,
"loc": {
"start": {
"line": 19,
"column": 16
},
"end": {
"line": 19,
"column": 51
}
},
"callee": {
"type": "MemberExpression",
"start": 458,
"end": 485,
"loc": {
"start": {
"line": 19,
"column": 16
},
"end": {
"line": 19,
"column": 43
}
},
"object": {
"type": "CallExpression",
"start": 458,
"end": 480,
"loc": {
"start": {
"line": 19,
"column": 16
},
"end": {
"line": 19,
"column": 38
}
},
"callee": {
"type": "Identifier",
"start": 458,
"end": 459,
"loc": {
"start": {
"line": 19,
"column": 16
},
"end": {
"line": 19,
"column": 17
}
},
"name": "$"
},
"arguments": [
{
"type": "MemberExpression",
"start": 460,
"end": 479,
"loc": {
"start": {
"line": 19,
"column": 18
},
"end": {
"line": 19,
"column": 37
}
},
"object": {
"type": "Identifier",
"start": 460,
"end": 465,
"loc": {
"start": {
"line": 19,
"column": 18
},
"end": {
"line": 19,
"column": 23
}
},
"name": "event"
},
"property": {
"type": "Identifier",
"start": 466,
"end": 479,
"loc": {
"start": {
"line": 19,
"column": 24
},
"end": {
"line": 19,
"column": 37
}
},
"name": "currentTarget"
},
"computed": false
}
]
},
"property": {
"type": "Identifier",
"start": 481,
"end": 485,
"loc": {
"start": {
"line": 19,
"column": 39
},
"end": {
"line": 19,
"column": 43
}
},
"name": "data"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 486,
"end": 492,
"loc": {
"start": {
"line": 19,
"column": 44
},
"end": {
"line": 19,
"column": 50
}
},
"value": "item",
"rawValue": "item",
"raw": "\"item\""
}
]
}
}
],
"kind": "let"
},
{
"type": "ExpressionStatement",
"start": 499,
"end": 557,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 20,
"column": 62
}
},
"expression": {
"type": "CallExpression",
"start": 499,
"end": 556,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 20,
"column": 61
}
},
"callee": {
"type": "MemberExpression",
"start": 499,
"end": 541,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 20,
"column": 46
}
},
"object": {
"type": "CallExpression",
"start": 499,
"end": 529,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 20,
"column": 34
}
},
"callee": {
"type": "Identifier",
"start": 499,
"end": 500,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 20,
"column": 5
}
},
"name": "$"
},
"arguments": [
{
"type": "Literal",
"start": 501,
"end": 528,
"loc": {
"start": {
"line": 20,
"column": 6
},
"end": {
"line": 20,
"column": 33
}
},
"value": ".tab__sub-nav__list--item",
"rawValue": ".tab__sub-nav__list--item",
"raw": "\".tab__sub-nav__list--item\""
}
]
},
"property": {
"type": "Identifier",
"start": 530,
"end": 541,
"loc": {
"start": {
"line": 20,
"column": 35
},
"end": {
"line": 20,
"column": 46
}
},
"name": "removeClass"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 542,
"end": 555,
"loc": {
"start": {
"line": 20,
"column": 47
},
"end": {
"line": 20,
"column": 60
}
},
"value": "is-selected",
"rawValue": "is-selected",
"raw": "\"is-selected\""
}
]
}
},
{
"type": "ExpressionStatement",
"start": 563,
"end": 704,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 26,
"column": 7
}
},
"expression": {
"type": "CallExpression",
"start": 563,
"end": 703,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 26,
"column": 6
}
},
"callee": {
"type": "MemberExpression",
"start": 563,
"end": 583,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 24
}
},
"object": {
"type": "Identifier",
"start": 563,
"end": 573,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 14
}
},
"name": "MapActions"
},
"property": {
"type": "Identifier",
"start": 574,
"end": 583,
"loc": {
"start": {
"line": 22,
"column": 15
},
"end": {
"line": 22,
"column": 24
}
},
"name": "gotoPlace"
},
"computed": false
},
"arguments": [
{
"type": "ObjectExpression",
"start": 584,
"end": 702,
"loc": {
"start": {
"line": 22,
"column": 25
},
"end": {
"line": 26,
"column": 5
}
},