coveragebook_components 0.15.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/build/coco/app.css +1513 -1605
  3. data/app/assets/build/coco/app.js +35 -27
  4. data/app/assets/build/coco/book.css +1212 -1303
  5. data/app/assets/build/coco/book.js +10 -6
  6. data/app/assets/build/coco/coco.css +6908 -0
  7. data/app/assets/build/coco/coco.js +10 -6
  8. data/app/assets/build/coco/tailwind.preset.js +2759 -0
  9. data/app/assets/css/base/setup.css +0 -11
  10. data/app/assets/css/base/tippy.css +40 -43
  11. data/app/assets/css/base/utils/text.css +0 -210
  12. data/app/assets/css/coco.css +3 -0
  13. data/app/assets/css/plugins/aspect.js +27 -0
  14. data/app/assets/css/plugins/colors.js +30 -0
  15. data/app/assets/css/plugins/icons.js +17 -0
  16. data/app/assets/css/plugins/layout.js +15 -0
  17. data/app/assets/css/plugins/text.js +183 -0
  18. data/app/components/coco/app/nav_drawer/nav_drawer.css +2 -2
  19. data/app/components/coco/app/plan_card/plan_card.css +1 -1
  20. data/app/components/coco/buttons/button/button.css +5 -5
  21. data/app/components/coco/buttons/button_group/button_group.css +1 -1
  22. data/app/components/coco/buttons/color_picker_button/color_picker_button.css +1 -1
  23. data/app/components/coco/buttons/menu/menu.css +1 -1
  24. data/app/components/coco/buttons/menu_items/user_profile/user_profile.css +1 -1
  25. data/app/components/coco/indicators/badge/badge.css +1 -1
  26. data/app/components/coco/layout/panel/panel.css +1 -1
  27. data/app/components/coco/modals/modal/modal.css +1 -1
  28. data/app/components/coco/modals/modal_dialog/modal_dialog.css +1 -1
  29. data/app/components/coco/utilities/placeholder/placeholder.css +1 -1
  30. data/app/helpers/coco/integration_helper.rb +25 -3
  31. data/config/exports.js +0 -0
  32. data/config/tailwind.config.js +1 -83
  33. data/config/tailwind.preset.js +66 -0
  34. data/config/tokens.js +25 -21
  35. data/lib/coco.rb +1 -1
  36. metadata +12 -5
  37. data/app/assets/css/base/utils/colors.css +0 -30
  38. data/app/assets/css/base/utils/icons.css +0 -16
  39. data/app/assets/css/base/utils/layout.css +0 -13
@@ -65,7 +65,7 @@
65
65
  }
66
66
 
67
67
  .divider {
68
- @apply h-0 border-t border-gray-300;
68
+ @apply h-0 border-t border-coco-gray-300;
69
69
  }
70
70
  }
71
71
  }
@@ -16,7 +16,7 @@
16
16
  }
17
17
 
18
18
  .user-profile-email {
19
- @apply text-gray-500 label-sm italic truncate;
19
+ @apply text-coco-gray-500 label-sm italic truncate;
20
20
  }
21
21
  }
22
22
  }
@@ -24,7 +24,7 @@
24
24
  }
25
25
 
26
26
  &[data-theme="neutral-muted"] {
27
- @apply bg-gray-300 text-content-dark-3;
27
+ @apply bg-coco-gray-300 text-content-dark-3;
28
28
  }
29
29
 
30
30
  &[data-theme="primary"] {
@@ -8,7 +8,7 @@
8
8
 
9
9
  /* Only style Coco panels that are not rendered inside legacy panel components */
10
10
  &:not([data-component="panel"] [data-component="panel"]) {
11
- @apply block bg-content-light-1 border border-gray-300 shadow-md rounded-xl;
11
+ @apply block bg-content-light-1 border border-coco-gray-300 shadow-md rounded-xl;
12
12
 
13
13
  .panel-content {
14
14
  @apply block;
@@ -82,7 +82,7 @@
82
82
  @apply max-w-2xl mx-auto;
83
83
 
84
84
  [data-component="modal-dialog"] {
85
- @apply border border-gray-300 shadow-md rounded-xl;
85
+ @apply border border-coco-gray-300 shadow-md rounded-xl;
86
86
  }
87
87
  }
88
88
  }
@@ -9,7 +9,7 @@
9
9
 
10
10
  .modal-dialog-header {
11
11
  @apply relative flex items-center;
12
- @apply px-4 sm:px-8 h-14 sm:h-16 border-b border-gray-300 rounded-t-xl bg-white;
12
+ @apply px-4 sm:px-8 h-14 sm:h-16 border-b border-coco-gray-300 rounded-t-xl bg-white;
13
13
  }
14
14
 
15
15
  .modal-dialog-title {
@@ -3,7 +3,7 @@
3
3
  @apply p-4;
4
4
 
5
5
  &[data-boxed="true"] {
6
- @apply border border-dashed border-gray-400 bg-gray-50;
6
+ @apply border border-dashed border-coco-gray-400 bg-coco-gray-50;
7
7
  }
8
8
 
9
9
  &[data-prose="true"] {
@@ -1,11 +1,33 @@
1
1
  module Coco
2
2
  module IntegrationHelper
3
- def coco_stylesheet_tag(context, dev: ENV["COCO_PATH"], **)
3
+ def coco_stylesheet_tag(context = "coco", dev: ENV["COCO_PATH"], **)
4
4
  stylesheet_link_tag("coco#{"/dev" if dev}/#{context}", **)
5
5
  end
6
6
 
7
- def coco_stylesheet_file_path(context, dev: ENV["COCO_PATH"], **opts)
8
- File.join(Coco::Engine.root, "app/assets/build/coco#{"/dev" if dev}/#{context}.css")
7
+ def coco_stylesheet_file_path(...)
8
+ IntegrationHelper.stylesheet_file_path(...)
9
+ end
10
+
11
+ def coco_javascript_file_path(...)
12
+ IntegrationHelper.javascript_file_path(...)
13
+ end
14
+
15
+ def coco_tailwind_preset_path(...)
16
+ IntegrationHelper.tailwind_preset_path(...)
17
+ end
18
+
19
+ class << self
20
+ def stylesheet_file_path(context = "coco", dev: ENV["COCO_PATH"], **opts)
21
+ File.join(Coco::Engine.root, "app/assets/build/coco#{"/dev" if dev}/#{context}.css")
22
+ end
23
+
24
+ def javascript_file_path(context = "coco", dev: ENV["COCO_PATH"], **opts)
25
+ File.join(Coco::Engine.root, "app/assets/build/coco#{"/dev" if dev}/#{context}.js")
26
+ end
27
+
28
+ def tailwind_preset_path
29
+ File.join(Coco::Engine.root, "app/assets/build/coco/tailwind.preset.js")
30
+ end
9
31
  end
10
32
  end
11
33
  end
data/config/exports.js ADDED
File without changes
@@ -1,94 +1,12 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
2
 
3
- const defaultTheme = require("tailwindcss/defaultTheme");
4
3
  const { cocoPath } = require("./utils.js");
5
- const { fontSize, fontFamily, colors, screens } = require("./tokens.js");
6
4
 
7
5
  module.exports = {
6
+ presets: [require("./tailwind.preset.js")],
8
7
  content: [
9
8
  cocoPath("@components/**/*.{erb,rb,js}", true),
10
9
  cocoPath("@assets/**/*.{erb,rb}", true),
11
- cocoPath("@previews/**/*.{erb,rb}", true),
12
- ],
13
- safelist: [
14
- {
15
- pattern: /tippy-.+/,
16
- },
17
10
  ],
18
11
  blocklist: ["container"],
19
- theme: {
20
- colors,
21
- screens,
22
- fontFamily: {
23
- display: [fontFamily.displaySans, ...defaultTheme.fontFamily.sans],
24
- body: [fontFamily.bodySans, ...defaultTheme.fontFamily.sans],
25
- branded: [fontFamily.displaySerif, ...defaultTheme.fontFamily.serif],
26
- },
27
- extend: {
28
- fontSize,
29
- containers: {
30
- "slide-fluid": "700px",
31
- },
32
- aspectRatio: {
33
- slide: "16 / 10",
34
- },
35
- animation: {
36
- spin: "spin 1.5s linear infinite",
37
- "spin-reverse": "spin 1.5s linear infinite reverse",
38
- },
39
- spacing: {
40
- 13: "3.25rem",
41
- 15: "3.75rem",
42
- 18: "4.5rem",
43
- },
44
- customForms: () => ({
45
- DEFAULT: {
46
- checkbox: {
47
- "&:indeterminate": {
48
- background:
49
- "url(\"data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='8' height='2' x='4' y='7' rx='1'/%3E%3C/svg%3E\");",
50
- borderColor: "transparent",
51
- backgroundColor: "currentColor",
52
- backgroundSize: "100% 100%",
53
- backgroundPosition: "center",
54
- backgroundRepeat: "no-repeat",
55
- },
56
- },
57
- },
58
- }),
59
- },
60
- },
61
- corePlugins: {
62
- aspectRatio: false,
63
- },
64
- plugins: [
65
- require("@tailwindcss/forms"),
66
- require("@tailwindcss/container-queries"),
67
-
68
- ({ matchUtilities, theme }) => {
69
- // Safari 14-compatible aspect ratio
70
- matchUtilities(
71
- {
72
- aspect: (value) => ({
73
- "@supports (aspect-ratio: 1 / 1)": {
74
- aspectRatio: value,
75
- },
76
- "@supports not (aspect-ratio: 1 / 1)": {
77
- "&::before": {
78
- content: '""',
79
- float: "left",
80
- paddingTop: `calc(100% / (${value}))`,
81
- },
82
- "&::after": {
83
- clear: "left",
84
- content: '""',
85
- display: "block",
86
- },
87
- },
88
- }),
89
- },
90
- { values: theme("aspectRatio") }
91
- );
92
- },
93
- ],
94
12
  };
@@ -0,0 +1,66 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+
3
+ const defaultTheme = require("tailwindcss/defaultTheme");
4
+ const { fontSize, fontFamily, colors, screens } = require("./tokens.js");
5
+
6
+ module.exports = {
7
+ theme: {
8
+ colors,
9
+ screens,
10
+ fontFamily: {
11
+ display: [fontFamily.displaySans, ...defaultTheme.fontFamily.sans],
12
+ body: [fontFamily.bodySans, ...defaultTheme.fontFamily.sans],
13
+ branded: [fontFamily.displaySerif, ...defaultTheme.fontFamily.serif],
14
+ },
15
+ extend: {
16
+ fontSize,
17
+ containers: {
18
+ "slide-fluid": "700px",
19
+ },
20
+ aspectRatio: {
21
+ slide: "16 / 10",
22
+ },
23
+ animation: {
24
+ spin: "spin 1.5s linear infinite",
25
+ "spin-reverse": "spin 1.5s linear infinite reverse",
26
+ },
27
+ spacing: {
28
+ 4.5: "1.125rem",
29
+ 5.5: "1.375rem",
30
+ 6.5: "1.675rem",
31
+ 7.5: "1.875rem",
32
+ 13: "3.25rem",
33
+ 15: "3.75rem",
34
+ 17: "4.25rem",
35
+ 18: "4.5rem",
36
+ },
37
+ customForms: () => ({
38
+ DEFAULT: {
39
+ checkbox: {
40
+ "&:indeterminate": {
41
+ background:
42
+ "url(\"data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='8' height='2' x='4' y='7' rx='1'/%3E%3C/svg%3E\");",
43
+ borderColor: "transparent",
44
+ backgroundColor: "currentColor",
45
+ backgroundSize: "100% 100%",
46
+ backgroundPosition: "center",
47
+ backgroundRepeat: "no-repeat",
48
+ },
49
+ },
50
+ },
51
+ }),
52
+ },
53
+ },
54
+ corePlugins: {
55
+ aspectRatio: false,
56
+ },
57
+ plugins: [
58
+ require("@tailwindcss/forms"),
59
+ require("@tailwindcss/container-queries"),
60
+ require("../app/assets/css/plugins/colors.js"),
61
+ require("../app/assets/css/plugins/icons.js"),
62
+ require("../app/assets/css/plugins/layout.js"),
63
+ require("../app/assets/css/plugins/text.js"),
64
+ require("../app/assets/css/plugins/aspect.js"),
65
+ ],
66
+ };
data/config/tokens.js CHANGED
@@ -3,17 +3,21 @@ const colors = {
3
3
  current: "currentColor",
4
4
  black: "#000000",
5
5
  white: "#FFFFFF",
6
+ coco: {
7
+ gray: {
8
+ 50: "#F9FAFB",
9
+ 100: "#F3F4F6",
10
+ 200: "#E5E7EB",
11
+ 300: "#D1D5DB",
12
+ 400: "#9CA3AF",
13
+ 500: "#6B7280",
14
+ 600: "#4B5563",
15
+ 700: "#374151",
16
+ 800: "#1F2937",
17
+ 900: "#111827",
18
+ },
19
+ },
6
20
  gray: {
7
- 50: "#F9FAFB",
8
- 100: "#F3F4F6",
9
- 200: "#E5E7EB",
10
- 300: "#D1D5DB",
11
- 400: "#9CA3AF",
12
- 500: "#6B7280",
13
- 600: "#4B5563",
14
- 700: "#374151",
15
- 800: "#1F2937",
16
- 900: "#111827",
17
21
  transparent: {
18
22
  50: "rgba(0, 12, 39, 0.06)",
19
23
  100: "rgba(0, 12, 39, 0.1)",
@@ -104,13 +108,13 @@ const colorAliases = {
104
108
  },
105
109
  light: {
106
110
  1: colors.white,
107
- 2: colors.gray[50],
108
- 3: colors.gray[100],
111
+ 2: colors.coco.gray[50],
112
+ 3: colors.coco.gray[100],
109
113
  },
110
114
  dark: {
111
- 1: colors.gray[900],
112
- 2: colors.gray[800],
113
- 3: colors.gray[700],
115
+ 1: colors.coco.gray[900],
116
+ 2: colors.coco.gray[800],
117
+ 3: colors.coco.gray[700],
114
118
  },
115
119
  primary: {
116
120
  DEFAULT: colors.green[500],
@@ -135,15 +139,15 @@ const colorAliases = {
135
139
  },
136
140
  content: {
137
141
  dark: {
138
- 1: colors.gray[900],
139
- 2: colors.gray[800],
140
- 3: colors.gray[600],
141
- muted: colors.gray[400],
142
+ 1: colors.coco.gray[900],
143
+ 2: colors.coco.gray[800],
144
+ 3: colors.coco.gray[600],
145
+ muted: colors.coco.gray[400],
142
146
  },
143
147
  light: {
144
148
  1: colors.white,
145
- 2: colors.gray[200],
146
- muted: colors.gray[400],
149
+ 2: colors.coco.gray[200],
150
+ muted: colors.coco.gray[400],
147
151
  },
148
152
  primary: {
149
153
  DEFAULT: colors.green[500],
data/lib/coco.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.15.0"
2
+ VERSION = "0.16.0"
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.15.0
4
+ version: 0.16.0
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-18 00:00:00.000000000 Z
11
+ date: 2024-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -63,6 +63,7 @@ files:
63
63
  - app/assets/build/coco/app.js
64
64
  - app/assets/build/coco/book.css
65
65
  - app/assets/build/coco/book.js
66
+ - app/assets/build/coco/coco.css
66
67
  - app/assets/build/coco/coco.js
67
68
  - app/assets/build/coco/icons/a-arrow-down.svg
68
69
  - app/assets/build/coco/icons/a-arrow-up.svg
@@ -1451,16 +1452,20 @@ files:
1451
1452
  - app/assets/build/coco/img/test/slides/slide-bg.jpg
1452
1453
  - app/assets/build/coco/img/test/slides/slide-foreground-landscape.jpg
1453
1454
  - app/assets/build/coco/img/test/slides/slide-foreground-portrait.jpg
1455
+ - app/assets/build/coco/tailwind.preset.js
1454
1456
  - app/assets/config/coco/manifest.js
1455
1457
  - app/assets/css/app.css
1456
1458
  - app/assets/css/base/config.css
1457
1459
  - app/assets/css/base/setup.css
1458
1460
  - app/assets/css/base/tippy.css
1459
- - app/assets/css/base/utils/colors.css
1460
- - app/assets/css/base/utils/icons.css
1461
- - app/assets/css/base/utils/layout.css
1462
1461
  - app/assets/css/base/utils/text.css
1463
1462
  - app/assets/css/book.css
1463
+ - app/assets/css/coco.css
1464
+ - app/assets/css/plugins/aspect.js
1465
+ - app/assets/css/plugins/colors.js
1466
+ - app/assets/css/plugins/icons.js
1467
+ - app/assets/css/plugins/layout.js
1468
+ - app/assets/css/plugins/text.js
1464
1469
  - app/assets/custom_icons/other/eye-off-red.svg
1465
1470
  - app/assets/custom_icons/other/google-sso.svg
1466
1471
  - app/assets/custom_icons/other/layout-overlay.svg
@@ -1763,9 +1768,11 @@ files:
1763
1768
  - app/helpers/coco/integration_helper.rb
1764
1769
  - app/helpers/coco/modal_helper.rb
1765
1770
  - app/helpers/coco/tag_helper.rb
1771
+ - config/exports.js
1766
1772
  - config/icons.json
1767
1773
  - config/locales/coco.en.yml
1768
1774
  - config/tailwind.config.js
1775
+ - config/tailwind.preset.js
1769
1776
  - config/tokens.js
1770
1777
  - config/utils.js
1771
1778
  - lib/coco.rb
@@ -1,30 +0,0 @@
1
- @layer utilities {
2
- /* Transparent gray blend-mode background utilities */
3
-
4
- .bg-gray-blend-50 {
5
- @apply bg-gray-transparent-50;
6
- background-blend-mode: hard-light;
7
- }
8
-
9
- .bg-gray-blend-100 {
10
- @apply bg-gray-transparent-100;
11
- background-blend-mode: hard-light;
12
- }
13
-
14
- .bg-gray-blend-200 {
15
- @apply bg-gray-transparent-200;
16
- background-blend-mode: hard-light;
17
- }
18
-
19
- .border-gray-blend-50 {
20
- @apply border-gray-transparent-50;
21
- }
22
-
23
- .border-gray-blend-100 {
24
- @apply border-gray-transparent-100;
25
- }
26
-
27
- .border-gray-blend-200 {
28
- @apply border-gray-transparent-200;
29
- }
30
- }
@@ -1,16 +0,0 @@
1
- @layer utilities {
2
- .icon {
3
- }
4
-
5
- .icon-stroke {
6
- @apply fill-none stroke-2 stroke-current text-current;
7
- stroke-linecap: round;
8
- stroke-linejoin: round;
9
- }
10
-
11
- .icon-fill {
12
- @apply fill-current text-current;
13
- stroke-linecap: round;
14
- stroke-linejoin: round;
15
- }
16
- }
@@ -1,13 +0,0 @@
1
- @layer utilities {
2
- .pl-app {
3
- @apply pl-3 sm:pl-6 md:pl-8 lg:pl-10 xl:pl-11;
4
- }
5
-
6
- .pr-app {
7
- @apply pr-3 sm:pr-6 md:pr-8 lg:pr-10 xl:pr-11;
8
- }
9
-
10
- .px-app {
11
- @apply pl-app pr-app;
12
- }
13
- }