{"id":21825892,"url":"https://github.com/bravetheskies/polaris-html","last_synced_at":"2025-04-14T05:23:23.867Z","repository":{"id":39693500,"uuid":"222947031","full_name":"bravetheskies/polaris-html","owner":"bravetheskies","description":"Shopify Polaris rails components.","archived":false,"fork":false,"pushed_at":"2024-07-01T02:26:37.000Z","size":55,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T19:13:24.617Z","etag":null,"topics":["rails","rails-gem","ruby","ruby-gem","ruby-on-rails","shopify","shopify-app","shopify-apps","shopify-embedded-applications","shopify-partners","shopify-polaris"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bravetheskies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-20T13:44:54.000Z","updated_at":"2025-01-22T23:58:57.000Z","dependencies_parsed_at":"2023-01-28T20:30:31.862Z","dependency_job_id":null,"html_url":"https://github.com/bravetheskies/polaris-html","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bravetheskies%2Fpolaris-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bravetheskies%2Fpolaris-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bravetheskies%2Fpolaris-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bravetheskies%2Fpolaris-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bravetheskies","download_url":"https://codeload.github.com/bravetheskies/polaris-html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248825293,"owners_count":21167455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rails","rails-gem","ruby","ruby-gem","ruby-on-rails","shopify","shopify-app","shopify-apps","shopify-embedded-applications","shopify-partners","shopify-polaris"],"created_at":"2024-11-27T18:02:57.070Z","updated_at":"2025-04-14T05:23:23.860Z","avatar_url":"https://github.com/bravetheskies.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polaris::Html\nActionView components for Shopify's Polaris components: https://polaris.shopify.com/\n\n## Usage\nThis gem is under active development. It is indeed as a drop-in solution for adding Polaris components to Ruby on Rails Shopify apps.\n\n## Installation\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'polaris-html', git: 'https://github.com/bravetheskies/Polaris-html'\n```\n\nAdd actionview comonents: https://github.com/github/actionview-component\n    \nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"actionview-component\"\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\nIn `config/application.rb`, add:\n\n```bash\nrequire \"action_view/component/railtie\"\n```\n\n## Components\n### Forms components\n```ruby\ntextbox = form: , field: , placeholder: nil, help_text: nil, label_hidden: false, class_extra_form_item: ''\n\u003c%= render(Form::Text, form: form , field: :email) %\u003e\n\u003c%= render(Form::Checkbox, form: form , label: 'Enabled', field: :enabled ) %\u003e\n```\n\ntags - path , label -\u003e defualt to delete path. Need to add as option\n\n### Layouts \n```ruby\n\u003c%= render(PolarisLayouts::AnnotatedSection, title: 'Operations', description: 'Past operations showing the alterations made ') do %\u003e\n\u003c% end %\u003e\n```\n\n### Navigation\n```ruby\n\u003c%= render(PolarisNavigation::FooterHelp) do %\u003e\n\u003c% end %\u003e\n```\n\n### Select\n```ruby\n\u003c%= render(Form::Select.new(form: form, field: :field_name, choices: Example.all.collect {|example| [example.name, example.id]})) %\u003e\n```\n\nYou will also need to add some Javascript to your `app/javascript/packs/application.js` to change the text in the select box. Example here:\n\n```javascript\ndocument.addEventListener(\"turbolinks:load\", function() {\n   const selectboxes = document.querySelectorAll('.Polaris-Select__Input');\n   selectboxes.forEach((element) =\u003e {\n      element.parentNode.querySelector('.Polaris-Select__SelectedOption').textContent = element.options[element.selectedIndex].text\n      element.onchange = function(){\n         element.parentNode.querySelector('.Polaris-Select__SelectedOption').textContent = element.options[element.selectedIndex].text\n      }\n   });\n});\n```\n\n### JavaScript\n\n#### Select Box\n\nOriginal select box javascript:\n\n```javascript\nconst selectboxes = document.querySelectorAll('.Polaris-Select__Input');\nselectboxes.forEach((element) =\u003e {\n  element.parentNode.querySelector('.Polaris-Select__SelectedOption').textContent = element.value\n});\n```\n\n## TODO\nTags, change to lable and link.\n## Contributing\nContribution directions go here.\n\n## License\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbravetheskies%2Fpolaris-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbravetheskies%2Fpolaris-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbravetheskies%2Fpolaris-html/lists"}