phlex-icons-bootstrap 2.39.0 → 2.41.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.
- checksums.yaml +4 -4
 - data/.devcontainer/devcontainer.json +13 -13
 - data/.ruby-version +1 -1
 - data/.vscode/extensions.json +9 -0
 - data/.vscode/settings.json +22 -0
 - data/README.md +65 -38
 - data/generators/huge.rb +100 -0
 - data/lib/phlex-icons/railtie.rb +9 -1
 - data/lib/phlex-icons/version.rb +1 -1
 - data/mise.toml +2 -0
 - metadata +7 -7
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: ad4826ecc6b98c2fbc807dcb86e77911a35760efef3099935b07bcf0edb5edf3
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: c87e3fedb6cf128fb80dad08fe7c4843c3cf69ede7ac867ff8d3d7c4c219a8d5
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f56fb314e5d5ff3204601815b689f3aa89adb7a254481cd669b6dd0abc366413eb8c02fa4b5668910066a696528bc1a8e8c053b1b919d0debdc7cc28cabb4291
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 5db0d76494e6f228286b806dc6facdae1f4e8621b98dbc659d536d36ed2cf1f92203ca30afb7dfb1c6a4d979e6086ae763e39e645cc3443ef9a94c50477bb4de
         
     | 
| 
         @@ -1,23 +1,23 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            // For format details, see https://aka.ms/devcontainer.json. For config options, see the
         
     | 
| 
       2 
2 
     | 
    
         
             
            // README at: https://github.com/devcontainers/templates/tree/main/src/ruby
         
     | 
| 
       3 
3 
     | 
    
         
             
            {
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
      
 4 
     | 
    
         
            +
              "name": "phlex-icons",
         
     | 
| 
      
 5 
     | 
    
         
            +
              // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
         
     | 
| 
      
 6 
     | 
    
         
            +
              "image": "ghcr.io/rails/devcontainer/images/ruby:3.4.7",
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
      
 8 
     | 
    
         
            +
              // Features to add to the dev container. More info: https://containers.dev/features.
         
     | 
| 
      
 9 
     | 
    
         
            +
              "features": {
         
     | 
| 
       10 
10 
     | 
    
         
             
                "ghcr.io/jungaretti/features/vim": {}
         
     | 
| 
       11 
11 
     | 
    
         
             
              },
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
      
 13 
     | 
    
         
            +
              // Use 'forwardPorts' to make a list of ports inside the container available locally.
         
     | 
| 
      
 14 
     | 
    
         
            +
              // "forwardPorts": [],
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 16 
     | 
    
         
            +
              // Use 'postCreateCommand' to run commands after the container is created.
         
     | 
| 
      
 17 
     | 
    
         
            +
              "postCreateCommand": ".devcontainer/setup.sh",
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
      
 19 
     | 
    
         
            +
              // Configure tool-specific properties.
         
     | 
| 
      
 20 
     | 
    
         
            +
              "customizations": {
         
     | 
| 
       21 
21 
     | 
    
         
             
                "vscode": {
         
     | 
| 
       22 
22 
     | 
    
         
             
                  "settings": {
         
     | 
| 
       23 
23 
     | 
    
         
             
                    "workbench": {
         
     | 
| 
         @@ -48,6 +48,6 @@ 
     | 
|
| 
       48 
48 
     | 
    
         
             
                }
         
     | 
| 
       49 
49 
     | 
    
         
             
              }
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
             
     | 
| 
      
 51 
     | 
    
         
            +
              // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
         
     | 
| 
      
 52 
     | 
    
         
            +
              // "remoteUser": "root"
         
     | 
| 
       53 
53 
     | 
    
         
             
            }
         
     | 
    
        data/.ruby-version
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            3. 
     | 
| 
      
 1 
     | 
    
         
            +
            3.4.7
         
     | 
| 
         @@ -0,0 +1,22 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            {
         
     | 
| 
      
 2 
     | 
    
         
            +
              "workbench.iconTheme": "vscode-icons",
         
     | 
| 
      
 3 
     | 
    
         
            +
              "editor.formatOnSave": true,
         
     | 
| 
      
 4 
     | 
    
         
            +
              "editor.quickSuggestions": {
         
     | 
| 
      
 5 
     | 
    
         
            +
                "strings": "on"
         
     | 
| 
      
 6 
     | 
    
         
            +
              },
         
     | 
| 
      
 7 
     | 
    
         
            +
              "[ruby]": {
         
     | 
| 
      
 8 
     | 
    
         
            +
                "editor.defaultFormatter": "Shopify.ruby-lsp",
         
     | 
| 
      
 9 
     | 
    
         
            +
                "editor.formatOnSave": true,
         
     | 
| 
      
 10 
     | 
    
         
            +
                "editor.tabSize": 2,
         
     | 
| 
      
 11 
     | 
    
         
            +
                "editor.insertSpaces": true,
         
     | 
| 
      
 12 
     | 
    
         
            +
                "editor.semanticHighlighting.enabled": true,
         
     | 
| 
      
 13 
     | 
    
         
            +
                "editor.formatOnType": true
         
     | 
| 
      
 14 
     | 
    
         
            +
              },
         
     | 
| 
      
 15 
     | 
    
         
            +
              "rubyLsp.rubyVersionManager": {
         
     | 
| 
      
 16 
     | 
    
         
            +
                "identifier": "mise"
         
     | 
| 
      
 17 
     | 
    
         
            +
              },
         
     | 
| 
      
 18 
     | 
    
         
            +
              "rubyLsp.formatter": "rubocop_internal",
         
     | 
| 
      
 19 
     | 
    
         
            +
              "mise.configureExtensionsAutomaticallyIgnoreList": [
         
     | 
| 
      
 20 
     | 
    
         
            +
                "ms-vscode.js-debug"
         
     | 
| 
      
 21 
     | 
    
         
            +
              ]
         
     | 
| 
      
 22 
     | 
    
         
            +
            }
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -10,23 +10,25 @@ 
     | 
|
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
            # PhlexIcons
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
            - [Bootstrap Icons](https://icons.getbootstrap.com) (2, 
     | 
| 
      
 13 
     | 
    
         
            +
            PhlexIcons brings 19,250+ SVG icons to [Phlex](https://phlex.fun) through a single, consistent API:
         
     | 
| 
      
 14 
     | 
    
         
            +
            - [Bootstrap Icons](https://icons.getbootstrap.com) (2,050+)
         
     | 
| 
       15 
15 
     | 
    
         
             
            - [Flag Icons](https://flagicons.lipis.dev) (250+)
         
     | 
| 
       16 
16 
     | 
    
         
             
            - [Heroicons](https://heroicons.com) (300+)
         
     | 
| 
       17 
     | 
    
         
            -
            - [ 
     | 
| 
      
 17 
     | 
    
         
            +
            - [Hugeicons](https://hugeicons.com) (4,450+)
         
     | 
| 
      
 18 
     | 
    
         
            +
            - [Lucide Icons](https://lucide.dev/icons) (1,600+)
         
     | 
| 
       18 
19 
     | 
    
         
             
            - [Material Design Icons](https://fonts.google.com/icons?icon.style=Filled&icon.set=Material+Icons) (2,100+)
         
     | 
| 
       19 
20 
     | 
    
         
             
            - [RadixUI Icons](https://radix-ui.com/icons) (300+)
         
     | 
| 
       20 
     | 
    
         
            -
            - [Remix Icons](https://remixicon.com) (3, 
     | 
| 
       21 
     | 
    
         
            -
            - [Tabler Icons](https://tabler.io/icons) (4, 
     | 
| 
      
 21 
     | 
    
         
            +
            - [Remix Icons](https://remixicon.com) (3,050+)
         
     | 
| 
      
 22 
     | 
    
         
            +
            - [Tabler Icons](https://tabler.io/icons) (4,950+)
         
     | 
| 
       22 
23 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
      
 24 
     | 
    
         
            +
            More packs can be added over time.
         
     | 
| 
       24 
25 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
      
 26 
     | 
    
         
            +
            Prefer not to include every pack? Install only the packs you need with these gems:
         
     | 
| 
       26 
27 
     | 
    
         | 
| 
       27 
28 
     | 
    
         
             
            - [phlex-icons-bootstrap](https://rubygems.org/gems/phlex-icons-bootstrap)
         
     | 
| 
       28 
29 
     | 
    
         
             
            - [phlex-icons-flag](https://rubygems.org/gems/phlex-icons-flag)
         
     | 
| 
       29 
30 
     | 
    
         
             
            - [phlex-icons-hero](https://rubygems.org/gems/phlex-icons-hero)
         
     | 
| 
      
 31 
     | 
    
         
            +
            - [phlex-icons-huge](https://rubygems.org/gems/phlex-icons-huge)
         
     | 
| 
       30 
32 
     | 
    
         
             
            - [phlex-icons-lucide](https://rubygems.org/gems/phlex-icons-lucide)
         
     | 
| 
       31 
33 
     | 
    
         
             
            - [phlex-icons-material](https://rubygems.org/gems/phlex-icons-material)
         
     | 
| 
       32 
34 
     | 
    
         
             
            - [phlex-icons-radix](https://rubygems.org/gems/phlex-icons-radix)
         
     | 
| 
         @@ -39,6 +41,16 @@ Other Phlex icon gems: 
     | 
|
| 
       39 
41 
     | 
    
         
             
            - [phlex-remixicon](https://github.com/danieldocki/phlex-remixicon)
         
     | 
| 
       40 
42 
     | 
    
         
             
            - [phlex-lucide](https://github.com/akodkod/phlex-lucide)
         
     | 
| 
       41 
43 
     | 
    
         | 
| 
      
 44 
     | 
    
         
            +
            ## Features
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
            - **Unified API**: One way to render icons across all supported packs.
         
     | 
| 
      
 47 
     | 
    
         
            +
            - **Use everything or just a pack**: Depend on the main gem or install per-pack gems.
         
     | 
| 
      
 48 
     | 
    
         
            +
            - **Configurable defaults**: Global defaults and per-pack variants.
         
     | 
| 
      
 49 
     | 
    
         
            +
            - **Works anywhere Phlex works**: With `Phlex::Kit` or plain Phlex components.
         
     | 
| 
      
 50 
     | 
    
         
            +
            - **Rails helper**: Simple `phlex_icon` helper (name is configurable).
         
     | 
| 
      
 51 
     | 
    
         
            +
            - **Custom icons**: Add your own icons alongside built-in packs.
         
     | 
| 
      
 52 
     | 
    
         
            +
            - **Kept up-to-date**: Auto-generated packs and weekly updates.
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
       42 
54 
     | 
    
         
             
            ## Installation
         
     | 
| 
       43 
55 
     | 
    
         | 
| 
       44 
56 
     | 
    
         
             
            Install the gem and add it to the application's Gemfile by executing:
         
     | 
| 
         @@ -53,9 +65,26 @@ If bundler is not being used to manage dependencies, install the gem by executin 
     | 
|
| 
       53 
65 
     | 
    
         
             
            gem install phlex-icons
         
     | 
| 
       54 
66 
     | 
    
         
             
            ```
         
     | 
| 
       55 
67 
     | 
    
         | 
| 
      
 68 
     | 
    
         
            +
            ## Quick start
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 71 
     | 
    
         
            +
            require 'phlex-icons' # Not needed in Rails apps; Bundler will require it.
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
            class IconsDemo < Phlex::HTML
         
     | 
| 
      
 74 
     | 
    
         
            +
              include PhlexIcons
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
              def view_template
         
     | 
| 
      
 77 
     | 
    
         
            +
                div do
         
     | 
| 
      
 78 
     | 
    
         
            +
                  Hero::Home(variant: :solid, class: 'w-6 h-6')
         
     | 
| 
      
 79 
     | 
    
         
            +
                  Icon('bootstrap/house', class: 'w-6 h-6') # string form
         
     | 
| 
      
 80 
     | 
    
         
            +
                end
         
     | 
| 
      
 81 
     | 
    
         
            +
              end
         
     | 
| 
      
 82 
     | 
    
         
            +
            end
         
     | 
| 
      
 83 
     | 
    
         
            +
            ```
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
       56 
85 
     | 
    
         
             
            ## Configuration
         
     | 
| 
       57 
86 
     | 
    
         | 
| 
       58 
     | 
    
         
            -
            The gem provides global configuration options 
     | 
| 
      
 87 
     | 
    
         
            +
            The gem provides global configuration options and per-pack options.
         
     | 
| 
       59 
88 
     | 
    
         | 
| 
       60 
89 
     | 
    
         
             
            ### Global configuration
         
     | 
| 
       61 
90 
     | 
    
         | 
| 
         @@ -101,6 +130,10 @@ end 
     | 
|
| 
       101 
130 
     | 
    
         
             
            PhlexIcons::Hero.configuration.default_variant = :solid # or :outline
         
     | 
| 
       102 
131 
     | 
    
         
             
            ```
         
     | 
| 
       103 
132 
     | 
    
         | 
| 
      
 133 
     | 
    
         
            +
            ### Hugeicons configuration
         
     | 
| 
      
 134 
     | 
    
         
            +
             
     | 
| 
      
 135 
     | 
    
         
            +
            Nothing to configure for Hugeicons, as we are providing only the free stroke variant.
         
     | 
| 
      
 136 
     | 
    
         
            +
             
     | 
| 
       104 
137 
     | 
    
         
             
            ### Lucide Icons configuration
         
     | 
| 
       105 
138 
     | 
    
         | 
| 
       106 
139 
     | 
    
         
             
            Nothing to configure for Lucide Icons.
         
     | 
| 
         @@ -144,7 +177,7 @@ PhlexIcons::Tabler.configuration.default_variant = :outline # or :filled 
     | 
|
| 
       144 
177 
     | 
    
         
             
            ```ruby
         
     | 
| 
       145 
178 
     | 
    
         
             
            require 'phlex-icons' # No need to require the gem if you are using it in a Rails application.
         
     | 
| 
       146 
179 
     | 
    
         | 
| 
       147 
     | 
    
         
            -
            class  
     | 
| 
      
 180 
     | 
    
         
            +
            class IconsDemo < Phlex::HTML
         
     | 
| 
       148 
181 
     | 
    
         
             
              include PhlexIcons
         
     | 
| 
       149 
182 
     | 
    
         | 
| 
       150 
183 
     | 
    
         
             
              def view_template
         
     | 
| 
         @@ -152,6 +185,7 @@ class PhlexIcons < Phlex::HTML 
     | 
|
| 
       152 
185 
     | 
    
         
             
                  Bootstrap::House(class: 'size-4')
         
     | 
| 
       153 
186 
     | 
    
         
             
                  Flag::Sa(variant: :rectangle, class: 'size-4')
         
     | 
| 
       154 
187 
     | 
    
         
             
                  Hero::Home(variant: :solid, class: 'size-4')
         
     | 
| 
      
 188 
     | 
    
         
            +
                  Huge::Home08(variant: :stroke, class: 'size-4')
         
     | 
| 
       155 
189 
     | 
    
         
             
                  Lucide::House(class: 'size-4')
         
     | 
| 
       156 
190 
     | 
    
         
             
                  Material::House(variant: :filled, class: 'size-4')
         
     | 
| 
       157 
191 
     | 
    
         
             
                  Radix::Home(class: 'size-4')
         
     | 
| 
         @@ -170,12 +204,13 @@ end 
     | 
|
| 
       170 
204 
     | 
    
         
             
            ```ruby
         
     | 
| 
       171 
205 
     | 
    
         
             
            require 'phlex-icons' # No need to require the gem if you are using it in a Rails application.
         
     | 
| 
       172 
206 
     | 
    
         | 
| 
       173 
     | 
    
         
            -
            class  
     | 
| 
      
 207 
     | 
    
         
            +
            class IconsDemo < Phlex::HTML
         
     | 
| 
       174 
208 
     | 
    
         
             
              def view_template
         
     | 
| 
       175 
209 
     | 
    
         
             
                div do
         
     | 
| 
       176 
210 
     | 
    
         
             
                  render PhlexIcons::Bootstrap::House.new(class: 'size-4')
         
     | 
| 
       177 
211 
     | 
    
         
             
                  render PhlexIcons::Flag::Sa.new(variant: :rectangle, class: 'size-4')
         
     | 
| 
       178 
212 
     | 
    
         
             
                  render PhlexIcons::Hero::Home.new(variant: :solid, class: 'size-4')
         
     | 
| 
      
 213 
     | 
    
         
            +
                  render PhlexIcons::Huge::Home08.new(variant: :stroke, class: 'size-4')
         
     | 
| 
       179 
214 
     | 
    
         
             
                  render PhlexIcons::Lucide::House.new(class: 'size-4')
         
     | 
| 
       180 
215 
     | 
    
         
             
                  render PhlexIcons::Material::House.new(variant: :filled, class: 'size-4')
         
     | 
| 
       181 
216 
     | 
    
         
             
                  render PhlexIcons::Radix::Home.new(class: 'size-4')
         
     | 
| 
         @@ -183,7 +218,7 @@ class PhlexIcons < Phlex::HTML 
     | 
|
| 
       183 
218 
     | 
    
         
             
                  render PhlexIcons::Tabler::Home.new(variant: :filled, class: 'size-4')
         
     | 
| 
       184 
219 
     | 
    
         | 
| 
       185 
220 
     | 
    
         
             
                  # or with a string
         
     | 
| 
       186 
     | 
    
         
            -
                  render PhlexIcons::Icon('bootstrap/house', class: 'size-4')
         
     | 
| 
      
 221 
     | 
    
         
            +
                  render PhlexIcons::Icon.new('bootstrap/house', class: 'size-4')
         
     | 
| 
       187 
222 
     | 
    
         
             
                end
         
     | 
| 
       188 
223 
     | 
    
         
             
              end
         
     | 
| 
       189 
224 
     | 
    
         
             
            end
         
     | 
| 
         @@ -191,9 +226,11 @@ end 
     | 
|
| 
       191 
226 
     | 
    
         | 
| 
       192 
227 
     | 
    
         
             
            ### Rails View Helper
         
     | 
| 
       193 
228 
     | 
    
         | 
| 
       194 
     | 
    
         
            -
             
     | 
| 
      
 229 
     | 
    
         
            +
            PhlexIcons provides a convenient helper method to render icons directly in your ERB or Phlex views.
         
     | 
| 
      
 230 
     | 
    
         
            +
             
     | 
| 
      
 231 
     | 
    
         
            +
            By default, the helper method is named `phlex_icon`, but it is configurable. You can change it by configuring `PhlexIcons.configuration.helper_method_name`.
         
     | 
| 
       195 
232 
     | 
    
         | 
| 
       196 
     | 
    
         
            -
             
     | 
| 
      
 233 
     | 
    
         
            +
            To use the helper method inside Phlex views/components, you need to register it in your base component (Or any other component) using `register_output_helper`.
         
     | 
| 
       197 
234 
     | 
    
         | 
| 
       198 
235 
     | 
    
         
             
            ```erb
         
     | 
| 
       199 
236 
     | 
    
         
             
            <%# Render a Bootstrap house icon with default size %>
         
     | 
| 
         @@ -217,15 +254,15 @@ By default, the helper method is named `phlex_icon`, but is configurable. 
     | 
|
| 
       217 
254 
     | 
    
         | 
| 
       218 
255 
     | 
    
         
             
            The first argument is the icon identifier. Such as: `'pack/icon_name:variant'`.
         
     | 
| 
       219 
256 
     | 
    
         | 
| 
       220 
     | 
    
         
            -
             
     | 
| 
       221 
     | 
    
         
            -
             
     | 
| 
       222 
     | 
    
         
            -
             
     | 
| 
      
 257 
     | 
    
         
            +
            - If `default_pack` is configured, you can omit the pack name (e.g., `'icon_name:variant'` instead of `'pack/icon_name:variant'`).
         
     | 
| 
      
 258 
     | 
    
         
            +
            - The `:variant` part is optional.
         
     | 
| 
      
 259 
     | 
    
         
            +
            - Examples: `'hero/house:solid'`, `'house:solid'`, `'house'`
         
     | 
| 
       223 
260 
     | 
    
         | 
| 
       224 
261 
     | 
    
         
             
            Subsequent arguments are passed as options to the icon component, such as `variant`, `class`, etc.
         
     | 
| 
       225 
262 
     | 
    
         | 
| 
       226 
     | 
    
         
            -
            ###  
     | 
| 
      
 263 
     | 
    
         
            +
            ### Use only specific packs
         
     | 
| 
       227 
264 
     | 
    
         | 
| 
       228 
     | 
    
         
            -
             
     | 
| 
      
 265 
     | 
    
         
            +
            For example, to use only Heroicons and Flag Icons, add:
         
     | 
| 
       229 
266 
     | 
    
         
             
            - [phlex-icons-flag](https://rubygems.org/gems/phlex-icons-flag)
         
     | 
| 
       230 
267 
     | 
    
         
             
            - [phlex-icons-hero](https://rubygems.org/gems/phlex-icons-hero)
         
     | 
| 
       231 
268 
     | 
    
         | 
| 
         @@ -252,12 +289,12 @@ class PhlexIcons < Phlex::HTML 
     | 
|
| 
       252 
289 
     | 
    
         
             
            end
         
     | 
| 
       253 
290 
     | 
    
         
             
            ```
         
     | 
| 
       254 
291 
     | 
    
         | 
| 
       255 
     | 
    
         
            -
            ### Add custom icons  
     | 
| 
      
 292 
     | 
    
         
            +
            ### Add custom icons (Rails)
         
     | 
| 
       256 
293 
     | 
    
         | 
| 
       257 
     | 
    
         
            -
             
     | 
| 
      
 294 
     | 
    
         
            +
            To add your own icons in a Rails app, create a `phlex_icons/custom` directory under `app/components`, then create one component per icon. For example:
         
     | 
| 
       258 
295 
     | 
    
         | 
| 
       259 
296 
     | 
    
         
             
            ```ruby
         
     | 
| 
       260 
     | 
    
         
            -
            # app/ 
     | 
| 
      
 297 
     | 
    
         
            +
            # app/components/phlex_icons/custom/icon_class_name.rb
         
     | 
| 
       261 
298 
     | 
    
         | 
| 
       262 
299 
     | 
    
         
             
            module PhlexIcons
         
     | 
| 
       263 
300 
     | 
    
         
             
              module Custom
         
     | 
| 
         @@ -270,33 +307,23 @@ module PhlexIcons 
     | 
|
| 
       270 
307 
     | 
    
         
             
            end
         
     | 
| 
       271 
308 
     | 
    
         
             
            ```
         
     | 
| 
       272 
309 
     | 
    
         | 
| 
       273 
     | 
    
         
            -
            Finally, you will need to create a `PhlexIcons::Custom` module in `phlex-icons/custom.rb` file to include your custom icons and make them a `Phlex::Kit`:
         
     | 
| 
       274 
     | 
    
         
            -
             
     | 
| 
       275 
     | 
    
         
            -
            ```ruby
         
     | 
| 
       276 
     | 
    
         
            -
            # app/views/components/phlex-icons/custom.rb
         
     | 
| 
       277 
     | 
    
         
            -
             
     | 
| 
       278 
     | 
    
         
            -
            module PhlexIcons
         
     | 
| 
       279 
     | 
    
         
            -
              module Custom
         
     | 
| 
       280 
     | 
    
         
            -
                extend Phlex::Kit
         
     | 
| 
       281 
     | 
    
         
            -
              end
         
     | 
| 
       282 
     | 
    
         
            -
            end
         
     | 
| 
       283 
     | 
    
         
            -
            ```
         
     | 
| 
       284 
     | 
    
         
            -
             
     | 
| 
       285 
310 
     | 
    
         
             
            Now, you can use your custom icons like any other icon pack as described above.
         
     | 
| 
       286 
311 
     | 
    
         | 
| 
       287 
312 
     | 
    
         
             
            ## Update icon packs
         
     | 
| 
       288 
313 
     | 
    
         | 
| 
       289 
     | 
    
         
            -
            All  
     | 
| 
      
 314 
     | 
    
         
            +
            All packs are generated from the scripts under [`generators`](/generators). Clone the repo and run the relevant generator to update a pack. A GitHub Action also regenerates all packs weekly and ships updates.
         
     | 
| 
       290 
315 
     | 
    
         | 
| 
       291 
     | 
    
         
            -
            ##  
     | 
| 
      
 316 
     | 
    
         
            +
            ## Icon pack versions
         
     | 
| 
       292 
317 
     | 
    
         | 
| 
       293 
     | 
    
         
            -
            Each  
     | 
| 
      
 318 
     | 
    
         
            +
            Each pack exposes a `VERSION` constant indicating the source version used by the gem. For example: `PhlexIcons::Bootstrap::VERSION`.
         
     | 
| 
       294 
319 
     | 
    
         | 
| 
       295 
320 
     | 
    
         
             
            ## Development
         
     | 
| 
       296 
321 
     | 
    
         | 
| 
       297 
     | 
    
         
            -
            After checking out the repo, open it in  
     | 
| 
      
 322 
     | 
    
         
            +
            After checking out the repo, open it in VS Code and choose `Reopen in Container` to start a development container. Then run `rake spec` to execute tests. Use `bin/console` to experiment interactively.
         
     | 
| 
      
 323 
     | 
    
         
            +
             
     | 
| 
      
 324 
     | 
    
         
            +
            If you prefer not to use the dev container, install Mise and run `mise trust && mise install` to set up dependencies.
         
     | 
| 
       298 
325 
     | 
    
         | 
| 
       299 
     | 
    
         
            -
            To install this gem  
     | 
| 
      
 326 
     | 
    
         
            +
            To install this gem locally, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, then run `bundle exec rake release` to tag, push, and publish the gem to [rubygems.org](https://rubygems.org).
         
     | 
| 
       300 
327 
     | 
    
         | 
| 
       301 
328 
     | 
    
         
             
            ## Contributing
         
     | 
| 
       302 
329 
     | 
    
         | 
    
        data/generators/huge.rb
    ADDED
    
    | 
         @@ -0,0 +1,100 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require_relative 'helper'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            REPO_URL = 'https://github.com/hugeicons/hugeicons-static.git'
         
     | 
| 
      
 6 
     | 
    
         
            +
            REPO_NAME = 'hugeicons-static'
         
     | 
| 
      
 7 
     | 
    
         
            +
            ICONS_PACK_MODULE_PATH = 'lib/phlex-icons/huge.rb'
         
     | 
| 
      
 8 
     | 
    
         
            +
            ICONS_PACK_PATH = 'lib/phlex-icons/huge'
         
     | 
| 
      
 9 
     | 
    
         
            +
            VARIANTS = %i[stroke].freeze
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            TEMPLATE = ERB.new <<~TEMPLATE
         
     | 
| 
      
 12 
     | 
    
         
            +
              # frozen_string_literal: true
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
              # rubocop:disable #{ROBOCOP_DISABLE_WARNINGS}
         
     | 
| 
      
 15 
     | 
    
         
            +
              module PhlexIcons
         
     | 
| 
      
 16 
     | 
    
         
            +
                module Huge
         
     | 
| 
      
 17 
     | 
    
         
            +
                  class <%= icon_name %> < Base
         
     | 
| 
      
 18 
     | 
    
         
            +
                    def stroke
         
     | 
| 
      
 19 
     | 
    
         
            +
                      <%= stroke_icon %>
         
     | 
| 
      
 20 
     | 
    
         
            +
                    end
         
     | 
| 
      
 21 
     | 
    
         
            +
                  end
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
      
 24 
     | 
    
         
            +
              # rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
         
     | 
| 
      
 25 
     | 
    
         
            +
            TEMPLATE
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            VARIANT_TEMPLATE = ERB.new <<~VARIANT_TEMPLATE
         
     | 
| 
      
 28 
     | 
    
         
            +
              # frozen_string_literal: true
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
              # rubocop:disable #{ROBOCOP_DISABLE_WARNINGS}
         
     | 
| 
      
 31 
     | 
    
         
            +
              module PhlexIcons
         
     | 
| 
      
 32 
     | 
    
         
            +
                module Huge
         
     | 
| 
      
 33 
     | 
    
         
            +
                  class <%= icon_name %><%= variant.to_s.capitalize %> < Base
         
     | 
| 
      
 34 
     | 
    
         
            +
                    def view_template
         
     | 
| 
      
 35 
     | 
    
         
            +
                      render <%= icon_name %>.new(variant: :<%= variant %>, **attrs)
         
     | 
| 
      
 36 
     | 
    
         
            +
                    end
         
     | 
| 
      
 37 
     | 
    
         
            +
                  end
         
     | 
| 
      
 38 
     | 
    
         
            +
                end
         
     | 
| 
      
 39 
     | 
    
         
            +
              end
         
     | 
| 
      
 40 
     | 
    
         
            +
              # rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
         
     | 
| 
      
 41 
     | 
    
         
            +
            VARIANT_TEMPLATE
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
            REPLACEMENTS = {
         
     | 
| 
      
 44 
     | 
    
         
            +
              '1st-' => 'first-',
         
     | 
| 
      
 45 
     | 
    
         
            +
              '2nd-' => 'second-',
         
     | 
| 
      
 46 
     | 
    
         
            +
              '3rd-' => 'third-',
         
     | 
| 
      
 47 
     | 
    
         
            +
              '3-d-' => 'three-d-',
         
     | 
| 
      
 48 
     | 
    
         
            +
              '3d-' => 'three-d-',
         
     | 
| 
      
 49 
     | 
    
         
            +
              '4k' => 'four-k',
         
     | 
| 
      
 50 
     | 
    
         
            +
              '7z-' => 'seven-z-',
         
     | 
| 
      
 51 
     | 
    
         
            +
              'comment ' => 'comment-',
         
     | 
| 
      
 52 
     | 
    
         
            +
              'image-flip ' => 'image-flip'
         
     | 
| 
      
 53 
     | 
    
         
            +
            }.freeze
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
            def main
         
     | 
| 
      
 56 
     | 
    
         
            +
              run_generator do
         
     | 
| 
      
 57 
     | 
    
         
            +
                new_version = JSON.parse(File.read("generators/#{REPO_NAME}/package.json"))['version']
         
     | 
| 
      
 58 
     | 
    
         
            +
                update_icon_path_version(new_version)
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
                icon_file_names.tqdm.each { create_icon_component(_1) }
         
     | 
| 
      
 61 
     | 
    
         
            +
              end
         
     | 
| 
      
 62 
     | 
    
         
            +
            end
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
            def icon_file_names
         
     | 
| 
      
 65 
     | 
    
         
            +
              Dir.glob("generators/#{REPO_NAME}/icons/*").map { |file| File.basename(file) }
         
     | 
| 
      
 66 
     | 
    
         
            +
            end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
            def create_icon_component(icon_file_name)
         
     | 
| 
      
 69 
     | 
    
         
            +
              File.write(
         
     | 
| 
      
 70 
     | 
    
         
            +
                File.join(ICONS_PACK_PATH, component_file_name(icon_file_name, REPLACEMENTS)),
         
     | 
| 
      
 71 
     | 
    
         
            +
                TEMPLATE.result_with_hash(
         
     | 
| 
      
 72 
     | 
    
         
            +
                  icon_name: component_class_name(icon_file_name, REPLACEMENTS),
         
     | 
| 
      
 73 
     | 
    
         
            +
                  stroke_icon: read_and_convert_icon(stroke_icon_file_path(icon_file_name))
         
     | 
| 
      
 74 
     | 
    
         
            +
                )
         
     | 
| 
      
 75 
     | 
    
         
            +
              )
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
              VARIANTS.each do |variant|
         
     | 
| 
      
 78 
     | 
    
         
            +
                File.write(
         
     | 
| 
      
 79 
     | 
    
         
            +
                  File.join(ICONS_PACK_PATH, variant_component_file_name(icon_file_name, variant, REPLACEMENTS)),
         
     | 
| 
      
 80 
     | 
    
         
            +
                  VARIANT_TEMPLATE.result_with_hash(
         
     | 
| 
      
 81 
     | 
    
         
            +
                    icon_name: component_class_name(icon_file_name, REPLACEMENTS),
         
     | 
| 
      
 82 
     | 
    
         
            +
                    variant: variant
         
     | 
| 
      
 83 
     | 
    
         
            +
                  )
         
     | 
| 
      
 84 
     | 
    
         
            +
                )
         
     | 
| 
      
 85 
     | 
    
         
            +
              end
         
     | 
| 
      
 86 
     | 
    
         
            +
            end
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
            def read_and_convert_icon(icon_file_path)
         
     | 
| 
      
 89 
     | 
    
         
            +
              icon_file_content = File.read(icon_file_path)
         
     | 
| 
      
 90 
     | 
    
         
            +
                                      .sub('width="24"', '')
         
     | 
| 
      
 91 
     | 
    
         
            +
                                      .sub('height="24"', '')
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
      
 93 
     | 
    
         
            +
              Phlexing::Converter.convert(icon_file_content).sub('svg(', "svg(\n**attrs,")
         
     | 
| 
      
 94 
     | 
    
         
            +
            end
         
     | 
| 
      
 95 
     | 
    
         
            +
             
     | 
| 
      
 96 
     | 
    
         
            +
            def stroke_icon_file_path(icon_file_name)
         
     | 
| 
      
 97 
     | 
    
         
            +
              "generators/#{REPO_NAME}/icons/#{icon_file_name}"
         
     | 
| 
      
 98 
     | 
    
         
            +
            end
         
     | 
| 
      
 99 
     | 
    
         
            +
             
     | 
| 
      
 100 
     | 
    
         
            +
            main if __FILE__ == $PROGRAM_NAME
         
     | 
    
        data/lib/phlex-icons/railtie.rb
    CHANGED
    
    | 
         @@ -9,7 +9,15 @@ module PhlexIcons 
     | 
|
| 
       9 
9 
     | 
    
         
             
                    helper_method_name = PhlexIcons.configuration.helper_method_name
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
                    define_method helper_method_name do |name, **options|
         
     | 
| 
       12 
     | 
    
         
            -
                       
     | 
| 
      
 12 
     | 
    
         
            +
                      component, fiber_id = Thread.current[:__phlex_component__]
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                      if component && fiber_id == Fiber.current.object_id
         
     | 
| 
      
 15 
     | 
    
         
            +
                        component.instance_exec { render PhlexIcons::Icon.new(name, **options) }
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                        nil
         
     | 
| 
      
 18 
     | 
    
         
            +
                      else
         
     | 
| 
      
 19 
     | 
    
         
            +
                        PhlexIcons::Icon.call(name, **options)&.html_safe
         
     | 
| 
      
 20 
     | 
    
         
            +
                      end
         
     | 
| 
       13 
21 
     | 
    
         
             
                    end
         
     | 
| 
       14 
22 
     | 
    
         
             
                  end
         
     | 
| 
       15 
23 
     | 
    
         
             
                end
         
     | 
    
        data/lib/phlex-icons/version.rb
    CHANGED
    
    
    
        data/mise.toml
    ADDED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: phlex-icons-bootstrap
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.41.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ali Hamdi Ali Fadel
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire:
         
     | 
| 
       9 
8 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
9 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 10 
     | 
    
         
            +
            date: 1980-01-02 00:00:00.000000000 Z
         
     | 
| 
       12 
11 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
12 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
13 
     | 
    
         
             
              name: phlex
         
     | 
| 
         @@ -24,7 +23,6 @@ dependencies: 
     | 
|
| 
       24 
23 
     | 
    
         
             
                - - ">="
         
     | 
| 
       25 
24 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
25 
     | 
    
         
             
                    version: '1.11'
         
     | 
| 
       27 
     | 
    
         
            -
            description:
         
     | 
| 
       28 
26 
     | 
    
         
             
            email:
         
     | 
| 
       29 
27 
     | 
    
         
             
            - aliosm1997@gmail.com
         
     | 
| 
       30 
28 
     | 
    
         
             
            executables: []
         
     | 
| 
         @@ -36,6 +34,8 @@ files: 
     | 
|
| 
       36 
34 
     | 
    
         
             
            - ".rspec"
         
     | 
| 
       37 
35 
     | 
    
         
             
            - ".rubocop.yml"
         
     | 
| 
       38 
36 
     | 
    
         
             
            - ".ruby-version"
         
     | 
| 
      
 37 
     | 
    
         
            +
            - ".vscode/extensions.json"
         
     | 
| 
      
 38 
     | 
    
         
            +
            - ".vscode/settings.json"
         
     | 
| 
       39 
39 
     | 
    
         
             
            - CHANGELOG.md
         
     | 
| 
       40 
40 
     | 
    
         
             
            - CODE_OF_CONDUCT.md
         
     | 
| 
       41 
41 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
         @@ -45,6 +45,7 @@ files: 
     | 
|
| 
       45 
45 
     | 
    
         
             
            - generators/flag.rb
         
     | 
| 
       46 
46 
     | 
    
         
             
            - generators/helper.rb
         
     | 
| 
       47 
47 
     | 
    
         
             
            - generators/hero.rb
         
     | 
| 
      
 48 
     | 
    
         
            +
            - generators/huge.rb
         
     | 
| 
       48 
49 
     | 
    
         
             
            - generators/lucide.rb
         
     | 
| 
       49 
50 
     | 
    
         
             
            - generators/material.rb
         
     | 
| 
       50 
51 
     | 
    
         
             
            - generators/radix.rb
         
     | 
| 
         @@ -2137,6 +2138,7 @@ files: 
     | 
|
| 
       2137 
2138 
     | 
    
         
             
            - lib/phlex-icons/name_parser.rb
         
     | 
| 
       2138 
2139 
     | 
    
         
             
            - lib/phlex-icons/railtie.rb
         
     | 
| 
       2139 
2140 
     | 
    
         
             
            - lib/phlex-icons/version.rb
         
     | 
| 
      
 2141 
     | 
    
         
            +
            - mise.toml
         
     | 
| 
       2140 
2142 
     | 
    
         
             
            - phlex-icons.png
         
     | 
| 
       2141 
2143 
     | 
    
         
             
            - sig/phlex/icons.rbs
         
     | 
| 
       2142 
2144 
     | 
    
         
             
            homepage: https://github.com/AliOsm/phlex-icons
         
     | 
| 
         @@ -2148,7 +2150,6 @@ metadata: 
     | 
|
| 
       2148 
2150 
     | 
    
         
             
              source_code_uri: https://github.com/AliOsm/phlex-icons
         
     | 
| 
       2149 
2151 
     | 
    
         
             
              changelog_uri: https://github.com/AliOsm/phlex-icons/blob/main/CHANGELOG.md
         
     | 
| 
       2150 
2152 
     | 
    
         
             
              rubygems_mfa_required: 'true'
         
     | 
| 
       2151 
     | 
    
         
            -
            post_install_message:
         
     | 
| 
       2152 
2153 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       2153 
2154 
     | 
    
         
             
            require_paths:
         
     | 
| 
       2154 
2155 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -2163,8 +2164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       2163 
2164 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       2164 
2165 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       2165 
2166 
     | 
    
         
             
            requirements: []
         
     | 
| 
       2166 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
       2167 
     | 
    
         
            -
            signing_key:
         
     | 
| 
      
 2167 
     | 
    
         
            +
            rubygems_version: 3.6.9
         
     | 
| 
       2168 
2168 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       2169 
2169 
     | 
    
         
             
            summary: Bootstrap icons library for Phlex
         
     | 
| 
       2170 
2170 
     | 
    
         
             
            test_files: []
         
     |