backpack_ui 0.1.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 +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +8 -0
- data/app/assets/config/backpack_ui_manifest.js +1 -0
- data/app/assets/stylesheets/backpack_ui/_variables.scss +404 -0
- data/app/assets/stylesheets/backpack_ui/application.css +16 -0
- data/app/assets/stylesheets/backpack_ui/application.scss +6 -0
- data/app/assets/stylesheets/backpack_ui/button.scss +218 -0
- data/app/components/backpack_ui/button_component.html.erb +4 -0
- data/app/components/backpack_ui/button_component.rb +35 -0
- data/app/controllers/backpack_ui/application_controller.rb +4 -0
- data/app/helpers/backpack_ui/application_helper.rb +4 -0
- data/app/jobs/backpack_ui/application_job.rb +4 -0
- data/app/mailers/backpack_ui/application_mailer.rb +6 -0
- data/app/models/backpack_ui/application_record.rb +5 -0
- data/app/views/layouts/backpack_ui/application.html.erb +15 -0
- data/config/routes.rb +2 -0
- data/lib/backpack_ui/engine.rb +17 -0
- data/lib/backpack_ui/version.rb +3 -0
- data/lib/backpack_ui.rb +8 -0
- data/lib/tasks/backpack_ui_tasks.rake +4 -0
- metadata +151 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a22767e9c2ff8585daaa3190c3d99f38dc3ac558fa381a2bc2d890cb02f3a3d7
|
4
|
+
data.tar.gz: 851f0e3319c878652866557961032a10ee60619ab0a4378c5400200954c46319
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: abc04d3185315b38c2861b137df94dbd839548719bcdfd00b2189f5b93dd1b2341416063da7f376c1035c5f386e2af0fbbaa8ef062c69fce7256d0cf301add05
|
7
|
+
data.tar.gz: 0af35484d989c55835780602186e7a0f527cdf4d2a152643c639257c6c9466c1587b771a24789c159da5586c9861783664dd3e7bb2f184e0701da1942a73f9cb
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright Josh Brito
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# BackpackUi
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem "backpack_ui"
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install backpack_ui
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
//= link backpack_ui/application.scss
|
@@ -0,0 +1,404 @@
|
|
1
|
+
// Slate
|
2
|
+
$slate-50: #f8fafc;
|
3
|
+
$slate-100: #f1f5f9;
|
4
|
+
$slate-200: #e2e8f0;
|
5
|
+
$slate-300: #cbd5e1;
|
6
|
+
$slate-400: #94a3b8;
|
7
|
+
$slate-500: #64748b;
|
8
|
+
$slate-600: #475569;
|
9
|
+
$slate-700: #334155;
|
10
|
+
$slate-800: #1e293b;
|
11
|
+
$slate-900: #0f172a;
|
12
|
+
$slate-950: #020617;
|
13
|
+
|
14
|
+
// Gray
|
15
|
+
$gray-50: #f9fafb;
|
16
|
+
$gray-100: #f3f4f6;
|
17
|
+
$gray-200: #e5e7eb;
|
18
|
+
$gray-300: #d1d5db;
|
19
|
+
$gray-400: #9ca3af;
|
20
|
+
$gray-500: #6b7280;
|
21
|
+
$gray-600: #4b5563;
|
22
|
+
$gray-700: #374151;
|
23
|
+
$gray-800: #1f2937;
|
24
|
+
$gray-900: #111827;
|
25
|
+
$gray-950: #030712;
|
26
|
+
|
27
|
+
// Zinc
|
28
|
+
$zinc-50: #fafafa;
|
29
|
+
$zinc-100: #f4f4f5;
|
30
|
+
$zinc-200: #e4e4e7;
|
31
|
+
$zinc-300: #d4d4d8;
|
32
|
+
$zinc-400: #a1a1aa;
|
33
|
+
$zinc-500: #71717a;
|
34
|
+
$zinc-600: #52525b;
|
35
|
+
$zinc-700: #3f3f46;
|
36
|
+
$zinc-800: #27272a;
|
37
|
+
$zinc-900: #18181b;
|
38
|
+
$zinc-950: #09090b;
|
39
|
+
|
40
|
+
// Neutral
|
41
|
+
$neutral-0: #FFFFFF;
|
42
|
+
$neutral-50: #fafafa;
|
43
|
+
$neutral-100: #f5f5f5;
|
44
|
+
$neutral-200: #e5e5e5;
|
45
|
+
$neutral-300: #d4d4d4;
|
46
|
+
$neutral-400: #a3a3a3;
|
47
|
+
$neutral-500: #737373;
|
48
|
+
$neutral-600: #525252;
|
49
|
+
$neutral-700: #404040;
|
50
|
+
$neutral-800: #262626;
|
51
|
+
$neutral-900: #171717;
|
52
|
+
$neutral-950: #0a0a0a;
|
53
|
+
|
54
|
+
// Stone
|
55
|
+
$stone-50: #fafaf9;
|
56
|
+
$stone-100: #f5f5f4;
|
57
|
+
$stone-200: #e7e5e4;
|
58
|
+
$stone-300: #d6d3d1;
|
59
|
+
$stone-400: #a8a29e;
|
60
|
+
$stone-500: #78716c;
|
61
|
+
$stone-600: #57534e;
|
62
|
+
$stone-700: #44403c;
|
63
|
+
$stone-800: #292524;
|
64
|
+
$stone-900: #1c1917;
|
65
|
+
$stone-950: #0c0a09;
|
66
|
+
|
67
|
+
// Red
|
68
|
+
$red-50: #fef2f2;
|
69
|
+
$red-100: #fee2e2;
|
70
|
+
$red-200: #fecaca;
|
71
|
+
$red-300: #fca5a5;
|
72
|
+
$red-400: #f87171;
|
73
|
+
$red-500: #ef4444;
|
74
|
+
$red-600: #dc2626;
|
75
|
+
$red-700: #b91c1c;
|
76
|
+
$red-800: #991b1b;
|
77
|
+
$red-900: #7f1d1d;
|
78
|
+
$red-950: #450a0a;
|
79
|
+
|
80
|
+
// Orange (Brand)
|
81
|
+
$orange-50: #fff9ed;
|
82
|
+
$orange-100: #fff1d4;
|
83
|
+
$orange-200: #ffdea8;
|
84
|
+
$orange-300: #ffc670;
|
85
|
+
$orange-400: #ffa237;
|
86
|
+
$orange-500: #ff8814;
|
87
|
+
$orange-600: #f06a06;
|
88
|
+
$orange-700: #c74f07;
|
89
|
+
$orange-800: #9e3e0e;
|
90
|
+
$orange-900: #7f350f;
|
91
|
+
$orange-950: #451805;
|
92
|
+
|
93
|
+
// Yellow (Brand)
|
94
|
+
$yellow-50: #fffaeb;
|
95
|
+
$yellow-100: #fff2c6;
|
96
|
+
$yellow-200: #ffe388;
|
97
|
+
$yellow-300: #ffcf4a;
|
98
|
+
$yellow-400: #ffb514;
|
99
|
+
$yellow-500: #f99607;
|
100
|
+
$yellow-600: #dd6f02;
|
101
|
+
$yellow-700: #b74d06;
|
102
|
+
$yellow-800: #943a0c;
|
103
|
+
$yellow-900: #7a300d;
|
104
|
+
$yellow-950: #461802;
|
105
|
+
|
106
|
+
// Lime (Brand)
|
107
|
+
$lime-50: #f4fce9;
|
108
|
+
$lime-100: #e6f8cf;
|
109
|
+
$lime-200: #cff1a5;
|
110
|
+
$lime-300: #afe571;
|
111
|
+
$lime-400: #8ad43a;
|
112
|
+
$lime-500: #72bc26;
|
113
|
+
$lime-600: #56961a;
|
114
|
+
$lime-700: #437219;
|
115
|
+
$lime-800: #375b19;
|
116
|
+
$lime-900: #314d1a;
|
117
|
+
$lime-950: #172a09;
|
118
|
+
|
119
|
+
// Green
|
120
|
+
$green-50: #f0fdf4;
|
121
|
+
$green-100: #dcfce7;
|
122
|
+
$green-200: #bbf7d0;
|
123
|
+
$green-300: #86efac;
|
124
|
+
$green-400: #4ade80;
|
125
|
+
$green-500: #22c55e;
|
126
|
+
$green-600: #16a34a;
|
127
|
+
$green-700: #15803d;
|
128
|
+
$green-800: #166534;
|
129
|
+
$green-900: #14532d;
|
130
|
+
$green-950: #052e16;
|
131
|
+
|
132
|
+
// Emerald
|
133
|
+
$emerald-50: #ecfdf5;
|
134
|
+
$emerald-100: #d1fae5;
|
135
|
+
$emerald-200: #a7f3d0;
|
136
|
+
$emerald-300: #6ee7b7;
|
137
|
+
$emerald-400: #34d399;
|
138
|
+
$emerald-500: #10b981;
|
139
|
+
$emerald-600: #059669;
|
140
|
+
$emerald-700: #047857;
|
141
|
+
$emerald-800: #065f46;
|
142
|
+
$emerald-900: #064e3b;
|
143
|
+
$emerald-950: #022c22;
|
144
|
+
|
145
|
+
// Teal
|
146
|
+
$teal-50: #f0fdfa;
|
147
|
+
$teal-100: #ccfbf1;
|
148
|
+
$teal-200: #99f6e4;
|
149
|
+
$teal-300: #5eead4;
|
150
|
+
$teal-400: #2dd4bf;
|
151
|
+
$teal-500: #14b8a6;
|
152
|
+
$teal-600: #0d9488;
|
153
|
+
$teal-700: #0f766e;
|
154
|
+
$teal-800: #115e59;
|
155
|
+
$teal-900: #134e4a;
|
156
|
+
$teal-950: #042f2e;
|
157
|
+
|
158
|
+
// Cyan
|
159
|
+
$cyan-50: #ecfeff;
|
160
|
+
$cyan-100: #cffafe;
|
161
|
+
$cyan-200: #a5f3fc;
|
162
|
+
$cyan-300: #67e8f9;
|
163
|
+
$cyan-400: #22d3ee;
|
164
|
+
$cyan-500: #06b6d4;
|
165
|
+
$cyan-600: #0891b2;
|
166
|
+
$cyan-700: #0e7490;
|
167
|
+
$cyan-800: #155e75;
|
168
|
+
$cyan-900: #164e63;
|
169
|
+
$cyan-950: #083344;
|
170
|
+
|
171
|
+
// Sky (Brand)
|
172
|
+
$sky-50: #eff8ff;
|
173
|
+
$sky-100: #def1ff;
|
174
|
+
$sky-200: #b6e4ff;
|
175
|
+
$sky-300: #75d0ff;
|
176
|
+
$sky-400: #2db8ff;
|
177
|
+
$sky-500: #0faafe;
|
178
|
+
$sky-600: #007fd3;
|
179
|
+
$sky-700: #0065aa;
|
180
|
+
$sky-800: #00558c;
|
181
|
+
$sky-900: #064774;
|
182
|
+
$sky-950: #042d4d;
|
183
|
+
|
184
|
+
// Blue
|
185
|
+
$blue-50: #eff6ff;
|
186
|
+
$blue-100: #dbeafe;
|
187
|
+
$blue-200: #bfdbfe;
|
188
|
+
$blue-300: #93c5fd;
|
189
|
+
$blue-400: #60a5fa;
|
190
|
+
$blue-500: #3b82f6;
|
191
|
+
$blue-600: #2563eb;
|
192
|
+
$blue-700: #1d4ed8;
|
193
|
+
$blue-800: #1e40af;
|
194
|
+
$blue-900: #1e3a8a;
|
195
|
+
$blue-950: #172554;
|
196
|
+
|
197
|
+
// Indigo
|
198
|
+
$indigo-50: #eef2ff;
|
199
|
+
$indigo-100: #e0e7ff;
|
200
|
+
$indigo-200: #c7d2fe;
|
201
|
+
$indigo-300: #a5b4fc;
|
202
|
+
$indigo-400: #818cf8;
|
203
|
+
$indigo-500: #6366f1;
|
204
|
+
$indigo-600: #4f46e5;
|
205
|
+
$indigo-700: #4338ca;
|
206
|
+
$indigo-800: #3730a3;
|
207
|
+
$indigo-900: #312e81;
|
208
|
+
$indigo-950: #1e1b4b;
|
209
|
+
|
210
|
+
// Violet
|
211
|
+
$violet-50: #f5f3ff;
|
212
|
+
$violet-100: #ede9fe;
|
213
|
+
$violet-200: #ddd6fe;
|
214
|
+
$violet-300: #c4b5fd;
|
215
|
+
$violet-400: #a78bfa;
|
216
|
+
$violet-500: #8b5cf6;
|
217
|
+
$violet-600: #7c3aed;
|
218
|
+
$violet-700: #6d28d9;
|
219
|
+
$violet-800: #5b21b6;
|
220
|
+
$violet-900: #4c1d95;
|
221
|
+
$violet-950: #2e1065;
|
222
|
+
|
223
|
+
// Purple
|
224
|
+
$purple-50: #faf5ff;
|
225
|
+
$purple-100: #f3e8ff;
|
226
|
+
$purple-200: #e9d5ff;
|
227
|
+
$purple-300: #d8b4fe;
|
228
|
+
$purple-400: #c084fc;
|
229
|
+
$purple-500: #a855f7;
|
230
|
+
$purple-600: #9333ea;
|
231
|
+
$purple-700: #7e22ce;
|
232
|
+
$purple-800: #6b21a8;
|
233
|
+
$purple-900: #581c87;
|
234
|
+
$purple-950: #3b0764;
|
235
|
+
|
236
|
+
// Fuchsia
|
237
|
+
$fuchsia-50: #fdf4ff;
|
238
|
+
$fuchsia-100: #fae8ff;
|
239
|
+
$fuchsia-200: #f5d0fe;
|
240
|
+
$fuchsia-300: #f0abfc;
|
241
|
+
$fuchsia-400: #e879f9;
|
242
|
+
$fuchsia-500: #d946ef;
|
243
|
+
$fuchsia-600: #c026d3;
|
244
|
+
$fuchsia-700: #a21caf;
|
245
|
+
$fuchsia-800: #86198f;
|
246
|
+
$fuchsia-900: #701a75;
|
247
|
+
$fuchsia-950: #4a044e;
|
248
|
+
|
249
|
+
// Pink
|
250
|
+
$pink-50: #fdf2f8;
|
251
|
+
$pink-100: #fce7f3;
|
252
|
+
$pink-200: #fbcfe8;
|
253
|
+
$pink-300: #f9a8d4;
|
254
|
+
$pink-400: #f472b6;
|
255
|
+
$pink-500: #ec4899;
|
256
|
+
$pink-600: #db2777;
|
257
|
+
$pink-700: #be185d;
|
258
|
+
$pink-800: #9d174d;
|
259
|
+
$pink-900: #831843;
|
260
|
+
$pink-950: #500724;
|
261
|
+
|
262
|
+
// Rose
|
263
|
+
$rose-50: #fff1f2;
|
264
|
+
$rose-100: #ffe4e6;
|
265
|
+
$rose-200: #fecdd3;
|
266
|
+
$rose-300: #fda4af;
|
267
|
+
$rose-400: #fb7185;
|
268
|
+
$rose-500: #f43f5e;
|
269
|
+
$rose-600: #e11d48;
|
270
|
+
$rose-700: #be123c;
|
271
|
+
$rose-800: #9f1239;
|
272
|
+
$rose-900: #881337;
|
273
|
+
$rose-950: #4c0519;
|
274
|
+
|
275
|
+
// Fonts
|
276
|
+
$font-primary: 'Open Sans', sans-serif;
|
277
|
+
|
278
|
+
$body-font-size: 16px;
|
279
|
+
$body-font-size-mobile: 12px;
|
280
|
+
|
281
|
+
$font-weight-light: 300;
|
282
|
+
$font-weight-normal: 400;
|
283
|
+
$font-weight-semi-bold: 600;
|
284
|
+
$font-weight-bold: 700;
|
285
|
+
$font-weight-extra-bold: 900;
|
286
|
+
|
287
|
+
// Padding
|
288
|
+
$padding-block: 10px;
|
289
|
+
$padding-inline: 14px;
|
290
|
+
$padding: $padding-block $padding-inline;
|
291
|
+
|
292
|
+
$padding-small-block: 8px;
|
293
|
+
$padding-small-inline: 12px;
|
294
|
+
$padding-small: $padding-small-block $padding-small-inline;
|
295
|
+
|
296
|
+
$border-radius-rounded-corner: 4px;
|
297
|
+
$border-radius-container: 8px;
|
298
|
+
$border-radius-pill: $padding-inline * 2;
|
299
|
+
$border-radius-pill-small: $padding-small-inline * 2;
|
300
|
+
|
301
|
+
$spacing: $padding-block;
|
302
|
+
$spacing-small: $padding-small-block;
|
303
|
+
|
304
|
+
$box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.25);
|
305
|
+
$box-shadow-hover: 0px 1px 6px;
|
306
|
+
|
307
|
+
// Breakpoints
|
308
|
+
$small-break-point: 620px;
|
309
|
+
$medium-break-point: 1024px;
|
310
|
+
|
311
|
+
:root {
|
312
|
+
--background-color: #{$neutral-100};
|
313
|
+
--foreground-color: #{$neutral-800};
|
314
|
+
|
315
|
+
--border-color: #{$neutral-300};
|
316
|
+
|
317
|
+
// UI Colors
|
318
|
+
--primary-color: #{$yellow-400};
|
319
|
+
--primary-color-hover: #{$yellow-300};
|
320
|
+
|
321
|
+
--secondary-color: #{$fuchsia-900};
|
322
|
+
--secondary-color-hover: #{$fuchsia-950};
|
323
|
+
|
324
|
+
--tertiary-color: #{$neutral-800};
|
325
|
+
--tertiary-color-hover: #{$neutral-950};
|
326
|
+
|
327
|
+
--outline-color: #{$neutral-200};
|
328
|
+
--outline-color-hover: #{$neutral-600};
|
329
|
+
|
330
|
+
--outline-dark-color: #{$neutral-600};
|
331
|
+
--outline-dark-color-hover: #{$neutral-200};
|
332
|
+
|
333
|
+
--outline-none-color: transparent;
|
334
|
+
--outline-none-color-hover: #{$neutral-200};
|
335
|
+
|
336
|
+
--notification-color: #{$red-500};
|
337
|
+
--notification-text: #{$neutral-100};
|
338
|
+
|
339
|
+
// Link
|
340
|
+
--link-color: #{$sky-600};
|
341
|
+
--link-color-visited: #{$sky-600};
|
342
|
+
--link-color-hover: #{$sky-600};
|
343
|
+
|
344
|
+
// Utility Colors
|
345
|
+
--info-color: #{$sky-600};
|
346
|
+
--info-color-light: #{$sky-200};
|
347
|
+
--success-color: #{$lime-600};
|
348
|
+
--success-color-light: #{$lime-200};
|
349
|
+
--warning-color: #{$orange-500};
|
350
|
+
--warning-color-light: #{$orange-200};
|
351
|
+
--error-color: #{$red-600};
|
352
|
+
--error-color-light: #{$red-200};
|
353
|
+
|
354
|
+
// Generic Colors
|
355
|
+
--blue-color: #{$sky-400};
|
356
|
+
--gray-color: #{$neutral-400};
|
357
|
+
--green-color: #{$lime-400};
|
358
|
+
--orange-color: #{$orange-400};
|
359
|
+
--red-color: #{$red-400};
|
360
|
+
--yellow-color: #{$yellow-400};
|
361
|
+
}
|
362
|
+
|
363
|
+
// MELLOW HAS NOT BEEN UPDATED IN AWHILE. It must follow the same variables as the root
|
364
|
+
.strongmind-ui-theme-mellow {
|
365
|
+
--background-color: #{$sky-200};
|
366
|
+
--foreground-color: #{$neutral-800};
|
367
|
+
--border-color: #{$neutral-400};
|
368
|
+
|
369
|
+
// UI Colors
|
370
|
+
--highlight-color: #{$sky-300};
|
371
|
+
--highlight-background-color: #{$sky-300};
|
372
|
+
--highlight-text-color: #{$neutral-700};
|
373
|
+
|
374
|
+
--secondary-background-color: #{$sky-200};
|
375
|
+
--secondary-text-color: #{$neutral-700};
|
376
|
+
|
377
|
+
--notification-color: #{$red-300};
|
378
|
+
--notification-text: #{$neutral-700};
|
379
|
+
|
380
|
+
// Utility Colors
|
381
|
+
--info-color: #{$sky-400};
|
382
|
+
--warning-color: #{$orange-300};
|
383
|
+
--success-color: #{$lime-300};
|
384
|
+
--error-color: #{$red-300};
|
385
|
+
|
386
|
+
// Generic Colors
|
387
|
+
--blue-color: #{$sky-200};
|
388
|
+
--gray-color: #{$neutral-200};
|
389
|
+
--green-color: #{$lime-200};
|
390
|
+
--orange-color: #{$orange-200};
|
391
|
+
--red-color: #{$red-200};
|
392
|
+
--yellow-color: #{$yellow-200};
|
393
|
+
|
394
|
+
// Link
|
395
|
+
--link-color: #{$sky-300};
|
396
|
+
--link-color-visited: #{$sky-400};
|
397
|
+
--link-color-hover: #{$sky-500};
|
398
|
+
}
|
399
|
+
|
400
|
+
// Mixin
|
401
|
+
@mixin disabled() {
|
402
|
+
cursor: not-allowed;
|
403
|
+
pointer-events: none;
|
404
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require backpack_ui/application
|
14
|
+
*= require_tree .
|
15
|
+
*/
|
16
|
+
|
@@ -0,0 +1,218 @@
|
|
1
|
+
//@import url(./assets/css/strongmind-ui-colors.less);
|
2
|
+
//@import url(./assets/css/strongmind-ui-variables.less);
|
3
|
+
|
4
|
+
@import '_variables.scss';
|
5
|
+
|
6
|
+
*.sm-btn {
|
7
|
+
align-items: center;
|
8
|
+
background-color: $neutral-200;
|
9
|
+
border-style: solid;
|
10
|
+
border-width: 1px;
|
11
|
+
border-color: transparent;
|
12
|
+
border-radius: $border-radius-rounded-corner;
|
13
|
+
color: $neutral-800;
|
14
|
+
cursor: pointer;
|
15
|
+
display: inline-flex;
|
16
|
+
font-size: 0.875rem;
|
17
|
+
gap: $spacing;
|
18
|
+
justify-content: center;
|
19
|
+
line-height: 1.375rem;
|
20
|
+
padding: 8px 24px 10px 24px;
|
21
|
+
text-decoration: none;
|
22
|
+
transition-duration: 0.12s;
|
23
|
+
transition-property: background-color, border-color, color;
|
24
|
+
transition-timing-function: ease-in-out;
|
25
|
+
white-space: nowrap;
|
26
|
+
|
27
|
+
> p {
|
28
|
+
line-height: 1.3;
|
29
|
+
margin: 0;
|
30
|
+
}
|
31
|
+
|
32
|
+
&:hover,
|
33
|
+
&:focus,
|
34
|
+
&:active {
|
35
|
+
background-color: $neutral-300;
|
36
|
+
border-color: $neutral-300;
|
37
|
+
color: $neutral-800;
|
38
|
+
text-decoration: none;
|
39
|
+
}
|
40
|
+
|
41
|
+
&:visited {
|
42
|
+
color: $neutral-800;
|
43
|
+
text-decoration: none;
|
44
|
+
}
|
45
|
+
|
46
|
+
&[disabled] {
|
47
|
+
@include disabled();
|
48
|
+
|
49
|
+
background-color: $neutral-100;
|
50
|
+
border-color: $neutral-100;
|
51
|
+
color: $neutral-400;
|
52
|
+
}
|
53
|
+
|
54
|
+
/*@media only screen and (max-width: 768px) {
|
55
|
+
gap: ~'calc(${spacing-small} / 2)';
|
56
|
+
padding: $padding-small;
|
57
|
+
}*/
|
58
|
+
|
59
|
+
// Variants
|
60
|
+
&-primary {
|
61
|
+
background-color: var(--primary-color);
|
62
|
+
border-color: var(--primary-color);
|
63
|
+
color: var(--foreground-color);
|
64
|
+
|
65
|
+
&:hover,
|
66
|
+
&:focus,
|
67
|
+
&:active {
|
68
|
+
background-color: var(--primary-color-hover);
|
69
|
+
border-color: var(--primary-color-hover);
|
70
|
+
color: var(--foreground-color);
|
71
|
+
}
|
72
|
+
|
73
|
+
&:visited {
|
74
|
+
color: var(--foreground-color);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
&-secondary {
|
79
|
+
background-color: var(--secondary-color);
|
80
|
+
border-color: var(--secondary-color);
|
81
|
+
color: var(--background-color);
|
82
|
+
|
83
|
+
&:hover,
|
84
|
+
&:focus,
|
85
|
+
&:active {
|
86
|
+
background-color: var(--secondary-color-hover);
|
87
|
+
border-color: var(--secondary-color-hover);
|
88
|
+
color: var(--background-color);
|
89
|
+
}
|
90
|
+
|
91
|
+
&:visited {
|
92
|
+
color: var(--background-color);
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
&-tertiary {
|
97
|
+
background-color: var(--tertiary-color);
|
98
|
+
border-color: var(--tertiary-color);
|
99
|
+
color: var(--background-color);
|
100
|
+
|
101
|
+
&:hover,
|
102
|
+
&:focus,
|
103
|
+
&:active {
|
104
|
+
background-color: var(--tertiary-color-hover);
|
105
|
+
border-color: var(--tertiary-color-hover);
|
106
|
+
color: var(--background-color);
|
107
|
+
}
|
108
|
+
|
109
|
+
&:visited {
|
110
|
+
color: var(--background-color);
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
&-outline {
|
115
|
+
background-color: transparent;
|
116
|
+
border-color: var(--outline-color);
|
117
|
+
color: var(--foreground-color);
|
118
|
+
|
119
|
+
&:hover,
|
120
|
+
&:focus,
|
121
|
+
&:active {
|
122
|
+
background-color: transparent;
|
123
|
+
border-color: var(--outline-color-hover);
|
124
|
+
color: var(--foreground-color);
|
125
|
+
}
|
126
|
+
|
127
|
+
&:visited {
|
128
|
+
color: var(--foreground-color);
|
129
|
+
}
|
130
|
+
}
|
131
|
+
|
132
|
+
&-outline-dark {
|
133
|
+
background-color: transparent;
|
134
|
+
border-color: var(--outline-dark-color);
|
135
|
+
color: var(--background-color);
|
136
|
+
|
137
|
+
&:hover,
|
138
|
+
&:focus,
|
139
|
+
&:active {
|
140
|
+
background-color: transparent;
|
141
|
+
border-color: var(--outline-dark-color-hover);
|
142
|
+
color: var(--background-color);
|
143
|
+
}
|
144
|
+
|
145
|
+
&:visited {
|
146
|
+
color: var(--background-color);
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
&-no-outline {
|
151
|
+
background-color: var(--outline-none-color);
|
152
|
+
border-color: var(--outline-none-color);
|
153
|
+
color: var(--foreground-color);
|
154
|
+
|
155
|
+
&:hover,
|
156
|
+
&:focus,
|
157
|
+
&:active {
|
158
|
+
background-color: var(--outline-none-color-hover);
|
159
|
+
border-color: var(--outline-none-color-hover);
|
160
|
+
color: var(--foreground-color);
|
161
|
+
}
|
162
|
+
|
163
|
+
&:visited {
|
164
|
+
color: var(--foreground-color);
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
&-link {
|
169
|
+
padding: unset;
|
170
|
+
border: none;
|
171
|
+
background-color: transparent;
|
172
|
+
color: var(--foreground-color);
|
173
|
+
text-decoration: none;
|
174
|
+
|
175
|
+
&:hover,
|
176
|
+
&:focus,
|
177
|
+
&:active {
|
178
|
+
background-color: transparent;
|
179
|
+
color: var(--foreground-color);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
&-delete {
|
184
|
+
background-color: transparent;
|
185
|
+
border-color: var(--error-color);
|
186
|
+
color: var(--error-color);
|
187
|
+
|
188
|
+
&:hover,
|
189
|
+
&:focus,
|
190
|
+
&:active {
|
191
|
+
background-color: var(--error-color);
|
192
|
+
border-color: var(--error-color);
|
193
|
+
color: var(--background-color);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
&-large {
|
198
|
+
padding: 20px 50px;
|
199
|
+
}
|
200
|
+
|
201
|
+
&-medium {
|
202
|
+
padding: 12px 35px;
|
203
|
+
gap: $padding-small-block;
|
204
|
+
}
|
205
|
+
|
206
|
+
&-small {
|
207
|
+
gap: $padding-small-block;
|
208
|
+
font-size: 12px;
|
209
|
+
}
|
210
|
+
|
211
|
+
&-icon-only {
|
212
|
+
padding: 9px 14px;
|
213
|
+
|
214
|
+
i {
|
215
|
+
line-height: inherit;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BackpackUi
|
4
|
+
class ButtonComponent < ViewComponent::Base
|
5
|
+
attr_reader :type
|
6
|
+
|
7
|
+
def initialize(name:, icon:, type: 'primary', size: 'medium')
|
8
|
+
@name = name
|
9
|
+
@icon = icon
|
10
|
+
@type = type
|
11
|
+
@size = size
|
12
|
+
end
|
13
|
+
|
14
|
+
def style
|
15
|
+
{
|
16
|
+
primary: "sm-btn-primary",
|
17
|
+
secondary: "sm-btn-secondary",
|
18
|
+
tertiary: "sm-btn-tertiary",
|
19
|
+
outline: "sm-btn-outline",
|
20
|
+
outline_dark: "sm-btn-outline-dark",
|
21
|
+
link: "sm-btn-link",
|
22
|
+
delete: "sm-btn-delete",
|
23
|
+
no_outline: "sm-btn-no-outline",
|
24
|
+
}[type.to_sym] + " " + "sm-btn" + " " + size
|
25
|
+
end
|
26
|
+
|
27
|
+
def size
|
28
|
+
{
|
29
|
+
small: "sm-btn-small",
|
30
|
+
medium: "sm-btn-medium",
|
31
|
+
large: "sm-btn-large",
|
32
|
+
}[@size.to_sym]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module BackpackUi
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace BackpackUi
|
4
|
+
|
5
|
+
config.autoload_paths << root.join("app", "components")
|
6
|
+
|
7
|
+
initializer "backpack_ui.assets.precompile" do |app|
|
8
|
+
app.config.assets.precompile += %w( backpack_ui/application.scss )
|
9
|
+
end
|
10
|
+
|
11
|
+
initializer "backpack_ui.hotwire_livereload" do |app|
|
12
|
+
if Rails.env.development?
|
13
|
+
app.config.hotwire_livereload.listen_paths << root.join("app")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/backpack_ui.rb
ADDED
metadata
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: backpack_ui
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Skunkworks
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-07-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 7.1.3.4
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 7.1.3.4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sassc-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: view_component
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: turbo-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: importmap-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: hotwire-livereload
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: UI components for StrongMind applications.
|
98
|
+
email:
|
99
|
+
- skunkworks@strongmind.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- MIT-LICENSE
|
105
|
+
- README.md
|
106
|
+
- Rakefile
|
107
|
+
- app/assets/config/backpack_ui_manifest.js
|
108
|
+
- app/assets/stylesheets/backpack_ui/_variables.scss
|
109
|
+
- app/assets/stylesheets/backpack_ui/application.css
|
110
|
+
- app/assets/stylesheets/backpack_ui/application.scss
|
111
|
+
- app/assets/stylesheets/backpack_ui/button.scss
|
112
|
+
- app/components/backpack_ui/button_component.html.erb
|
113
|
+
- app/components/backpack_ui/button_component.rb
|
114
|
+
- app/controllers/backpack_ui/application_controller.rb
|
115
|
+
- app/helpers/backpack_ui/application_helper.rb
|
116
|
+
- app/jobs/backpack_ui/application_job.rb
|
117
|
+
- app/mailers/backpack_ui/application_mailer.rb
|
118
|
+
- app/models/backpack_ui/application_record.rb
|
119
|
+
- app/views/layouts/backpack_ui/application.html.erb
|
120
|
+
- config/routes.rb
|
121
|
+
- lib/backpack_ui.rb
|
122
|
+
- lib/backpack_ui/engine.rb
|
123
|
+
- lib/backpack_ui/version.rb
|
124
|
+
- lib/tasks/backpack_ui_tasks.rake
|
125
|
+
homepage: https://github.com/strongmind/backpack-ui
|
126
|
+
licenses:
|
127
|
+
- MIT
|
128
|
+
metadata:
|
129
|
+
homepage_uri: https://github.com/strongmind/backpack-ui
|
130
|
+
source_code_uri: https://github.com/StrongMind/backpack-ui
|
131
|
+
changelog_uri: https://github.com/StrongMind/backpack-ui/blob/main/CHANGELOG.md
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: 3.0.0
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubygems_version: 3.5.14
|
148
|
+
signing_key:
|
149
|
+
specification_version: 4
|
150
|
+
summary: UI components for StrongMind applications.
|
151
|
+
test_files: []
|