@aquera/nile-elements 1.8.1 → 1.8.2

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 (36) hide show
  1. package/README.md +3 -0
  2. package/dist/index.js +323 -174
  3. package/dist/nile-slider/nile-slider.cjs.js +1 -1
  4. package/dist/nile-slider/nile-slider.cjs.js.map +1 -1
  5. package/dist/nile-slider/nile-slider.css.cjs.js +1 -1
  6. package/dist/nile-slider/nile-slider.css.cjs.js.map +1 -1
  7. package/dist/nile-slider/nile-slider.css.esm.js +162 -41
  8. package/dist/nile-slider/nile-slider.esm.js +5 -3
  9. package/dist/nile-slider/nile-slider.template.cjs.js +1 -1
  10. package/dist/nile-slider/nile-slider.template.cjs.js.map +1 -1
  11. package/dist/nile-slider/nile-slider.template.esm.js +49 -23
  12. package/dist/nile-slider/utils/nile-slider.utils.cjs.js +1 -1
  13. package/dist/nile-slider/utils/nile-slider.utils.cjs.js.map +1 -1
  14. package/dist/nile-slider/utils/nile-slider.utils.esm.js +1 -1
  15. package/dist/src/nile-slider/nile-slider.css.js +160 -39
  16. package/dist/src/nile-slider/nile-slider.css.js.map +1 -1
  17. package/dist/src/nile-slider/nile-slider.d.ts +5 -1
  18. package/dist/src/nile-slider/nile-slider.js +23 -1
  19. package/dist/src/nile-slider/nile-slider.js.map +1 -1
  20. package/dist/src/nile-slider/nile-slider.template.d.ts +2 -0
  21. package/dist/src/nile-slider/nile-slider.template.js +38 -1
  22. package/dist/src/nile-slider/nile-slider.template.js.map +1 -1
  23. package/dist/src/nile-slider/types/nile-slider.types.d.ts +1 -0
  24. package/dist/src/nile-slider/types/nile-slider.types.js.map +1 -1
  25. package/dist/src/nile-slider/utils/nile-slider.utils.js +4 -0
  26. package/dist/src/nile-slider/utils/nile-slider.utils.js.map +1 -1
  27. package/dist/src/version.js +1 -1
  28. package/dist/src/version.js.map +1 -1
  29. package/dist/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +1 -1
  31. package/src/nile-slider/nile-slider.css.ts +160 -39
  32. package/src/nile-slider/nile-slider.template.ts +45 -2
  33. package/src/nile-slider/nile-slider.ts +11 -3
  34. package/src/nile-slider/types/nile-slider.types.ts +2 -0
  35. package/src/nile-slider/utils/nile-slider.utils.ts +2 -0
  36. package/vscode-html-custom-data.json +38 -9
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","./nile-slider.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/class-map.js","lit","lit/decorators.js","./nile-slider.template.cjs.js","./utils/nile-slider.utils.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,s,i,e,h,a,l,n,r,o,c,p,d,m,u,v,b,y,_templateObject,_templateObject2,g;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_nileSliderCssCjsJs){s=_nileSliderCssCjsJs.s;},function(_internalNileElementCjsJs){i=_internalNileElementCjsJs.N;},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;},function(_lit){h=_lit.html;},function(_litDecoratorsJs){a=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_nileSliderTemplateCjsJs){n=_nileSliderTemplateCjsJs.l;r=_nileSliderTemplateCjsJs.r;o=_nileSliderTemplateCjsJs.s;},function(_utilsNileSliderUtilsCjsJs){c=_utilsNileSliderUtilsCjsJs.h;p=_utilsNileSliderUtilsCjsJs.a;d=_utilsNileSliderUtilsCjsJs.b;m=_utilsNileSliderUtilsCjsJs.v;u=_utilsNileSliderUtilsCjsJs.r;v=_utilsNileSliderUtilsCjsJs.c;b=_utilsNileSliderUtilsCjsJs.d;y=_utilsNileSliderUtilsCjsJs.g;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",g=/*#__PURE__*/function(_i){function g(){var _this;_classCallCheck(this,g);_this=_callSuper(this,g,arguments),_this.minValue=0,_this.value=_this.minValue,_this.maxValue=100,_this.rangeOneValue=_this.minValue,_this.rangeTwoValue=_this.maxValue,_this.showLabel=!1,_this.labelStart="",_this.labelEnd="",_this.rangeSlider=!1,_this.labelPosition="top",_this.tooltipPosition="top",_this.activeThumb=null,_this.onMouseMove=function(t){var s=_this.range.getBoundingClientRect();if(_this.rangeSlider){"one"===_this.activeThumb?p(t,s,_assertThisInitialized(_this)):"two"===_this.activeThumb&&d(t,s,_assertThisInitialized(_this));var _i2=m(_this.rangeOneValue,_assertThisInitialized(_this)),_e=m(_this.rangeTwoValue,_assertThisInitialized(_this)),_h=Math.min(_i2,_e),_a=Math.abs(_e-_i2);_this.rangeTwoValue>=_this.rangeOneValue&&(_this.completed.style.left="".concat(_h,"%"),_this.completed.style.width="".concat(_a,"%"));}else c(t,s,_assertThisInitialized(_this));},_this.onMouseUp=function(){_this.rangeSlider?(_this.emit("nile-button-first-change-end",{value:_this.rangeOneValue}),_this.emit("nile-button-last-change-end",{value:_this.rangeTwoValue})):_this.emit("nile-change-end",{value:_this.value}),_this.activeThumb=null,u(_assertThisInitialized(_this));},_this.onMouseDown=function(t){var s=_this.range.getBoundingClientRect(),i=(t.clientX-s.left)/s.width*100,e=_this.minValue+i/100*(_this.maxValue-_this.minValue);if(_this.rangeSlider){b(e,_assertThisInitialized(_this));var _t=Math.abs(e-_this.rangeOneValue),_s=Math.abs(e-_this.rangeTwoValue);_this.activeThumb=_t<=_s?"one":"two",v(_assertThisInitialized(_this));}else c(t,s,_assertThisInitialized(_this)),_this.activeThumb="one",v(_assertThisInitialized(_this));};return _this;}_inherits(g,_i);return _createClass(g,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(g,"connectedCallback",this,3)([]),this.emit("nile-init"),this.rangeSlider&&this.checkRangeValidity();}},{key:"firstUpdated",value:function firstUpdated(t){if(y(this),!this.rangeSlider&&t.has("value")){this.value=this.checkValueValidity(this.value,this.minValue,this.maxValue);var _t2=m(this.value,this);this.buttonOne.style.left="".concat(_t2,"%"),this.completed.style.width="".concat(_t2,"%");}else if(this.rangeSlider){var _t3=m(this.rangeOneValue,this),_s2=m(this.rangeTwoValue,this);this.buttonOne&&(this.buttonOne.style.left="".concat(_t3,"%")),this.buttonTwo&&(this.buttonTwo.style.left="".concat(_s2,"%"));var _i3=Math.min(_t3,_s2),_e2=Math.abs(_s2-_t3);this.completed.style.left="".concat(_i3,"%"),this.completed.style.width="".concat(_e2,"%");}}},{key:"checkValueValidity",value:function checkValueValidity(t,s,i){return i-s<=1?Math.max(s,Math.min(t,i)):Math.floor(Math.max(s,Math.min(t,i)));}},{key:"checkRangeValidity",value:function checkRangeValidity(){this.rangeTwoValue>this.maxValue?this.rangeTwoValue=this.maxValue:this.rangeTwoValue<this.rangeOneValue&&(this.rangeTwoValue=this.rangeOneValue),this.rangeOneValue<this.minValue?this.rangeOneValue=this.minValue:this.rangeOneValue>this.rangeTwoValue&&(this.rangeOneValue=this.rangeTwoValue);}},{key:"render",value:function render(){var t=this.showLabel,s=t?"label-start label-end":void 0;return h(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"base\"\n class=","\n >\n <slot class=\"span\" name=\"prefix\"></slot>\n \n <div\n part=\"range-container\"\n class=","\n >\n ","\n \n <div\n class=\"range\"\n part=\"range\"\n role=\"group\"\n aria-labelledby=","\n >\n <span class=\"range-completed\" part=\"range-completed\"></span>\n ","\n </div>\n </div>\n \n <slot class=\"span\" name=\"suffix\"></slot>\n </div>\n "])),e({container:!0,"align-item-center":!t}),e({"range-container":!0,"column-reverse":"bottom"===this.labelPosition}),t?n(this):h(_templateObject2||(_templateObject2=_taggedTemplateLiteral([""]))),s,this.rangeSlider?r(this):o(this));}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(g,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}}],[{key:"styles",get:function get(){return[s];}}]);}(i));t([a({type:Number})],g.prototype,"minValue",void 0),t([a({type:Number})],g.prototype,"value",void 0),t([a({type:Number})],g.prototype,"maxValue",void 0),t([a({type:Number})],g.prototype,"rangeOneValue",void 0),t([a({type:Number})],g.prototype,"rangeTwoValue",void 0),t([a({type:Boolean})],g.prototype,"showLabel",void 0),t([a({type:String})],g.prototype,"labelStart",void 0),t([a({type:String})],g.prototype,"labelEnd",void 0),t([a({type:Boolean})],g.prototype,"rangeSlider",void 0),t([a({type:String})],g.prototype,"labelPosition",void 0),t([a({type:String})],g.prototype,"tooltipPosition",void 0),_export("N",g=t([l("nile-slider")],g));}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","./nile-slider.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/class-map.js","lit","lit/decorators.js","./nile-slider.template.cjs.js","./utils/nile-slider.utils.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,s,i,e,h,a,l,r,n,o,c,p,d,m,u,v,b,y,f,g,_templateObject,_templateObject2,_templateObject3,_templateObject4,j;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_nileSliderCssCjsJs){s=_nileSliderCssCjsJs.s;},function(_internalNileElementCjsJs){i=_internalNileElementCjsJs.N;},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;},function(_lit){h=_lit.html;},function(_litDecoratorsJs){a=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_nileSliderTemplateCjsJs){r=_nileSliderTemplateCjsJs.f;n=_nileSliderTemplateCjsJs.l;o=_nileSliderTemplateCjsJs.r;c=_nileSliderTemplateCjsJs.s;p=_nileSliderTemplateCjsJs.b;},function(_utilsNileSliderUtilsCjsJs){d=_utilsNileSliderUtilsCjsJs.h;m=_utilsNileSliderUtilsCjsJs.a;u=_utilsNileSliderUtilsCjsJs.b;v=_utilsNileSliderUtilsCjsJs.v;b=_utilsNileSliderUtilsCjsJs.r;y=_utilsNileSliderUtilsCjsJs.c;f=_utilsNileSliderUtilsCjsJs.d;g=_utilsNileSliderUtilsCjsJs.g;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",j=/*#__PURE__*/function(_i){function j(){var _this;_classCallCheck(this,j);_this=_callSuper(this,j,arguments),_this.minValue=0,_this.value=_this.minValue,_this.maxValue=100,_this.rangeOneValue=_this.minValue,_this.rangeTwoValue=_this.maxValue,_this.showLabel=!1,_this.labelStart="",_this.labelEnd="",_this.rangeSlider=!1,_this.labelPosition="top",_this.tooltipPosition="top",_this.label="",_this.disabled=!1,_this.error=!1,_this.valueLabel="tooltip",_this.activeThumb=null,_this.onMouseMove=function(t){if(_this.disabled)return;var s=_this.range.getBoundingClientRect();if(_this.rangeSlider){"one"===_this.activeThumb?m(t,s,_assertThisInitialized(_this)):"two"===_this.activeThumb&&u(t,s,_assertThisInitialized(_this));var _i2=v(_this.rangeOneValue,_assertThisInitialized(_this)),_e=v(_this.rangeTwoValue,_assertThisInitialized(_this)),_h=Math.min(_i2,_e),_a=Math.abs(_e-_i2);_this.rangeTwoValue>=_this.rangeOneValue&&(_this.completed.style.left="".concat(_h,"%"),_this.completed.style.width="".concat(_a,"%"));}else d(t,s,_assertThisInitialized(_this));},_this.onMouseUp=function(){_this.rangeSlider?(_this.emit("nile-button-first-change-end",{value:_this.rangeOneValue}),_this.emit("nile-button-last-change-end",{value:_this.rangeTwoValue})):_this.emit("nile-change-end",{value:_this.value}),_this.activeThumb=null,b(_assertThisInitialized(_this));},_this.onMouseDown=function(t){if(_this.disabled)return;var s=_this.range.getBoundingClientRect(),i=(t.clientX-s.left)/s.width*100,e=_this.minValue+i/100*(_this.maxValue-_this.minValue);if(_this.rangeSlider){f(e,_assertThisInitialized(_this));var _t=Math.abs(e-_this.rangeOneValue),_s=Math.abs(e-_this.rangeTwoValue);_this.activeThumb=_t<=_s?"one":"two",y(_assertThisInitialized(_this));}else d(t,s,_assertThisInitialized(_this)),_this.activeThumb="one",y(_assertThisInitialized(_this));};return _this;}_inherits(j,_i);return _createClass(j,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(j,"connectedCallback",this,3)([]),this.emit("nile-init"),this.rangeSlider&&this.checkRangeValidity();}},{key:"firstUpdated",value:function firstUpdated(t){if(g(this),!this.rangeSlider&&t.has("value")){this.value=this.checkValueValidity(this.value,this.minValue,this.maxValue);var _t2=v(this.value,this);this.buttonOne.style.left="".concat(_t2,"%"),this.completed.style.width="".concat(_t2,"%");}else if(this.rangeSlider){var _t3=v(this.rangeOneValue,this),_s2=v(this.rangeTwoValue,this);this.buttonOne&&(this.buttonOne.style.left="".concat(_t3,"%")),this.buttonTwo&&(this.buttonTwo.style.left="".concat(_s2,"%"));var _i3=Math.min(_t3,_s2),_e2=Math.abs(_s2-_t3);this.completed.style.left="".concat(_i3,"%"),this.completed.style.width="".concat(_e2,"%");}}},{key:"checkValueValidity",value:function checkValueValidity(t,s,i){return i-s<=1?Math.max(s,Math.min(t,i)):Math.floor(Math.max(s,Math.min(t,i)));}},{key:"checkRangeValidity",value:function checkRangeValidity(){this.rangeTwoValue>this.maxValue?this.rangeTwoValue=this.maxValue:this.rangeTwoValue<this.rangeOneValue&&(this.rangeTwoValue=this.rangeOneValue),this.rangeOneValue<this.minValue?this.rangeOneValue=this.minValue:this.rangeOneValue>this.rangeTwoValue&&(this.rangeOneValue=this.rangeTwoValue);}},{key:"render",value:function render(){var t=this.showLabel,s=t?"label-start label-end":void 0;return h(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n ","\n <div\n part=\"base\"\n class=","\n >\n <slot class=\"span\" name=\"prefix\"></slot>\n \n <div\n part=\"range-container\"\n class=","\n >\n ","\n \n <div\n class=\"range\"\n part=\"range\"\n role=\"group\"\n aria-labelledby=","\n >\n <span class=\"range-completed\" part=\"range-completed\"></span>\n ","\n ","\n </div>\n </div>\n \n <slot class=\"span\" name=\"suffix\"></slot>\n </div>\n "])),this.label?r(this):h(_templateObject2||(_templateObject2=_taggedTemplateLiteral([""]))),e({container:!0,"align-item-center":!t}),e({"range-container":!0,"column-reverse":"bottom"===this.labelPosition}),t?n(this):h(_templateObject3||(_templateObject3=_taggedTemplateLiteral([""]))),s,this.rangeSlider?o(this):c(this),"bottom"===this.valueLabel?p(this):h(_templateObject4||(_templateObject4=_taggedTemplateLiteral([""]))));}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(j,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}}],[{key:"styles",get:function get(){return[s];}}]);}(i));t([a({type:Number})],j.prototype,"minValue",void 0),t([a({type:Number})],j.prototype,"value",void 0),t([a({type:Number})],j.prototype,"maxValue",void 0),t([a({type:Number})],j.prototype,"rangeOneValue",void 0),t([a({type:Number})],j.prototype,"rangeTwoValue",void 0),t([a({type:Boolean})],j.prototype,"showLabel",void 0),t([a({type:String})],j.prototype,"labelStart",void 0),t([a({type:String})],j.prototype,"labelEnd",void 0),t([a({type:Boolean})],j.prototype,"rangeSlider",void 0),t([a({type:String})],j.prototype,"labelPosition",void 0),t([a({type:String})],j.prototype,"tooltipPosition",void 0),t([a({type:String})],j.prototype,"label",void 0),t([a({type:Boolean,reflect:!0})],j.prototype,"disabled",void 0),t([a({type:Boolean,reflect:!0})],j.prototype,"error",void 0),t([a({type:String,reflect:!0})],j.prototype,"valueLabel",void 0),_export("N",j=t([l("nile-slider")],j));}};});
2
2
  //# sourceMappingURL=nile-slider.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-slider.cjs.js","sources":["../../../src/nile-slider/nile-slider.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { styles } from './nile-slider.css';\nimport NileElement from '../internal/nile-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TooltipPosition } from './types/nile-slider.types';\nimport { NileSliderEvents } from './types/nile-slider.enums';\nimport { rangeSlider, singleSlider, lableContaier } from './nile-slider.template';\nimport { \n handleSingleSlider, \n handleRangeOne, \n handleRangeTwo, \n getHtmlElements, \n removeMoveListeners,\n valueToPercent,\n handleTwoThumbClick,\n addMoveListeners\n} from './utils/nile-slider.utils'\n\n/** \n * Nile slider component.\n *\n * @tag nile-slider\n */\n@customElement('nile-slider')\nexport class NileSlider extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Number }) minValue: number = 0;\n @property({ type: Number }) value: number = this.minValue;\n @property({ type: Number }) maxValue: number = 100;\n @property({ type: Number }) rangeOneValue: number = this.minValue;\n @property({ type: Number }) rangeTwoValue: number = this.maxValue;\n @property({ type: Boolean}) showLabel: boolean = false;\n @property({ type: String }) labelStart: string = \"\";\n @property({ type: String }) labelEnd: string = \"\";\n @property({ type: Boolean}) rangeSlider: boolean = false;\n @property({ type: String }) labelPosition: string = \"top\";\n @property({ type: String }) tooltipPosition: TooltipPosition = \"top\";\n\n public buttonOne!: HTMLElement;\n public buttonTwo!: HTMLElement;\n public range!: HTMLElement;\n public completed!: HTMLElement;\n public activeThumb: 'one' | 'two' | null = null;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.emit(NileSliderEvents.NILE_INIT); \n\n if(this.rangeSlider) {\n this.checkRangeValidity();\n }\n }\n\n firstUpdated(changedProps: Map<string, any>): void {\n getHtmlElements(this);\n\n if (!this.rangeSlider && changedProps.has('value')) {\n this.value = this.checkValueValidity(this.value, this.minValue, this.maxValue);\n const percent = valueToPercent(this.value, this);\n \n this.buttonOne.style.left = `${percent}%`;\n this.completed.style.width = `${percent}%`;\n } else if (this.rangeSlider) {\n \n const percentOne = valueToPercent(this.rangeOneValue, this);\n const percentTwo = valueToPercent(this.rangeTwoValue, this);\n \n if (this.buttonOne) this.buttonOne.style.left = `${percentOne}%`;\n if (this.buttonTwo) this.buttonTwo.style.left = `${percentTwo}%`;\n \n const left = Math.min(percentOne, percentTwo);\n const width = Math.abs(percentTwo - percentOne);\n \n this.completed.style.left = `${left}%`;\n this.completed.style.width = `${width}%`;\n }\n }\n\n checkValueValidity(value: number, min: number, max: number): number {\n if(max - min <= 1) { \n return Math.max(min, Math.min(value, max));\n }\n return Math.floor(Math.max(min, Math.min(value, max)));\n }\n\n checkRangeValidity(): void {\n if(this.rangeTwoValue > this.maxValue) {\n this.rangeTwoValue = this.maxValue;\n } else if(this.rangeTwoValue < this.rangeOneValue) {\n this.rangeTwoValue = this.rangeOneValue;\n }\n\n if(this.rangeOneValue < this.minValue) {\n this.rangeOneValue = this.minValue;\n } else if(this.rangeOneValue > this.rangeTwoValue) {\n this.rangeOneValue = this.rangeTwoValue;\n }\n } \n\n public onMouseMove = (e: MouseEvent): void => {\n const rect = this.range.getBoundingClientRect();\n\n if (!this.rangeSlider) {\n handleSingleSlider(e, rect, this);\n } else {\n if (this.activeThumb === 'one') {\n handleRangeOne(e, rect, this);\n } else if (this.activeThumb === 'two') {\n handleRangeTwo(e, rect, this);\n }\n\n const start = valueToPercent(this.rangeOneValue, this);\n const end = valueToPercent(this.rangeTwoValue, this);\n const left = Math.min(start, end);\n const width = Math.abs(end - start);\n\n if(this.rangeTwoValue >= this.rangeOneValue) {\n this.completed.style.left = `${left}%`;\n this.completed.style.width = `${width}%`;\n }\n }\n };\n\n public onMouseUp = (): void => {\n if(!this.rangeSlider) this.emit(NileSliderEvents.NILE_CHANGE_END, { value: this.value });\n else {\n this.emit(NileSliderEvents.NILE_BUTTON_FIRST_CHANGE_END, { value: this.rangeOneValue });\n this.emit(NileSliderEvents.NILE_BUTTON_LAST_CHANGE_END, { value: this.rangeTwoValue });\n }\n this.activeThumb = null;\n removeMoveListeners(this);\n };\n\n public onMouseDown = (e: MouseEvent): void => {\n const rect = this.range.getBoundingClientRect();\n const clickX = e.clientX - rect.left;\n const percent = (clickX / rect.width) * 100;\n const value = this.minValue + (percent / 100) * (this.maxValue - this.minValue);\n \n if (!this.rangeSlider) {\n handleSingleSlider(e, rect, this);\n this.activeThumb = 'one';\n addMoveListeners(this);\n } else {\n handleTwoThumbClick(value, this);\n const distToOne = Math.abs(value - this.rangeOneValue);\n const distToTwo = Math.abs(value - this.rangeTwoValue);\n this.activeThumb = distToOne <= distToTwo ? 'one' : 'two';\n addMoveListeners(this);\n }\n };\n\n public render(): TemplateResult {\n const hasLabels = this.showLabel;\n const ariaLabelledby = hasLabels ? 'label-start label-end' : undefined;\n \n return html`\n <div\n part=\"base\"\n class=${classMap({\n 'container': true,\n 'align-item-center': !hasLabels\n })}\n >\n <slot class=\"span\" name=\"prefix\"></slot>\n \n <div\n part=\"range-container\"\n class=${classMap({\n 'range-container': true,\n 'column-reverse': this.labelPosition === 'bottom'\n })}\n >\n ${hasLabels ? lableContaier(this) : html``}\n \n <div\n class=\"range\"\n part=\"range\"\n role=\"group\"\n aria-labelledby=${ariaLabelledby}\n >\n <span class=\"range-completed\" part=\"range-completed\"></span>\n ${this.rangeSlider ? rangeSlider(this) : singleSlider(this)}\n </div>\n </div>\n \n <slot class=\"span\" name=\"suffix\"></slot>\n </div>\n `;\n } \n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.emit(NileSliderEvents.NILE_DESTROY);\n }\n}\n\nexport default NileSlider;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-slider': NileSlider;\n }\n}\n"],"names":["NileSlider","_i","g","constructor","this","minValue","value","maxValue","rangeOneValue","rangeTwoValue","showLabel","labelStart","labelEnd","rangeSlider","labelPosition","tooltipPosition","activeThumb","onMouseMove","e","rect","range","getBoundingClientRect","handleRangeOne","handleRangeTwo","start","valueToPercent","end","left","Math","min","width","abs","completed","style","concat","handleSingleSlider","onMouseUp","emit","removeMoveListeners","onMouseDown","percent","clientX","handleTwoThumbClick","distToOne","distToTwo","addMoveListeners","_this","_inherits","_createClass","key","connectedCallback","super","checkRangeValidity","firstUpdated","changedProps","getHtmlElements","has","checkValueValidity","buttonOne","percentOne","percentTwo","buttonTwo","max","floor","render","hasLabels","ariaLabelledby","undefined","html","_templateObject","_taggedTemplateLiteral","classMap","container","lableContaier","_templateObject2","singleSlider","disconnectedCallback","__decorate","get","styles","NileElement","property","type","Number","prototype","Boolean","String","customElement"],"mappings":"yiJAgCaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAKuBC,KAAAA,CAAQC,QAAAA,CAAW,EACnBD,KAAAA,CAAAE,KAAAA,CAAgBF,KAAAA,CAAKC,QAAAA,CACrBD,KAAAA,CAAQG,QAAAA,CAAW,IACnBH,KAAAA,CAAAI,aAAAA,CAAwBJ,KAAAA,CAAKC,QAAAA,CAC7BD,KAAAA,CAAAK,aAAAA,CAAwBL,KAAAA,CAAKG,QAC7BH,CAAAA,KAAAA,CAASM,WAAY,CACrBN,CAAAA,KAAAA,CAAUO,WAAW,EACrBP,CAAAA,KAAAA,CAAQQ,QAAW,CAAA,EAAA,CACnBR,KAAAA,CAAWS,WAAAA,CAAAA,CAAY,EACvBT,KAAAA,CAAaU,aAAAA,CAAW,KACxBV,CAAAA,KAAAA,CAAeW,eAAoB,CAAA,KAAA,CAMxDX,KAAAA,CAAWY,WAAyB,CAAA,IAAA,CAyDpCZ,KAAAA,CAAAa,WAAAA,CAAeC,SAAAA,CACpB,CAAA,CAAA,GAAMC,CAAAA,EAAOf,KAAAA,CAAKgB,KAAAA,CAAMC,wBAExB,GAAKjB,KAAAA,CAAKS,YAEH,CACoB,KAAA,GAArBT,KAAAA,CAAKY,WAAAA,CACPM,CAAeJ,CAAAA,CAAAA,CAAGC,+BACY,CAAA,CAAA,KAAA,GAArBf,KAAAA,CAAKY,WAAAA,EACdO,CAAeL,CAAAA,CAAAA,CAAGC,+BAGpB,CAAA,CAAA,GAAMK,CAAAA,GAAQC,CAAAA,CAAAA,CAAerB,KAAAA,CAAKI,aAAAA,CAAAA,sBAAAA,CAAAA,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AA,CAAU6E,CAAA,CAAA,CADtBU,CAAc,CAAA,aAAA,CAAA,CAAA,CACFvF"}
1
+ {"version":3,"file":"nile-slider.cjs.js","sources":["../../../src/nile-slider/nile-slider.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { styles } from './nile-slider.css';\nimport NileElement from '../internal/nile-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TooltipPosition, ValueLabelMode } from './types/nile-slider.types';\nimport { NileSliderEvents } from './types/nile-slider.enums';\nimport { rangeSlider, singleSlider, lableContaier, fieldHeader, bottomValueLabels } from './nile-slider.template';\nimport { \n handleSingleSlider, \n handleRangeOne, \n handleRangeTwo, \n getHtmlElements, \n removeMoveListeners,\n valueToPercent,\n handleTwoThumbClick,\n addMoveListeners\n} from './utils/nile-slider.utils'\n\n/** \n * Nile slider component.\n *\n * @tag nile-slider\n */\n@customElement('nile-slider')\nexport class NileSlider extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Number }) minValue: number = 0;\n @property({ type: Number }) value: number = this.minValue;\n @property({ type: Number }) maxValue: number = 100;\n @property({ type: Number }) rangeOneValue: number = this.minValue;\n @property({ type: Number }) rangeTwoValue: number = this.maxValue;\n @property({ type: Boolean}) showLabel: boolean = false;\n @property({ type: String }) labelStart: string = \"\";\n @property({ type: String }) labelEnd: string = \"\";\n @property({ type: Boolean}) rangeSlider: boolean = false;\n @property({ type: String }) labelPosition: string = \"top\";\n @property({ type: String }) tooltipPosition: TooltipPosition = \"top\";\n @property({ type: String }) label = \"\";\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: Boolean, reflect: true }) error = false;\n @property({ type: String, reflect: true }) valueLabel: ValueLabelMode = 'tooltip';\n\n public buttonOne!: HTMLElement;\n public buttonTwo!: HTMLElement;\n public range!: HTMLElement;\n public completed!: HTMLElement;\n public activeThumb: 'one' | 'two' | null = null;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.emit(NileSliderEvents.NILE_INIT); \n\n if(this.rangeSlider) {\n this.checkRangeValidity();\n }\n }\n\n firstUpdated(changedProps: Map<string, any>): void {\n getHtmlElements(this);\n\n if (!this.rangeSlider && changedProps.has('value')) {\n this.value = this.checkValueValidity(this.value, this.minValue, this.maxValue);\n const percent = valueToPercent(this.value, this);\n \n this.buttonOne.style.left = `${percent}%`;\n this.completed.style.width = `${percent}%`;\n } else if (this.rangeSlider) {\n \n const percentOne = valueToPercent(this.rangeOneValue, this);\n const percentTwo = valueToPercent(this.rangeTwoValue, this);\n \n if (this.buttonOne) this.buttonOne.style.left = `${percentOne}%`;\n if (this.buttonTwo) this.buttonTwo.style.left = `${percentTwo}%`;\n \n const left = Math.min(percentOne, percentTwo);\n const width = Math.abs(percentTwo - percentOne);\n \n this.completed.style.left = `${left}%`;\n this.completed.style.width = `${width}%`;\n }\n }\n\n checkValueValidity(value: number, min: number, max: number): number {\n if(max - min <= 1) {\n return Math.max(min, Math.min(value, max));\n }\n return Math.floor(Math.max(min, Math.min(value, max)));\n }\n\n checkRangeValidity(): void {\n if(this.rangeTwoValue > this.maxValue) {\n this.rangeTwoValue = this.maxValue;\n } else if(this.rangeTwoValue < this.rangeOneValue) {\n this.rangeTwoValue = this.rangeOneValue;\n }\n\n if(this.rangeOneValue < this.minValue) {\n this.rangeOneValue = this.minValue;\n } else if(this.rangeOneValue > this.rangeTwoValue) {\n this.rangeOneValue = this.rangeTwoValue;\n }\n } \n\n public onMouseMove = (e: MouseEvent): void => {\n if (this.disabled) return;\n const rect = this.range.getBoundingClientRect();\n\n if (!this.rangeSlider) {\n handleSingleSlider(e, rect, this);\n } else {\n if (this.activeThumb === 'one') {\n handleRangeOne(e, rect, this);\n } else if (this.activeThumb === 'two') {\n handleRangeTwo(e, rect, this);\n }\n\n const start = valueToPercent(this.rangeOneValue, this);\n const end = valueToPercent(this.rangeTwoValue, this);\n const left = Math.min(start, end);\n const width = Math.abs(end - start);\n\n if(this.rangeTwoValue >= this.rangeOneValue) {\n this.completed.style.left = `${left}%`;\n this.completed.style.width = `${width}%`;\n }\n }\n };\n\n public onMouseUp = (): void => {\n if(!this.rangeSlider) this.emit(NileSliderEvents.NILE_CHANGE_END, { value: this.value });\n else {\n this.emit(NileSliderEvents.NILE_BUTTON_FIRST_CHANGE_END, { value: this.rangeOneValue });\n this.emit(NileSliderEvents.NILE_BUTTON_LAST_CHANGE_END, { value: this.rangeTwoValue });\n }\n this.activeThumb = null;\n removeMoveListeners(this);\n };\n\n public onMouseDown = (e: MouseEvent): void => {\n if (this.disabled) return;\n const rect = this.range.getBoundingClientRect();\n const clickX = e.clientX - rect.left;\n const percent = (clickX / rect.width) * 100;\n const value = this.minValue + (percent / 100) * (this.maxValue - this.minValue);\n \n if (!this.rangeSlider) {\n handleSingleSlider(e, rect, this);\n this.activeThumb = 'one';\n addMoveListeners(this);\n } else {\n handleTwoThumbClick(value, this);\n const distToOne = Math.abs(value - this.rangeOneValue);\n const distToTwo = Math.abs(value - this.rangeTwoValue);\n this.activeThumb = distToOne <= distToTwo ? 'one' : 'two';\n addMoveListeners(this);\n }\n };\n\n public render(): TemplateResult {\n const hasLabels = this.showLabel;\n const ariaLabelledby = hasLabels ? 'label-start label-end' : undefined;\n \n return html`\n ${this.label ? fieldHeader(this) : html``}\n <div\n part=\"base\"\n class=${classMap({\n 'container': true,\n 'align-item-center': !hasLabels\n })}\n >\n <slot class=\"span\" name=\"prefix\"></slot>\n \n <div\n part=\"range-container\"\n class=${classMap({\n 'range-container': true,\n 'column-reverse': this.labelPosition === 'bottom'\n })}\n >\n ${hasLabels ? lableContaier(this) : html``}\n \n <div\n class=\"range\"\n part=\"range\"\n role=\"group\"\n aria-labelledby=${ariaLabelledby}\n >\n <span class=\"range-completed\" part=\"range-completed\"></span>\n ${this.rangeSlider ? rangeSlider(this) : singleSlider(this)}\n ${this.valueLabel === 'bottom' ? bottomValueLabels(this) : html``}\n </div>\n </div>\n \n <slot class=\"span\" name=\"suffix\"></slot>\n </div>\n `;\n } \n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.emit(NileSliderEvents.NILE_DESTROY);\n }\n}\n\nexport default NileSlider;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-slider': NileSlider;\n }\n}\n"],"names":["NileSlider","_i","j","constructor","this","minValue","value","maxValue","rangeOneValue","rangeTwoValue","showLabel","labelStart","labelEnd","rangeSlider","labelPosition","tooltipPosition","label","disabled","error","valueLabel","activeThumb","onMouseMove","e","rect","range","getBoundingClientRect","handleRangeOne","handleRangeTwo","start","valueToPercent","end","left","Math","min","width","abs","completed","style","concat","handleSingleSlider","onMouseUp","emit","removeMoveListeners","onMouseDown","percent","clientX","handleTwoThumbClick","distToOne","distToTwo","addMoveListeners","_this","_inherits","_createClass","key","connectedCallback","super","checkRangeValidity","firstUpdated","changedProps","getHtmlElements","has","checkValueValidity","buttonOne","percentOne","percentTwo","buttonTwo","max","floor","render","hasLabels","ariaLabelledby","undefined","html","_templateObject","_taggedTemplateLiteral","fieldHeader","_templateObject2","classMap","container","lableContaier","_templateObject3","singleSlider","bottomValueLabels","_templateObject4","disconnectedCallback","get","styles","NileElement","__decorate","property","type","Number","prototype","Boolean","String","reflect","customElement"],"mappings":"yoJAgCaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAKuBC,KAAAA,CAAQC,QAAAA,CAAW,EACnBD,KAAAA,CAAAE,KAAAA,CAAgBF,KAAAA,CAAKC,QAAAA,CACrBD,KAAAA,CAAQG,QAAAA,CAAW,IACnBH,KAAAA,CAAAI,aAAAA,CAAwBJ,KAAAA,CAAKC,QAAAA,CAC7BD,KAAAA,CAAAK,aAAAA,CAAwBL,KAAAA,CAAKG,QAC7BH,CAAAA,KAAAA,C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,CAAA,OAAA,CAAA,IAAA,EACIJ,CAAAA,CAAAA,CAAAA,CAAA,CAA3CC,CAAS,CAAA,CAAEC,KAAMG,OAASE,CAAAA,OAAAA,CAAAA,CAAS,KAA0B/F,CAAA4F,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAClBJ,EAAA,CAA3CC,CAAAA,CAAS,CAAEC,IAAMG,CAAAA,OAAAA,CAASE,SAAS,CAAsB/F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4F,SAAA,CAAA,OAAA,CAAA,IAAA,IACfJ,CAAA,CAAA,CAA1CC,EAAS,CAAEC,IAAAA,CAAMI,OAAQC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+C/F,CAAA4F,CAAAA,SAAAA,CAAA,iBAAA,EAnBvE5F,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAUwF,EAAA,CADtBQ,CAAAA,CAAc,gBACFhG"}
@@ -1,2 +1,2 @@
1
- System.register(["lit"],function(_export,_context){"use strict";var r,_templateObject,a;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){r=_lit.css;}],execute:function execute(){_export("s",a=r(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: block;\n }\n\n .container {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 10px;\n height: 100px;\n }\n\n .align-item-center {\n align-items: center;\n }\n\n slot.span {\n font-size: var(--nile-font-size-micro);\n margin-top: 14px;\n }\n\n .range-container {\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-sm);\n }\n\n .column-reverse {\n flex-direction: column-reverse;\n }\n\n .label-container {\n display: flex;\n justify-content: space-between;\n }\n\n .label-container span {\n margin: var(--nile-spacing-none);\n padding: var(--nile-spacing-none);\n font-size: var(--nile-font-size-micro);\n }\n\n .range {\n position: relative;\n width: 228px;\n height: 4px;\n background-color: var(--nile-colors-neutral-400);\n user-select: none;\n border-radius: var(--nile-radius-radius-3xl);\n }\n\n .range:hover {\n cursor: pointer;\n }\n\n .range-completed {\n position: absolute;\n height: 100%;\n width: 0%;\n background-color: var(--nile-colors-primary-600);\n top: 0px;\n left: 0px;\n z-index: 98;\n border-radius: var(--nile-radius-radius-3xl);\n }\n\n .range-button {\n height: 12px;\n width: 12px;\n background-color: var(--nile-colors-primary-600);\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n border-radius: var(--nile-radius-radius-3xl);\n left: 0;\n z-index: 100;\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;\n transition: box-shadow var(--nile-transition-duration-default) ease;\n }\n\n .range-button:hover, .range-button-two:hover {\n cursor: pointer;\n background-color: var(--nile-colors-primary-700);\n }\n\n .range-button:active, .range-button-two:active {\n transition: box-shadow var(--nile-transition-duration-default) ease;\n background-color: var(--nile-colors-primary-700);\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 4px;\n }\n\n .range-button-two {\n height: 12px;\n width: 12px;\n background-color: var(--nile-colors-primary-600);\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n border-radius: var(--nile-radius-radius-3xl);\n left: 100%;\n z-index: 100;\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;\n transition: box-shadow var(--nile-transition-duration-default) ease;\n }\n"]))));}};});
1
+ System.register(["lit"],function(_export,_context){"use strict";var r,_templateObject,e;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){r=_lit.css;}],execute:function execute(){_export("s",e=r(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: block;\n }\n\n /* Field header */\n\n .field-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-md));\n margin-bottom: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .field-label {\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n }\n\n /* Layout */\n\n .container {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-md));\n min-height: var(--nile-spacing-5xl, var(--ng-spacing-5xl));\n }\n\n .align-item-center {\n align-items: center;\n }\n\n slot.span {\n font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));\n }\n\n .range-container {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n gap: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .column-reverse {\n flex-direction: column-reverse;\n }\n\n .label-container {\n display: flex;\n justify-content: space-between;\n }\n\n .label-container span {\n margin: var(--nile-spacing-none, var(--ng-spacing-none));\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-tertiary-600));\n }\n\n /* track & fill */\n\n .range {\n position: relative;\n width: var(--nile-slider-width, 228px);\n height: var(--nile-spacing-xs, var(--ng-spacing-sm));\n background-color: var(--nile-colors-neutral-400, var(--ng-colors-bg-quaternary));\n user-select: none;\n border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));\n }\n\n .range:hover {\n cursor: pointer;\n }\n\n .range-completed {\n position: absolute;\n height: 100%;\n width: 0%;\n background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-brand-solid));\n top: 0px;\n left: 0px;\n z-index: 98;\n border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));\n }\n\n /* ------------------------------------------------------------------ */\n /* Inline value label (valueLabel=\"bottom\") */\n /* ------------------------------------------------------------------ */\n\n .value-label {\n position: absolute;\n /* Start at the track bottom, then push down past the handle and the\n largest (pressed, 8px) ring */\n top: 100%;\n margin-top: var(--nile-spacing-xl, var(--ng-spacing-xl));\n transform: translateX(-50%);\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));\n font-variant-numeric: tabular-nums;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-quaternary-500));\n white-space: nowrap;\n pointer-events: none;\n user-select: none;\n -webkit-user-select: none;\n }\n\n /* Reserve room below the track for the inline value label */\n :host([valuelabel='bottom']) .container {\n padding-bottom: var(--nile-spacing-2xl, var(--ng-spacing-2xl));\n }\n\n /* Handles */\n\n .range-button,\n .range-button-two {\n height: var(--nile-spacing-lg, var(--ng-spacing-2xl));\n width: var(--nile-spacing-lg, var(--ng-spacing-2xl));\n box-sizing: border-box;\n /* Enterprise: solid brand dot - NextGen: white fill + brand border */\n background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-primary));\n border: var(--nile-spacing-xxs, var(--ng-spacing-xxs)) solid\n var(--nile-colors-primary-600, var(--ng-colors-border-brand-alt));\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));\n left: 0;\n z-index: 100;\n cursor: grab;\n transition:\n box-shadow var(--nile-transition-duration-short, 120ms) ease,\n background-color var(--nile-transition-duration-short, 120ms) ease,\n transform var(--nile-transition-duration-shorter, 80ms) ease;\n }\n\n .range-button-two {\n left: 100%;\n }\n\n /* Hover: ring (Enterprise 2px - NextGen 6px) */\n .range-button:hover,\n .range-button-two:hover {\n cursor: grab;\n box-shadow: 0 0 0 var(--nile-spacing-xxs, var(--ng-spacing-sm))\n var(--nile-colors-primary-100, var(--ng-colors-bg-brand-secondary));\n }\n\n /* Focused: theme focus ring */\n .range-button:focus-visible,\n .range-button-two:focus-visible {\n outline: none;\n box-shadow: var(--nile-focus-ring,\n var(--ng-focus-ring,\n 0 0 0 var(--nile-spacing-xs) var(--nile-colors-primary-100)));\n }\n\n /* Pressed: ring (Enterprise 4px - NextGen 8px) + 1.1x scale */\n .range-button:active,\n .range-button-two:active {\n cursor: grabbing;\n transform: translate(-50%, -50%) scale(1.1);\n box-shadow: 0 0 0 var(--nile-spacing-xs, var(--ng-spacing-md))\n var(--nile-colors-primary-100, var(--ng-colors-bg-brand-secondary));\n }\n\n /* Error state */\n :host([error]) .range-completed {\n background-color: var(--nile-colors-red-700, var(--ng-colors-bg-error-solid));\n }\n\n :host([error]) .range-button,\n :host([error]) .range-button-two {\n background-color: var(--nile-colors-red-700, var(--ng-colors-bg-primary));\n border-color: var(--nile-colors-red-700, var(--ng-colors-border-error));\n }\n\n :host([error]) .range-button:hover,\n :host([error]) .range-button-two:hover {\n box-shadow: 0 0 0 var(--nile-spacing-xxs, var(--ng-spacing-sm))\n var(--nile-colors-red-100, var(--ng-colors-bg-error-secondary, var(--ng-color-error-100)));\n }\n\n :host([error]) .range-button:focus-visible,\n :host([error]) .range-button-two:focus-visible {\n box-shadow: var(--nile-focus-ring-error,\n var(--ng-focus-ring-error,\n 0 0 0 var(--nile-spacing-xs) var(--nile-colors-red-100)));\n }\n\n /* Disabled state */\n :host([disabled]) .range,\n :host([disabled]) .range:hover {\n cursor: not-allowed;\n background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-disabled));\n }\n\n :host([disabled]) .range-completed {\n background-color: var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled));\n }\n\n :host([disabled]) .range-button,\n :host([disabled]) .range-button-two {\n background-color: var(--nile-colors-neutral-500, var(--ng-colors-bg-primary));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));\n cursor: not-allowed;\n }\n\n :host([disabled]) .range-button:hover,\n :host([disabled]) .range-button-two:hover,\n :host([disabled]) .range-button:active,\n :host([disabled]) .range-button-two:active {\n box-shadow: none;\n transform: translate(-50%, -50%);\n }\n\n :host([disabled]) .field-label,\n :host([disabled]) .value-label,\n :host([disabled]) .label-container span {\n color: var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled));\n user-select: none;\n -webkit-user-select: none;\n }\n"]))));}};});
2
2
  //# sourceMappingURL=nile-slider.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-slider.css.cjs.js","sources":["../../../src/nile-slider/nile-slider.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2025\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\nimport { css } from 'lit';\n\n/**\n* Slider CSS\n*/\nexport const styles = css`\n :host {\n display: block;\n }\n\n .container {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 10px;\n height: 100px;\n }\n\n .align-item-center {\n align-items: center;\n }\n\n slot.span {\n font-size: var(--nile-font-size-micro);\n margin-top: 14px;\n }\n\n .range-container {\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-sm);\n }\n\n .column-reverse {\n flex-direction: column-reverse;\n }\n\n .label-container {\n display: flex;\n justify-content: space-between;\n }\n\n .label-container span {\n margin: var(--nile-spacing-none);\n padding: var(--nile-spacing-none);\n font-size: var(--nile-font-size-micro);\n }\n\n .range {\n position: relative;\n width: 228px;\n height: 4px;\n background-color: var(--nile-colors-neutral-400);\n user-select: none;\n border-radius: var(--nile-radius-radius-3xl);\n }\n\n .range:hover {\n cursor: pointer;\n }\n\n .range-completed {\n position: absolute;\n height: 100%;\n width: 0%;\n background-color: var(--nile-colors-primary-600);\n top: 0px;\n left: 0px;\n z-index: 98;\n border-radius: var(--nile-radius-radius-3xl);\n }\n\n .range-button {\n height: 12px;\n width: 12px;\n background-color: var(--nile-colors-primary-600);\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n border-radius: var(--nile-radius-radius-3xl);\n left: 0;\n z-index: 100;\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;\n transition: box-shadow var(--nile-transition-duration-default) ease;\n }\n\n .range-button:hover, .range-button-two:hover {\n cursor: pointer;\n background-color: var(--nile-colors-primary-700);\n }\n\n .range-button:active, .range-button-two:active {\n transition: box-shadow var(--nile-transition-duration-default) ease;\n background-color: var(--nile-colors-primary-700);\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 4px;\n }\n\n .range-button-two {\n height: 12px;\n width: 12px;\n background-color: var(--nile-colors-primary-600);\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n border-radius: var(--nile-radius-radius-3xl);\n left: 100%;\n z-index: 100;\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;\n transition: box-shadow var(--nile-transition-duration-default) ease;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAWaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-slider.css.cjs.js","sources":["../../../src/nile-slider/nile-slider.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2025\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\nimport { css } from 'lit';\n\n/**\n* Slider CSS\n*/\nexport const styles = css`\n :host {\n display: block;\n }\n\n /* Field header */\n\n .field-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-md));\n margin-bottom: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .field-label {\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n }\n\n /* Layout */\n\n .container {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-md));\n min-height: var(--nile-spacing-5xl, var(--ng-spacing-5xl));\n }\n\n .align-item-center {\n align-items: center;\n }\n\n slot.span {\n font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));\n }\n\n .range-container {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n gap: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .column-reverse {\n flex-direction: column-reverse;\n }\n\n .label-container {\n display: flex;\n justify-content: space-between;\n }\n\n .label-container span {\n margin: var(--nile-spacing-none, var(--ng-spacing-none));\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-tertiary-600));\n }\n\n /* track & fill */\n\n .range {\n position: relative;\n width: var(--nile-slider-width, 228px);\n height: var(--nile-spacing-xs, var(--ng-spacing-sm));\n background-color: var(--nile-colors-neutral-400, var(--ng-colors-bg-quaternary));\n user-select: none;\n border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));\n }\n\n .range:hover {\n cursor: pointer;\n }\n\n .range-completed {\n position: absolute;\n height: 100%;\n width: 0%;\n background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-brand-solid));\n top: 0px;\n left: 0px;\n z-index: 98;\n border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));\n }\n\n /* ------------------------------------------------------------------ */\n /* Inline value label (valueLabel=\"bottom\") */\n /* ------------------------------------------------------------------ */\n\n .value-label {\n position: absolute;\n /* Start at the track bottom, then push down past the handle and the\n largest (pressed, 8px) ring */\n top: 100%;\n margin-top: var(--nile-spacing-xl, var(--ng-spacing-xl));\n transform: translateX(-50%);\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));\n font-variant-numeric: tabular-nums;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-quaternary-500));\n white-space: nowrap;\n pointer-events: none;\n user-select: none;\n -webkit-user-select: none;\n }\n\n /* Reserve room below the track for the inline value label */\n :host([valuelabel='bottom']) .container {\n padding-bottom: var(--nile-spacing-2xl, var(--ng-spacing-2xl));\n }\n\n /* Handles */\n\n .range-button,\n .range-button-two {\n height: var(--nile-spacing-lg, var(--ng-spacing-2xl));\n width: var(--nile-spacing-lg, var(--ng-spacing-2xl));\n box-sizing: border-box;\n /* Enterprise: solid brand dot - NextGen: white fill + brand border */\n background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-primary));\n border: var(--nile-spacing-xxs, var(--ng-spacing-xxs)) solid\n var(--nile-colors-primary-600, var(--ng-colors-border-brand-alt));\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));\n left: 0;\n z-index: 100;\n cursor: grab;\n transition:\n box-shadow var(--nile-transition-duration-short, 120ms) ease,\n background-color var(--nile-transition-duration-short, 120ms) ease,\n transform var(--nile-transition-duration-shorter, 80ms) ease;\n }\n\n .range-button-two {\n left: 100%;\n }\n\n /* Hover: ring (Enterprise 2px - NextGen 6px) */\n .range-button:hover,\n .range-button-two:hover {\n cursor: grab;\n box-shadow: 0 0 0 var(--nile-spacing-xxs, var(--ng-spacing-sm))\n var(--nile-colors-primary-100, var(--ng-colors-bg-brand-secondary));\n }\n\n /* Focused: theme focus ring */\n .range-button:focus-visible,\n .range-button-two:focus-visible {\n outline: none;\n box-shadow: var(--nile-focus-ring,\n var(--ng-focus-ring,\n 0 0 0 var(--nile-spacing-xs) var(--nile-colors-primary-100)));\n }\n\n /* Pressed: ring (Enterprise 4px - NextGen 8px) + 1.1x scale */\n .range-button:active,\n .range-button-two:active {\n cursor: grabbing;\n transform: translate(-50%, -50%) scale(1.1);\n box-shadow: 0 0 0 var(--nile-spacing-xs, var(--ng-spacing-md))\n var(--nile-colors-primary-100, var(--ng-colors-bg-brand-secondary));\n }\n\n /* Error state */\n :host([error]) .range-completed {\n background-color: var(--nile-colors-red-700, var(--ng-colors-bg-error-solid));\n }\n\n :host([error]) .range-button,\n :host([error]) .range-button-two {\n background-color: var(--nile-colors-red-700, var(--ng-colors-bg-primary));\n border-color: var(--nile-colors-red-700, var(--ng-colors-border-error));\n }\n\n :host([error]) .range-button:hover,\n :host([error]) .range-button-two:hover {\n box-shadow: 0 0 0 var(--nile-spacing-xxs, var(--ng-spacing-sm))\n var(--nile-colors-red-100, var(--ng-colors-bg-error-secondary, var(--ng-color-error-100)));\n }\n\n :host([error]) .range-button:focus-visible,\n :host([error]) .range-button-two:focus-visible {\n box-shadow: var(--nile-focus-ring-error,\n var(--ng-focus-ring-error,\n 0 0 0 var(--nile-spacing-xs) var(--nile-colors-red-100)));\n }\n\n /* Disabled state */\n :host([disabled]) .range,\n :host([disabled]) .range:hover {\n cursor: not-allowed;\n background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-disabled));\n }\n\n :host([disabled]) .range-completed {\n background-color: var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled));\n }\n\n :host([disabled]) .range-button,\n :host([disabled]) .range-button-two {\n background-color: var(--nile-colors-neutral-500, var(--ng-colors-bg-primary));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));\n cursor: not-allowed;\n }\n\n :host([disabled]) .range-button:hover,\n :host([disabled]) .range-button-two:hover,\n :host([disabled]) .range-button:active,\n :host([disabled]) .range-button-two:active {\n box-shadow: none;\n transform: translate(-50%, -50%);\n }\n\n :host([disabled]) .field-label,\n :host([disabled]) .value-label,\n :host([disabled]) .label-container span {\n color: var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled));\n user-select: none;\n -webkit-user-select: none;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAWaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -1,14 +1,33 @@
1
- import{css as r}from"lit";const a=r`
1
+ import{css as r}from"lit";const e=r`
2
2
  :host {
3
3
  display: block;
4
4
  }
5
5
 
6
+ /* Field header */
7
+
8
+ .field-header {
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ gap: var(--nile-spacing-md, var(--ng-spacing-md));
13
+ margin-bottom: var(--nile-spacing-sm, var(--ng-spacing-sm));
14
+ }
15
+
16
+ .field-label {
17
+ font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
18
+ font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
19
+ font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));
20
+ color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));
21
+ }
22
+
23
+ /* Layout */
24
+
6
25
  .container {
7
26
  display: flex;
8
27
  justify-content: center;
9
28
  align-items: center;
10
- gap: 10px;
11
- height: 100px;
29
+ gap: var(--nile-spacing-md, var(--ng-spacing-md));
30
+ min-height: var(--nile-spacing-5xl, var(--ng-spacing-5xl));
12
31
  }
13
32
 
14
33
  .align-item-center {
@@ -16,14 +35,14 @@ import{css as r}from"lit";const a=r`
16
35
  }
17
36
 
18
37
  slot.span {
19
- font-size: var(--nile-font-size-micro);
20
- margin-top: 14px;
38
+ font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));
21
39
  }
22
40
 
23
41
  .range-container {
24
42
  display: flex;
25
43
  flex-direction: column;
26
- gap: var(--nile-spacing-sm);
44
+ flex: 1 1 auto;
45
+ gap: var(--nile-spacing-sm, var(--ng-spacing-sm));
27
46
  }
28
47
 
29
48
  .column-reverse {
@@ -36,18 +55,21 @@ import{css as r}from"lit";const a=r`
36
55
  }
37
56
 
38
57
  .label-container span {
39
- margin: var(--nile-spacing-none);
40
- padding: var(--nile-spacing-none);
41
- font-size: var(--nile-font-size-micro);
58
+ margin: var(--nile-spacing-none, var(--ng-spacing-none));
59
+ padding: var(--nile-spacing-none, var(--ng-spacing-none));
60
+ font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));
61
+ color: var(--nile-colors-dark-500, var(--ng-colors-text-tertiary-600));
42
62
  }
43
63
 
64
+ /* track & fill */
65
+
44
66
  .range {
45
67
  position: relative;
46
- width: 228px;
47
- height: 4px;
48
- background-color: var(--nile-colors-neutral-400);
68
+ width: var(--nile-slider-width, 228px);
69
+ height: var(--nile-spacing-xs, var(--ng-spacing-sm));
70
+ background-color: var(--nile-colors-neutral-400, var(--ng-colors-bg-quaternary));
49
71
  user-select: none;
50
- border-radius: var(--nile-radius-radius-3xl);
72
+ border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));
51
73
  }
52
74
 
53
75
  .range:hover {
@@ -58,49 +80,148 @@ import{css as r}from"lit";const a=r`
58
80
  position: absolute;
59
81
  height: 100%;
60
82
  width: 0%;
61
- background-color: var(--nile-colors-primary-600);
83
+ background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-brand-solid));
62
84
  top: 0px;
63
85
  left: 0px;
64
86
  z-index: 98;
65
- border-radius: var(--nile-radius-radius-3xl);
87
+ border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));
88
+ }
89
+
90
+ /* ------------------------------------------------------------------ */
91
+ /* Inline value label (valueLabel="bottom") */
92
+ /* ------------------------------------------------------------------ */
93
+
94
+ .value-label {
95
+ position: absolute;
96
+ /* Start at the track bottom, then push down past the handle and the
97
+ largest (pressed, 8px) ring */
98
+ top: 100%;
99
+ margin-top: var(--nile-spacing-xl, var(--ng-spacing-xl));
100
+ transform: translateX(-50%);
101
+ font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
102
+ font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));
103
+ font-variant-numeric: tabular-nums;
104
+ color: var(--nile-colors-dark-500, var(--ng-colors-text-quaternary-500));
105
+ white-space: nowrap;
106
+ pointer-events: none;
107
+ user-select: none;
108
+ -webkit-user-select: none;
66
109
  }
67
110
 
68
- .range-button {
69
- height: 12px;
70
- width: 12px;
71
- background-color: var(--nile-colors-primary-600);
111
+ /* Reserve room below the track for the inline value label */
112
+ :host([valuelabel='bottom']) .container {
113
+ padding-bottom: var(--nile-spacing-2xl, var(--ng-spacing-2xl));
114
+ }
115
+
116
+ /* Handles */
117
+
118
+ .range-button,
119
+ .range-button-two {
120
+ height: var(--nile-spacing-lg, var(--ng-spacing-2xl));
121
+ width: var(--nile-spacing-lg, var(--ng-spacing-2xl));
122
+ box-sizing: border-box;
123
+ /* Enterprise: solid brand dot - NextGen: white fill + brand border */
124
+ background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-primary));
125
+ border: var(--nile-spacing-xxs, var(--ng-spacing-xxs)) solid
126
+ var(--nile-colors-primary-600, var(--ng-colors-border-brand-alt));
72
127
  position: absolute;
73
128
  top: 50%;
74
129
  transform: translate(-50%, -50%);
75
- border-radius: var(--nile-radius-radius-3xl);
130
+ border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));
76
131
  left: 0;
77
132
  z-index: 100;
78
- box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;
79
- transition: box-shadow var(--nile-transition-duration-default) ease;
133
+ cursor: grab;
134
+ transition:
135
+ box-shadow var(--nile-transition-duration-short, 120ms) ease,
136
+ background-color var(--nile-transition-duration-short, 120ms) ease,
137
+ transform var(--nile-transition-duration-shorter, 80ms) ease;
80
138
  }
81
139
 
82
- .range-button:hover, .range-button-two:hover {
83
- cursor: pointer;
84
- background-color: var(--nile-colors-primary-700);
140
+ .range-button-two {
141
+ left: 100%;
85
142
  }
86
143
 
87
- .range-button:active, .range-button-two:active {
88
- transition: box-shadow var(--nile-transition-duration-default) ease;
89
- background-color: var(--nile-colors-primary-700);
90
- box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 4px;
144
+ /* Hover: ring (Enterprise 2px - NextGen 6px) */
145
+ .range-button:hover,
146
+ .range-button-two:hover {
147
+ cursor: grab;
148
+ box-shadow: 0 0 0 var(--nile-spacing-xxs, var(--ng-spacing-sm))
149
+ var(--nile-colors-primary-100, var(--ng-colors-bg-brand-secondary));
91
150
  }
92
151
 
93
- .range-button-two {
94
- height: 12px;
95
- width: 12px;
96
- background-color: var(--nile-colors-primary-600);
97
- position: absolute;
98
- top: 50%;
152
+ /* Focused: theme focus ring */
153
+ .range-button:focus-visible,
154
+ .range-button-two:focus-visible {
155
+ outline: none;
156
+ box-shadow: var(--nile-focus-ring,
157
+ var(--ng-focus-ring,
158
+ 0 0 0 var(--nile-spacing-xs) var(--nile-colors-primary-100)));
159
+ }
160
+
161
+ /* Pressed: ring (Enterprise 4px - NextGen 8px) + 1.1x scale */
162
+ .range-button:active,
163
+ .range-button-two:active {
164
+ cursor: grabbing;
165
+ transform: translate(-50%, -50%) scale(1.1);
166
+ box-shadow: 0 0 0 var(--nile-spacing-xs, var(--ng-spacing-md))
167
+ var(--nile-colors-primary-100, var(--ng-colors-bg-brand-secondary));
168
+ }
169
+
170
+ /* Error state */
171
+ :host([error]) .range-completed {
172
+ background-color: var(--nile-colors-red-700, var(--ng-colors-bg-error-solid));
173
+ }
174
+
175
+ :host([error]) .range-button,
176
+ :host([error]) .range-button-two {
177
+ background-color: var(--nile-colors-red-700, var(--ng-colors-bg-primary));
178
+ border-color: var(--nile-colors-red-700, var(--ng-colors-border-error));
179
+ }
180
+
181
+ :host([error]) .range-button:hover,
182
+ :host([error]) .range-button-two:hover {
183
+ box-shadow: 0 0 0 var(--nile-spacing-xxs, var(--ng-spacing-sm))
184
+ var(--nile-colors-red-100, var(--ng-colors-bg-error-secondary, var(--ng-color-error-100)));
185
+ }
186
+
187
+ :host([error]) .range-button:focus-visible,
188
+ :host([error]) .range-button-two:focus-visible {
189
+ box-shadow: var(--nile-focus-ring-error,
190
+ var(--ng-focus-ring-error,
191
+ 0 0 0 var(--nile-spacing-xs) var(--nile-colors-red-100)));
192
+ }
193
+
194
+ /* Disabled state */
195
+ :host([disabled]) .range,
196
+ :host([disabled]) .range:hover {
197
+ cursor: not-allowed;
198
+ background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-disabled));
199
+ }
200
+
201
+ :host([disabled]) .range-completed {
202
+ background-color: var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled));
203
+ }
204
+
205
+ :host([disabled]) .range-button,
206
+ :host([disabled]) .range-button-two {
207
+ background-color: var(--nile-colors-neutral-500, var(--ng-colors-bg-primary));
208
+ border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));
209
+ cursor: not-allowed;
210
+ }
211
+
212
+ :host([disabled]) .range-button:hover,
213
+ :host([disabled]) .range-button-two:hover,
214
+ :host([disabled]) .range-button:active,
215
+ :host([disabled]) .range-button-two:active {
216
+ box-shadow: none;
99
217
  transform: translate(-50%, -50%);
100
- border-radius: var(--nile-radius-radius-3xl);
101
- left: 100%;
102
- z-index: 100;
103
- box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;
104
- transition: box-shadow var(--nile-transition-duration-default) ease;
105
218
  }
106
- `;export{a as s};
219
+
220
+ :host([disabled]) .field-label,
221
+ :host([disabled]) .value-label,
222
+ :host([disabled]) .label-container span {
223
+ color: var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled));
224
+ user-select: none;
225
+ -webkit-user-select: none;
226
+ }
227
+ `;export{e as s};
@@ -1,4 +1,5 @@
1
- import{__decorate as t}from"tslib";import{s}from"./nile-slider.css.esm.js";import{N as i}from"../internal/nile-element.esm.js";import{classMap as e}from"lit/directives/class-map.js";import{html as h}from"lit";import{property as a,customElement as l}from"lit/decorators.js";import{l as n,r,s as o}from"./nile-slider.template.esm.js";import{h as c,a as m,b as p,v as d,r as u,c as v,d as b,g as y}from"./utils/nile-slider.utils.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";let g=class extends i{constructor(){super(...arguments),this.minValue=0,this.value=this.minValue,this.maxValue=100,this.rangeOneValue=this.minValue,this.rangeTwoValue=this.maxValue,this.showLabel=!1,this.labelStart="",this.labelEnd="",this.rangeSlider=!1,this.labelPosition="top",this.tooltipPosition="top",this.activeThumb=null,this.onMouseMove=t=>{const s=this.range.getBoundingClientRect();if(this.rangeSlider){"one"===this.activeThumb?m(t,s,this):"two"===this.activeThumb&&p(t,s,this);const i=d(this.rangeOneValue,this),e=d(this.rangeTwoValue,this),h=Math.min(i,e),a=Math.abs(e-i);this.rangeTwoValue>=this.rangeOneValue&&(this.completed.style.left=`${h}%`,this.completed.style.width=`${a}%`)}else c(t,s,this)},this.onMouseUp=()=>{this.rangeSlider?(this.emit("nile-button-first-change-end",{value:this.rangeOneValue}),this.emit("nile-button-last-change-end",{value:this.rangeTwoValue})):this.emit("nile-change-end",{value:this.value}),this.activeThumb=null,u(this)},this.onMouseDown=t=>{const s=this.range.getBoundingClientRect(),i=(t.clientX-s.left)/s.width*100,e=this.minValue+i/100*(this.maxValue-this.minValue);if(this.rangeSlider){b(e,this);const t=Math.abs(e-this.rangeOneValue),s=Math.abs(e-this.rangeTwoValue);this.activeThumb=t<=s?"one":"two",v(this)}else c(t,s,this),this.activeThumb="one",v(this)}}static get styles(){return[s]}connectedCallback(){super.connectedCallback(),this.emit("nile-init"),this.rangeSlider&&this.checkRangeValidity()}firstUpdated(t){if(y(this),!this.rangeSlider&&t.has("value")){this.value=this.checkValueValidity(this.value,this.minValue,this.maxValue);const t=d(this.value,this);this.buttonOne.style.left=`${t}%`,this.completed.style.width=`${t}%`}else if(this.rangeSlider){const t=d(this.rangeOneValue,this),s=d(this.rangeTwoValue,this);this.buttonOne&&(this.buttonOne.style.left=`${t}%`),this.buttonTwo&&(this.buttonTwo.style.left=`${s}%`);const i=Math.min(t,s),e=Math.abs(s-t);this.completed.style.left=`${i}%`,this.completed.style.width=`${e}%`}}checkValueValidity(t,s,i){return i-s<=1?Math.max(s,Math.min(t,i)):Math.floor(Math.max(s,Math.min(t,i)))}checkRangeValidity(){this.rangeTwoValue>this.maxValue?this.rangeTwoValue=this.maxValue:this.rangeTwoValue<this.rangeOneValue&&(this.rangeTwoValue=this.rangeOneValue),this.rangeOneValue<this.minValue?this.rangeOneValue=this.minValue:this.rangeOneValue>this.rangeTwoValue&&(this.rangeOneValue=this.rangeTwoValue)}render(){const t=this.showLabel,s=t?"label-start label-end":void 0;return h`
1
+ import{__decorate as t}from"tslib";import{s}from"./nile-slider.css.esm.js";import{N as i}from"../internal/nile-element.esm.js";import{classMap as e}from"lit/directives/class-map.js";import{html as h}from"lit";import{property as a,customElement as l}from"lit/decorators.js";import{f as r,l as n,r as o,s as c,b as p}from"./nile-slider.template.esm.js";import{h as d,a as m,b as u,v,r as b,c as y,d as f,g}from"./utils/nile-slider.utils.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";let $=class extends i{constructor(){super(...arguments),this.minValue=0,this.value=this.minValue,this.maxValue=100,this.rangeOneValue=this.minValue,this.rangeTwoValue=this.maxValue,this.showLabel=!1,this.labelStart="",this.labelEnd="",this.rangeSlider=!1,this.labelPosition="top",this.tooltipPosition="top",this.label="",this.disabled=!1,this.error=!1,this.valueLabel="tooltip",this.activeThumb=null,this.onMouseMove=t=>{if(this.disabled)return;const s=this.range.getBoundingClientRect();if(this.rangeSlider){"one"===this.activeThumb?m(t,s,this):"two"===this.activeThumb&&u(t,s,this);const i=v(this.rangeOneValue,this),e=v(this.rangeTwoValue,this),h=Math.min(i,e),a=Math.abs(e-i);this.rangeTwoValue>=this.rangeOneValue&&(this.completed.style.left=`${h}%`,this.completed.style.width=`${a}%`)}else d(t,s,this)},this.onMouseUp=()=>{this.rangeSlider?(this.emit("nile-button-first-change-end",{value:this.rangeOneValue}),this.emit("nile-button-last-change-end",{value:this.rangeTwoValue})):this.emit("nile-change-end",{value:this.value}),this.activeThumb=null,b(this)},this.onMouseDown=t=>{if(this.disabled)return;const s=this.range.getBoundingClientRect(),i=(t.clientX-s.left)/s.width*100,e=this.minValue+i/100*(this.maxValue-this.minValue);if(this.rangeSlider){f(e,this);const t=Math.abs(e-this.rangeOneValue),s=Math.abs(e-this.rangeTwoValue);this.activeThumb=t<=s?"one":"two",y(this)}else d(t,s,this),this.activeThumb="one",y(this)}}static get styles(){return[s]}connectedCallback(){super.connectedCallback(),this.emit("nile-init"),this.rangeSlider&&this.checkRangeValidity()}firstUpdated(t){if(g(this),!this.rangeSlider&&t.has("value")){this.value=this.checkValueValidity(this.value,this.minValue,this.maxValue);const t=v(this.value,this);this.buttonOne.style.left=`${t}%`,this.completed.style.width=`${t}%`}else if(this.rangeSlider){const t=v(this.rangeOneValue,this),s=v(this.rangeTwoValue,this);this.buttonOne&&(this.buttonOne.style.left=`${t}%`),this.buttonTwo&&(this.buttonTwo.style.left=`${s}%`);const i=Math.min(t,s),e=Math.abs(s-t);this.completed.style.left=`${i}%`,this.completed.style.width=`${e}%`}}checkValueValidity(t,s,i){return i-s<=1?Math.max(s,Math.min(t,i)):Math.floor(Math.max(s,Math.min(t,i)))}checkRangeValidity(){this.rangeTwoValue>this.maxValue?this.rangeTwoValue=this.maxValue:this.rangeTwoValue<this.rangeOneValue&&(this.rangeTwoValue=this.rangeOneValue),this.rangeOneValue<this.minValue?this.rangeOneValue=this.minValue:this.rangeOneValue>this.rangeTwoValue&&(this.rangeOneValue=this.rangeTwoValue)}render(){const t=this.showLabel,s=t?"label-start label-end":void 0;return h`
2
+ ${this.label?r(this):h``}
2
3
  <div
3
4
  part="base"
4
5
  class=${e({container:!0,"align-item-center":!t})}
@@ -18,10 +19,11 @@ import{__decorate as t}from"tslib";import{s}from"./nile-slider.css.esm.js";impor
18
19
  aria-labelledby=${s}
19
20
  >
20
21
  <span class="range-completed" part="range-completed"></span>
21
- ${this.rangeSlider?r(this):o(this)}
22
+ ${this.rangeSlider?o(this):c(this)}
23
+ ${"bottom"===this.valueLabel?p(this):h``}
22
24
  </div>
23
25
  </div>
24
26
 
25
27
  <slot class="span" name="suffix"></slot>
26
28
  </div>
27
- `}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}};t([a({type:Number})],g.prototype,"minValue",void 0),t([a({type:Number})],g.prototype,"value",void 0),t([a({type:Number})],g.prototype,"maxValue",void 0),t([a({type:Number})],g.prototype,"rangeOneValue",void 0),t([a({type:Number})],g.prototype,"rangeTwoValue",void 0),t([a({type:Boolean})],g.prototype,"showLabel",void 0),t([a({type:String})],g.prototype,"labelStart",void 0),t([a({type:String})],g.prototype,"labelEnd",void 0),t([a({type:Boolean})],g.prototype,"rangeSlider",void 0),t([a({type:String})],g.prototype,"labelPosition",void 0),t([a({type:String})],g.prototype,"tooltipPosition",void 0),g=t([l("nile-slider")],g);export{g as N};
29
+ `}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}};t([a({type:Number})],$.prototype,"minValue",void 0),t([a({type:Number})],$.prototype,"value",void 0),t([a({type:Number})],$.prototype,"maxValue",void 0),t([a({type:Number})],$.prototype,"rangeOneValue",void 0),t([a({type:Number})],$.prototype,"rangeTwoValue",void 0),t([a({type:Boolean})],$.prototype,"showLabel",void 0),t([a({type:String})],$.prototype,"labelStart",void 0),t([a({type:String})],$.prototype,"labelEnd",void 0),t([a({type:Boolean})],$.prototype,"rangeSlider",void 0),t([a({type:String})],$.prototype,"labelPosition",void 0),t([a({type:String})],$.prototype,"tooltipPosition",void 0),t([a({type:String})],$.prototype,"label",void 0),t([a({type:Boolean,reflect:!0})],$.prototype,"disabled",void 0),t([a({type:Boolean,reflect:!0})],$.prototype,"error",void 0),t([a({type:String,reflect:!0})],$.prototype,"valueLabel",void 0),$=t([l("nile-slider")],$);export{$ as N};
@@ -1,2 +1,2 @@
1
- System.register(["lit","lit/directives/class-map.js"],function(_export,_context){"use strict";var a,e,_templateObject,_templateObject2,_templateObject3,i,t,l;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){a=_lit.html;},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;}],execute:function execute(){_export("r",i=function i(e){return a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div>\n <nile-tooltip\n content=","\n placement=","\n >\n <div \n id=\"range-one\" \n class=\"range-button\"\n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=","\n aria-valuemax=","\n aria-valuenow=","\n aria-label=\"Minimum value\"\n ></div>\n </nile-tooltip>\n <nile-tooltip\n content=","\n placement=","\n >\n <div\n id=\"range-two\"\n class=\"range-button-two\"\n part=\"range-button-two\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=","\n aria-valuemax=","\n aria-valuenow=","\n aria-label=\"Maximum value\"\n ></div>\n </nile-tooltip>\n </div>\n "])),e.rangeOneValue,e.tooltipPosition,e.minValue,e.maxValue,e.rangeOneValue,e.rangeTwoValue,e.tooltipPosition,e.minValue,e.maxValue,e.rangeTwoValue);}),_export("s",t=function t(i){return a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div>\n <nile-tooltip\n content=","\n placement=","\n >\n <div \n class="," \n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=","\n aria-valuemax=","\n aria-valuenow=","\n aria-label=","\n ></div>\n </nile-tooltip>\n </div>\n "])),i.value,i.tooltipPosition,e({"range-button":!0,"range-button-active":"one"===i.activeThumb}),i.minValue,i.maxValue,i.value,i.ariaLabel||"Slider value");}),_export("l",l=function l(e){return a(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <div part=\"label-container\" class=\"label-container\">\n <span id=\"label-start\">","</span>\n <span id=\"label-end\">","</span>\n </div>\n "])),e.labelStart,e.labelEnd);});}};});
1
+ System.register(["lit","lit/directives/class-map.js","./utils/nile-slider.utils.cjs.js"],function(_export,_context){"use strict";var a,l,e,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,i,t,n,s,r,o;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){a=_lit.html;},function(_litDirectivesClassMapJs){l=_litDirectivesClassMapJs.classMap;},function(_utilsNileSliderUtilsCjsJs){e=_utilsNileSliderUtilsCjsJs.v;}],execute:function execute(){i=function i(a){return a.disabled||"tooltip"!==a.valueLabel;},_export("r",t=function t(l){return a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div>\n <nile-tooltip\n content=","\n placement=","\n ?disabled=","\n >\n <div \n id=\"range-one\" \n class=\"range-button\"\n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=","\n aria-valuemax=","\n aria-valuenow=","\n aria-label=\"Minimum value\"\n ></div>\n </nile-tooltip>\n <nile-tooltip\n content=","\n placement=","\n ?disabled=","\n >\n <div\n id=\"range-two\"\n class=\"range-button-two\"\n part=\"range-button-two\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=","\n aria-valuemax=","\n aria-valuenow=","\n aria-label=\"Maximum value\"\n ></div>\n </nile-tooltip>\n </div>\n "])),l.rangeOneValue,l.tooltipPosition,i(l),l.minValue,l.maxValue,l.rangeOneValue,l.rangeTwoValue,l.tooltipPosition,i(l),l.minValue,l.maxValue,l.rangeTwoValue);}),_export("s",n=function n(e){return a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div>\n <nile-tooltip\n content=","\n placement=","\n ?disabled=","\n >\n <div \n class="," \n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=","\n aria-valuemax=","\n aria-valuenow=","\n aria-label=","\n ></div>\n </nile-tooltip>\n </div>\n "])),e.value,e.tooltipPosition,i(e),l({"range-button":!0,"range-button-active":"one"===e.activeThumb}),e.minValue,e.maxValue,e.value,e.ariaLabel||e.label||"Slider value");}),_export("l",s=function s(l){return a(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <div part=\"label-container\" class=\"label-container\">\n <span id=\"label-start\">","</span>\n <span id=\"label-end\">","</span>\n </div>\n "])),l.labelStart,l.labelEnd);}),_export("f",r=function r(l){return a(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div part=\"field-header\" class=\"field-header\">\n <label id=\"field-label\" part=\"field-label\" class=\"field-label\">\n ","\n </label>\n </div>\n "])),l.label);}),_export("b",o=function o(l){return l.rangeSlider?a(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <span\n part=\"value-label\"\n class=\"value-label\"\n style=\"left: ","%\"\n >","</span>\n <span\n part=\"value-label\"\n class=\"value-label\"\n style=\"left: ","%\"\n >","</span>\n "])),e(l.rangeOneValue,l),l.rangeOneValue,e(l.rangeTwoValue,l),l.rangeTwoValue):a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <span\n part=\"value-label\"\n class=\"value-label\"\n style=\"left: ","%\"\n >","</span>\n "])),e(l.value,l),l.value);});}};});
2
2
  //# sourceMappingURL=nile-slider.template.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-slider.template.cjs.js","sources":["../../../src/nile-slider/nile-slider.template.ts"],"sourcesContent":["import { TemplateResult, html } from 'lit';\nimport NileSlider from './nile-slider';\nimport { classMap } from 'lit/directives/class-map.js';\n\nexport const rangeSlider = (nileSlider: NileSlider): TemplateResult => {\n return html`\n <div>\n <nile-tooltip\n content=${nileSlider.rangeOneValue}\n placement=${nileSlider.tooltipPosition}\n >\n <div \n id=\"range-one\" \n class=\"range-button\"\n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=${nileSlider.minValue}\n aria-valuemax=${nileSlider.maxValue}\n aria-valuenow=${nileSlider.rangeOneValue}\n aria-label=\"Minimum value\"\n ></div>\n </nile-tooltip>\n <nile-tooltip\n content=${nileSlider.rangeTwoValue}\n placement=${nileSlider.tooltipPosition}\n >\n <div\n id=\"range-two\"\n class=\"range-button-two\"\n part=\"range-button-two\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=${nileSlider.minValue}\n aria-valuemax=${nileSlider.maxValue}\n aria-valuenow=${nileSlider.rangeTwoValue}\n aria-label=\"Maximum value\"\n ></div>\n </nile-tooltip>\n </div>\n `;\n};\n\nexport const singleSlider = (nileSlider: NileSlider): TemplateResult => {\n return html`\n <div>\n <nile-tooltip\n content=${nileSlider.value}\n placement=${nileSlider.tooltipPosition}\n >\n <div \n class=${classMap({\n 'range-button': true,\n 'range-button-active': nileSlider.activeThumb === 'one',\n })} \n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=${nileSlider.minValue}\n aria-valuemax=${nileSlider.maxValue}\n aria-valuenow=${nileSlider.value}\n aria-label=${nileSlider.ariaLabel || \"Slider value\"}\n ></div>\n </nile-tooltip>\n </div>\n `;\n};\n\n\nexport const lableContaier = (nileSlider: NileSlider): TemplateResult => {\n return html`\n <div part=\"label-container\" class=\"label-container\">\n <span id=\"label-start\">${nileSlider.labelStart}</span>\n <span id=\"label-end\">${nileSlider.labelEnd}</span>\n </div>\n `;\n};"],"names":["rangeSlider","nileSlider","html","_templateObject","_taggedTemplateLiteral","rangeOneValue","tooltipPosition","minValue","maxValue","rangeTwoValue","singleSlider","_templateObject2","value","classMap","activeThumb","ariaLabel","lableContaier","_templateObject3","labelStart","labelEnd"],"mappings":"ocAIaA,CAAAA,CAAeC,QAAfD,CAAAA,CAAAA,CAAeC,SACnBC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,m1BAGKH,CAAWI,CAAAA,aAAAA,CACTJ,CAAWK,CAAAA,eAAAA,CAQLL,CAAWM,CAAAA,QAAAA,CACXN,CAAWO,CAAAA,QAAAA,CACXP,CAAWI,CAAAA,aAAAA,CAKnBJ,CAAWQ,CAAAA,aAAAA,CACTR,CAAWK,CAAAA,eAAAA,CAQLL,CAAWM,CAAAA,QAAAA,CACXN,CAAWO,CAAAA,QAAAA,CACXP,CAAWQ,CAAAA,aAAAA,GAQxBC,EAAAA,OAAAA,KAAAA,CAAAA,CAAgBT,QAAhBS,CAAAA,CAAAA,CAAgBT,SACpBC,CAAAA,CAAI,CAAAS,gBAAA,GAAAA,gBAAA,CAAAP,sBAAA,iYAGKH,CAAWW,CAAAA,KAAAA,CACTX,CAAWK,CAAAA,eAAAA,CAGbO,CAAAA,CAAS,CACf,cAAA,CAAA,CAAgB,CAChB,CAAA,qBAAA,CAAkD,QAA3BZ,CAAWa,CAAAA,WAAAA,CAAAA,CAAAA,CAKpBb,CAAWM,CAAAA,QAAAA,CACXN,CAAWO,CAAAA,QAAAA,CACXP,CAAWW,CAAAA,KAAAA,CACdX,CAAAA,CAAWc,SAAa,EAAA,cAAA,GAQlCC,EAAAA,OAAAA,KAAAA,CAAAA,CAAiBf,QAAjBe,CAAAA,CAAAA,CAAiBf,SACrBC,CAAAA,CAAI,CAAAe,gBAAA,GAAAA,gBAAA,CAAAb,sBAAA,0KAEkBH,CAAWiB,CAAAA,UAAAA,CACbjB,CAAWkB,CAAAA,QAAAA"}
1
+ {"version":3,"file":"nile-slider.template.cjs.js","sources":["../../../src/nile-slider/nile-slider.template.ts"],"sourcesContent":["import { TemplateResult, html } from 'lit';\nimport NileSlider from './nile-slider';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { valueToPercent } from './utils/nile-slider.utils';\n\nconst tooltipDisabled = (nileSlider: NileSlider): boolean =>\n nileSlider.disabled || nileSlider.valueLabel !== 'tooltip';\n\nexport const rangeSlider = (nileSlider: NileSlider): TemplateResult => {\n return html`\n <div>\n <nile-tooltip\n content=${nileSlider.rangeOneValue}\n placement=${nileSlider.tooltipPosition}\n ?disabled=${tooltipDisabled(nileSlider)}\n >\n <div \n id=\"range-one\" \n class=\"range-button\"\n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=${nileSlider.minValue}\n aria-valuemax=${nileSlider.maxValue}\n aria-valuenow=${nileSlider.rangeOneValue}\n aria-label=\"Minimum value\"\n ></div>\n </nile-tooltip>\n <nile-tooltip\n content=${nileSlider.rangeTwoValue}\n placement=${nileSlider.tooltipPosition}\n ?disabled=${tooltipDisabled(nileSlider)}\n >\n <div\n id=\"range-two\"\n class=\"range-button-two\"\n part=\"range-button-two\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=${nileSlider.minValue}\n aria-valuemax=${nileSlider.maxValue}\n aria-valuenow=${nileSlider.rangeTwoValue}\n aria-label=\"Maximum value\"\n ></div>\n </nile-tooltip>\n </div>\n `;\n};\n\nexport const singleSlider = (nileSlider: NileSlider): TemplateResult => {\n return html`\n <div>\n <nile-tooltip\n content=${nileSlider.value}\n placement=${nileSlider.tooltipPosition}\n ?disabled=${tooltipDisabled(nileSlider)}\n >\n <div \n class=${classMap({\n 'range-button': true,\n 'range-button-active': nileSlider.activeThumb === 'one',\n })} \n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=${nileSlider.minValue}\n aria-valuemax=${nileSlider.maxValue}\n aria-valuenow=${nileSlider.value}\n aria-label=${nileSlider.ariaLabel || nileSlider.label || \"Slider value\"}\n ></div>\n </nile-tooltip>\n </div>\n `;\n};\n\n\nexport const lableContaier = (nileSlider: NileSlider): TemplateResult => {\n return html`\n <div part=\"label-container\" class=\"label-container\">\n <span id=\"label-start\">${nileSlider.labelStart}</span>\n <span id=\"label-end\">${nileSlider.labelEnd}</span>\n </div>\n `;\n};\n\n\nexport const fieldHeader = (nileSlider: NileSlider): TemplateResult => {\n return html`\n <div part=\"field-header\" class=\"field-header\">\n <label id=\"field-label\" part=\"field-label\" class=\"field-label\">\n ${nileSlider.label}\n </label>\n </div>\n `;\n};\n\n\nexport const bottomValueLabels = (nileSlider: NileSlider): TemplateResult => {\n if (!nileSlider.rangeSlider) {\n return html`\n <span\n part=\"value-label\"\n class=\"value-label\"\n style=\"left: ${valueToPercent(nileSlider.value, nileSlider)}%\"\n >${nileSlider.value}</span>\n `;\n }\n return html`\n <span\n part=\"value-label\"\n class=\"value-label\"\n style=\"left: ${valueToPercent(nileSlider.rangeOneValue, nileSlider)}%\"\n >${nileSlider.rangeOneValue}</span>\n <span\n part=\"value-label\"\n class=\"value-label\"\n style=\"left: ${valueToPercent(nileSlider.rangeTwoValue, nileSlider)}%\"\n >${nileSlider.rangeTwoValue}</span>\n `;\n};\n"],"names":["tooltipDisabled","nileSlider","disabled","valueLabel","rangeSlider","html","_templateObject","_taggedTemplateLiteral","rangeOneValue","tooltipPosition","minValue","maxValue","rangeTwoValue","singleSlider","_templateObject2","value","classMap","activeThumb","ariaLabel","label","lableContaier","_templateObject3","labelStart","labelEnd","fieldHeader","_templateObject4","bottomValueLabels","_templateObject5","valueToPercent","_templateObject6"],"mappings":"4lBAKMA,CAAAA,CAAmBC,QAAnBD,CAAAA,CAAAA,CAAmBC,CACvBA,QAAAA,CAAAA,CAAAA,CAAWC,UAAsC,SAA1BD,GAAAA,CAAAA,CAAWE,UAEvBC,GAAAA,OAAAA,KAAAA,CAAAA,CAAeH,QAAfG,CAAAA,CAAAA,CAAeH,SACnBI,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,i4BAGKN,CAAWO,CAAAA,aAAAA,CACTP,CAAWQ,CAAAA,eAAAA,CACXT,CAAgBC,CAAAA,CAAAA,CAAAA,CAQVA,CAAWS,CAAAA,QAAAA,CACXT,CAAWU,CAAAA,QAAAA,CACXV,CAAWO,CAAAA,aAAAA,CAKnBP,CAAWW,CAAAA,aAAAA,CACTX,CAAWQ,CAAAA,eAAAA,CACXT,CAAgBC,CAAAA,CAAAA,CAAAA,CAQVA,CAAWS,CAAAA,QAAAA,CACXT,CAAWU,CAAAA,QAAAA,CACXV,CAAWW,CAAAA,aAAAA,GAQxBC,EAAAA,OAAAA,KAAAA,CAAAA,CAAgBZ,QAAhBY,CAAAA,CAAAA,CAAgBZ,SACpBI,CAAAA,CAAI,CAAAS,gBAAA,GAAAA,gBAAA,CAAAP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