coveragebook_components 0.19.0 → 0.19.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb5049eeec9c70081fd0cc9fec4723e35da58b39e02597077cc1a20625370b8f
4
- data.tar.gz: c99db45370f570dd98fb3c67016925f7a1d6c950bbe1b446b3be253a6023ebe2
3
+ metadata.gz: ddda4d2e278e6259a45856fe50f05eefffa161a337489494e12b8198584b7afb
4
+ data.tar.gz: e2476d7be98d6c3b35529d498cb3d4c1c88b4eb51ce1cc11b76bbf3fdc927d79
5
5
  SHA512:
6
- metadata.gz: '09a1eb6b7ec6f403018617a0f2a9ae3a6a3947673756714a314a3372e20443ce1bea81eb9f8dd755b91fb401fdc3ee034a74280639d9fe15cfb8d0101e6f41a3'
7
- data.tar.gz: 805735413da217fedda4b939504d1b0f627effce246aea20fee7aa13ee65870b581060e5513c0a8f19938b089a064a08a83b58bf037a5037092628928a1cd497
6
+ metadata.gz: 6457b878c1d4891014e51a9439fe3e145b0bc55612b79ab594c98c1999929385015d9d37f983e35b48bee973af1409aabd2d08577b8587c9d51f68da2597f178
7
+ data.tar.gz: 382ec0a0021eb489bc7901c67f4cac5825cdf115d3b8d3f439b6873092790413be6c8357968b522b4ab32e954a59a5bd3933b024dd73fa83e8ba1d7e4aeb6d28
@@ -731,6 +731,10 @@ select{
731
731
  --tw-contain-style:
732
732
  }
733
733
 
734
+ :root {
735
+ --button-border-radius: 44px;
736
+ }
737
+
734
738
  .coco-button-wrapper{
735
739
  display: contents !important
736
740
  }
@@ -864,7 +868,7 @@ select{
864
868
  transition-property: all;
865
869
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
866
870
  transition-duration: 150ms;
867
- border-radius: 44px
871
+ border-radius: var(--button-border-radius)
868
872
  }
869
873
 
870
874
  [data-coco].coco-button[data-theme] .button-content{
@@ -2225,7 +2229,7 @@ select{
2225
2229
  [data-coco][data-component="button-group"] {
2226
2230
  width: -moz-fit-content;
2227
2231
  width: fit-content;
2228
- border-radius: 44px;
2232
+ border-radius: var(--button-border-radius);
2229
2233
  }
2230
2234
 
2231
2235
  [data-coco][data-component="button-group"][data-collapsible="true"]{
@@ -2345,6 +2349,10 @@ select{
2345
2349
  line-height: 16px
2346
2350
  }
2347
2351
 
2352
+ [data-coco][data-component="confirm-panel"] .coco-button {
2353
+ border-radius: var(--button-border-radius) !important;
2354
+ }
2355
+
2348
2356
  [data-coco][data-component="image-picker-button"]{
2349
2357
  display: contents
2350
2358
  }
@@ -2624,7 +2632,7 @@ select{
2624
2632
  background-color: rgba(0, 12, 39, 0.06);
2625
2633
  padding: 0.25rem;
2626
2634
 
2627
- border-radius: 44px;
2635
+ border-radius: var(--button-border-radius);
2628
2636
  width: -moz-fit-content;
2629
2637
  width: fit-content
2630
2638
  }
@@ -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(() => {
@@ -15296,7 +15326,7 @@ var alpine_default = import_alpinejs.default;
15296
15326
  // ../../../package.json
15297
15327
  var package_default = {
15298
15328
  name: "coveragebook-components",
15299
- version: "0.19.0",
15329
+ version: "0.19.1",
15300
15330
  repository: "git@github.com:coveragebook/coco.git",
15301
15331
  license: "NO LICENSE",
15302
15332
  author: "Mark Perkins <mark@coveragebook.com>",
@@ -15311,9 +15341,10 @@ var package_default = {
15311
15341
  "css:build": "postcss ./app/assets/css/coco.css -d ./app/assets/build/coco",
15312
15342
  "css:dev": "postcss ./app/assets/css/coco.css -d ./app/assets/build/coco/dev",
15313
15343
  "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",
15344
+ "js:build": "node esbuild.mjs",
15345
+ "js:dev": "node esbuild.mjs --dev",
15346
+ "js:watch": "node esbuild.mjs --watch",
15347
+ "js:analyse": "node lib/scripts/esbuild-meta.mjs",
15317
15348
  "lint:fix": "bundle exec standardrb --fix && prettier --write .",
15318
15349
  "lookbook:build": "cd lookbook && npm run build",
15319
15350
  prepare: "husky install",
@@ -15338,14 +15369,14 @@ var package_default = {
15338
15369
  },
15339
15370
  dependencies: {
15340
15371
  "@alpinejs/focus": "^3.13.2",
15341
- "@alpinejs/mask": "^3.13.5",
15372
+ "@alpinejs/mask": "^3.14.1",
15342
15373
  "@alpinejs/morph": "^3.13.5",
15343
15374
  "@jaames/iro": "^5.5.2",
15344
15375
  "@percy/cli": "^1.28.8",
15345
15376
  "@tailwindcss/container-queries": "^0.1.0",
15346
15377
  "@tailwindcss/forms": "^0.5.6",
15347
15378
  "alias-hq": "^6.2.2",
15348
- alpinejs: "^3.13.8",
15379
+ alpinejs: "^3.14.1",
15349
15380
  autoprefixer: "^10.4.16",
15350
15381
  "container-query-polyfill": "^1.0.2",
15351
15382
  del: "^7.1.0",
@@ -15364,7 +15395,7 @@ var package_default = {
15364
15395
  postcss: "^8.4.38",
15365
15396
  "postcss-cli": "^11.0.0",
15366
15397
  "postcss-value-parser": "^4.2.0",
15367
- prettier: "^3.2.5",
15398
+ prettier: "^3.3.3",
15368
15399
  "release-it": "^17.2.1",
15369
15400
  svgo: "^3.0.2",
15370
15401
  tailwindcss: "^3.4.3",
@@ -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
+ };
@@ -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.1"
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.1
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-10 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