@mmb-digital/ds-lilly 0.10.13 → 0.10.15

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.
@@ -0,0 +1,400 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("react"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["react"], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["${FILENAME}"] = factory(require("react"));
8
+ else
9
+ root["${FILENAME}"] = factory(root["React"]);
10
+ })(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {
11
+ return /******/ (function(modules) { // webpackBootstrap
12
+ /******/ // The module cache
13
+ /******/ var installedModules = {};
14
+ /******/
15
+ /******/ // The require function
16
+ /******/ function __webpack_require__(moduleId) {
17
+ /******/
18
+ /******/ // Check if module is in cache
19
+ /******/ if(installedModules[moduleId]) {
20
+ /******/ return installedModules[moduleId].exports;
21
+ /******/ }
22
+ /******/ // Create a new module (and put it into the cache)
23
+ /******/ var module = installedModules[moduleId] = {
24
+ /******/ i: moduleId,
25
+ /******/ l: false,
26
+ /******/ exports: {}
27
+ /******/ };
28
+ /******/
29
+ /******/ // Execute the module function
30
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
+ /******/
32
+ /******/ // Flag the module as loaded
33
+ /******/ module.l = true;
34
+ /******/
35
+ /******/ // Return the exports of the module
36
+ /******/ return module.exports;
37
+ /******/ }
38
+ /******/
39
+ /******/
40
+ /******/ // expose the modules object (__webpack_modules__)
41
+ /******/ __webpack_require__.m = modules;
42
+ /******/
43
+ /******/ // expose the module cache
44
+ /******/ __webpack_require__.c = installedModules;
45
+ /******/
46
+ /******/ // define getter function for harmony exports
47
+ /******/ __webpack_require__.d = function(exports, name, getter) {
48
+ /******/ if(!__webpack_require__.o(exports, name)) {
49
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50
+ /******/ }
51
+ /******/ };
52
+ /******/
53
+ /******/ // define __esModule on exports
54
+ /******/ __webpack_require__.r = function(exports) {
55
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
+ /******/ }
58
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
+ /******/ };
60
+ /******/
61
+ /******/ // create a fake namespace object
62
+ /******/ // mode & 1: value is a module id, require it
63
+ /******/ // mode & 2: merge all properties of value into the ns
64
+ /******/ // mode & 4: return value when already ns object
65
+ /******/ // mode & 8|1: behave like require
66
+ /******/ __webpack_require__.t = function(value, mode) {
67
+ /******/ if(mode & 1) value = __webpack_require__(value);
68
+ /******/ if(mode & 8) return value;
69
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
+ /******/ var ns = Object.create(null);
71
+ /******/ __webpack_require__.r(ns);
72
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
+ /******/ return ns;
75
+ /******/ };
76
+ /******/
77
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
78
+ /******/ __webpack_require__.n = function(module) {
79
+ /******/ var getter = module && module.__esModule ?
80
+ /******/ function getDefault() { return module['default']; } :
81
+ /******/ function getModuleExports() { return module; };
82
+ /******/ __webpack_require__.d(getter, 'a', getter);
83
+ /******/ return getter;
84
+ /******/ };
85
+ /******/
86
+ /******/ // Object.prototype.hasOwnProperty.call
87
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88
+ /******/
89
+ /******/ // __webpack_public_path__
90
+ /******/ __webpack_require__.p = "";
91
+ /******/
92
+ /******/
93
+ /******/ // Load entry module and return exports
94
+ /******/ return __webpack_require__(__webpack_require__.s = 529);
95
+ /******/ })
96
+ /************************************************************************/
97
+ /******/ ({
98
+
99
+ /***/ 0:
100
+ /***/ (function(module, exports) {
101
+
102
+ module.exports = __WEBPACK_EXTERNAL_MODULE__0__;
103
+
104
+ /***/ }),
105
+
106
+ /***/ 15:
107
+ /***/ (function(module, exports, __webpack_require__) {
108
+
109
+ // extracted by mini-css-extract-plugin
110
+
111
+ /***/ }),
112
+
113
+ /***/ 3:
114
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
115
+
116
+ "use strict";
117
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cx; });
118
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
119
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
120
+ /* harmony import */ var _scss_styles_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
121
+ /* harmony import */ var _scss_styles_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_scss_styles_scss__WEBPACK_IMPORTED_MODULE_1__);
122
+
123
+
124
+ var cx = classnames__WEBPACK_IMPORTED_MODULE_0___default.a.bind(_scss_styles_scss__WEBPACK_IMPORTED_MODULE_1___default.a);
125
+
126
+
127
+ /***/ }),
128
+
129
+ /***/ 378:
130
+ /***/ (function(module, exports, __webpack_require__) {
131
+
132
+ /**
133
+ * cuid.js
134
+ * Collision-resistant UID generator for browsers and node.
135
+ * Sequential for fast db lookups and recency sorting.
136
+ * Safe for element IDs and server-side lookups.
137
+ *
138
+ * Extracted from CLCTR
139
+ *
140
+ * Copyright (c) Eric Elliott 2012
141
+ * MIT License
142
+ */
143
+
144
+ var fingerprint = __webpack_require__(444);
145
+ var pad = __webpack_require__(404);
146
+ var getRandomValue = __webpack_require__(445);
147
+
148
+ var c = 0,
149
+ blockSize = 4,
150
+ base = 36,
151
+ discreteValues = Math.pow(base, blockSize);
152
+
153
+ function randomBlock () {
154
+ return pad((getRandomValue() *
155
+ discreteValues << 0)
156
+ .toString(base), blockSize);
157
+ }
158
+
159
+ function safeCounter () {
160
+ c = c < discreteValues ? c : 0;
161
+ c++; // this is not subliminal
162
+ return c - 1;
163
+ }
164
+
165
+ function cuid () {
166
+ // Starting with a lowercase letter makes
167
+ // it HTML element ID friendly.
168
+ var letter = 'c', // hard-coded allows for sequential access
169
+
170
+ // timestamp
171
+ // warning: this exposes the exact date and time
172
+ // that the uid was created.
173
+ timestamp = (new Date().getTime()).toString(base),
174
+
175
+ // Prevent same-machine collisions.
176
+ counter = pad(safeCounter().toString(base), blockSize),
177
+
178
+ // A few chars to generate distinct ids for different
179
+ // clients (so different computers are far less
180
+ // likely to generate the same id)
181
+ print = fingerprint(),
182
+
183
+ // Grab some more chars from Math.random()
184
+ random = randomBlock() + randomBlock();
185
+
186
+ return letter + timestamp + counter + print + random;
187
+ }
188
+
189
+ cuid.slug = function slug () {
190
+ var date = new Date().getTime().toString(36),
191
+ counter = safeCounter().toString(36).slice(-4),
192
+ print = fingerprint().slice(0, 1) +
193
+ fingerprint().slice(-1),
194
+ random = randomBlock().slice(-2);
195
+
196
+ return date.slice(-2) +
197
+ counter + print + random;
198
+ };
199
+
200
+ cuid.isCuid = function isCuid (stringToCheck) {
201
+ if (typeof stringToCheck !== 'string') return false;
202
+ if (stringToCheck.startsWith('c')) return true;
203
+ return false;
204
+ };
205
+
206
+ cuid.isSlug = function isSlug (stringToCheck) {
207
+ if (typeof stringToCheck !== 'string') return false;
208
+ var stringLength = stringToCheck.length;
209
+ if (stringLength >= 7 && stringLength <= 10) return true;
210
+ return false;
211
+ };
212
+
213
+ cuid.fingerprint = fingerprint;
214
+
215
+ module.exports = cuid;
216
+
217
+
218
+ /***/ }),
219
+
220
+ /***/ 404:
221
+ /***/ (function(module, exports) {
222
+
223
+ module.exports = function pad (num, size) {
224
+ var s = '000000000' + num;
225
+ return s.substr(s.length - size);
226
+ };
227
+
228
+
229
+ /***/ }),
230
+
231
+ /***/ 444:
232
+ /***/ (function(module, exports, __webpack_require__) {
233
+
234
+ var pad = __webpack_require__(404);
235
+
236
+ var env = typeof window === 'object' ? window : self;
237
+ var globalCount = Object.keys(env).length;
238
+ var mimeTypesLength = navigator.mimeTypes ? navigator.mimeTypes.length : 0;
239
+ var clientId = pad((mimeTypesLength +
240
+ navigator.userAgent.length).toString(36) +
241
+ globalCount.toString(36), 4);
242
+
243
+ module.exports = function fingerprint () {
244
+ return clientId;
245
+ };
246
+
247
+
248
+ /***/ }),
249
+
250
+ /***/ 445:
251
+ /***/ (function(module, exports) {
252
+
253
+
254
+ var getRandomValue;
255
+
256
+ var crypto = typeof window !== 'undefined' &&
257
+ (window.crypto || window.msCrypto) ||
258
+ typeof self !== 'undefined' &&
259
+ self.crypto;
260
+
261
+ if (crypto) {
262
+ var lim = Math.pow(2, 32) - 1;
263
+ getRandomValue = function () {
264
+ return Math.abs(crypto.getRandomValues(new Uint32Array(1))[0] / lim);
265
+ };
266
+ } else {
267
+ getRandomValue = Math.random;
268
+ }
269
+
270
+ module.exports = getRandomValue;
271
+
272
+
273
+ /***/ }),
274
+
275
+ /***/ 529:
276
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
277
+
278
+ "use strict";
279
+ // ESM COMPAT FLAG
280
+ __webpack_require__.r(__webpack_exports__);
281
+
282
+ // EXPORTS
283
+ __webpack_require__.d(__webpack_exports__, "Pills", function() { return /* reexport */ Pills_Pills; });
284
+
285
+ // EXTERNAL MODULE: ./node_modules/cuid/index.js
286
+ var cuid = __webpack_require__(378);
287
+ var cuid_default = /*#__PURE__*/__webpack_require__.n(cuid);
288
+
289
+ // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react","umd":"react"}
290
+ var external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_ = __webpack_require__(0);
291
+ var external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_);
292
+
293
+ // EXTERNAL MODULE: ./src/utils/classBinder.ts
294
+ var classBinder = __webpack_require__(3);
295
+
296
+ // CONCATENATED MODULE: ./src/components/Components/Pills/Pills.tsx
297
+
298
+
299
+
300
+ var Pills = function (_a) {
301
+ var ariaLabel = _a.ariaLabel, _b = _a.initialPill, initialPill = _b === void 0 ? '' : _b, onChange = _a.onChange, pills = _a.pills, _c = _a.testId, testId = _c === void 0 ? 'Pills' : _c, theme = _a.theme;
302
+ var _d = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(''), activePill = _d[0], setActivePill = _d[1];
303
+ var updateActivePill = function (pill) {
304
+ if (onChange)
305
+ onChange(pill);
306
+ setActivePill(pill);
307
+ };
308
+ var handleOnClick = function (pill, isDisabled) { return function (event) {
309
+ if (isDisabled) {
310
+ event.preventDefault();
311
+ }
312
+ updateActivePill(pill);
313
+ }; };
314
+ Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useEffect"])(function () {
315
+ setActivePill(initialPill);
316
+ }, [initialPill]);
317
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("ul", { "aria-label": ariaLabel, className: Object(classBinder["a" /* cx */])('c-pills__list', theme), "data-testid": testId }, pills.map(function (_a) {
318
+ var _b;
319
+ var _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, label = _a.label, value = _a.value;
320
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("li", { key: "pills-" + cuid_default()() + "-" + value, className: Object(classBinder["a" /* cx */])('c-pills__listItem', (_b = {},
321
+ _b["c-pills__listItem--disabled"] = isDisabled,
322
+ _b["c-pills__listItem--selected"] = activePill === value,
323
+ _b)) },
324
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("button", { className: Object(classBinder["a" /* cx */])('c-pills__listButton'), disabled: isDisabled, onClick: handleOnClick(value, isDisabled) }, label)));
325
+ })));
326
+ };
327
+ /* harmony default export */ var Pills_Pills = (Pills);
328
+
329
+ // CONCATENATED MODULE: ./src/components/Components/Pills/index.ts
330
+
331
+
332
+
333
+ /***/ }),
334
+
335
+ /***/ 7:
336
+ /***/ (function(module, exports, __webpack_require__) {
337
+
338
+ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
339
+ Copyright (c) 2018 Jed Watson.
340
+ Licensed under the MIT License (MIT), see
341
+ http://jedwatson.github.io/classnames
342
+ */
343
+ /* global define */
344
+
345
+ (function () {
346
+ 'use strict';
347
+
348
+ var hasOwn = {}.hasOwnProperty;
349
+
350
+ function classNames() {
351
+ var classes = [];
352
+
353
+ for (var i = 0; i < arguments.length; i++) {
354
+ var arg = arguments[i];
355
+ if (!arg) continue;
356
+
357
+ var argType = typeof arg;
358
+
359
+ if (argType === 'string' || argType === 'number') {
360
+ classes.push(arg);
361
+ } else if (Array.isArray(arg)) {
362
+ if (arg.length) {
363
+ var inner = classNames.apply(null, arg);
364
+ if (inner) {
365
+ classes.push(inner);
366
+ }
367
+ }
368
+ } else if (argType === 'object') {
369
+ if (arg.toString === Object.prototype.toString) {
370
+ for (var key in arg) {
371
+ if (hasOwn.call(arg, key) && arg[key]) {
372
+ classes.push(key);
373
+ }
374
+ }
375
+ } else {
376
+ classes.push(arg.toString());
377
+ }
378
+ }
379
+ }
380
+
381
+ return classes.join(' ');
382
+ }
383
+
384
+ if ( true && module.exports) {
385
+ classNames.default = classNames;
386
+ module.exports = classNames;
387
+ } else if (true) {
388
+ // register as 'classnames', consistent with npm package name
389
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
390
+ return classNames;
391
+ }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
392
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
393
+ } else {}
394
+ }());
395
+
396
+
397
+ /***/ })
398
+
399
+ /******/ });
400
+ });