coveragebook_components 0.17.1 → 0.17.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/build/coco/coco.css +72 -32
- data/app/assets/build/coco/coco.js +111 -67
- data/app/components/coco/buttons/button_group/button_group.css +6 -0
- data/app/components/coco/buttons/button_group/button_group.rb +1 -0
- data/app/components/coco/concerns/acts_as_button_group.rb +5 -0
- data/app/components/coco/messaging/alert/alert.rb +5 -0
- data/app/components/coco/messaging/notice/notice.rb +8 -0
- data/app/components/coco/modals/modal_dialog/modal_dialog.css +27 -9
- data/app/components/coco/modals/modal_dialog/modal_dialog.html.erb +19 -10
- data/app/components/coco/modals/modal_dialog/modal_dialog.rb +5 -0
- data/app/helpers/coco/components_helper.rb +54 -54
- data/lib/coco.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fc0953881f78a258a61ca7b0f24ea84133a1f63046af384ea9d081cbc2db6d8
|
4
|
+
data.tar.gz: dfc32ff156d2b19aa5271e42a44c540e0337a9c1b0674d470e88e8b4c4e74845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4730eeebb41cd89b8bd77645fc50779339b83c3157bab022990d3bfcfcfae2a21b217d7f6d03f011830a6491623f5cfd8fe2529d4acf4625d878551ecf0a061
|
7
|
+
data.tar.gz: 3c0929b433a8eab7860b52107965f3cb7f5b481603e6d903cec8c2bf0554e2ee32f26cd0ac695a8074fceb6037682b413b89ab90957c8f28b2756e6be9785062
|
@@ -2241,6 +2241,10 @@ select{
|
|
2241
2241
|
border-color: rgb(209 213 219 / var(--tw-border-opacity))
|
2242
2242
|
}
|
2243
2243
|
|
2244
|
+
[data-coco][data-component="button-group"][data-reversed="true"] .button-group-buttons{
|
2245
|
+
flex-direction: row-reverse
|
2246
|
+
}
|
2247
|
+
|
2244
2248
|
[data-coco][data-component="button-group"][data-align="end"] .button-group-buttons{
|
2245
2249
|
margin-left: auto
|
2246
2250
|
}
|
@@ -4545,56 +4549,72 @@ select{
|
|
4545
4549
|
|
4546
4550
|
[data-coco][data-component="modal-dialog"]{
|
4547
4551
|
width: 100%;
|
4548
|
-
border-radius:
|
4552
|
+
border-radius: 2rem;
|
4553
|
+
--tw-bg-opacity: 1;
|
4554
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity))
|
4549
4555
|
}
|
4550
4556
|
|
4551
4557
|
.modal-frame [data-coco][data-component="modal-dialog"]{
|
4552
|
-
--tw-shadow: 0 25px
|
4553
|
-
--tw-shadow-colored: 0 25px
|
4554
|
-
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
|
4555
|
-
max-width: 42rem /* temp until sizes added */
|
4558
|
+
--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
|
4559
|
+
--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);
|
4560
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
|
4556
4561
|
}
|
4557
4562
|
|
4563
|
+
.modal-frame [data-coco][data-component="modal-dialog"][data-size="sm"] {
|
4564
|
+
max-width: 480px;
|
4565
|
+
}
|
4566
|
+
|
4567
|
+
.modal-frame [data-coco][data-component="modal-dialog"][data-size="md"] {
|
4568
|
+
max-width: 520px;
|
4569
|
+
}
|
4570
|
+
|
4571
|
+
.modal-frame [data-coco][data-component="modal-dialog"][data-size="lg"] {
|
4572
|
+
max-width: 640px;
|
4573
|
+
}
|
4574
|
+
|
4558
4575
|
[data-coco][data-component="modal-dialog"] .modal-dialog-header{
|
4559
|
-
|
4560
|
-
|
4561
|
-
align-items: center;
|
4562
|
-
height: 3.5rem;
|
4563
|
-
border-top-left-radius: 0.75rem;
|
4564
|
-
border-top-right-radius: 0.75rem;
|
4565
|
-
border-bottom-width: 1px;
|
4566
|
-
--tw-border-opacity: 1;
|
4567
|
-
border-color: rgb(209 213 219 / var(--tw-border-opacity));
|
4576
|
+
border-top-left-radius: 2rem;
|
4577
|
+
border-top-right-radius: 2rem;
|
4568
4578
|
--tw-bg-opacity: 1;
|
4569
4579
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
4570
4580
|
padding-left: 1rem;
|
4571
|
-
padding-right: 1rem
|
4581
|
+
padding-right: 1rem;
|
4582
|
+
padding-top: 1rem;
|
4583
|
+
padding-bottom: 1rem
|
4572
4584
|
}
|
4573
4585
|
|
4574
4586
|
@media (min-width: 576px){
|
4575
4587
|
|
4576
4588
|
[data-coco][data-component="modal-dialog"] .modal-dialog-header{
|
4577
|
-
|
4578
|
-
padding-
|
4579
|
-
padding-
|
4589
|
+
padding-left: 2.5rem;
|
4590
|
+
padding-right: 2.5rem;
|
4591
|
+
padding-top: 1.5rem;
|
4592
|
+
padding-bottom: 1.5rem
|
4580
4593
|
}
|
4581
4594
|
}
|
4582
4595
|
|
4596
|
+
[data-coco][data-component="modal-dialog"] .modal-dialog-header-container{
|
4597
|
+
position: relative;
|
4598
|
+
display: flex;
|
4599
|
+
height: 2.75rem;
|
4600
|
+
align-items: center
|
4601
|
+
}
|
4602
|
+
|
4583
4603
|
[data-coco][data-component="modal-dialog"] .modal-dialog-title{
|
4584
4604
|
width: 100%;
|
4585
4605
|
overflow: hidden;
|
4586
4606
|
text-overflow: ellipsis;
|
4587
4607
|
white-space: nowrap;
|
4588
4608
|
padding-right: 1.5rem;
|
4589
|
-
font-size:
|
4590
|
-
line-height:
|
4609
|
+
font-size: 20px;
|
4610
|
+
line-height: 24px;
|
4591
4611
|
font-weight: 700
|
4592
4612
|
}
|
4593
4613
|
|
4594
4614
|
[data-coco][data-component="modal-dialog"] .modal-dialog-close{
|
4595
4615
|
position: absolute;
|
4596
4616
|
top: 50%;
|
4597
|
-
right: 0.25rem;
|
4617
|
+
right: -0.25rem;
|
4598
4618
|
display: block;
|
4599
4619
|
flex: none;
|
4600
4620
|
--tw-translate-y: -50%;
|
@@ -4605,18 +4625,24 @@ select{
|
|
4605
4625
|
@media (min-width: 576px){
|
4606
4626
|
|
4607
4627
|
[data-coco][data-component="modal-dialog"] .modal-dialog-close{
|
4608
|
-
right: 0.
|
4628
|
+
right: -0.5rem
|
4609
4629
|
}
|
4610
4630
|
}
|
4611
4631
|
|
4612
4632
|
[data-coco][data-component="modal-dialog"] .modal-dialog-close{
|
4633
|
+
border-radius: 9999px;
|
4613
4634
|
--tw-text-opacity: 1;
|
4614
|
-
color: rgb(
|
4635
|
+
color: rgb(17 24 39 / var(--tw-text-opacity));
|
4636
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
4637
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
4638
|
+
transition-duration: 150ms
|
4615
4639
|
}
|
4616
4640
|
|
4617
4641
|
[data-coco][data-component="modal-dialog"] .modal-dialog-close:hover{
|
4642
|
+
--tw-bg-opacity: 1;
|
4643
|
+
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
4618
4644
|
--tw-text-opacity: 1;
|
4619
|
-
color: rgb(
|
4645
|
+
color: rgb(17 24 39 / var(--tw-text-opacity))
|
4620
4646
|
}
|
4621
4647
|
|
4622
4648
|
[data-coco][data-component="modal-dialog"] .modal-dialog-close:focus{
|
@@ -4627,23 +4653,37 @@ select{
|
|
4627
4653
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)
|
4628
4654
|
}
|
4629
4655
|
|
4656
|
+
[data-coco][data-component="modal-dialog"] .modal-dialog-notice [data-component="notice"]{
|
4657
|
+
margin-bottom: 1rem;
|
4658
|
+
padding-left: 1rem;
|
4659
|
+
padding-right: 1rem
|
4660
|
+
}
|
4661
|
+
|
4662
|
+
@media (min-width: 576px){
|
4663
|
+
|
4664
|
+
[data-coco][data-component="modal-dialog"] .modal-dialog-notice [data-component="notice"]{
|
4665
|
+
margin-bottom: 1.5rem;
|
4666
|
+
padding-left: 2.5rem;
|
4667
|
+
padding-right: 2.5rem
|
4668
|
+
}
|
4669
|
+
}
|
4670
|
+
|
4630
4671
|
[data-coco][data-component="modal-dialog"] .modal-dialog-content{
|
4631
|
-
border-radius:
|
4672
|
+
border-bottom-right-radius: 2rem;
|
4673
|
+
border-bottom-left-radius: 2rem;
|
4632
4674
|
--tw-bg-opacity: 1;
|
4633
|
-
background-color: rgb(
|
4675
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
4634
4676
|
padding-left: 1rem;
|
4635
4677
|
padding-right: 1rem;
|
4636
|
-
padding-
|
4637
|
-
padding-bottom: 1rem
|
4678
|
+
padding-bottom: 1.5rem
|
4638
4679
|
}
|
4639
4680
|
|
4640
4681
|
@media (min-width: 576px){
|
4641
4682
|
|
4642
4683
|
[data-coco][data-component="modal-dialog"] .modal-dialog-content{
|
4643
|
-
padding-left:
|
4644
|
-
padding-right:
|
4645
|
-
padding-
|
4646
|
-
padding-bottom: 1.5rem
|
4684
|
+
padding-left: 2.5rem;
|
4685
|
+
padding-right: 2.5rem;
|
4686
|
+
padding-bottom: 2rem
|
4647
4687
|
}
|
4648
4688
|
}
|
4649
4689
|
|
@@ -7176,6 +7176,7 @@ var require_module_cjs = __commonJS({
|
|
7176
7176
|
});
|
7177
7177
|
var module_exports = {};
|
7178
7178
|
__export2(module_exports, {
|
7179
|
+
Alpine: () => src_default,
|
7179
7180
|
default: () => module_default
|
7180
7181
|
});
|
7181
7182
|
module.exports = __toCommonJS(module_exports);
|
@@ -7262,6 +7263,24 @@ var require_module_cjs = __commonJS({
|
|
7262
7263
|
cleanup();
|
7263
7264
|
}];
|
7264
7265
|
}
|
7266
|
+
function watch(getter, callback) {
|
7267
|
+
let firstTime = true;
|
7268
|
+
let oldValue;
|
7269
|
+
let effectReference = effect(() => {
|
7270
|
+
let value = getter();
|
7271
|
+
JSON.stringify(value);
|
7272
|
+
if (!firstTime) {
|
7273
|
+
queueMicrotask(() => {
|
7274
|
+
callback(value, oldValue);
|
7275
|
+
oldValue = value;
|
7276
|
+
});
|
7277
|
+
} else {
|
7278
|
+
oldValue = value;
|
7279
|
+
}
|
7280
|
+
firstTime = false;
|
7281
|
+
});
|
7282
|
+
return () => release(effectReference);
|
7283
|
+
}
|
7265
7284
|
function dispatch(el, name, detail = {}) {
|
7266
7285
|
el.dispatchEvent(
|
7267
7286
|
new CustomEvent(name, {
|
@@ -7421,21 +7440,17 @@ var require_module_cjs = __commonJS({
|
|
7421
7440
|
observer.disconnect();
|
7422
7441
|
currentlyObserving = false;
|
7423
7442
|
}
|
7424
|
-
var
|
7425
|
-
var willProcessRecordQueue = false;
|
7443
|
+
var queuedMutations = [];
|
7426
7444
|
function flushObserver() {
|
7427
|
-
|
7428
|
-
|
7429
|
-
|
7430
|
-
|
7431
|
-
|
7432
|
-
|
7433
|
-
|
7434
|
-
|
7435
|
-
|
7436
|
-
function processRecordQueue() {
|
7437
|
-
onMutate(recordQueue);
|
7438
|
-
recordQueue.length = 0;
|
7445
|
+
let records = observer.takeRecords();
|
7446
|
+
queuedMutations.push(() => records.length > 0 && onMutate(records));
|
7447
|
+
let queueLengthWhenTriggered = queuedMutations.length;
|
7448
|
+
queueMicrotask(() => {
|
7449
|
+
if (queuedMutations.length === queueLengthWhenTriggered) {
|
7450
|
+
while (queuedMutations.length > 0)
|
7451
|
+
queuedMutations.shift()();
|
7452
|
+
}
|
7453
|
+
});
|
7439
7454
|
}
|
7440
7455
|
function mutateDom(callback) {
|
7441
7456
|
if (!currentlyObserving)
|
@@ -7460,16 +7475,16 @@ var require_module_cjs = __commonJS({
|
|
7460
7475
|
deferredMutations = deferredMutations.concat(mutations);
|
7461
7476
|
return;
|
7462
7477
|
}
|
7463
|
-
let addedNodes =
|
7464
|
-
let removedNodes =
|
7478
|
+
let addedNodes = /* @__PURE__ */ new Set();
|
7479
|
+
let removedNodes = /* @__PURE__ */ new Set();
|
7465
7480
|
let addedAttributes = /* @__PURE__ */ new Map();
|
7466
7481
|
let removedAttributes = /* @__PURE__ */ new Map();
|
7467
7482
|
for (let i2 = 0; i2 < mutations.length; i2++) {
|
7468
7483
|
if (mutations[i2].target._x_ignoreMutationObserver)
|
7469
7484
|
continue;
|
7470
7485
|
if (mutations[i2].type === "childList") {
|
7471
|
-
mutations[i2].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.
|
7472
|
-
mutations[i2].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.
|
7486
|
+
mutations[i2].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.add(node));
|
7487
|
+
mutations[i2].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.add(node));
|
7473
7488
|
}
|
7474
7489
|
if (mutations[i2].type === "attributes") {
|
7475
7490
|
let el = mutations[i2].target;
|
@@ -7502,7 +7517,7 @@ var require_module_cjs = __commonJS({
|
|
7502
7517
|
onAttributeAddeds.forEach((i2) => i2(el, attrs));
|
7503
7518
|
});
|
7504
7519
|
for (let node of removedNodes) {
|
7505
|
-
if (addedNodes.
|
7520
|
+
if (addedNodes.has(node))
|
7506
7521
|
continue;
|
7507
7522
|
onElRemoveds.forEach((i2) => i2(node));
|
7508
7523
|
destroyTree(node);
|
@@ -7512,7 +7527,7 @@ var require_module_cjs = __commonJS({
|
|
7512
7527
|
node._x_ignore = true;
|
7513
7528
|
});
|
7514
7529
|
for (let node of addedNodes) {
|
7515
|
-
if (removedNodes.
|
7530
|
+
if (removedNodes.has(node))
|
7516
7531
|
continue;
|
7517
7532
|
if (!node.isConnected)
|
7518
7533
|
continue;
|
@@ -7690,7 +7705,10 @@ var require_module_cjs = __commonJS({
|
|
7690
7705
|
}
|
7691
7706
|
}
|
7692
7707
|
function handleError(error2, el, expression = void 0) {
|
7693
|
-
Object.assign(
|
7708
|
+
error2 = Object.assign(
|
7709
|
+
error2 != null ? error2 : { message: "No error message given." },
|
7710
|
+
{ el, expression }
|
7711
|
+
);
|
7694
7712
|
console.warn(`Alpine Expression Error: ${error2.message}
|
7695
7713
|
|
7696
7714
|
${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
@@ -7806,9 +7824,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
7806
7824
|
return {
|
7807
7825
|
before(directive2) {
|
7808
7826
|
if (!directiveHandlers[directive2]) {
|
7809
|
-
console.warn(
|
7810
|
-
"Cannot find directive `${directive}`. `${name}` will use the default order of execution"
|
7811
|
-
);
|
7827
|
+
console.warn(String.raw`Cannot find directive \`${directive2}\`. \`${name}\` will use the default order of execution`);
|
7812
7828
|
return;
|
7813
7829
|
}
|
7814
7830
|
const pos = directiveOrder.indexOf(directive2);
|
@@ -8602,25 +8618,25 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
8602
8618
|
function entangle({ get: outerGet, set: outerSet }, { get: innerGet, set: innerSet }) {
|
8603
8619
|
let firstRun = true;
|
8604
8620
|
let outerHash;
|
8621
|
+
let innerHash;
|
8605
8622
|
let reference = effect(() => {
|
8606
|
-
|
8607
|
-
|
8623
|
+
let outer = outerGet();
|
8624
|
+
let inner = innerGet();
|
8608
8625
|
if (firstRun) {
|
8609
8626
|
innerSet(cloneIfObject(outer));
|
8610
8627
|
firstRun = false;
|
8611
|
-
outerHash = JSON.stringify(outer);
|
8612
8628
|
} else {
|
8613
|
-
|
8629
|
+
let outerHashLatest = JSON.stringify(outer);
|
8630
|
+
let innerHashLatest = JSON.stringify(inner);
|
8614
8631
|
if (outerHashLatest !== outerHash) {
|
8615
8632
|
innerSet(cloneIfObject(outer));
|
8616
|
-
|
8617
|
-
} else {
|
8633
|
+
} else if (outerHashLatest !== innerHashLatest) {
|
8618
8634
|
outerSet(cloneIfObject(inner));
|
8619
|
-
|
8635
|
+
} else {
|
8620
8636
|
}
|
8621
8637
|
}
|
8622
|
-
JSON.stringify(
|
8623
|
-
JSON.stringify(
|
8638
|
+
outerHash = JSON.stringify(outerGet());
|
8639
|
+
innerHash = JSON.stringify(innerGet());
|
8624
8640
|
});
|
8625
8641
|
return () => {
|
8626
8642
|
release(reference);
|
@@ -8729,7 +8745,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
8729
8745
|
get raw() {
|
8730
8746
|
return raw;
|
8731
8747
|
},
|
8732
|
-
version: "3.13.
|
8748
|
+
version: "3.13.5",
|
8733
8749
|
flushAndStopDeferringMutations,
|
8734
8750
|
dontAutoEvaluateFunctions,
|
8735
8751
|
disableEffectScheduling,
|
@@ -8782,31 +8798,24 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
8782
8798
|
// INTERNAL
|
8783
8799
|
bound: getBinding,
|
8784
8800
|
$data: scope,
|
8801
|
+
watch,
|
8785
8802
|
walk,
|
8786
8803
|
data,
|
8787
8804
|
bind: bind2
|
8788
8805
|
};
|
8789
8806
|
var alpine_default2 = Alpine3;
|
8790
|
-
var
|
8807
|
+
var import_reactivity10 = __toESM2(require_reactivity());
|
8791
8808
|
magic("nextTick", () => nextTick);
|
8792
8809
|
magic("dispatch", (el) => dispatch.bind(dispatch, el));
|
8793
|
-
magic("watch", (el, { evaluateLater: evaluateLater2,
|
8810
|
+
magic("watch", (el, { evaluateLater: evaluateLater2, cleanup }) => (key, callback) => {
|
8794
8811
|
let evaluate2 = evaluateLater2(key);
|
8795
|
-
let
|
8796
|
-
|
8797
|
-
|
8798
|
-
|
8799
|
-
|
8800
|
-
|
8801
|
-
|
8802
|
-
oldValue = value;
|
8803
|
-
});
|
8804
|
-
} else {
|
8805
|
-
oldValue = value;
|
8806
|
-
}
|
8807
|
-
firstTime = false;
|
8808
|
-
}));
|
8809
|
-
el._x_effects.delete(effectReference);
|
8812
|
+
let getter = () => {
|
8813
|
+
let value;
|
8814
|
+
evaluate2((i2) => value = i2);
|
8815
|
+
return value;
|
8816
|
+
};
|
8817
|
+
let unwatch = watch(getter, callback);
|
8818
|
+
cleanup(unwatch);
|
8810
8819
|
});
|
8811
8820
|
magic("store", getStores);
|
8812
8821
|
magic("data", (el) => scope(el));
|
@@ -8845,11 +8854,31 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
8845
8854
|
if (!el._x_ids[name])
|
8846
8855
|
el._x_ids[name] = findAndIncrementId(name);
|
8847
8856
|
}
|
8848
|
-
magic("id", (el) => (name, key = null) => {
|
8849
|
-
let
|
8850
|
-
|
8851
|
-
|
8857
|
+
magic("id", (el, { cleanup }) => (name, key = null) => {
|
8858
|
+
let cacheKey = `${name}${key ? `-${key}` : ""}`;
|
8859
|
+
return cacheIdByNameOnElement(el, cacheKey, cleanup, () => {
|
8860
|
+
let root = closestIdRoot(el, name);
|
8861
|
+
let id = root ? root._x_ids[name] : findAndIncrementId(name);
|
8862
|
+
return key ? `${name}-${id}-${key}` : `${name}-${id}`;
|
8863
|
+
});
|
8864
|
+
});
|
8865
|
+
interceptClone((from, to) => {
|
8866
|
+
if (from._x_id) {
|
8867
|
+
to._x_id = from._x_id;
|
8868
|
+
}
|
8852
8869
|
});
|
8870
|
+
function cacheIdByNameOnElement(el, cacheKey, cleanup, callback) {
|
8871
|
+
if (!el._x_id)
|
8872
|
+
el._x_id = {};
|
8873
|
+
if (el._x_id[cacheKey])
|
8874
|
+
return el._x_id[cacheKey];
|
8875
|
+
let output = callback();
|
8876
|
+
el._x_id[cacheKey] = output;
|
8877
|
+
cleanup(() => {
|
8878
|
+
delete el._x_id[cacheKey];
|
8879
|
+
});
|
8880
|
+
return output;
|
8881
|
+
}
|
8853
8882
|
magic("el", (el) => el);
|
8854
8883
|
warnMissingPluginMagic("Focus", "focus", "focus");
|
8855
8884
|
warnMissingPluginMagic("Persist", "persist", "persist");
|
@@ -9153,7 +9182,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
9153
9182
|
setValue(getInputValue(el, modifiers, e2, getValue()));
|
9154
9183
|
});
|
9155
9184
|
if (modifiers.includes("fill")) {
|
9156
|
-
if ([null, ""].includes(getValue()) || el.type === "checkbox" && Array.isArray(getValue())) {
|
9185
|
+
if ([void 0, null, ""].includes(getValue()) || el.type === "checkbox" && Array.isArray(getValue())) {
|
9157
9186
|
el.dispatchEvent(new Event(event, {}));
|
9158
9187
|
}
|
9159
9188
|
}
|
@@ -9618,6 +9647,11 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
9618
9647
|
let names = evaluate2(expression);
|
9619
9648
|
names.forEach((name) => setIdRoot(el, name));
|
9620
9649
|
});
|
9650
|
+
interceptClone((from, to) => {
|
9651
|
+
if (from._x_ids) {
|
9652
|
+
to._x_ids = from._x_ids;
|
9653
|
+
}
|
9654
|
+
});
|
9621
9655
|
mapAttributes(startingWith("@", into(prefix("on:"))));
|
9622
9656
|
directive("on", skipDuringClone((el, { value, modifiers, expression }, { cleanup }) => {
|
9623
9657
|
let evaluate2 = expression ? evaluateLater(el, expression) : () => {
|
@@ -9642,7 +9676,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
9642
9676
|
directive(directiveName, (el) => warn(`You can't use [x-${directiveName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el));
|
9643
9677
|
}
|
9644
9678
|
alpine_default2.setEvaluator(normalEvaluator);
|
9645
|
-
alpine_default2.setReactivityEngine({ reactive:
|
9679
|
+
alpine_default2.setReactivityEngine({ reactive: import_reactivity10.reactive, effect: import_reactivity10.effect, release: import_reactivity10.stop, raw: import_reactivity10.toRaw });
|
9646
9680
|
var src_default = alpine_default2;
|
9647
9681
|
var module_default = src_default;
|
9648
9682
|
}
|
@@ -9671,7 +9705,7 @@ var require_module_cjs2 = __commonJS({
|
|
9671
9705
|
var module_exports = {};
|
9672
9706
|
__export2(module_exports, {
|
9673
9707
|
default: () => module_default,
|
9674
|
-
morph: () =>
|
9708
|
+
morph: () => src_default
|
9675
9709
|
});
|
9676
9710
|
module.exports = __toCommonJS(module_exports);
|
9677
9711
|
function morph2(from, toHtml, options) {
|
@@ -10034,11 +10068,12 @@ var require_module_cjs3 = __commonJS({
|
|
10034
10068
|
var module_exports = {};
|
10035
10069
|
__export2(module_exports, {
|
10036
10070
|
default: () => module_default,
|
10071
|
+
mask: () => src_default,
|
10037
10072
|
stripDown: () => stripDown
|
10038
10073
|
});
|
10039
10074
|
module.exports = __toCommonJS(module_exports);
|
10040
10075
|
function src_default(Alpine3) {
|
10041
|
-
Alpine3.directive("mask", (el, { value, expression }, { effect, evaluateLater }) => {
|
10076
|
+
Alpine3.directive("mask", (el, { value, expression }, { effect, evaluateLater, cleanup }) => {
|
10042
10077
|
let templateFn = () => expression;
|
10043
10078
|
let lastInputValue = "";
|
10044
10079
|
queueMicrotask(() => {
|
@@ -10066,8 +10101,17 @@ var require_module_cjs3 = __commonJS({
|
|
10066
10101
|
if (el._x_model)
|
10067
10102
|
el._x_model.set(el.value);
|
10068
10103
|
});
|
10069
|
-
|
10070
|
-
|
10104
|
+
const controller = new AbortController();
|
10105
|
+
cleanup(() => {
|
10106
|
+
controller.abort();
|
10107
|
+
});
|
10108
|
+
el.addEventListener("input", () => processInputValue(el), {
|
10109
|
+
signal: controller.signal,
|
10110
|
+
// Setting this as a capture phase listener to ensure it runs
|
10111
|
+
// before wire:model or x-model added as a latent binding...
|
10112
|
+
capture: true
|
10113
|
+
});
|
10114
|
+
el.addEventListener("blur", () => processInputValue(el, false), { signal: controller.signal });
|
10071
10115
|
function processInputValue(el2, shouldRestoreCursor = true) {
|
10072
10116
|
let input = el2.value;
|
10073
10117
|
let template = templateFn(input);
|
@@ -15371,7 +15415,7 @@ var alpine_default = import_alpinejs.default;
|
|
15371
15415
|
// ../../../package.json
|
15372
15416
|
var package_default = {
|
15373
15417
|
name: "coveragebook-components",
|
15374
|
-
version: "0.17.
|
15418
|
+
version: "0.17.3",
|
15375
15419
|
repository: "git@github.com:coveragebook/coco.git",
|
15376
15420
|
license: "NO LICENSE",
|
15377
15421
|
author: "Mark Perkins <mark@coveragebook.com>",
|
@@ -15413,14 +15457,14 @@ var package_default = {
|
|
15413
15457
|
},
|
15414
15458
|
dependencies: {
|
15415
15459
|
"@alpinejs/focus": "^3.13.2",
|
15416
|
-
"@alpinejs/mask": "^3.13.
|
15417
|
-
"@alpinejs/morph": "^3.13.
|
15460
|
+
"@alpinejs/mask": "^3.13.5",
|
15461
|
+
"@alpinejs/morph": "^3.13.5",
|
15418
15462
|
"@jaames/iro": "^5.5.2",
|
15419
15463
|
"@percy/cli": "^1.27.3",
|
15420
15464
|
"@tailwindcss/container-queries": "^0.1.0",
|
15421
15465
|
"@tailwindcss/forms": "^0.5.6",
|
15422
15466
|
"alias-hq": "^6.2.2",
|
15423
|
-
alpinejs: "^3.13.
|
15467
|
+
alpinejs: "^3.13.5",
|
15424
15468
|
autoprefixer: "^10.4.16",
|
15425
15469
|
"container-query-polyfill": "^1.0.2",
|
15426
15470
|
del: "^7.1.0",
|
@@ -15430,14 +15474,14 @@ var package_default = {
|
|
15430
15474
|
"fast-sort": "^3.2.1",
|
15431
15475
|
husky: "^8.0.3",
|
15432
15476
|
"js-cookie": "^3.0.5",
|
15433
|
-
"lint-staged": "^15.2.
|
15477
|
+
"lint-staged": "^15.2.2",
|
15434
15478
|
"lodash.camelcase": "^4.3.0",
|
15435
15479
|
"lodash.kebabcase": "^4.1.1",
|
15436
15480
|
"lodash.keyby": "^4.6.0",
|
15437
15481
|
"lodash.mapvalues": "^4.6.0",
|
15438
15482
|
"lucide-static": "^0.303.0",
|
15439
15483
|
postcss: "^8.4.31",
|
15440
|
-
"postcss-cli": "^
|
15484
|
+
"postcss-cli": "^11.0.0",
|
15441
15485
|
"postcss-value-parser": "^4.2.0",
|
15442
15486
|
prettier: "^3.1.1",
|
15443
15487
|
"release-it": "^17.0.1",
|
@@ -5,6 +5,7 @@ module Coco
|
|
5
5
|
|
6
6
|
accepts_option :size, default: :default, private: true
|
7
7
|
accepts_option :theme, default: :primary, private: true
|
8
|
+
accepts_option :reversed, from: [true, false], default: false
|
8
9
|
accepts_option :segmented, from: [true, false], default: false
|
9
10
|
accepts_option :floating, from: [true, false], default: false
|
10
11
|
accepts_option :collapsible, from: [true, false, nil]
|
@@ -14,6 +14,7 @@ module Coco
|
|
14
14
|
renders_many :items, types: {
|
15
15
|
noop: -> {},
|
16
16
|
divider: ->(**kwargs) { tag.div(class: "divider") },
|
17
|
+
html: ->(&block) { block.call },
|
17
18
|
button: ->(*args, **kwargs, &block) { coco_button(*args, **button_kwargs(kwargs, :button), &block) },
|
18
19
|
menu_button: ->(*args, **kwargs, &block) { instantiate_button(:menu, *args, **kwargs, &block) },
|
19
20
|
color_picker_button: ->(*args, **kwargs, &block) { instantiate_button(:color_picker, *args, **kwargs, &block) },
|
@@ -45,6 +46,10 @@ module Coco
|
|
45
46
|
with_item_button(...)
|
46
47
|
end
|
47
48
|
|
49
|
+
def with_button_html(...)
|
50
|
+
with_item_html(...)
|
51
|
+
end
|
52
|
+
|
48
53
|
def with_menu_button(...)
|
49
54
|
with_item_menu_button(...)
|
50
55
|
end
|
@@ -1,28 +1,46 @@
|
|
1
1
|
@layer components {
|
2
2
|
[data-coco][data-component="modal-dialog"] {
|
3
|
-
@apply rounded-
|
3
|
+
@apply rounded-[2rem] w-full bg-background-light-1;
|
4
4
|
|
5
5
|
.modal-frame & {
|
6
|
-
@apply shadow-
|
7
|
-
|
6
|
+
@apply shadow-xl;
|
7
|
+
|
8
|
+
&[data-size="sm"] {
|
9
|
+
max-width: 480px;
|
10
|
+
}
|
11
|
+
|
12
|
+
&[data-size="md"] {
|
13
|
+
max-width: 520px;
|
14
|
+
}
|
15
|
+
|
16
|
+
&[data-size="lg"] {
|
17
|
+
max-width: 640px;
|
18
|
+
}
|
8
19
|
}
|
9
20
|
|
10
21
|
.modal-dialog-header {
|
11
|
-
@apply
|
12
|
-
|
22
|
+
@apply px-4 sm:px-10 py-4 sm:py-6 rounded-t-[2rem] bg-background-light-1;
|
23
|
+
}
|
24
|
+
|
25
|
+
.modal-dialog-header-container {
|
26
|
+
@apply relative flex items-center h-11;
|
13
27
|
}
|
14
28
|
|
15
29
|
.modal-dialog-title {
|
16
|
-
@apply text-
|
30
|
+
@apply text-heading-5 pr-6 w-full font-bold truncate;
|
17
31
|
}
|
18
32
|
|
19
33
|
.modal-dialog-close {
|
20
|
-
@apply flex-none block p-2 absolute top-1/2 right-1 sm
|
21
|
-
@apply focus:ring-0 focus:outline-none text-content-dark-
|
34
|
+
@apply flex-none block p-2 absolute top-1/2 -right-1 sm:-right-2 -translate-y-1/2;
|
35
|
+
@apply focus:ring-0 focus:outline-none text-content-dark-1 hover:text-content-dark-1 rounded-full hover:bg-coco-gray-100 transition-colors;
|
36
|
+
}
|
37
|
+
|
38
|
+
.modal-dialog-notice [data-component="notice"] {
|
39
|
+
@apply px-4 sm:px-10 mb-4 sm:mb-6;
|
22
40
|
}
|
23
41
|
|
24
42
|
.modal-dialog-content {
|
25
|
-
@apply px-4 sm:px-
|
43
|
+
@apply px-4 sm:px-10 pb-6 sm:pb-8 rounded-b-[2rem] bg-background-light-1;
|
26
44
|
}
|
27
45
|
|
28
46
|
.modal-dialog-header + .modal-dialog-content {
|
@@ -1,18 +1,27 @@
|
|
1
1
|
<%= render component_tag(x: {data: x_data("modalDialog")}) do %>
|
2
2
|
<% if header? %>
|
3
3
|
<header class="modal-dialog-header">
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
<div class="modal-dialog-header-container">
|
5
|
+
<% if title? %>
|
6
|
+
<h4 class="modal-dialog-title" data-role="title">
|
7
|
+
<%= title %>
|
8
|
+
</h4>
|
9
|
+
<% end %>
|
10
|
+
<% if dismissable? %>
|
11
|
+
<button type="button" class="modal-dialog-close" data-role="close" @click="close">
|
12
|
+
<%= coco_icon(:x, size: :md) %>
|
13
|
+
</button>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
14
16
|
</header>
|
15
17
|
<% end %>
|
18
|
+
|
19
|
+
<% if notice? %>
|
20
|
+
<div class="modal-dialog-notice">
|
21
|
+
<%= notice %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
|
16
25
|
<div class="modal-dialog-content">
|
17
26
|
<%= content %>
|
18
27
|
</div>
|
@@ -3,6 +3,11 @@ module Coco
|
|
3
3
|
include Concerns::AcceptsOptions
|
4
4
|
|
5
5
|
accepts_option :dismissable, from: [true, false], default: true
|
6
|
+
accepts_option :size, from: [:sm, :md, :lg], default: :md
|
7
|
+
|
8
|
+
renders_one :notice, ->(**kwargs) do
|
9
|
+
Coco::Notice.new(**kwargs, dismissable: false)
|
10
|
+
end
|
6
11
|
|
7
12
|
renders_one :title
|
8
13
|
|
@@ -23,40 +23,40 @@ module Coco
|
|
23
23
|
render(component, &block)
|
24
24
|
end
|
25
25
|
|
26
|
-
def coco_button_group(**, &
|
27
|
-
render
|
26
|
+
def coco_button_group(**, &)
|
27
|
+
render(Coco::ButtonGroup.new(**), &)
|
28
28
|
end
|
29
29
|
|
30
|
-
def coco_menu_button(**, &
|
31
|
-
render
|
30
|
+
def coco_menu_button(**, &)
|
31
|
+
render(Coco::MenuButton.new(**), &)
|
32
32
|
end
|
33
33
|
|
34
|
-
def coco_menu_item(type, **, &
|
35
|
-
render
|
34
|
+
def coco_menu_item(type, **, &)
|
35
|
+
render(coco_component("menu_items/#{type}", **), &)
|
36
36
|
end
|
37
37
|
|
38
|
-
def coco_confirm_button(href = nil, **, &
|
39
|
-
render
|
38
|
+
def coco_confirm_button(href = nil, **, &)
|
39
|
+
render(Coco::ConfirmButton.new(href: href, **), &)
|
40
40
|
end
|
41
41
|
|
42
|
-
def coco_color_picker_button(**, &
|
43
|
-
render
|
42
|
+
def coco_color_picker_button(**, &)
|
43
|
+
render(Coco::ColorPickerButton.new(**), &)
|
44
44
|
end
|
45
45
|
|
46
|
-
def coco_image_picker_button(**, &
|
47
|
-
render
|
46
|
+
def coco_image_picker_button(**, &)
|
47
|
+
render(Coco::ImagePickerButton.new(**), &)
|
48
48
|
end
|
49
49
|
|
50
|
-
def coco_layout_picker_button(**, &
|
51
|
-
render
|
50
|
+
def coco_layout_picker_button(**, &)
|
51
|
+
render(Coco::LayoutPickerButton.new(**), &)
|
52
52
|
end
|
53
53
|
|
54
|
-
def coco_toolbar(**, &
|
55
|
-
render
|
54
|
+
def coco_toolbar(**, &)
|
55
|
+
render(Coco::Toolbar.new(**), &)
|
56
56
|
end
|
57
57
|
|
58
|
-
def coco_option_bar(**, &
|
59
|
-
render
|
58
|
+
def coco_option_bar(**, &)
|
59
|
+
render(Coco::OptionBar.new(**), &)
|
60
60
|
end
|
61
61
|
|
62
62
|
# Embeds
|
@@ -72,16 +72,16 @@ module Coco
|
|
72
72
|
|
73
73
|
# Forms (WIP)
|
74
74
|
|
75
|
-
def coco_form_with(**, &
|
76
|
-
form_with(**, builder: Coco::AppFormBuilder, &
|
75
|
+
def coco_form_with(**, &)
|
76
|
+
form_with(**, builder: Coco::AppFormBuilder, &)
|
77
77
|
end
|
78
78
|
|
79
|
-
def coco_form_for(*, **, &
|
80
|
-
form_for(*, **, builder: Coco::AppFormBuilder, &
|
79
|
+
def coco_form_for(*, **, &)
|
80
|
+
form_for(*, **, builder: Coco::AppFormBuilder, &)
|
81
81
|
end
|
82
82
|
|
83
|
-
def coco_fields(**, &
|
84
|
-
fields(**, builder: Coco::AppFormBuilder, &
|
83
|
+
def coco_fields(**, &)
|
84
|
+
fields(**, builder: Coco::AppFormBuilder, &)
|
85
85
|
end
|
86
86
|
|
87
87
|
# Images
|
@@ -98,8 +98,8 @@ module Coco
|
|
98
98
|
render Coco::Avatar.new(src: src, name: name, **)
|
99
99
|
end
|
100
100
|
|
101
|
-
def coco_icon(icon_name = nil, **, &
|
102
|
-
render
|
101
|
+
def coco_icon(icon_name = nil, **, &)
|
102
|
+
render(Coco::Icon.new(name: icon_name, **), &)
|
103
103
|
end
|
104
104
|
|
105
105
|
# Indicators
|
@@ -132,45 +132,45 @@ module Coco
|
|
132
132
|
end
|
133
133
|
alias_method :space, :coco_spacer
|
134
134
|
|
135
|
-
def coco_stack(spacing: Coco::Spacer::DEFAULT, **, &
|
136
|
-
render
|
135
|
+
def coco_stack(spacing: Coco::Spacer::DEFAULT, **, &)
|
136
|
+
render(Coco::Stack.new(spacing:, **), &)
|
137
137
|
end
|
138
138
|
|
139
|
-
def coco_panel(**, &
|
140
|
-
render
|
139
|
+
def coco_panel(**, &)
|
140
|
+
render(Coco::Panel.new(**), &)
|
141
141
|
end
|
142
142
|
|
143
|
-
def coco_page(id, **, &
|
144
|
-
render
|
143
|
+
def coco_page(id, **, &)
|
144
|
+
render(Coco::Page.new(id: id, **), &)
|
145
145
|
end
|
146
146
|
|
147
147
|
# Messaging
|
148
148
|
|
149
|
-
def coco_notice(**, &
|
150
|
-
render
|
149
|
+
def coco_notice(**, &)
|
150
|
+
render(Coco::Notice.new(**), &)
|
151
151
|
end
|
152
152
|
|
153
|
-
def coco_snackbar(**, &
|
154
|
-
render
|
153
|
+
def coco_snackbar(**, &)
|
154
|
+
render(Coco::Snackbar.new(**), &)
|
155
155
|
end
|
156
156
|
|
157
|
-
def coco_toast(**, &
|
158
|
-
render
|
157
|
+
def coco_toast(**, &)
|
158
|
+
render(Coco::Toast.new(**), &)
|
159
159
|
end
|
160
160
|
|
161
|
-
def coco_system_banner(**, &
|
162
|
-
render
|
161
|
+
def coco_system_banner(**, &)
|
162
|
+
render(Coco::SystemBanner.new(**), &)
|
163
163
|
end
|
164
164
|
|
165
165
|
# Modals
|
166
166
|
|
167
|
-
def coco_modal(name = "default", **, &
|
168
|
-
render(Coco::Modal.new(name: name, **), &
|
167
|
+
def coco_modal(name = "default", **, &)
|
168
|
+
render(Coco::Modal.new(name: name, **), &)
|
169
169
|
end
|
170
170
|
|
171
|
-
def coco_modal_dialog(name = "default", **, &block)
|
171
|
+
def coco_modal_dialog(name = "default", size: :md, **, &block)
|
172
172
|
render(Coco::Modal.new(name: name, **)) do |modal|
|
173
|
-
modal.with_container_dialog(&block)
|
173
|
+
modal.with_container_dialog(size: size, &block)
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
@@ -220,30 +220,30 @@ module Coco
|
|
220
220
|
render(button, &block)
|
221
221
|
end
|
222
222
|
|
223
|
-
def coco_pager_button(direction, **, &
|
224
|
-
render
|
223
|
+
def coco_pager_button(direction, **, &)
|
224
|
+
render(Coco::PagerButton.new(direction:, **), &)
|
225
225
|
end
|
226
226
|
|
227
227
|
# Typography
|
228
228
|
|
229
|
-
def coco_prose(**, &
|
230
|
-
render
|
229
|
+
def coco_prose(**, &)
|
230
|
+
render(Coco::Prose.new(**), &)
|
231
231
|
end
|
232
232
|
|
233
|
-
def coco_seamless_textarea(**, &
|
234
|
-
render
|
233
|
+
def coco_seamless_textarea(**, &)
|
234
|
+
render(Coco::SeamlessTextarea.new(**), &)
|
235
235
|
end
|
236
236
|
|
237
237
|
# Utilties (internal)
|
238
238
|
|
239
|
-
def coco_placeholder(text_content = nil, **, &
|
240
|
-
render
|
239
|
+
def coco_placeholder(text_content = nil, **, &)
|
240
|
+
render(Coco::Placeholder.new(text_content:, **), &)
|
241
241
|
end
|
242
242
|
|
243
243
|
# General
|
244
244
|
|
245
|
-
def coco_tag(*, **, &
|
246
|
-
render
|
245
|
+
def coco_tag(*, **, &)
|
246
|
+
render(Coco::Tag.new(*, **), &)
|
247
247
|
end
|
248
248
|
|
249
249
|
def coco_component(name, *, **)
|
data/lib/coco.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coveragebook_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Perkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|