1
+ "use strict" ;
2
+
3
+ Object . defineProperty ( exports , "__esModule" , {
4
+ value : true
5
+ } ) ;
6
+ exports [ "default" ] = void 0 ;
7
+
8
+ var _react = require ( "react" ) ;
9
+
10
+ var _propTypes = _interopRequireDefault ( require ( "prop-types" ) ) ;
11
+
12
+ var _themrShape = _interopRequireDefault ( require ( "../utils/themr-shape" ) ) ;
13
+
14
+ function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { "default" : obj } ; }
15
+
16
+ function _typeof ( obj ) { if ( typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ) { _typeof = function _typeof ( obj ) { return typeof obj ; } ; } else { _typeof = function _typeof ( obj ) { return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ; } ; } return _typeof ( obj ) ; }
17
+
18
+ function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
19
+
20
+ function _defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } }
21
+
22
+ function _createClass ( Constructor , protoProps , staticProps ) { if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) _defineProperties ( Constructor , staticProps ) ; return Constructor ; }
23
+
24
+ function _possibleConstructorReturn ( self , call ) { if ( call && ( _typeof ( call ) === "object" || typeof call === "function" ) ) { return call ; } return _assertThisInitialized ( self ) ; }
25
+
26
+ function _assertThisInitialized ( self ) { if ( self === void 0 ) { throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ; } return self ; }
27
+
28
+ function _getPrototypeOf ( o ) { _getPrototypeOf = Object . setPrototypeOf ? Object . getPrototypeOf : function _getPrototypeOf ( o ) { return o . __proto__ || Object . getPrototypeOf ( o ) ; } ; return _getPrototypeOf ( o ) ; }
29
+
30
+ function _inherits ( subClass , superClass ) { if ( typeof superClass !== "function" && superClass !== null ) { throw new TypeError ( "Super expression must either be null or a function" ) ; } subClass . prototype = Object . create ( superClass && superClass . prototype , { constructor : { value : subClass , writable : true , configurable : true } } ) ; if ( superClass ) _setPrototypeOf ( subClass , superClass ) ; }
31
+
32
+ function _setPrototypeOf ( o , p ) { _setPrototypeOf = Object . setPrototypeOf || function _setPrototypeOf ( o , p ) { o . __proto__ = p ; return o ; } ; return _setPrototypeOf ( o , p ) ; }
33
+
34
+ function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
35
+
36
+ var ThemeProvider =
37
+ /*#__PURE__*/
38
+ function ( _Component ) {
39
+ _inherits ( ThemeProvider , _Component ) ;
40
+
41
+ function ThemeProvider ( ) {
42
+ _classCallCheck ( this , ThemeProvider ) ;
43
+
44
+ return _possibleConstructorReturn ( this , _getPrototypeOf ( ThemeProvider ) . apply ( this , arguments ) ) ;
45
+ }
46
+
47
+ _createClass ( ThemeProvider , [ {
48
+ key : "getChildContext" ,
49
+ value : function getChildContext ( ) {
50
+ return {
51
+ themr : {
52
+ theme : this . props . theme
53
+ }
54
+ } ;
55
+ }
56
+ } , {
57
+ key : "render" ,
58
+ value : function render ( ) {
59
+ return _react . Children . only ( this . props . children ) ;
60
+ }
61
+ } ] ) ;
62
+
63
+ return ThemeProvider ;
64
+ } ( _react . Component ) ;
65
+
66
+ exports [ "default" ] = ThemeProvider ;
67
+
68
+ _defineProperty ( ThemeProvider , "propTypes" , {
69
+ children : _propTypes [ "default" ] . element . isRequired ,
70
+ theme : _propTypes [ "default" ] . object . isRequired
71
+ } ) ;
72
+
73
+ _defineProperty ( ThemeProvider , "defaultProps" , {
74
+ theme : { }
75
+ } ) ;
76
+
77
+ _defineProperty ( ThemeProvider , "childContextTypes" , {
78
+ themr : _themrShape [ "default" ] . isRequired
79
+ } ) ;
0 commit comments