odt-ui-rails 1.0.0 → 2.0.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/README.md +24 -49
- data/app/assets/stylesheets/odt_ui/styles.css +3463 -0
- data/app/assets/stylesheets/odt_ui/tokens.css +302 -0
- data/app/assets/stylesheets/odt_ui.css +2 -0
- data/lib/generators/odt/install_generator.rb +6 -53
- data/lib/odt_ui/engine.rb +8 -0
- data/lib/odt_ui/helper.rb +305 -103
- data/lib/odt_ui/version.rb +3 -1
- metadata +5 -5
- data/lib/generators/odt/templates/odt_component_controller.js +0 -48
- data/lib/generators/odt/templates/odt_registry.js +0 -28
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f3d502ed94d1a35d653519dbb0a8f3a8c357f0248e9d1d58c4830740b2f4332
|
|
4
|
+
data.tar.gz: bbec797d7209fc7f0728a41276092c6ccc907544d7e20d9cdcb91ff40530bf85
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2fff4bd8c26cd16351373dca4bca8da03d0310d272c9c5cb2e0d731ecddc431e70fb863e9ff24ea9a6ea3a17e4a5adcdffdc445b9d46675ca92457ea08c758c0
|
|
7
|
+
data.tar.gz: d07f27f59a574e569ca69f6e49ed61e9dc85415941810be1b306af25734867f745233cb86d622c177631328213c38e946bc80e5890056a186853d1a844f72946
|
data/README.md
CHANGED
|
@@ -1,78 +1,53 @@
|
|
|
1
|
-
# ODT
|
|
1
|
+
# ODT-UI for Ruby on Rails
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Native Ruby on Rails integration for ODT-Lightweight-UI. Fast, accessible, and zero JavaScript runtime overhead for UI components.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
[https://odt-lightweight.piaxel.com/storybook/?path=/story/overview-ruby-on-rails-gem--guide](https://odt-lightweight.piaxel.com/storybook/?path=/story/overview-ruby-on-rails-gem--guide)
|
|
5
|
+
## Installation
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Quick Start
|
|
11
|
-
|
|
12
|
-
### 1. Add Gem to Rails `Gemfile`
|
|
7
|
+
Add to your `Gemfile`:
|
|
13
8
|
|
|
14
9
|
```ruby
|
|
15
|
-
|
|
16
|
-
gem "odt-ui-rails", path: "path/to/ODT-Lightweight-UI/integrations/rails"
|
|
17
|
-
|
|
18
|
-
# Or from GitHub:
|
|
19
|
-
# gem "odt-ui-rails", github: "PixxelTK/ODT-Lightweight-UI", glob: "integrations/rails/*.gemspec"
|
|
10
|
+
gem "odt-ui-rails", "~> 2.0.0"
|
|
20
11
|
```
|
|
21
12
|
|
|
22
|
-
|
|
13
|
+
Run bundle:
|
|
23
14
|
|
|
24
15
|
```bash
|
|
25
16
|
bundle install
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 2. Run the Generator
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
17
|
bin/rails g odt:install
|
|
32
18
|
```
|
|
33
19
|
|
|
34
|
-
|
|
20
|
+
Or add CSS manually in `app/assets/stylesheets/application.css`:
|
|
35
21
|
|
|
36
|
-
|
|
22
|
+
```css
|
|
23
|
+
@import "odt_ui.css";
|
|
24
|
+
```
|
|
37
25
|
|
|
38
|
-
## Usage
|
|
26
|
+
## Usage
|
|
39
27
|
|
|
40
28
|
### Buttons
|
|
41
|
-
|
|
42
29
|
```erb
|
|
43
|
-
<%= odt_button "
|
|
44
|
-
<%= odt_button "
|
|
30
|
+
<%= odt_button "Click me", variant: :filled, color: :primary, radius: :full %>
|
|
31
|
+
<%= odt_button "New Schedule", href: new_event_path, icon: "fa-solid fa-plus" %>
|
|
45
32
|
```
|
|
46
33
|
|
|
47
|
-
###
|
|
48
|
-
|
|
34
|
+
### Badges
|
|
49
35
|
```erb
|
|
50
|
-
<%=
|
|
51
|
-
|
|
52
|
-
<%= odt_password_input :password, label: "รหัสผ่าน" %>
|
|
53
|
-
<%= odt_button "เข้าสู่ระบบ", variant: "primary", type: "submit" %>
|
|
54
|
-
<% end %>
|
|
36
|
+
<%= odt_badge "Active", variant: :subtle, color: :success %>
|
|
37
|
+
<%= odt_badge "Date", icon: "fa-regular fa-calendar" %>
|
|
55
38
|
```
|
|
56
39
|
|
|
57
|
-
### Cards &
|
|
58
|
-
|
|
40
|
+
### Cards & Layout
|
|
59
41
|
```erb
|
|
60
|
-
<%= odt_card title: "
|
|
61
|
-
|
|
42
|
+
<%= odt_card title: "Profile", subtitle: "User settings" do %>
|
|
43
|
+
<p>Card content</p>
|
|
62
44
|
<% end %>
|
|
63
45
|
```
|
|
64
46
|
|
|
65
|
-
###
|
|
66
|
-
|
|
47
|
+
### Typography & Alerts
|
|
67
48
|
```erb
|
|
68
|
-
<%=
|
|
69
|
-
<%=
|
|
49
|
+
<%= odt_heading "Welcome", as: :h1 %>
|
|
50
|
+
<%= odt_text "Description here", color: :muted %>
|
|
51
|
+
<%= odt_alert "Saved successfully!", variant: :success %>
|
|
52
|
+
<%= odt_avatar name: "John Doe", size: :md %>
|
|
70
53
|
```
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## How It Works Under the Hood
|
|
75
|
-
|
|
76
|
-
1. **Rails Engine**: Automatically injects `OdtUi::Helper` methods into ActionView templates.
|
|
77
|
-
2. **Stimulus Adapter (`odt_component_controller.js`)**: Safely mounts and unmounts React components in sync with Hotwire/Turbo navigation.
|
|
78
|
-
3. **Registry (`odt_registry.js`)**: Maps string names to ODT React components. You can register custom app-specific wrappers here easily.
|