brainzlab-ui 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.
@@ -4,10 +4,10 @@ module Brainzlab
4
4
  module Components
5
5
  class Modal < Base
6
6
  SIZES = {
7
- sm: "modal-sm",
8
- md: "modal-md",
9
- lg: "modal-lg",
10
- xl: "modal-xl"
7
+ sm: 'modal-sm',
8
+ md: 'modal-md',
9
+ lg: 'modal-lg',
10
+ xl: 'modal-xl'
11
11
  }.freeze
12
12
 
13
13
  def initialize(size: :md, **attrs)
@@ -16,14 +16,14 @@ module Brainzlab
16
16
  end
17
17
 
18
18
  def view_template(&)
19
- div(class: "modal-overlay", data: { modal_target: "overlay" })
20
- div(class: modal_classes, role: "dialog", **@attrs, &)
19
+ div(class: 'modal-overlay', data: { modal_target: 'overlay' })
20
+ div(class: modal_classes, role: 'dialog', **@attrs, &)
21
21
  end
22
22
 
23
23
  private
24
24
 
25
25
  def modal_classes
26
- classes("modal", SIZES[@size], @attrs[:class])
26
+ classes('modal', SIZES[@size], @attrs[:class])
27
27
  end
28
28
  end
29
29
 
@@ -33,7 +33,7 @@ module Brainzlab
33
33
  end
34
34
 
35
35
  def view_template(&)
36
- div(class: classes("modal-header", @attrs[:class]), **@attrs.except(:class), &)
36
+ div(class: classes('modal-header', @attrs[:class]), **@attrs.except(:class), &)
37
37
  end
38
38
  end
39
39
 
@@ -43,7 +43,7 @@ module Brainzlab
43
43
  end
44
44
 
45
45
  def view_template(&)
46
- div(class: classes("modal-body", @attrs[:class]), **@attrs.except(:class), &)
46
+ div(class: classes('modal-body', @attrs[:class]), **@attrs.except(:class), &)
47
47
  end
48
48
  end
49
49
 
@@ -53,7 +53,7 @@ module Brainzlab
53
53
  end
54
54
 
55
55
  def view_template(&)
56
- div(class: classes("modal-footer", @attrs[:class]), **@attrs.except(:class), &)
56
+ div(class: classes('modal-footer', @attrs[:class]), **@attrs.except(:class), &)
57
57
  end
58
58
  end
59
59
  end
@@ -3,7 +3,7 @@
3
3
  module Brainzlab
4
4
  module Components
5
5
  class NavItem < Base
6
- def initialize(href: "#", active: false, **attrs)
6
+ def initialize(href: '#', active: false, **attrs)
7
7
  @href = href
8
8
  @active = active
9
9
  @attrs = attrs
@@ -22,8 +22,8 @@ module Brainzlab
22
22
 
23
23
  def nav_item_classes
24
24
  classes(
25
- "nav-item",
26
- @active ? "active" : nil,
25
+ 'nav-item',
26
+ @active ? 'active' : nil,
27
27
  @attrs[:class]
28
28
  )
29
29
  end
@@ -12,12 +12,10 @@ module Brainzlab
12
12
  end
13
13
 
14
14
  def view_template
15
- div(class: classes("stat-card", @attrs[:class]), **@attrs.except(:class)) do
16
- div(class: "stat-label") { @label }
17
- div(class: "stat-value") { @value }
18
- if @change
19
- span(class: change_classes) { @change }
20
- end
15
+ div(class: classes('stat-card', @attrs[:class]), **@attrs.except(:class)) do
16
+ div(class: 'stat-label') { @label }
17
+ div(class: 'stat-value') { @value }
18
+ span(class: change_classes) { @change } if @change
21
19
  end
22
20
  end
23
21
 
@@ -25,9 +23,9 @@ module Brainzlab
25
23
 
26
24
  def change_classes
27
25
  classes(
28
- "stat-change",
29
- @change_type == :positive ? "stat-change-positive" : nil,
30
- @change_type == :negative ? "stat-change-negative" : nil
26
+ 'stat-change',
27
+ @change_type == :positive ? 'stat-change-positive' : nil,
28
+ @change_type == :negative ? 'stat-change-negative' : nil
31
29
  )
32
30
  end
33
31
  end
@@ -8,8 +8,8 @@ module Brainzlab
8
8
  end
9
9
 
10
10
  def view_template(&)
11
- div(class: "table-wrapper") do
12
- table(class: classes("table", @attrs[:class]), **@attrs.except(:class), &)
11
+ div(class: 'table-wrapper') do
12
+ table(class: classes('table', @attrs[:class]), **@attrs.except(:class), &)
13
13
  end
14
14
  end
15
15
  end
@@ -5,12 +5,12 @@ module Brainzlab
5
5
  class Engine < ::Rails::Engine
6
6
  isolate_namespace Brainzlab::UI
7
7
 
8
- initializer "brainzlab_ui.assets" do |app|
8
+ initializer 'brainzlab_ui.assets' do |app|
9
9
  # Add stylesheets to the asset pipeline
10
- app.config.assets.paths << root.join("app/assets/stylesheets")
10
+ app.config.assets.paths << root.join('app/assets/stylesheets')
11
11
  end
12
12
 
13
- initializer "brainzlab_ui.phlex" do
13
+ initializer 'brainzlab_ui.phlex' do
14
14
  # Ensure Phlex components are available
15
15
  ActiveSupport.on_load(:action_view) do
16
16
  include Phlex::Rails::HelperMacros if defined?(Phlex::Rails::HelperMacros)
@@ -19,7 +19,7 @@ module Brainzlab
19
19
 
20
20
  config.to_prepare do
21
21
  # Eager load components in development
22
- Dir.glob(Brainzlab::UI.root.join("lib/brainzlab/components/*.rb")).each do |file|
22
+ Dir.glob(Brainzlab::UI.root.join('lib/brainzlab/components/*.rb')).each do |file|
23
23
  require file
24
24
  end
25
25
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Brainzlab
4
4
  module UI
5
- VERSION = "0.1.0"
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
data/lib/brainzlab/ui.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "ui/version"
3
+ require_relative 'ui/version'
4
4
 
5
5
  module Brainzlab
6
6
  module UI
@@ -8,26 +8,27 @@ module Brainzlab
8
8
 
9
9
  class << self
10
10
  def root
11
- @root ||= Pathname.new(File.expand_path("../..", __dir__))
11
+ @root ||= Pathname.new(File.expand_path('../..', __dir__))
12
12
  end
13
13
  end
14
14
  end
15
15
 
16
16
  # Shorthand for components
17
17
  module Components
18
- autoload :Base, "brainzlab/components/base"
19
- autoload :Button, "brainzlab/components/button"
20
- autoload :Card, "brainzlab/components/card"
21
- autoload :Badge, "brainzlab/components/badge"
22
- autoload :Input, "brainzlab/components/input"
23
- autoload :Alert, "brainzlab/components/alert"
24
- autoload :Avatar, "brainzlab/components/avatar"
25
- autoload :Table, "brainzlab/components/table"
26
- autoload :NavItem, "brainzlab/components/nav_item"
27
- autoload :StatCard, "brainzlab/components/stat_card"
28
- autoload :EmptyState, "brainzlab/components/empty_state"
29
- autoload :Modal, "brainzlab/components/modal"
18
+ autoload :Base, 'brainzlab/components/base'
19
+ autoload :Button, 'brainzlab/components/button'
20
+ autoload :Card, 'brainzlab/components/card'
21
+ autoload :Badge, 'brainzlab/components/badge'
22
+ autoload :MaturityBadge, 'brainzlab/components/maturity_badge'
23
+ autoload :Input, 'brainzlab/components/input'
24
+ autoload :Alert, 'brainzlab/components/alert'
25
+ autoload :Avatar, 'brainzlab/components/avatar'
26
+ autoload :Table, 'brainzlab/components/table'
27
+ autoload :NavItem, 'brainzlab/components/nav_item'
28
+ autoload :StatCard, 'brainzlab/components/stat_card'
29
+ autoload :EmptyState, 'brainzlab/components/empty_state'
30
+ autoload :Modal, 'brainzlab/components/modal'
30
31
  end
31
32
  end
32
33
 
33
- require_relative "ui/engine" if defined?(Rails::Engine)
34
+ require_relative 'ui/engine' if defined?(Rails::Engine)
data/lib/brainzlab-ui.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "brainzlab/ui"
3
+ require_relative 'brainzlab/ui'
data/lib/brainzlab_ui.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "brainzlab/ui"
3
+ require_relative 'brainzlab/ui'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainzlab-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brainz Lab
@@ -93,6 +93,7 @@ files:
93
93
  - app/assets/stylesheets/brainzlab_ui/animations.css
94
94
  - app/assets/stylesheets/brainzlab_ui/base.css
95
95
  - app/assets/stylesheets/brainzlab_ui/components.css
96
+ - app/assets/stylesheets/brainzlab_ui/dark-mode.css
96
97
  - app/assets/stylesheets/brainzlab_ui/tokens.css
97
98
  - app/assets/stylesheets/brainzlab_ui/utilities.css
98
99
  - lib/brainzlab-ui.rb
@@ -104,6 +105,7 @@ files:
104
105
  - lib/brainzlab/components/card.rb
105
106
  - lib/brainzlab/components/empty_state.rb
106
107
  - lib/brainzlab/components/input.rb
108
+ - lib/brainzlab/components/maturity_badge.rb
107
109
  - lib/brainzlab/components/modal.rb
108
110
  - lib/brainzlab/components/nav_item.rb
109
111
  - lib/brainzlab/components/stat_card.rb
@@ -119,6 +121,7 @@ metadata:
119
121
  homepage_uri: https://github.com/brainzlab/brainzlab-ui
120
122
  source_code_uri: https://github.com/brainzlab/brainzlab-ui
121
123
  changelog_uri: https://github.com/brainzlab/brainzlab-ui/blob/main/CHANGELOG.md
124
+ rubygems_mfa_required: 'true'
122
125
  rdoc_options: []
123
126
  require_paths:
124
127
  - lib