@pingux/astro 2.117.0 → 2.118.0-alpha.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.
Files changed (58) hide show
  1. package/lib/cjs/components/ComboBoxField/ComboBoxField.js +0 -1
  2. package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +24 -16
  3. package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +74 -32
  4. package/lib/cjs/components/SliderField/Slider.styles.d.ts +138 -0
  5. package/lib/cjs/components/SliderField/Slider.styles.js +163 -0
  6. package/lib/cjs/components/SliderField/SliderActiveTrack.d.ts +4 -0
  7. package/lib/cjs/components/SliderField/SliderActiveTrack.js +49 -0
  8. package/lib/cjs/components/SliderField/SliderField.d.ts +4 -0
  9. package/lib/cjs/components/SliderField/SliderField.js +58 -0
  10. package/lib/cjs/components/SliderField/SliderField.mdx +127 -0
  11. package/lib/cjs/components/SliderField/SliderField.stories.d.ts +11 -0
  12. package/lib/cjs/components/SliderField/SliderField.stories.js +151 -0
  13. package/lib/cjs/components/SliderField/SliderField.test.d.ts +1 -0
  14. package/lib/cjs/components/SliderField/SliderField.test.js +357 -0
  15. package/lib/cjs/components/SliderField/SliderLabelContainer.d.ts +4 -0
  16. package/lib/cjs/components/SliderField/SliderLabelContainer.js +43 -0
  17. package/lib/cjs/components/SliderField/SliderThumb.d.ts +4 -0
  18. package/lib/cjs/components/SliderField/SliderThumb.js +82 -0
  19. package/lib/cjs/components/SliderField/index.d.ts +1 -0
  20. package/lib/cjs/components/SliderField/index.js +14 -0
  21. package/lib/cjs/hooks/index.d.ts +1 -0
  22. package/lib/cjs/hooks/index.js +7 -0
  23. package/lib/cjs/hooks/useSliderField/index.d.ts +1 -0
  24. package/lib/cjs/hooks/useSliderField/index.js +14 -0
  25. package/lib/cjs/hooks/useSliderField/useSliderField.d.ts +4290 -0
  26. package/lib/cjs/hooks/useSliderField/useSliderField.js +230 -0
  27. package/lib/cjs/hooks/useSliderField/useSliderField.test.d.ts +1 -0
  28. package/lib/cjs/hooks/useSliderField/useSliderField.test.js +109 -0
  29. package/lib/cjs/index.d.ts +1 -0
  30. package/lib/cjs/index.js +8 -0
  31. package/lib/cjs/styles/colors.d.ts +6 -0
  32. package/lib/cjs/styles/colors.js +5 -1
  33. package/lib/cjs/styles/variants/variants.js +2 -0
  34. package/lib/cjs/types/sliderField.d.ts +79 -0
  35. package/lib/cjs/types/sliderField.js +6 -0
  36. package/lib/cjs/utils/testUtils/universalFormSubmitTest.js +17 -0
  37. package/lib/components/ComboBoxField/ComboBoxField.js +0 -1
  38. package/lib/components/ComboBoxField/ComboBoxField.stories.js +24 -16
  39. package/lib/components/ComboBoxField/ComboBoxField.test.js +74 -32
  40. package/lib/components/SliderField/Slider.styles.js +155 -0
  41. package/lib/components/SliderField/SliderActiveTrack.js +37 -0
  42. package/lib/components/SliderField/SliderField.js +46 -0
  43. package/lib/components/SliderField/SliderField.mdx +127 -0
  44. package/lib/components/SliderField/SliderField.stories.js +131 -0
  45. package/lib/components/SliderField/SliderField.test.js +354 -0
  46. package/lib/components/SliderField/SliderLabelContainer.js +29 -0
  47. package/lib/components/SliderField/SliderThumb.js +68 -0
  48. package/lib/components/SliderField/index.js +1 -0
  49. package/lib/hooks/index.js +1 -0
  50. package/lib/hooks/useSliderField/index.js +1 -0
  51. package/lib/hooks/useSliderField/useSliderField.js +220 -0
  52. package/lib/hooks/useSliderField/useSliderField.test.js +102 -0
  53. package/lib/index.js +1 -0
  54. package/lib/styles/colors.js +5 -1
  55. package/lib/styles/variants/variants.js +2 -0
  56. package/lib/types/sliderField.js +1 -0
  57. package/lib/utils/testUtils/universalFormSubmitTest.js +17 -0
  58. package/package.json +3 -1
@@ -193,7 +193,6 @@ var ComboBoxField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
193
193
  hasNoArrow: true,
194
194
  isNonModal: true,
195
195
  isOpen: state.isOpen,
196
- onClose: state.close,
197
196
  placement: placement,
198
197
  ref: popoverRef,
199
198
  style: style
@@ -107,31 +107,40 @@ var withSection = [{
107
107
  name: 'Animals',
108
108
  key: 'Animals',
109
109
  children: [{
110
- name: 'Raccoon'
110
+ name: 'Raccoon',
111
+ key: 'raccoon'
111
112
  }, {
112
- name: 'Kangaroo'
113
+ name: 'Kangaroo',
114
+ key: 'kangaroo'
113
115
  }, {
114
- name: 'Opossum'
116
+ name: 'Opossum',
117
+ key: 'opossum'
115
118
  }]
116
119
  }, {
117
120
  name: 'People',
118
121
  key: 'People',
119
122
  children: [{
120
- name: 'Michael'
123
+ name: 'Michael',
124
+ key: 'michael'
121
125
  }, {
122
- name: 'Dwight'
126
+ name: 'Dwight',
127
+ key: 'dwight'
123
128
  }, {
124
- name: 'Creed'
129
+ name: 'Creed',
130
+ key: 'creed'
125
131
  }]
126
132
  }, {
127
- name: null,
133
+ name: 'Fruits',
128
134
  key: 'fruit',
129
135
  children: [{
130
- name: 'Apple'
136
+ name: 'Apple',
137
+ key: 'apple'
131
138
  }, {
132
- name: 'Orange'
139
+ name: 'Orange',
140
+ key: 'orange'
133
141
  }, {
134
- name: 'Banana'
142
+ name: 'Banana',
143
+ key: 'banana'
135
144
  }]
136
145
  }];
137
146
  var actions = {
@@ -221,17 +230,17 @@ var Default = function Default(args) {
221
230
  };
222
231
  exports.Default = Default;
223
232
  var WithSections = function WithSections(args) {
224
- return (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.ComboBoxField, (0, _extends2["default"])({
233
+ return (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.ComboBoxField, (0, _extends2["default"])({}, args, {
225
234
  label: "Example label",
226
- items: withSection
227
- }, args), function (section) {
235
+ defaultItems: withSection
236
+ }), function (section) {
228
237
  return (0, _react2.jsx)(_index.Section, {
229
238
  key: section.key,
230
239
  items: section.children,
231
240
  title: section.name
232
241
  }, function (item) {
233
242
  return (0, _react2.jsx)(_index.Item, {
234
- key: item.name
243
+ key: item.key
235
244
  }, item.name);
236
245
  });
237
246
  }));
@@ -448,8 +457,7 @@ var WithCustomInputValue = function WithCustomInputValue() {
448
457
  hasCustomValue: true
449
458
  }, function (item) {
450
459
  return (0, _react2.jsx)(_index.Item, {
451
- key: item.id,
452
- textValue: item.id
460
+ key: item.id
453
461
  }, item.name);
454
462
  }));
455
463
  };
@@ -23,6 +23,7 @@ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
23
23
  var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
24
24
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
25
25
  var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
26
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
26
27
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
27
28
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
28
29
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
@@ -42,8 +43,8 @@ var _react3 = require("@emotion/react");
42
43
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
43
44
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
44
45
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
45
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty2(_context8 = ownKeys(Object(source), !0)).call(_context8, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty2(_context9 = ownKeys(Object(source))).call(_context9, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
46
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context6; _forEachInstanceProperty2(_context6 = ["next", "throw", "return"]).call(_context6, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty2(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context7; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty2(_context7 = this.tryEntries).call(_context7, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
46
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context10, _context11; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty2(_context10 = ownKeys(Object(source), !0)).call(_context10, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty2(_context11 = ownKeys(Object(source))).call(_context11, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
47
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context8; _forEachInstanceProperty2(_context8 = ["next", "throw", "return"]).call(_context8, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty2(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context9; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty2(_context9 = this.tryEntries).call(_context9, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
47
48
  var items = [{
48
49
  name: 'Aardvark',
49
50
  id: '1'
@@ -333,6 +334,47 @@ test('should be able to open and navigate through the listbox by click', functio
333
334
  _userEvent["default"].click(button);
334
335
  expect(options[0]).toHaveClass('is-focused');
335
336
  });
337
+ test('should be able to hover list item and filter on input box', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
338
+ var button, input, options;
339
+ return _regeneratorRuntime().wrap(function _callee$(_context3) {
340
+ while (1) switch (_context3.prev = _context3.next) {
341
+ case 0:
342
+ getComponentWithSections({
343
+ defaultFilter: function defaultFilter(option, inputValue) {
344
+ var _context2;
345
+ return (0, _includes["default"])(_context2 = option.name.toLowerCase()).call(_context2, inputValue.toLowerCase());
346
+ }
347
+ });
348
+ button = _testWrapper.screen.queryByRole('button');
349
+ input = _testWrapper.screen.queryByRole('combobox');
350
+ expect(_testWrapper.screen.queryByRole('combobox')).toHaveValue('');
351
+ expect(_testWrapper.screen.queryByRole('listbox')).not.toBeInTheDocument();
352
+
353
+ // Open the list by clicking on the button and ensure first option is not active
354
+ _userEvent["default"].click(button);
355
+ options = _testWrapper.screen.queryAllByRole('option');
356
+ expect(_testWrapper.screen.queryByRole('listbox')).toBeInTheDocument();
357
+ // Both dismiss buttons should be available, but the dropdown button should be inaccessible
358
+ expect(_testWrapper.screen.queryAllByRole('button')).toHaveLength(2);
359
+ expect(options).toHaveLength(9);
360
+ expect(input).not.toHaveAttribute('aria-activedescendant', options[0].id);
361
+ (0, _forEach["default"])(options).call(options, function (opt) {
362
+ return expect(opt).not.toHaveClass('is-focused');
363
+ });
364
+
365
+ // Ensure active styles are applied
366
+ _userEvent["default"].hover(options[0]);
367
+ expect(input).toHaveAttribute('aria-activedescendant', options[0].id);
368
+ expect(options[0]).toHaveClass('is-focused');
369
+ _userEvent["default"].type(input, 'k');
370
+ expect(_testWrapper.screen.queryByRole('listbox')).toBeInTheDocument();
371
+ expect(input).toHaveValue('k');
372
+ case 18:
373
+ case "end":
374
+ return _context3.stop();
375
+ }
376
+ }, _callee);
377
+ })));
336
378
  test('should be able to open the listbox by keyboard', function () {
337
379
  getComponent();
338
380
  var input = _testWrapper.screen.getByRole('combobox');
@@ -521,37 +563,37 @@ test('should use default contains filtering', function () {
521
563
  _userEvent["default"].type(input, 'z');
522
564
  expect(_testWrapper.screen.queryByRole('option')).not.toBeInTheDocument();
523
565
  });
524
- test('should be able to use controlled filtering', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
566
+ test('should be able to use controlled filtering', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
525
567
  var options, input;
526
- return _regeneratorRuntime().wrap(function _callee$(_context2) {
527
- while (1) switch (_context2.prev = _context2.next) {
568
+ return _regeneratorRuntime().wrap(function _callee2$(_context4) {
569
+ while (1) switch (_context4.prev = _context4.next) {
528
570
  case 0:
529
571
  (0, _testWrapper.render)((0, _react3.jsx)(ComboBoxWithCustomFilter, null));
530
572
  input = _testWrapper.screen.queryByRole('combobox'); // Should list all without filterable input
531
573
  _userEvent["default"].type(input, '{arrowdown}');
532
- _context2.next = 5;
574
+ _context4.next = 5;
533
575
  return _testWrapper.screen.findAllByRole('option');
534
576
  case 5:
535
- options = _context2.sent;
577
+ options = _context4.sent;
536
578
  expect(options).toHaveLength(items.length);
537
579
 
538
580
  // Should only list the second option
539
581
  _userEvent["default"].type(input, 'k');
540
- _context2.next = 10;
582
+ _context4.next = 10;
541
583
  return _testWrapper.screen.findAllByRole('option');
542
584
  case 10:
543
- options = _context2.sent;
585
+ options = _context4.sent;
544
586
  expect(options[0]).toHaveTextContent(items[1].name);
545
587
  case 12:
546
588
  case "end":
547
- return _context2.stop();
589
+ return _context4.stop();
548
590
  }
549
- }, _callee);
591
+ }, _callee2);
550
592
  })));
551
- test('should be able to use custom default filtering', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
593
+ test('should be able to use custom default filtering', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
552
594
  var options, defaultFilter, input;
553
- return _regeneratorRuntime().wrap(function _callee2$(_context3) {
554
- while (1) switch (_context3.prev = _context3.next) {
595
+ return _regeneratorRuntime().wrap(function _callee3$(_context5) {
596
+ while (1) switch (_context5.prev = _context5.next) {
555
597
  case 0:
556
598
  defaultFilter = function defaultFilter(option, inputValue) {
557
599
  return (0, _startsWith["default"])(option).call(option, inputValue);
@@ -561,29 +603,29 @@ test('should be able to use custom default filtering', /*#__PURE__*/(0, _asyncTo
561
603
  });
562
604
  input = _testWrapper.screen.queryByRole('combobox'); // Should list all without filterable input
563
605
  _userEvent["default"].type(input, '{arrowdown}');
564
- _context3.next = 6;
606
+ _context5.next = 6;
565
607
  return _testWrapper.screen.findAllByRole('option');
566
608
  case 6:
567
- options = _context3.sent;
609
+ options = _context5.sent;
568
610
  expect(options).toHaveLength(items.length);
569
611
 
570
612
  // Should only list the second option
571
613
  _userEvent["default"].type(input, 'K');
572
- _context3.next = 11;
614
+ _context5.next = 11;
573
615
  return _testWrapper.screen.findAllByRole('option');
574
616
  case 11:
575
- options = _context3.sent;
617
+ options = _context5.sent;
576
618
  expect(options[0]).toHaveTextContent(items[1].name);
577
619
  case 13:
578
620
  case "end":
579
- return _context3.stop();
621
+ return _context5.stop();
580
622
  }
581
- }, _callee2);
623
+ }, _callee3);
582
624
  })));
583
- test('should show in input "textValue" if provided', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
625
+ test('should show in input "textValue" if provided', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
584
626
  var newItems, input, options;
585
- return _regeneratorRuntime().wrap(function _callee3$(_context4) {
586
- while (1) switch (_context4.prev = _context4.next) {
627
+ return _regeneratorRuntime().wrap(function _callee4$(_context6) {
628
+ while (1) switch (_context6.prev = _context6.next) {
587
629
  case 0:
588
630
  newItems = (0, _map["default"])(items).call(items, function (item) {
589
631
  return _objectSpread(_objectSpread({}, item), {}, {
@@ -595,10 +637,10 @@ test('should show in input "textValue" if provided', /*#__PURE__*/(0, _asyncToGe
595
637
  });
596
638
  input = _testWrapper.screen.queryByRole('combobox');
597
639
  _userEvent["default"].click(input);
598
- _context4.next = 6;
640
+ _context6.next = 6;
599
641
  return _testWrapper.screen.findAllByRole('option');
600
642
  case 6:
601
- options = _context4.sent;
643
+ options = _context6.sent;
602
644
  _userEvent["default"].click(options[0]);
603
645
  expect(input).toHaveValue(newItems[0].textValue);
604
646
 
@@ -607,14 +649,14 @@ test('should show in input "textValue" if provided', /*#__PURE__*/(0, _asyncToGe
607
649
  expect(input).toHaveValue(newItems[0].textValue);
608
650
  case 11:
609
651
  case "end":
610
- return _context4.stop();
652
+ return _context6.stop();
611
653
  }
612
- }, _callee3);
654
+ }, _callee4);
613
655
  })));
614
- test('option list should be opened on scroll input value', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
656
+ test('option list should be opened on scroll input value', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
615
657
  var options, otherItems, input;
616
- return _regeneratorRuntime().wrap(function _callee4$(_context5) {
617
- while (1) switch (_context5.prev = _context5.next) {
658
+ return _regeneratorRuntime().wrap(function _callee5$(_context7) {
659
+ while (1) switch (_context7.prev = _context7.next) {
618
660
  case 0:
619
661
  otherItems = [{
620
662
  name: 'Short item name one',
@@ -654,9 +696,9 @@ test('option list should be opened on scroll input value', /*#__PURE__*/(0, _asy
654
696
  expect(options.length).toBe(0);
655
697
  case 14:
656
698
  case "end":
657
- return _context5.stop();
699
+ return _context7.stop();
658
700
  }
659
- }, _callee4);
701
+ }, _callee5);
660
702
  })));
661
703
  describe('loadingState', function () {
662
704
  it('combobox should not render a loader if menu is not open', function () {
@@ -0,0 +1,138 @@
1
+ declare const _default: {
2
+ test: {
3
+ bg: string;
4
+ };
5
+ slider: {
6
+ display: string;
7
+ '&.is-horizontal': {
8
+ flexDirection: string;
9
+ };
10
+ };
11
+ activeTrack: {
12
+ bg: string;
13
+ position: string;
14
+ '&.is-horizontal': {
15
+ borderRadius: string;
16
+ height: string;
17
+ '&.is-single-track': {
18
+ left: string;
19
+ };
20
+ };
21
+ '&.is-vertical': {
22
+ borderRadius: string;
23
+ width: string;
24
+ bottom: string;
25
+ };
26
+ };
27
+ thumb: {
28
+ width: string;
29
+ height: string;
30
+ borderRadius: string;
31
+ bg: string;
32
+ cursor: string;
33
+ '&.is-focused': {
34
+ outline: string;
35
+ outlineColor: string;
36
+ outlineOffset: string;
37
+ };
38
+ '&.is-horizontal': {
39
+ top: string;
40
+ };
41
+ '&.is-vertical': {
42
+ left: string;
43
+ };
44
+ '&.is-hovered': {
45
+ backgroundColor: string;
46
+ };
47
+ '&.is-pressed': {
48
+ backgroundColor: string;
49
+ };
50
+ };
51
+ track: {
52
+ backgroundColor: string;
53
+ cursor: string;
54
+ mb: string;
55
+ position: string;
56
+ '&.is-disabled': {
57
+ opacity: number;
58
+ };
59
+ '&.is-horizontal': {
60
+ height: string;
61
+ borderRadius: string;
62
+ width: string;
63
+ };
64
+ '&:before': {
65
+ content: string;
66
+ display: string;
67
+ position: string;
68
+ height: string;
69
+ width: string;
70
+ top: string;
71
+ transform: string;
72
+ };
73
+ '&.is-vertical': {
74
+ width: string;
75
+ borderRadius: string;
76
+ height: string;
77
+ '&:before': {
78
+ content: string;
79
+ display: string;
80
+ position: string;
81
+ width: string;
82
+ height: string;
83
+ left: string;
84
+ transform: string;
85
+ };
86
+ };
87
+ };
88
+ hiddenTrack: {
89
+ cursor: string;
90
+ '&.is-horizontal': {
91
+ height: string;
92
+ borderRadius: string;
93
+ width: string;
94
+ ml: string;
95
+ mr: string;
96
+ };
97
+ '&.is-vertical': {
98
+ width: string;
99
+ borderRadius: string;
100
+ height: string;
101
+ mt: string;
102
+ mb: string;
103
+ };
104
+ };
105
+ trackWrapper: {
106
+ '&.is-vertical': {
107
+ py: string;
108
+ };
109
+ '&.is-horizontal': {
110
+ px: string;
111
+ };
112
+ };
113
+ labelContainer: {
114
+ '&.is-horizontal': {
115
+ mb: string;
116
+ };
117
+ '&.is-vertical': {
118
+ mt: string;
119
+ gap: string;
120
+ };
121
+ };
122
+ outputContainer: {
123
+ '&.is-horizontal': {
124
+ marginLeft: string;
125
+ mt: string;
126
+ };
127
+ };
128
+ wrapper: {
129
+ '&.is-horizontal': {
130
+ width: string;
131
+ };
132
+ '&.is-vertical': {
133
+ height: string;
134
+ ml: string;
135
+ };
136
+ };
137
+ };
138
+ export default _default;
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+
3
+ var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
5
+ var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
6
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
7
+ var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
8
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
9
+ var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
10
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
11
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
12
+ _Object$defineProperty(exports, "__esModule", {
13
+ value: true
14
+ });
15
+ exports["default"] = void 0;
16
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
17
+ var _Buttons = require("../Button/Buttons.styles");
18
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
20
+ var test = {
21
+ bg: 'active'
22
+ };
23
+ var slider = {
24
+ display: 'flex',
25
+ '&.is-horizontal': {
26
+ flexDirection: 'column'
27
+ }
28
+ };
29
+ var track = {
30
+ backgroundColor: 'slider.track',
31
+ cursor: 'pointer',
32
+ mb: 'sm',
33
+ position: 'relative',
34
+ '&.is-disabled': {
35
+ opacity: 0.4
36
+ },
37
+ '&.is-horizontal': {
38
+ height: '10px',
39
+ borderRadius: '11px',
40
+ width: '100%'
41
+ },
42
+ '&:before': {
43
+ content: 'attr(x)',
44
+ display: 'block',
45
+ position: 'absolute',
46
+ height: '3px',
47
+ width: '100%',
48
+ top: '50%',
49
+ transform: 'translateY(-50%)'
50
+ },
51
+ '&.is-vertical': {
52
+ width: '10px',
53
+ borderRadius: '11px',
54
+ height: '100%',
55
+ '&:before': {
56
+ content: 'attr(x)',
57
+ display: 'block',
58
+ position: 'absolute',
59
+ width: '3px',
60
+ height: '100%',
61
+ left: '50%',
62
+ transform: 'translateX(-50%)'
63
+ }
64
+ }
65
+ };
66
+ var hiddenTrack = {
67
+ cursor: 'pointer',
68
+ '&.is-horizontal': {
69
+ height: '10px',
70
+ borderRadius: '11px',
71
+ width: 'calc(100% - 9px)',
72
+ ml: '4.5px',
73
+ mr: '4.5px'
74
+ },
75
+ '&.is-vertical': {
76
+ width: '10px',
77
+ borderRadius: '11px',
78
+ height: 'calc(100% - 9px)',
79
+ mt: '4.5px',
80
+ mb: '4.5px'
81
+ }
82
+ };
83
+ var thumb = {
84
+ width: '21px',
85
+ height: '21px',
86
+ borderRadius: '50%',
87
+ bg: 'active',
88
+ cursor: 'pointer',
89
+ '&.is-focused': _objectSpread({}, _Buttons.defaultFocus),
90
+ '&.is-horizontal': {
91
+ top: '50%'
92
+ },
93
+ '&.is-vertical': {
94
+ left: '50%'
95
+ },
96
+ '&.is-hovered': {
97
+ backgroundColor: 'accent.40'
98
+ },
99
+ '&.is-pressed': {
100
+ backgroundColor: 'accent.20'
101
+ }
102
+ };
103
+ var activeTrack = {
104
+ bg: 'active',
105
+ position: 'absolute',
106
+ '&.is-horizontal': {
107
+ borderRadius: '11px 0px 0px 11px',
108
+ height: '100%',
109
+ '&.is-single-track': {
110
+ left: '0%'
111
+ }
112
+ },
113
+ '&.is-vertical': {
114
+ borderRadius: '11px 11px 11px 11px',
115
+ width: '100%',
116
+ bottom: '0%'
117
+ }
118
+ };
119
+ var trackWrapper = {
120
+ '&.is-vertical': {
121
+ py: '9px'
122
+ },
123
+ '&.is-horizontal': {
124
+ px: '9px'
125
+ }
126
+ };
127
+ var labelContainer = {
128
+ '&.is-horizontal': {
129
+ mb: 'xs'
130
+ },
131
+ '&.is-vertical': {
132
+ mt: 'xs',
133
+ gap: 'xs'
134
+ }
135
+ };
136
+ var wrapper = {
137
+ '&.is-horizontal': {
138
+ width: '100%'
139
+ },
140
+ '&.is-vertical': {
141
+ height: '100%',
142
+ ml: 'xs'
143
+ }
144
+ };
145
+ var outputContainer = {
146
+ '&.is-horizontal': {
147
+ marginLeft: 'auto',
148
+ mt: '-3px'
149
+ }
150
+ };
151
+ var _default = {
152
+ test: test,
153
+ slider: slider,
154
+ activeTrack: activeTrack,
155
+ thumb: thumb,
156
+ track: track,
157
+ hiddenTrack: hiddenTrack,
158
+ trackWrapper: trackWrapper,
159
+ labelContainer: labelContainer,
160
+ outputContainer: outputContainer,
161
+ wrapper: wrapper
162
+ };
163
+ exports["default"] = _default;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SliderActiveTrackProps } from '../../types/sliderField';
3
+ declare const SliderActiveTrack: React.ForwardRefExoticComponent<SliderActiveTrackProps & React.RefAttributes<HTMLDivElement>>;
4
+ export default SliderActiveTrack;