@wayke-se/components-react 3.6.1-beta.1 → 3.6.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,29 +1,29 @@
1
1
  # Components React
2
2
 
3
- This repository contains components for search and items to use on external websites.
3
+ > This repository contains components for search and items to use on external websites.
4
4
 
5
- ## Usage
5
+ ## Notes
6
6
 
7
- Get started using `@wayke-se/components-react`.
7
+ * Starting from version `2.0.0` and above will require import of `@wayke.se/components-react/assets/default.css` in order to apply basic styling to the gallery.
8
8
 
9
- ### Before you start
9
+ ## Usage
10
10
 
11
- **Install**
11
+ Install
12
12
  ```bash
13
13
  npm install @wayke-se/components-react
14
14
  ```
15
15
 
16
- **Install peer dependencies**
16
+ Install peer dependencies
17
17
  ```bash
18
18
  npm install react react-dom styled-components
19
19
  ```
20
20
 
21
- ### Basic usage
22
-
23
21
  ```javascript
24
22
  import React from 'react';
25
23
  import WaykeComposite from '@wayke-se/components-react'
26
- import '@wayke-se/ecom-web/dist/index.css'; // Only required if Ecom is activated
24
+ import '@wayke-se/components-react/assets/default.css';
25
+ // Optional
26
+ import '@wayke-se/ecom-web/dist/index.css';
27
27
 
28
28
  const ProviderSettings: WaykeProviderSettings = {
29
29
  graphQlUrl: "https://gql.wayketech.se/query",
@@ -66,9 +66,10 @@ const ProviderSettings: WaykeProviderSettings = {
66
66
  }
67
67
  ```
68
68
 
69
+
69
70
  ### WaykeComposite uses hash-route, i want to use path-route
70
71
 
71
- In this case you need to make sure that you are in control of the routing, if the user reloads the page, where same html file is
72
+ In this case you need to make sure that you are in control of the routing, if the user reloads the page, where same html file is
72
73
  served for `/your/path/to/this/component` and `/your/path/to/this/component/00000000-0000-0000-0000-000000000000`.
73
74
 
74
75
  Examples given the application is located in `/search/vehicles`:
@@ -83,7 +84,9 @@ Examples given the application is located in `/search/vehicles`:
83
84
  ```javascript
84
85
  import React from 'react';
85
86
  import { WaykeCompositePath } from '@wayke-se/components-react'
86
- import '@wayke-se/ecom-web/dist/index.css'; // Only required if Ecom is activated
87
+ import '@wayke.se/components-react/assets/default.css';
88
+ // Optional
89
+ import '@wayke-se/ecom-web/dist/index.css';
87
90
 
88
91
  const App = () => (
89
92
  <WaykeCompositePath
@@ -116,6 +119,7 @@ const App = () => {
116
119
  );
117
120
  };
118
121
  ```
122
+
119
123
  ### I only want to use the Search Item component
120
124
 
121
125
  It's recomended to place WaykeItemProvider close to app-root in order to keep the cache
@@ -123,7 +127,9 @@ It's recomended to place WaykeItemProvider close to app-root in order to keep th
123
127
  ```javascript
124
128
  import React, { useCallback } from 'react';
125
129
  import { WaykeItemProvider, WaykeSearchItem } from '@wayke-se/components-react'
126
- import '@wayke-se/ecom-web/dist/index.css'; // Only required if Ecom is activated
130
+ import '@wayke.se/components-react/assets/default.css';
131
+ // Optional
132
+ import '@wayke-se/ecom-web/dist/index.css';
127
133
 
128
134
  const App = ({}) => {
129
135
  const id = 'd01f79a3-7552-49c4-9d4d-deb3aa581c31';
@@ -436,7 +442,7 @@ To style the components, copy the following snippet into your *CSS* file and mod
436
442
  }
437
443
  ```
438
444
 
439
- ...or if you want to use it as _Sass_ (.scss):
445
+ ...or if you want to use it as Sass (.scss):
440
446
 
441
447
  ```scss
442
448
  .wayke__theme {
@@ -468,23 +474,17 @@ To style the components, copy the following snippet into your *CSS* file and mod
468
474
  }
469
475
  ```
470
476
 
471
- > **It is highly recommended to *NOT* add or remove any properties defined above in the color selectors**. However, since fonts usually requires more configuration we encourage you to add the necessary font styling required to match your current profile. If you add new properties to the font selectors, please be careful and ensure everything looks as intended before going into production.
472
-
473
477
  ### Ecom theme
478
+ The default ecom css can be found and imported `node_module/@wayke-se/ecom-web/dist/index.css`.
474
479
 
475
- The default Ecom *CSS* can be found and imported from `@wayke-se/ecom-web/dist/index.css`. This is only necessary if Ecom is activated. If activated and the *CSS* is not imported, the Ecom module will not be displayed correctly.
476
-
477
- If you want to customize the look of the Ecom module we refer you to the documentation of [@wayke-se/ecom-web](https://www.npmjs.com/package/@wayke-se/ecom-web).
478
-
479
- ## Run example from this repository
480
-
481
- This repository contains an example app that uses [@wayke-se/components-react](https://www.npmjs.com/package/@wayke-se/components-react).
480
+ > **It is highly recommended to *NOT* add or remove any properties defined above in the color selectors**. However, since fonts usually requires more configuration we encourage you to add the necessary font styling required to match your current profile. If you add new properties to the font selectors, please be careful and ensure everything looks as intended before going into production.
482
481
 
482
+ ## Run example from repo
483
+ This repository contains a example app that uses [@wayke-se/components-react](https://www.npmjs.com/package/@wayke-se/components-react).
483
484
 
484
- ### Setup environment variables
485
485
 
486
- To start the example create an `.env` file in root with the following content.
487
486
 
487
+ To start the example create an `.env` file in root.
488
488
  ```
489
489
  WAYKE_HOST=YOUR_HOST_1,YOUR_HOST_2
490
490
  WAYKE_SEARCH_URL=https://api.wayketech.se/vehicles
@@ -495,15 +495,10 @@ WAYKE_ECOM_URL=https://ecom.wayketech.se
495
495
  GOOGLE_MAPS_API_KEY=YOUR_GOOGLE_MAPS_STATIC_API_KEY
496
496
  ```
497
497
 
498
- #### Notes
499
-
500
- * `WAYKE_SEARCH_MLT_URL` - An *optional* flag. Will fetch related vehicles to current vehicle. If not provided
498
+ * `WAYKE_SEARCH_MLT_URL` - An *optional* flag. Will fetch related vehicles to current vehicle. If not provided
501
499
  `WAYKE_SEARCH_URL` will be used instead, but will fetch latest vehicles.
502
500
 
503
- ### Start the example app
504
-
505
- Run the following commands to start the example app.
506
-
501
+ Then run the following:
507
502
  ```bash
508
503
  npm install
509
504
  cd example
@@ -511,38 +506,35 @@ npm install
511
506
  npm start
512
507
  ```
513
508
 
514
- ### Custom host
515
-
516
- `WAYKE_HOST` can be used instead of using and exposing the `WAYKE_SEARCH_X_API_KEY`. If, for example, your development host is `test.com.localhost`.
517
-
518
- To do so update your local host file and add:
519
- ```txt
509
+ `WAYKE_HOST` can be used instead of using and exposing the `WAYKE_SEARCH_X_API_KEY`. If, for example, your development host is `test.com.localhost`
510
+ Update your local host file and add:
520
511
  127.0.0.1 test.com.localhost
521
- ```
522
-
523
- This will change the origin, while still pointing to `localhost`. Start the example app and open `test.com.localhost:5000` in your browser.
524
-
525
- ### Multiple hosts
512
+ This will change the origin, while still pointing to localhost.
513
+ Start the example and open `test.com.localhost:5000`.
526
514
 
527
- To add multiple hosts, add all hohsts to your local host file and then update `WAYKE_HOST` in `.env` as a comma separated list.
528
-
529
- ```txt
515
+ To add more hosts, add all to your local host file and then update `WAYKE_HOST` (comma separated):
516
+ ```
530
517
  WAYKE_HOST=a.com.localhost,b.com.localhost
531
518
  ```
532
-
533
519
  `a.com.localhost:5000` and `b.com.localhost:5000` can now be accessed.
534
520
 
535
- ### Available routes (independent)
536
521
 
537
- **WaykeComposite**
522
+ ### Available Routes (Independent)
523
+
524
+ #### WaykeComposite
538
525
  [http://localhost:5000](http://localhost:5000)
539
526
 
540
- **WaykeSearch With WaykeProvider**
527
+ #### WaykeSearch With WaykeProvider
541
528
  [http://localhost:5000/search](http://localhost:5000/search)
542
529
 
543
- **WaykeSearchItem With WaykeProvider**
530
+ #### WaykeSearchItem With WaykeProvider
544
531
  [http://localhost:5000/search-item/d01f79a3-7552-49c4-9d4d-deb3aa581c31](http://localhost:5000/search-item/d01f79a3-7552-49c4-9d4d-deb3aa581c31)
545
532
 
533
+
546
534
  ## Example repositories
547
535
 
548
- We have setup an example repository where you can see how we've implemented `@wayke-se/components-react`. You'll find the repository here: [https://github.com/wayke-se/components-react-example](https://github.com/wayke-se/components-react-example).
536
+ ### React and Typescript example
537
+ [https://github.com/wayke-se/components-react-boilerplate](https://github.com/wayke-se/components-react-boilerplate)
538
+
539
+ ### Non-React with/without Typescript example
540
+ [https://github.com/wayke-se/components-react-example](https://github.com/wayke-se/components-react-example)
Binary file
@@ -0,0 +1 @@
1
+ @charset 'UTF-8';.slick-slider{position:relative;display:block;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-khtml-user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.slick-list{position:relative;display:block;overflow:hidden;margin:0;padding:0}.slick-list:focus{outline:0}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-list,.slick-slider .slick-track{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.slick-track{position:relative;top:0;left:0;display:block;margin-left:auto;margin-right:auto}.slick-track:after,.slick-track:before{display:table;content:''}.slick-track:after{clear:both}.slick-loading .slick-track{visibility:hidden}.slick-slide{display:none;float:left;height:100%;min-height:1px}[dir=rtl] .slick-slide{float:right}.slick-slide img{display:block}.slick-slide.slick-loading img{display:none}.slick-slide.dragging img{pointer-events:none}.slick-initialized .slick-slide{display:block}.slick-loading .slick-slide{visibility:hidden}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-arrow.slick-hidden{display:none}.slick-loading .slick-list{background:#fff url(ajax-loader.gif) center center no-repeat}@font-face{font-family:slick;font-weight:400;font-style:normal;src:url(fonts/slick.eot);src:url(fonts/slick.eot?#iefix) format('embedded-opentype'),url(fonts/slick.woff) format('woff'),url(fonts/slick.ttf) format('truetype'),url(fonts/slick.svg#slick) format('svg')}.slick-next,.slick-prev{font-size:0;line-height:0;position:absolute;top:50%;display:block;width:20px;height:20px;padding:0;-webkit-transform:translate(0,-50%);-ms-transform:translate(0,-50%);transform:translate(0,-50%);cursor:pointer;color:transparent;border:none;outline:0;background:0 0}.slick-next:focus,.slick-next:hover,.slick-prev:focus,.slick-prev:hover{color:transparent;outline:0;background:0 0}.slick-next:focus:before,.slick-next:hover:before,.slick-prev:focus:before,.slick-prev:hover:before{opacity:1}.slick-next.slick-disabled:before,.slick-prev.slick-disabled:before{opacity:.25}.slick-next:before,.slick-prev:before{font-family:slick;font-size:20px;line-height:1;opacity:.75;color:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-prev{left:-25px}[dir=rtl] .slick-prev{right:-25px;left:auto}.slick-prev:before{content:'←'}[dir=rtl] .slick-prev:before{content:'→'}.slick-next{right:-25px}[dir=rtl] .slick-next{right:auto;left:-25px}.slick-next:before{content:'→'}[dir=rtl] .slick-next:before{content:'←'}.slick-dotted.slick-slider{margin-bottom:30px}.slick-dots{position:absolute;bottom:-25px;display:block;width:100%;padding:0;margin:0;list-style:none;text-align:center}.slick-dots li{position:relative;display:inline-block;width:20px;height:20px;margin:0 5px;padding:0;cursor:pointer}.slick-dots li button{font-size:0;line-height:0;display:block;width:20px;height:20px;padding:5px;cursor:pointer;color:transparent;border:0;outline:0;background:0 0}.slick-dots li button:focus,.slick-dots li button:hover{outline:0}.slick-dots li button:focus:before,.slick-dots li button:hover:before{opacity:1}.slick-dots li button:before{font-family:slick;font-size:6px;line-height:20px;position:absolute;top:0;left:0;width:20px;height:20px;content:'•';text-align:center;opacity:.25;color:#000;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-dots li.slick-active button:before{opacity:.75;color:#000}
Binary file
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by Fontastic.me</metadata>
5
+ <defs>
6
+ <font id="slick" horiz-adv-x="512">
7
+ <font-face font-family="slick" units-per-em="512" ascent="480" descent="-32"/>
8
+ <missing-glyph horiz-adv-x="512" />
9
+
10
+ <glyph unicode="&#8594;" d="M241 113l130 130c4 4 6 8 6 13 0 5-2 9-6 13l-130 130c-3 3-7 5-12 5-5 0-10-2-13-5l-29-30c-4-3-6-7-6-12 0-5 2-10 6-13l87-88-87-88c-4-3-6-8-6-13 0-5 2-9 6-12l29-30c3-3 8-5 13-5 5 0 9 2 12 5z m234 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
11
+ <glyph unicode="&#8592;" d="M296 113l29 30c4 3 6 7 6 12 0 5-2 10-6 13l-87 88 87 88c4 3 6 8 6 13 0 5-2 9-6 12l-29 30c-3 3-8 5-13 5-5 0-9-2-12-5l-130-130c-4-4-6-8-6-13 0-5 2-9 6-13l130-130c3-3 7-5 12-5 5 0 10 2 13 5z m179 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
12
+ <glyph unicode="&#8226;" d="M475 256c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
13
+ <glyph unicode="&#97;" d="M475 439l0-128c0-5-1-9-5-13-4-4-8-5-13-5l-128 0c-8 0-13 3-17 11-3 7-2 14 4 20l40 39c-28 26-62 39-100 39-20 0-39-4-57-11-18-8-33-18-46-32-14-13-24-28-32-46-7-18-11-37-11-57 0-20 4-39 11-57 8-18 18-33 32-46 13-14 28-24 46-32 18-7 37-11 57-11 23 0 44 5 64 15 20 9 38 23 51 42 2 1 4 3 7 3 3 0 5-1 7-3l39-39c2-2 3-3 3-6 0-2-1-4-2-6-21-25-46-45-76-59-29-14-60-20-93-20-30 0-58 5-85 17-27 12-51 27-70 47-20 19-35 43-47 70-12 27-17 55-17 85 0 30 5 58 17 85 12 27 27 51 47 70 19 20 43 35 70 47 27 12 55 17 85 17 28 0 55-5 81-15 26-11 50-26 70-45l37 37c6 6 12 7 20 4 8-4 11-9 11-17z"/>
14
+ </font></defs></svg>
Binary file
Binary file
@@ -3384,76 +3384,6 @@ const SliderWrapper = styled__default.div`
3384
3384
  bottom: 0;
3385
3385
  left: 0;
3386
3386
  right: 0;
3387
- user-select: none;
3388
- touch-action: pan-y;
3389
- -webkit-tap-highlight-color: transparent;
3390
-
3391
- .slick-list,
3392
- .slick-track {
3393
- transform: translate3d(0, 0, 0);
3394
- }
3395
- }
3396
-
3397
- .slick-list {
3398
- position: relative;
3399
- display: block;
3400
- margin: 0;
3401
- padding: 0;
3402
- overflow: hidden;
3403
-
3404
- &:focus {
3405
- outline: none;
3406
- }
3407
-
3408
- &.dragging {
3409
- cursor: pointer;
3410
- cursor: hand;
3411
- }
3412
- }
3413
-
3414
- .slick-track {
3415
- position: relative;
3416
- top: 0;
3417
- left: 0;
3418
- display: block;
3419
- margin-left: auto;
3420
- margin-right: auto;
3421
-
3422
- &::before,
3423
- &::after {
3424
- content: '';
3425
- display: table;
3426
- }
3427
-
3428
- &::after {
3429
- clear: both;
3430
- }
3431
- }
3432
-
3433
- .slick-slide {
3434
- display: none;
3435
- float: left;
3436
- min-height: 1px;
3437
- }
3438
-
3439
- .slick-loading {
3440
- .slick-track {
3441
- visibility: hidden;
3442
- }
3443
-
3444
- img {
3445
- display: none;
3446
- }
3447
- }
3448
-
3449
- .slick-initialized {
3450
- .slick-slide {
3451
- display: block;
3452
- }
3453
- }
3454
-
3455
- .slick-slide.dragging img {
3456
- pointer-events: none;
3457
3387
  }
3458
3388
 
3459
3389
  ${props => props.theme.breakpoint.LtMd} {
@@ -3466,6 +3396,7 @@ const SliderWrapper = styled__default.div`
3466
3396
 
3467
3397
  .slick-slide {
3468
3398
  border-right: ${size(1)} solid ${props => props.theme.color.bg};
3399
+ //transform: scale(0.95);
3469
3400
  transform-origin: 0 50%;
3470
3401
  transition: transform 150ms ease;
3471
3402
  }