m9sh 0.1.0 → 0.2.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/Dockerfile +2 -1
- data/GEM_README.md +284 -0
- data/LICENSE.txt +21 -0
- data/M9SH_CLI.md +453 -0
- data/PUBLISHING.md +331 -0
- data/README.md +120 -52
- data/app/components/m9sh/accordion_component.rb +3 -3
- data/app/components/m9sh/alert_component.rb +7 -9
- data/app/components/m9sh/base_component.rb +1 -0
- data/app/components/m9sh/button_component.rb +3 -2
- data/app/components/m9sh/color_customizer_component.rb +624 -0
- data/app/components/m9sh/dialog_close_component.rb +30 -0
- data/app/components/m9sh/dialog_component.rb +11 -99
- data/app/components/m9sh/dialog_content_component.rb +102 -0
- data/app/components/m9sh/dialog_description_component.rb +14 -0
- data/app/components/m9sh/dialog_footer_component.rb +14 -0
- data/app/components/m9sh/dialog_header_component.rb +27 -0
- data/app/components/m9sh/dialog_title_component.rb +14 -0
- data/app/components/m9sh/dialog_trigger_component.rb +23 -0
- data/app/components/m9sh/dropdown_menu_content_component.rb +1 -1
- data/app/components/m9sh/dropdown_menu_item_component.rb +1 -1
- data/app/components/m9sh/dropdown_menu_trigger_component.rb +1 -1
- data/app/components/m9sh/icon_component.rb +78 -0
- data/app/components/m9sh/main_component.rb +1 -1
- data/app/components/m9sh/menu_component.rb +85 -0
- data/app/components/m9sh/navbar_component.rb +186 -0
- data/app/components/m9sh/navigation_menu_component.rb +2 -2
- data/app/components/m9sh/popover_component.rb +12 -7
- data/app/components/m9sh/radio_group_component.rb +45 -13
- data/app/components/m9sh/sheet_component.rb +6 -6
- data/app/components/m9sh/sidebar_component.rb +6 -1
- data/app/components/m9sh/skeleton_component.rb +7 -1
- data/app/components/m9sh/tabs_component.rb +76 -48
- data/app/components/m9sh/textarea_component.rb +1 -1
- data/app/components/m9sh/theme_toggle_component.rb +1 -0
- data/app/javascript/controllers/m9sh/popover_controller.js +24 -18
- data/app/javascript/controllers/m9sh/sidebar_controller.js +29 -7
- data/lib/m9sh/config.rb +5 -5
- data/lib/m9sh/registry.rb +2 -2
- data/lib/m9sh/registry.yml +37 -0
- data/lib/m9sh/version.rb +1 -1
- data/lib/tasks/tailwindcss.rake +15 -0
- data/m9sh.gemspec +48 -0
- data/publish.sh +48 -0
- metadata +20 -3
- data/fix_namespaces.py +0 -32
data/PUBLISHING.md
ADDED
@@ -0,0 +1,331 @@
|
|
1
|
+
# Publishing M9sh Gem to RubyGems
|
2
|
+
|
3
|
+
This guide explains how to publish the M9sh gem to RubyGems.org.
|
4
|
+
|
5
|
+
## Prerequisites
|
6
|
+
|
7
|
+
1. **RubyGems Account**
|
8
|
+
- Create an account at https://rubygems.org/sign_up
|
9
|
+
- Verify your email address
|
10
|
+
|
11
|
+
2. **API Key**
|
12
|
+
- Once logged in, go to https://rubygems.org/profile/edit
|
13
|
+
- Copy your API key
|
14
|
+
|
15
|
+
3. **Configure RubyGems Credentials**
|
16
|
+
```bash
|
17
|
+
gem signin
|
18
|
+
# Or manually create ~/.gem/credentials with:
|
19
|
+
# ---
|
20
|
+
# :rubygems_api_key: your_api_key_here
|
21
|
+
```
|
22
|
+
|
23
|
+
## Pre-Publishing Checklist
|
24
|
+
|
25
|
+
Before publishing, update these files:
|
26
|
+
|
27
|
+
### 1. Update `m9sh.gemspec`
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
spec.authors = ["Your Name"]
|
31
|
+
spec.email = ["your.email@example.com"]
|
32
|
+
spec.homepage = "https://github.com/yourusername/m9sh"
|
33
|
+
```
|
34
|
+
|
35
|
+
### 2. Update URLs in `GEM_README.md`
|
36
|
+
|
37
|
+
Replace placeholder URLs with your actual repository URLs.
|
38
|
+
|
39
|
+
### 3. Verify Version
|
40
|
+
|
41
|
+
Check `lib/m9sh/version.rb`:
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
module M9sh
|
45
|
+
VERSION = "0.1.0" # Update as needed
|
46
|
+
end
|
47
|
+
```
|
48
|
+
|
49
|
+
### 4. Update LICENSE
|
50
|
+
|
51
|
+
Ensure copyright year and name are correct in `LICENSE.txt`.
|
52
|
+
|
53
|
+
## Building the Gem
|
54
|
+
|
55
|
+
### 1. Build the Gem Package
|
56
|
+
|
57
|
+
```bash
|
58
|
+
gem build m9sh.gemspec
|
59
|
+
```
|
60
|
+
|
61
|
+
This creates `m9sh-0.1.0.gem` in your current directory.
|
62
|
+
|
63
|
+
### 2. Test the Gem Locally
|
64
|
+
|
65
|
+
Install the gem locally to test:
|
66
|
+
|
67
|
+
```bash
|
68
|
+
gem install ./m9sh-0.1.0.gem
|
69
|
+
```
|
70
|
+
|
71
|
+
Test the CLI:
|
72
|
+
|
73
|
+
```bash
|
74
|
+
m9sh version
|
75
|
+
m9sh help
|
76
|
+
```
|
77
|
+
|
78
|
+
Create a test project:
|
79
|
+
|
80
|
+
```bash
|
81
|
+
mkdir test-m9sh-project
|
82
|
+
cd test-m9sh-project
|
83
|
+
m9sh init
|
84
|
+
```
|
85
|
+
|
86
|
+
### 3. Uninstall Test Gem
|
87
|
+
|
88
|
+
```bash
|
89
|
+
gem uninstall m9sh
|
90
|
+
```
|
91
|
+
|
92
|
+
## Publishing to RubyGems
|
93
|
+
|
94
|
+
### First Time Publishing
|
95
|
+
|
96
|
+
```bash
|
97
|
+
# Push the gem to RubyGems
|
98
|
+
gem push m9sh-0.1.0.gem
|
99
|
+
```
|
100
|
+
|
101
|
+
You'll see output like:
|
102
|
+
|
103
|
+
```
|
104
|
+
Pushing gem to https://rubygems.org...
|
105
|
+
Successfully registered gem: m9sh (0.1.0)
|
106
|
+
```
|
107
|
+
|
108
|
+
### Verify Publication
|
109
|
+
|
110
|
+
1. Visit https://rubygems.org/gems/m9sh
|
111
|
+
2. Check that your gem is listed
|
112
|
+
3. Test installation:
|
113
|
+
|
114
|
+
```bash
|
115
|
+
gem install m9sh
|
116
|
+
m9sh version
|
117
|
+
```
|
118
|
+
|
119
|
+
## Publishing Updates
|
120
|
+
|
121
|
+
### 1. Update Version
|
122
|
+
|
123
|
+
Edit `lib/m9sh/version.rb`:
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
module M9sh
|
127
|
+
VERSION = "0.1.1" # Increment version
|
128
|
+
end
|
129
|
+
```
|
130
|
+
|
131
|
+
### 2. Update CHANGELOG
|
132
|
+
|
133
|
+
Create `CHANGELOG.md` if it doesn't exist and document changes:
|
134
|
+
|
135
|
+
```markdown
|
136
|
+
## [0.1.1] - 2025-01-XX
|
137
|
+
|
138
|
+
### Added
|
139
|
+
- New feature description
|
140
|
+
|
141
|
+
### Fixed
|
142
|
+
- Bug fix description
|
143
|
+
|
144
|
+
### Changed
|
145
|
+
- Changed behavior description
|
146
|
+
```
|
147
|
+
|
148
|
+
### 3. Commit Changes
|
149
|
+
|
150
|
+
```bash
|
151
|
+
git add .
|
152
|
+
git commit -m "Bump version to 0.1.1"
|
153
|
+
git tag v0.1.1
|
154
|
+
git push origin main --tags
|
155
|
+
```
|
156
|
+
|
157
|
+
### 4. Build and Push
|
158
|
+
|
159
|
+
```bash
|
160
|
+
gem build m9sh.gemspec
|
161
|
+
gem push m9sh-0.1.1.gem
|
162
|
+
```
|
163
|
+
|
164
|
+
## Yanking a Release
|
165
|
+
|
166
|
+
If you need to remove a version:
|
167
|
+
|
168
|
+
```bash
|
169
|
+
gem yank m9sh -v 0.1.0
|
170
|
+
```
|
171
|
+
|
172
|
+
**Warning**: Only yank if absolutely necessary (security issues, critical bugs).
|
173
|
+
|
174
|
+
## Automated Publishing with GitHub Actions
|
175
|
+
|
176
|
+
Create `.github/workflows/publish.yml`:
|
177
|
+
|
178
|
+
```yaml
|
179
|
+
name: Publish to RubyGems
|
180
|
+
|
181
|
+
on:
|
182
|
+
push:
|
183
|
+
tags:
|
184
|
+
- 'v*'
|
185
|
+
|
186
|
+
jobs:
|
187
|
+
publish:
|
188
|
+
runs-on: ubuntu-latest
|
189
|
+
|
190
|
+
steps:
|
191
|
+
- uses: actions/checkout@v3
|
192
|
+
|
193
|
+
- name: Set up Ruby
|
194
|
+
uses: ruby/setup-ruby@v1
|
195
|
+
with:
|
196
|
+
ruby-version: '3.0'
|
197
|
+
|
198
|
+
- name: Publish to RubyGems
|
199
|
+
run: |
|
200
|
+
mkdir -p ~/.gem
|
201
|
+
cat > ~/.gem/credentials << EOF
|
202
|
+
---
|
203
|
+
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
204
|
+
EOF
|
205
|
+
chmod 0600 ~/.gem/credentials
|
206
|
+
gem build m9sh.gemspec
|
207
|
+
gem push *.gem
|
208
|
+
env:
|
209
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
210
|
+
```
|
211
|
+
|
212
|
+
Add your RubyGems API key as a GitHub secret:
|
213
|
+
1. Go to your repo → Settings → Secrets → Actions
|
214
|
+
2. Add `RUBYGEMS_API_KEY` with your API key
|
215
|
+
|
216
|
+
Now publishing is automatic when you push a tag:
|
217
|
+
|
218
|
+
```bash
|
219
|
+
git tag v0.1.0
|
220
|
+
git push origin v0.1.0
|
221
|
+
```
|
222
|
+
|
223
|
+
## Versioning Strategy
|
224
|
+
|
225
|
+
Follow [Semantic Versioning](https://semver.org/):
|
226
|
+
|
227
|
+
- **MAJOR** (1.0.0): Breaking changes
|
228
|
+
- **MINOR** (0.1.0): New features, backwards compatible
|
229
|
+
- **PATCH** (0.0.1): Bug fixes, backwards compatible
|
230
|
+
|
231
|
+
Examples:
|
232
|
+
- `0.1.0` → `0.1.1`: Bug fix
|
233
|
+
- `0.1.0` → `0.2.0`: New component added
|
234
|
+
- `0.9.0` → `1.0.0`: Stable API, ready for production
|
235
|
+
|
236
|
+
## Post-Publishing Checklist
|
237
|
+
|
238
|
+
After publishing:
|
239
|
+
|
240
|
+
- [ ] Verify gem appears on RubyGems.org
|
241
|
+
- [ ] Test installation: `gem install m9sh`
|
242
|
+
- [ ] Verify CLI works: `m9sh version`
|
243
|
+
- [ ] Update documentation if needed
|
244
|
+
- [ ] Announce on social media/forums
|
245
|
+
- [ ] Create GitHub release with changelog
|
246
|
+
|
247
|
+
## Troubleshooting
|
248
|
+
|
249
|
+
### "You do not have permission to push to this gem"
|
250
|
+
|
251
|
+
You're not the owner. Use a different gem name or contact the owner.
|
252
|
+
|
253
|
+
### "There was a problem saving your gem"
|
254
|
+
|
255
|
+
- Verify gemspec is valid: `gem build m9sh.gemspec`
|
256
|
+
- Check all required fields are filled
|
257
|
+
- Ensure version is unique (not already published)
|
258
|
+
|
259
|
+
### "Invalid gem file"
|
260
|
+
|
261
|
+
```bash
|
262
|
+
# Rebuild the gem
|
263
|
+
rm *.gem
|
264
|
+
gem build m9sh.gemspec
|
265
|
+
```
|
266
|
+
|
267
|
+
### Testing Locally Before Publishing
|
268
|
+
|
269
|
+
```bash
|
270
|
+
# Build gem
|
271
|
+
gem build m9sh.gemspec
|
272
|
+
|
273
|
+
# Install locally
|
274
|
+
gem install ./m9sh-0.1.0.gem
|
275
|
+
|
276
|
+
# Test in a new directory
|
277
|
+
cd ~/test-project
|
278
|
+
m9sh init
|
279
|
+
m9sh add button
|
280
|
+
|
281
|
+
# Clean up
|
282
|
+
gem uninstall m9sh
|
283
|
+
```
|
284
|
+
|
285
|
+
## Security
|
286
|
+
|
287
|
+
- **Never** commit API keys to git
|
288
|
+
- Use `~/.gem/credentials` for API keys
|
289
|
+
- Add `*.gem` to `.gitignore`
|
290
|
+
- Keep your RubyGems account secure with 2FA
|
291
|
+
|
292
|
+
## Resources
|
293
|
+
|
294
|
+
- [RubyGems Guides](https://guides.rubygems.org/)
|
295
|
+
- [Publishing to RubyGems](https://guides.rubygems.org/publishing/)
|
296
|
+
- [Semantic Versioning](https://semver.org/)
|
297
|
+
- [GitHub Actions for Ruby](https://github.com/ruby/setup-ruby)
|
298
|
+
|
299
|
+
## Maintenance
|
300
|
+
|
301
|
+
### Regular Tasks
|
302
|
+
|
303
|
+
1. **Monitor Issues** - Respond to GitHub issues
|
304
|
+
2. **Update Dependencies** - Keep Thor, ViewComponent updated
|
305
|
+
3. **Add Components** - Add new components to registry
|
306
|
+
4. **Improve CLI** - Add new CLI features
|
307
|
+
5. **Documentation** - Keep docs up to date
|
308
|
+
|
309
|
+
### Deprecation Policy
|
310
|
+
|
311
|
+
When deprecating features:
|
312
|
+
|
313
|
+
1. Add deprecation warning in current version
|
314
|
+
2. Update docs to show new approach
|
315
|
+
3. Remove in next major version
|
316
|
+
4. Document in CHANGELOG
|
317
|
+
|
318
|
+
Example:
|
319
|
+
|
320
|
+
```ruby
|
321
|
+
def old_method
|
322
|
+
warn "[DEPRECATION] `old_method` is deprecated. Use `new_method` instead."
|
323
|
+
new_method
|
324
|
+
end
|
325
|
+
```
|
326
|
+
|
327
|
+
## Support
|
328
|
+
|
329
|
+
For questions about publishing:
|
330
|
+
- RubyGems Support: https://help.rubygems.org/
|
331
|
+
- GitHub Discussions: https://github.com/yourusername/m9sh/discussions
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# M9sh - Beautiful UI Components for Rails
|
2
2
|
|
3
|
-
Beautiful, accessible UI components for Rails applications using Hotwire, inspired by [shadcn/ui](https://ui.shadcn.com).
|
3
|
+
Beautiful, accessible UI components for Rails applications using ViewComponent and Hotwire, inspired by [shadcn/ui](https://ui.shadcn.com).
|
4
4
|
|
5
5
|
## Features
|
6
6
|
|
@@ -9,7 +9,8 @@ Beautiful, accessible UI components for Rails applications using Hotwire, inspir
|
|
9
9
|
- 🎨 **Tailwind CSS v4** - Modern styling with the latest Tailwind features
|
10
10
|
- ♿ **Accessible** - ARIA compliant components
|
11
11
|
- 🌙 **Dark Mode** - Built-in dark mode support
|
12
|
-
-
|
12
|
+
- 🔧 **CLI Generator** - Powerful CLI for generating components with namespace customization
|
13
|
+
- 📦 **Components You Own** - Copy components to your project and customize freely
|
13
14
|
|
14
15
|
## Components
|
15
16
|
|
@@ -40,43 +41,105 @@ Beautiful, accessible UI components for Rails applications using Hotwire, inspir
|
|
40
41
|
|
41
42
|
## Installation
|
42
43
|
|
43
|
-
1
|
44
|
-
```bash
|
45
|
-
git clone https://github.com/yourusername/hotcdn.git
|
46
|
-
cd hotcdn
|
47
|
-
```
|
44
|
+
### Option 1: Using the CLI (Recommended)
|
48
45
|
|
49
|
-
|
50
|
-
```bash
|
51
|
-
# Using mise for Ruby version management
|
52
|
-
mise install
|
53
|
-
bundle install
|
54
|
-
```
|
46
|
+
Install the M9sh gem:
|
55
47
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
48
|
+
```bash
|
49
|
+
gem install m9sh
|
50
|
+
```
|
51
|
+
|
52
|
+
Initialize M9sh in your Rails project:
|
53
|
+
|
54
|
+
```bash
|
55
|
+
m9sh init
|
56
|
+
```
|
57
|
+
|
58
|
+
Add components as needed:
|
59
|
+
|
60
|
+
```bash
|
61
|
+
m9sh add button
|
62
|
+
m9sh add card
|
63
|
+
m9sh add dialog
|
64
|
+
# Or add all components at once
|
65
|
+
m9sh add --all
|
66
|
+
```
|
67
|
+
|
68
|
+
### Option 2: Manual Installation
|
60
69
|
|
61
|
-
|
70
|
+
1. **Clone this repository**
|
62
71
|
```bash
|
63
|
-
|
64
|
-
|
72
|
+
git clone https://github.com/veas-org/m9sh.git
|
73
|
+
cd m9sh
|
65
74
|
```
|
66
75
|
|
67
|
-
|
76
|
+
2. **Install dependencies**
|
68
77
|
```bash
|
69
|
-
|
78
|
+
bundle install
|
79
|
+
npm install
|
70
80
|
```
|
71
81
|
|
72
|
-
|
82
|
+
3. **Start the development server**
|
73
83
|
```bash
|
74
|
-
|
84
|
+
rails server
|
75
85
|
```
|
76
86
|
|
77
|
-
|
87
|
+
4. **Visit the showcase**
|
78
88
|
Open [http://localhost:3000](http://localhost:3000) to see all components in action.
|
79
89
|
|
90
|
+
## Quick Start
|
91
|
+
|
92
|
+
### 1. Initialize Configuration
|
93
|
+
|
94
|
+
```bash
|
95
|
+
m9sh init
|
96
|
+
```
|
97
|
+
|
98
|
+
This creates a `m9sh.yml` configuration file. You can customize:
|
99
|
+
- Component namespace (e.g., `MyApp::UI`)
|
100
|
+
- Component directory path
|
101
|
+
- JavaScript controller path
|
102
|
+
|
103
|
+
### 2. Browse Available Components
|
104
|
+
|
105
|
+
```bash
|
106
|
+
m9sh list
|
107
|
+
```
|
108
|
+
|
109
|
+
### 3. Add Components
|
110
|
+
|
111
|
+
```bash
|
112
|
+
# Add a single component with dependencies
|
113
|
+
m9sh add button
|
114
|
+
|
115
|
+
# Add multiple components
|
116
|
+
m9sh add card dialog tabs
|
117
|
+
|
118
|
+
# Get component information
|
119
|
+
m9sh info button
|
120
|
+
```
|
121
|
+
|
122
|
+
### 4. Use in Your Views
|
123
|
+
|
124
|
+
Components are automatically generated in your configured namespace:
|
125
|
+
|
126
|
+
```erb
|
127
|
+
<%= render M9sh::ButtonComponent.new(variant: :primary) do %>
|
128
|
+
Click Me!
|
129
|
+
<% end %>
|
130
|
+
```
|
131
|
+
|
132
|
+
## CLI Commands
|
133
|
+
|
134
|
+
- `m9sh init` - Initialize configuration
|
135
|
+
- `m9sh add <component>` - Add component with dependencies
|
136
|
+
- `m9sh list` - List all available components
|
137
|
+
- `m9sh info <component>` - Show component details
|
138
|
+
- `m9sh sync <component>` - Update component to latest version
|
139
|
+
- `m9sh version` - Show CLI version
|
140
|
+
|
141
|
+
For detailed CLI documentation, see [M9SH_CLI.md](./M9SH_CLI.md).
|
142
|
+
|
80
143
|
## Usage
|
81
144
|
|
82
145
|
### Using Components in Your Views
|
@@ -85,29 +148,30 @@ Components are used via ViewComponent's `render` method:
|
|
85
148
|
|
86
149
|
```erb
|
87
150
|
# Button component
|
88
|
-
<%= render
|
151
|
+
<%= render M9sh::ButtonComponent.new(variant: :primary, size: :lg) do %>
|
89
152
|
Click Me!
|
90
153
|
<% end %>
|
91
154
|
|
92
155
|
# Card component with slots
|
93
|
-
<%= render
|
94
|
-
<% card.
|
95
|
-
Card Title
|
156
|
+
<%= render M9sh::CardComponent.new do |card| %>
|
157
|
+
<% card.with_header do |header| %>
|
158
|
+
<% header.with_title { "Card Title" } %>
|
159
|
+
<% header.with_description { "Card description" } %>
|
96
160
|
<% end %>
|
97
|
-
|
98
|
-
|
161
|
+
|
162
|
+
<% card.with_body do %>
|
163
|
+
Your content here
|
99
164
|
<% end %>
|
100
|
-
Your content here
|
101
165
|
<% end %>
|
102
166
|
|
103
167
|
# Form components
|
104
|
-
<%= render
|
168
|
+
<%= render M9sh::InputComponent.new(
|
105
169
|
type: "email",
|
106
170
|
placeholder: "Enter email",
|
107
171
|
name: "user[email]"
|
108
172
|
) %>
|
109
173
|
|
110
|
-
<%= render
|
174
|
+
<%= render M9sh::SwitchComponent.new(
|
111
175
|
name: "settings[notifications]",
|
112
176
|
checked: true
|
113
177
|
) %>
|
@@ -119,21 +183,21 @@ Components like Accordion, Dialog, and Tabs use Stimulus controllers:
|
|
119
183
|
|
120
184
|
```erb
|
121
185
|
# Accordion
|
122
|
-
<%= render
|
186
|
+
<%= render M9sh::AccordionComponent.new(type: "single", collapsible: true) do |accordion| %>
|
123
187
|
<% accordion.with_item(value: "item-1") do |item| %>
|
124
188
|
<% item.with_trigger do %>
|
125
189
|
Click to expand
|
126
190
|
<% end %>
|
127
|
-
<% item.
|
191
|
+
<% item.with_body do %>
|
128
192
|
Hidden content revealed here
|
129
193
|
<% end %>
|
130
194
|
<% end %>
|
131
195
|
<% end %>
|
132
196
|
|
133
197
|
# Dialog/Modal
|
134
|
-
<%= render
|
198
|
+
<%= render M9sh::DialogComponent.new do |dialog| %>
|
135
199
|
<% dialog.with_trigger do %>
|
136
|
-
<%= render
|
200
|
+
<%= render M9sh::ButtonComponent.new do %>
|
137
201
|
Open Modal
|
138
202
|
<% end %>
|
139
203
|
<% end %>
|
@@ -183,30 +247,34 @@ The theme uses CSS custom properties defined in `app/assets/stylesheets/applicat
|
|
183
247
|
## Project Structure
|
184
248
|
|
185
249
|
```
|
186
|
-
|
250
|
+
m9sh/
|
187
251
|
├── app/
|
188
252
|
│ ├── components/
|
189
|
-
│ │ └──
|
253
|
+
│ │ └── m9sh/ # ViewComponent classes
|
190
254
|
│ │ ├── base_component.rb
|
191
255
|
│ │ ├── button_component.rb
|
192
256
|
│ │ ├── card_component.rb
|
193
257
|
│ │ └── ...
|
194
258
|
│ ├── javascript/
|
195
259
|
│ │ └── controllers/
|
196
|
-
│ │ └──
|
260
|
+
│ │ └── m9sh/ # Stimulus controllers
|
197
261
|
│ │ ├── accordion_controller.js
|
198
262
|
│ │ ├── dialog_controller.js
|
199
263
|
│ │ └── ...
|
200
|
-
│
|
201
|
-
│
|
202
|
-
│
|
203
|
-
|
204
|
-
│
|
205
|
-
│
|
206
|
-
├── config
|
207
|
-
│
|
208
|
-
│
|
209
|
-
└──
|
264
|
+
│ └── views/
|
265
|
+
│ └── showcase/ # Demo pages
|
266
|
+
│ └── index.html.erb
|
267
|
+
├── lib/
|
268
|
+
│ └── m9sh/ # CLI implementation
|
269
|
+
│ ├── cli.rb # CLI commands
|
270
|
+
│ ├── config.rb # Configuration management
|
271
|
+
│ ├── generator.rb # Component generator
|
272
|
+
│ ├── registry.rb # Component registry
|
273
|
+
│ └── registry.yml # Component definitions
|
274
|
+
├── bin/
|
275
|
+
│ └── m9sh # CLI executable
|
276
|
+
├── m9sh.gemspec # Gem specification
|
277
|
+
└── README.md
|
210
278
|
```
|
211
279
|
|
212
280
|
## Contributing
|
@@ -56,7 +56,7 @@ module M9sh
|
|
56
56
|
private
|
57
57
|
|
58
58
|
def item_classes
|
59
|
-
"border-b"
|
59
|
+
"border-b border-border"
|
60
60
|
end
|
61
61
|
|
62
62
|
def render_trigger
|
@@ -94,11 +94,11 @@ module M9sh
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def trigger_classes
|
97
|
-
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[aria-expanded=true]>svg]:rotate-180"
|
97
|
+
"flex flex-1 items-center justify-between py-4 text-sm font-medium text-foreground transition-all hover:underline [&[aria-expanded=true]>svg]:rotate-180"
|
98
98
|
end
|
99
99
|
|
100
100
|
def content_classes
|
101
|
-
"overflow-hidden text-sm transition-all duration-300 ease-in-out"
|
101
|
+
"overflow-hidden text-sm text-muted-foreground transition-all duration-300 ease-in-out"
|
102
102
|
end
|
103
103
|
|
104
104
|
def chevron_icon
|
@@ -5,8 +5,8 @@ module M9sh
|
|
5
5
|
include Utilities
|
6
6
|
|
7
7
|
VARIANTS = {
|
8
|
-
default: "bg-
|
9
|
-
destructive: "text-destructive
|
8
|
+
default: "bg-background text-foreground",
|
9
|
+
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
10
10
|
}.freeze
|
11
11
|
|
12
12
|
renders_one :icon
|
@@ -36,7 +36,7 @@ module M9sh
|
|
36
36
|
private
|
37
37
|
|
38
38
|
def base_classes
|
39
|
-
"relative w-full rounded-lg border
|
39
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground"
|
40
40
|
end
|
41
41
|
|
42
42
|
def variant_classes
|
@@ -46,16 +46,15 @@ module M9sh
|
|
46
46
|
def render_icon
|
47
47
|
return unless icon?
|
48
48
|
|
49
|
-
|
49
|
+
icon
|
50
50
|
end
|
51
51
|
|
52
52
|
def render_title
|
53
53
|
return unless title?
|
54
54
|
|
55
|
-
tag.
|
55
|
+
tag.h5(
|
56
56
|
title,
|
57
|
-
class: "
|
58
|
-
data: { slot: "alert-title" }
|
57
|
+
class: "mb-1 font-medium leading-none tracking-tight"
|
59
58
|
)
|
60
59
|
end
|
61
60
|
|
@@ -64,8 +63,7 @@ module M9sh
|
|
64
63
|
|
65
64
|
tag.div(
|
66
65
|
description,
|
67
|
-
class: "text-
|
68
|
-
data: { slot: "alert-description" }
|
66
|
+
class: "text-sm [&_p]:leading-relaxed"
|
69
67
|
)
|
70
68
|
end
|
71
69
|
end
|