coveragebook_components 0.10.0 → 0.10.1.beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/build/coco/app.css +4339 -3025
  3. data/app/assets/build/coco/app.js +116 -104
  4. data/app/assets/build/coco/book.css +1492 -92
  5. data/app/assets/build/coco/book.js +278 -17
  6. data/app/assets/css/app/tippy.css +1 -1
  7. data/app/assets/css/app.css +3 -3
  8. data/app/assets/css/{base/base.css → base.css} +14 -7
  9. data/app/assets/css/book.css +2 -2
  10. data/app/assets/css/{libs → shared}/tippy.css +20 -1
  11. data/app/assets/css/shared/utils/text.css +143 -0
  12. data/app/assets/js/app.js +2 -2
  13. data/app/assets/js/book.js +2 -2
  14. data/app/assets/js/libs/alpine/directives/dropdown.js +1 -1
  15. data/app/assets/js/libs/alpine/directives/tooltip.js +1 -1
  16. data/app/assets/js/shared/components.js +4 -0
  17. data/app/components/coco/app/blocks/header/header.js +1 -1
  18. data/app/components/coco/app/blocks/header/header.rb +2 -2
  19. data/app/components/coco/app/blocks/nav_drawer/nav_drawer.css +4 -0
  20. data/app/components/coco/app/blocks/nav_drawer/nav_drawer.js +1 -1
  21. data/app/components/coco/app/blocks/sidebar_nav/item/item.css +3 -3
  22. data/app/components/coco/app/blocks/sidebar_nav/item/item.js +2 -2
  23. data/app/components/coco/app/blocks/sidebar_nav/menu/menu.css +3 -3
  24. data/app/components/coco/app/blocks/sidebar_nav/menu/menu.js +1 -1
  25. data/app/components/coco/app/blocks/sidebar_nav/navbar/navbar.js +1 -1
  26. data/app/components/coco/app/blocks/slide_editor/slide_editor.js +1 -1
  27. data/app/components/coco/app/elements/alert/alert.css +4 -4
  28. data/app/components/coco/app/elements/alert/alert.js +1 -1
  29. data/app/components/coco/app/elements/color_picker/color_picker.css +2 -2
  30. data/app/components/coco/app/elements/color_picker/color_picker.js +1 -1
  31. data/app/components/coco/app/elements/color_picker_button/color_picker_button.js +1 -1
  32. data/app/components/coco/app/elements/color_picker_button/color_picker_button.rb +3 -3
  33. data/app/components/coco/app/elements/confirm_panel/confirm_panel.css +1 -1
  34. data/app/components/coco/app/elements/confirm_panel/confirm_panel.js +1 -1
  35. data/app/components/coco/app/elements/image_picker/image_picker.css +4 -4
  36. data/app/components/coco/app/elements/image_picker/image_picker.js +1 -1
  37. data/app/components/coco/app/elements/image_picker_button/image_picker_button.js +1 -1
  38. data/app/components/coco/app/elements/image_picker_button/image_picker_button.rb +3 -3
  39. data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.js +1 -1
  40. data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.rb +3 -3
  41. data/app/components/coco/app/elements/link/link.rb +1 -1
  42. data/app/components/coco/app/elements/menu/menu.css +5 -5
  43. data/app/components/coco/app/elements/menu_button/menu_button.js +1 -1
  44. data/app/components/coco/app/elements/menu_button/menu_button.rb +3 -3
  45. data/app/components/coco/app/elements/menu_items/user_profile/user_profile.css +1 -1
  46. data/app/components/coco/app/elements/notice/notice.js +1 -1
  47. data/app/components/coco/app/elements/seamless_textarea/seamless_textarea.js +1 -1
  48. data/app/components/coco/app/elements/snackbar/snackbar.css +1 -1
  49. data/app/components/coco/app/elements/snackbar/snackbar.js +1 -1
  50. data/app/components/coco/app/elements/system_banner/system_banner.js +1 -1
  51. data/app/components/coco/app/elements/toast/toast.js +1 -1
  52. data/app/components/coco/app/elements/toolbar/toolbar.js +1 -1
  53. data/app/components/coco/app/elements/toolbar/toolbar.rb +1 -1
  54. data/app/components/coco/app/fields/button_component.rb +1 -1
  55. data/app/components/coco/app/fields/submit_component.rb +1 -0
  56. data/app/components/coco/app/layouts/application/application.js +1 -1
  57. data/app/components/coco/app/layouts/page/page.js +1 -1
  58. data/app/components/coco/{app/elements → shared}/button/button.css +104 -32
  59. data/app/components/coco/shared/button/button.html.erb +83 -0
  60. data/app/components/coco/{base → shared}/button/button.js +2 -1
  61. data/app/components/coco/{base → shared}/button/button.rb +107 -42
  62. data/app/components/coco/{base → shared}/button/button_dropdown.js +11 -2
  63. data/app/components/coco/{app/elements → shared}/button_group/button_group.css +1 -1
  64. data/app/components/coco/{app/elements → shared}/button_group/button_group.js +12 -4
  65. data/app/components/coco/shared/button_group/button_group.rb +40 -0
  66. data/app/components/coco/{app/elements → shared}/button_to/button_to.css +1 -1
  67. data/app/components/coco/shared/button_to/button_to.rb +50 -0
  68. data/app/components/coco/{base → shared}/dropdown/dropdown.js +1 -1
  69. data/app/components/coco/{base → shared}/icon/icon.js +1 -1
  70. data/app/components/coco/{base → shared}/image_uploader/image_uploader.js +1 -1
  71. data/app/components/coco/{base → shared}/modal/modal.js +2 -2
  72. data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.js +1 -1
  73. data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.js +1 -1
  74. data/app/components/coco/{base → shared}/poll_controller/poll_controller.js +1 -1
  75. data/app/helpers/coco/app_helper.rb +0 -23
  76. data/app/helpers/coco/component_helper.rb +1 -1
  77. data/app/helpers/coco/{base_helper.rb → shared_helper.rb} +24 -1
  78. data/app/helpers/coco/url_helper.rb +1 -1
  79. data/lib/coco/engine.rb +2 -2
  80. data/lib/coco.rb +1 -1
  81. data/lib/generators/coco/coco_generator.rb +1 -1
  82. metadata +74 -79
  83. data/app/assets/css/base/components/coco.css +0 -5
  84. data/app/assets/css/base/components/dropdown.css +0 -7
  85. data/app/assets/css/base/components/tooltip.css +0 -19
  86. data/app/assets/css/base/utils/text.css +0 -79
  87. data/app/assets/js/base/components.js +0 -4
  88. data/app/components/coco/app/elements/button/button.rb +0 -87
  89. data/app/components/coco/app/elements/button_group/button_group.rb +0 -42
  90. data/app/components/coco/app/elements/button_to/button_to.rb +0 -54
  91. data/app/components/coco/base/button/button.css +0 -75
  92. data/app/components/coco/base/button/button.html.erb +0 -71
  93. /data/app/assets/css/app/{utilities.css → utils.css} +0 -0
  94. /data/app/assets/css/{base → shared}/utils/colors.css +0 -0
  95. /data/app/assets/css/{base → shared}/utils/icons.css +0 -0
  96. /data/app/assets/js/{coco.js → shared/coco.js} +0 -0
  97. /data/app/components/coco/{base → shared}/avatar/avatar.css +0 -0
  98. /data/app/components/coco/{base → shared}/avatar/avatar.rb +0 -0
  99. /data/app/components/coco/{app/elements → shared}/button_group/button_group.html.erb +0 -0
  100. /data/app/components/coco/{app/elements → shared}/button_to/button_to.html.erb +0 -0
  101. /data/app/components/coco/{base → shared}/content/content.rb +0 -0
  102. /data/app/components/coco/{base → shared}/dropdown/dropdown.css +0 -0
  103. /data/app/components/coco/{base → shared}/dropdown/dropdown.html.erb +0 -0
  104. /data/app/components/coco/{base → shared}/dropdown/dropdown.rb +0 -0
  105. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.css +0 -0
  106. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.html.erb +0 -0
  107. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.rb +0 -0
  108. /data/app/components/coco/{base → shared}/icon/icon.css +0 -0
  109. /data/app/components/coco/{base → shared}/icon/icon.html.erb +0 -0
  110. /data/app/components/coco/{base → shared}/icon/icon.rb +0 -0
  111. /data/app/components/coco/{base → shared}/image/image.css +0 -0
  112. /data/app/components/coco/{base → shared}/image/image.rb +0 -0
  113. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.css +0 -0
  114. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.html.erb +0 -0
  115. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.rb +0 -0
  116. /data/app/components/coco/{base → shared}/link/link.css +0 -0
  117. /data/app/components/coco/{base → shared}/link/link.rb +0 -0
  118. /data/app/components/coco/{base → shared}/modal/modal.css +0 -0
  119. /data/app/components/coco/{base → shared}/modal/modal.html.erb +0 -0
  120. /data/app/components/coco/{base → shared}/modal/modal.rb +0 -0
  121. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.css +0 -0
  122. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.html.erb +0 -0
  123. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.rb +0 -0
  124. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.css +0 -0
  125. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.html.erb +0 -0
  126. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.rb +0 -0
  127. /data/app/components/coco/{base → shared}/pager_link/pager_link.css +0 -0
  128. /data/app/components/coco/{base → shared}/pager_link/pager_link.html.erb +0 -0
  129. /data/app/components/coco/{base → shared}/pager_link/pager_link.rb +0 -0
  130. /data/app/components/coco/{base → shared}/panel/panel.css +0 -0
  131. /data/app/components/coco/{base → shared}/panel/panel.html.erb +0 -0
  132. /data/app/components/coco/{base → shared}/panel/panel.rb +0 -0
  133. /data/app/components/coco/{base → shared}/placeholder/placeholder.css +0 -0
  134. /data/app/components/coco/{base → shared}/placeholder/placeholder.html.erb +0 -0
  135. /data/app/components/coco/{base → shared}/placeholder/placeholder.rb +0 -0
  136. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.css +0 -0
  137. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.html.erb +0 -0
  138. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.rb +0 -0
  139. /data/app/components/coco/{base → shared}/svg/svg.html.erb +0 -0
  140. /data/app/components/coco/{base → shared}/svg/svg.rb +0 -0
@@ -14779,6 +14779,169 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14779
14779
  }
14780
14780
  }
14781
14781
  });
14782
+ var createSingleton = function createSingleton2(tippyInstances, optionalProps) {
14783
+ var _optionalProps$popper;
14784
+ if (optionalProps === void 0) {
14785
+ optionalProps = {};
14786
+ }
14787
+ if (true) {
14788
+ errorWhen(!Array.isArray(tippyInstances), ["The first argument passed to createSingleton() must be an array of", "tippy instances. The passed value was", String(tippyInstances)].join(" "));
14789
+ }
14790
+ var individualInstances = tippyInstances;
14791
+ var references = [];
14792
+ var triggerTargets = [];
14793
+ var currentTarget;
14794
+ var overrides = optionalProps.overrides;
14795
+ var interceptSetPropsCleanups = [];
14796
+ var shownOnCreate = false;
14797
+ function setTriggerTargets() {
14798
+ triggerTargets = individualInstances.map(function(instance) {
14799
+ return normalizeToArray(instance.props.triggerTarget || instance.reference);
14800
+ }).reduce(function(acc, item) {
14801
+ return acc.concat(item);
14802
+ }, []);
14803
+ }
14804
+ function setReferences() {
14805
+ references = individualInstances.map(function(instance) {
14806
+ return instance.reference;
14807
+ });
14808
+ }
14809
+ function enableInstances(isEnabled) {
14810
+ individualInstances.forEach(function(instance) {
14811
+ if (isEnabled) {
14812
+ instance.enable();
14813
+ } else {
14814
+ instance.disable();
14815
+ }
14816
+ });
14817
+ }
14818
+ function interceptSetProps(singleton2) {
14819
+ return individualInstances.map(function(instance) {
14820
+ var originalSetProps2 = instance.setProps;
14821
+ instance.setProps = function(props) {
14822
+ originalSetProps2(props);
14823
+ if (instance.reference === currentTarget) {
14824
+ singleton2.setProps(props);
14825
+ }
14826
+ };
14827
+ return function() {
14828
+ instance.setProps = originalSetProps2;
14829
+ };
14830
+ });
14831
+ }
14832
+ function prepareInstance(singleton2, target) {
14833
+ var index = triggerTargets.indexOf(target);
14834
+ if (target === currentTarget) {
14835
+ return;
14836
+ }
14837
+ currentTarget = target;
14838
+ var overrideProps = (overrides || []).concat("content").reduce(function(acc, prop) {
14839
+ acc[prop] = individualInstances[index].props[prop];
14840
+ return acc;
14841
+ }, {});
14842
+ singleton2.setProps(Object.assign({}, overrideProps, {
14843
+ getReferenceClientRect: typeof overrideProps.getReferenceClientRect === "function" ? overrideProps.getReferenceClientRect : function() {
14844
+ var _references$index;
14845
+ return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect();
14846
+ }
14847
+ }));
14848
+ }
14849
+ enableInstances(false);
14850
+ setReferences();
14851
+ setTriggerTargets();
14852
+ var plugin2 = {
14853
+ fn: function fn3() {
14854
+ return {
14855
+ onDestroy: function onDestroy2() {
14856
+ enableInstances(true);
14857
+ },
14858
+ onHidden: function onHidden2() {
14859
+ currentTarget = null;
14860
+ },
14861
+ onClickOutside: function onClickOutside2(instance) {
14862
+ if (instance.props.showOnCreate && !shownOnCreate) {
14863
+ shownOnCreate = true;
14864
+ currentTarget = null;
14865
+ }
14866
+ },
14867
+ onShow: function onShow2(instance) {
14868
+ if (instance.props.showOnCreate && !shownOnCreate) {
14869
+ shownOnCreate = true;
14870
+ prepareInstance(instance, references[0]);
14871
+ }
14872
+ },
14873
+ onTrigger: function onTrigger2(instance, event) {
14874
+ prepareInstance(instance, event.currentTarget);
14875
+ }
14876
+ };
14877
+ }
14878
+ };
14879
+ var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ["overrides"]), {
14880
+ plugins: [plugin2].concat(optionalProps.plugins || []),
14881
+ triggerTarget: triggerTargets,
14882
+ popperOptions: Object.assign({}, optionalProps.popperOptions, {
14883
+ modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier])
14884
+ })
14885
+ }));
14886
+ var originalShow = singleton.show;
14887
+ singleton.show = function(target) {
14888
+ originalShow();
14889
+ if (!currentTarget && target == null) {
14890
+ return prepareInstance(singleton, references[0]);
14891
+ }
14892
+ if (currentTarget && target == null) {
14893
+ return;
14894
+ }
14895
+ if (typeof target === "number") {
14896
+ return references[target] && prepareInstance(singleton, references[target]);
14897
+ }
14898
+ if (individualInstances.indexOf(target) >= 0) {
14899
+ var ref = target.reference;
14900
+ return prepareInstance(singleton, ref);
14901
+ }
14902
+ if (references.indexOf(target) >= 0) {
14903
+ return prepareInstance(singleton, target);
14904
+ }
14905
+ };
14906
+ singleton.showNext = function() {
14907
+ var first = references[0];
14908
+ if (!currentTarget) {
14909
+ return singleton.show(0);
14910
+ }
14911
+ var index = references.indexOf(currentTarget);
14912
+ singleton.show(references[index + 1] || first);
14913
+ };
14914
+ singleton.showPrevious = function() {
14915
+ var last = references[references.length - 1];
14916
+ if (!currentTarget) {
14917
+ return singleton.show(last);
14918
+ }
14919
+ var index = references.indexOf(currentTarget);
14920
+ var target = references[index - 1] || last;
14921
+ singleton.show(target);
14922
+ };
14923
+ var originalSetProps = singleton.setProps;
14924
+ singleton.setProps = function(props) {
14925
+ overrides = props.overrides || overrides;
14926
+ originalSetProps(props);
14927
+ };
14928
+ singleton.setInstances = function(nextInstances) {
14929
+ enableInstances(true);
14930
+ interceptSetPropsCleanups.forEach(function(fn3) {
14931
+ return fn3();
14932
+ });
14933
+ individualInstances = nextInstances;
14934
+ enableInstances(false);
14935
+ setReferences();
14936
+ setTriggerTargets();
14937
+ interceptSetPropsCleanups = interceptSetProps(singleton);
14938
+ singleton.setProps({
14939
+ triggerTarget: triggerTargets
14940
+ });
14941
+ };
14942
+ interceptSetPropsCleanups = interceptSetProps(singleton);
14943
+ return singleton;
14944
+ };
14782
14945
  var mouseCoords = {
14783
14946
  clientX: 0,
14784
14947
  clientY: 0
@@ -15250,13 +15413,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15250
15413
  module_default.plugin(notification_default);
15251
15414
  var alpine_default2 = module_default;
15252
15415
 
15253
- // ../../components/coco/base/button/button.js
15416
+ // ../../components/coco/shared/button/button.js
15254
15417
  var button_exports = {};
15255
15418
  __export(button_exports, {
15256
15419
  default: () => button_default
15257
15420
  });
15258
15421
 
15259
- // coco.js
15422
+ // shared/coco.js
15260
15423
  function CocoComponent(name, fn3) {
15261
15424
  const func = nameFunction(name, (...args) => {
15262
15425
  const data2 = fn3(...args);
@@ -15274,7 +15437,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15274
15437
  return func;
15275
15438
  }
15276
15439
 
15277
- // ../../components/coco/base/button/button.js
15440
+ // ../../components/coco/shared/button/button.js
15278
15441
  var import_lodash2 = __toESM(require_lodash(), 1);
15279
15442
  var button_default = CocoComponent("button", (data2 = {}) => {
15280
15443
  return __spreadProps(__spreadValues({
@@ -15408,17 +15571,18 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15408
15571
  root: {
15409
15572
  "x-options": "options",
15410
15573
  "x-tooltip": "tooltipText",
15411
- "x-effect": "setTooltipText"
15574
+ "x-effect": "setTooltipText",
15575
+ ":disabled": "disabled"
15412
15576
  }
15413
15577
  });
15414
15578
  });
15415
15579
 
15416
- // ../../components/coco/base/button/button_dropdown.js
15580
+ // ../../components/coco/shared/button/button_dropdown.js
15417
15581
  var button_dropdown_exports = {};
15418
15582
  __export(button_dropdown_exports, {
15419
15583
  default: () => button_dropdown_default
15420
15584
  });
15421
- var button_dropdown_default = CocoComponent("buttonDropdown", (data2 = {}) => {
15585
+ var button_dropdown_default = CocoComponent("buttonDropdown", () => {
15422
15586
  return {
15423
15587
  dropdown: null,
15424
15588
  button: null,
@@ -15436,11 +15600,108 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15436
15600
  if (this.dropdown) {
15437
15601
  this.dropdown.show();
15438
15602
  }
15603
+ },
15604
+ /* bindings */
15605
+ root: {
15606
+ "@dropdown:show": "button.setState('active')",
15607
+ "@dropdown:hide": "button.resetState()",
15608
+ "@confirmation:confirm": "button.approveAndRun($event)",
15609
+ "@confirmation:cancel": "button.cancelConfirmation($event)"
15610
+ }
15611
+ };
15612
+ });
15613
+
15614
+ // ../../components/coco/shared/button_group/button_group.js
15615
+ var button_group_exports = {};
15616
+ __export(button_group_exports, {
15617
+ default: () => button_group_default
15618
+ });
15619
+ var button_group_default = CocoComponent("appButtonGroup", () => {
15620
+ return {
15621
+ options: ["collapsible"],
15622
+ ready: false,
15623
+ containerWidth: 0,
15624
+ contentWidth: 0,
15625
+ collapsed: false,
15626
+ singletonTooltip: null,
15627
+ tooltipInstances: [],
15628
+ get collapsible() {
15629
+ return this.$options.collapsible !== false;
15630
+ },
15631
+ get buttons() {
15632
+ const buttonElements = this.$el.querySelectorAll(
15633
+ "[data-component='button']"
15634
+ );
15635
+ return Array.from(buttonElements).map((el) => getComponent(el));
15636
+ },
15637
+ get parent() {
15638
+ return this.$root.parentElement;
15639
+ },
15640
+ init() {
15641
+ if (this.collapsible) {
15642
+ this.$nextTick(() => {
15643
+ this.onResize();
15644
+ this.createSingletonTooltip();
15645
+ this.ready = true;
15646
+ });
15647
+ } else {
15648
+ this.ready = true;
15649
+ }
15650
+ this.$watch("collapsed", (value) => {
15651
+ this.buttons.forEach((button) => {
15652
+ button.isCollapsed = value;
15653
+ });
15654
+ this.$nextTick(() => this.createSingletonTooltip());
15655
+ });
15656
+ },
15657
+ createSingletonTooltip() {
15658
+ this.destroySingletonTooltip();
15659
+ this.tooltipInstances = this.buttons.map((button) => {
15660
+ if (button.tippyInstance && button.shouldShowTooltip && button.shouldShowTooltip()) {
15661
+ return button.tippyInstance;
15662
+ }
15663
+ }).filter((t2) => t2);
15664
+ this.singletonTooltip = createSingleton(this.tooltipInstances, {
15665
+ theme: "coco-tooltip",
15666
+ delay: 100,
15667
+ moveTransition: "transform 0.1s ease-out"
15668
+ });
15669
+ },
15670
+ destroySingletonTooltip() {
15671
+ if (this.singletonTooltip && this.singletonTooltip.destroy) {
15672
+ this.singletonTooltip.destroy();
15673
+ this.singletonTooltip = null;
15674
+ this.tooltipInstances.forEach((tooltip) => tooltip.destroy());
15675
+ this.tooltipInstances = [];
15676
+ }
15677
+ },
15678
+ onResize() {
15679
+ if (!this.collapsible)
15680
+ return;
15681
+ this.containerWidth = Math.ceil(this.parent.offsetWidth);
15682
+ if (this.collapsed) {
15683
+ if (this.containerWidth > this.contentWidth) {
15684
+ this.collapsed = false;
15685
+ }
15686
+ } else {
15687
+ if (this.containerWidth < this.contentWidth) {
15688
+ this.collapsed = true;
15689
+ } else {
15690
+ const contentWidth = Math.ceil(this.$refs.buttons.scrollWidth);
15691
+ this.contentWidth = contentWidth;
15692
+ }
15693
+ }
15694
+ },
15695
+ destroy() {
15696
+ if (this.singletonTooltip) {
15697
+ this.singletonTooltip.destroy();
15698
+ this.singletonTooltip = null;
15699
+ }
15439
15700
  }
15440
15701
  };
15441
15702
  });
15442
15703
 
15443
- // ../../components/coco/base/dropdown/dropdown.js
15704
+ // ../../components/coco/shared/dropdown/dropdown.js
15444
15705
  var dropdown_exports = {};
15445
15706
  __export(dropdown_exports, {
15446
15707
  default: () => dropdown_default2
@@ -15449,7 +15710,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15449
15710
  return {};
15450
15711
  });
15451
15712
 
15452
- // ../../components/coco/base/icon/icon.js
15713
+ // ../../components/coco/shared/icon/icon.js
15453
15714
  var icon_exports = {};
15454
15715
  __export(icon_exports, {
15455
15716
  default: () => icon_default
@@ -15475,7 +15736,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15475
15736
  };
15476
15737
  });
15477
15738
 
15478
- // ../../components/coco/base/image_uploader/image_uploader.js
15739
+ // ../../components/coco/shared/image_uploader/image_uploader.js
15479
15740
  var image_uploader_exports = {};
15480
15741
  __export(image_uploader_exports, {
15481
15742
  default: () => image_uploader_default
@@ -15548,7 +15809,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15548
15809
  };
15549
15810
  });
15550
15811
 
15551
- // ../../components/coco/base/modal/modal.js
15812
+ // ../../components/coco/shared/modal/modal.js
15552
15813
  var modal_exports = {};
15553
15814
  __export(modal_exports, {
15554
15815
  default: () => modal_default
@@ -15565,7 +15826,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15565
15826
  }
15566
15827
  }
15567
15828
 
15568
- // ../../components/coco/base/modal/modal.js
15829
+ // ../../components/coco/shared/modal/modal.js
15569
15830
  var modal_default = CocoComponent("modal", () => {
15570
15831
  return {
15571
15832
  open: false,
@@ -15651,7 +15912,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15651
15912
  };
15652
15913
  });
15653
15914
 
15654
- // ../../components/coco/base/modal_dialog/modal_dialog.js
15915
+ // ../../components/coco/shared/modal_dialog/modal_dialog.js
15655
15916
  var modal_dialog_exports = {};
15656
15917
  __export(modal_dialog_exports, {
15657
15918
  default: () => modal_dialog_default
@@ -15685,7 +15946,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15685
15946
  };
15686
15947
  });
15687
15948
 
15688
- // ../../components/coco/base/modal_lightbox/modal_lightbox.js
15949
+ // ../../components/coco/shared/modal_lightbox/modal_lightbox.js
15689
15950
  var modal_lightbox_exports = {};
15690
15951
  __export(modal_lightbox_exports, {
15691
15952
  default: () => modal_lightbox_default
@@ -15719,7 +15980,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15719
15980
  };
15720
15981
  });
15721
15982
 
15722
- // ../../components/coco/base/poll_controller/poll_controller.js
15983
+ // ../../components/coco/shared/poll_controller/poll_controller.js
15723
15984
  var poll_controller_exports = {};
15724
15985
  __export(poll_controller_exports, {
15725
15986
  default: () => poll_controller_default
@@ -15783,11 +16044,11 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15783
16044
  }
15784
16045
  }
15785
16046
 
15786
- // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@baseComponents/**/*.js
15787
- var modules = [button_exports, button_dropdown_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, poll_controller_exports];
16047
+ // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/shared|@sharedComponents/**/*.js
16048
+ var modules = [button_exports, button_dropdown_exports, button_group_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, poll_controller_exports];
15788
16049
  var __default = modules;
15789
16050
 
15790
- // base/components.js
16051
+ // shared/components.js
15791
16052
  var components_default = registerComponents(__default);
15792
16053
 
15793
16054
  // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/book|@bookComponents/**/*.js
@@ -1,6 +1,6 @@
1
1
  @layer utilities {
2
2
  .tippy-dropdown-box {
3
- @apply bg-background-light-2 text-gray-900 text-label-sm border border-solid border-gray-blend-100 shadow-xl rounded-lg;
3
+ @apply bg-background-light-2 text-gray-900 coco-label-sm border border-solid border-gray-blend-100 shadow-xl rounded-lg;
4
4
  }
5
5
  }
6
6
 
@@ -1,9 +1,9 @@
1
1
  @import "./app/config";
2
- @import "./base/base";
2
+ @import "./base";
3
3
 
4
- @import "./app/utilities";
4
+ @import "./app/utils";
5
5
  @import "./app/tippy";
6
6
 
7
- @import-glob "@baseComponents/**/*.css";
7
+ @import-glob "@sharedComponents/**/*.css";
8
8
  @import-glob "@appComponents/**/*.css";
9
9
  @import-glob "@bookComponents/**/*.css";
@@ -2,13 +2,10 @@
2
2
  @import "tailwindcss/components";
3
3
  @import "tailwindcss/utilities";
4
4
 
5
- @import "../libs/tippy";
6
- @import "./utils/colors";
7
- @import "./utils/icons";
8
- @import "./utils/text";
9
- @import "./components/tooltip";
10
- @import "./components/dropdown";
11
- @import "./components/coco";
5
+ @import "./shared/utils/colors";
6
+ @import "./shared/utils/icons";
7
+ @import "./shared/utils/text";
8
+ @import "./shared/tippy";
12
9
 
13
10
  @layer base {
14
11
  :root {
@@ -34,4 +31,14 @@
34
31
  [x-cloak] {
35
32
  display: none !important;
36
33
  }
34
+
35
+ [data-coco] {
36
+ @apply text-content-dark-1 font-body;
37
+ }
38
+
39
+ [x-dropdown] {
40
+ [x-dropdown\:content] {
41
+ @apply hidden;
42
+ }
43
+ }
37
44
  }
@@ -1,5 +1,5 @@
1
1
  @import "./book/config";
2
- @import "./base/base";
2
+ @import "./base";
3
3
 
4
- @import-glob "@baseComponents/**/*.css";
4
+ @import-glob "@sharedComponents/**/*.css";
5
5
  @import-glob "@bookComponents/**/*.css";
@@ -2,13 +2,14 @@
2
2
  @import "tippy.js/dist/svg-arrow";
3
3
  @import "tippy.js/dist/border.css";
4
4
 
5
+ /* Tippy */
5
6
  @layer components {
6
7
  [data-tippy-root] {
7
8
  @apply !z-[10010];
8
9
  }
9
10
 
10
11
  .tippy-box[data-theme^="coco-"] {
11
- @apply bg-transparent text-gray-900 text-label-md whitespace-normal;
12
+ @apply bg-transparent text-gray-900 coco-label-md whitespace-normal;
12
13
 
13
14
  .tippy-content {
14
15
  @apply p-0;
@@ -24,4 +25,22 @@
24
25
  @apply fill-transparent;
25
26
  }
26
27
  }
28
+
29
+ /* Tooltip theme */
30
+ .tippy-box[data-theme~="coco-tooltip"] {
31
+ @apply bg-background-dark-2 text-white coco-label-sm rounded-lg shadow-xl;
32
+
33
+ .tippy-content {
34
+ @apply px-3 py-2 truncate max-w-[240px];
35
+ }
36
+
37
+ /* arrow background */
38
+ .tippy-svg-arrow > svg:first-child {
39
+ @apply hidden;
40
+ }
41
+
42
+ .tippy-svg-arrow > svg:last-child {
43
+ @apply fill-gray-900;
44
+ }
45
+ }
27
46
  }
@@ -0,0 +1,143 @@
1
+ @layer utilities {
2
+ /* paragraphs */
3
+
4
+ .coco-para-lg {
5
+ @apply font-body text-para-lg;
6
+ }
7
+
8
+ .coco-para-md {
9
+ @apply font-body text-para-md;
10
+ }
11
+
12
+ .coco-para-sm {
13
+ @apply font-body text-para-sm;
14
+ }
15
+
16
+ .coco-para-xs {
17
+ @apply font-body text-para-xs;
18
+ }
19
+
20
+ /* labels */
21
+
22
+ .coco-label-lg {
23
+ @apply font-body text-label-lg font-semibold;
24
+ }
25
+
26
+ .coco-label-md {
27
+ @apply font-body text-label-md font-semibold;
28
+ }
29
+
30
+ .coco-label-sm {
31
+ @apply font-body text-label-sm font-semibold;
32
+ }
33
+
34
+ .coco-label-xs {
35
+ @apply font-body text-label-xs font-semibold;
36
+ }
37
+
38
+ .coco-label-xxs {
39
+ @apply font-body text-label-xxs font-semibold;
40
+ }
41
+
42
+ /* standard headings */
43
+
44
+ .coco-heading-1 {
45
+ @apply font-body text-heading-1 font-bold;
46
+ }
47
+
48
+ .coco-heading-2 {
49
+ @apply font-body text-heading-2 font-bold;
50
+ }
51
+
52
+ .coco-heading-3 {
53
+ @apply font-body text-heading-3 font-bold;
54
+ }
55
+
56
+ .coco-heading-4 {
57
+ @apply font-body text-heading-4 font-bold;
58
+ }
59
+
60
+ .coco-heading-5 {
61
+ @apply font-body text-heading-5 font-bold;
62
+ }
63
+
64
+ .coco-heading-6 {
65
+ @apply font-body text-heading-6 font-bold;
66
+ }
67
+
68
+ /* standard subheadings */
69
+
70
+ .coco-subheading-1 {
71
+ @apply font-body text-subheading-1 font-[500];
72
+ }
73
+
74
+ .coco-subheading-2 {
75
+ @apply font-body text-subheading-2 font-[500];
76
+ }
77
+
78
+ .coco-subheading-3 {
79
+ @apply font-body text-subheading-3 font-[500];
80
+ }
81
+
82
+ .coco-subheading-4 {
83
+ @apply font-body text-subheading-4 font-[500];
84
+ }
85
+
86
+ /* display headings */
87
+
88
+ .coco-display-1 {
89
+ @apply font-display text-display-1 font-bold;
90
+ }
91
+
92
+ .coco-display-2 {
93
+ @apply font-display text-display-2 font-bold;
94
+ }
95
+
96
+ .coco-display-3 {
97
+ @apply font-display text-display-3 font-bold;
98
+ }
99
+
100
+ .coco-display-4 {
101
+ @apply font-display text-display-4 font-bold;
102
+ }
103
+
104
+ /* branded headings */
105
+
106
+ .coco-branded-heading-1 {
107
+ @apply font-branded text-heading-1 font-bold;
108
+ }
109
+
110
+ .coco-branded-heading-2 {
111
+ @apply font-branded text-heading-2 font-bold;
112
+ }
113
+
114
+ .coco-branded-heading-3 {
115
+ @apply font-branded text-heading-3 font-bold;
116
+ }
117
+
118
+ .coco-branded-heading-4 {
119
+ @apply font-branded text-heading-4 font-bold;
120
+ }
121
+
122
+ .coco-branded-heading-5 {
123
+ @apply font-branded text-heading-5 font-bold;
124
+ }
125
+
126
+ /* branded display headings */
127
+
128
+ .coco-branded-display-1 {
129
+ @apply font-branded text-relaxed-display-1 font-bold;
130
+ }
131
+
132
+ .coco-branded-display-2 {
133
+ @apply font-branded text-relaxed-display-2 font-bold;
134
+ }
135
+
136
+ .coco-branded-display-3 {
137
+ @apply font-branded text-relaxed-display-3 font-bold;
138
+ }
139
+
140
+ .coco-branded-display-4 {
141
+ @apply font-branded text-relaxed-display-4 font-bold;
142
+ }
143
+ }
data/app/assets/js/app.js CHANGED
@@ -3,11 +3,11 @@ import packageJSON from "@/package.json" assert { type: "json" };
3
3
  console.info("Initializing Coco JS", packageJSON.version);
4
4
 
5
5
  import "container-query-polyfill";
6
- import Alpine from "@libs/alpine";
6
+ import Alpine from "@assets/js/libs/alpine";
7
7
 
8
8
  import "./app/setup";
9
9
 
10
- import "./base/components";
10
+ import "./shared/components";
11
11
  import "./book/components";
12
12
  import "./app/components";
13
13
 
@@ -1,8 +1,8 @@
1
1
  import "container-query-polyfill";
2
2
 
3
- import Alpine from "@libs/alpine";
3
+ import Alpine from "@assets/js/libs/alpine";
4
4
 
5
- import "./base/components";
5
+ import "./shared/components";
6
6
  import "./book/components";
7
7
 
8
8
  Alpine.start();
@@ -1,4 +1,4 @@
1
- import tippy from "@libs/tippy";
1
+ import tippy from "@assets/js/libs/tippy";
2
2
  import buildConfig from "../utils/tippy_modifiers";
3
3
  import { isObject } from "@helpers/lang";
4
4
  import { isNode } from "@helpers/dom";
@@ -1,4 +1,4 @@
1
- import tippy from "@libs/tippy";
1
+ import tippy from "@assets/js/libs/tippy";
2
2
  import buildConfig from "../utils/tippy_modifiers";
3
3
  import { setData } from "@helpers/alpine";
4
4