odt-ui-rails 2.0.0 → 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.
- checksums.yaml +4 -4
- data/README.md +80 -18
- data/app/assets/stylesheets/odt_ui/styles.css +907 -3195
- data/app/assets/stylesheets/odt_ui/theme.css +126 -0
- data/app/assets/stylesheets/odt_ui/tokens.css +189 -46
- data/lib/generators/odt/install_generator.rb +45 -4
- data/lib/odt_ui/helper.rb +628 -241
- data/lib/odt_ui/version.rb +1 -1
- data/sig/odt_ui.rbs +230 -0
- metadata +3 -1
data/lib/odt_ui/version.rb
CHANGED
data/sig/odt_ui.rbs
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
module OdtUi
|
|
2
|
+
VERSION: String
|
|
3
|
+
|
|
4
|
+
module Helper
|
|
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
|
+
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
|
+
type shadow_size = :none | :card | :dropdown | :modal | :popover | Symbol | String
|
|
10
|
+
|
|
11
|
+
type badge_variant = :subtle | :filled | :outlined | :outline | String
|
|
12
|
+
type badge_color = :primary | :secondary | :success | :warning | :danger | :info | :neutral | String
|
|
13
|
+
type badge_size = :sm | :md | String
|
|
14
|
+
|
|
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
|
+
|
|
21
|
+
type alert_variant = :success | :warning | :danger | :info | 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
|
|
31
|
+
type avatar_color = :secondary | :primary | :neutral | String
|
|
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
|
+
|
|
39
|
+
# Renders an ODT Button component.
|
|
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
|
|
57
|
+
|
|
58
|
+
# Renders an ODT Badge component.
|
|
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
|
|
69
|
+
|
|
70
|
+
# Renders an ODT Card component.
|
|
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
|
|
85
|
+
|
|
86
|
+
# Renders an ODT Alert banner.
|
|
87
|
+
def odt_alert: (
|
|
88
|
+
?String? message,
|
|
89
|
+
?variant: alert_variant,
|
|
90
|
+
?icon: String?,
|
|
91
|
+
**untyped
|
|
92
|
+
) ?{ () -> untyped } -> untyped
|
|
93
|
+
|
|
94
|
+
# Renders an ODT Heading element.
|
|
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
|
|
104
|
+
|
|
105
|
+
# Renders styled body text.
|
|
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
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
module ActionView
|
|
223
|
+
class Base
|
|
224
|
+
include OdtUi::Helper
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
module Helpers
|
|
228
|
+
include OdtUi::Helper
|
|
229
|
+
end
|
|
230
|
+
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.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pixel
|
|
@@ -39,12 +39,14 @@ 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
|
|
45
46
|
- lib/odt_ui/engine.rb
|
|
46
47
|
- lib/odt_ui/helper.rb
|
|
47
48
|
- lib/odt_ui/version.rb
|
|
49
|
+
- sig/odt_ui.rbs
|
|
48
50
|
homepage: https://github.com/PixxelTK/ODT-Lightweight-UI
|
|
49
51
|
licenses:
|
|
50
52
|
- MIT
|