coveragebook_components 0.19.0 ā†’ 0.19.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb5049eeec9c70081fd0cc9fec4723e35da58b39e02597077cc1a20625370b8f
4
- data.tar.gz: c99db45370f570dd98fb3c67016925f7a1d6c950bbe1b446b3be253a6023ebe2
3
+ metadata.gz: 5070cfdd98c6756ccb797a78bd59629c232de7dffef0eb89159160c920a770b4
4
+ data.tar.gz: 26f34b06acd278881a4b3b3c661b746300b014eaf38e2b5d5703bdb4b91dc26c
5
5
  SHA512:
6
- metadata.gz: '09a1eb6b7ec6f403018617a0f2a9ae3a6a3947673756714a314a3372e20443ce1bea81eb9f8dd755b91fb401fdc3ee034a74280639d9fe15cfb8d0101e6f41a3'
7
- data.tar.gz: 805735413da217fedda4b939504d1b0f627effce246aea20fee7aa13ee65870b581060e5513c0a8f19938b089a064a08a83b58bf037a5037092628928a1cd497
6
+ metadata.gz: aa8823631eab711945f593fe35a9466ce68cccb1c950c5aef153305acd4b4d86e92633070a24fbd3b7f86cbcfaf59eb1d35cd5c77288075dd21e93be3c1587a2
7
+ data.tar.gz: 9bdfa43e88ccb8ad26b4f29e6138801f98d3af0c5514ede9b5a4b88c3753ec14afbff4b0f711abb96b02430b17ae60320beffa8a0c5868b2be52f77411d8e2ed
@@ -591,10 +591,165 @@ select{
591
591
  outline: 1px solid ButtonText;
592
592
  outline: 1px auto -webkit-focus-ring-color
593
593
  }
594
- :root {
594
+
595
+ :root{
596
+ --coco-colors-transparent: transparent;
597
+ --coco-colors-current: currentColor;
598
+ --coco-colors-black: #000000;
599
+ --coco-colors-white: #FFFFFF;
600
+ --coco-colors-gray-50: #F9FAFB;
601
+ --coco-colors-gray-100: #F3F4F6;
602
+ --coco-colors-gray-200: #E5E7EB;
603
+ --coco-colors-gray-300: #D1D5DB;
604
+ --coco-colors-gray-400: #9CA3AF;
605
+ --coco-colors-gray-500: #6B7280;
606
+ --coco-colors-gray-600: #4B5563;
607
+ --coco-colors-gray-700: #374151;
608
+ --coco-colors-gray-800: #1F2937;
609
+ --coco-colors-gray-900: #111827;
610
+ --coco-colors-green-50: #E8F3F1;
611
+ --coco-colors-green-100: #D1E7E2;
612
+ --coco-colors-green-200: #A3CFC5;
613
+ --coco-colors-green-300: #76B8AA;
614
+ --coco-colors-green-400: #48A08D;
615
+ --coco-colors-green-500: #1A8871;
616
+ --coco-colors-green-600: #137464;
617
+ --coco-colors-green-700: #0D6159;
618
+ --coco-colors-green-800: #084C4E;
619
+ --coco-colors-green-900: #013C43;
620
+ --coco-colors-red-50: #FEF2F2;
621
+ --coco-colors-red-100: #FEE2E2;
622
+ --coco-colors-red-200: #FECACA;
623
+ --coco-colors-red-300: #FCA5A5;
624
+ --coco-colors-red-400: #F87171;
625
+ --coco-colors-red-500: #EF4444;
626
+ --coco-colors-red-600: #DC2626;
627
+ --coco-colors-red-700: #B91C1C;
628
+ --coco-colors-red-800: #991B1B;
629
+ --coco-colors-red-900: #7F1D1D;
630
+ --coco-colors-amber-50: #FFFBEB;
631
+ --coco-colors-amber-100: #FEF3C7;
632
+ --coco-colors-amber-200: #FDE68A;
633
+ --coco-colors-amber-300: #FCD34D;
634
+ --coco-colors-amber-400: #FBBF24;
635
+ --coco-colors-amber-500: #F59E0B;
636
+ --coco-colors-amber-600: #D97706;
637
+ --coco-colors-amber-700: #B45309;
638
+ --coco-colors-amber-800: #92400E;
639
+ --coco-colors-amber-900: #78350F;
640
+ --coco-colors-blue-50: #F0F9FF;
641
+ --coco-colors-blue-100: #E0F2FE;
642
+ --coco-colors-blue-200: #BAE6FD;
643
+ --coco-colors-blue-300: #7DD3FC;
644
+ --coco-colors-blue-400: #38BDF8;
645
+ --coco-colors-blue-500: #0EA5E9;
646
+ --coco-colors-blue-600: #0284C7;
647
+ --coco-colors-blue-700: #0369A1;
648
+ --coco-colors-blue-800: #075985;
649
+ --coco-colors-blue-900: #0C4A6E;
650
+ --coco-colors-teal-50: #F0FDFA;
651
+ --coco-colors-teal-100: #CCFBF1;
652
+ --coco-colors-teal-200: #99F6E4;
653
+ --coco-colors-teal-300: #5EEAD4;
654
+ --coco-colors-teal-400: #2DD4BF;
655
+ --coco-colors-teal-500: #14B8A6;
656
+ --coco-colors-teal-600: #0D9488;
657
+ --coco-colors-teal-700: #0F766E;
658
+ --coco-colors-teal-800: #115E59;
659
+ --coco-colors-teal-900: #134E4A;
660
+ --coco-colors-primary-50: #E8F3F1;
661
+ --coco-colors-primary-100: #D1E7E2;
662
+ --coco-colors-primary-200: #A3CFC5;
663
+ --coco-colors-primary-300: #76B8AA;
664
+ --coco-colors-primary-400: #48A08D;
665
+ --coco-colors-primary-500: #1A8871;
666
+ --coco-colors-primary-600: #137464;
667
+ --coco-colors-primary-700: #0D6159;
668
+ --coco-colors-primary-800: #084C4E;
669
+ --coco-colors-primary-900: #013C43;
670
+ --coco-colors-positive-50: #E8F3F1;
671
+ --coco-colors-positive-100: #D1E7E2;
672
+ --coco-colors-positive-200: #A3CFC5;
673
+ --coco-colors-positive-300: #76B8AA;
674
+ --coco-colors-positive-400: #48A08D;
675
+ --coco-colors-positive-500: #1A8871;
676
+ --coco-colors-positive-600: #137464;
677
+ --coco-colors-positive-700: #0D6159;
678
+ --coco-colors-positive-800: #084C4E;
679
+ --coco-colors-positive-900: #013C43;
680
+ --coco-colors-negative-50: #FEF2F2;
681
+ --coco-colors-negative-100: #FEE2E2;
682
+ --coco-colors-negative-200: #FECACA;
683
+ --coco-colors-negative-300: #FCA5A5;
684
+ --coco-colors-negative-400: #F87171;
685
+ --coco-colors-negative-500: #EF4444;
686
+ --coco-colors-negative-600: #DC2626;
687
+ --coco-colors-negative-700: #B91C1C;
688
+ --coco-colors-negative-800: #991B1B;
689
+ --coco-colors-negative-900: #7F1D1D;
690
+ --coco-colors-warning-50: #FFFBEB;
691
+ --coco-colors-warning-100: #FEF3C7;
692
+ --coco-colors-warning-200: #FDE68A;
693
+ --coco-colors-warning-300: #FCD34D;
694
+ --coco-colors-warning-400: #FBBF24;
695
+ --coco-colors-warning-500: #F59E0B;
696
+ --coco-colors-warning-600: #D97706;
697
+ --coco-colors-warning-700: #B45309;
698
+ --coco-colors-warning-800: #92400E;
699
+ --coco-colors-warning-900: #78350F;
700
+ --coco-colors-info-50: #F0F9FF;
701
+ --coco-colors-info-100: #E0F2FE;
702
+ --coco-colors-info-200: #BAE6FD;
703
+ --coco-colors-info-300: #7DD3FC;
704
+ --coco-colors-info-400: #38BDF8;
705
+ --coco-colors-info-500: #0EA5E9;
706
+ --coco-colors-info-600: #0284C7;
707
+ --coco-colors-info-700: #0369A1;
708
+ --coco-colors-info-800: #075985;
709
+ --coco-colors-info-900: #0C4A6E;
710
+ --coco-colors-background-header: #427484;
711
+ --coco-colors-background-light-1: #FFFFFF;
712
+ --coco-colors-background-light-2: #F9FAFB;
713
+ --coco-colors-background-light-3: #F3F4F6;
714
+ --coco-colors-background-dark-1: #111827;
715
+ --coco-colors-background-dark-2: #1F2937;
716
+ --coco-colors-background-dark-3: #374151;
717
+ --coco-colors-background-primary: #1A8871;
718
+ --coco-colors-background-primary-light: #D1E7E2;
719
+ --coco-colors-background-negative: #DC2626;
720
+ --coco-colors-background-negative-light: #FEE2E2;
721
+ --coco-colors-background-warning: #F59E0B;
722
+ --coco-colors-background-warning-light: #FFFBEB;
723
+ --coco-colors-background-positive: #1A8871;
724
+ --coco-colors-background-positive-light: #D1E7E2;
725
+ --coco-colors-background-info: #0284C7;
726
+ --coco-colors-background-info-light: #E0F2FE;
727
+ --coco-colors-content-dark-1: #111827;
728
+ --coco-colors-content-dark-2: #1F2937;
729
+ --coco-colors-content-dark-3: #4B5563;
730
+ --coco-colors-content-dark-muted: #9CA3AF;
731
+ --coco-colors-content-light-1: #FFFFFF;
732
+ --coco-colors-content-light-2: #E5E7EB;
733
+ --coco-colors-content-light-muted: #9CA3AF;
734
+ --coco-colors-content-primary: #1A8871;
735
+ --coco-colors-content-primary-dark: #137464;
736
+ --coco-colors-content-primary-inverse: #76B8AA;
737
+ --coco-colors-content-primary-inverse-vivid: #009979;
738
+ --coco-colors-content-negative: #DC2626;
739
+ --coco-colors-content-negative-dark: #B91C1C;
740
+ --coco-colors-content-negative-inverse: #FCA5A5;
741
+ --coco-colors-content-warning: #D97706;
742
+ --coco-colors-content-warning-dark: #B45309;
743
+ --coco-colors-content-warning-inverse: #FCD34D;
744
+ --coco-colors-content-positive: #1A8871;
745
+ --coco-colors-content-positive-dark: #137464;
746
+ --coco-colors-content-positive-inverse: #76B8AA;
747
+ --coco-colors-content-info: #0284C7;
748
+ --coco-colors-content-info-dark: #0369A1;
749
+ --coco-colors-content-info-inverse: #7DD3FC;
595
750
  --snackbar-bottom-offset: 2rem;
596
- --app-height: 100%;
597
- }
751
+ --app-height: 100%
752
+ }
598
753
 
599
754
  html{
600
755
  scroll-behavior: smooth;
@@ -731,6 +886,10 @@ select{
731
886
  --tw-contain-style:
732
887
  }
733
888
 
889
+ :root {
890
+ --button-border-radius: 44px;
891
+ }
892
+
734
893
  .coco-button-wrapper{
735
894
  display: contents !important
736
895
  }
@@ -864,7 +1023,7 @@ select{
864
1023
  transition-property: all;
865
1024
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
866
1025
  transition-duration: 150ms;
867
- border-radius: 44px
1026
+ border-radius: var(--button-border-radius)
868
1027
  }
869
1028
 
870
1029
  [data-coco].coco-button[data-theme] .button-content{
@@ -2225,7 +2384,7 @@ select{
2225
2384
  [data-coco][data-component="button-group"] {
2226
2385
  width: -moz-fit-content;
2227
2386
  width: fit-content;
2228
- border-radius: 44px;
2387
+ border-radius: var(--button-border-radius);
2229
2388
  }
2230
2389
 
2231
2390
  [data-coco][data-component="button-group"][data-collapsible="true"]{
@@ -2345,6 +2504,10 @@ select{
2345
2504
  line-height: 16px
2346
2505
  }
2347
2506
 
2507
+ [data-coco][data-component="confirm-panel"] .coco-button {
2508
+ border-radius: var(--button-border-radius) !important;
2509
+ }
2510
+
2348
2511
  [data-coco][data-component="image-picker-button"]{
2349
2512
  display: contents
2350
2513
  }
@@ -2624,7 +2787,7 @@ select{
2624
2787
  background-color: rgba(0, 12, 39, 0.06);
2625
2788
  padding: 0.25rem;
2626
2789
 
2627
- border-radius: 44px;
2790
+ border-radius: var(--button-border-radius);
2628
2791
  width: -moz-fit-content;
2629
2792
  width: fit-content
2630
2793
  }
@@ -7280,112 +7280,6 @@ var require_module_cjs = __commonJS({
7280
7280
  });
7281
7281
  return () => release(effectReference);
7282
7282
  }
7283
- function dispatch(el, name, detail = {}) {
7284
- el.dispatchEvent(
7285
- new CustomEvent(name, {
7286
- detail,
7287
- bubbles: true,
7288
- // Allows events to pass the shadow DOM barrier.
7289
- composed: true,
7290
- cancelable: true
7291
- })
7292
- );
7293
- }
7294
- function walk(el, callback) {
7295
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
7296
- Array.from(el.children).forEach((el2) => walk(el2, callback));
7297
- return;
7298
- }
7299
- let skip = false;
7300
- callback(el, () => skip = true);
7301
- if (skip)
7302
- return;
7303
- let node = el.firstElementChild;
7304
- while (node) {
7305
- walk(node, callback, false);
7306
- node = node.nextElementSibling;
7307
- }
7308
- }
7309
- function warn(message, ...args) {
7310
- console.warn(`Alpine Warning: ${message}`, ...args);
7311
- }
7312
- var started = false;
7313
- function start() {
7314
- if (started)
7315
- warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");
7316
- started = true;
7317
- if (!document.body)
7318
- warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
7319
- dispatch(document, "alpine:init");
7320
- dispatch(document, "alpine:initializing");
7321
- startObservingMutations();
7322
- onElAdded((el) => initTree(el, walk));
7323
- onElRemoved((el) => destroyTree(el));
7324
- onAttributesAdded((el, attrs) => {
7325
- directives(el, attrs).forEach((handle) => handle());
7326
- });
7327
- let outNestedComponents = (el) => !closestRoot(el.parentElement, true);
7328
- Array.from(document.querySelectorAll(allSelectors().join(","))).filter(outNestedComponents).forEach((el) => {
7329
- initTree(el);
7330
- });
7331
- dispatch(document, "alpine:initialized");
7332
- }
7333
- var rootSelectorCallbacks = [];
7334
- var initSelectorCallbacks = [];
7335
- function rootSelectors() {
7336
- return rootSelectorCallbacks.map((fn) => fn());
7337
- }
7338
- function allSelectors() {
7339
- return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn());
7340
- }
7341
- function addRootSelector(selectorCallback) {
7342
- rootSelectorCallbacks.push(selectorCallback);
7343
- }
7344
- function addInitSelector(selectorCallback) {
7345
- initSelectorCallbacks.push(selectorCallback);
7346
- }
7347
- function closestRoot(el, includeInitSelectors = false) {
7348
- return findClosest(el, (element) => {
7349
- const selectors = includeInitSelectors ? allSelectors() : rootSelectors();
7350
- if (selectors.some((selector) => element.matches(selector)))
7351
- return true;
7352
- });
7353
- }
7354
- function findClosest(el, callback) {
7355
- if (!el)
7356
- return;
7357
- if (callback(el))
7358
- return el;
7359
- if (el._x_teleportBack)
7360
- el = el._x_teleportBack;
7361
- if (!el.parentElement)
7362
- return;
7363
- return findClosest(el.parentElement, callback);
7364
- }
7365
- function isRoot(el) {
7366
- return rootSelectors().some((selector) => el.matches(selector));
7367
- }
7368
- var initInterceptors = [];
7369
- function interceptInit(callback) {
7370
- initInterceptors.push(callback);
7371
- }
7372
- function initTree(el, walker = walk, intercept = () => {
7373
- }) {
7374
- deferHandlingDirectives(() => {
7375
- walker(el, (el2, skip) => {
7376
- intercept(el2, skip);
7377
- initInterceptors.forEach((i2) => i2(el2, skip));
7378
- directives(el2, el2.attributes).forEach((handle) => handle());
7379
- el2._x_ignore && skip();
7380
- });
7381
- });
7382
- }
7383
- function destroyTree(root, walker = walk) {
7384
- walker(root, (el) => {
7385
- cleanupAttributes(el);
7386
- cleanupElement(el);
7387
- });
7388
- }
7389
7283
  var onAttributeAddeds = [];
7390
7284
  var onElRemoveds = [];
7391
7285
  var onElAddeds = [];
@@ -7519,7 +7413,6 @@ var require_module_cjs = __commonJS({
7519
7413
  if (addedNodes.has(node))
7520
7414
  continue;
7521
7415
  onElRemoveds.forEach((i2) => i2(node));
7522
- destroyTree(node);
7523
7416
  }
7524
7417
  addedNodes.forEach((node) => {
7525
7418
  node._x_ignoreSelf = true;
@@ -7598,7 +7491,7 @@ var require_module_cjs = __commonJS({
7598
7491
  ) || objects[objects.length - 1];
7599
7492
  const descriptor = Object.getOwnPropertyDescriptor(target, name);
7600
7493
  if ((descriptor == null ? void 0 : descriptor.set) && (descriptor == null ? void 0 : descriptor.get))
7601
- return Reflect.set(target, name, value, thisProxy);
7494
+ return descriptor.set.call(thisProxy, value) || true;
7602
7495
  return Reflect.set(target, name, value);
7603
7496
  }
7604
7497
  };
@@ -7609,7 +7502,7 @@ var require_module_cjs = __commonJS({
7609
7502
  return acc;
7610
7503
  }, {});
7611
7504
  }
7612
- function initInterceptors2(data2) {
7505
+ function initInterceptors(data2) {
7613
7506
  let isObject2 = (val) => typeof val === "object" && !Array.isArray(val) && val !== null;
7614
7507
  let recurse = (obj, basePath = "") => {
7615
7508
  Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => {
@@ -7833,6 +7726,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
7833
7726
  }
7834
7727
  };
7835
7728
  }
7729
+ function directiveExists(name) {
7730
+ return Object.keys(directiveHandlers).includes(name);
7731
+ }
7836
7732
  function directives(el, attributes, originalAttributeOverride) {
7837
7733
  attributes = Array.from(attributes);
7838
7734
  if (el._x_virtualDirectives) {
@@ -7972,6 +7868,132 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
7972
7868
  let typeB = directiveOrder.indexOf(b2.type) === -1 ? DEFAULT : b2.type;
7973
7869
  return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);
7974
7870
  }
7871
+ function dispatch(el, name, detail = {}) {
7872
+ el.dispatchEvent(
7873
+ new CustomEvent(name, {
7874
+ detail,
7875
+ bubbles: true,
7876
+ // Allows events to pass the shadow DOM barrier.
7877
+ composed: true,
7878
+ cancelable: true
7879
+ })
7880
+ );
7881
+ }
7882
+ function walk(el, callback) {
7883
+ if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
7884
+ Array.from(el.children).forEach((el2) => walk(el2, callback));
7885
+ return;
7886
+ }
7887
+ let skip = false;
7888
+ callback(el, () => skip = true);
7889
+ if (skip)
7890
+ return;
7891
+ let node = el.firstElementChild;
7892
+ while (node) {
7893
+ walk(node, callback, false);
7894
+ node = node.nextElementSibling;
7895
+ }
7896
+ }
7897
+ function warn(message, ...args) {
7898
+ console.warn(`Alpine Warning: ${message}`, ...args);
7899
+ }
7900
+ var started = false;
7901
+ function start() {
7902
+ if (started)
7903
+ warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");
7904
+ started = true;
7905
+ if (!document.body)
7906
+ warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
7907
+ dispatch(document, "alpine:init");
7908
+ dispatch(document, "alpine:initializing");
7909
+ startObservingMutations();
7910
+ onElAdded((el) => initTree(el, walk));
7911
+ onElRemoved((el) => destroyTree(el));
7912
+ onAttributesAdded((el, attrs) => {
7913
+ directives(el, attrs).forEach((handle) => handle());
7914
+ });
7915
+ let outNestedComponents = (el) => !closestRoot(el.parentElement, true);
7916
+ Array.from(document.querySelectorAll(allSelectors().join(","))).filter(outNestedComponents).forEach((el) => {
7917
+ initTree(el);
7918
+ });
7919
+ dispatch(document, "alpine:initialized");
7920
+ setTimeout(() => {
7921
+ warnAboutMissingPlugins();
7922
+ });
7923
+ }
7924
+ var rootSelectorCallbacks = [];
7925
+ var initSelectorCallbacks = [];
7926
+ function rootSelectors() {
7927
+ return rootSelectorCallbacks.map((fn) => fn());
7928
+ }
7929
+ function allSelectors() {
7930
+ return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn());
7931
+ }
7932
+ function addRootSelector(selectorCallback) {
7933
+ rootSelectorCallbacks.push(selectorCallback);
7934
+ }
7935
+ function addInitSelector(selectorCallback) {
7936
+ initSelectorCallbacks.push(selectorCallback);
7937
+ }
7938
+ function closestRoot(el, includeInitSelectors = false) {
7939
+ return findClosest(el, (element) => {
7940
+ const selectors = includeInitSelectors ? allSelectors() : rootSelectors();
7941
+ if (selectors.some((selector) => element.matches(selector)))
7942
+ return true;
7943
+ });
7944
+ }
7945
+ function findClosest(el, callback) {
7946
+ if (!el)
7947
+ return;
7948
+ if (callback(el))
7949
+ return el;
7950
+ if (el._x_teleportBack)
7951
+ el = el._x_teleportBack;
7952
+ if (!el.parentElement)
7953
+ return;
7954
+ return findClosest(el.parentElement, callback);
7955
+ }
7956
+ function isRoot(el) {
7957
+ return rootSelectors().some((selector) => el.matches(selector));
7958
+ }
7959
+ var initInterceptors2 = [];
7960
+ function interceptInit(callback) {
7961
+ initInterceptors2.push(callback);
7962
+ }
7963
+ function initTree(el, walker = walk, intercept = () => {
7964
+ }) {
7965
+ deferHandlingDirectives(() => {
7966
+ walker(el, (el2, skip) => {
7967
+ intercept(el2, skip);
7968
+ initInterceptors2.forEach((i2) => i2(el2, skip));
7969
+ directives(el2, el2.attributes).forEach((handle) => handle());
7970
+ el2._x_ignore && skip();
7971
+ });
7972
+ });
7973
+ }
7974
+ function destroyTree(root, walker = walk) {
7975
+ walker(root, (el) => {
7976
+ cleanupAttributes(el);
7977
+ cleanupElement(el);
7978
+ });
7979
+ }
7980
+ function warnAboutMissingPlugins() {
7981
+ let pluginDirectives = [
7982
+ ["ui", "dialog", ["[x-dialog], [x-popover]"]],
7983
+ ["anchor", "anchor", ["[x-anchor]"]],
7984
+ ["sort", "sort", ["[x-sort]"]]
7985
+ ];
7986
+ pluginDirectives.forEach(([plugin2, directive2, selectors]) => {
7987
+ if (directiveExists(directive2))
7988
+ return;
7989
+ selectors.some((selector) => {
7990
+ if (document.querySelector(selector)) {
7991
+ warn(`found "${selector}", but missing ${plugin2} plugin`);
7992
+ return true;
7993
+ }
7994
+ });
7995
+ });
7996
+ }
7975
7997
  var tickStack = [];
7976
7998
  var isHolding = false;
7977
7999
  function nextTick(callback = () => {
@@ -8232,7 +8254,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8232
8254
  let carry = Promise.all([
8233
8255
  el2._x_hidePromise,
8234
8256
  ...(el2._x_hideChildren || []).map(hideAfterChildren)
8235
- ]).then(([i2]) => i2());
8257
+ ]).then(([i2]) => i2 == null ? void 0 : i2());
8236
8258
  delete el2._x_hidePromise;
8237
8259
  delete el2._x_hideChildren;
8238
8260
  return carry;
@@ -8663,7 +8685,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8663
8685
  if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") {
8664
8686
  stores[name].init();
8665
8687
  }
8666
- initInterceptors2(stores[name]);
8688
+ initInterceptors(stores[name]);
8667
8689
  }
8668
8690
  function getStores() {
8669
8691
  return stores;
@@ -8745,7 +8767,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8745
8767
  get raw() {
8746
8768
  return raw;
8747
8769
  },
8748
- version: "3.13.8",
8770
+ version: "3.14.1",
8749
8771
  flushAndStopDeferringMutations,
8750
8772
  dontAutoEvaluateFunctions,
8751
8773
  disableEffectScheduling,
@@ -8951,8 +8973,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8951
8973
  };
8952
8974
  mutateDom(() => {
8953
8975
  placeInDom(clone2, target, modifiers);
8954
- initTree(clone2);
8955
- clone2._x_ignore = true;
8976
+ skipDuringClone(() => {
8977
+ initTree(clone2);
8978
+ clone2._x_ignore = true;
8979
+ })();
8956
8980
  });
8957
8981
  el._x_teleportPutBack = () => {
8958
8982
  let target2 = getTarget(expression);
@@ -9022,10 +9046,12 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9022
9046
  e2.stopPropagation();
9023
9047
  next(e2);
9024
9048
  });
9025
- if (modifiers.includes("self"))
9049
+ if (modifiers.includes("once")) {
9026
9050
  handler4 = wrapHandler(handler4, (next, e2) => {
9027
- e2.target === el && next(e2);
9051
+ next(e2);
9052
+ listenerTarget.removeEventListener(event, handler4, options);
9028
9053
  });
9054
+ }
9029
9055
  if (modifiers.includes("away") || modifiers.includes("outside")) {
9030
9056
  listenerTarget = document;
9031
9057
  handler4 = wrapHandler(handler4, (next, e2) => {
@@ -9040,20 +9066,18 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9040
9066
  next(e2);
9041
9067
  });
9042
9068
  }
9043
- if (modifiers.includes("once")) {
9069
+ if (modifiers.includes("self"))
9044
9070
  handler4 = wrapHandler(handler4, (next, e2) => {
9045
- next(e2);
9046
- listenerTarget.removeEventListener(event, handler4, options);
9071
+ e2.target === el && next(e2);
9047
9072
  });
9048
- }
9049
- handler4 = wrapHandler(handler4, (next, e2) => {
9050
- if (isKeyEvent(event)) {
9073
+ if (isKeyEvent(event) || isClickEvent(event)) {
9074
+ handler4 = wrapHandler(handler4, (next, e2) => {
9051
9075
  if (isListeningForASpecificKeyThatHasntBeenPressed(e2, modifiers)) {
9052
9076
  return;
9053
9077
  }
9054
- }
9055
- next(e2);
9056
- });
9078
+ next(e2);
9079
+ });
9080
+ }
9057
9081
  listenerTarget.addEventListener(event, handler4, options);
9058
9082
  return () => {
9059
9083
  listenerTarget.removeEventListener(event, handler4, options);
@@ -9078,9 +9102,12 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9078
9102
  function isKeyEvent(event) {
9079
9103
  return ["keydown", "keyup"].includes(event);
9080
9104
  }
9105
+ function isClickEvent(event) {
9106
+ return ["contextmenu", "click", "mouse"].some((i2) => event.includes(i2));
9107
+ }
9081
9108
  function isListeningForASpecificKeyThatHasntBeenPressed(e2, modifiers) {
9082
9109
  let keyModifiers = modifiers.filter((i2) => {
9083
- return !["window", "document", "prevent", "stop", "once", "capture"].includes(i2);
9110
+ return !["window", "document", "prevent", "stop", "once", "capture", "self", "away", "outside", "passive"].includes(i2);
9084
9111
  });
9085
9112
  if (keyModifiers.includes("debounce")) {
9086
9113
  let debounceIndex = keyModifiers.indexOf("debounce");
@@ -9104,6 +9131,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9104
9131
  return e2[`${modifier}Key`];
9105
9132
  });
9106
9133
  if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {
9134
+ if (isClickEvent(e2.type))
9135
+ return false;
9107
9136
  if (keyToModifiers(e2.key).includes(keyModifiers[0]))
9108
9137
  return false;
9109
9138
  }
@@ -9126,6 +9155,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9126
9155
  "left": "arrow-left",
9127
9156
  "right": "arrow-right",
9128
9157
  "period": ".",
9158
+ "comma": ",",
9129
9159
  "equal": "=",
9130
9160
  "minus": "-",
9131
9161
  "underscore": "_"
@@ -9180,7 +9210,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9180
9210
  setValue(getInputValue(el, modifiers, e2, getValue()));
9181
9211
  });
9182
9212
  if (modifiers.includes("fill")) {
9183
- if ([void 0, null, ""].includes(getValue()) || el.type === "checkbox" && Array.isArray(getValue())) {
9213
+ if ([void 0, null, ""].includes(getValue()) || el.type === "checkbox" && Array.isArray(getValue()) || el.tagName.toLowerCase() === "select" && el.multiple) {
9184
9214
  setValue(
9185
9215
  getInputValue(el, modifiers, { target: el }, getValue())
9186
9216
  );
@@ -9192,7 +9222,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9192
9222
  cleanup(() => el._x_removeModelListeners["default"]());
9193
9223
  if (el.form) {
9194
9224
  let removeResetListener = on(el.form, "reset", [], (e2) => {
9195
- nextTick(() => el._x_model && el._x_model.set(el.value));
9225
+ nextTick(() => el._x_model && el._x_model.set(getInputValue(el, modifiers, { target: el }, getValue())));
9196
9226
  });
9197
9227
  cleanup(() => removeResetListener());
9198
9228
  }
@@ -9232,7 +9262,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9232
9262
  } else {
9233
9263
  newValue = event.target.value;
9234
9264
  }
9235
- return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
9265
+ return event.target.checked ? currentValue.includes(newValue) ? currentValue : currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
9236
9266
  } else {
9237
9267
  return event.target.checked;
9238
9268
  }
@@ -9371,7 +9401,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9371
9401
  data2 = {};
9372
9402
  injectMagics(data2, el);
9373
9403
  let reactiveData = reactive(data2);
9374
- initInterceptors2(reactiveData);
9404
+ initInterceptors(reactiveData);
9375
9405
  let undo = addScopeToNode(el, reactiveData);
9376
9406
  reactiveData["init"] && evaluate(el, reactiveData["init"]);
9377
9407
  cleanup(() => {
@@ -11419,6 +11449,8 @@ var require_tokens = __commonJS({
11419
11449
  900: "#134E4A"
11420
11450
  }
11421
11451
  };
11452
+ var { coco, ...colorVariables } = colors;
11453
+ colorVariables.gray = colors.coco.gray;
11422
11454
  var colorAliases = {
11423
11455
  primary: {
11424
11456
  ...colors.green
@@ -11569,6 +11601,16 @@ var require_tokens = __commonJS({
11569
11601
  displaySans: "proxima-nova",
11570
11602
  bodySans: "proxima-nova",
11571
11603
  displaySerif: "merriweather"
11604
+ },
11605
+ variables: {
11606
+ DEFAULT: {
11607
+ coco: {
11608
+ colors: {
11609
+ ...colorVariables,
11610
+ ...colorAliases
11611
+ }
11612
+ }
11613
+ }
11572
11614
  }
11573
11615
  };
11574
11616
  }
@@ -15296,7 +15338,7 @@ var alpine_default = import_alpinejs.default;
15296
15338
  // ../../../package.json
15297
15339
  var package_default = {
15298
15340
  name: "coveragebook-components",
15299
- version: "0.19.0",
15341
+ version: "0.19.2",
15300
15342
  repository: "git@github.com:coveragebook/coco.git",
15301
15343
  license: "NO LICENSE",
15302
15344
  author: "Mark Perkins <mark@coveragebook.com>",
@@ -15311,9 +15353,10 @@ var package_default = {
15311
15353
  "css:build": "postcss ./app/assets/css/coco.css -d ./app/assets/build/coco",
15312
15354
  "css:dev": "postcss ./app/assets/css/coco.css -d ./app/assets/build/coco/dev",
15313
15355
  "css:watch": "postcss ./app/assets/css/coco.css -d ./app/assets/build/coco/dev --watch",
15314
- "js:build": "node esbuild.config.mjs",
15315
- "js:dev": "node esbuild.config.mjs --dev",
15316
- "js:watch": "node esbuild.config.mjs --watch",
15356
+ "js:build": "node esbuild.mjs",
15357
+ "js:dev": "node esbuild.mjs --dev",
15358
+ "js:watch": "node esbuild.mjs --watch",
15359
+ "js:analyse": "node lib/scripts/esbuild-meta.mjs",
15317
15360
  "lint:fix": "bundle exec standardrb --fix && prettier --write .",
15318
15361
  "lookbook:build": "cd lookbook && npm run build",
15319
15362
  prepare: "husky install",
@@ -15338,14 +15381,14 @@ var package_default = {
15338
15381
  },
15339
15382
  dependencies: {
15340
15383
  "@alpinejs/focus": "^3.13.2",
15341
- "@alpinejs/mask": "^3.13.5",
15384
+ "@alpinejs/mask": "^3.14.1",
15342
15385
  "@alpinejs/morph": "^3.13.5",
15343
15386
  "@jaames/iro": "^5.5.2",
15344
15387
  "@percy/cli": "^1.28.8",
15345
15388
  "@tailwindcss/container-queries": "^0.1.0",
15346
15389
  "@tailwindcss/forms": "^0.5.6",
15347
15390
  "alias-hq": "^6.2.2",
15348
- alpinejs: "^3.13.8",
15391
+ alpinejs: "^3.14.1",
15349
15392
  autoprefixer: "^10.4.16",
15350
15393
  "container-query-polyfill": "^1.0.2",
15351
15394
  del: "^7.1.0",
@@ -15364,7 +15407,7 @@ var package_default = {
15364
15407
  postcss: "^8.4.38",
15365
15408
  "postcss-cli": "^11.0.0",
15366
15409
  "postcss-value-parser": "^4.2.0",
15367
- prettier: "^3.2.5",
15410
+ prettier: "^3.3.3",
15368
15411
  "release-it": "^17.2.1",
15369
15412
  svgo: "^3.0.2",
15370
15413
  tailwindcss: "^3.4.3",
@@ -15390,6 +15433,9 @@ var package_default = {
15390
15433
  "after:version:bump": "bundle exec rake coco:gem:bump_version[${version}] && bundle && cd lookbook && bundle",
15391
15434
  "after:release": "rake coco:gem:release[${version}]"
15392
15435
  }
15436
+ },
15437
+ devDependencies: {
15438
+ "@mertasan/tailwindcss-variables": "^2.7.0"
15393
15439
  }
15394
15440
  };
15395
15441
 
@@ -1,4 +1,8 @@
1
1
  @layer components {
2
+ :root {
3
+ --button-border-radius: 44px;
4
+ }
5
+
2
6
  .coco-button-wrapper {
3
7
  @apply !contents;
4
8
  }
@@ -83,7 +87,7 @@
83
87
 
84
88
  &[data-theme] {
85
89
  @apply transition-all overflow-hidden;
86
- border-radius: 44px;
90
+ border-radius: var(--button-border-radius);
87
91
 
88
92
  .button-content {
89
93
  @apply font-semibold;
@@ -1,7 +1,7 @@
1
1
  @layer components {
2
2
  [data-coco][data-component="button-group"] {
3
3
  width: fit-content;
4
- border-radius: 44px;
4
+ border-radius: var(--button-border-radius);
5
5
 
6
6
  &[data-collapsible="true"] {
7
7
  @apply opacity-0;
@@ -6,5 +6,9 @@
6
6
  .confirm-text {
7
7
  @apply label-sm font-semibold;
8
8
  }
9
+
10
+ .coco-button {
11
+ border-radius: var(--button-border-radius) !important;
12
+ }
9
13
  }
10
14
  }
@@ -2,7 +2,7 @@
2
2
  [data-coco][data-component="option-bar"] {
3
3
  @apply border border-gray-transparent-100 p-1 bg-gray-transparent-50;
4
4
 
5
- border-radius: 44px;
5
+ border-radius: var(--button-border-radius);
6
6
  width: fit-content;
7
7
 
8
8
  .option-bar-buttons {
@@ -16,12 +16,12 @@ module Coco
16
16
  @sections[alignment] = view_context.render(component, &block)
17
17
  end
18
18
 
19
- def initialize(**kwargs)
19
+ def initialize(**)
20
20
  @sections = {
21
21
  start: nil,
22
22
  end: nil
23
23
  }
24
- super(**kwargs)
24
+ super
25
25
  end
26
26
 
27
27
  def start_section
@@ -65,7 +65,7 @@ module Coco
65
65
  # be used to initialize the component.
66
66
  kwargs = run_callbacks(:before_initialize, kwargs, reduce: true)
67
67
 
68
- obj = super(**kwargs)
68
+ obj = super
69
69
 
70
70
  if obj.instance_of?(Coco::Component)
71
71
  raise "`Coco::Component` must be subclassed before use"
@@ -22,7 +22,7 @@ module Coco
22
22
  end
23
23
  end
24
24
 
25
- instance = kwargs.any? ? super(subject, **kwargs) : super(subject)
25
+ instance = kwargs.any? ? super : super(subject)
26
26
  instance.subject = subject
27
27
  instance
28
28
  end
@@ -0,0 +1,56 @@
1
+ import importGlob from "../lib/scripts/esbuild-plugin-import-glob.mjs";
2
+ import buildIcons from "../lib/scripts/esbuild-plugin-build-icons.mjs";
3
+ import mapAliasedPath from "../lib/scripts/map-aliased-path.mjs";
4
+ import cleanPlugin from "../lib/scripts/esbuild-plugin-clean.mjs";
5
+ import { copy } from "esbuild-plugin-copy";
6
+ import { cocoPath } from "./utils.js";
7
+
8
+ const watch = process.argv.includes("--watch");
9
+ const dev = watch || process.argv.includes("--dev");
10
+
11
+ export default {
12
+ entryPoints: ["coco.js"],
13
+ bundle: true,
14
+ metafile: true,
15
+ outdir: cocoPath("@build"),
16
+ absWorkingDir: cocoPath("@js"),
17
+ entryNames: `[dir]${dev ? "/dev" : ""}/[name]`,
18
+ logLevel: dev ? "warning" : "error",
19
+ plugins: [
20
+ importGlob({
21
+ importMapper: mapAliasedPath,
22
+ }),
23
+ cleanPlugin({
24
+ initialCleanPatterns: [
25
+ "**/*",
26
+ "!coco.css",
27
+ "!coco.js",
28
+ "!tailwind.preset.js",
29
+ ],
30
+ }),
31
+ buildIcons(
32
+ cocoPath("@npm/lucide-static/icons"),
33
+ cocoPath("@build/icons"),
34
+ cocoPath("@config")
35
+ ),
36
+ copy({
37
+ assets: [
38
+ {
39
+ from: ["./app/assets/img/**/*"],
40
+ to: ["./img"],
41
+ },
42
+ {
43
+ from: ["./app/assets/custom_icons/lucide/**/*"],
44
+ to: ["./icons"],
45
+ },
46
+ {
47
+ from: ["./app/assets/custom_icons/other/**/*"],
48
+ to: ["./icons/custom"],
49
+ },
50
+ ],
51
+ watch,
52
+ }),
53
+ ],
54
+ format: "esm",
55
+ platform: "node",
56
+ };
@@ -1,12 +1,19 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
2
 
3
3
  const defaultTheme = require("tailwindcss/defaultTheme");
4
- const { fontSize, fontFamily, colors, screens } = require("./tokens.js");
4
+ const {
5
+ fontSize,
6
+ fontFamily,
7
+ colors,
8
+ variables,
9
+ screens,
10
+ } = require("./tokens.js");
5
11
 
6
12
  module.exports = {
7
13
  theme: {
8
14
  colors,
9
15
  screens,
16
+ variables,
10
17
  fontFamily: {
11
18
  display: [fontFamily.displaySans, ...defaultTheme.fontFamily.sans],
12
19
  body: [fontFamily.bodySans, ...defaultTheme.fontFamily.sans],
@@ -58,6 +65,7 @@ module.exports = {
58
65
  plugins: [
59
66
  require("@tailwindcss/forms"),
60
67
  require("@tailwindcss/container-queries"),
68
+ require("@mertasan/tailwindcss-variables"),
61
69
  require("../app/assets/css/plugins/colors.js"),
62
70
  require("../app/assets/css/plugins/icons.js"),
63
71
  require("../app/assets/css/plugins/layout.js"),
data/config/tokens.js CHANGED
@@ -86,6 +86,9 @@ const colors = {
86
86
  },
87
87
  };
88
88
 
89
+ const { coco, ...colorVariables } = colors;
90
+ colorVariables.gray = colors.coco.gray;
91
+
89
92
  const colorAliases = {
90
93
  primary: {
91
94
  ...colors.green,
@@ -244,4 +247,14 @@ module.exports = {
244
247
  bodySans: "proxima-nova",
245
248
  displaySerif: "merriweather",
246
249
  },
250
+ variables: {
251
+ DEFAULT: {
252
+ coco: {
253
+ colors: {
254
+ ...colorVariables,
255
+ ...colorAliases,
256
+ },
257
+ },
258
+ },
259
+ },
247
260
  };
@@ -21,7 +21,7 @@ module Coco
21
21
 
22
22
  class_methods do
23
23
  def new(arg, **opts)
24
- arg.is_a?(self) ? arg : super(arg, **opts)
24
+ arg.is_a?(self) ? arg : super
25
25
  end
26
26
  end
27
27
  end
data/lib/coco.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.19.0"
2
+ VERSION = "0.19.2"
3
3
  end
@@ -0,0 +1,26 @@
1
+ import esbuild from "esbuild";
2
+ import path from "path";
3
+ import fs from "fs";
4
+ import config from "../../config/esbuild.config.mjs";
5
+
6
+ const metafilePath = "tmp/bundle-metadata.json";
7
+
8
+ function ensureDirectoryExistence(filePath) {
9
+ var dirname = path.dirname(filePath);
10
+ if (fs.existsSync(dirname)) {
11
+ return true;
12
+ }
13
+ ensureDirectoryExistence(dirname);
14
+ fs.mkdirSync(dirname);
15
+ }
16
+
17
+ ensureDirectoryExistence(metafilePath);
18
+
19
+ esbuild.build({ ...config, metafile: true }).then((result) => {
20
+ fs.writeFileSync(metafilePath, JSON.stringify(result.metafile));
21
+ console.log("\nāœ… Bundle metadata file generated.");
22
+
23
+ console.log(
24
+ `šŸ‘€ You can now upload '${metafilePath}' to https://esbuild.github.io/analyze/ for bundle analysis.`
25
+ );
26
+ });
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.19.0
4
+ version: 0.19.2
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-07-08 00:00:00.000000000 Z
11
+ date: 2024-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -1723,6 +1723,7 @@ files:
1723
1723
  - app/helpers/coco/integration_helper.rb
1724
1724
  - app/helpers/coco/modal_helper.rb
1725
1725
  - app/helpers/coco/tag_helper.rb
1726
+ - config/esbuild.config.mjs
1726
1727
  - config/exports.js
1727
1728
  - config/icons.json
1728
1729
  - config/locales/coco.en.yml
@@ -1749,6 +1750,7 @@ files:
1749
1750
  - lib/generators/coco/templates/component.rb.tt
1750
1751
  - lib/generators/coco/templates/preview.rb.tt
1751
1752
  - lib/generators/coco/templates/test.rb.tt
1753
+ - lib/scripts/esbuild-meta.mjs
1752
1754
  - lib/scripts/esbuild-plugin-build-icons.mjs
1753
1755
  - lib/scripts/esbuild-plugin-clean.mjs
1754
1756
  - lib/scripts/esbuild-plugin-import-glob.mjs