katalyst-koi 5.0.0.alpha.1 → 5.0.0.alpha.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4080b3cf1a331e6a44c27073860147d44ba416aedee36ed5b9544e53b053337e
4
- data.tar.gz: 7cd2b85aaafa0703b7276efdaeab07a05aa5cf104b9e88a26af0cedd2759a787
3
+ metadata.gz: 8fcedc1a4ceaad07f40a65c739317ff349bf3eb7e758e5ed044ec2839c04e825
4
+ data.tar.gz: f3305d49058f1c1dcfb3b6481580bd5c32b1061442905c43eab21f7aa609566a
5
5
  SHA512:
6
- metadata.gz: dc7bd443f0a1ae6d4d4b503af59200592c35c4d1f73326400be7e05b85ad92fdf814d2f9e339034907eb4ede0a0b513dc744f1edc89ce9ce69dc856edf416bff
7
- data.tar.gz: 2a9973470c68cf9b6930aa7f5da4b62d71f1218e88fb383ee66643427b742522fa742649aa1c2a18f2c6e3c9eafcb7564e79c2be97651c559efde0ecaa463aae
6
+ metadata.gz: 53676e2729ac91e2483d8cc71627de7e3eeb4bef19ff0542abb1acae2df07dc0ed1a67dc95ea7aa7d858b3abdc16b947b4e84326ef113ade0096ede7d67575dc
7
+ data.tar.gz: aafc8b03af7a5fb846d5a45ed2a49b47a32489359e7d9c469614580f3dbfd77899dedf7f8560399eb2f30a651f6faf1df1e1f6fb94cacae6a0ba38cfe21dbd19
@@ -3,17 +3,17 @@
3
3
  }
4
4
 
5
5
  .flash:is([data-flash-type="alert"]) {
6
- --flash-color: var(--site-alert);
6
+ --flash-color: var(--color-alert);
7
7
  }
8
8
 
9
9
  .flash:is([data-flash-type="notice"]) {
10
- --flash-color: var(--site-notice);
10
+ --flash-color: var(--color-notice);
11
11
  }
12
12
 
13
13
  .flash:is([data-flash-type="success"]) {
14
- --flash-color: var(--site-success);
14
+ --flash-color: var(--color-success);
15
15
  }
16
16
 
17
17
  .flash:is([data-flash-type="warning"], [data-flash-type="error"]) {
18
- --flash-color: var(--site-warning);
18
+ --flash-color: var(--color-warning);
19
19
  }
@@ -41,7 +41,7 @@
41
41
  content: "";
42
42
  display: block;
43
43
  grid-area: input;
44
- border-color: var(--site-text-color);
44
+ border-color: var(--color-dark);
45
45
  border-style: solid;
46
46
  }
47
47
 
@@ -15,22 +15,3 @@
15
15
  @import url("blocks/index.css");
16
16
 
17
17
  @import url("icons.css");
18
-
19
- :root {
20
- /* Color styles */
21
- --site-primary-light: #5a87c9;
22
- --site-primary: #266dd3;
23
- --site-primary-dark: #344055;
24
- --site-on-primary: #ffffff;
25
- --site-secondary-light: #5a87c9;
26
- --site-secondary: #266dd3;
27
- --site-secondary-dark: #344055;
28
- --site-on-secondary: #ffffff;
29
- --site-text-color: #000000;
30
- --site-success: #129d7f;
31
- --site-warning: #ffc759;
32
- --site-alert: #ea3946;
33
- --site-notice: rgb(37, 99, 235);
34
- --site-disabled: #9ca3af;
35
- --site-link: #266dd3;
36
- }
@@ -6,7 +6,7 @@ module Admin
6
6
  include Koi::Controller::RecordsAuthentication
7
7
 
8
8
  before_action :redirect_authenticated, only: %i[new], if: :admin_signed_in?
9
- before_action :authenticate_local_admin, only: %i[new], if: -> { Koi.config.authenticate_local_admins? }
9
+ before_action :authenticate_local_admin, only: %i[new], if: -> { Koi.config.authenticate_local_admins }
10
10
 
11
11
  layout "koi/login"
12
12
 
@@ -24,6 +24,7 @@ module Koi
24
24
  # Koi Helpers
25
25
  helper FormHelper
26
26
  helper HeaderHelper
27
+ helper ModalHelper
27
28
  helper Pagy::Frontend
28
29
 
29
30
  # @deprecated to be removed in Koi 5
@@ -18,11 +18,12 @@ module Koi
18
18
  tag.header(class: "repel", data: "nowrap") do
19
19
  concat(tag.h2(title))
20
20
  concat(tag.button(
21
- form: form_id,
22
- formmethod: "dialog",
23
- class: "button",
24
- data: { button_padding: "tight",
25
- "text-button": "" },
21
+ class: "button",
22
+ data: {
23
+ action: "koi--modal#dismiss",
24
+ button_padding: "tight",
25
+ "text-button": "",
26
+ },
26
27
  ) do
27
28
  tag.icon(" ".html_safe, aria: { hidden: true }, class: "icon", data: { icon: "close" }) +
28
29
  tag.span("Close", class: "visually-hidden")
@@ -4,7 +4,6 @@ require "rails/generators/named_base"
4
4
 
5
5
  module Koi
6
6
  class AdminGenerator < Rails::Generators::NamedBase
7
-
8
7
  class_option :force, type: :boolean, default: true
9
8
 
10
9
  hook_for :admin_controller, in: :koi, as: :admin, type: :boolean, default: true do |instance, controller|
@@ -7,10 +7,10 @@
7
7
 
8
8
  <h1>Archived <%= human_name.pluralize.titleize %></h1>
9
9
  <%% end %>
10
+ <%- if query? -%>
10
11
 
11
- <% if query? %>
12
12
  <%%= table_query_with(collection:) %>
13
- <% end %>
13
+ <%- end -%>
14
14
 
15
15
  <%%= table_selection_with(collection:) do %>
16
16
  <%%= tag.button("Restore", formaction: <%= restore_admin_helper %>, formmethod: :put, class: "button") %>
@@ -27,7 +27,7 @@
27
27
  <%- end -%>
28
28
  <%% row.date :archived_at %>
29
29
  <%% end %>
30
-
31
30
  <%- if paginate? -%>
31
+
32
32
  <%%= table_pagination_with(collection:) %>
33
33
  <%- end -%>
@@ -111,7 +111,7 @@ module Koi
111
111
  limit = [controller.size, model.size].min
112
112
 
113
113
  (1..limit).reverse_each do |size|
114
- return model.slice(0...size) if controller.slice(size - 1..-1) == model.slice(0...size)
114
+ return model.slice(0...size) if controller.slice((size - 1)..-1) == model.slice(0...size)
115
115
  end
116
116
 
117
117
  []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-koi
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.alpha.1
4
+ version: 5.0.0.alpha.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
@@ -330,10 +330,6 @@ files:
330
330
  - app/assets/stylesheets/koi/icons.css
331
331
  - app/assets/stylesheets/koi/index.css
332
332
  - app/assets/stylesheets/koi/login.css
333
- - app/assets/stylesheets/koi/themes/_content.scss
334
- - app/assets/stylesheets/koi/themes/_index.scss
335
- - app/assets/stylesheets/koi/themes/_navigation.scss
336
- - app/assets/stylesheets/koi/themes/_trix.scss
337
333
  - app/assets/stylesheets/koi/utilities/index.css
338
334
  - app/assets/stylesheets/koi/utilities/visually-hidden.css
339
335
  - app/components/concerns/koi/tables/cells.rb
@@ -1,62 +0,0 @@
1
- @use "katalyst/content/editor/variables" as variables;
2
- @use "katalyst/content";
3
-
4
- [data-controller="content--editor--container"] {
5
- --heading--h4: 1rem;
6
- }
7
-
8
- [data-controller="content--editor--table"] {
9
- .content--editor--table-editor {
10
- // ensure the table editor is easy to target when empty
11
- &:not(:has(table)) {
12
- min-height: 4rem !important;
13
- }
14
-
15
- // tight wrap the table editor around the table and use table borders
16
- &:has(table) {
17
- border: none !important;
18
- padding: 0 !important;
19
- }
20
-
21
- table {
22
- width: 100%;
23
- }
24
-
25
- table,
26
- th,
27
- td {
28
- border: 2px solid black;
29
- }
30
- }
31
-
32
- // restore webkit spinners, hidden by govuk
33
- // these are not ideal, but spinners are much easier to work with for this
34
- // use case than the default number input, because we submit the form on
35
- // change to implement the live preview
36
- input[type="number"]::-webkit-inner-spin-button {
37
- position: relative;
38
- right: -1px;
39
- margin-top: -2px;
40
- margin-bottom: -4px;
41
- -webkit-appearance: inner-spin-button !important;
42
- opacity: 1 !important;
43
- }
44
- }
45
-
46
- [data-enum="state"][data-value="published"] {
47
- --tag-background-color: #{variables.$status-published-background-color};
48
- --tag-color: #{variables.$status-published-color};
49
- border: 1px solid variables.$status-published-border-color;
50
- }
51
-
52
- [data-enum="state"][data-value="draft"] {
53
- --tag-background-color: #{variables.$status-draft-background-color};
54
- --tag-color: #{variables.$status-draft-color};
55
- border: 1px solid variables.$status-draft-border-color;
56
- }
57
-
58
- [data-enum="state"][data-value="unpublished"] {
59
- --tag-background-color: #{variables.$status-draft-background-color};
60
- --tag-color: #{variables.$status-draft-color};
61
- border: 1px solid variables.$status-draft-border-color;
62
- }
@@ -1,4 +0,0 @@
1
- @use "content";
2
- @use "govuk";
3
- @use "navigation";
4
- @use "trix";
@@ -1,5 +0,0 @@
1
- @use "katalyst/navigation/editor";
2
-
3
- [data-controller="navigation--editor--menu"] {
4
- --heading--h4: 1rem;
5
- }
@@ -1,32 +0,0 @@
1
- // navigation and content already load trix, ensure they are loaded first
2
- @use "content";
3
- @use "navigation";
4
-
5
- // overrides for default trix styles to match our button styles
6
- trix-toolbar {
7
- .trix-button-group {
8
- border: 1px solid var(--site-text-color);
9
- border-radius: 0;
10
- }
11
-
12
- .trix-button {
13
- color: var(--site-secondary);
14
- border-bottom: none;
15
- }
16
-
17
- .trix-button:not(:first-child) {
18
- border-left: 1px solid var(--site-text-color);
19
- }
20
-
21
- .trix-button.trix-active {
22
- background-color: var(--site-secondary-light);
23
- color: var(--site-on-secondary);
24
- border-bottom: none;
25
- }
26
- }
27
-
28
- // set a maximim width for the text editor and toolbar to match other inputs
29
- trix-toolbar,
30
- trix-editor {
31
- max-width: var(--text-width);
32
- }