@searchspring/snap-preact-components 0.30.0 → 0.31.0

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.
Files changed (29) hide show
  1. package/dist/cjs/components/Molecules/Carousel/Carousel.d.ts +1 -0
  2. package/dist/cjs/components/Molecules/Carousel/Carousel.d.ts.map +1 -1
  3. package/dist/cjs/components/Molecules/Carousel/Carousel.js +5 -2
  4. package/dist/cjs/components/Molecules/Carousel/Carousel.stories.d.ts +11 -0
  5. package/dist/cjs/components/Molecules/Carousel/Carousel.stories.d.ts.map +1 -1
  6. package/dist/cjs/components/Molecules/Carousel/Carousel.stories.js +8 -0
  7. package/dist/cjs/components/Organisms/Recommendation/Recommendation.stories.d.ts +11 -0
  8. package/dist/cjs/components/Organisms/Recommendation/Recommendation.stories.d.ts.map +1 -1
  9. package/dist/cjs/components/Organisms/Recommendation/Recommendation.stories.js +8 -0
  10. package/dist/cjs/providers/controller.d.ts.map +1 -1
  11. package/dist/cjs/providers/controller.js +3 -1
  12. package/dist/cjs/providers/store.d.ts +2 -2
  13. package/dist/cjs/providers/store.d.ts.map +1 -1
  14. package/dist/cjs/providers/store.js +3 -1
  15. package/dist/esm/components/Molecules/Carousel/Carousel.d.ts +1 -0
  16. package/dist/esm/components/Molecules/Carousel/Carousel.d.ts.map +1 -1
  17. package/dist/esm/components/Molecules/Carousel/Carousel.js +5 -2
  18. package/dist/esm/components/Molecules/Carousel/Carousel.stories.d.ts +11 -0
  19. package/dist/esm/components/Molecules/Carousel/Carousel.stories.d.ts.map +1 -1
  20. package/dist/esm/components/Molecules/Carousel/Carousel.stories.js +9 -0
  21. package/dist/esm/components/Organisms/Recommendation/Recommendation.stories.d.ts +11 -0
  22. package/dist/esm/components/Organisms/Recommendation/Recommendation.stories.d.ts.map +1 -1
  23. package/dist/esm/components/Organisms/Recommendation/Recommendation.stories.js +9 -0
  24. package/dist/esm/providers/controller.d.ts.map +1 -1
  25. package/dist/esm/providers/controller.js +3 -1
  26. package/dist/esm/providers/store.d.ts +2 -2
  27. package/dist/esm/providers/store.d.ts.map +1 -1
  28. package/dist/esm/providers/store.js +3 -1
  29. package/package.json +11 -11
@@ -51,6 +51,7 @@ export interface CarouselProps extends ComponentProps {
51
51
  onNextButtonClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
52
52
  onPrevButtonClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
53
53
  onInit?: (swiper: SwiperCore) => void;
54
+ modules?: any[];
54
55
  children: JSX.Element[];
55
56
  }
56
57
  //# sourceMappingURL=Carousel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Carousel/Carousel.tsx"],"names":[],"mappings":";AAQA,OAAO,UAAsC,MAAM,aAAa,CAAC;AAMjE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AA8H9E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BtC,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,QAAQ,gBAAyB,aAAa,KAAG,WAAW;;CAiJvE,CAAC;AAEH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACpD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAA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U,GAAG,YAAY,KAAK,IAAI,CAAC;IAClF,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC3E,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC3E,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;CACxB"}
@@ -235,7 +235,7 @@ exports.Carousel = (0, mobx_react_lite_1.observer)(function (properties) {
235
235
  }
236
236
  props = __assign(__assign(__assign({}, props), displaySettings), { theme: theme_1 });
237
237
  }
238
- var children = props.children, breakpoints = props.breakpoints, loop = props.loop, pagination = props.pagination, nextButton = props.nextButton, prevButton = props.prevButton, hideButtons = props.hideButtons, vertical = props.vertical, autoAdjustSlides = props.autoAdjustSlides, onInit = props.onInit, onNextButtonClick = props.onNextButtonClick, onPrevButtonClick = props.onPrevButtonClick, onClick = props.onClick, disableStyles = props.disableStyles, style = props.style, className = props.className, additionalProps = __rest(props, ["children", "breakpoints", "loop", "pagination", "nextButton", "prevButton", "hideButtons", "vertical", "autoAdjustSlides", "onInit", "onNextButtonClick", "onPrevButtonClick", "onClick", "disableStyles", "style", "className"]);
238
+ var children = props.children, breakpoints = props.breakpoints, loop = props.loop, pagination = props.pagination, nextButton = props.nextButton, prevButton = props.prevButton, hideButtons = props.hideButtons, vertical = props.vertical, autoAdjustSlides = props.autoAdjustSlides, onInit = props.onInit, onNextButtonClick = props.onNextButtonClick, onPrevButtonClick = props.onPrevButtonClick, onClick = props.onClick, disableStyles = props.disableStyles, style = props.style, modules = props.modules, className = props.className, additionalProps = __rest(props, ["children", "breakpoints", "loop", "pagination", "nextButton", "prevButton", "hideButtons", "vertical", "autoAdjustSlides", "onInit", "onNextButtonClick", "onPrevButtonClick", "onClick", "disableStyles", "style", "modules", "className"]);
239
239
  var subProps = {
240
240
  icon: __assign(__assign(__assign({
241
241
  // default props
@@ -245,7 +245,10 @@ exports.Carousel = (0, mobx_react_lite_1.observer)(function (properties) {
245
245
  // component theme overrides
246
246
  theme: props.theme }),
247
247
  };
248
- core_1.default.use([core_1.Pagination, core_1.Navigation]);
248
+ var swiperModulesUnfiltered = modules ? [core_1.Navigation, core_1.Pagination].concat(modules) : [core_1.Navigation, core_1.Pagination];
249
+ //remove any duplicates, in case user passes in Navigation or Pagination
250
+ var swiperModules = swiperModulesUnfiltered.filter(function (module, pos) { return swiperModulesUnfiltered.indexOf(module) === pos; });
251
+ core_1.default.use(swiperModules);
249
252
  var navigationPrevRef = (0, hooks_1.useRef)(null);
250
253
  var navigationNextRef = (0, hooks_1.useRef)(null);
251
254
  var rootComponentRef = (0, hooks_1.useRef)(null);
@@ -109,6 +109,17 @@ declare const _default: {
109
109
  type: string;
110
110
  };
111
111
  };
112
+ modules: {
113
+ description: string;
114
+ table: {
115
+ type: {
116
+ summary: string;
117
+ };
118
+ defaultValue: {
119
+ summary: string;
120
+ };
121
+ };
122
+ };
112
123
  hideButtons: {
113
124
  defaultValue: boolean;
114
125
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Carousel/Carousel.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAAY,aAAa,EAAE,MAAM,YAAY,CAAC;;;;;;;;;;;yBAmB3C,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAdb,wBAqJE;AAIF,eAAO,MAAM,MAAM;YAAW,aAAa;;;;;;CAQ1C,CAAC;AAOF,eAAO,MAAM,KAAK,UAAW,aAAa,kBAazC,CAAC"}
1
+ {"version":3,"file":"Carousel.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Carousel/Carousel.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAAY,aAAa,EAAE,MAAM,YAAY,CAAC;;;;;;;;;;;yBAmB3C,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAdb,wBA8JE;AAIF,eAAO,MAAM,MAAM;YAAW,aAAa;;;;;;CAQ1C,CAAC;AAOF,eAAO,MAAM,KAAK,UAAW,aAAa,kBAazC,CAAC"}
@@ -68,6 +68,14 @@ exports.default = {
68
68
  defaultValue: { summary: false },
69
69
  },
70
70
  control: { type: 'boolean' },
71
+ }, modules: {
72
+ description: 'Additional Swiper modules',
73
+ table: {
74
+ type: {
75
+ summary: 'SwiperModule[]',
76
+ },
77
+ defaultValue: { summary: '[Navigation, Pagination]' },
78
+ },
71
79
  }, hideButtons: {
72
80
  defaultValue: false,
73
81
  description: 'Hide prev/next buttons',
@@ -122,6 +122,17 @@ declare const _default: {
122
122
  type: string;
123
123
  };
124
124
  };
125
+ modules: {
126
+ description: string;
127
+ table: {
128
+ type: {
129
+ summary: string;
130
+ };
131
+ defaultValue: {
132
+ summary: string;
133
+ };
134
+ };
135
+ };
125
136
  pagination: {
126
137
  defaultValue: boolean;
127
138
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Recommendation.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Organisms/Recommendation/Recommendation.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;;;;yBAkBpE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAdb,wBAmIE;AAIF,eAAO,MAAM,OAAO;YAAW,mBAAmB;;wBAAsD,wBAAwB;;;;;;CAE/H,CAAC"}
1
+ {"version":3,"file":"Recommendation.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Organisms/Recommendation/Recommendation.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;;;;yBAkBpE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAdb,wBA4IE;AAIF,eAAO,MAAM,OAAO;YAAW,mBAAmB;;wBAAsD,wBAAwB;;;;;;CAE/H,CAAC"}
@@ -111,6 +111,14 @@ exports.default = {
111
111
  },
112
112
  },
113
113
  control: { type: 'none' },
114
+ }, modules: {
115
+ description: 'Additional Swiper modules',
116
+ table: {
117
+ type: {
118
+ summary: 'SwiperModule[]',
119
+ },
120
+ defaultValue: { summary: '[Navigation, Pagination]' },
121
+ },
114
122
  }, pagination: {
115
123
  defaultValue: false,
116
124
  description: 'Display pagination dots',
@@ -1 +1 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/providers/controller.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAiB,iBAAiB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAIxE,eAAO,MAAM,kBAAkB;cAA0C,iBAAiB;gBAAc,kBAAkB;mBAEzH,CAAC;AAEF,eAAO,MAAM,aAAa,iCAAsC,CAAC;AAEjE,wBAAgB,cAAc,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAIvE"}
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/providers/controller.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAiB,iBAAiB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAIxE,eAAO,MAAM,kBAAkB;cAA0C,iBAAiB;gBAAc,kBAAkB;mBAEzH,CAAC;AAEF,eAAO,MAAM,aAAa,iCAAsC,CAAC;AAEjE,wBAAgB,cAAc,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAKvE"}
@@ -23,6 +23,8 @@ exports.ControllerProvider = ControllerProvider;
23
23
  var useController = function () { return (0, hooks_1.useContext)(ControllerContext); };
24
24
  exports.useController = useController;
25
25
  function withController(Component) {
26
- return (function (props) { return ((0, preact_1.h)(ControllerContext.Consumer, null, function (controller) { return (0, preact_1.h)(Component, __assign({}, props, { controller: controller })); })); });
26
+ return (function (props) { return (
27
+ // additional props must come after controller prop
28
+ (0, preact_1.h)(Component, __assign({ controller: (0, exports.useController)() }, props))); });
27
29
  }
28
30
  exports.withController = withController;
@@ -1,9 +1,9 @@
1
- import preact, { ComponentChildren, ComponentType } from 'preact';
1
+ import { h, ComponentChildren, ComponentType } from 'preact';
2
2
  import type { AbstractStore } from '@searchspring/snap-store-mobx';
3
3
  export declare const StoreProvider: ({ children, store }: {
4
4
  children: ComponentChildren;
5
5
  store: AbstractStore;
6
- }) => preact.JSX.Element;
6
+ }) => h.JSX.Element;
7
7
  export declare const useStore: () => AbstractStore | null;
8
8
  export declare function withStore<C extends ComponentType>(Component: C): C;
9
9
  //# sourceMappingURL=store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/providers/store.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAoB,iBAAiB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAInE,eAAO,MAAM,aAAa;cAAqC,iBAAiB;WAAS,aAAa;wBAErG,CAAC;AAEF,eAAO,MAAM,QAAQ,4BAAiC,CAAC;AAEvD,wBAAgB,SAAS,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAElE"}
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/providers/store.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAiB,iBAAiB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAInE,eAAO,MAAM,aAAa;cAAqC,iBAAiB;WAAS,aAAa;mBAErG,CAAC;AAEF,eAAO,MAAM,QAAQ,4BAAiC,CAAC;AAEvD,wBAAgB,SAAS,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAKlE"}
@@ -23,6 +23,8 @@ exports.StoreProvider = StoreProvider;
23
23
  var useStore = function () { return (0, hooks_1.useContext)(StoreContext); };
24
24
  exports.useStore = useStore;
25
25
  function withStore(Component) {
26
- return (function (props) { return (0, preact_1.h)(StoreContext.Consumer, null, function (store) { return (0, preact_1.h)(Component, __assign({}, props, { store: store })); }); });
26
+ return (function (props) { return (
27
+ // additional props must come after store prop
28
+ (0, preact_1.h)(Component, __assign({ store: (0, exports.useStore)() }, props))); });
27
29
  }
28
30
  exports.withStore = withStore;
@@ -51,6 +51,7 @@ export interface CarouselProps extends ComponentProps {
51
51
  onNextButtonClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
52
52
  onPrevButtonClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
53
53
  onInit?: (swiper: SwiperCore) => void;
54
+ modules?: any[];
54
55
  children: JSX.Element[];
55
56
  }
56
57
  //# sourceMappingURL=Carousel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Carousel/Carousel.tsx"],"names":[],"mappings":";AAQA,OAAO,UAAsC,MAAM,aAAa,CAAC;AAMjE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AA8H9E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BtC,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,QAAQ,gBAAyB,aAAa,KAAG,WAAW;;CAiJvE,CAAC;AAEH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACpD,WAAW,CAAC,EAAE,gBAA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AC;IAC/B,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,KAAK,IAAI,CAAC;IAClF,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC3E,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC3E,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;CACxB"}
@@ -192,7 +192,7 @@ export const Carousel = observer((properties) => {
192
192
  theme,
193
193
  };
194
194
  }
195
- const { children, breakpoints, loop, pagination, nextButton, prevButton, hideButtons, vertical, autoAdjustSlides, onInit, onNextButtonClick, onPrevButtonClick, onClick, disableStyles, style, className, ...additionalProps } = props;
195
+ const { children, breakpoints, loop, pagination, nextButton, prevButton, hideButtons, vertical, autoAdjustSlides, onInit, onNextButtonClick, onPrevButtonClick, onClick, disableStyles, style, modules, className, ...additionalProps } = props;
196
196
  const subProps = {
197
197
  icon: {
198
198
  // default props
@@ -207,7 +207,10 @@ export const Carousel = observer((properties) => {
207
207
  theme: props.theme,
208
208
  },
209
209
  };
210
- SwiperCore.use([Pagination, Navigation]);
210
+ const swiperModulesUnfiltered = modules ? [Navigation, Pagination].concat(modules) : [Navigation, Pagination];
211
+ //remove any duplicates, in case user passes in Navigation or Pagination
212
+ const swiperModules = swiperModulesUnfiltered.filter((module, pos) => swiperModulesUnfiltered.indexOf(module) === pos);
213
+ SwiperCore.use(swiperModules);
211
214
  const navigationPrevRef = useRef(null);
212
215
  const navigationNextRef = useRef(null);
213
216
  const rootComponentRef = useRef(null);
@@ -109,6 +109,17 @@ declare const _default: {
109
109
  type: string;
110
110
  };
111
111
  };
112
+ modules: {
113
+ description: string;
114
+ table: {
115
+ type: {
116
+ summary: string;
117
+ };
118
+ defaultValue: {
119
+ summary: string;
120
+ };
121
+ };
122
+ };
112
123
  hideButtons: {
113
124
  defaultValue: boolean;
114
125
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Carousel/Carousel.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAAY,aAAa,EAAE,MAAM,YAAY,CAAC;;;;;;;;;;;yBAmB3C,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAdb,wBAqJE;AAIF,eAAO,MAAM,MAAM;YAAW,aAAa;;;;;;CAQ1C,CAAC;AAOF,eAAO,MAAM,KAAK,UAAW,aAAa,kBAazC,CAAC"}
1
+ {"version":3,"file":"Carousel.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Carousel/Carousel.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAAY,aAAa,EAAE,MAAM,YAAY,CAAC;;;;;;;;;;;yBAmB3C,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAdb,wBA8JE;AAIF,eAAO,MAAM,MAAM;YAAW,aAAa;;;;;;CAQ1C,CAAC;AAOF,eAAO,MAAM,KAAK,UAAW,aAAa,kBAazC,CAAC"}
@@ -55,6 +55,15 @@ export default {
55
55
  },
56
56
  control: { type: 'boolean' },
57
57
  },
58
+ modules: {
59
+ description: 'Additional Swiper modules',
60
+ table: {
61
+ type: {
62
+ summary: 'SwiperModule[]',
63
+ },
64
+ defaultValue: { summary: '[Navigation, Pagination]' },
65
+ },
66
+ },
58
67
  hideButtons: {
59
68
  defaultValue: false,
60
69
  description: 'Hide prev/next buttons',
@@ -122,6 +122,17 @@ declare const _default: {
122
122
  type: string;
123
123
  };
124
124
  };
125
+ modules: {
126
+ description: string;
127
+ table: {
128
+ type: {
129
+ summary: string;
130
+ };
131
+ defaultValue: {
132
+ summary: string;
133
+ };
134
+ };
135
+ };
125
136
  pagination: {
126
137
  defaultValue: boolean;
127
138
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Recommendation.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Organisms/Recommendation/Recommendation.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;;;;yBAkBpE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAdb,wBAmIE;AAIF,eAAO,MAAM,OAAO;YAAW,mBAAmB;;wBAAsD,wBAAwB;;;;;;CAE/H,CAAC"}
1
+ {"version":3,"file":"Recommendation.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Organisms/Recommendation/Recommendation.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;;;;yBAkBpE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAdb,wBA4IE;AAIF,eAAO,MAAM,OAAO;YAAW,mBAAmB;;wBAAsD,wBAAwB;;;;;;CAE/H,CAAC"}
@@ -63,6 +63,15 @@ export default {
63
63
  },
64
64
  control: { type: 'none' },
65
65
  },
66
+ modules: {
67
+ description: 'Additional Swiper modules',
68
+ table: {
69
+ type: {
70
+ summary: 'SwiperModule[]',
71
+ },
72
+ defaultValue: { summary: '[Navigation, Pagination]' },
73
+ },
74
+ },
66
75
  pagination: {
67
76
  defaultValue: false,
68
77
  description: 'Display pagination dots',
@@ -1 +1 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/providers/controller.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAiB,iBAAiB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAIxE,eAAO,MAAM,kBAAkB;cAA0C,iBAAiB;gBAAc,kBAAkB;mBAEzH,CAAC;AAEF,eAAO,MAAM,aAAa,iCAAsC,CAAC;AAEjE,wBAAgB,cAAc,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAIvE"}
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/providers/controller.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAiB,iBAAiB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAIxE,eAAO,MAAM,kBAAkB;cAA0C,iBAAiB;gBAAc,kBAAkB;mBAEzH,CAAC;AAEF,eAAO,MAAM,aAAa,iCAAsC,CAAC;AAEjE,wBAAgB,cAAc,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAKvE"}
@@ -6,5 +6,7 @@ export const ControllerProvider = ({ children, controller }) => {
6
6
  };
7
7
  export const useController = () => useContext(ControllerContext);
8
8
  export function withController(Component) {
9
- return ((props) => (h(ControllerContext.Consumer, null, (controller) => h(Component, { ...props, controller: controller }))));
9
+ return ((props) => (
10
+ // additional props must come after controller prop
11
+ h(Component, { controller: useController(), ...props })));
10
12
  }
@@ -1,9 +1,9 @@
1
- import preact, { ComponentChildren, ComponentType } from 'preact';
1
+ import { h, ComponentChildren, ComponentType } from 'preact';
2
2
  import type { AbstractStore } from '@searchspring/snap-store-mobx';
3
3
  export declare const StoreProvider: ({ children, store }: {
4
4
  children: ComponentChildren;
5
5
  store: AbstractStore;
6
- }) => preact.JSX.Element;
6
+ }) => h.JSX.Element;
7
7
  export declare const useStore: () => AbstractStore | null;
8
8
  export declare function withStore<C extends ComponentType>(Component: C): C;
9
9
  //# sourceMappingURL=store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/providers/store.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAoB,iBAAiB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAInE,eAAO,MAAM,aAAa;cAAqC,iBAAiB;WAAS,aAAa;wBAErG,CAAC;AAEF,eAAO,MAAM,QAAQ,4BAAiC,CAAC;AAEvD,wBAAgB,SAAS,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAElE"}
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/providers/store.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAiB,iBAAiB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAInE,eAAO,MAAM,aAAa;cAAqC,iBAAiB;WAAS,aAAa;mBAErG,CAAC;AAEF,eAAO,MAAM,QAAQ,4BAAiC,CAAC;AAEvD,wBAAgB,SAAS,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAKlE"}
@@ -6,5 +6,7 @@ export const StoreProvider = ({ children, store }) => {
6
6
  };
7
7
  export const useStore = () => useContext(StoreContext);
8
8
  export function withStore(Component) {
9
- return ((props) => h(StoreContext.Consumer, null, (store) => h(Component, { ...props, store: store })));
9
+ return ((props) => (
10
+ // additional props must come after store prop
11
+ h(Component, { store: useStore(), ...props })));
10
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchspring/snap-preact-components",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Snap Preact Component Library",
5
5
  "author": "Searchspring",
6
6
  "license": "MIT",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@emotion/react": "11.9.0",
29
- "@searchspring/snap-toolbox": "^0.30.0",
29
+ "@searchspring/snap-toolbox": "^0.31.0",
30
30
  "classnames": "2.3.1",
31
31
  "deepmerge": "4.2.2",
32
32
  "mobx-react-lite": "3.4.0",
@@ -37,14 +37,14 @@
37
37
  "preact": "10.7.3"
38
38
  },
39
39
  "devDependencies": {
40
- "@searchspring/snap-client": "^0.30.0",
41
- "@searchspring/snap-controller": "^0.30.0",
42
- "@searchspring/snap-event-manager": "^0.30.0",
43
- "@searchspring/snap-logger": "^0.30.0",
44
- "@searchspring/snap-profiler": "^0.30.0",
45
- "@searchspring/snap-store-mobx": "^0.30.0",
46
- "@searchspring/snap-tracker": "^0.30.0",
47
- "@searchspring/snap-url-manager": "^0.30.0",
40
+ "@searchspring/snap-client": "^0.31.0",
41
+ "@searchspring/snap-controller": "^0.31.0",
42
+ "@searchspring/snap-event-manager": "^0.31.0",
43
+ "@searchspring/snap-logger": "^0.31.0",
44
+ "@searchspring/snap-profiler": "^0.31.0",
45
+ "@searchspring/snap-store-mobx": "^0.31.0",
46
+ "@searchspring/snap-tracker": "^0.31.0",
47
+ "@searchspring/snap-url-manager": "^0.31.0",
48
48
  "@storybook/addon-actions": "6.4.22",
49
49
  "@storybook/addon-controls": "6.4.22",
50
50
  "@storybook/addon-docs": "6.4.22",
@@ -65,5 +65,5 @@
65
65
  "react-dom": "16.14.0"
66
66
  },
67
67
  "sideEffects": false,
68
- "gitHead": "48ab43e7ecb42f7b0e1da15b85fe02cc929918f6"
68
+ "gitHead": "b09e1f5eb179f8ef167d264fab4dc5234ac9f83b"
69
69
  }