keystone_ui 0.10.0 → 0.11.1
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 +4 -4
- data/app/assets/tailwind/keystone_ui_engine/{engine.css → grid_safelist.css} +0 -3
- data/lib/keystone_ui/configuration.rb +3 -0
- data/lib/keystone_ui/engine.rb +6 -1
- data/lib/keystone_ui/leftover_stylesheet.rb +16 -0
- data/lib/keystone_ui/source_css.rb +8 -7
- data/lib/keystone_ui/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 24cf791aa7574c54fce5bde514cd2c23c9f1ed4ea3d1f8b878ed13bc544ec380
|
|
4
|
+
data.tar.gz: f36f715a3d2423e4cf94480785088673f481d3cbe5f9d46d8bd3013c977a4e2f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cefa7a60ca4be4b4aa123e60d26f623729f2c970fa3f581f17024858c713623484dc95f74bb0366f9d6c928c0a5c6f7480975403c65a5ceed1ccb81dd6b4ea33
|
|
7
|
+
data.tar.gz: 227693a252c9131d146089eaf36530a68d6994278233d81fd9c716f51a66af3bf4286fb3f0dc2f930f4589bac2f9bc82818c56ffba2abd18486610b77aa2544d
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* Keystone UI components — tells Tailwind to scan for classes in component files */
|
|
2
|
-
@source "../../components/**/*.{erb,rb}";
|
|
3
|
-
|
|
4
1
|
/* Safelist: grid-cols classes built from static constants in GridComponent.
|
|
5
2
|
Belt-and-suspenders — ensures these classes survive JIT purging even if
|
|
6
3
|
the scanner misses the Ruby hash literals. */
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
module KeystoneUi
|
|
4
4
|
class Configuration
|
|
5
5
|
attr_accessor :accent, :surface, :theme_mode_supplier
|
|
6
|
+
attr_reader :tailwind_imports, :tailwind_sources
|
|
6
7
|
|
|
7
8
|
def initialize
|
|
8
9
|
@accent = :blue
|
|
9
10
|
@surface = :zinc
|
|
11
|
+
@tailwind_imports = []
|
|
12
|
+
@tailwind_sources = []
|
|
10
13
|
end
|
|
11
14
|
|
|
12
15
|
def supplied_theme_mode(view)
|
data/lib/keystone_ui/engine.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "keystone_ui/source_css"
|
|
4
|
+
require "keystone_ui/leftover_stylesheet"
|
|
4
5
|
|
|
5
6
|
module KeystoneUi
|
|
6
7
|
class Engine < ::Rails::Engine
|
|
@@ -13,6 +14,10 @@ module KeystoneUi
|
|
|
13
14
|
end
|
|
14
15
|
end
|
|
15
16
|
|
|
17
|
+
initializer "keystone_ui.remove_leftover_stylesheet" do |app|
|
|
18
|
+
KeystoneUi::LeftoverStylesheet.new(app.root).remove
|
|
19
|
+
end
|
|
20
|
+
|
|
16
21
|
# Write a separate keystone_source.css with the gem's @source directive
|
|
17
22
|
# so Tailwind can scan component files during asset compilation.
|
|
18
23
|
#
|
|
@@ -29,7 +34,7 @@ module KeystoneUi
|
|
|
29
34
|
keystone_import = '@import "./keystone_source.css";'
|
|
30
35
|
next unless css_path.read.include?(keystone_import)
|
|
31
36
|
|
|
32
|
-
tailwind_dir.join("keystone_source.css").write(KeystoneUi::SourceCss.new(root).to_s)
|
|
37
|
+
tailwind_dir.join("keystone_source.css").write(KeystoneUi::SourceCss.new(root, imports: KeystoneUi.configuration.tailwind_imports, sources: KeystoneUi.configuration.tailwind_sources).to_s)
|
|
33
38
|
end
|
|
34
39
|
end
|
|
35
40
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "pathname"
|
|
4
|
+
|
|
5
|
+
module KeystoneUi
|
|
6
|
+
class LeftoverStylesheet
|
|
7
|
+
def initialize(root)
|
|
8
|
+
@root = Pathname.new(root)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def remove
|
|
12
|
+
leftover = @root.join("app/assets/builds/tailwind/keystone_ui_engine.css")
|
|
13
|
+
leftover.delete if leftover.exist?
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -5,8 +5,10 @@ require "keystone_ui/styles"
|
|
|
5
5
|
|
|
6
6
|
module KeystoneUi
|
|
7
7
|
class SourceCss
|
|
8
|
-
def initialize(root)
|
|
8
|
+
def initialize(root, imports: [], sources: [])
|
|
9
9
|
@root = Pathname.new(root)
|
|
10
|
+
@imports = imports
|
|
11
|
+
@sources = sources
|
|
10
12
|
end
|
|
11
13
|
|
|
12
14
|
def to_s
|
|
@@ -15,16 +17,15 @@ module KeystoneUi
|
|
|
15
17
|
|
|
16
18
|
private
|
|
17
19
|
|
|
18
|
-
def styles_entry
|
|
19
|
-
KeystoneUi::Styles::Engine.root.join("app/assets/tailwind/keystone_ui_styles/engine.css")
|
|
20
|
-
end
|
|
21
|
-
|
|
22
20
|
def lines
|
|
23
21
|
[
|
|
24
|
-
%(@import "#{
|
|
22
|
+
%(@import "#{KeystoneUi::Styles.tailwind_file}";),
|
|
25
23
|
%(@source "#{@root}/app/components/**/*.{erb,rb}";),
|
|
26
24
|
%(@import "#{@root}/app/assets/tailwind/keystone_ui_engine/nav.css";),
|
|
27
|
-
%(@import "#{@root}/app/assets/tailwind/keystone_ui_engine/color_picker.css";)
|
|
25
|
+
%(@import "#{@root}/app/assets/tailwind/keystone_ui_engine/color_picker.css";),
|
|
26
|
+
%(@import "#{@root}/app/assets/tailwind/keystone_ui_engine/grid_safelist.css";),
|
|
27
|
+
*@imports.map { |import| %(@import "#{import}";) },
|
|
28
|
+
*@sources.map { |source| %(@source "#{source}";) }
|
|
28
29
|
]
|
|
29
30
|
end
|
|
30
31
|
end
|
data/lib/keystone_ui/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: keystone_ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.11.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tyler Schneider
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: keystone_ui-styles
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.1.
|
|
19
|
+
version: 0.1.1
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 0.1.
|
|
26
|
+
version: 0.1.1
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: view_component
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -70,7 +70,7 @@ files:
|
|
|
70
70
|
- app/assets/javascripts/keystone_ui/tab_switcher_controller.js
|
|
71
71
|
- app/assets/javascripts/keystone_ui/theme_toggle_controller.js
|
|
72
72
|
- app/assets/tailwind/keystone_ui_engine/color_picker.css
|
|
73
|
-
- app/assets/tailwind/keystone_ui_engine/
|
|
73
|
+
- app/assets/tailwind/keystone_ui_engine/grid_safelist.css
|
|
74
74
|
- app/assets/tailwind/keystone_ui_engine/nav.css
|
|
75
75
|
- app/components/keystone/ui/accordion_component.html.erb
|
|
76
76
|
- app/components/keystone/ui/accordion_component.rb
|
|
@@ -180,6 +180,7 @@ files:
|
|
|
180
180
|
- lib/keystone_ui.rb
|
|
181
181
|
- lib/keystone_ui/configuration.rb
|
|
182
182
|
- lib/keystone_ui/engine.rb
|
|
183
|
+
- lib/keystone_ui/leftover_stylesheet.rb
|
|
183
184
|
- lib/keystone_ui/safelist.rb
|
|
184
185
|
- lib/keystone_ui/source_css.rb
|
|
185
186
|
- lib/keystone_ui/theme_choice.rb
|