coveragebook_components 0.17.0 → 0.17.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: dc43045cc6048971e404fd7a2379f96920e0010e55c24b699b6765a03b1f94cc
4
- data.tar.gz: 4149e9785f9e4d7a23b07cf10683ca7da2375b9d7ead3f248f5779d33d5734da
3
+ metadata.gz: a2af0604e33ee8ea690a93abf997f126ecaeb23528b3bf682fadc79eed353df2
4
+ data.tar.gz: 6d055a247adaa8f2a794d3a6864d38a23fd2059d0c01d08ea183e751c06c440c
5
5
  SHA512:
6
- metadata.gz: ed242d2d14c076df4b69ef6de50b5bf8478680cd78372d54d4e3836fbdb86408f0dce619881a726312b6ac0e517ac2886d0c61cfdd411581228e181de8272334
7
- data.tar.gz: accd767375b3d5f2cc9a479fa8d60bde2e4f894226f1673f8758624e00ba79d34e2ba55a7aae950272afb977778d714869b7914c46808b559dd67a5062b33c4c
6
+ metadata.gz: eb41e2bfb905a693fb9a9ac36019d09699001552fa9f6aa2ce0df0b7f8281ebcc159f15cf41a58c059e1f83fe6907c085265cddee43dc893d8d475e34b146092
7
+ data.tar.gz: 9c229a0bf2926994c7bf5699485365d74956e3fc23cb0df41842b11ca5e27df24f3603c9339a86771316acdf94b185e83250f9e2b5c651771f0fcb130c0f7f24
@@ -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
  }
@@ -4220,15 +4220,15 @@ var require_tippy_cjs = __commonJS({
4220
4220
  }
4221
4221
  return arrow;
4222
4222
  }
4223
- function setContent(content2, props) {
4223
+ function setContent(content, props) {
4224
4224
  if (isElement(props.content)) {
4225
- dangerouslySetInnerHTML(content2, "");
4226
- content2.appendChild(props.content);
4225
+ dangerouslySetInnerHTML(content, "");
4226
+ content.appendChild(props.content);
4227
4227
  } else if (typeof props.content !== "function") {
4228
4228
  if (props.allowHTML) {
4229
- dangerouslySetInnerHTML(content2, props.content);
4229
+ dangerouslySetInnerHTML(content, props.content);
4230
4230
  } else {
4231
- content2.textContent = props.content;
4231
+ content.textContent = props.content;
4232
4232
  }
4233
4233
  }
4234
4234
  }
@@ -4254,15 +4254,15 @@ var require_tippy_cjs = __commonJS({
4254
4254
  box.className = BOX_CLASS;
4255
4255
  box.setAttribute("data-state", "hidden");
4256
4256
  box.setAttribute("tabindex", "-1");
4257
- var content2 = div();
4258
- content2.className = CONTENT_CLASS;
4259
- content2.setAttribute("data-state", "hidden");
4260
- setContent(content2, instance.props);
4257
+ var content = div();
4258
+ content.className = CONTENT_CLASS;
4259
+ content.setAttribute("data-state", "hidden");
4260
+ setContent(content, instance.props);
4261
4261
  popper.appendChild(box);
4262
- box.appendChild(content2);
4262
+ box.appendChild(content);
4263
4263
  onUpdate(instance.props, instance.props);
4264
4264
  function onUpdate(prevProps, nextProps) {
4265
- var _getChildren = getChildren(popper), box2 = _getChildren.box, content3 = _getChildren.content, arrow = _getChildren.arrow;
4265
+ var _getChildren = getChildren(popper), box2 = _getChildren.box, content2 = _getChildren.content, arrow = _getChildren.arrow;
4266
4266
  if (nextProps.theme) {
4267
4267
  box2.setAttribute("data-theme", nextProps.theme);
4268
4268
  } else {
@@ -4285,7 +4285,7 @@ var require_tippy_cjs = __commonJS({
4285
4285
  box2.removeAttribute("role");
4286
4286
  }
4287
4287
  if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) {
4288
- setContent(content3, instance.props);
4288
+ setContent(content2, instance.props);
4289
4289
  }
4290
4290
  if (nextProps.arrow) {
4291
4291
  if (!arrow) {
@@ -4877,9 +4877,9 @@ var require_tippy_cjs = __commonJS({
4877
4877
  }
4878
4878
  invokeHook("onAfterUpdate", [instance, partialProps]);
4879
4879
  }
4880
- function setContent2(content2) {
4880
+ function setContent2(content) {
4881
4881
  instance.setProps({
4882
- content: content2
4882
+ content
4883
4883
  });
4884
4884
  }
4885
4885
  function show() {
@@ -4911,8 +4911,8 @@ var require_tippy_cjs = __commonJS({
4911
4911
  popper.style.transition = "none";
4912
4912
  }
4913
4913
  if (getIsDefaultRenderFn()) {
4914
- var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content2 = _getDefaultTemplateCh2.content;
4915
- setTransitionDuration([box, content2], 0);
4914
+ var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content = _getDefaultTemplateCh2.content;
4915
+ setTransitionDuration([box, content], 0);
4916
4916
  }
4917
4917
  onFirstUpdate = function onFirstUpdate2() {
4918
4918
  var _instance$popperInsta2;
@@ -4967,10 +4967,10 @@ var require_tippy_cjs = __commonJS({
4967
4967
  removeDocumentPress();
4968
4968
  handleStyles(true);
4969
4969
  if (getIsDefaultRenderFn()) {
4970
- var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content2 = _getDefaultTemplateCh4.content;
4970
+ var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content = _getDefaultTemplateCh4.content;
4971
4971
  if (instance.props.animation) {
4972
- setTransitionDuration([box, content2], duration);
4973
- setVisibilityState([box, content2], "hidden");
4972
+ setTransitionDuration([box, content], duration);
4973
+ setVisibilityState([box, content], "hidden");
4974
4974
  }
4975
4975
  }
4976
4976
  handleAriaContentAttribute();
@@ -5387,7 +5387,7 @@ var require_tippy_cjs = __commonJS({
5387
5387
  }
5388
5388
  return {};
5389
5389
  }
5390
- var _getChildren = getChildren(instance.popper), box = _getChildren.box, content2 = _getChildren.content;
5390
+ var _getChildren = getChildren(instance.popper), box = _getChildren.box, content = _getChildren.content;
5391
5391
  var backdrop = instance.props.animateFill ? createBackdropElement() : null;
5392
5392
  return {
5393
5393
  onCreate: function onCreate() {
@@ -5405,7 +5405,7 @@ var require_tippy_cjs = __commonJS({
5405
5405
  if (backdrop) {
5406
5406
  var transitionDuration = box.style.transitionDuration;
5407
5407
  var duration = Number(transitionDuration.replace("ms", ""));
5408
- content2.style.transitionDelay = Math.round(duration / 10) + "ms";
5408
+ content.style.transitionDelay = Math.round(duration / 10) + "ms";
5409
5409
  backdrop.style.transitionDuration = transitionDuration;
5410
5410
  setVisibilityState([backdrop], "visible");
5411
5411
  }
@@ -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 recordQueue = [];
7425
- var willProcessRecordQueue = false;
7443
+ var queuedMutations = [];
7426
7444
  function flushObserver() {
7427
- recordQueue = recordQueue.concat(observer.takeRecords());
7428
- if (recordQueue.length && !willProcessRecordQueue) {
7429
- willProcessRecordQueue = true;
7430
- queueMicrotask(() => {
7431
- processRecordQueue();
7432
- willProcessRecordQueue = false;
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.push(node));
7472
- mutations[i2].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node));
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.includes(node))
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.includes(node))
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(error2, { el, expression });
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
- const outer = outerGet();
8607
- const inner = innerGet();
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
- const outerHashLatest = JSON.stringify(outer);
8629
+ let outerHashLatest = JSON.stringify(outer);
8630
+ let innerHashLatest = JSON.stringify(inner);
8614
8631
  if (outerHashLatest !== outerHash) {
8615
8632
  innerSet(cloneIfObject(outer));
8616
- outerHash = outerHashLatest;
8617
- } else {
8633
+ } else if (outerHashLatest !== innerHashLatest) {
8618
8634
  outerSet(cloneIfObject(inner));
8619
- outerHash = JSON.stringify(inner);
8635
+ } else {
8620
8636
  }
8621
8637
  }
8622
- JSON.stringify(innerGet());
8623
- JSON.stringify(outerGet());
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.3",
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 import_reactivity9 = __toESM2(require_reactivity());
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, effect: effect3 }) => (key, callback) => {
8810
+ magic("watch", (el, { evaluateLater: evaluateLater2, cleanup }) => (key, callback) => {
8794
8811
  let evaluate2 = evaluateLater2(key);
8795
- let firstTime = true;
8796
- let oldValue;
8797
- let effectReference = effect3(() => evaluate2((value) => {
8798
- JSON.stringify(value);
8799
- if (!firstTime) {
8800
- queueMicrotask(() => {
8801
- callback(value, oldValue);
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 root = closestIdRoot(el, name);
8850
- let id = root ? root._x_ids[name] : findAndIncrementId(name);
8851
- return key ? `${name}-${id}-${key}` : `${name}-${id}`;
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: import_reactivity9.reactive, effect: import_reactivity9.effect, release: import_reactivity9.stop, raw: import_reactivity9.toRaw });
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: () => morph2
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
- el.addEventListener("input", () => processInputValue(el));
10070
- el.addEventListener("blur", () => processInputValue(el, false));
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);
@@ -10265,8 +10309,8 @@ var require_module_cjs4 = __commonJS({
10265
10309
  var element = elementsToCheck.shift();
10266
10310
  if (element.tagName === "SLOT") {
10267
10311
  var assigned = element.assignedElements();
10268
- var content2 = assigned.length ? assigned : element.children;
10269
- var nestedCandidates = getCandidatesIteratively2(content2, true, options);
10312
+ var content = assigned.length ? assigned : element.children;
10313
+ var nestedCandidates = getCandidatesIteratively2(content, true, options);
10270
10314
  if (options.flatten) {
10271
10315
  candidates.push.apply(candidates, nestedCandidates);
10272
10316
  } else {
@@ -15126,13 +15170,13 @@ function tooltip_default(Alpine3) {
15126
15170
  let initialContent = null;
15127
15171
  const enableTooltip = () => el.__x_tippy.enable();
15128
15172
  const disableTooltip = () => el.__x_tippy.disable();
15129
- const setupTooltip = (content2) => {
15130
- if (!content2) {
15173
+ const setupTooltip = (content) => {
15174
+ if (!content) {
15131
15175
  disableTooltip();
15132
15176
  } else {
15133
15177
  enableTooltip();
15134
- el.__x_tippy.setContent(content2);
15135
- initialContent = initialContent || content2;
15178
+ el.__x_tippy.setContent(content);
15179
+ initialContent = initialContent || content;
15136
15180
  }
15137
15181
  };
15138
15182
  if (modifiers.includes("raw")) {
@@ -15140,21 +15184,21 @@ function tooltip_default(Alpine3) {
15140
15184
  } else {
15141
15185
  const getContent = evaluateLater(expression);
15142
15186
  effect(() => {
15143
- getContent((content2) => {
15144
- if (typeof content2 === "object" && content2 !== null) {
15145
- el.__x_tippy.setProps(content2);
15146
- initialContent = initialContent || content2.content;
15187
+ getContent((content) => {
15188
+ if (typeof content === "object" && content !== null) {
15189
+ el.__x_tippy.setProps(content);
15190
+ initialContent = initialContent || content.content;
15147
15191
  enableTooltip();
15148
15192
  } else {
15149
- setupTooltip(content2);
15193
+ setupTooltip(content);
15150
15194
  }
15151
15195
  });
15152
15196
  });
15153
15197
  }
15154
15198
  setData(el, {
15155
15199
  tooltip: {
15156
- setContent(content2) {
15157
- setupTooltip(content2);
15200
+ setContent(content) {
15201
+ setupTooltip(content);
15158
15202
  },
15159
15203
  disable: () => disableTooltip(),
15160
15204
  enable: () => enableTooltip(),
@@ -15183,7 +15227,7 @@ function destroy_default(Alpine3) {
15183
15227
  function dropdown_default(Alpine3) {
15184
15228
  Alpine3.directive(
15185
15229
  "dropdown",
15186
- (el, { value, modifiers, expression }, { evaluate, effect }) => {
15230
+ (el, { value, modifiers, expression }, { evaluate }) => {
15187
15231
  if (value)
15188
15232
  return;
15189
15233
  const data = getData(el);
@@ -15192,7 +15236,7 @@ function dropdown_default(Alpine3) {
15192
15236
  const directiveConfig = isObject(result) ? result : {};
15193
15237
  let { triggerTarget, contentTarget, anchorTarget, ...config } = directiveConfig;
15194
15238
  contentTarget = contentTarget || el.querySelector("[x-dropdown\\:content]");
15195
- content = isNode(contentTarget) ? contentTarget.firstElementChild : contentTarget;
15239
+ const content = isNode(contentTarget) ? contentTarget.firstElementChild : contentTarget;
15196
15240
  triggerTarget = triggerTarget || el.querySelector("[x-dropdown\\:trigger]") || el;
15197
15241
  anchorTarget = anchorTarget || el.querySelector("[x-dropdown\\:anchor]") || el;
15198
15242
  if (!el.__x_dropdown) {
@@ -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.0",
15418
+ version: "0.17.2",
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.3",
15417
- "@alpinejs/morph": "^3.13.2",
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.2",
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.0",
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": "^10.1.0",
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",
@@ -15618,8 +15662,8 @@ var button_default = CocoComponent("button", (data = {}) => {
15618
15662
  this.state = this.state === state1 ? state2 : state1;
15619
15663
  },
15620
15664
  getContentForState(state) {
15621
- const content2 = this.$refs[`${state}Content`];
15622
- return content2 ? content2.innerText : null;
15665
+ const content = this.$refs[`${state}Content`];
15666
+ return content ? content.innerText : null;
15623
15667
  },
15624
15668
  hasIconForState(state) {
15625
15669
  return !!this.$refs[`${state}Icon`];
@@ -7,7 +7,7 @@ import { setData, getData } from "@helpers/alpine";
7
7
  export default function (Alpine) {
8
8
  Alpine.directive(
9
9
  "dropdown",
10
- (el, { value, modifiers, expression }, { evaluate, effect }) => {
10
+ (el, { value, modifiers, expression }, { evaluate }) => {
11
11
  // Don't run for dropdown sub-elements
12
12
  // like `x-dropdown:trigger` and `x-dropdown:content`
13
13
  if (value) return;
@@ -21,7 +21,7 @@ export default function (Alpine) {
21
21
 
22
22
  contentTarget =
23
23
  contentTarget || el.querySelector("[x-dropdown\\:content]");
24
- content = isNode(contentTarget)
24
+ const content = isNode(contentTarget)
25
25
  ? contentTarget.firstElementChild
26
26
  : contentTarget;
27
27
  triggerTarget =
@@ -20,6 +20,12 @@
20
20
  @apply w-0 border-l border-coco-gray-300 self-stretch;
21
21
  }
22
22
 
23
+ &[data-reversed="true"] {
24
+ .button-group-buttons {
25
+ @apply flex-row-reverse;
26
+ }
27
+ }
28
+
23
29
  &[data-align="end"] {
24
30
  .button-group-buttons {
25
31
  @apply ml-auto;
@@ -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
@@ -23,40 +23,40 @@ module Coco
23
23
  render(component, &block)
24
24
  end
25
25
 
26
- def coco_button_group(**, &block)
27
- render Coco::ButtonGroup.new(**), &block
26
+ def coco_button_group(**, &)
27
+ render(Coco::ButtonGroup.new(**), &)
28
28
  end
29
29
 
30
- def coco_menu_button(**, &block)
31
- render Coco::MenuButton.new(**), &block
30
+ def coco_menu_button(**, &)
31
+ render(Coco::MenuButton.new(**), &)
32
32
  end
33
33
 
34
- def coco_menu_item(type, **, &block)
35
- render coco_component("menu_items/#{type}", **), &block
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, **, &block)
39
- render Coco::ConfirmButton.new(href: href, **), &block
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(**, &block)
43
- render Coco::ColorPickerButton.new(**), &block
42
+ def coco_color_picker_button(**, &)
43
+ render(Coco::ColorPickerButton.new(**), &)
44
44
  end
45
45
 
46
- def coco_image_picker_button(**, &block)
47
- render Coco::ImagePickerButton.new(**), &block
46
+ def coco_image_picker_button(**, &)
47
+ render(Coco::ImagePickerButton.new(**), &)
48
48
  end
49
49
 
50
- def coco_layout_picker_button(**, &block)
51
- render Coco::LayoutPickerButton.new(**), &block
50
+ def coco_layout_picker_button(**, &)
51
+ render(Coco::LayoutPickerButton.new(**), &)
52
52
  end
53
53
 
54
- def coco_toolbar(**, &block)
55
- render Coco::Toolbar.new(**), &block
54
+ def coco_toolbar(**, &)
55
+ render(Coco::Toolbar.new(**), &)
56
56
  end
57
57
 
58
- def coco_option_bar(**, &block)
59
- render Coco::OptionBar.new(**), &block
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(**, &block)
76
- form_with(**, builder: Coco::AppFormBuilder, &block)
75
+ def coco_form_with(**, &)
76
+ form_with(**, builder: Coco::AppFormBuilder, &)
77
77
  end
78
78
 
79
- def coco_form_for(*, **, &block)
80
- form_for(*, **, builder: Coco::AppFormBuilder, &block)
79
+ def coco_form_for(*, **, &)
80
+ form_for(*, **, builder: Coco::AppFormBuilder, &)
81
81
  end
82
82
 
83
- def coco_fields(**, &block)
84
- fields(**, builder: Coco::AppFormBuilder, &block)
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, **, &block)
102
- render Coco::Icon.new(name: icon_name, **), &block
101
+ def coco_icon(icon_name = nil, **, &)
102
+ render(Coco::Icon.new(name: icon_name, **), &)
103
103
  end
104
104
 
105
105
  # Indicators
@@ -132,40 +132,40 @@ module Coco
132
132
  end
133
133
  alias_method :space, :coco_spacer
134
134
 
135
- def coco_stack(spacing: Coco::Spacer::DEFAULT, **, &block)
136
- render Coco::Stack.new(spacing:, **), &block
135
+ def coco_stack(spacing: Coco::Spacer::DEFAULT, **, &)
136
+ render(Coco::Stack.new(spacing:, **), &)
137
137
  end
138
138
 
139
- def coco_panel(**, &block)
140
- render Coco::Panel.new(**), &block
139
+ def coco_panel(**, &)
140
+ render(Coco::Panel.new(**), &)
141
141
  end
142
142
 
143
- def coco_page(id, **, &block)
144
- render Coco::Page.new(id: id, **), &block
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(**, &block)
150
- render Coco::Notice.new(**), &block
149
+ def coco_notice(**, &)
150
+ render(Coco::Notice.new(**), &)
151
151
  end
152
152
 
153
- def coco_snackbar(**, &block)
154
- render Coco::Snackbar.new(**), &block
153
+ def coco_snackbar(**, &)
154
+ render(Coco::Snackbar.new(**), &)
155
155
  end
156
156
 
157
- def coco_toast(**, &block)
158
- render Coco::Toast.new(**), &block
157
+ def coco_toast(**, &)
158
+ render(Coco::Toast.new(**), &)
159
159
  end
160
160
 
161
- def coco_system_banner(**, &block)
162
- render Coco::SystemBanner.new(**), &block
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", **, &block)
168
- render(Coco::Modal.new(name: name, **), &block)
167
+ def coco_modal(name = "default", **, &)
168
+ render(Coco::Modal.new(name: name, **), &)
169
169
  end
170
170
 
171
171
  def coco_modal_dialog(name = "default", **, &block)
@@ -220,30 +220,30 @@ module Coco
220
220
  render(button, &block)
221
221
  end
222
222
 
223
- def coco_pager_button(direction, **, &block)
224
- render Coco::PagerButton.new(direction:, **), &block
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(**, &block)
230
- render Coco::Prose.new(**), &block
229
+ def coco_prose(**, &)
230
+ render(Coco::Prose.new(**), &)
231
231
  end
232
232
 
233
- def coco_seamless_textarea(**, &block)
234
- render Coco::SeamlessTextarea.new(**), &block
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, **, &block)
240
- render Coco::Placeholder.new(text_content:, **), &block
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(*, **, &block)
246
- render Coco::Tag.new(*, **), &block
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
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.17.0"
2
+ VERSION = "0.17.2"
3
3
  end
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.0
4
+ version: 0.17.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-01-30 00:00:00.000000000 Z
11
+ date: 2024-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails