odt-ui-rails 2.0.0 → 2.0.1
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/lib/odt_ui/helper.rb +3 -3
- data/lib/odt_ui/version.rb +1 -1
- data/sig/odt_ui.rbs +97 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 10337f9332af1c1db8c182d90d70779756c002616c77454ca8d1af89f81708b8
|
|
4
|
+
data.tar.gz: 8e33db7e338ca554cfe476f38d81483d1ba863d4b11e4869019eec3541542fae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aaebded1e337cfd81c708f2f74f59d796bd61ad3d8b54bc56a74afc125e2bd76f5130a897a32629546e58316bec53d334c578a48134bdd74499ee08aeaf04bfc
|
|
7
|
+
data.tar.gz: ad4d3582146da249c419376707d2d707f99653b6a6be279f4e07f880e7b758937efab206f07c7e5d6fa81eb225c65285f1daa287144bf3d044dfc94df2a0eb64
|
data/lib/odt_ui/helper.rb
CHANGED
|
@@ -164,7 +164,7 @@ module OdtUi
|
|
|
164
164
|
# @param variant [:subtle, :filled, :outline]
|
|
165
165
|
# @param color [:primary, :secondary, :success, :warning, :danger, :info, :neutral]
|
|
166
166
|
# @param size [:sm, :md]
|
|
167
|
-
# @param radius [:none, :xs, :sm, :md, :lg, :xl, 2xl, 3xl, 4xl, :full]
|
|
167
|
+
# @param radius [:none, :xs, :sm, :md, :lg, :xl, :"2xl", :"3xl", :"4xl", :full]
|
|
168
168
|
# @param dot [Boolean]
|
|
169
169
|
# @param icon [String, nil]
|
|
170
170
|
# @return [ActiveSupport::SafeBuffer]
|
|
@@ -195,8 +195,8 @@ module OdtUi
|
|
|
195
195
|
# @param title [String, nil]
|
|
196
196
|
# @param subtitle [String, nil]
|
|
197
197
|
# @param variant [:elevated, :frosted, :subtle, :muted, :outlined]
|
|
198
|
-
# @param radius [:none, :xs, :sm, :md, :lg, :xl, 2xl, 3xl, 4xl, :full]
|
|
199
|
-
# @param border [Boolean,
|
|
198
|
+
# @param radius [:none, :xs, :sm, :md, :lg, :xl, :"2xl", :"3xl", :"4xl", :full]
|
|
199
|
+
# @param border [Boolean, Symbol, String]
|
|
200
200
|
# @param hover [Boolean]
|
|
201
201
|
# @return [ActiveSupport::SafeBuffer]
|
|
202
202
|
def odt_card(title: nil, subtitle: nil, variant: :frosted, radius: :"3xl", border: false, hover: true, **html_options, &block)
|
data/lib/odt_ui/version.rb
CHANGED
data/sig/odt_ui.rbs
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
module OdtUi
|
|
2
|
+
VERSION: String
|
|
3
|
+
|
|
4
|
+
module Helper
|
|
5
|
+
type button_variant = :filled | :light | :outline | :subtle | :ghost | String
|
|
6
|
+
type button_color = :primary | :secondary | :success | :warning | :danger | :neutral | String
|
|
7
|
+
type button_size = :xs | :sm | :md | :lg | :xl | String
|
|
8
|
+
type radius_size = :none | :xs | :sm | :md | :lg | :xl | :"2xl" | :"3xl" | :"4xl" | :full | Symbol | String
|
|
9
|
+
|
|
10
|
+
type badge_variant = :subtle | :filled | :outline | String
|
|
11
|
+
type badge_color = :primary | :secondary | :success | :warning | :danger | :info | :neutral | String
|
|
12
|
+
type badge_size = :sm | :md | String
|
|
13
|
+
|
|
14
|
+
type card_variant = :elevated | :frosted | :subtle | :muted | :outlined | String
|
|
15
|
+
type alert_variant = :success | :warning | :danger | :info | String
|
|
16
|
+
type heading_tag = :h1 | :h2 | :h3 | :h4 | :h5 | String
|
|
17
|
+
type text_color = :default | :strong | :muted | :subtle | :primary | String
|
|
18
|
+
type text_size = :xs | :sm | :base | :lg | String
|
|
19
|
+
type avatar_size = :xs | :sm | :md | :lg | :xl | String
|
|
20
|
+
type avatar_color = :secondary | :primary | :neutral | String
|
|
21
|
+
|
|
22
|
+
# Renders an ODT Button component.
|
|
23
|
+
#
|
|
24
|
+
# @param text [String, nil] Button label text
|
|
25
|
+
# @param variant [:filled, :light, :outline, :subtle, :ghost] Button style variant (default: :filled)
|
|
26
|
+
# @param color [:primary, :secondary, :success, :warning, :danger, :neutral] Button theme color (default: :primary)
|
|
27
|
+
# @param size [:xs, :sm, :md, :lg, :xl] Size of the button (default: :md)
|
|
28
|
+
# @param radius [:none, :xs, :sm, :md, :lg, :xl, :"2xl", :"3xl", :"4xl", :full] Border radius (default: :full)
|
|
29
|
+
# @param href [String, nil] URL if rendering as an anchor link <a>
|
|
30
|
+
# @param icon [String, nil] Icon class (e.g. 'fa-solid fa-plus') or SVG string
|
|
31
|
+
# @param right_icon [String, nil] Right icon class or SVG string
|
|
32
|
+
# @param full_width [bool] Stretch button to 100% width (default: false)
|
|
33
|
+
# @param disabled [bool] Disabled state (default: false)
|
|
34
|
+
# @param type [String] Button type attribute (default: "button")
|
|
35
|
+
def odt_button: (?String? text, ?variant: button_variant, ?color: button_color, ?size: button_size, ?radius: radius_size, ?href: String?, ?icon: String?, ?right_icon: String?, ?full_width: bool, ?disabled: bool, ?type: String, **untyped) ?{ () -> untyped } -> untyped
|
|
36
|
+
|
|
37
|
+
# Renders an ODT Badge component.
|
|
38
|
+
#
|
|
39
|
+
# @param text [String, nil] Badge label text
|
|
40
|
+
# @param variant [:subtle, :filled, :outline] Badge style variant (default: :subtle)
|
|
41
|
+
# @param color [:primary, :secondary, :success, :warning, :danger, :info, :neutral] Badge color (default: :neutral)
|
|
42
|
+
# @param size [:sm, :md] Badge size (default: :sm)
|
|
43
|
+
# @param radius [:none, :xs, :sm, :md, :lg, :xl, :"2xl", :"3xl", :"4xl", :full] Border radius (default: :full)
|
|
44
|
+
# @param dot [bool] Whether to render a leading status dot (default: false)
|
|
45
|
+
# @param icon [String, nil] Icon class (e.g. 'fa-regular fa-calendar') or SVG string
|
|
46
|
+
def odt_badge: (?String? text, ?variant: badge_variant, ?color: badge_color, ?size: badge_size, ?radius: radius_size, ?dot: bool, ?icon: String?, **untyped) ?{ () -> untyped } -> untyped
|
|
47
|
+
|
|
48
|
+
# Renders an ODT Card component.
|
|
49
|
+
#
|
|
50
|
+
# @param title [String, nil] Card header title
|
|
51
|
+
# @param subtitle [String, nil] Card header subtitle
|
|
52
|
+
# @param variant [:elevated, :frosted, :subtle, :muted, :outlined] Surface style variant (default: :frosted)
|
|
53
|
+
# @param radius [:none, :xs, :sm, :md, :lg, :xl, :"2xl", :"3xl", :"4xl", :full] Corner radius (default: :"3xl")
|
|
54
|
+
# @param border [bool, Symbol, String] Border styling (default: false)
|
|
55
|
+
# @param hover [bool] Hover elevation effect (default: true)
|
|
56
|
+
def odt_card: (?title: String?, ?subtitle: String?, ?variant: card_variant, ?radius: radius_size, ?border: bool | Symbol | String, ?hover: bool, **untyped) ?{ () -> untyped } -> untyped
|
|
57
|
+
|
|
58
|
+
# Renders an ODT Alert banner.
|
|
59
|
+
#
|
|
60
|
+
# @param message [String, nil] Alert text message
|
|
61
|
+
# @param variant [:success, :warning, :danger, :info] Alert status variant (default: :success)
|
|
62
|
+
# @param icon [String, nil] Custom icon class or SVG
|
|
63
|
+
def odt_alert: (?String? message, ?variant: alert_variant, ?icon: String?, **untyped) ?{ () -> untyped } -> untyped
|
|
64
|
+
|
|
65
|
+
# Renders an ODT Heading element.
|
|
66
|
+
#
|
|
67
|
+
# @param text [String, nil] Heading text
|
|
68
|
+
# @param as [:h1, :h2, :h3, :h4, :h5] HTML heading tag (default: :h2)
|
|
69
|
+
def odt_heading: (?String? text, ?as: heading_tag, **untyped) ?{ () -> untyped } -> untyped
|
|
70
|
+
|
|
71
|
+
# Renders styled body text.
|
|
72
|
+
#
|
|
73
|
+
# @param text [String, nil] Body text content
|
|
74
|
+
# @param color [:default, :strong, :muted, :subtle, :primary] Text color variant (default: :default)
|
|
75
|
+
# @param size [:xs, :sm, :base, :lg] Text size (default: :base)
|
|
76
|
+
def odt_text: (?String? text, ?color: text_color, ?size: text_size, **untyped) ?{ () -> untyped } -> untyped
|
|
77
|
+
|
|
78
|
+
# Renders an ODT Avatar element with initials or image fallback.
|
|
79
|
+
#
|
|
80
|
+
# @param name [String, nil] User name for automatic initials generation
|
|
81
|
+
# @param src [String, nil] Image avatar URL
|
|
82
|
+
# @param size [:xs, :sm, :md, :lg, :xl] Avatar size (default: :sm)
|
|
83
|
+
# @param color [:secondary, :primary, :neutral] Background color theme (default: :secondary)
|
|
84
|
+
# @param icon [String] Fallback icon if no name or image provided (default: "fa-solid fa-user")
|
|
85
|
+
def odt_avatar: (?name: String?, ?src: String?, ?size: avatar_size, ?color: avatar_color, ?icon: String, **untyped) -> untyped
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
module ActionView
|
|
90
|
+
class Base
|
|
91
|
+
include OdtUi::Helper
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
module Helpers
|
|
95
|
+
include OdtUi::Helper
|
|
96
|
+
end
|
|
97
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: odt-ui-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pixel
|
|
@@ -45,6 +45,7 @@ files:
|
|
|
45
45
|
- lib/odt_ui/engine.rb
|
|
46
46
|
- lib/odt_ui/helper.rb
|
|
47
47
|
- lib/odt_ui/version.rb
|
|
48
|
+
- sig/odt_ui.rbs
|
|
48
49
|
homepage: https://github.com/PixxelTK/ODT-Lightweight-UI
|
|
49
50
|
licenses:
|
|
50
51
|
- MIT
|