okonomi_ui_kit 0.1.7 → 0.1.9
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/README.md +165 -7
- data/app/assets/builds/okonomi_ui_kit/application.tailwind.css +664 -187
- data/app/helpers/okonomi_ui_kit/application_helper.rb +8 -0
- data/app/helpers/okonomi_ui_kit/attribute_section_helper.rb +5 -5
- data/app/helpers/okonomi_ui_kit/component.rb +44 -21
- data/app/helpers/okonomi_ui_kit/components/alert.rb +1 -1
- data/app/helpers/okonomi_ui_kit/components/badge.rb +5 -5
- data/app/helpers/okonomi_ui_kit/components/breadcrumbs.rb +69 -0
- data/app/helpers/okonomi_ui_kit/components/button_base.rb +56 -0
- data/app/helpers/okonomi_ui_kit/components/button_tag.rb +23 -0
- data/app/helpers/okonomi_ui_kit/components/button_to.rb +4 -15
- data/app/helpers/okonomi_ui_kit/components/code.rb +41 -37
- data/app/helpers/okonomi_ui_kit/components/confirmation_modal.rb +130 -0
- data/app/helpers/okonomi_ui_kit/components/forms/check_box_with_label.rb +38 -0
- data/app/helpers/okonomi_ui_kit/components/forms/collection_select.rb +57 -0
- data/app/helpers/okonomi_ui_kit/components/forms/date_field.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms/datetime_local_field.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms/email_field.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms/field.rb +24 -0
- data/app/helpers/okonomi_ui_kit/components/forms/field_set.rb +17 -0
- data/app/helpers/okonomi_ui_kit/components/forms/input_base.rb +57 -0
- data/app/helpers/okonomi_ui_kit/components/forms/label.rb +27 -0
- data/app/helpers/okonomi_ui_kit/components/forms/multi_select.rb +18 -0
- data/app/helpers/okonomi_ui_kit/components/forms/number_field.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms/password_field.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms/search_field.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms/select.rb +57 -0
- data/app/helpers/okonomi_ui_kit/components/forms/show_if.rb +28 -0
- data/app/helpers/okonomi_ui_kit/components/forms/telephone_field.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms/text_area.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms/text_field.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms/time_field.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms/upload_field.rb +25 -0
- data/app/helpers/okonomi_ui_kit/components/forms/url_field.rb +9 -0
- data/app/helpers/okonomi_ui_kit/components/forms.rb +6 -0
- data/app/helpers/okonomi_ui_kit/components/icon.rb +36 -0
- data/app/helpers/okonomi_ui_kit/components/link_to.rb +8 -19
- data/app/helpers/okonomi_ui_kit/components/navigation.rb +98 -0
- data/app/helpers/okonomi_ui_kit/components/page.rb +8 -8
- data/app/helpers/okonomi_ui_kit/components/table.rb +9 -10
- data/app/helpers/okonomi_ui_kit/components/typography.rb +16 -16
- data/app/helpers/okonomi_ui_kit/components.rb +4 -0
- data/app/helpers/okonomi_ui_kit/config.rb +5 -1
- data/app/helpers/okonomi_ui_kit/configs.rb +4 -0
- data/app/helpers/okonomi_ui_kit/form_builder.rb +39 -130
- data/app/helpers/okonomi_ui_kit/form_component.rb +7 -0
- data/app/helpers/okonomi_ui_kit/svg_icons.rb +5 -5
- data/app/helpers/okonomi_ui_kit/t_w_merge.rb +114 -0
- data/app/helpers/okonomi_ui_kit/ui_helper.rb +17 -58
- data/app/views/okonomi/components/breadcrumbs/_breadcrumbs.html.erb +46 -0
- data/app/views/okonomi/components/confirmation_modal/_confirmation_modal.html.erb +76 -0
- data/app/views/okonomi/components/forms/check_box_with_label/_check_box_with_label.html.erb +6 -0
- data/app/views/okonomi/components/forms/field/_field.html.erb +3 -0
- data/app/views/okonomi/components/forms/field_set/_field_set.html.erb +3 -0
- data/app/views/okonomi/components/forms/upload_field/_upload_field.html.erb +1 -0
- data/app/views/okonomi/components/icon/_icon.html.erb +38 -0
- data/app/views/okonomi/components/navigation/_link.html.erb +18 -0
- data/app/views/okonomi/components/navigation/_navigation.html.erb +4 -0
- data/app/views/okonomi/forms/tailwind/_checkbox_label.html.erb +2 -2
- data/app/views/okonomi/forms/tailwind/_field.html.erb +6 -6
- data/app/views/okonomi/forms/tailwind/_multi_select.html.erb +2 -4
- data/app/views/okonomi/forms/tailwind/_upload_field.html.erb +10 -10
- data/config/importmap.rb +1 -1
- data/lib/okonomi_ui_kit/engine.rb +0 -3
- data/lib/okonomi_ui_kit/version.rb +1 -1
- metadata +43 -12
- data/app/helpers/okonomi_ui_kit/breadcrumbs_helper.rb +0 -60
- data/app/helpers/okonomi_ui_kit/icon_helper.rb +0 -39
- data/app/helpers/okonomi_ui_kit/navigation_helper.rb +0 -72
- data/app/helpers/okonomi_ui_kit/theme.rb +0 -159
- data/app/helpers/okonomi_ui_kit/theme_helper.rb +0 -17
- data/app/views/okonomi/forms/tailwind/_field_set.html.erb +0 -3
- data/app/views/okonomi/modals/_confirmation_modal.html.erb +0 -77
- data/app/views/okonomi/navigation/_link.html.erb +0 -15
- data/app/views/okonomi/navigation/_menu.html.erb +0 -3
- data/app/views/okonomi/navigation/_navbar.html.erb +0 -105
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc90801689c7c39688c8a5a065b77ea61eb8fd0afa45cdee03b6b66ebee974d5
|
4
|
+
data.tar.gz: 8a2de086a893267f851b3084d3cbd7c8d8056da5f7f577141641383ae6ac74fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26b66dae684154ebed6861acdb06759b19fdc2e9a161a4ef900006c25b20ac787b88a307baa1e6a7cf31d465d7611f59c0c7229c0abaf3a48d4189d43677eaea
|
7
|
+
data.tar.gz: edcdadb51037bc73eb330bcd09f80ce7dfe7a0c2d81d7b1b653cd64088fefa1f5976adf7ba39ff4421a08bce41dc3243d08edb1845f5496249f313f2f6628625
|
data/README.md
CHANGED
@@ -1,10 +1,20 @@
|
|
1
1
|
# OkonomiUiKit
|
2
|
-
Short description and motivation.
|
3
2
|
|
4
|
-
|
5
|
-
|
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
|
+
- **🎯 Style System** - Component-based styling with config class overrides
|
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,161 @@ And then execute:
|
|
16
26
|
$ bundle
|
17
27
|
```
|
18
28
|
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
+
- [Confirmation Modal](guides/components/confirmation_modal.md) - Accessible modal dialogs for user confirmations
|
126
|
+
- [Icon](guides/components/icon.md) - SVG icon rendering with style customization
|
127
|
+
- [Navigation](guides/components/navigation.md) - Sidebar navigation menus with groups and links
|
128
|
+
- [Typography](guides/components/typography.md) - Text styling with semantic HTML elements
|
129
|
+
|
130
|
+
### Development
|
131
|
+
|
132
|
+
For development setup and commands, see [CLAUDE.md](CLAUDE.md#development-commands).
|
133
|
+
|
134
|
+
## Architecture Overview
|
135
|
+
|
136
|
+
OkonomiUiKit is built as a Rails Engine with:
|
137
|
+
|
138
|
+
- **Helper-based components** - Ruby methods that generate semantic HTML
|
139
|
+
- **Component style system** - Consistent styling with intelligent class merging
|
140
|
+
- **Stimulus controllers** - Progressive enhancement for interactivity
|
141
|
+
- **Tailwind CSS integration** - Modern utility-first styling
|
142
|
+
- **Smart style merging** - Intelligent conflict resolution for Tailwind classes
|
143
|
+
|
24
144
|
## Contributing
|
25
|
-
|
145
|
+
|
146
|
+
We welcome contributions! Please follow these steps:
|
147
|
+
|
148
|
+
1. Fork the repository
|
149
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
150
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
151
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
152
|
+
5. Open a Pull Request
|
153
|
+
|
154
|
+
### Development Setup
|
155
|
+
|
156
|
+
```bash
|
157
|
+
# Clone the repository
|
158
|
+
git clone https://github.com/yourusername/okonomi_ui_kit.git
|
159
|
+
cd okonomi_ui_kit
|
160
|
+
|
161
|
+
# Install dependencies
|
162
|
+
bundle install
|
163
|
+
|
164
|
+
# Start the development server
|
165
|
+
bin/dev
|
166
|
+
|
167
|
+
# Run tests
|
168
|
+
bin/rails test
|
169
|
+
|
170
|
+
# Run linter
|
171
|
+
bin/rubocop
|
172
|
+
```
|
26
173
|
|
27
174
|
## License
|
175
|
+
|
28
176
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
177
|
+
|
178
|
+
## Credits
|
179
|
+
|
180
|
+
OkonomiUiKit is maintained by the Okonomi team. We're passionate about creating tools that make Rails development more enjoyable and productive.
|
181
|
+
|
182
|
+
## Support
|
183
|
+
|
184
|
+
- 📚 [Documentation](guides/)
|
185
|
+
- 🐛 [Issue Tracker](https://github.com/yourusername/okonomi_ui_kit/issues)
|
186
|
+
- 💬 [Discussions](https://github.com/yourusername/okonomi_ui_kit/discussions)
|