coveragebook_components 0.17.1 → 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: cd71727c5f2de38b71197cc66fafb74c94e49ea9a50b0f1dd6c80d4c90b420b6
4
- data.tar.gz: a786af7b55623200e2d6cd4f5c1f0f0a13305f6ef79508c3726445e6dd7ca347
3
+ metadata.gz: a2af0604e33ee8ea690a93abf997f126ecaeb23528b3bf682fadc79eed353df2
4
+ data.tar.gz: 6d055a247adaa8f2a794d3a6864d38a23fd2059d0c01d08ea183e751c06c440c
5
5
  SHA512:
6
- metadata.gz: 96949e0868cfcf1cab1000c8b8971333620dac8b96626556214477de3ea9aa4141b7785f772a0d90ff9469cf136b27aaff5acbb33569b6ae7543a6db26a5f66f
7
- data.tar.gz: 3ef018ff32c75d340bebf3965359888aa875792ebf3f84ed1bf26becc8739e4ddd952aa4fd4ad9bc44ce72bd8d07f17d6382fd7e1cada2f6fda666568f72f637
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
  }
@@ -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);
@@ -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.1",
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",
@@ -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.1"
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.1
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-02-02 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