trek 0.1.20 → 0.1.22

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.npmignore +3 -0
  3. data/Gemfile.lock +86 -82
  4. data/README.md +8 -0
  5. data/app/assets/stylesheets/trek/_colors.css +181 -0
  6. data/app/components/trek/button_component.rb +9 -3
  7. data/app/components/trek/dashboard/tile_component/tile_component.html.slim +1 -1
  8. data/app/components/trek/dashboard/tile_component.rb +2 -0
  9. data/app/components/trek/form/actions_component/actions_component.css +6 -0
  10. data/app/components/trek/form/image_field_component/image_field_component.css +8 -0
  11. data/app/components/trek/form/image_field_component/image_field_component.html.slim +20 -8
  12. data/app/components/trek/form/image_field_component/image_field_component.js +23 -1
  13. data/app/components/trek/form/image_field_component.rb +13 -0
  14. data/app/components/trek/form/switch_box_component.rb +1 -0
  15. data/app/components/trek/tabs_component/tabs_component.css +1 -0
  16. data/app/controllers/concerns/trek/model.rb +4 -1
  17. data/config/locales/trek.en.yml +3 -0
  18. data/config/locales/trek.fr.yml +1 -0
  19. data/docs/.vitepress/config.mjs +133 -0
  20. data/docs/.vitepress/theme/index.js +17 -0
  21. data/docs/.vitepress/theme/style.css +139 -0
  22. data/docs/customize.md +63 -7
  23. data/docs/getting-started.md +160 -0
  24. data/docs/index.md +39 -0
  25. data/docs/public/logo.svg +1 -0
  26. data/docs/reference/components.md +40 -0
  27. data/docs/reference/concerns/contentable.md +28 -0
  28. data/docs/reference/concerns/formattable.md +24 -0
  29. data/docs/reference/concerns/fragmentable.md +33 -0
  30. data/docs/reference/concerns/keyable.md +18 -0
  31. data/docs/reference/concerns/orderable.md +26 -0
  32. data/docs/reference/concerns/pageable.md +35 -0
  33. data/docs/reference/concerns/pathable.md +28 -0
  34. data/docs/reference/concerns/phonable.md +28 -0
  35. data/docs/reference/concerns/search-engine-optimizable.md +19 -0
  36. data/docs/reference/concerns/searchable.md +22 -0
  37. data/docs/reference/concerns/sectionable.md +24 -0
  38. data/docs/reference/concerns/sluggable.md +21 -0
  39. data/docs/reference/concerns/taggable.md +20 -0
  40. data/docs/reference/concerns/translatable.md +35 -0
  41. data/docs/reference/concerns/versionable.md +27 -0
  42. data/docs/reference/controllers.md +23 -0
  43. data/docs/reference/environment-variables.md +9 -0
  44. data/docs/reference/formatters.md +30 -0
  45. data/docs/reference/forms.md +21 -0
  46. data/docs/reference/generators/admin-user.md +17 -0
  47. data/docs/reference/generators/install.md +42 -0
  48. data/docs/reference/generators/scaffold.md +37 -0
  49. data/docs/reference/generators/taxonomies.md +21 -0
  50. data/docs/reference/icons.md +11 -0
  51. data/docs/reference/index.md +47 -0
  52. data/docs/reference/models/current.md +11 -0
  53. data/docs/reference/models/external-link.md +16 -0
  54. data/docs/reference/models/fragment.md +28 -0
  55. data/docs/reference/models/menu-node.md +30 -0
  56. data/docs/reference/models/page-path.md +19 -0
  57. data/docs/reference/models/page-version.md +30 -0
  58. data/docs/reference/models/page.md +48 -0
  59. data/docs/reference/models/tag.md +41 -0
  60. data/docs/reference/models/user.md +65 -0
  61. data/docs/reference/policies.md +30 -0
  62. data/docs/reference/uploaders.md +19 -0
  63. data/docs/what-is-trek.md +37 -0
  64. data/esbuild.config.js +10 -7
  65. data/lib/generators/trek/templates/initializers/shrine.rb +1 -0
  66. data/lib/trek/version.rb +1 -1
  67. data/netlify.toml +4 -0
  68. data/package.json +10 -5
  69. data/renovate.json +4 -0
  70. data/yarn.lock +2015 -235
  71. metadata +48 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8836f5f71ee9aeae0475df30e1e941038aeac1d3ba5a1f0a8bc548ddf87cedff
4
- data.tar.gz: 2b07e244708e2e9a6258d9d352f04fc03bba3777e11b2a6ae3a7ad7e0e100fd5
3
+ metadata.gz: bb5c6af64a8d5934859280f654a6c835a44af7d87125da7f76246abc0c77e974
4
+ data.tar.gz: 72f797bee0d73262a8636b0a2e08b753c275c4529b9fca26a9a2dac8fd61bd30
5
5
  SHA512:
6
- metadata.gz: 568c5f70e0482e4ef6c86e66d4ffe46bc5828848c28ec8646129468bbc4db60c362fb3ddd4bee9ba9e747fffc5d24385f3198876bc8a3dc9031658c3eb1dc380
7
- data.tar.gz: 322f0ab2ab3fc8d3bef7cabc8fadbd750b43b790163e9abf915c7bb8766c594bec7161980695e020e6d0e8b7a3e8e4a6c47309edefea2a2df72bd1918a8ffe77
6
+ metadata.gz: abdfd7fd9b23d6a1d7ea200df36cf61dc339f00be775dc3de25d982841e280a7ec1adc32613ff96c2c004c06773b888436ab54977ee1f75656f6a7b7b867cdec
7
+ data.tar.gz: 54835b0a50cdcd83003b162a6ee061c161d7fa2c29293f421c9a11a300516131f30ca538091b3a99c793fb3fe88ac9f220fbf14bad661f9b89ed7da80b294271
data/.npmignore CHANGED
@@ -1,6 +1,9 @@
1
+ .claude
2
+ .yarn
1
3
  app/**/*.{rb,slim}
2
4
  bin
3
5
  config
4
6
  docs
5
7
  lib
8
+ pkg
6
9
  spec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trek (0.1.20)
4
+ trek (0.1.22)
5
5
  action_policy (~> 0.6)
6
6
  actioncable
7
7
  acts_as_list (~> 1.1)
@@ -37,31 +37,31 @@ GEM
37
37
  specs:
38
38
  action_policy (0.7.5)
39
39
  ruby-next-core (>= 1.0)
40
- action_text-trix (2.1.16)
40
+ action_text-trix (2.1.18)
41
41
  railties
42
- actioncable (8.1.1)
43
- actionpack (= 8.1.1)
44
- activesupport (= 8.1.1)
42
+ actioncable (8.1.3)
43
+ actionpack (= 8.1.3)
44
+ activesupport (= 8.1.3)
45
45
  nio4r (~> 2.0)
46
46
  websocket-driver (>= 0.6.1)
47
47
  zeitwerk (~> 2.6)
48
- actionmailbox (8.1.1)
49
- actionpack (= 8.1.1)
50
- activejob (= 8.1.1)
51
- activerecord (= 8.1.1)
52
- activestorage (= 8.1.1)
53
- activesupport (= 8.1.1)
48
+ actionmailbox (8.1.3)
49
+ actionpack (= 8.1.3)
50
+ activejob (= 8.1.3)
51
+ activerecord (= 8.1.3)
52
+ activestorage (= 8.1.3)
53
+ activesupport (= 8.1.3)
54
54
  mail (>= 2.8.0)
55
- actionmailer (8.1.1)
56
- actionpack (= 8.1.1)
57
- actionview (= 8.1.1)
58
- activejob (= 8.1.1)
59
- activesupport (= 8.1.1)
55
+ actionmailer (8.1.3)
56
+ actionpack (= 8.1.3)
57
+ actionview (= 8.1.3)
58
+ activejob (= 8.1.3)
59
+ activesupport (= 8.1.3)
60
60
  mail (>= 2.8.0)
61
61
  rails-dom-testing (~> 2.2)
62
- actionpack (8.1.1)
63
- actionview (= 8.1.1)
64
- activesupport (= 8.1.1)
62
+ actionpack (8.1.3)
63
+ actionview (= 8.1.3)
64
+ activesupport (= 8.1.3)
65
65
  nokogiri (>= 1.8.5)
66
66
  rack (>= 2.2.4)
67
67
  rack-session (>= 1.0.1)
@@ -69,36 +69,36 @@ GEM
69
69
  rails-dom-testing (~> 2.2)
70
70
  rails-html-sanitizer (~> 1.6)
71
71
  useragent (~> 0.16)
72
- actiontext (8.1.1)
72
+ actiontext (8.1.3)
73
73
  action_text-trix (~> 2.1.15)
74
- actionpack (= 8.1.1)
75
- activerecord (= 8.1.1)
76
- activestorage (= 8.1.1)
77
- activesupport (= 8.1.1)
74
+ actionpack (= 8.1.3)
75
+ activerecord (= 8.1.3)
76
+ activestorage (= 8.1.3)
77
+ activesupport (= 8.1.3)
78
78
  globalid (>= 0.6.0)
79
79
  nokogiri (>= 1.8.5)
80
- actionview (8.1.1)
81
- activesupport (= 8.1.1)
80
+ actionview (8.1.3)
81
+ activesupport (= 8.1.3)
82
82
  builder (~> 3.1)
83
83
  erubi (~> 1.11)
84
84
  rails-dom-testing (~> 2.2)
85
85
  rails-html-sanitizer (~> 1.6)
86
- activejob (8.1.1)
87
- activesupport (= 8.1.1)
86
+ activejob (8.1.3)
87
+ activesupport (= 8.1.3)
88
88
  globalid (>= 0.3.6)
89
- activemodel (8.1.1)
90
- activesupport (= 8.1.1)
91
- activerecord (8.1.1)
92
- activemodel (= 8.1.1)
93
- activesupport (= 8.1.1)
89
+ activemodel (8.1.3)
90
+ activesupport (= 8.1.3)
91
+ activerecord (8.1.3)
92
+ activemodel (= 8.1.3)
93
+ activesupport (= 8.1.3)
94
94
  timeout (>= 0.4.0)
95
- activestorage (8.1.1)
96
- actionpack (= 8.1.1)
97
- activejob (= 8.1.1)
98
- activerecord (= 8.1.1)
99
- activesupport (= 8.1.1)
95
+ activestorage (8.1.3)
96
+ actionpack (= 8.1.3)
97
+ activejob (= 8.1.3)
98
+ activerecord (= 8.1.3)
99
+ activesupport (= 8.1.3)
100
100
  marcel (~> 1.0)
101
- activesupport (8.1.1)
101
+ activesupport (8.1.3)
102
102
  base64
103
103
  bigdecimal
104
104
  concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -114,7 +114,7 @@ GEM
114
114
  acts_as_list (1.2.6)
115
115
  activerecord (>= 6.1)
116
116
  activesupport (>= 6.1)
117
- addressable (2.8.8)
117
+ addressable (2.9.0)
118
118
  public_suffix (>= 2.0.2, < 8.0)
119
119
  ast (2.4.3)
120
120
  aws-eventstream (1.4.0)
@@ -137,7 +137,7 @@ GEM
137
137
  aws-sigv4 (1.12.1)
138
138
  aws-eventstream (~> 1, >= 1.0.2)
139
139
  base64 (0.3.0)
140
- bigdecimal (3.3.1)
140
+ bigdecimal (4.1.2)
141
141
  blurhash (0.1.8)
142
142
  brakeman (7.1.2)
143
143
  racc
@@ -162,8 +162,9 @@ GEM
162
162
  connection_pool (3.0.2)
163
163
  content_disposition (1.0.0)
164
164
  crass (1.0.6)
165
- css_parser (1.21.1)
165
+ css_parser (3.0.0)
166
166
  addressable
167
+ ssrf_filter (~> 1.5)
167
168
  date (3.5.1)
168
169
  deepl-rb (3.6.1)
169
170
  diff-lcs (1.6.2)
@@ -193,14 +194,14 @@ GEM
193
194
  dry-logic (~> 1.5)
194
195
  dry-types (~> 1.8)
195
196
  zeitwerk (~> 2.6)
196
- dry-types (1.8.3)
197
- bigdecimal (~> 3.0)
197
+ dry-types (1.9.1)
198
+ bigdecimal (>= 3.0)
198
199
  concurrent-ruby (~> 1.0)
199
200
  dry-core (~> 1.0)
200
201
  dry-inflector (~> 1.0)
201
202
  dry-logic (~> 1.4)
202
203
  zeitwerk (~> 2.6)
203
- erb (6.0.1)
204
+ erb (6.0.4)
204
205
  erubi (1.13.1)
205
206
  fastimage (2.4.0)
206
207
  ffi (1.17.3-arm64-darwin)
@@ -230,12 +231,13 @@ GEM
230
231
  mini_magick (>= 4.9.5, < 6)
231
232
  ruby-vips (>= 2.0.17, < 3)
232
233
  io-console (0.8.2)
233
- irb (1.16.0)
234
+ irb (1.17.0)
234
235
  pp (>= 0.6.0)
236
+ prism (>= 1.3.0)
235
237
  rdoc (>= 4.0.0)
236
238
  reline (>= 0.4.2)
237
239
  jmespath (1.6.2)
238
- json (2.18.0)
240
+ json (2.19.5)
239
241
  kaminari (1.2.2)
240
242
  activesupport (>= 4.1.0)
241
243
  kaminari-actionview (= 1.2.2)
@@ -254,7 +256,7 @@ GEM
254
256
  rb-fsevent (~> 0.10, >= 0.10.3)
255
257
  rb-inotify (~> 0.9, >= 0.9.10)
256
258
  logger (1.7.0)
257
- loofah (2.25.0)
259
+ loofah (2.25.1)
258
260
  crass (~> 1.0.2)
259
261
  nokogiri (>= 1.12.0)
260
262
  lookbook (2.3.14)
@@ -280,12 +282,13 @@ GEM
280
282
  mini_magick (5.3.1)
281
283
  logger
282
284
  mini_mime (1.1.5)
283
- minitest (6.0.1)
285
+ minitest (6.0.6)
286
+ drb (~> 2.0)
284
287
  prism (~> 1.5)
285
288
  mobility (1.3.2)
286
289
  i18n (>= 0.6.10, < 2)
287
290
  request_store (~> 1.0)
288
- net-imap (0.6.2)
291
+ net-imap (0.6.4)
289
292
  date
290
293
  net-protocol
291
294
  net-pop (0.1.2)
@@ -295,9 +298,9 @@ GEM
295
298
  net-smtp (0.5.1)
296
299
  net-protocol
297
300
  nio4r (2.7.5)
298
- nokogiri (1.19.1-arm64-darwin)
301
+ nokogiri (1.19.3-arm64-darwin)
299
302
  racc (~> 1.4)
300
- nokogiri (1.19.1-x86_64-darwin)
303
+ nokogiri (1.19.3-x86_64-darwin)
301
304
  racc (~> 1.4)
302
305
  parallel (1.27.0)
303
306
  parser (3.3.10.0)
@@ -312,36 +315,36 @@ GEM
312
315
  pp (0.6.3)
313
316
  prettyprint
314
317
  prettyprint (0.2.0)
315
- prism (1.7.0)
318
+ prism (1.9.0)
316
319
  prosemirror_to_html (0.3.0)
317
320
  nokogiri
318
321
  psych (5.3.1)
319
322
  date
320
323
  stringio
321
- public_suffix (7.0.2)
324
+ public_suffix (7.0.5)
322
325
  racc (1.8.1)
323
- rack (3.2.5)
324
- rack-session (2.1.1)
326
+ rack (3.2.6)
327
+ rack-session (2.1.2)
325
328
  base64 (>= 0.1.0)
326
329
  rack (>= 3.0.0)
327
330
  rack-test (2.2.0)
328
331
  rack (>= 1.3)
329
332
  rackup (2.3.1)
330
333
  rack (>= 3)
331
- rails (8.1.1)
332
- actioncable (= 8.1.1)
333
- actionmailbox (= 8.1.1)
334
- actionmailer (= 8.1.1)
335
- actionpack (= 8.1.1)
336
- actiontext (= 8.1.1)
337
- actionview (= 8.1.1)
338
- activejob (= 8.1.1)
339
- activemodel (= 8.1.1)
340
- activerecord (= 8.1.1)
341
- activestorage (= 8.1.1)
342
- activesupport (= 8.1.1)
334
+ rails (8.1.3)
335
+ actioncable (= 8.1.3)
336
+ actionmailbox (= 8.1.3)
337
+ actionmailer (= 8.1.3)
338
+ actionpack (= 8.1.3)
339
+ actiontext (= 8.1.3)
340
+ actionview (= 8.1.3)
341
+ activejob (= 8.1.3)
342
+ activemodel (= 8.1.3)
343
+ activerecord (= 8.1.3)
344
+ activestorage (= 8.1.3)
345
+ activesupport (= 8.1.3)
343
346
  bundler (>= 1.15.0)
344
- railties (= 8.1.1)
347
+ railties (= 8.1.3)
345
348
  rails-dom-testing (2.3.0)
346
349
  activesupport (>= 5.0.0)
347
350
  minitest
@@ -349,15 +352,15 @@ GEM
349
352
  rails-healthcheck (1.4.0)
350
353
  actionpack
351
354
  railties
352
- rails-html-sanitizer (1.6.2)
353
- loofah (~> 2.21)
355
+ rails-html-sanitizer (1.7.0)
356
+ loofah (~> 2.25)
354
357
  nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
355
358
  rails-i18n (8.1.0)
356
359
  i18n (>= 0.7, < 2)
357
360
  railties (>= 8.0.0, < 9)
358
- railties (8.1.1)
359
- actionpack (= 8.1.1)
360
- activesupport (= 8.1.1)
361
+ railties (8.1.3)
362
+ actionpack (= 8.1.3)
363
+ activesupport (= 8.1.3)
361
364
  irb (~> 1.13)
362
365
  rackup (>= 1.0.0)
363
366
  rake (>= 12.2)
@@ -369,7 +372,7 @@ GEM
369
372
  rb-fsevent (0.11.2)
370
373
  rb-inotify (0.11.1)
371
374
  ffi (~> 1.0)
372
- rdoc (7.0.3)
375
+ rdoc (7.2.0)
373
376
  erb
374
377
  psych (>= 4.0.0)
375
378
  tsort
@@ -477,15 +480,16 @@ GEM
477
480
  rexml (~> 3.2)
478
481
  rubocop (>= 1.0, < 2.0)
479
482
  slim (>= 3.0, < 6.0)
483
+ ssrf_filter (1.5.0)
480
484
  stringio (3.2.0)
481
485
  strip_attributes (2.0.1)
482
486
  activemodel (>= 3.0, < 9.0)
483
487
  temple (0.10.4)
484
488
  terminal-table (4.0.0)
485
489
  unicode-display_width (>= 1.1.1, < 4)
486
- thor (1.4.0)
490
+ thor (1.5.0)
487
491
  tilt (2.6.1)
488
- timeout (0.6.0)
492
+ timeout (0.6.1)
489
493
  tsort (0.2.0)
490
494
  tzinfo (2.0.6)
491
495
  concurrent-ruby (~> 1.0)
@@ -494,9 +498,9 @@ GEM
494
498
  unicode-emoji (4.2.0)
495
499
  uri (1.1.1)
496
500
  useragent (0.16.11)
497
- view_component (4.1.1)
498
- actionview (>= 7.1.0, < 8.2)
499
- activesupport (>= 7.1.0, < 8.2)
501
+ view_component (4.10.0)
502
+ actionview (>= 7.1.0)
503
+ activesupport (>= 7.1.0)
500
504
  concurrent-ruby (~> 1)
501
505
  view_component-form (0.3.0)
502
506
  actionview (>= 7.2.0, < 8.2)
@@ -512,8 +516,8 @@ GEM
512
516
  zeitwerk (>= 2.7)
513
517
  xpath (3.2.0)
514
518
  nokogiri (~> 1.8)
515
- yard (0.9.38)
516
- zeitwerk (2.7.4)
519
+ yard (0.9.43)
520
+ zeitwerk (2.7.5)
517
521
 
518
522
  PLATFORMS
519
523
  arm64-darwin-24
data/README.md CHANGED
@@ -210,6 +210,14 @@ When you're done, disable the local package:
210
210
 
211
211
  yarn unlink ~/projects/trek
212
212
 
213
+ ### Working on documentation
214
+
215
+ The docs, based on [VitePress](https://vitepress.dev), are embedded in the `/docs` folder.
216
+
217
+ - Launch dev mode: `yarn docs:dev`
218
+ - Build the docs: `yarn docs:build`
219
+ - Open the built docs: `yarn docs:preview`
220
+
213
221
  ### Publishing a new version
214
222
 
215
223
  make release
@@ -41,3 +41,184 @@
41
41
  --accent-11: var(--cyan-11);
42
42
  --accent-12: var(--cyan-12);
43
43
  }
44
+
45
+ /* Define the accent color overrides */
46
+ [data-accent-color="amber"] {
47
+ --accent-1: var(--amber-1);
48
+ --accent-2: var(--amber-2);
49
+ --accent-3: var(--amber-3);
50
+ --accent-4: var(--amber-4);
51
+ --accent-5: var(--amber-5);
52
+ --accent-6: var(--amber-6);
53
+ --accent-7: var(--amber-7);
54
+ --accent-8: var(--amber-8);
55
+ --accent-9: var(--amber-9);
56
+ --accent-10: var(--amber-10);
57
+ --accent-11: var(--amber-11);
58
+ --accent-12: var(--amber-12);
59
+ }
60
+
61
+ [data-accent-color="blue"] {
62
+ --accent-1: var(--blue-1);
63
+ --accent-2: var(--blue-2);
64
+ --accent-3: var(--blue-3);
65
+ --accent-4: var(--blue-4);
66
+ --accent-5: var(--blue-5);
67
+ --accent-6: var(--blue-6);
68
+ --accent-7: var(--blue-7);
69
+ --accent-8: var(--blue-8);
70
+ --accent-9: var(--blue-9);
71
+ --accent-10: var(--blue-10);
72
+ --accent-11: var(--blue-11);
73
+ --accent-12: var(--blue-12);
74
+ }
75
+
76
+ [data-accent-color="cyan"] {
77
+ --accent-1: var(--cyan-1);
78
+ --accent-2: var(--cyan-2);
79
+ --accent-3: var(--cyan-3);
80
+ --accent-4: var(--cyan-4);
81
+ --accent-5: var(--cyan-5);
82
+ --accent-6: var(--cyan-6);
83
+ --accent-7: var(--cyan-7);
84
+ --accent-8: var(--cyan-8);
85
+ --accent-9: var(--cyan-9);
86
+ --accent-10: var(--cyan-10);
87
+ --accent-11: var(--cyan-11);
88
+ --accent-12: var(--cyan-12);
89
+ }
90
+
91
+ [data-accent-color="grass"] {
92
+ --accent-1: var(--grass-1);
93
+ --accent-2: var(--grass-2);
94
+ --accent-3: var(--grass-3);
95
+ --accent-4: var(--grass-4);
96
+ --accent-5: var(--grass-5);
97
+ --accent-6: var(--grass-6);
98
+ --accent-7: var(--grass-7);
99
+ --accent-8: var(--grass-8);
100
+ --accent-9: var(--grass-9);
101
+ --accent-10: var(--grass-10);
102
+ --accent-11: var(--grass-11);
103
+ --accent-12: var(--grass-12);
104
+ }
105
+
106
+ [data-accent-color="lime"] {
107
+ --accent-1: var(--lime-1);
108
+ --accent-2: var(--lime-2);
109
+ --accent-3: var(--lime-3);
110
+ --accent-4: var(--lime-4);
111
+ --accent-5: var(--lime-5);
112
+ --accent-6: var(--lime-6);
113
+ --accent-7: var(--lime-7);
114
+ --accent-8: var(--lime-8);
115
+ --accent-9: var(--lime-9);
116
+ --accent-10: var(--lime-10);
117
+ --accent-11: var(--lime-11);
118
+ --accent-12: var(--lime-12);
119
+ }
120
+
121
+ [data-accent-color="mint"] {
122
+ --accent-1: var(--mint-1);
123
+ --accent-2: var(--mint-2);
124
+ --accent-3: var(--mint-3);
125
+ --accent-4: var(--mint-4);
126
+ --accent-5: var(--mint-5);
127
+ --accent-6: var(--mint-6);
128
+ --accent-7: var(--mint-7);
129
+ --accent-8: var(--mint-8);
130
+ --accent-9: var(--mint-9);
131
+ --accent-10: var(--mint-10);
132
+ --accent-11: var(--mint-11);
133
+ --accent-12: var(--mint-12);
134
+ }
135
+
136
+ [data-accent-color="purple"] {
137
+ --accent-1: var(--purple-1);
138
+ --accent-2: var(--purple-2);
139
+ --accent-3: var(--purple-3);
140
+ --accent-4: var(--purple-4);
141
+ --accent-5: var(--purple-5);
142
+ --accent-6: var(--purple-6);
143
+ --accent-7: var(--purple-7);
144
+ --accent-8: var(--purple-8);
145
+ --accent-9: var(--purple-9);
146
+ --accent-10: var(--purple-10);
147
+ --accent-11: var(--purple-11);
148
+ --accent-12: var(--purple-12);
149
+ }
150
+
151
+ [data-accent-color="sky"] {
152
+ --accent-1: var(--sky-1);
153
+ --accent-2: var(--sky-2);
154
+ --accent-3: var(--sky-3);
155
+ --accent-4: var(--sky-4);
156
+ --accent-5: var(--sky-5);
157
+ --accent-6: var(--sky-6);
158
+ --accent-7: var(--sky-7);
159
+ --accent-8: var(--sky-8);
160
+ --accent-9: var(--sky-9);
161
+ --accent-10: var(--sky-10);
162
+ --accent-11: var(--sky-11);
163
+ --accent-12: var(--sky-12);
164
+ }
165
+
166
+ [data-accent-color="slate"] {
167
+ --accent-1: var(--slate-1);
168
+ --accent-2: var(--slate-2);
169
+ --accent-3: var(--slate-3);
170
+ --accent-4: var(--slate-4);
171
+ --accent-5: var(--slate-5);
172
+ --accent-6: var(--slate-6);
173
+ --accent-7: var(--slate-7);
174
+ --accent-8: var(--slate-8);
175
+ --accent-9: var(--slate-9);
176
+ --accent-10: var(--slate-10);
177
+ --accent-11: var(--slate-11);
178
+ --accent-12: var(--slate-12);
179
+ }
180
+
181
+ [data-accent-color="teal"] {
182
+ --accent-1: var(--teal-1);
183
+ --accent-2: var(--teal-2);
184
+ --accent-3: var(--teal-3);
185
+ --accent-4: var(--teal-4);
186
+ --accent-5: var(--teal-5);
187
+ --accent-6: var(--teal-6);
188
+ --accent-7: var(--teal-7);
189
+ --accent-8: var(--teal-8);
190
+ --accent-9: var(--teal-9);
191
+ --accent-10: var(--teal-10);
192
+ --accent-11: var(--teal-11);
193
+ --accent-12: var(--teal-12);
194
+ }
195
+
196
+ [data-accent-color="tomato"] {
197
+ --accent-1: var(--tomato-1);
198
+ --accent-2: var(--tomato-2);
199
+ --accent-3: var(--tomato-3);
200
+ --accent-4: var(--tomato-4);
201
+ --accent-5: var(--tomato-5);
202
+ --accent-6: var(--tomato-6);
203
+ --accent-7: var(--tomato-7);
204
+ --accent-8: var(--tomato-8);
205
+ --accent-9: var(--tomato-9);
206
+ --accent-10: var(--tomato-10);
207
+ --accent-11: var(--tomato-11);
208
+ --accent-12: var(--tomato-12);
209
+ }
210
+
211
+ [data-accent-color="violet"] {
212
+ --accent-1: var(--violet-1);
213
+ --accent-2: var(--violet-2);
214
+ --accent-3: var(--violet-3);
215
+ --accent-4: var(--violet-4);
216
+ --accent-5: var(--violet-5);
217
+ --accent-6: var(--violet-6);
218
+ --accent-7: var(--violet-7);
219
+ --accent-8: var(--violet-8);
220
+ --accent-9: var(--violet-9);
221
+ --accent-10: var(--violet-10);
222
+ --accent-11: var(--violet-11);
223
+ --accent-12: var(--violet-12);
224
+ }
@@ -35,6 +35,12 @@ module Trek
35
35
  )
36
36
  end
37
37
 
38
+ def data_attributes
39
+ attributes = {}
40
+ attributes["accent-color"] = color if color
41
+ attributes.merge(data)
42
+ end
43
+
38
44
  def rendered_content
39
45
  safe_join([
40
46
  icon,
@@ -48,7 +54,7 @@ module Trek
48
54
  link_to rendered_content,
49
55
  href,
50
56
  class: classes,
51
- data: data,
57
+ data: data_attributes,
52
58
  rel: rel,
53
59
  target: target,
54
60
  title: title
@@ -57,7 +63,7 @@ module Trek
57
63
  link_to rendered_content,
58
64
  to,
59
65
  class: classes,
60
- data: data.merge(turbo_method: method),
66
+ data: data_attributes.merge(turbo_method: method),
61
67
  form: form,
62
68
  form_class: form_class,
63
69
  params: params
@@ -65,7 +71,7 @@ module Trek
65
71
  content_tag tag,
66
72
  rendered_content,
67
73
  class: classes,
68
- data:,
74
+ data: data_attributes,
69
75
  form:,
70
76
  type:,
71
77
  value:
@@ -1,4 +1,4 @@
1
- = link_to href, class: classes
1
+ = link_to href, class: classes, rel: rel, target: target
2
2
  - if icon
3
3
  = render Trek::IconComponent.new(icon, classnames: class_for("icon"))
4
4
  span(class=class_for("text")) = formatted_text
@@ -5,6 +5,8 @@ module Trek
5
5
  option :color, default: proc { :slate }
6
6
  option :href
7
7
  option :icon, optional: true
8
+ option :rel, optional: true
9
+ option :target, optional: true
8
10
  option :text
9
11
  option :allowed_to, default: -> { true }
10
12
 
@@ -2,8 +2,14 @@
2
2
 
3
3
  .root {
4
4
  align-items: center;
5
+ background-color: var(--accent-1);
6
+ bottom: 0;
5
7
  display: flex;
6
8
  max-width: 120rem;
9
+ padding: 4rem 0;
10
+ position: fixed;
11
+ width: 100%;
12
+ z-index: 1;
7
13
  }
8
14
 
9
15
  .buttons {
@@ -13,6 +13,7 @@
13
13
  border-radius: 0.2rem;
14
14
  color: var(--slate-8);
15
15
  display: flex;
16
+ flex-shrink: 0;
16
17
  height: 11.5rem;
17
18
  justify-content: center;
18
19
  margin-right: 2rem;
@@ -29,3 +30,10 @@
29
30
  .preview img {
30
31
  object-fit: contain;
31
32
  }
33
+
34
+ .actions {
35
+ align-items: flex-start;
36
+ display: flex;
37
+ flex-direction: column;
38
+ gap: 0.8rem;
39
+ }
@@ -10,12 +10,24 @@
10
10
  value: cached_data,
11
11
  id: nil,
12
12
  data: stimulus_target_hash("hiddenInput")
13
+ = form.hidden_field "remove_#{method_name}",
14
+ value: nil,
15
+ id: nil,
16
+ data: stimulus_target_hash("removeInput")
17
+
18
+ div(class=class_for("actions"))
19
+ = render Trek::ButtonComponent.new( \
20
+ tag: :label,
21
+ text: button_text,
22
+ size: :narrow,
23
+ )
24
+ = form.file_field method_name,
25
+ class: "sr-only",
26
+ data: file_field_data_attributes
13
27
 
14
- = render Trek::ButtonComponent.new( \
15
- tag: :label,
16
- text: button_text,
17
- size: :narrow,
18
- )
19
- = form.file_field method_name,
20
- class: "sr-only",
21
- data: file_field_data_attributes
28
+ - if image&.exists?
29
+ = render Trek::ButtonComponent.new( \
30
+ text: t("admin.actions.remove"),
31
+ size: :narrow,
32
+ data: remove_button_data_attributes,
33
+ )