okonomi_ui_kit 0.1.6 → 0.1.8

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +163 -7
  3. data/app/assets/builds/okonomi_ui_kit/application.tailwind.css +292 -4
  4. data/app/helpers/okonomi_ui_kit/component.rb +81 -0
  5. data/app/helpers/okonomi_ui_kit/components/badge.rb +21 -16
  6. data/app/helpers/okonomi_ui_kit/components/breadcrumbs.rb +69 -0
  7. data/app/helpers/okonomi_ui_kit/components/button_base.rb +56 -0
  8. data/app/helpers/okonomi_ui_kit/components/button_tag.rb +23 -0
  9. data/app/helpers/okonomi_ui_kit/components/button_to.rb +23 -0
  10. data/app/helpers/okonomi_ui_kit/components/code.rb +73 -0
  11. data/app/helpers/okonomi_ui_kit/components/icon.rb +36 -0
  12. data/app/helpers/okonomi_ui_kit/components/link_to.rb +23 -0
  13. data/app/helpers/okonomi_ui_kit/components/page.rb +247 -0
  14. data/app/helpers/okonomi_ui_kit/components/table.rb +207 -0
  15. data/app/helpers/okonomi_ui_kit/components/typography.rb +29 -3
  16. data/app/helpers/okonomi_ui_kit/config.rb +20 -0
  17. data/app/helpers/okonomi_ui_kit/form_builder.rb +2 -2
  18. data/app/helpers/okonomi_ui_kit/t_w_merge.rb +108 -0
  19. data/app/helpers/okonomi_ui_kit/theme.rb +3 -26
  20. data/app/helpers/okonomi_ui_kit/ui_helper.rb +0 -40
  21. data/app/views/okonomi/components/breadcrumbs/_breadcrumbs.html.erb +46 -0
  22. data/app/views/okonomi/components/code/_code.html.erb +1 -0
  23. data/app/views/okonomi/components/icon/_icon.html.erb +38 -0
  24. data/app/views/okonomi/components/page/_page.html.erb +5 -0
  25. data/app/views/okonomi/components/table/_table.html.erb +3 -0
  26. data/app/views/okonomi/forms/tailwind/_upload_field.html.erb +2 -2
  27. data/app/views/okonomi/modals/_confirmation_modal.html.erb +2 -2
  28. data/app/views/okonomi/navigation/_link.html.erb +1 -1
  29. data/lib/okonomi_ui_kit/engine.rb +0 -5
  30. data/lib/okonomi_ui_kit/version.rb +1 -1
  31. metadata +18 -7
  32. data/app/helpers/okonomi_ui_kit/badge_helper.rb +0 -23
  33. data/app/helpers/okonomi_ui_kit/breadcrumbs_helper.rb +0 -60
  34. data/app/helpers/okonomi_ui_kit/icon_helper.rb +0 -39
  35. data/app/helpers/okonomi_ui_kit/page_builder_helper.rb +0 -217
  36. data/app/helpers/okonomi_ui_kit/table_helper.rb +0 -158
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c9f6e01883b276ac9f9698f3d62b837b2b015e43c58928c2dce2a8f7d989ec9
4
- data.tar.gz: 70f433e695cec861ff14035220709e8d56115b4747d18e4397b342d8f5693e0d
3
+ metadata.gz: 24a820c59804a18c24872be13e80062bd25cfb96fe7d6da83eaee5e94b6e7ac0
4
+ data.tar.gz: e4dd1e222ac1593f098fc5f49e1a8b322aee75612b087ca62f6610822b6ed963
5
5
  SHA512:
6
- metadata.gz: b1477d7d86ad3def41842194405981bfcaed050bde961961f1e75f74ccc7057b9c0dbd4c06686f1c6639042e17bfef01fe5947a27fc895f516f257c878ac3f68
7
- data.tar.gz: 3ac01a8f7d26c04b62b3af528e32003f98b59f4caa06da35fd1f974e36017b7fe4c21589a32bf3ca50d14eecee641a719871ee7bb1b2ef3f3bef15652de4a503
6
+ metadata.gz: 7c800c4444d8f97f83898e8cb58a51f56746602fddc398a902412c6984501c86f9b653420dcbec5e5dd5c0bc5d208db86b2e291b8288de596e11e27b78e92284
7
+ data.tar.gz: 10047841cc202597d69470676eae295f7fa4215c3580d8183f855b92bd197b8b425d849097962ec47e49046d24bb3e18e9014d2bbfb3cee0a98144365953e758
data/README.md CHANGED
@@ -1,10 +1,20 @@
1
1
  # OkonomiUiKit
2
- Short description and motivation.
3
2
 
4
- ## Usage
5
- How to use my plugin.
3
+ A Rails Engine gem that provides customizable, Tailwind CSS-based UI components for Rails applications. Built with maximum flexibility in mind, OkonomiUiKit allows you to maintain consistent design patterns across projects while giving you complete control over styling and behavior.
4
+
5
+ ## Features
6
+
7
+ - **🎨 Fully Customizable** - Override any component's styling through a powerful configuration system
8
+ - **🚀 Rails Native** - Built as a Rails Engine following Rails conventions
9
+ - **💨 Tailwind CSS** - Modern utility-first CSS with intelligent class merging
10
+ - **⚡ Stimulus Powered** - Progressive enhancement with Stimulus controllers
11
+ - **🔧 Form Builder** - Enhanced form helpers with consistent styling
12
+ - **📦 Component Library** - Pre-built components including buttons, badges, tables, alerts, and more
13
+ - **🎯 Theme System** - Centralized theme configuration with variant support
14
+ - **🔄 Smart Style Merging** - Intelligent Tailwind class conflict resolution
6
15
 
7
16
  ## Installation
17
+
8
18
  Add this line to your application's Gemfile:
9
19
 
10
20
  ```ruby
@@ -16,13 +26,159 @@ And then execute:
16
26
  $ bundle
17
27
  ```
18
28
 
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install okonomi_ui_kit
29
+ In your application layout, include the CSS and JavaScript:
30
+
31
+ ```erb
32
+ <%= stylesheet_link_tag "okonomi_ui_kit/application.tailwind", "data-turbo-track": "reload" %>
33
+ <%= javascript_importmap_tags "okonomi_ui_kit" %>
34
+ ```
35
+
36
+ ## Quick Start
37
+
38
+ ### Using Components
39
+
40
+ OkonomiUiKit provides a `ui` helper that gives you access to all components:
41
+
42
+ ```erb
43
+ <%= ui.button "Click me", variant: :contained, color: :primary %>
44
+ <%= ui.badge "New", color: :success %>
45
+ <%= ui.alert "Welcome to OkonomiUiKit!", variant: :info %>
46
+ ```
47
+
48
+ ### Using the Form Builder
49
+
50
+ ```erb
51
+ <%= form_with model: @user, builder: OkonomiUiKit::FormBuilder do |f| %>
52
+ <%= f.field_set do %>
53
+ <%= f.field :email do %>
54
+ <%= f.email_field :email %>
55
+ <% end %>
56
+
57
+ <%= f.field :password do %>
58
+ <%= f.password_field :password %>
59
+ <% end %>
60
+ <% end %>
61
+
62
+ <%= f.submit "Sign Up", color: :primary %>
63
+ <% end %>
64
+ ```
65
+
66
+ ## Available Components
67
+
68
+ ### Core Components
69
+ - **Button** - Buttons with multiple variants (contained, outlined, text)
70
+ - **Badge** - Status indicators and labels
71
+ - **Alert** - Notification messages with icons
72
+ - **Table** - Data tables with consistent styling
73
+ - **Typography** - Headings and text with predefined styles
74
+ - **Code** - Inline and block code display
75
+
76
+ ### Form Components
77
+ - **Field** - Form field wrapper with label and error handling
78
+ - **FieldSet** - Group related form fields
79
+ - **Select** - Styled select dropdowns
80
+ - **Checkbox/Radio** - Enhanced checkboxes and radio buttons
81
+ - **File Upload** - Drag-and-drop file uploads
82
+
83
+ ### Navigation Components
84
+ - **Dropdown** - Dropdown menus with Stimulus integration
85
+ - **Breadcrumbs** - Navigation breadcrumbs
86
+ - **Link** - Styled links with variants
87
+
88
+ ## Customization
89
+
90
+ OkonomiUiKit is designed to be highly customizable. You can override component styles by creating configuration classes in your Rails application.
91
+
92
+ ### Quick Example
93
+
94
+ ```ruby
95
+ # app/helpers/okonomi_ui_kit/configs/button_base.rb
96
+ module OkonomiUiKit
97
+ module Configs
98
+ class ButtonBase < OkonomiUiKit::Config
99
+ register_styles :default do
100
+ {
101
+ root: "font-semibold transition-all duration-200",
102
+ contained: {
103
+ colors: {
104
+ primary: "bg-brand-500 hover:bg-brand-600"
105
+ }
106
+ }
107
+ }
108
+ end
109
+ end
110
+ end
111
+ end
22
112
  ```
23
113
 
114
+ ## Documentation
115
+
116
+ ### Guides
117
+
118
+ - [Style Overrides Guide](guides/style-overrides-guide.md) - Complete guide to customizing component styles
119
+ - [Component Guide](docs/COMPONENT_GUIDE.md) - Creating custom components
120
+ - [CLAUDE.md](CLAUDE.md) - AI assistant instructions and architecture details
121
+
122
+ ### Component Guides
123
+
124
+ - [Breadcrumbs](guides/components/breadcrumbs.md) - Navigation breadcrumb trails
125
+ - [Typography](guides/components/typography.md) - Text styling with semantic HTML elements
126
+ - [Icon](guides/components/icon.md) - SVG icon rendering with theme support
127
+
128
+ ### Development
129
+
130
+ For development setup and commands, see [CLAUDE.md](CLAUDE.md#development-commands).
131
+
132
+ ## Architecture Overview
133
+
134
+ OkonomiUiKit is built as a Rails Engine with:
135
+
136
+ - **Helper-based components** - Ruby methods that generate semantic HTML
137
+ - **Centralized theme system** - Consistent styling across all components
138
+ - **Stimulus controllers** - Progressive enhancement for interactivity
139
+ - **Tailwind CSS integration** - Modern utility-first styling
140
+ - **Smart style merging** - Intelligent conflict resolution for Tailwind classes
141
+
24
142
  ## Contributing
25
- Contribution directions go here.
143
+
144
+ We welcome contributions! Please follow these steps:
145
+
146
+ 1. Fork the repository
147
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
148
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
149
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
150
+ 5. Open a Pull Request
151
+
152
+ ### Development Setup
153
+
154
+ ```bash
155
+ # Clone the repository
156
+ git clone https://github.com/yourusername/okonomi_ui_kit.git
157
+ cd okonomi_ui_kit
158
+
159
+ # Install dependencies
160
+ bundle install
161
+
162
+ # Start the development server
163
+ bin/dev
164
+
165
+ # Run tests
166
+ bin/rails test
167
+
168
+ # Run linter
169
+ bin/rubocop
170
+ ```
26
171
 
27
172
  ## License
173
+
28
174
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
175
+
176
+ ## Credits
177
+
178
+ OkonomiUiKit is maintained by the Okonomi team. We're passionate about creating tools that make Rails development more enjoyable and productive.
179
+
180
+ ## Support
181
+
182
+ - 📚 [Documentation](guides/)
183
+ - 🐛 [Issue Tracker](https://github.com/yourusername/okonomi_ui_kit/issues)
184
+ - 💬 [Discussions](https://github.com/yourusername/okonomi_ui_kit/discussions)