katalyst-koi 4.18.1 → 5.0.0.alpha.2

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 (222) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/koi/icons/add.svg +3 -0
  3. data/app/assets/images/koi/icons/close.svg +1 -0
  4. data/app/assets/images/koi/koi.png +0 -0
  5. data/app/assets/javascripts/koi/controllers/file_field_controller.js +2 -2
  6. data/app/assets/javascripts/koi/controllers/index.js +0 -3
  7. data/app/assets/javascripts/koi/controllers/koi/modal_controller.js +40 -0
  8. data/app/assets/javascripts/koi/controllers/navigation_controller.js +14 -21
  9. data/app/assets/javascripts/koi/controllers/webauthn_registration_controller.js +4 -1
  10. data/app/assets/stylesheets/koi/blocks/actions.css +8 -0
  11. data/app/assets/stylesheets/koi/blocks/application-header.css +15 -0
  12. data/app/assets/stylesheets/koi/blocks/application-navigation.css +54 -0
  13. data/app/assets/stylesheets/koi/blocks/button.css +90 -0
  14. data/app/assets/stylesheets/koi/blocks/flash.css +19 -0
  15. data/app/assets/stylesheets/koi/blocks/icon.css +15 -0
  16. data/app/assets/stylesheets/koi/blocks/index.css +13 -0
  17. data/app/assets/stylesheets/koi/blocks/modal.css +26 -0
  18. data/app/assets/stylesheets/koi/blocks/navigation.css +23 -0
  19. data/app/assets/stylesheets/koi/blocks/page-header.css +31 -0
  20. data/app/assets/stylesheets/koi/blocks/pagy.css +82 -0
  21. data/app/assets/stylesheets/koi/blocks/prose.css +37 -0
  22. data/app/assets/stylesheets/koi/blocks/tables/index.css +4 -0
  23. data/app/assets/stylesheets/koi/{components/_query.scss → blocks/tables/query.css} +13 -13
  24. data/app/assets/stylesheets/koi/{base/_tables.scss → blocks/tables/table.css} +12 -60
  25. data/app/assets/stylesheets/koi/compositions/cover.css +17 -0
  26. data/app/assets/stylesheets/koi/{base/_flow.scss → compositions/flow.css} +1 -1
  27. data/app/assets/stylesheets/koi/compositions/index.css +4 -0
  28. data/app/assets/stylesheets/koi/compositions/wrapper.css +11 -0
  29. data/app/assets/stylesheets/koi/forms/caption.css +22 -0
  30. data/app/assets/stylesheets/koi/forms/checkboxes.css +153 -0
  31. data/app/assets/stylesheets/koi/forms/date-input.css +12 -0
  32. data/app/assets/stylesheets/koi/{components/_document-field.scss → forms/document-field.css} +20 -15
  33. data/app/assets/stylesheets/koi/forms/errors.css +38 -0
  34. data/app/assets/stylesheets/koi/forms/fieldset.css +73 -0
  35. data/app/assets/stylesheets/koi/forms/file-upload.css +20 -0
  36. data/app/assets/stylesheets/koi/forms/form-group.css +19 -0
  37. data/app/assets/stylesheets/koi/forms/hint.css +11 -0
  38. data/app/assets/stylesheets/koi/forms/image-field.css +96 -0
  39. data/app/assets/stylesheets/koi/forms/index.css +44 -0
  40. data/app/assets/stylesheets/koi/forms/input.css +194 -0
  41. data/app/assets/stylesheets/koi/forms/label.css +43 -0
  42. data/app/assets/stylesheets/koi/forms/password.css +18 -0
  43. data/app/assets/stylesheets/koi/forms/radios.css +162 -0
  44. data/app/assets/stylesheets/koi/forms/select.css +18 -0
  45. data/app/assets/stylesheets/koi/forms/textarea.css +3 -0
  46. data/app/assets/stylesheets/koi/forms/trix.css +33 -0
  47. data/app/assets/stylesheets/koi/global/fonts.css +22 -0
  48. data/app/assets/stylesheets/koi/global/global-styles.css +297 -0
  49. data/app/assets/stylesheets/koi/global/reset.css +98 -0
  50. data/app/assets/stylesheets/koi/global/variables.css +97 -0
  51. data/app/assets/stylesheets/koi/icons.css +14 -0
  52. data/app/assets/stylesheets/koi/index.css +17 -0
  53. data/app/assets/stylesheets/koi/login.css +26 -0
  54. data/app/assets/stylesheets/koi/utilities/index.css +1 -0
  55. data/app/assets/stylesheets/koi/utilities/visually-hidden.css +18 -0
  56. data/app/components/concerns/koi/tables/cells.rb +3 -3
  57. data/app/components/koi/header_component.html.erb +12 -11
  58. data/app/components/koi/header_component.rb +2 -0
  59. data/app/components/koi/table_component.rb +8 -0
  60. data/app/controllers/admin/admin_users_controller.rb +24 -18
  61. data/app/controllers/admin/application_controller.rb +1 -3
  62. data/app/controllers/admin/credentials_controller.rb +18 -14
  63. data/app/controllers/admin/otps_controller.rb +15 -13
  64. data/app/controllers/admin/sessions_controller.rb +12 -1
  65. data/app/controllers/admin/url_rewrites_controller.rb +19 -17
  66. data/app/controllers/admin/well_knowns_controller.rb +20 -18
  67. data/app/controllers/concerns/koi/controller.rb +37 -0
  68. data/app/helpers/koi/form_helper.rb +18 -0
  69. data/app/helpers/koi/header_helper.rb +122 -0
  70. data/app/helpers/koi/index_actions_helper.rb +3 -2
  71. data/app/helpers/koi/modal_helper.rb +71 -0
  72. data/app/models/admin/user.rb +7 -1
  73. data/app/models/url_rewrite.rb +1 -9
  74. data/app/views/admin/admin_users/_form.html+self.erb +8 -0
  75. data/app/views/admin/admin_users/_form.html.erb +8 -0
  76. data/app/views/admin/admin_users/archived.html.erb +7 -4
  77. data/app/views/admin/admin_users/edit.html+self.erb +12 -0
  78. data/app/views/admin/admin_users/edit.html.erb +13 -8
  79. data/app/views/admin/admin_users/index.html.erb +10 -5
  80. data/app/views/admin/admin_users/new.html.erb +8 -8
  81. data/app/views/admin/admin_users/show.html+self.erb +26 -14
  82. data/app/views/admin/admin_users/show.html.erb +22 -20
  83. data/app/views/admin/credentials/_credentials.html+self.erb +8 -6
  84. data/app/views/admin/credentials/_credentials.html.erb +3 -1
  85. data/app/views/admin/credentials/create.turbo_stream.erb +4 -3
  86. data/app/views/admin/credentials/destroy.turbo_stream.erb +4 -2
  87. data/app/views/admin/credentials/new.html.erb +42 -36
  88. data/app/views/admin/dashboards/show.html.erb +13 -1
  89. data/app/views/admin/otps/_form.html.erb +7 -7
  90. data/app/views/admin/otps/create.turbo_stream.erb +3 -3
  91. data/app/views/admin/otps/new.html.erb +5 -3
  92. data/app/views/admin/sessions/new.html.erb +2 -3
  93. data/app/views/admin/sessions/otp.html.erb +1 -3
  94. data/app/views/admin/sessions/password.html.erb +1 -3
  95. data/app/views/admin/tokens/show.html.erb +4 -6
  96. data/app/views/admin/url_rewrites/_form.html.erb +9 -0
  97. data/app/views/admin/url_rewrites/edit.html.erb +13 -9
  98. data/app/views/admin/url_rewrites/index.html.erb +10 -7
  99. data/app/views/admin/url_rewrites/new.html.erb +8 -8
  100. data/app/views/admin/url_rewrites/show.html.erb +17 -12
  101. data/app/views/admin/well_knowns/_form.html.erb +9 -0
  102. data/app/views/admin/well_knowns/edit.html.erb +13 -9
  103. data/app/views/admin/well_knowns/index.html.erb +8 -5
  104. data/app/views/admin/well_knowns/new.html.erb +8 -8
  105. data/app/views/admin/well_knowns/show.html.erb +14 -13
  106. data/app/views/katalyst/content/asides/_aside.html+form.erb +6 -4
  107. data/app/views/katalyst/content/columns/_column.html+form.erb +5 -3
  108. data/app/views/katalyst/content/contents/_content.html+form.erb +8 -6
  109. data/app/views/katalyst/content/figures/_figure.html+form.erb +8 -5
  110. data/app/views/katalyst/content/groups/_group.html+form.erb +5 -3
  111. data/app/views/katalyst/content/items/_item.html+form.erb +5 -3
  112. data/app/views/katalyst/content/sections/_section.html+form.erb +5 -3
  113. data/app/views/katalyst/content/tables/_table.html+form.erb +16 -11
  114. data/app/views/katalyst/navigation/items/_button.html.erb +6 -12
  115. data/app/views/katalyst/navigation/items/_heading.html.erb +3 -10
  116. data/app/views/katalyst/navigation/items/_link.html.erb +6 -11
  117. data/app/views/katalyst/navigation/menus/edit.html.erb +10 -6
  118. data/app/views/katalyst/navigation/menus/index.html.erb +4 -2
  119. data/app/views/katalyst/navigation/menus/new.html.erb +5 -3
  120. data/app/views/katalyst/navigation/menus/show.html.erb +8 -7
  121. data/app/views/layouts/koi/_application_header.html.erb +20 -0
  122. data/app/views/layouts/koi/_application_navigation.html.erb +34 -0
  123. data/app/views/layouts/koi/_flash.html.erb +6 -3
  124. data/app/views/layouts/koi/_navigation_header.html.erb +0 -2
  125. data/app/views/layouts/koi/application.html.erb +22 -27
  126. data/app/views/layouts/koi/frame.html.erb +1 -3
  127. data/app/views/layouts/koi/login.html.erb +12 -5
  128. data/config/locales/koi.en.yml +9 -1
  129. data/config/routes.rb +1 -1
  130. data/lib/generators/koi/admin/admin_generator.rb +3 -13
  131. data/lib/generators/koi/admin_controller/admin_controller_generator.rb +6 -16
  132. data/lib/generators/koi/admin_controller/templates/controller.rb.tt +82 -18
  133. data/lib/generators/koi/admin_controller/templates/controller_spec.rb.tt +113 -47
  134. data/lib/generators/koi/admin_route/admin_route_generator.rb +60 -6
  135. data/lib/generators/koi/admin_views/USAGE +18 -7
  136. data/lib/generators/koi/admin_views/admin_views_generator.rb +19 -11
  137. data/lib/generators/koi/admin_views/templates/_form.html.erb.tt +8 -0
  138. data/lib/generators/koi/admin_views/templates/archived.html.erb.tt +33 -0
  139. data/lib/generators/koi/admin_views/templates/edit.html.erb.tt +17 -9
  140. data/lib/generators/koi/admin_views/templates/index.html.erb.tt +31 -3
  141. data/lib/generators/koi/admin_views/templates/new.html.erb.tt +8 -8
  142. data/lib/generators/koi/admin_views/templates/show.html.erb.tt +15 -18
  143. data/lib/generators/koi/helpers/attribute_helpers.rb +147 -0
  144. data/lib/generators/koi/helpers/attribute_types.rb +218 -0
  145. data/lib/generators/koi/helpers/resource_helpers.rb +121 -0
  146. data/lib/generators/koi/{active_record/active_record_generator.rb → model/model_generator.rb} +1 -1
  147. data/lib/koi/config.rb +3 -1
  148. data/lib/koi/engine.rb +0 -9
  149. data/lib/koi/form/builder.rb +4 -4
  150. data/lib/koi/form/content.rb +55 -0
  151. data/lib/koi/form/elements/document.rb +1 -1
  152. data/lib/koi/form/elements/image.rb +1 -1
  153. data/lib/koi/form_builder.rb +1 -0
  154. data/lib/koi/menu.rb +14 -1
  155. data/spec/factories/admins.rb +1 -1
  156. metadata +90 -103
  157. data/app/assets/builds/koi/admin.css +0 -1
  158. data/app/assets/stylesheets/koi/admin.scss +0 -27
  159. data/app/assets/stylesheets/koi/base/_button.scss +0 -122
  160. data/app/assets/stylesheets/koi/base/_icon.scss +0 -29
  161. data/app/assets/stylesheets/koi/base/_index.scss +0 -21
  162. data/app/assets/stylesheets/koi/base/_input.scss +0 -19
  163. data/app/assets/stylesheets/koi/base/_link.scss +0 -26
  164. data/app/assets/stylesheets/koi/base/_list.scss +0 -11
  165. data/app/assets/stylesheets/koi/base/_typography.scss +0 -160
  166. data/app/assets/stylesheets/koi/components/_actions-group.scss +0 -7
  167. data/app/assets/stylesheets/koi/components/_image-field.scss +0 -95
  168. data/app/assets/stylesheets/koi/components/_index.scss +0 -9
  169. data/app/assets/stylesheets/koi/components/_pagy.scss +0 -29
  170. data/app/assets/stylesheets/koi/components/_summary-list.scss +0 -40
  171. data/app/assets/stylesheets/koi/layouts/_banner.scss +0 -7
  172. data/app/assets/stylesheets/koi/layouts/_content.scss +0 -40
  173. data/app/assets/stylesheets/koi/layouts/_flash.scss +0 -41
  174. data/app/assets/stylesheets/koi/layouts/_header.scss +0 -61
  175. data/app/assets/stylesheets/koi/layouts/_index.scss +0 -48
  176. data/app/assets/stylesheets/koi/layouts/_main.scss +0 -23
  177. data/app/assets/stylesheets/koi/layouts/_navigation.scss +0 -180
  178. data/app/assets/stylesheets/koi/layouts/_stack.scss +0 -13
  179. data/app/assets/stylesheets/koi/pages/_index.scss +0 -1
  180. data/app/assets/stylesheets/koi/pages/_login.scss +0 -46
  181. data/app/assets/stylesheets/koi/themes/_content.scss +0 -62
  182. data/app/assets/stylesheets/koi/themes/_govuk.scss +0 -56
  183. data/app/assets/stylesheets/koi/themes/_index.scss +0 -5
  184. data/app/assets/stylesheets/koi/themes/_kpop.scss +0 -5
  185. data/app/assets/stylesheets/koi/themes/_navigation.scss +0 -5
  186. data/app/assets/stylesheets/koi/themes/_trix.scss +0 -32
  187. data/app/assets/stylesheets/koi/utils/_breakpoints.scss +0 -13
  188. data/app/assets/stylesheets/koi/utils/_hide.scss +0 -11
  189. data/app/assets/stylesheets/koi/utils/_index.scss +0 -2
  190. data/app/assets/stylesheets/koi/utils/_typography.scss +0 -42
  191. data/app/components/koi/content/editor/item_form_component.html.erb +0 -11
  192. data/app/components/koi/content/editor/item_form_component.rb +0 -94
  193. data/app/components/koi/summary_list/attachment_component.rb +0 -47
  194. data/app/components/koi/summary_list/base.rb +0 -59
  195. data/app/components/koi/summary_list/boolean_component.rb +0 -15
  196. data/app/components/koi/summary_list/date_component.rb +0 -17
  197. data/app/components/koi/summary_list/datetime_component.rb +0 -17
  198. data/app/components/koi/summary_list/item_component.rb +0 -26
  199. data/app/components/koi/summary_list/number_component.rb +0 -21
  200. data/app/components/koi/summary_list/rich_text_component.rb +0 -8
  201. data/app/components/koi/summary_list/text_component.rb +0 -8
  202. data/app/components/koi/summary_list_component.html.erb +0 -5
  203. data/app/components/koi/summary_list_component.rb +0 -75
  204. data/app/controllers/concerns/koi/controller/is_admin_controller.rb +0 -66
  205. data/app/helpers/koi/application_helper.rb +0 -7
  206. data/app/helpers/koi/date_helper.rb +0 -26
  207. data/app/helpers/koi/definition_list_helper.rb +0 -10
  208. data/app/views/admin/admin_users/_fields.html+self.erb +0 -3
  209. data/app/views/admin/admin_users/_fields.html.erb +0 -3
  210. data/app/views/admin/url_rewrites/_fields.html.erb +0 -4
  211. data/app/views/admin/well_knowns/_fields.html.erb +0 -6
  212. data/app/views/layouts/koi/_environment.html.erb +0 -4
  213. data/app/views/layouts/koi/_header.html.erb +0 -11
  214. data/app/views/layouts/koi/_navigation.html.erb +0 -23
  215. data/app/views/layouts/koi/_navigation_collapse.html.erb +0 -3
  216. data/lib/generators/koi/admin_views/templates/_fields.html.erb.tt +0 -3
  217. data/lib/generators/koi/helpers/admin_generator_attributes.rb +0 -66
  218. data/lib/koi/extensions/dartsass.rb +0 -23
  219. /data/app/assets/stylesheets/koi/{components/_clipboard.scss → blocks/clipboard.css} +0 -0
  220. /data/app/assets/stylesheets/koi/{components/_index-actions.scss → blocks/index-actions.css} +0 -0
  221. /data/app/assets/stylesheets/koi/{components/_toolbar.scss → blocks/toolbar.css} +0 -0
  222. /data/app/assets/stylesheets/koi/{base/_repel.scss → compositions/repel.css} +0 -0
@@ -0,0 +1,297 @@
1
+ /*
2
+ Global styles
3
+
4
+ Low-specificity, global styles that apply to the whole
5
+ project: https://cube.fyi/css.html
6
+ */
7
+
8
+ body {
9
+ background: var(--color-light);
10
+ color: var(--color-dark);
11
+ font-size: var(--size-step-0);
12
+ font-family: var(--font-base);
13
+ line-height: var(--leading-standard);
14
+ font-size-adjust: from-font;
15
+ margin: 0;
16
+ }
17
+
18
+ main {
19
+ container-type: inline-size;
20
+ }
21
+
22
+ /* Headings */
23
+
24
+ :is(h1, h2, h3, h4) {
25
+ line-height: var(--leading-fine);
26
+ text-wrap: balance;
27
+ }
28
+
29
+ h1 {
30
+ font-size: var(--size-step-5);
31
+ max-width: 20ch;
32
+ }
33
+
34
+ h2 {
35
+ font-size: var(--size-step-4);
36
+ max-width: 35ch;
37
+ }
38
+
39
+ h3 {
40
+ font-size: var(--size-step-3);
41
+ max-width: 35ch;
42
+ }
43
+
44
+ :is(h4, h5, h6) {
45
+ font-size: var(--size-step-2);
46
+ }
47
+
48
+ small {
49
+ font-size: var(--size-step--1);
50
+ }
51
+
52
+ ins {
53
+ text-decoration: none;
54
+ background: var(--color-primary);
55
+ color: var(--color-light);
56
+ padding-inline: 0.3em;
57
+ }
58
+
59
+ /* Code */
60
+
61
+ :is(code, kbd, samp) {
62
+ font-family: var(--font-mono);
63
+ padding: 0.2em 0.2em 0.05em 0.2em;
64
+ hyphens: none;
65
+ tab-size: 2;
66
+ text-align: left;
67
+ word-spacing: normal;
68
+ word-break: normal;
69
+ word-wrap: normal;
70
+ box-decoration-break: clone;
71
+ }
72
+
73
+ /* This is quite a new property, so we want code styles to at least, not be huge or tiny */
74
+ @supports not (font-size-adjust: from-font) {
75
+ :is(code, kbd, samp) {
76
+ font-size: 0.8em;
77
+ }
78
+ }
79
+
80
+ pre:has(code) {
81
+ width: max-content;
82
+ max-width: 100%;
83
+ overflow-x: auto;
84
+ }
85
+
86
+ pre code {
87
+ border: none;
88
+ background: none;
89
+ padding: 0;
90
+ }
91
+
92
+ kbd {
93
+ border: none;
94
+ outline: 1px solid;
95
+ padding-block-end: 0.1em;
96
+ }
97
+
98
+ var {
99
+ font-style: normal;
100
+ font-weight: var(--font-medium);
101
+ }
102
+
103
+ q {
104
+ font-style: italic;
105
+ }
106
+
107
+ /* Lists */
108
+
109
+ ul:not([class]) {
110
+ padding-inline-start: 1.7ch;
111
+ list-style-type: disc;
112
+ }
113
+
114
+ ul:not([class]) > li {
115
+ padding-inline-start: var(--space-xs);
116
+ }
117
+
118
+ :is(ol, ul):not([class]) li + * {
119
+ margin-block-start: var(--flow-space, var(--space-xs));
120
+ }
121
+
122
+ ul ::marker {
123
+ font-size: 0.8lh;
124
+ }
125
+
126
+ ol ::marker {
127
+ font-size: 1em;
128
+ font-weight: var(--font-bold);
129
+ }
130
+
131
+ /* Lists with classes and roles will be out of standard flow, so remove the default spacing */
132
+ [role="list"],
133
+ [role="tablist"] {
134
+ margin-block: 0;
135
+ padding: 0;
136
+ }
137
+
138
+ dt {
139
+ font-weight: var(--font-medium);
140
+ }
141
+
142
+ dt + dd {
143
+ margin-block-start: var(--space-xs);
144
+ }
145
+
146
+ dd + dt {
147
+ margin-block-start: var(--space-s);
148
+ }
149
+
150
+ dd {
151
+ margin-inline-start: 1.5ch;
152
+ }
153
+
154
+ /* Blockquotes */
155
+
156
+ blockquote {
157
+ margin-inline: 0;
158
+ color: var(--color-primary);
159
+ }
160
+
161
+ blockquote footer {
162
+ margin-block-start: var(--space-s);
163
+ color: var(--color-mid);
164
+ font-size: var(--size-step--1);
165
+ }
166
+
167
+ blockquote q {
168
+ font-style: normal;
169
+ }
170
+
171
+ /* Media */
172
+
173
+ :is(video, iframe[src*="youtube"], iframe[src*="vimeo"]) {
174
+ display: block;
175
+ width: 100%;
176
+ height: auto;
177
+ aspect-ratio: 16/9;
178
+ }
179
+
180
+ img {
181
+ height: auto;
182
+ max-width: 100%;
183
+ display: block;
184
+ }
185
+
186
+ figcaption {
187
+ padding-block-start: 0.5em;
188
+ font-size: var(--size-step--1);
189
+ font-family: monospace;
190
+ }
191
+
192
+ /* Tables */
193
+
194
+ table {
195
+ border-collapse: collapse;
196
+ width: 100%;
197
+ }
198
+
199
+ th {
200
+ text-align: left;
201
+ font-weight: var(--font-bold);
202
+ line-height: var(--leading-fine);
203
+ }
204
+
205
+ thead th {
206
+ padding-block: var(--space-s);
207
+ }
208
+
209
+ td,
210
+ th {
211
+ vertical-align: top;
212
+ padding: var(--space-xs) var(--space-s);
213
+ box-shadow: inset 0 -1px 0 var(--color-tint);
214
+ }
215
+
216
+ caption {
217
+ caption-side: bottom;
218
+ margin-block-start: var(--space-s);
219
+ }
220
+
221
+ /* Interactions */
222
+
223
+ a:not([class]):hover {
224
+ text-underline-offset: 0.2lh;
225
+ }
226
+
227
+ :is(h1, h2, h3, h4) a:not([class]) {
228
+ text-decoration-thickness: 0.1ex;
229
+ text-underline-offset: 0.2ex;
230
+ }
231
+
232
+ :is(h1, h2, h3, h4) a:not([class]):hover {
233
+ text-underline-offset: 0.3ex;
234
+ }
235
+
236
+ :focus {
237
+ outline: none;
238
+ }
239
+
240
+ :focus-visible {
241
+ outline: 2px solid var(--focus-color, currentColor);
242
+ outline-offset: var(--focus-offset, 0.1lh);
243
+ }
244
+
245
+ /*
246
+ * Firefox is the only browser that doesn't outline the whole element unless you
247
+ * make it display: inline-block. That in itself causes multiple flow issues so
248
+ * we can detect it, using its own vendor prefix and reduce focus offset.
249
+ */
250
+ @supports (-moz-appearance: none) {
251
+ :root {
252
+ --focus-offset: 0.08em;
253
+ }
254
+ }
255
+
256
+ :target {
257
+ scroll-margin-block: 5lh;
258
+ }
259
+
260
+ ::selection {
261
+ color: var(--color-light);
262
+ background: var(--color-primary);
263
+ }
264
+
265
+ /* Misc elements */
266
+
267
+ hr {
268
+ border: none;
269
+ border-block-start: var(--stroke);
270
+ margin-block: var(--flow-space, var(--space-xl));
271
+ }
272
+
273
+ svg:not([class]) {
274
+ width: auto;
275
+ height: 1lh;
276
+ }
277
+
278
+ svg {
279
+ flex-shrink: 0;
280
+ }
281
+
282
+ svg[role="img"][width][height] {
283
+ width: revert;
284
+ height: revert;
285
+ padding: var(--space-xs);
286
+ }
287
+
288
+ /* Details, summary */
289
+
290
+ summary {
291
+ font-weight: var(--font-bold);
292
+ cursor: pointer;
293
+ }
294
+
295
+ details[open] summary {
296
+ margin-block-end: var(--space-s);
297
+ }
@@ -0,0 +1,98 @@
1
+ /* Modern reset: https://piccalil.li/blog/a-more-modern-css-reset/ */
2
+
3
+ /* Box sizing rules */
4
+ *,
5
+ *::before,
6
+ *::after {
7
+ box-sizing: border-box;
8
+ }
9
+
10
+ /* Prevent font size inflation */
11
+ html {
12
+ -moz-text-size-adjust: none;
13
+ -webkit-text-size-adjust: none;
14
+ text-size-adjust: none;
15
+ }
16
+
17
+ /* Remove default margin in favour of better control in authored CSS */
18
+ body,
19
+ h1,
20
+ h2,
21
+ h3,
22
+ h4,
23
+ h5,
24
+ h6,
25
+ p,
26
+ figure,
27
+ blockquote,
28
+ dl,
29
+ dd {
30
+ margin-block: 0;
31
+ }
32
+
33
+ /* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
34
+ ul[role="list"],
35
+ ol[role="list"] {
36
+ list-style: none;
37
+ }
38
+
39
+ /* Set core body defaults */
40
+ body {
41
+ min-height: 100vh;
42
+ line-height: 1.5;
43
+ }
44
+
45
+ /* Set shorter line heights on headings and interactive elements */
46
+ h1,
47
+ h2,
48
+ h3,
49
+ h4,
50
+ h5,
51
+ h6,
52
+ button,
53
+ input,
54
+ label {
55
+ line-height: 1.1;
56
+ }
57
+
58
+ /* Balance text wrapping on headings */
59
+ h1,
60
+ h2,
61
+ h3,
62
+ h4,
63
+ h5,
64
+ h6 {
65
+ text-wrap: balance;
66
+ }
67
+
68
+ /* A elements that don't have a class get default styles */
69
+ a:not([class]) {
70
+ text-decoration-skip-ink: auto;
71
+ color: currentColor;
72
+ text-underline-offset: 0.1lh;
73
+ }
74
+
75
+ /* Make images easier to work with */
76
+ img,
77
+ picture {
78
+ max-width: 100%;
79
+ display: block;
80
+ }
81
+
82
+ /* Inherit fonts for inputs and buttons */
83
+ input,
84
+ button,
85
+ textarea,
86
+ select {
87
+ font: inherit;
88
+ }
89
+
90
+ /* Make sure textareas without a rows attribute are not tiny */
91
+ textarea:not([rows]) {
92
+ min-height: 10em;
93
+ }
94
+
95
+ /* Anything that has been anchored to should have extra scroll margin */
96
+ :target {
97
+ scroll-margin-block: 5ex;
98
+ }
@@ -0,0 +1,97 @@
1
+ /* Koi colours */
2
+ :root {
3
+ --color-dark: #333;
4
+ --color-dark-glare: #555;
5
+ --color-mid: #9ca3af;
6
+ --color-light: #ffffff;
7
+ --color-primary: #266dd3;
8
+ --color-tint: #f0ecf3;
9
+ --focus-color: #fd0;
10
+
11
+ /* alerts */
12
+ --color-success: #129d7f;
13
+ --color-warning: #ffc759;
14
+ --color-alert: #ea3946;
15
+ --color-notice: #2563eb;
16
+ }
17
+
18
+ :root {
19
+ --gutter: var(--space-m-l);
20
+ --transition-base: 250ms ease;
21
+ --transition-movement: 200ms linear;
22
+ --transition-fade: 300ms ease;
23
+ --transition-bounce: 500ms cubic-bezier(0.5, 0.05, 0.2, 1.5);
24
+ --stroke: 1px solid var(--color-tint);
25
+ --radius-s: 0.2rem;
26
+ --radius-m: 0.75rem;
27
+ --radius-l: 2.5rem;
28
+ --uppercase-kerning: 0.04ch;
29
+ }
30
+
31
+ /* Font sizes */
32
+ /* @link https://utopia.fyi/type/calculator?c=600,14,1.2,1600,16,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
33
+
34
+ :root {
35
+ /* Step -2: 9.7222px → 10.24px */
36
+ --size-step--2: clamp(0.6076rem, 0.5882rem + 0.0518vw, 0.64rem);
37
+ /* Step -1: 11.6667px → 12.8px */
38
+ --size-step--1: clamp(0.7292rem, 0.6867rem + 0.1133vw, 0.8rem);
39
+ /* Step 0: 14px → 16px */
40
+ --size-step-0: clamp(0.875rem, 0.8rem + 0.2vw, 1rem);
41
+ /* Step 1: 16.8px → 20px */
42
+ --size-step-1: clamp(1.05rem, 0.93rem + 0.32vw, 1.25rem);
43
+ /* Step 2: 20.16px → 25px */
44
+ --size-step-2: clamp(1.26rem, 1.0785rem + 0.484vw, 1.5625rem);
45
+ /* Step 3: 24.192px → 31.25px */
46
+ --size-step-3: clamp(1.512rem, 1.2473rem + 0.7058vw, 1.9531rem);
47
+ /* Step 4: 29.0304px → 39.0625px */
48
+ --size-step-4: clamp(1.8144rem, 1.4382rem + 1.0032vw, 2.4414rem);
49
+ /* Step 5: 34.8365px → 48.8281px */
50
+ --size-step-5: clamp(2.1773rem, 1.6526rem + 1.3992vw, 3.0518rem);
51
+ }
52
+
53
+ /* Fluid spacing */
54
+ /* @link https://utopia.fyi/space/calculator?c=600,14,1.2,1600,16,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
55
+
56
+ :root {
57
+ /* Space 3xs: 4px → 4px */
58
+ --space-3xs: clamp(0.25rem, 0.25rem + 0vw, 0.25rem);
59
+ /* Space 2xs: 7px → 8px */
60
+ --space-2xs: clamp(0.4375rem, 0.4rem + 0.1vw, 0.5rem);
61
+ /* Space xs: 11px → 12px */
62
+ --space-xs: clamp(0.6875rem, 0.65rem + 0.1vw, 0.75rem);
63
+ /* Space s: 14px → 16px */
64
+ --space-s: clamp(0.875rem, 0.8rem + 0.2vw, 1rem);
65
+ /* Space m: 21px → 24px */
66
+ --space-m: clamp(1.3125rem, 1.2rem + 0.3vw, 1.5rem);
67
+ /* Space l: 28px → 32px */
68
+ --space-l: clamp(1.75rem, 1.6rem + 0.4vw, 2rem);
69
+ /* Space xl: 42px → 48px */
70
+ --space-xl: clamp(2.625rem, 2.4rem + 0.6vw, 3rem);
71
+ /* Space 2xl: 56px → 64px */
72
+ --space-2xl: clamp(3.5rem, 3.2rem + 0.8vw, 4rem);
73
+ /* Space 3xl: 84px → 96px */
74
+ --space-3xl: clamp(5.25rem, 4.8rem + 1.2vw, 6rem);
75
+
76
+ /* One-up pairs */
77
+ /* Space 3xs-2xs: 4px → 8px */
78
+ --space-3xs-2xs: clamp(0.25rem, 0.1rem + 0.4vw, 0.5rem);
79
+ /* Space 2xs-xs: 7px → 12px */
80
+ --space-2xs-xs: clamp(0.4375rem, 0.25rem + 0.5vw, 0.75rem);
81
+ /* Space xs-s: 11px → 16px */
82
+ --space-xs-s: clamp(0.6875rem, 0.5rem + 0.5vw, 1rem);
83
+ /* Space s-m: 14px → 24px */
84
+ --space-s-m: clamp(0.875rem, 0.5rem + 1vw, 1.5rem);
85
+ /* Space m-l: 21px → 32px */
86
+ --space-m-l: clamp(1.3125rem, 0.9rem + 1.1vw, 2rem);
87
+ /* Space l-xl: 28px → 48px */
88
+ --space-l-xl: clamp(1.75rem, 1rem + 2vw, 3rem);
89
+ /* Space xl-2xl: 42px → 64px */
90
+ --space-xl-2xl: clamp(2.625rem, 1.8rem + 2.2vw, 4rem);
91
+ /* Space 2xl-3xl: 56px → 96px */
92
+ --space-2xl-3xl: clamp(3.5rem, 2rem + 4vw, 6rem);
93
+
94
+ /* Custom pairs */
95
+ /* Space s-l: 14px → 32px */
96
+ --space-s-l: clamp(0.875rem, 0.2rem + 1.8vw, 2rem);
97
+ }
@@ -0,0 +1,14 @@
1
+ [data-icon="add"] {
2
+ -webkit-mask: url("icons/add.svg");
3
+ mask: url("icons/add.svg");
4
+ }
5
+
6
+ [data-icon="close"] {
7
+ -webkit-mask: url("icons/close.svg");
8
+ mask: url("icons/close.svg");
9
+ }
10
+
11
+ [data-icon="koi"] {
12
+ -webkit-mask: url("koi.png") center/cover no-repeat;
13
+ mask: url("koi.png") center/cover no-repeat;
14
+ }
@@ -0,0 +1,17 @@
1
+ @import url("global/reset.css");
2
+ @import url("global/fonts.css");
3
+
4
+ @import url("/katalyst/content/editor.css");
5
+ @import url("/katalyst/navigation.css");
6
+ @import url("/katalyst/tables.css");
7
+
8
+ @import url("global/variables.css");
9
+ @import url("global/global-styles.css");
10
+
11
+ @import url("forms/index.css");
12
+
13
+ @import url("compositions/index.css");
14
+ @import url("utilities/index.css");
15
+ @import url("blocks/index.css");
16
+
17
+ @import url("icons.css");
@@ -0,0 +1,26 @@
1
+ .login {
2
+ header {
3
+ display: grid;
4
+ grid-template-areas: "logo header" "logo site-name";
5
+ grid-template-columns: auto 1fr;
6
+ grid-template-rows: auto auto;
7
+ column-gap: var(--space-m);
8
+ }
9
+
10
+ h1 {
11
+ grid-area: header;
12
+ font-weight: var(--font-light);
13
+ }
14
+
15
+ h2 {
16
+ grid-area: site-name;
17
+ font-weight: var(--font-medium);
18
+ font-size: var(--size-m);
19
+ }
20
+
21
+ img {
22
+ max-height: 4rem;
23
+ grid-area: logo;
24
+ align-self: center;
25
+ }
26
+ }
@@ -0,0 +1 @@
1
+ @import url("visually-hidden.css");
@@ -0,0 +1,18 @@
1
+ .visually-hidden {
2
+ border: 0;
3
+ clip: rect(0 0 0 0);
4
+ height: auto;
5
+ margin: 0;
6
+ overflow: hidden;
7
+ padding: 0;
8
+ position: absolute;
9
+ width: 1px;
10
+ white-space: nowrap;
11
+ }
12
+
13
+ /* data-controller="show-hide" */
14
+ [data-collapsed] {
15
+ max-height: 0;
16
+ overflow: hidden;
17
+ margin-bottom: 0 !important;
18
+ }
@@ -19,12 +19,12 @@ module Koi
19
19
  # @return [void]
20
20
  #
21
21
  # @example Render a column containing the record's title, linked to its show page
22
- # <% row.link :title %> # => <td><a href="/admin/post/15">About us</a></td>
22
+ # <% row.link :title %> # => <td><a href="/admin/page/15">About us</a></td>
23
23
  # @example Render a column containing the record's title, linked to its edit page
24
- # <% row.link :title, url: :edit_admin_post_path do |cell| %>
24
+ # <% row.link :title, url: :edit_admin_page_path do |cell| %>
25
25
  # Edit <%= cell %>
26
26
  # <% end %>
27
- # # => <td><a href="/admin/post/15/edit">Edit About us</a></td>
27
+ # # => <td><a href="/admin/page/15/edit">Edit About us</a></td>
28
28
  def link(column, label: nil, heading: false, url: (default_url = true), link: {}, **, &)
29
29
  with_cell(Tables::Cells::LinkComponent.new(
30
30
  collection:, row:, column:, record:, label:, heading:, url:, default_url:, link:, **,
@@ -1,16 +1,17 @@
1
- <% content_for :title, @title %>
2
- <header>
3
- <h1 class="heading"><%= @title %></h1>
4
-
5
- <div class="breadcrumbs" role="navigation" aria-label="Breadcrumbs">
1
+ <% if breadcrumbs? %>
2
+ <%= breadcrumb_list do %>
6
3
  <% breadcrumbs.each do |breadcrumb| %>
7
- <%= breadcrumb %>
4
+ <li><%= breadcrumb %></li>
8
5
  <% end %>
9
- </div>
6
+ <% end %>
7
+ <% end %>
8
+
9
+ <h1><%= @title %></h1>
10
10
 
11
- <div class="actions" role="navigation" aria-label="Related pages">
11
+ <% if actions? %>
12
+ <%= actions_list do %>
12
13
  <% actions.each do |action| %>
13
- <%= action %>
14
+ <li><%= action %></li>
14
15
  <% end %>
15
- </div>
16
- </header>
16
+ <% end %>
17
+ <% end %>
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Koi
4
4
  class HeaderComponent < ViewComponent::Base
5
+ include HeaderHelper
6
+
5
7
  renders_many :actions, "LinkComponent"
6
8
  renders_many :breadcrumbs, "LinkComponent"
7
9
 
@@ -3,5 +3,13 @@
3
3
  module Koi
4
4
  class TableComponent < Katalyst::TableComponent
5
5
  include Tables::Cells
6
+
7
+ def output_preamble
8
+ '<div class="table-container">'.html_safe + super
9
+ end
10
+
11
+ def output_postamble
12
+ super + "</div>".html_safe
13
+ end
6
14
  end
7
15
  end