epages-essence 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +4 -3
  4. data/app/assets/images/essence/icon_component/arrow_right.svg +1 -0
  5. data/app/assets/images/essence/icon_component/chevron_up_down.svg +3 -0
  6. data/app/assets/images/essence/icon_component/power_off.svg +1 -0
  7. data/app/assets/images/essence/icon_component/sparkles.svg +1 -0
  8. data/app/assets/images/essence/icon_component/x_mark.svg +3 -0
  9. data/app/assets/stylesheets/essence/beyond/{_base.scss → layout/base.css} +0 -5
  10. data/app/assets/stylesheets/essence/beyond/layout/{_content.scss → content.css} +1 -1
  11. data/app/assets/stylesheets/essence/beyond/simple_form/control.css +249 -0
  12. data/app/assets/stylesheets/essence/beyond/simple_form/error.css +29 -0
  13. data/app/assets/stylesheets/essence/beyond/simple_form/fieldset.css +32 -0
  14. data/app/assets/stylesheets/essence/beyond/simple_form/group.css +21 -0
  15. data/app/assets/stylesheets/essence/beyond/simple_form/hint.css +6 -0
  16. data/app/assets/stylesheets/essence/beyond/simple_form/label.css +38 -0
  17. data/app/assets/stylesheets/essence/beyond/simple_form/row.css +5 -0
  18. data/app/assets/stylesheets/essence/beyond/simple_form/wrapper.css +3 -0
  19. data/app/assets/stylesheets/essence/beyond/utils/margin.css +15 -0
  20. data/app/assets/stylesheets/essence/beyond/variables.css +281 -0
  21. data/app/assets/stylesheets/essence/beyond.css +39 -0
  22. data/app/components/essence/action_bar_component/action_bar_component.css +23 -0
  23. data/app/components/essence/action_bar_component.rb +2 -1
  24. data/app/components/essence/app_info_component/app_info_component.css +45 -0
  25. data/app/components/essence/application_component.rb +1 -3
  26. data/app/components/essence/breadcrumb_component/breadcrumb_component.css +35 -0
  27. data/app/components/essence/button_component/button_component.css +140 -0
  28. data/app/components/essence/button_component/button_component.html.erb +2 -0
  29. data/app/components/essence/button_component/button_component_controller.js +27 -0
  30. data/app/components/essence/button_component.rb +27 -2
  31. data/app/components/essence/button_group_component/button_group_component.css +21 -0
  32. data/app/components/essence/button_group_component/button_group_component.html.erb +5 -0
  33. data/app/components/essence/button_group_component.rb +28 -0
  34. data/app/components/essence/card_component/card_component.css +66 -0
  35. data/app/components/essence/card_component/card_component.html.erb +6 -0
  36. data/app/components/essence/card_component/ribbon_component.html.erb +3 -0
  37. data/app/components/essence/card_component.rb +38 -4
  38. data/app/components/essence/clipboard_copy_component/{clipboard_copy_component.scss → clipboard_copy_component.css} +4 -4
  39. data/app/components/essence/empty_state_component/empty_state_component.css +42 -0
  40. data/app/components/essence/expandable_component/expandable_component.css +36 -0
  41. data/app/components/essence/expandable_component/expandable_component.html.erb +8 -0
  42. data/app/components/essence/expandable_component/expandable_component_controller.js +32 -0
  43. data/app/components/essence/expandable_component.rb +30 -0
  44. data/app/components/essence/expandable_toggle_component/expandable_toggle_component.css +7 -0
  45. data/app/components/essence/expandable_toggle_component/expandable_toggle_component.html.erb +3 -0
  46. data/app/components/essence/expandable_toggle_component/expandable_toggle_component.yml +4 -0
  47. data/app/components/essence/expandable_toggle_component/expandable_toggle_component_controller.js +52 -0
  48. data/app/components/essence/expandable_toggle_component.rb +38 -0
  49. data/app/components/essence/flash_component/container_component.html.erb +7 -0
  50. data/app/components/essence/flash_component/flash_component.css +101 -0
  51. data/app/components/essence/flash_component/flash_component.html.erb +11 -0
  52. data/app/components/essence/flash_component/flash_component_controller.js +24 -0
  53. data/app/components/essence/flash_component.rb +29 -0
  54. data/app/components/essence/link_component/link_component.css +49 -0
  55. data/app/components/essence/notification_component/notification_component.css +55 -0
  56. data/app/components/essence/notification_component.rb +6 -2
  57. data/app/components/essence/paragraph_component/{paragraph_component.scss → paragraph_component.css} +0 -5
  58. data/app/components/essence/scroll_shadow_component/{scroll_shadow_component.scss → scroll_shadow_component.css} +4 -0
  59. data/app/components/essence/spinner_component/{spinner_component.scss → spinner_component.css} +5 -12
  60. data/app/components/essence/spinner_component/spinner_component.html.erb +1 -1
  61. data/app/components/essence/spinner_component.rb +4 -2
  62. data/app/components/essence/status_component/status_component.css +64 -0
  63. data/app/components/essence/status_component.rb +1 -1
  64. data/app/components/essence/step_list_component/step_list_component.css +72 -0
  65. data/app/components/essence/step_list_component/step_list_component.html.erb +3 -1
  66. data/app/components/essence/step_list_component.rb +7 -1
  67. data/app/components/essence/table_component/{table_component.scss → table_component.css} +5 -8
  68. data/app/components/essence/title_component/{title_component.scss → title_component.css} +0 -4
  69. data/app/components/essence/tooltip_component/tooltip_component.css +55 -0
  70. data/app/inputs/file_input.rb +73 -0
  71. data/app/javascript/essence/application.js +2 -2
  72. data/app/javascript/essence/controllers/file_input_controller.js +41 -0
  73. data/app/javascript/essence/controllers/index.js +18 -3
  74. data/app/views/essence/beyond/body.html.erb +1 -0
  75. data/config/importmap.rb +3 -0
  76. data/config/initializers/essence/inline_svg.rb +5 -0
  77. data/config/initializers/essence/simple_form.rb +29 -8
  78. data/config/locales/essence.en.yml +3 -0
  79. data/lib/components/input_group.rb +19 -0
  80. data/lib/essence/engine.rb +20 -5
  81. data/lib/essence/version.rb +1 -1
  82. data/lib/essence.rb +1 -1
  83. data/vendor/assets/stylesheets/essence/flexboxgrid.css +824 -0
  84. metadata +78 -53
  85. data/app/assets/config/essence_manifest.js +0 -5
  86. data/app/assets/stylesheets/essence/beyond/components/_index.scss +0 -17
  87. data/app/assets/stylesheets/essence/beyond/layout/_index.scss +0 -1
  88. data/app/assets/stylesheets/essence/beyond/simple_form/_control.scss +0 -172
  89. data/app/assets/stylesheets/essence/beyond/simple_form/_error.scss +0 -27
  90. data/app/assets/stylesheets/essence/beyond/simple_form/_fieldset.scss +0 -34
  91. data/app/assets/stylesheets/essence/beyond/simple_form/_group.scss +0 -6
  92. data/app/assets/stylesheets/essence/beyond/simple_form/_hint.scss +0 -8
  93. data/app/assets/stylesheets/essence/beyond/simple_form/_index.scss +0 -43
  94. data/app/assets/stylesheets/essence/beyond/simple_form/_label.scss +0 -26
  95. data/app/assets/stylesheets/essence/beyond/simple_form/_wrapper.scss +0 -5
  96. data/app/assets/stylesheets/essence/beyond.scss +0 -4
  97. data/app/components/essence/action_bar_component/action_bar_component.scss +0 -29
  98. data/app/components/essence/app_info_component/app_info_component.scss +0 -45
  99. data/app/components/essence/breadcrumb_component/breadcrumb_component.scss +0 -39
  100. data/app/components/essence/button_component/button_component.scss +0 -105
  101. data/app/components/essence/card_component/card_component.scss +0 -21
  102. data/app/components/essence/empty_state_component/empty_state_component.scss +0 -50
  103. data/app/components/essence/link_component/link_component.scss +0 -58
  104. data/app/components/essence/notification_component/notification_component.scss +0 -63
  105. data/app/components/essence/status_component/status_component.scss +0 -80
  106. data/app/components/essence/step_list_component/step_list_component.scss +0 -79
  107. data/app/components/essence/tooltip_component/tooltip_component.scss +0 -63
@@ -0,0 +1,281 @@
1
+ /**
2
+ * @tokens baseColors
3
+ * @presenter Color
4
+ */
5
+ :root {
6
+ /*
7
+ /* ---------------------------------------------------
8
+ /* Brand
9
+ /* --------------------------------------------------- */
10
+ --primary-color: Orange;
11
+ --secondary-color: #383838;
12
+ --tertiary-color: DeepSkyBlue;
13
+ /*
14
+ /* ---------------------------------------------------
15
+ /* Global layout
16
+ /* --------------------------------------------------- */
17
+ --workspace-text: #3e3e3e;
18
+ --workspace-background: #e6e6e6;
19
+ --workspace-border: #d2d2d2;
20
+ --workspace-headline: #676767;
21
+ --padding: 40px;
22
+ --borderRadius: 3px;
23
+ --surfaceHover-color: #b3ecff;
24
+ /*
25
+ /* ---------------------------------------------------
26
+ /* Card
27
+ /* --------------------------------------------------- */
28
+ --card-headline: #a3a3a3;
29
+ --card-background: white;
30
+ --card-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
31
+ --card-divider-border: 1px solid #e6e6e6;
32
+ --card-borderRadius: 3px;
33
+ --card-padding: 40px;
34
+ /*
35
+ /* ---------------------------------------------------
36
+ /* Breadcrumb
37
+ /* --------------------------------------------------- */
38
+ --breadcrumb-text: #787878;
39
+ --breadcrumb-link: #787878;
40
+ --breadcrumb-link-hover: #525252;
41
+ --breadcrumb-icon: #787878;
42
+ /*
43
+ /* ---------------------------------------------------
44
+ /* Action bar
45
+ /* --------------------------------------------------- */
46
+ --workspace-toolbar-background: white;
47
+ --workspace-toolbar-border: 1px solid rgba(0, 0, 0, 0.2);
48
+ --header-bar-height: 73px;
49
+ /*
50
+ /* ---------------------------------------------------
51
+ /* Notification and Toast messages
52
+ /* --------------------------------------------------- */
53
+ --notification-background: white;
54
+ --notification-text: gray;
55
+ --notification-borderRadius: 4px;
56
+ --notification-boxShadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
57
+ --notification-success: #97c344;
58
+ --notification-info: #999999;
59
+ --notification-warning: #f3b547;
60
+ --notification-danger: #da3c3c;
61
+ /*
62
+ /* ---------------------------------------------------
63
+ /* Modal
64
+ /* --------------------------------------------------- */
65
+ --modal-overlay-background: rgba(0, 0, 0, 0.75);
66
+ --modal-container-background: white;
67
+ --modal-container-borderRadius: 3px;
68
+ --modal-closeButton-icon: #8b8b8b;
69
+ --modal-closeButton-icon-hover: #717171;
70
+ --modal-container-padding: 40px;
71
+ /*
72
+ /* ---------------------------------------------------
73
+ /* Empty states
74
+ /* --------------------------------------------------- */
75
+ --emptyState-surface: #e3e3e3;
76
+ --emptyState-bubbles: #dedede;
77
+ --emptyState-outline: #575757;
78
+ --emptyState-headline: #676767;
79
+ --emptyState-help-text: gray;
80
+ /*
81
+ /* ---------------------------------------------------
82
+ /* Loading spinner
83
+ /* --------------------------------------------------- */
84
+ --spinner-border: #c0c0c0;
85
+ --spinner-border-highlighting: #676767;
86
+ /*
87
+ /* ---------------------------------------------------
88
+ /* States
89
+ /* --------------------------------------------------- */
90
+ --danger-color: #da3c3c;
91
+ --success-color: #97c344;
92
+ --warning-color: #f3b547;
93
+ --disabled-color: #d0d0d0;
94
+ --default-color: #999999;
95
+ /*
96
+ /* ---------------------------------------------------
97
+ /* Status bubbles
98
+ /* --------------------------------------------------- */
99
+ --todo-status-background: #f9dca7;
100
+ --todo-status-text: #af740b;
101
+ --todo-status-icon: #f0a217;
102
+ --active-status-background: #cde2a5;
103
+ --active-status-text: #4e6721;
104
+ --active-status-icon: #8ab43a;
105
+ --danger-status-background: #eeb3a7;
106
+ --danger-status-text: #c72626;
107
+ --danger-status-icon: #e46f6f;
108
+ --outline-status-background: transparent;
109
+ --outline-status-border: #b3b3b3;
110
+ --outline-status-text: #808080;
111
+ --outline-status-icon: #cdcdcd;
112
+ /*
113
+ /* ---------------------------------------------------
114
+ /* Link
115
+ /* --------------------------------------------------- */
116
+ --primaryLink-color: DeepSkyBlue;
117
+ --primaryLink-hover-color: #0099cc;
118
+ --secondaryLink-color: #787878;
119
+ --secondaryLink-hover-color: #5e5e5e;
120
+ --dangerLink-color: #da3c3c;
121
+ --dangerLink-hover-color: #bf2424;
122
+ --defaultLink-color: #787878;
123
+ --defaultLink-hover-color: #5e5e5e;
124
+ /*
125
+ /* ---------------------------------------------------
126
+ /* Buttons
127
+ /* --------------------------------------------------- */
128
+ --button-text: white;
129
+ --button-borderRadius: 4px;
130
+ --button-borderBottom-width: 2px;
131
+ --button-horizontal-padding: calc(8px - 2px / 2);
132
+ --button-primary-background: Orange;
133
+ --button-primary-background-hover: #cc8400;
134
+ --button-primary-borderBottom-color: #cc8400;
135
+ --button-secondary-background: #999999;
136
+ --button-secondary-background-hover: #7f7f7f;
137
+ --button-secondary-borderBottom-color: #7f7f7f;
138
+ --button-danger-background: #da3c3c;
139
+ --button-danger-background-hover: #ae3535;
140
+ --button-danger-borderBottom-color: #ae3535;
141
+ --button-disabled-background: #d0d0d0;
142
+ --button-disabled-borderBottom-color: #aaaaaa;
143
+ --button-disabled-text: #909090;
144
+ --button-disabled-textShadow: 1px 1px 0 #ffffff;
145
+ --button-outline-border-color: Orange;
146
+ --button-outline-border-width: 1px;
147
+ --button-outline-borderBottom-width: 2px;
148
+ --button-outline-background: transparent;
149
+ --button-outline-background-hover: #ffedcc;
150
+ --button-outline-text: #eb9800;
151
+ --button-link-primary-text: DeepSkyBlue;
152
+ --button-link-secondary-text: #787878;
153
+ --button-default-background: #999999;
154
+ --button-default-background-hover: #7f7f7f;
155
+ --button-default-borderBottom-color: #7f7f7f;
156
+ --button-link-default-text: #787878;
157
+ /*
158
+ /* ---------------------------------------------------
159
+ /* Copilot
160
+ /* --------------------------------------------------- */
161
+ --button-copilot-background: linear-gradient(
162
+ 90deg,
163
+ oklch(from Orange calc(l - 0.1) c h),
164
+ Orange,
165
+ oklch(from Orange calc(l + 0.1) c h),
166
+ Orange,
167
+ oklch(from Orange calc(l - 0.1) c h)
168
+ );
169
+ --button-copilot-borderBottom-color: Orange;
170
+ /*
171
+ /* ---------------------------------------------------
172
+ /* RichTextEditor
173
+ /* --------------------------------------------------- */
174
+ --textEditor-text: #3e3e3e;
175
+ --textEditor-background: white;
176
+ --textEditor-border-color: #d2d2d2;
177
+ --textEditor-border-radius: 3px;
178
+ --textEditor-toolbar-background: #f3f3f3;
179
+ --textEditor-toolbar-border-color: #d2d2d2;
180
+ --textEditor-button-background: #f3f3f3;
181
+ --textEditor-button-background-hover: #e6e6e6;
182
+ --textEditor-button-active-background: #d4d4d4;
183
+ --textEditor-button-icon: #676767;
184
+ --textEditor-button-icon-disabled: #b3b3b3;
185
+ /*
186
+ /* ---------------------------------------------------
187
+ /* Table
188
+ /* --------------------------------------------------- */
189
+ --table-row-border: 1px solid #e6e6e6;
190
+ --table-row-background: white;
191
+ --table-row-background-hover: #b3ecff;
192
+ --table-header-background: #ebebeb;
193
+ --table-header-link: #3e3e3e;
194
+ --table-header-link-hover: #252525;
195
+ --table-header-sort-icon-default: #b3b3b3;
196
+ --table-header-sort-icon: currentcolor;
197
+ /*
198
+ /* ---------------------------------------------------
199
+ /* Media queries
200
+ /* --------------------------------------------------- */
201
+ --screen-xs-max: 47.9375em;
202
+ --screen-sm: 48em;
203
+ --screen-sm-max: 61.9375em;
204
+ --screen-md: 62em;
205
+ --screen-md-max: 74.9375em;
206
+ --screen-lg: 75em;
207
+ --screen-lg-max: 112.4375em;
208
+ --screen-xl: 112.5em;
209
+ /*
210
+ /* ---------------------------------------------------
211
+ /* Form elements
212
+ /* --------------------------------------------------- */
213
+ --formGroup-label: gray;
214
+ --formGroup-validation-error: #da3c3c;
215
+ --formGroup-validation-text: white;
216
+ --formGroup-validation-borderRadius: 3px;
217
+ --inputField-borderRadius: 3px;
218
+ --inputField-border: #d2d2d2;
219
+ --inputField-border-focus: Orange;
220
+ --inputField-text: #3e3e3e;
221
+ --inputField-background: white;
222
+ --inputField-background-focus: white;
223
+ --inputField-background-disabled: #f5f5f5;
224
+ --inputField-text-disabled: #9a9a9a;
225
+ --inputField-placeholder-text: #a4a4a4;
226
+ --inputField-hint-text: gray;
227
+ --smartInputField-suggestion-active: #b3ecff;
228
+ --smartInputField-value-background: #d9d9d9;
229
+ --smartInputField-value-text: #666666;
230
+ --smartInputField-value-icon: currentcolor;
231
+ --smartInputField-value-icon-hover: #4d4d4d;
232
+ --smartInputField-value-borderRadius: 3px;
233
+ /*
234
+ /* ---------------------------------------------------
235
+ /* Checkboxes and Radio buttons
236
+ /* --------------------------------------------------- */
237
+ --check-color: #97c344;
238
+ --uncheck-color: #b3b3b3;
239
+ --check-disabled-text: #c5c5c5;
240
+ --check-disabled-icon: #d9d9d9;
241
+ /*
242
+ /* ---------------------------------------------------
243
+ /* FlipSwitch
244
+ /* --------------------------------------------------- */
245
+ --flipSwitch-unchecked-background: #b3b3b3;
246
+ --flipSwitch-checked-background: #97c344;
247
+ --flipSwitch-border: #c0c0c0;
248
+ --flipSwitch-label: gray;
249
+ --flipSwitch-text: silver;
250
+ /*
251
+ /* ---------------------------------------------------
252
+ /* Step list
253
+ /* --------------------------------------------------- */
254
+ --stepList-background: #f0f0f0;
255
+ --stepList-headline: #747474;
256
+ --stepList-bubble-line: #808080;
257
+ --stepList-bubble-background: #808080;
258
+ --stepList-bubble-text: white;
259
+ /*
260
+ /* ---------------------------------------------------
261
+ /* Reseller logo
262
+ /* --------------------------------------------------- */
263
+ --logo-width: 238px;
264
+ --logo-height: 76px;
265
+ /*
266
+ /* ---------------------------------------------------
267
+ /* Gray scale colors
268
+ /* --------------------------------------------------- */
269
+ --white: white;
270
+ --gray: gray;
271
+ --silver: silver;
272
+ /*
273
+ /* ---------------------------------------------------
274
+ /* Tooltip
275
+ /* --------------------------------------------------- */
276
+ --tooltip-icon: Orange;
277
+ --tooltip-background: white;
278
+ --tooltip-text: #3e3e3e;
279
+ --tooltip-borderRadius: 3px;
280
+ --tooltip-boxShadow: 0 0 14px 0 rgba(0, 0, 0, 0.4);
281
+ }
@@ -0,0 +1,39 @@
1
+ @import url("beyond/variables.css");
2
+
3
+ @import url("beyond/layout/base.css");
4
+ @import url("beyond/layout/content.css");
5
+
6
+ @import url("flexboxgrid.css");
7
+
8
+ @import url("beyond/simple_form/control.css");
9
+ @import url("beyond/simple_form/error.css");
10
+ @import url("beyond/simple_form/fieldset.css");
11
+ @import url("beyond/simple_form/group.css");
12
+ @import url("beyond/simple_form/hint.css");
13
+ @import url("beyond/simple_form/label.css");
14
+ @import url("beyond/simple_form/row.css");
15
+ @import url("beyond/simple_form/wrapper.css");
16
+
17
+ @import url("beyond/utils/margin.css");
18
+
19
+ @import url("action_bar_component/action_bar_component.css");
20
+ @import url("app_info_component/app_info_component.css");
21
+ @import url("breadcrumb_component/breadcrumb_component.css");
22
+ @import url("button_component/button_component.css");
23
+ @import url("button_group_component/button_group_component.css");
24
+ @import url("card_component/card_component.css");
25
+ @import url("clipboard_copy_component/clipboard_copy_component.css");
26
+ @import url("empty_state_component/empty_state_component.css");
27
+ @import url("expandable_component/expandable_component.css");
28
+ @import url("expandable_toggle_component/expandable_toggle_component.css");
29
+ @import url("flash_component/flash_component.css");
30
+ @import url("link_component/link_component.css");
31
+ @import url("notification_component/notification_component.css");
32
+ @import url("paragraph_component/paragraph_component.css");
33
+ @import url("scroll_shadow_component/scroll_shadow_component.css");
34
+ @import url("spinner_component/spinner_component.css");
35
+ @import url("status_component/status_component.css");
36
+ @import url("step_list_component/step_list_component.css");
37
+ @import url("table_component/table_component.css");
38
+ @import url("title_component/title_component.css");
39
+ @import url("tooltip_component/tooltip_component.css");
@@ -0,0 +1,23 @@
1
+ .action-bar {
2
+ background-color: var(--workspace-toolbar-background);
3
+ border-bottom: var(--workspace-toolbar-border);
4
+ height: var(--header-bar-height);
5
+ position: sticky;
6
+ top: 0;
7
+ z-index: 1;
8
+ }
9
+
10
+ .action-bar-wrapper {
11
+ align-items: center;
12
+ display: flex;
13
+ height: 100%;
14
+ justify-content: space-between;
15
+ padding: 0 25px;
16
+ }
17
+
18
+ .action-bar-left-content,
19
+ .action-bar-right-content {
20
+ align-items: center;
21
+ display: flex;
22
+ gap: 30px;
23
+ }
@@ -7,7 +7,8 @@ module Essence
7
7
  [:left, :right].each do |side|
8
8
  renders_many side, types: {
9
9
  button: ButtonComponent,
10
- link: LinkComponent
10
+ link: LinkComponent,
11
+ button_group: ButtonGroupComponent
11
12
  }
12
13
  end
13
14
 
@@ -0,0 +1,45 @@
1
+ .app-info {
2
+ display: grid;
3
+ grid-template-columns: 10fr 2fr;
4
+ column-gap: 30px;
5
+ grid-auto-rows: minmax(auto, max-content);
6
+ }
7
+
8
+ .app-info-headline {
9
+ color: var(--card-headline);
10
+ font-size: 190%;
11
+ font-weight: normal;
12
+ line-height: 1;
13
+ }
14
+
15
+ .app-info-sub-headline {
16
+ margin-top: 15px;
17
+ font-size: 110%;
18
+ color: var(--workspace-headline);
19
+ font-weight: bold;
20
+ line-height: 1;
21
+ }
22
+
23
+ .app-info-text {
24
+ ul {
25
+ padding-left: 24px;
26
+
27
+ li {
28
+ list-style: none;
29
+
30
+ &::before {
31
+ background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M9 21.035l-9-8.638 2.791-2.87 6.156 5.874 12.21-12.436 2.843 2.817z"/></svg>');
32
+ content: '';
33
+ background-size: contain;
34
+ display: inline-block;
35
+ width: 10px;
36
+ height: 10px;
37
+ margin-right: 6px;
38
+ }
39
+ }
40
+ }
41
+ }
42
+
43
+ .app-info-logo {
44
+ width: 100%;
45
+ }
@@ -15,9 +15,7 @@ module Essence
15
15
  end
16
16
  end
17
17
 
18
- def assets_path
19
- self.class.assets_path
20
- end
18
+ delegate :assets_path, to: :class
21
19
 
22
20
  private
23
21
 
@@ -0,0 +1,35 @@
1
+ .breadcrumb {
2
+ font-size: 90%;
3
+ display: flex;
4
+ align-items: center;
5
+ }
6
+
7
+ .breadcrumb-icon {
8
+ fill: var(--breadcrumb-icon);
9
+
10
+ &:first-child {
11
+ width: 12px;
12
+ height: 12px;
13
+ margin-right: 4px;
14
+ margin-bottom: 3px;
15
+ }
16
+
17
+ &:not(:first-child) {
18
+ width: 8px;
19
+ height: 8px;
20
+ margin: 0 10px;
21
+ }
22
+ }
23
+
24
+ .breadcrumb-item {
25
+ color: var(--breadcrumb-link);
26
+ text-decoration: none;
27
+
28
+ &:hover {
29
+ color: var(--breadcrumb-link-hover);
30
+ }
31
+ }
32
+
33
+ .breadcrumb-current {
34
+ color: var(--breadcrumb-text);
35
+ }
@@ -0,0 +1,140 @@
1
+ .button {
2
+ border: 0;
3
+ border-bottom-style: solid;
4
+ border-bottom-width: var(--button-borderBottom-width);
5
+ border-radius: var(--button-borderRadius);
6
+ color: var(--button-text);
7
+ cursor: pointer;
8
+ display: inline-flex;
9
+ font-weight: bold;
10
+ height: fit-content;
11
+ line-height: 1;
12
+ padding: var(--button-horizontal-padding) 12px;
13
+ position: relative;
14
+ text-decoration: none;
15
+ transition: all 0.4s cubic-bezier(0, 0, 0.1, 1);
16
+ width: fit-content;
17
+ white-space: nowrap;
18
+
19
+ &:disabled,
20
+ &.button-busy {
21
+ background: var(--button-disabled-background);
22
+ border-color: var(--button-disabled-background);
23
+ border-bottom-color: var(--button-disabled-borderBottom-color);
24
+ color: var(--button-disabled-text);
25
+ cursor: default;
26
+ text-shadow: var(--button-disabled-textShadow);
27
+ }
28
+
29
+ &:not(:disabled):not(.button-busy) {
30
+ &.button-primary {
31
+ background: var(--button-primary-background);
32
+ border-bottom-color: var(--button-primary-borderBottom-color);
33
+
34
+ &:hover {
35
+ background: var(--button-primary-background-hover);
36
+ }
37
+ }
38
+
39
+ &.button-secondary {
40
+ background: var(--button-secondary-background);
41
+ border-bottom-color: var(--button-secondary-borderBottom-color);
42
+
43
+ &:hover {
44
+ background: var(--button-secondary-background-hover);
45
+ }
46
+ }
47
+
48
+ &.button-danger {
49
+ background: var(--button-danger-background);
50
+ border-bottom-color: var(--button-danger-borderBottom-color);
51
+
52
+ &:hover {
53
+ background: var(--button-danger-background-hover);
54
+ }
55
+ }
56
+
57
+ &.button-outline {
58
+ background-color: var(--button-outline-background);
59
+ border: var(--button-outline-border-width) solid
60
+ var(--button-outline-border-color);
61
+ border-bottom-width: var(--button-outline-borderBottom-width);
62
+ color: var(--button-outline-text);
63
+ padding-top: calc(var(--button-horizontal-padding) - 1px);
64
+
65
+ &:hover {
66
+ background-color: var(--button-outline-background-hover);
67
+ }
68
+ }
69
+
70
+ &.button-copilot {
71
+ background-image: var(--button-copilot-background);
72
+ background-size: 200% auto;
73
+ border-bottom-color: var(--button-copilot-borderBottom-color);
74
+ transition: background-position 0.3s ease;
75
+
76
+ &::before {
77
+ content: "";
78
+ width: 17px;
79
+ background-color: var(--button-text);
80
+ mask: url("data:image/svg+xml,%3Csvg data-token-category='icons' xmlns='http://www.w3.org/2000/svg' width='83.75' height='67.98' viewBox='0 0 83.75 67.98'%3E%3Cpath d='M83 32.98l-8.7-1c-11.2-1.4-20.1-10.2-21.4-21.4l-1-8.7c-.1-1-1.6-1-1.7 0l-1 8.7c-1.4 11.2-10.2 20.1-21.4 21.4l-8.7 1c-1 .1-1 1.6 0 1.7l8.7 1c11.2 1.4 20.1 10.2 21.4 21.4l1 8.7c.1 1 1.6 1 1.7 0l1-8.7c1.4-11.2 10.2-20.1 21.4-21.4l8.7-1c1-.1 1-1.6 0-1.7zM2.2 15.48l4 .5c5.1.6 9.2 4.6 9.8 9.8l.5 4c.1.5.8.5.8 0l.5-4c.6-5.1 4.6-9.2 9.8-9.8l4-.5c.5-.1.5-.8 0-.8l-4-.5c-5.1-.6-9.2-4.6-9.8-9.8l-.5-4c-.1-.5-.8-.5-.8 0l-.5 4c-.6 5.1-4.6 9.2-9.8 9.8l-4 .5c-.5.1-.5.8 0 .8zm23.2 39.3l-3.4-.4c-4.4-.5-7.9-4-8.4-8.4l-.4-3.4c-.1-.4-.7-.4-.7 0l-.4 3.4c-.5 4.4-4 7.9-8.4 8.4l-3.4.4c-.4.1-.4.7 0 .7l3.4.4c4.4.5 7.9 4 8.4 8.4l.4 3.4c.1.4.7.4.7 0l.4-3.4c.5-4.4 4-7.9 8.4-8.4l3.4-.4c.4-.1.4-.7 0-.7z'%3E%3C/path%3E%3C/svg%3E%0A")
81
+ no-repeat center;
82
+ mask-size: contain;
83
+ -webkit-mask: url("data:image/svg+xml,%3Csvg data-token-category='icons' xmlns='http://www.w3.org/2000/svg' width='83.75' height='67.98' viewBox='0 0 83.75 67.98'%3E%3Cpath d='M83 32.98l-8.7-1c-11.2-1.4-20.1-10.2-21.4-21.4l-1-8.7c-.1-1-1.6-1-1.7 0l-1 8.7c-1.4 11.2-10.2 20.1-21.4 21.4l-8.7 1c-1 .1-1 1.6 0 1.7l8.7 1c11.2 1.4 20.1 10.2 21.4 21.4l1 8.7c.1 1 1.6 1 1.7 0l1-8.7c1.4-11.2 10.2-20.1 21.4-21.4l8.7-1c1-.1 1-1.6 0-1.7zM2.2 15.48l4 .5c5.1.6 9.2 4.6 9.8 9.8l.5 4c.1.5.8.5.8 0l.5-4c.6-5.1 4.6-9.2 9.8-9.8l4-.5c.5-.1.5-.8 0-.8l-4-.5c-5.1-.6-9.2-4.6-9.8-9.8l-.5-4c-.1-.5-.8-.5-.8 0l-.5 4c-.6 5.1-4.6 9.2-9.8 9.8l-4 .5c-.5.1-.5.8 0 .8zm23.2 39.3l-3.4-.4c-4.4-.5-7.9-4-8.4-8.4l-.4-3.4c-.1-.4-.7-.4-.7 0l-.4 3.4c-.5 4.4-4 7.9-8.4 8.4l-3.4.4c-.4.1-.4.7 0 .7l3.4.4c4.4.5 7.9 4 8.4 8.4l.4 3.4c.1.4.7.4.7 0l.4-3.4c.5-4.4 4-7.9 8.4-8.4l3.4-.4c.4-.1.4-.7 0-.7z'%3E%3C/path%3E%3C/svg%3E%0A")
84
+ no-repeat center;
85
+ -webkit-mask-size: contain;
86
+ margin-right: 7px;
87
+ }
88
+
89
+ &:hover {
90
+ background-position: 100%;
91
+ }
92
+ }
93
+ }
94
+
95
+ &.button-busy {
96
+ &::before {
97
+ display: none;
98
+ }
99
+
100
+ .button-spinner {
101
+ display: block;
102
+ }
103
+ }
104
+
105
+ .button-spinner {
106
+ display: none;
107
+ position: relative;
108
+ height: 14px;
109
+ width: 22px;
110
+ margin-right: 10px;
111
+
112
+ &::after {
113
+ content: "";
114
+ position: absolute;
115
+ top: -4px;
116
+ left: 0;
117
+ border: solid 3px #aaa;
118
+ border-bottom-color: var(--button-disabled-text);
119
+ border-radius: 50%;
120
+ height: var(--spinner-size);
121
+ width: var(--spinner-size);
122
+ animation: spin 1.5s infinite linear;
123
+ transform-origin: center;
124
+ }
125
+ }
126
+
127
+ .button-icon {
128
+ fill: currentColor;
129
+ height: 14px;
130
+ width: 14px;
131
+
132
+ &:first-child {
133
+ margin-right: 5px;
134
+ }
135
+
136
+ &:last-child {
137
+ margin-left: 6px;
138
+ }
139
+ }
140
+ }
@@ -1,12 +1,14 @@
1
1
  <% if url.present? %>
2
2
  <%= button_to url, **html_options do %>
3
3
  <%= left_icon if left_icon? %>
4
+ <%= render Essence::SpinnerComponent.new(size: 22, class: 'button-spinner') if display_as_button? %>
4
5
  <span><%= name %></span>
5
6
  <%= right_icon if right_icon? %>
6
7
  <% end %>
7
8
  <% else %>
8
9
  <%= button_tag **html_options do %>
9
10
  <%= left_icon if left_icon? %>
11
+ <%= render Essence::SpinnerComponent.new(size: 22, class: 'button-spinner') if display_as_button? %>
10
12
  <span><%= name %></span>
11
13
  <%= right_icon if right_icon? %>
12
14
  <% end %>
@@ -0,0 +1,27 @@
1
+ import { Controller } from "@hotwired/stimulus";
2
+
3
+ export default class extends Controller {
4
+ connect() {
5
+ const button = this.element
6
+ const formId = button.getAttribute("form")
7
+
8
+ this.form = formId
9
+ ? document.getElementById(formId)
10
+ : button.closest("form")
11
+
12
+ if (!this.form) return
13
+
14
+ this._start = () => button.classList.add("button-busy")
15
+ this._end = () => button.classList.remove("button-busy")
16
+
17
+ this.form.addEventListener("turbo:submit-start", this._start)
18
+ this.form.addEventListener("turbo:submit-end", this._end)
19
+ }
20
+
21
+ disconnect() {
22
+ if (!this.form) return
23
+
24
+ this.form.removeEventListener("turbo:submit-start", this._start)
25
+ this.form.removeEventListener("turbo:submit-end", this._end)
26
+ }
27
+ }
@@ -8,12 +8,15 @@ module Essence
8
8
 
9
9
  DEFAULT_VARIANT = :primary
10
10
 
11
+ DEFAULT_BUSY = false
12
+
11
13
  BUTTON_MAPPINGS = {
12
14
  DEFAULT_DISPLAY_AS => {
13
15
  DEFAULT_VARIANT => 'button-primary',
14
16
  secondary: 'button-secondary',
15
17
  danger: 'button-danger',
16
- outline: 'button-outline'
18
+ outline: 'button-outline',
19
+ copilot: 'button-copilot'
17
20
  }
18
21
  }.freeze
19
22
 
@@ -31,11 +34,13 @@ module Essence
31
34
  url: nil,
32
35
  variant: DEFAULT_VARIANT,
33
36
  display_as: DEFAULT_DISPLAY_AS,
37
+ busy: DEFAULT_BUSY,
34
38
  **html_options)
35
39
  @name = name
36
40
  @url = url
37
41
  @variant = fetch_or_fallback(VARIANT_MAPPINGS[display_as.to_sym].keys, variant.to_sym, DEFAULT_VARIANT)
38
42
  @display_as = fetch_or_fallback(DISPLAY_AS_OPTIONS, display_as.to_sym, DEFAULT_DISPLAY_AS)
43
+ @busy = fetch_or_fallback_boolean(busy, fallback: DEFAULT_BUSY)
39
44
  @html_options = html_options
40
45
  end
41
46
 
@@ -43,9 +48,29 @@ module Essence
43
48
 
44
49
  def before_render
45
50
  set_base_html_options(
51
+ *css_classes,
52
+ **options
53
+ )
54
+ end
55
+
56
+ def css_classes
57
+ classes = [
46
58
  @display_as.to_s,
47
59
  VARIANT_MAPPINGS.dig(@display_as.to_sym, @variant.to_sym)
48
- )
60
+ ]
61
+ classes << 'button-busy' if @busy && display_as_button?
62
+
63
+ classes
64
+ end
65
+
66
+ def options
67
+ return {} unless display_as_button?
68
+
69
+ { data: { controller: 'button' } }
70
+ end
71
+
72
+ def display_as_button?
73
+ @display_as == :button
49
74
  end
50
75
  end
51
76
  end