odt-ui-rails 2.0.1 → 2.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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OdtUi
4
- VERSION = "2.0.1"
4
+ VERSION = "2.2.0"
5
5
  end
data/sig/odt_ui.rbs CHANGED
@@ -2,87 +2,220 @@ module OdtUi
2
2
  VERSION: String
3
3
 
4
4
  module Helper
5
- type button_variant = :filled | :light | :outline | :subtle | :ghost | String
6
- type button_color = :primary | :secondary | :success | :warning | :danger | :neutral | String
5
+ type button_variant = :filled | :frosted | :capsule | :ghost | :light | :outline | :outlined | :subtle | String
6
+ type button_color = :primary | :secondary | :surface | :muted | :inverse | :success | :warning | :danger | :info | :neutral | String
7
7
  type button_size = :xs | :sm | :md | :lg | :xl | String
8
8
  type radius_size = :none | :xs | :sm | :md | :lg | :xl | :"2xl" | :"3xl" | :"4xl" | :full | Symbol | String
9
+ type shadow_size = :none | :card | :dropdown | :modal | :popover | Symbol | String
9
10
 
10
- type badge_variant = :subtle | :filled | :outline | String
11
+ type badge_variant = :subtle | :filled | :outlined | :outline | String
11
12
  type badge_color = :primary | :secondary | :success | :warning | :danger | :info | :neutral | String
12
13
  type badge_size = :sm | :md | String
13
14
 
14
- type card_variant = :elevated | :frosted | :subtle | :muted | :outlined | String
15
+ type card_variant = :elevated | :outlined | :subtle | :muted | :ghost | :frosted | String
16
+ type card_background = :base | :surface | :surface_elevated | :surface_muted | :surface_subtle | :gradient_primary | :gradient_secondary | :gradient_vibrant | :gradient_hero | :frosted | :frosted_muted | :frosted_subtle | :frosted_gradient_primary | :frosted_gradient_secondary | :transparent | Symbol | String
17
+ type card_border = :none | :muted | :base | :strong | :primary | :secondary | :danger | :success | bool | Symbol | String
18
+ type card_padding = :none | :xs | :sm | :md | :lg | :xl | :"2xl" | Symbol | String
19
+ type card_tag = :div | :article | :section | :aside | :main | Symbol | String
20
+
15
21
  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
22
+ type heading_tag = :h1 | :h2 | :h3 | :h4 | :h5 | :h6 | String
23
+ type heading_size = :"5xl" | :"4xl" | :"3xl" | :"2xl" | :xl | :lg | Symbol | String
24
+ type font_weight = :light | :normal | :medium | :semibold | :bold | :extrabold | Symbol | String
25
+ type typography_color = :strong | :default | :muted | :subtle | :disabled | :primary | :secondary | :success | :warning | :danger | :info | Symbol | String
26
+
27
+ type text_tag = :p | :span | :div | :label | :small | Symbol | String
28
+ type text_size = :xs | :sm | :base | :lg | :xl | :"2xl" | Symbol | String
29
+
30
+ type avatar_size = :xs | :sm | :md | :lg | :xl | :"2xl" | String
20
31
  type avatar_color = :secondary | :primary | :neutral | String
21
32
 
33
+ type input_variant = :outlined | :filled | :frosted | String
34
+ type input_size = :sm | :md | :lg | String
35
+ type input_resize = :none | :vertical | :horizontal | :both | String
36
+ type checkbox_color = :primary | :secondary | :success | :warning | :danger | :dark | :neutral | String
37
+ type checkbox_size = :sm | :md | :lg | String
38
+
22
39
  # 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
40
+ def odt_button: (
41
+ ?String? text,
42
+ ?variant: button_variant,
43
+ ?color: button_color,
44
+ ?size: button_size,
45
+ ?radius: radius_size?,
46
+ ?shadow: shadow_size?,
47
+ ?icon_only: bool,
48
+ ?full_width: bool,
49
+ ?loading: bool,
50
+ ?disabled: bool,
51
+ ?href: String?,
52
+ ?icon: String?,
53
+ ?right_icon: String?,
54
+ ?type: String,
55
+ **untyped
56
+ ) ?{ () -> untyped } -> untyped
36
57
 
37
58
  # 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
59
+ def odt_badge: (
60
+ ?String? text,
61
+ ?variant: badge_variant,
62
+ ?color: badge_color,
63
+ ?size: badge_size,
64
+ ?radius: radius_size?,
65
+ ?dot: bool,
66
+ ?icon: String?,
67
+ **untyped
68
+ ) ?{ () -> untyped } -> untyped
47
69
 
48
70
  # 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
71
+ def odt_card: (
72
+ ?title: String?,
73
+ ?subtitle: String?,
74
+ ?variant: card_variant,
75
+ ?background: card_background?,
76
+ ?border: card_border?,
77
+ ?shadow: shadow_size?,
78
+ ?radius: radius_size?,
79
+ ?padding: card_padding?,
80
+ ?hoverable: bool,
81
+ ?hover: bool,
82
+ ?as: card_tag,
83
+ **untyped
84
+ ) ?{ () -> untyped } -> untyped
57
85
 
58
86
  # 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
87
+ def odt_alert: (
88
+ ?String? message,
89
+ ?variant: alert_variant,
90
+ ?icon: String?,
91
+ **untyped
92
+ ) ?{ () -> untyped } -> untyped
64
93
 
65
94
  # 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
95
+ def odt_heading: (
96
+ ?String? text,
97
+ ?as: heading_tag,
98
+ ?size: heading_size?,
99
+ ?weight: font_weight?,
100
+ ?color: typography_color?,
101
+ ?truncate: bool,
102
+ **untyped
103
+ ) ?{ () -> untyped } -> untyped
70
104
 
71
105
  # 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
106
+ def odt_text: (
107
+ ?String? text,
108
+ ?as: text_tag,
109
+ ?size: text_size?,
110
+ ?weight: font_weight?,
111
+ ?color: typography_color?,
112
+ ?truncate: bool,
113
+ **untyped
114
+ ) ?{ () -> untyped } -> untyped
115
+
116
+ # Renders an ODT Avatar element.
117
+ def odt_avatar: (
118
+ ?name: String?,
119
+ ?src: String?,
120
+ ?size: avatar_size,
121
+ ?color: avatar_color,
122
+ ?icon: String,
123
+ ?fallback: String?,
124
+ **untyped
125
+ ) -> untyped
126
+
127
+ # Renders a styled input field.
128
+ def odt_input: (
129
+ ?label: String?,
130
+ ?variant: input_variant,
131
+ ?size: input_size,
132
+ ?radius: radius_size?,
133
+ ?type: String,
134
+ ?placeholder: String?,
135
+ ?error: String?,
136
+ ?helper: String?,
137
+ ?helper_text: String?,
138
+ ?success: String?,
139
+ ?left_icon: String?,
140
+ ?right_icon: String?,
141
+ ?prefix: String?,
142
+ ?suffix: String?,
143
+ ?addon_before: String?,
144
+ ?addon_after: String?,
145
+ ?disabled: bool,
146
+ ?full_width: bool,
147
+ **untyped
148
+ ) -> untyped
149
+
150
+ # Renders a styled textarea field.
151
+ def odt_textarea: (
152
+ ?label: String?,
153
+ ?variant: input_variant,
154
+ ?size: input_size,
155
+ ?radius: radius_size?,
156
+ ?rows: Integer,
157
+ ?resize: input_resize,
158
+ ?error: String?,
159
+ ?helper: String?,
160
+ ?helper_text: String?,
161
+ ?success: String?,
162
+ ?disabled: bool,
163
+ ?full_width: bool,
164
+ **untyped
165
+ ) ?{ () -> untyped } -> untyped
166
+
167
+ # Renders a styled native <select> dropdown.
168
+ def odt_select: (
169
+ ?label: String?,
170
+ ?options: untyped,
171
+ ?variant: input_variant,
172
+ ?size: input_size,
173
+ ?radius: radius_size?,
174
+ ?prompt: String?,
175
+ ?error: String?,
176
+ ?helper: String?,
177
+ ?helper_text: String?,
178
+ ?success: String?,
179
+ ?disabled: bool,
180
+ ?full_width: bool,
181
+ **untyped
182
+ ) -> untyped
183
+
184
+ # Renders a styled checkbox.
185
+ def odt_checkbox: (
186
+ ?label: String?,
187
+ ?description: String?,
188
+ ?checked: bool,
189
+ ?color: checkbox_color,
190
+ ?size: checkbox_size,
191
+ ?radius: radius_size?,
192
+ ?disabled: bool,
193
+ ?error: String?,
194
+ **untyped
195
+ ) -> untyped
196
+
197
+ # Renders a styled radio button.
198
+ def odt_radio: (
199
+ ?label: String?,
200
+ ?description: String?,
201
+ ?checked: bool,
202
+ ?color: checkbox_color,
203
+ ?size: checkbox_size,
204
+ ?disabled: bool,
205
+ ?error: String?,
206
+ **untyped
207
+ ) -> untyped
208
+
209
+ # Renders a form field wrapper.
210
+ def odt_form_group: (
211
+ ?label: String?,
212
+ ?error: String?,
213
+ ?helper: String?,
214
+ ?helper_text: String?,
215
+ ?success: String?,
216
+ ?required: bool,
217
+ **untyped
218
+ ) ?{ () -> untyped } -> untyped
86
219
  end
87
220
  end
88
221
 
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.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pixel
@@ -39,6 +39,7 @@ files:
39
39
  - README.md
40
40
  - app/assets/stylesheets/odt_ui.css
41
41
  - app/assets/stylesheets/odt_ui/styles.css
42
+ - app/assets/stylesheets/odt_ui/theme.css
42
43
  - app/assets/stylesheets/odt_ui/tokens.css
43
44
  - lib/generators/odt/install_generator.rb
44
45
  - lib/odt-ui-rails.rb