lightning_ui_kit 0.1.1 → 0.1.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.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/app/assets/builds/{lightning_ui.css → lightning_ui_kit.css} +0 -58
- data/app/assets/builds/{lightning_ui.js → lightning_ui_kit.js} +1 -1
- data/app/assets/builds/{lightning_ui.js.map → lightning_ui_kit.js.map} +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/alert_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/avatar_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/badge_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/banner_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/base_component.rb +2 -2
- data/app/components/{lightning_ui → lightning_ui_kit}/button_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/checkbox_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/description_list/item_component.rb +1 -1
- data/app/components/lightning_ui_kit/description_list_component.rb +5 -0
- data/app/components/lightning_ui_kit/dropdown/item_component.rb +5 -0
- data/app/components/{lightning_ui → lightning_ui_kit}/dropdown_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/input_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/link_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/modal_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/pagination_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/select_component.rb +1 -1
- data/app/components/lightning_ui_kit/sidebar_component.rb +4 -0
- data/app/components/{lightning_ui → lightning_ui_kit}/skeleton_component.rb +1 -1
- data/app/components/lightning_ui_kit/spinner_component.rb +4 -0
- data/app/components/{lightning_ui → lightning_ui_kit}/switch_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/table/action_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/table/column_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/table_component.rb +3 -3
- data/app/components/{lightning_ui → lightning_ui_kit}/text_component.rb +1 -1
- data/app/components/{lightning_ui → lightning_ui_kit}/textarea_component.rb +1 -1
- data/app/helpers/lightning_ui_kit/application_helper.rb +7 -0
- data/app/helpers/{lightning_ui → lightning_ui_kit}/heroicon_helper.rb +1 -1
- data/lib/{lightning_ui → lightning_ui_kit}/engine.rb +5 -5
- data/lib/lightning_ui_kit/version.rb +3 -0
- data/lib/lightning_ui_kit.rb +6 -0
- metadata +70 -71
- data/app/components/lightning_ui/description_list_component.rb +0 -5
- data/app/components/lightning_ui/dropdown/item_component.rb +0 -5
- data/app/components/lightning_ui/sidebar_component.rb +0 -4
- data/app/components/lightning_ui/spinner_component.rb +0 -4
- data/app/helpers/lightning_ui/application_helper.rb +0 -7
- data/lib/lightning_ui/version.rb +0 -3
- data/lib/lightning_ui.rb +0 -6
- data/lib/tasks/lightning_ui_tasks.rake +0 -4
- /data/app/assets/stylesheets/{lightning_ui → lightning_ui_kit}/application.css +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/alert_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/avatar_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/badge_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/banner_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/button_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/checkbox_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/description_list/item_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/description_list_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/dropdown_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/input_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/link_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/modal_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/pagination_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/select_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/sidebar_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/skeleton_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/spinner_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/switch_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/table_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/text_component.html.erb +0 -0
- /data/app/components/{lightning_ui → lightning_ui_kit}/textarea_component.html.erb +0 -0
- /data/app/javascript/{lightning_ui → lightning_ui_kit}/controllers/accordion_controller.js +0 -0
- /data/app/javascript/{lightning_ui → lightning_ui_kit}/controllers/banner_controller.js +0 -0
- /data/app/javascript/{lightning_ui → lightning_ui_kit}/controllers/checkbox_controller.js +0 -0
- /data/app/javascript/{lightning_ui → lightning_ui_kit}/controllers/clipboard_controller.js +0 -0
- /data/app/javascript/{lightning_ui → lightning_ui_kit}/controllers/dropdown_controller.js +0 -0
- /data/app/javascript/{lightning_ui → lightning_ui_kit}/controllers/main_controller.js +0 -0
- /data/app/javascript/{lightning_ui → lightning_ui_kit}/controllers/modal_controller.js +0 -0
- /data/app/javascript/{lightning_ui → lightning_ui_kit}/controllers/reveal_controller.js +0 -0
- /data/app/javascript/{lightning_ui → lightning_ui_kit}/controllers/switch_controller.js +0 -0
- /data/app/javascript/{lightning_ui → lightning_ui_kit}/index.js +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8836f59e031032030c582368a2e49051f6c0010e23100aa3f611e5336417e288
|
4
|
+
data.tar.gz: 803273fe377aa778ee04f23e941d79d49d7e54a1cfe444ddd3332f9dff483930
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e31e4ee4d0204d007c10a83881ff66fe32310565f92331a69cdb2c9b3d61b356c960cef83b7a24d494a4bc3fad2f4a4b22e04346f1dbf76d6aaa30534a91d43
|
7
|
+
data.tar.gz: a61fd2fa656943afe5dad28d0ef5107f93876a891e361763903911dafdb27740c72a7e1a6f5d7d1d7812df628bf4a9d246f3a1d5d0d9d337ef7b05a45512fdc3
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# LightningUiKit
|
2
2
|
UI components for fast prototyping in Rails applications.
|
3
3
|
|
4
4
|
## Usage
|
@@ -16,14 +16,14 @@ $ bundle
|
|
16
16
|
|
17
17
|
Add the following lines to your `application.html.erb` file:
|
18
18
|
```erb
|
19
|
-
<%= stylesheet_link_tag "
|
20
|
-
<%= javascript_include_tag "
|
19
|
+
<%= stylesheet_link_tag "lightning_ui_kit" %>
|
20
|
+
<%= javascript_include_tag "lightning_ui_kit" %>
|
21
21
|
```
|
22
22
|
|
23
23
|
Then you can use components in your views like this:
|
24
24
|
|
25
25
|
```erb
|
26
|
-
<%= render
|
26
|
+
<%= render LightningUiKit::ButtonComponent.new(text: "Click me!") %>
|
27
27
|
```
|
28
28
|
|
29
29
|
## Contributing
|
@@ -601,9 +601,6 @@
|
|
601
601
|
.mt-2 {
|
602
602
|
margin-top: calc(var(--spacing) * 2);
|
603
603
|
}
|
604
|
-
.mt-6 {
|
605
|
-
margin-top: calc(var(--spacing) * 6);
|
606
|
-
}
|
607
604
|
.mt-8 {
|
608
605
|
margin-top: calc(var(--spacing) * 8);
|
609
606
|
}
|
@@ -613,15 +610,9 @@
|
|
613
610
|
.mb-4 {
|
614
611
|
margin-bottom: calc(var(--spacing) * 4);
|
615
612
|
}
|
616
|
-
.ml-2 {
|
617
|
-
margin-left: calc(var(--spacing) * 2);
|
618
|
-
}
|
619
613
|
.block {
|
620
614
|
display: block;
|
621
615
|
}
|
622
|
-
.contents {
|
623
|
-
display: contents;
|
624
|
-
}
|
625
616
|
.flex {
|
626
617
|
display: flex;
|
627
618
|
}
|
@@ -786,12 +777,6 @@
|
|
786
777
|
.grid-cols-1 {
|
787
778
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
788
779
|
}
|
789
|
-
.grid-cols-2 {
|
790
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
791
|
-
}
|
792
|
-
.grid-cols-4 {
|
793
|
-
grid-template-columns: repeat(4, minmax(0, 1fr));
|
794
|
-
}
|
795
780
|
.grid-cols-\[1\.125rem_1fr\] {
|
796
781
|
grid-template-columns: 1.125rem 1fr;
|
797
782
|
}
|
@@ -828,15 +813,9 @@
|
|
828
813
|
.justify-items-center {
|
829
814
|
justify-items: center;
|
830
815
|
}
|
831
|
-
.gap-1 {
|
832
|
-
gap: calc(var(--spacing) * 1);
|
833
|
-
}
|
834
816
|
.gap-3 {
|
835
817
|
gap: calc(var(--spacing) * 3);
|
836
818
|
}
|
837
|
-
.gap-4 {
|
838
|
-
gap: calc(var(--spacing) * 4);
|
839
|
-
}
|
840
819
|
.gap-x-1\.5 {
|
841
820
|
column-gap: calc(var(--spacing) * 1.5);
|
842
821
|
}
|
@@ -856,13 +835,6 @@
|
|
856
835
|
margin-block-end: calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)));
|
857
836
|
}
|
858
837
|
}
|
859
|
-
.space-y-4 {
|
860
|
-
:where(& > :not(:last-child)) {
|
861
|
-
--tw-space-y-reverse: 0;
|
862
|
-
margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));
|
863
|
-
margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));
|
864
|
-
}
|
865
|
-
}
|
866
838
|
.gap-y-1 {
|
867
839
|
row-gap: calc(var(--spacing) * 1);
|
868
840
|
}
|
@@ -893,9 +865,6 @@
|
|
893
865
|
.rounded-md {
|
894
866
|
border-radius: var(--radius-md);
|
895
867
|
}
|
896
|
-
.rounded-xl {
|
897
|
-
border-radius: var(--radius-xl);
|
898
|
-
}
|
899
868
|
.rounded-t-3xl {
|
900
869
|
border-top-left-radius: var(--radius-3xl);
|
901
870
|
border-top-right-radius: var(--radius-3xl);
|
@@ -916,9 +885,6 @@
|
|
916
885
|
border-bottom-style: var(--tw-border-style);
|
917
886
|
border-bottom-width: 1px;
|
918
887
|
}
|
919
|
-
.border-amber-400 {
|
920
|
-
border-color: var(--color-amber-400);
|
921
|
-
}
|
922
888
|
.border-inherit {
|
923
889
|
border-color: inherit;
|
924
890
|
}
|
@@ -952,9 +918,6 @@
|
|
952
918
|
.bg-\(--btn-border\) {
|
953
919
|
background-color: var(--btn-border);
|
954
920
|
}
|
955
|
-
.bg-amber-50 {
|
956
|
-
background-color: var(--color-amber-50);
|
957
|
-
}
|
958
921
|
.bg-gray-50 {
|
959
922
|
background-color: var(--color-gray-50);
|
960
923
|
}
|
@@ -997,9 +960,6 @@
|
|
997
960
|
.fill-current {
|
998
961
|
fill: currentColor;
|
999
962
|
}
|
1000
|
-
.fill-yellow-500 {
|
1001
|
-
fill: var(--color-yellow-500);
|
1002
|
-
}
|
1003
963
|
.stroke-\(--checkbox-check\) {
|
1004
964
|
stroke: var(--checkbox-check);
|
1005
965
|
}
|
@@ -1021,9 +981,6 @@
|
|
1021
981
|
.p-\[5\%\] {
|
1022
982
|
padding: 5%;
|
1023
983
|
}
|
1024
|
-
.px-1\.5 {
|
1025
|
-
padding-inline: calc(var(--spacing) * 1.5);
|
1026
|
-
}
|
1027
984
|
.px-2 {
|
1028
985
|
padding-inline: calc(var(--spacing) * 2);
|
1029
986
|
}
|
@@ -1039,9 +996,6 @@
|
|
1039
996
|
.py-1 {
|
1040
997
|
padding-block: calc(var(--spacing) * 1);
|
1041
998
|
}
|
1042
|
-
.py-1\.5 {
|
1043
|
-
padding-block: calc(var(--spacing) * 1.5);
|
1044
|
-
}
|
1045
999
|
.py-2 {
|
1046
1000
|
padding-block: calc(var(--spacing) * 2);
|
1047
1001
|
}
|
@@ -1125,9 +1079,6 @@
|
|
1125
1079
|
.text-pretty {
|
1126
1080
|
text-wrap: pretty;
|
1127
1081
|
}
|
1128
|
-
.text-amber-600 {
|
1129
|
-
color: var(--color-amber-600);
|
1130
|
-
}
|
1131
1082
|
.text-gray-800 {
|
1132
1083
|
color: var(--color-gray-800);
|
1133
1084
|
}
|
@@ -1297,15 +1248,6 @@
|
|
1297
1248
|
.\[--switch\:white\] {
|
1298
1249
|
--switch: white;
|
1299
1250
|
}
|
1300
|
-
.\[callback\:\<function\>\] {
|
1301
|
-
callback: <function>;
|
1302
|
-
}
|
1303
|
-
.\[keys\:\<String\>\] {
|
1304
|
-
keys: <String>;
|
1305
|
-
}
|
1306
|
-
.\[option\:\[string\|object\|function\]\] {
|
1307
|
-
option: [string|object|function];
|
1308
|
-
}
|
1309
1251
|
.ring-inset {
|
1310
1252
|
--tw-ring-inset: inset;
|
1311
1253
|
}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
%o
|
4
4
|
|
5
5
|
%o`,t,e,s),(n=window.onerror)===null||n===void 0||n.call(window,t,"",0,0,e)}logFormattedMessage(e,t,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}};function wt(){return new Promise(r=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>r()):r()})}function At(r){return L(r,"classes").reduce((t,s)=>Object.assign(t,Tt(s)),{})}function Tt(r){return{[`${r}Class`]:{get(){let{classes:e}=this;if(e.has(r))return e.get(r);{let t=e.getAttributeName(r);throw new Error(`Missing attribute "${t}"`)}}},[`${r}Classes`]:{get(){return this.classes.getAll(r)}},[`has${B(r)}Class`]:{get(){return this.classes.has(r)}}}}function xt(r){return L(r,"outlets").reduce((t,s)=>Object.assign(t,Ft(s)),{})}function Be(r,e,t){return r.application.getControllerForElementAndIdentifier(e,t)}function Le(r,e,t){let s=Be(r,e,t);if(s||(r.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),s=Be(r,e,t),s))return s}function Ft(r){let e=X(r);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(r),s=this.outlets.getSelectorForOutletName(r);if(t){let n=Le(this,t,r);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(r);return t.length>0?t.map(s=>{let n=Le(this,s,r);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`,s)}).filter(s=>s):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(r),s=this.outlets.getSelectorForOutletName(r);if(t)return t;throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(r)}},[`has${B(e)}Outlet`]:{get(){return this.outlets.has(r)}}}}function Ct(r){return L(r,"targets").reduce((t,s)=>Object.assign(t,kt(s)),{})}function kt(r){return{[`${r}Target`]:{get(){let e=this.targets.find(r);if(e)return e;throw new Error(`Missing target element "${r}" for "${this.identifier}" controller`)}},[`${r}Targets`]:{get(){return this.targets.findAll(r)}},[`has${B(r)}Target`]:{get(){return this.targets.has(r)}}}}function Mt(r){let e=ht(r,"values"),t={valueDescriptorMap:{get(){return e.reduce((s,n)=>{let i=Ke(n,this.identifier),o=this.data.getAttributeNameForKey(i.key);return Object.assign(s,{[o]:i})},{})}}};return e.reduce((s,n)=>Object.assign(s,Nt(n)),t)}function Nt(r,e){let t=Ke(r,e),{key:s,name:n,reader:i,writer:o}=t;return{[n]:{get(){let c=this.data.get(s);return c!==null?i(c):t.defaultValue},set(c){c===void 0?this.data.delete(s):this.data.set(s,o(c))}},[`has${B(n)}`]:{get(){return this.data.has(s)||t.hasCustomDefaultValue}}}}function Ke([r,e],t){return Dt({controller:t,token:r,typeDefinition:e})}function Q(r){switch(r){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function $(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(r))return"array";if(Object.prototype.toString.call(r)==="[object Object]")return"object"}function $t(r){let{controller:e,token:t,typeObject:s}=r,n=ke(s.type),i=ke(s.default),o=n&&i,c=n&&!i,a=!n&&i,u=Q(s.type),A=$(r.typeObject.default);if(c)return u;if(a)return A;if(u!==A){let I=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${I}" must match the defined type "${u}". The provided default value of "${s.default}" is of type "${A}".`)}if(o)return u}function Bt(r){let{controller:e,token:t,typeDefinition:s}=r,i=$t({controller:e,token:t,typeObject:s}),o=$(s),c=Q(s),a=i||o||c;if(a)return a;let u=e?`${e}.${s}`:t;throw new Error(`Unknown value type "${u}" for "${t}" value`)}function Lt(r){let e=Q(r);if(e)return De[e];let t=ee(r,"default"),s=ee(r,"type"),n=r;if(t)return n.default;if(s){let{type:i}=n,o=Q(i);if(o)return De[o]}return r}function Dt(r){let{token:e,typeDefinition:t}=r,s=`${Ve(e)}-value`,n=Bt(r);return{type:n,key:s,name:ye(s),get defaultValue(){return Lt(t)},get hasCustomDefaultValue(){return $(t)!==void 0},reader:St[n],writer:Se[n]||Se.default}}var De={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},St={array(r){let e=JSON.parse(r);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${r}" of type "${$(e)}"`);return e},boolean(r){return!(r=="0"||String(r).toLowerCase()=="false")},number(r){return Number(r.replace(/_/g,""))},object(r){let e=JSON.parse(r);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${r}" of type "${$(e)}"`);return e},string(r){return r}},Se={default:jt,array:je,object:je};function je(r){return JSON.stringify(r)}function jt(r){return`${r}`}var l=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:s={},prefix:n=this.identifier,bubbles:i=!0,cancelable:o=!0}={}){let c=n?`${n}:${e}`:e,a=new CustomEvent(c,{detail:s,bubbles:i,cancelable:o});return t.dispatchEvent(a),a}};l.blessings=[At,Ct,Mt,xt];l.targets=[];l.outlets=[];l.values={};var D=class extends l{connect(){this.hasInputTarget&&(this.inputTarget.disabled=!0)}copy(r){if(r.preventDefault(),!this.hasInputTarget)return;let e=this.inputTarget.innerHTML||this.inputTarget.value;navigator.clipboard.writeText(e)}};d(D,"targets",["input"]);var S=class extends l{toggle(r){r.preventDefault();let e=this.controlTarget;e.dataset.checked?(this.fieldTarget.value=!1,delete e.dataset.checked):(this.fieldTarget.value=!0,e.dataset.checked=!0)}};d(S,"targets",["field","control"]);var J=class extends l{close(){this.element.classList.remove("opacity-100"),this.element.classList.add("opacity-0"),setTimeout(()=>{this.element.classList.add("hidden")},300)}};var G=class extends l{openModal(){this.findElement("lui-modal").open()}closeModal(){this.findElement("lui-modal").close()}findElement(r){let e=this.element.dataset.target.replace("#",""),t=document.getElementById(e);return this.application.getControllerForElementAndIdentifier(t,r)}};var j=class extends l{connect(){this.openItem(this.itemTargets[0])}toggle(r){r.preventDefault(),this.itemTargets.forEach(e=>{e.contains(r.target)?this.isOpen(e)?this.closeItem(e):this.openItem(e):this.closeItem(e)})}openItem(r){let e=r.querySelector("[data-accordion-target=content]");e.classList.remove("grid-rows-[0fr]"),e.classList.add("grid-rows-[1fr]"),e.classList.remove("opacity-0"),e.classList.add("opacity-100"),r.querySelector("[data-accordion-target=arrow]").classList.add("rotate-180")}closeItem(r){let e=r.querySelector("[data-accordion-target=content]");e.classList.remove("grid-rows-[1fr]"),e.classList.add("grid-rows-[0fr]"),e.classList.remove("opacity-100"),e.classList.add("opacity-0"),r.querySelector("[data-accordion-target=arrow]").classList.remove("rotate-180")}isOpen(r){return r.querySelector("[data-accordion-target=content]").classList.contains("grid-rows-[1fr]")}};d(j,"targets",["content","item"]);var x=class extends l{connect(){this.dialogTarget.addEventListener("click",this.onClick.bind(this)),this.openValue&&this.open()}disconnect(){this.dialogTarget.removeEventListener("click",this.onClick.bind(this))}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute("closing",""),Promise.all(this.dialogTarget.getAnimations().map(r=>r.finished)).then(()=>{this.dialogTarget.removeAttribute("closing"),this.dialogTarget.close()})}onClick(r){r.target===this.dialogTarget&&this.dialogTarget.close()}submitForm(){this.dialogTarget.querySelector("form").requestSubmit()}};d(x,"targets",["dialog"]),d(x,"values",{open:Boolean});var F=class extends l{connect(){this.initialShowValue||this.itemTargets.forEach(r=>{r.classList.add("hidden")})}toggle(r){r.preventDefault(),this.itemTargets.forEach(e=>{e.classList.toggle("hidden")})}};d(F,"targets",["item"]),d(F,"values",{initialShow:Boolean});var V=class extends l{toggle(r){r.preventDefault();let e=r.target;e.dataset.checked?(this.fieldTarget.value=!1,delete e.dataset.checked):(this.fieldTarget.value=!0,e.dataset.checked=!0)}};d(V,"targets",["field"]);var Ee=class extends l{};Ee.debounces=[];var Oe=class extends l{};Oe.throttles=[];var Vt={enterFromClass:"enter",enterActiveClass:"enterStart",enterToClass:"enterEnd",leaveFromClass:"leave",leaveActiveClass:"leaveStart",leaveToClass:"leaveEnd"},It={transitioned:!1,hiddenClass:"hidden",preserveOriginalClass:!0,removeToClasses:!0},_e=(r,e={})=>{var t,s,n;let i=r,o=i.element.dataset.transitionTarget,c;o&&(c=i[`${o}Target`]);let a=(e==null?void 0:e.element)||c||i.element;if(!(a instanceof HTMLElement||a instanceof SVGElement))return;let u=a.dataset,A=parseInt(u.leaveAfter||"")||e.leaveAfter||0,{transitioned:I,hiddenClass:m,preserveOriginalClass:we,removeToClasses:P}=Object.assign({},It,e),Ae=(t=i.enter)===null||t===void 0?void 0:t.bind(i),Te=(s=i.leave)===null||s===void 0?void 0:s.bind(i),xe=(n=i.toggleTransition)===null||n===void 0?void 0:n.bind(i);function K(h){return v(this,null,function*(){if(i.transitioned)return;i.transitioned=!0,Ae&&Ae(h);let f=y("enterFrom",e,u),E=y("enterActive",e,u),O=y("enterTo",e,u),w=y("leaveTo",e,u);m&&a.classList.remove(m),P||T(a,w),yield Ce(a,f,E,O,m,we,P),A>0&&setTimeout(()=>{k(h)},A)})}function k(h){return v(this,null,function*(){if(!i.transitioned)return;i.transitioned=!1,Te&&Te(h);let f=y("leaveFrom",e,u),E=y("leaveActive",e,u),O=y("leaveTo",e,u),w=y("enterTo",e,u);P||T(a,w),yield Ce(a,f,E,O,m,we,P),m&&a.classList.add(m)})}function Fe(h){xe&&xe(h),i.transitioned?k():K()}function Ce(h,f,E,O,w,qe,ze){return v(this,null,function*(){let M=[];qe&&(f.forEach(g=>h.classList.contains(g)&&g!==w&&M.push(g)),E.forEach(g=>h.classList.contains(g)&&g!==w&&M.push(g)),O.forEach(g=>h.classList.contains(g)&&g!==w&&M.push(g))),_(h,f),T(h,M),_(h,E),yield Kt(),T(h,f),_(h,O),yield Pt(h),T(h,E),ze&&T(h,O),_(h,M)})}function Re(){i.transitioned=I,I?(m&&a.classList.remove(m),K()):(m&&a.classList.add(m),k())}function _(h,f){f.length>0&&h.classList.add(...f)}function T(h,f){f.length>0&&h.classList.remove(...f)}return Re(),Object.assign(i,{enter:K,leave:k,toggleTransition:Fe}),[K,k,Fe]};function y(r,e,t){let s=`transition${r[0].toUpperCase()}${r.substr(1)}`,n=Vt[r],i=e[r]||t[s]||t[n]||" ";return _t(i)?[]:i.split(" ")}function Pt(r){return v(this,null,function*(){return new Promise(e=>{let t=Number(getComputedStyle(r).transitionDuration.split(",")[0].replace("s",""))*1e3;setTimeout(()=>{e(t)},t)})})}function Kt(){return v(this,null,function*(){return new Promise(r=>{requestAnimationFrame(()=>{requestAnimationFrame(r)})})})}function _t(r){return r.length===0||!r.trim()}var C=class extends l{connect(){_e(this,{element:this.menuTarget})}toggle(){this.toggleTransition()}hide(e){!this.element.contains(e.target)&&!this.menuTarget.classList.contains("hidden")&&this.leave()}};d(C,"targets",["menu"]);var b="lui",Ue=H.start();window.Stimulus=Ue;function Ut(r){r.register(`${b}-clipboard`,D),r.register(`${b}-checkbox`,S),r.register(`${b}-banner`,J),r.register(`${b}-main`,G),r.register(`${b}-accordion`,j),r.register(`${b}-modal`,x),r.register(`${b}-reveal`,F),r.register(`${b}-switch`,V),r.register(`${b}-dropdown`,C)}Ut(Ue);})();
|
6
|
-
//# sourceMappingURL=
|
6
|
+
//# sourceMappingURL=lightning_ui_kit.js.map
|