@unlk/keymaster 1.2.6 → 1.2.7

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Unlock Keymaster [object Object] v1.2.6 (https://unlock-com.github.io/keymaster)
2
+ * Unlock Keymaster [object Object] v1.2.7 (https://unlock-com.github.io/keymaster)
3
3
  * Copyright 2022-2025 Unlk Developers
4
4
  */
5
5
  (function (global, factory) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Unlock Keymaster [object Object] v1.2.6 (https://unlock-com.github.io/keymaster)
2
+ * Unlock Keymaster [object Object] v1.2.7 (https://unlock-com.github.io/keymaster)
3
3
  * Copyright 2022-2025 Unlk Developers
4
4
  */
5
5
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).keymaster={})}(this,function(e){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}),n}var i,s={exports:{}},o={exports:{}},r={exports:{}};function a(){return i||(i=1,function(e){e.exports=function(){const e=new Map,t={set(t,n,i){e.has(t)||e.set(t,new Map);const s=e.get(t);(s.has(n)||0===s.size)&&s.set(n,i)},get:(t,n)=>e.has(t)&&e.get(t).get(n)||null,remove(t,n){if(!e.has(t))return;const i=e.get(t);i.delete(n),0===i.size&&e.delete(t)}};return t}()}(r)),r.exports}var l,c={exports:{}},u={exports:{}};function d(){return l||(l=1,function(e,t){!function(e){const t=1e6,n=1e3,i="transitionend",s=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),o=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),r=e=>{do{e+=Math.floor(Math.random()*t)}while(document.getElementById(e));return e},a=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:i}=window.getComputedStyle(e);const s=Number.parseFloat(t),o=Number.parseFloat(i);return s||o?(t=t.split(",")[0],i=i.split(",")[0],(Number.parseFloat(t)+Number.parseFloat(i))*n):0},l=e=>{e.dispatchEvent(new Event(i))},c=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),u=e=>c(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(s(e)):null,d=e=>{if(!c(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t},h=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),f=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?f(e.parentNode):null},p=()=>{},g=e=>{e.offsetHeight},m=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,_=[],b=e=>{"loading"===document.readyState?(_.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of _)e()}),_.push(e)):e()},v=()=>"rtl"===document.documentElement.dir,y=e=>{b(()=>{const t=m();if(t){const n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=i,e.jQueryInterface)}})},w=(e,t=[],n=e)=>"function"==typeof e?e.call(...t):n,E=(e,t,n=!0)=>{if(!n)return void w(e);const s=5,o=a(t)+s;let r=!1;const c=({target:n})=>{n===t&&(r=!0,t.removeEventListener(i,c),w(e))};t.addEventListener(i,c),setTimeout(()=>{r||l(t)},o)},A=(e,t,n,i)=>{const s=e.length;let o=e.indexOf(t);return-1===o?!n&&i?e[s-1]:e[0]:(o+=n?1:-1,i&&(o=(o+s)%s),e[Math.max(0,Math.min(o,s-1))])};e.defineJQueryPlugin=y,e.execute=w,e.executeAfterTransition=E,e.findShadowRoot=f,e.getElement=u,e.getNextActiveElement=A,e.getTransitionDurationFromElement=a,e.getUID=r,e.getjQuery=m,e.isDisabled=h,e.isElement=c,e.isRTL=v,e.isVisible=d,e.noop=p,e.onDOMContentLoaded=b,e.parseSelector=s,e.reflow=g,e.toType=o,e.triggerTransitionEnd=l,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}(t)}(0,u.exports)),u.exports}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unlk/keymaster",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -12,6 +12,7 @@
12
12
  }
13
13
  }
14
14
 
15
+
15
16
  @each $color, $value in $theme-colors {
16
17
  .btn-link-#{$color} {
17
18
  @if $color == "action" {
@@ -21,9 +22,6 @@
21
22
  );
22
23
  }
23
24
  }
24
- }
25
-
26
- @each $color, $value in $theme-colors {
27
25
  .btn-#{$color} {
28
26
  @if $color == "secondary" {
29
27
  @include button-variant(
@@ -49,4 +47,77 @@
49
47
  );
50
48
  }
51
49
  }
50
+ .btn-icon-#{$color} {
51
+ @if $color == "secondary" {
52
+ @include button-icon-variant(
53
+ $value,
54
+ $value,
55
+ $hover-background: tint-color($value, $btn-hover-bg-shade-amount),
56
+ $hover-border: tint-color($value, $btn-hover-border-shade-amount),
57
+ $active-background: tint-color($value, $btn-active-bg-shade-amount),
58
+ $active-border: tint-color($value, $btn-active-border-shade-amount),
59
+ $disabled-color: $gray-950
60
+ );
61
+ } @else {
62
+ @include button-icon-variant(
63
+ $value,
64
+ $value,
65
+ $hover-background: shade-color($value, $btn-hover-bg-shade-amount),
66
+ $hover-border: shade-color($value, $btn-hover-border-shade-amount),
67
+ $active-background: shade-color($value, $btn-active-bg-shade-amount),
68
+ $active-border: shade-color($value, $btn-active-border-shade-amount),
69
+ $disabled-color: $white
70
+ );
71
+ }
72
+ }
73
+ .btn-icon-outline-#{$color} {
74
+ @include button-icon-outline-variant(
75
+ $value,
76
+ $value,
77
+ $hover-background: $value,
78
+ $hover-border: $value,
79
+ $active-background: shade-color($value, $btn-active-bg-shade-amount),
80
+ $active-border: shade-color($value, $btn-active-border-shade-amount),
81
+ $disabled-color: $white
82
+ );
83
+ }
84
+ }
85
+
86
+ [class*="btn-icon-"],
87
+ [class*="btn-icon-outline-"] {
88
+
89
+ &.btn-sm {
90
+ width: rfs-value(32px);
91
+ height: rfs-value(32px);
92
+ --#{$prefix}btn-padding-x: 0;
93
+ --#{$prefix}btn-padding-y: 0;
94
+ }
95
+
96
+ &.btn-lg {
97
+ width: rfs-value(48px);
98
+ height: rfs-value(48px);
99
+ }
100
+ }
101
+ .btn-sm {
102
+ > i + *,
103
+ > .icon + * {
104
+ margin-left: $spacer * .375;
105
+ }
106
+
107
+ > * + i,
108
+ > * + .icon {
109
+ margin-left: $spacer * .375;
110
+ }
111
+ }
112
+
113
+ .btn-lg {
114
+ > i + *,
115
+ > .icon + * {
116
+ margin-left: $spacer * .625;
117
+ }
118
+
119
+ > * + i,
120
+ > * + .icon {
121
+ margin-left: $spacer * .625;
122
+ }
52
123
  }
@@ -54,3 +54,69 @@
54
54
  --#{$prefix}btn-focus-shadow-rgb: #{to-rgb(mix(color-contrast($primary), $primary, 15%))};
55
55
  text-decoration: none;
56
56
  }
57
+
58
+ @mixin button-icon-variant(
59
+ $background,
60
+ $border,
61
+ $color: color-contrast($background),
62
+ $hover-background: if($color == $color-contrast-light, shade-color($background, $btn-hover-bg-shade-amount), tint-color($background, $btn-hover-bg-tint-amount)),
63
+ $hover-border: if($color == $color-contrast-light, shade-color($border, $btn-hover-border-shade-amount), tint-color($border, $btn-hover-border-tint-amount)),
64
+ $hover-color: color-contrast($hover-background),
65
+ $active-background: if($color == $color-contrast-light, shade-color($background, $btn-active-bg-shade-amount), tint-color($background, $btn-active-bg-tint-amount)),
66
+ $active-border: if($color == $color-contrast-light, shade-color($border, $btn-active-border-shade-amount), tint-color($border, $btn-active-border-tint-amount)),
67
+ $active-color: color-contrast($active-background),
68
+ $disabled-background: rgba($background, 1),
69
+ $disabled-border: rgba($border, 1),
70
+ $disabled-color: color-contrast($disabled-background)
71
+ ) {
72
+ width: rfs-value(40px);
73
+ height: rfs-value(40px);
74
+ line-height: 1;
75
+ text-align: center;
76
+ --#{$prefix}btn-padding-x: #{$spacer * .5};
77
+ --#{$prefix}btn-padding-y: #{$spacer * .5};
78
+ --#{$prefix}btn-color: #{$color};
79
+ --#{$prefix}btn-bg: #{$background};
80
+ --#{$prefix}btn-border-color: #{$border};
81
+ --#{$prefix}btn-border-radius: #{$btn-border-radius};
82
+ --#{$prefix}btn-hover-color: #{$hover-color};
83
+ --#{$prefix}btn-hover-bg: #{$hover-background};
84
+ --#{$prefix}btn-hover-border-color: #{$hover-border};
85
+ --#{$prefix}btn-active-color: #{$active-color};
86
+ --#{$prefix}btn-active-bg: #{$active-background};
87
+ --#{$prefix}btn-active-border-color: #{$active-border};
88
+ --#{$prefix}btn-disabled-color: #{$disabled-color};
89
+ --#{$prefix}btn-disabled-border-color: #{$disabled-border};
90
+ }
91
+
92
+ @mixin button-icon-outline-variant(
93
+ $border,
94
+ $color,
95
+ $hover-background: $color,
96
+ $hover-border: $color,
97
+ $hover-color: color-contrast($hover-background),
98
+ $active-background: if($color == $color-contrast-light, shade-color($background, $btn-active-bg-shade-amount), tint-color($background, $btn-active-bg-tint-amount)),
99
+ $active-border: if($color == $color-contrast-light, shade-color($border, $btn-active-border-shade-amount), tint-color($border, $btn-active-border-tint-amount)),
100
+ $active-color: color-contrast($active-background),
101
+ $disabled-background: transparent,
102
+ $disabled-border: rgba($border, 1),
103
+ $disabled-color: color-contrast($disabled-background)
104
+ ) {
105
+ width: rfs-value(40px);
106
+ height: rfs-value(40px);
107
+ line-height: 1;
108
+ --#{$prefix}btn-padding-x: #{$spacer * .5};
109
+ --#{$prefix}btn-padding-y: #{$spacer * .5};
110
+ --#{$prefix}btn-color: #{$color};
111
+ --#{$prefix}btn-bg: transparent;
112
+ --#{$prefix}btn-border-color: #{$border};
113
+ --#{$prefix}btn-border-radius: #{$btn-border-radius};
114
+ --#{$prefix}btn-hover-color: #{$hover-color};
115
+ --#{$prefix}btn-hover-bg: #{$hover-background};
116
+ --#{$prefix}btn-hover-border-color: #{$hover-border};
117
+ --#{$prefix}btn-active-color: #{$active-color};
118
+ --#{$prefix}btn-active-bg: #{$active-background};
119
+ --#{$prefix}btn-active-border-color: #{$active-border};
120
+ --#{$prefix}btn-disabled-color: #{$disabled-color};
121
+ --#{$prefix}btn-disabled-border-color: #{$disabled-border};
122
+ }