rails_accordion 0.2.0.pre.beta → 0.2.1.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e9e757eaa0cead4dab2b564df0a1ca006e5638d11c1d0fa6261595ea3faf367
4
- data.tar.gz: 89a3fd28498cf34c6ac666abd5be076aba75a8c0125b3903a9eaa36b68d2d822
3
+ metadata.gz: 5eb59844a72b37143480b3d381e0d0ee13ea92bbac68355a1766f3a651424ccc
4
+ data.tar.gz: e26a6c6147137db853e55b19a182bfbc16dcfcce2c2dbdeadd55ce0da8f4684e
5
5
  SHA512:
6
- metadata.gz: a1c850657c4d42d3a00db7f82aee4862e7e8f8c26843c2092ed435913349ee5870961b79fd88ed6cb84a9400e5ceb37cb02caeb75d43344ec90d5b34a5928f38
7
- data.tar.gz: 2a319415261a298555ad85e36f735f4775cb2c42c7f2ec53420bc366c608e9d8ba60db35e59d2fb51ae21bb1f83ad59fe00afc68d214a78b80bb7a9af0eb65e2
6
+ metadata.gz: 3e6698a157058150b399aba32c57d801d32a43d778a7cf11c5fd182fa9dfee1fa7fe13220c52adc8f741ee47804cdc6508300b0c06921825d02fcac70f543cea
7
+ data.tar.gz: 0fb7e046dcf8e61c062ddf1d2a2f5eb1d4cdf3c41aeb24a67b6868575180c4aca1e20b14f95f580aa67c3bc01d7fcc2b8195285a743409e61f39726b30f24dbd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_accordion (0.2.0.pre.beta)
4
+ rails_accordion (0.1.11.pre.beta)
5
5
  stimulus-rails (~> 1.2)
6
6
  view_component (~> 2.52)
7
7
  zeitwerk (~> 2.6)
@@ -9,25 +9,24 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (6.1.7.3)
13
- actionview (= 6.1.7.3)
14
- activesupport (= 6.1.7.3)
15
- rack (~> 2.0, >= 2.0.9)
12
+ actionpack (7.0.4.3)
13
+ actionview (= 7.0.4.3)
14
+ activesupport (= 7.0.4.3)
15
+ rack (~> 2.0, >= 2.2.0)
16
16
  rack-test (>= 0.6.3)
17
17
  rails-dom-testing (~> 2.0)
18
18
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
19
- actionview (6.1.7.3)
20
- activesupport (= 6.1.7.3)
19
+ actionview (7.0.4.3)
20
+ activesupport (= 7.0.4.3)
21
21
  builder (~> 3.1)
22
22
  erubi (~> 1.4)
23
23
  rails-dom-testing (~> 2.0)
24
24
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
25
- activesupport (6.1.7.3)
25
+ activesupport (7.0.4.3)
26
26
  concurrent-ruby (~> 1.0, >= 1.0.2)
27
27
  i18n (>= 1.6, < 2)
28
28
  minitest (>= 5.1)
29
29
  tzinfo (~> 2.0)
30
- zeitwerk (~> 2.3)
31
30
  ast (2.4.2)
32
31
  builder (3.2.4)
33
32
  concurrent-ruby (1.2.2)
@@ -42,11 +41,9 @@ GEM
42
41
  nokogiri (>= 1.12.0)
43
42
  method_source (1.0.0)
44
43
  minitest (5.18.0)
45
- nokogiri (1.13.10-arm64-darwin)
44
+ nokogiri (1.14.4-arm64-darwin)
46
45
  racc (~> 1.4)
47
- nokogiri (1.13.10-x86_64-darwin)
48
- racc (~> 1.4)
49
- nokogiri (1.13.10-x86_64-linux)
46
+ nokogiri (1.14.4-x86_64-darwin)
50
47
  racc (~> 1.4)
51
48
  parallel (1.23.0)
52
49
  parser (3.2.2.1)
@@ -60,12 +57,13 @@ GEM
60
57
  nokogiri (>= 1.6)
61
58
  rails-html-sanitizer (1.5.0)
62
59
  loofah (~> 2.19, >= 2.19.1)
63
- railties (6.1.7.3)
64
- actionpack (= 6.1.7.3)
65
- activesupport (= 6.1.7.3)
60
+ railties (7.0.4.3)
61
+ actionpack (= 7.0.4.3)
62
+ activesupport (= 7.0.4.3)
66
63
  method_source
67
64
  rake (>= 12.2)
68
65
  thor (~> 1.0)
66
+ zeitwerk (~> 2.5)
69
67
  rainbow (3.1.1)
70
68
  rake (13.0.6)
71
69
  regexp_parser (2.8.0)
@@ -111,7 +109,6 @@ GEM
111
109
  PLATFORMS
112
110
  arm64-darwin-22
113
111
  x86_64-darwin-20
114
- x86_64-linux
115
112
 
116
113
  DEPENDENCIES
117
114
  rails_accordion!
@@ -123,4 +120,4 @@ DEPENDENCIES
123
120
  zeitwerk (~> 2.6)
124
121
 
125
122
  BUNDLED WITH
126
- 2.4.13
123
+ 2.4.8
data/README.md CHANGED
@@ -5,7 +5,7 @@ rails_accordion is a Ruby gem that provides an easy-to-use accordion component f
5
5
  ## Installation
6
6
 
7
7
  ```rb
8
- gem 'rails_accordion', '~> 0.1.12.pre.beta'
8
+ gem 'rails_accordion', '~> 0.2.0.pre.beta'
9
9
  ```
10
10
 
11
11
  ```shell
@@ -16,26 +16,69 @@ bundle install
16
16
  rails generate rails_accordion:install
17
17
  ```
18
18
 
19
- In config/importmap.rb, add:
19
+ Then follow the instructions for your JavaScript setup:
20
20
 
21
- ```rb
21
+ - [Importmap](#importmap) (Rails 7 default)
22
+ - [esbuild, rollup.js, or Webpack](#esbuild-rollupjs-or-webpack)
23
+ - [Webpacker](#webpacker) (Rails 6 default)
24
+ - [Sprockets](#sprockets)
25
+
26
+ ### Importmap
27
+
28
+ In `config/importmap.rb`, add:
29
+
30
+ ```ruby
22
31
  pin "rails_accordion", to: "rails_accordion.js"
23
32
  ```
24
33
 
25
- And in app/javascript/application.js, add:
34
+ And in `app/javascript/application.js`, add:
35
+
36
+ ```js
37
+ import "rails_accordion"
38
+ ```
39
+
40
+ ### esbuild, rollup.js, or Webpack
41
+
42
+ Run:
43
+
44
+ ```sh
45
+ yarn add rails_accordion rails_accordion.js
46
+ ```
47
+
48
+ And in `app/javascript/application.js`, add:
49
+
50
+ ```js
51
+ import "rails_accordion/rails_accordion.js"
52
+ ```
53
+
54
+ Note: For rollup.js, this requires `format: "iife"` in `rollup.config.js`.
55
+
56
+ ### Webpacker
57
+
58
+ Run:
59
+
60
+ ```sh
61
+ yarn add rails_accordion rails_accordion.js
62
+ ```
63
+
64
+ And in `app/javascript/packs/application.js`, add:
65
+
26
66
  ```js
27
- import 'rails_accordion'
67
+ import "rails_accordion/rails_accordion.js"
28
68
  ```
29
69
 
30
- in application.scss, add:
31
- ```scss
32
- @import 'rails_accordion'
70
+ ### Sprockets
71
+
72
+ In `app/assets/javascripts/application.js`, add:
73
+
74
+ ```js
75
+ //= require rails_accordion
33
76
  ```
34
77
 
35
78
  ## Usage
36
79
 
37
80
  ```erb
38
- <%= accordion class: "bg-white rounded-xl overflow-auto", data: {controller: "tooltip"} do %>
81
+ <%= accordion class: "bg-white rounded-xl overflow-auto" do %>
39
82
  <%= accordion_item do |item| %>
40
83
  <% item.header do %>
41
84
  Hello world
@@ -47,6 +90,13 @@ in application.scss, add:
47
90
  <% end %>
48
91
  ```
49
92
 
93
+ ### Options
94
+
95
+ multiple_open: [true, false]
96
+ default_state: 1. all_closed: All items are closed on page load. 2. all_opened: All items are opened. 3. first_opened: First item is opened by default
97
+
98
+ <%= accordion class: "bg-white rounded-xl overflow-auto", default_state: :all_opened do %>
99
+
50
100
  ## Development
51
101
 
52
102
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -55,7 +105,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
55
105
 
56
106
  ## Contributing
57
107
 
58
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rails_accordion. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/rails_accordion/blob/master/CODE_OF_CONDUCT.md).
108
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rails_accordion. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Tajbrains/rails_accordion/blob/master/CODE_OF_CONDUCT.md).
59
109
 
60
110
  ## License
61
111
 
@@ -3,7 +3,7 @@ module RailsAccordion
3
3
  attr_accessor :default_state, :animation_duration, :multiple_open
4
4
 
5
5
  def initialize
6
- @default_state = :closed
6
+ @default_state = :all_closed
7
7
  @animation_duration = 300
8
8
  @multiple_open = false
9
9
  end
@@ -4,7 +4,7 @@ require_relative "lib/rails_accordion/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "rails_accordion"
7
- spec.version = RailsAccordion::VERSION
7
+ spec.version = ENV['GEM_VERSION'] || RailsAccordion::VERSION
8
8
  spec.authors = ["Ahmadshoh Nasrullozoda"]
9
9
  spec.email = ["tajbrains@gmail.com"]
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_accordion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.pre.beta
4
+ version: 0.2.1.pre.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmadshoh Nasrullozoda
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-21 00:00:00.000000000 Z
11
+ date: 2023-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stimulus-rails
@@ -91,7 +91,7 @@ metadata:
91
91
  homepage_uri: https://tajbrains.com
92
92
  source_code_uri: https://github.com/Tajbrains/rails_accordion
93
93
  changelog_uri: https://github.com/Tajbrains/rails_accordion/blob/master/CHANGELOG.md
94
- post_install_message:
94
+ post_install_message:
95
95
  rdoc_options: []
96
96
  require_paths:
97
97
  - lib
@@ -106,8 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: 1.3.1
108
108
  requirements: []
109
- rubygems_version: 3.0.1
110
- signing_key:
109
+ rubygems_version: 3.3.20
110
+ signing_key:
111
111
  specification_version: 4
112
112
  summary: rails_accordion is in development.
113
113
  test_files: []