okonomi_ui_kit 0.1.8 → 0.1.9

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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -3
  3. data/app/assets/builds/okonomi_ui_kit/application.tailwind.css +409 -187
  4. data/app/helpers/okonomi_ui_kit/application_helper.rb +8 -0
  5. data/app/helpers/okonomi_ui_kit/attribute_section_helper.rb +5 -5
  6. data/app/helpers/okonomi_ui_kit/component.rb +10 -6
  7. data/app/helpers/okonomi_ui_kit/components/alert.rb +1 -1
  8. data/app/helpers/okonomi_ui_kit/components/badge.rb +3 -3
  9. data/app/helpers/okonomi_ui_kit/components/breadcrumbs.rb +4 -4
  10. data/app/helpers/okonomi_ui_kit/components/button_base.rb +6 -6
  11. data/app/helpers/okonomi_ui_kit/components/button_tag.rb +3 -3
  12. data/app/helpers/okonomi_ui_kit/components/button_to.rb +3 -3
  13. data/app/helpers/okonomi_ui_kit/components/code.rb +41 -37
  14. data/app/helpers/okonomi_ui_kit/components/confirmation_modal.rb +130 -0
  15. data/app/helpers/okonomi_ui_kit/components/forms/check_box_with_label.rb +38 -0
  16. data/app/helpers/okonomi_ui_kit/components/forms/collection_select.rb +57 -0
  17. data/app/helpers/okonomi_ui_kit/components/forms/date_field.rb +9 -0
  18. data/app/helpers/okonomi_ui_kit/components/forms/datetime_local_field.rb +9 -0
  19. data/app/helpers/okonomi_ui_kit/components/forms/email_field.rb +9 -0
  20. data/app/helpers/okonomi_ui_kit/components/forms/field.rb +24 -0
  21. data/app/helpers/okonomi_ui_kit/components/forms/field_set.rb +17 -0
  22. data/app/helpers/okonomi_ui_kit/components/forms/input_base.rb +57 -0
  23. data/app/helpers/okonomi_ui_kit/components/forms/label.rb +27 -0
  24. data/app/helpers/okonomi_ui_kit/components/forms/multi_select.rb +18 -0
  25. data/app/helpers/okonomi_ui_kit/components/forms/number_field.rb +9 -0
  26. data/app/helpers/okonomi_ui_kit/components/forms/password_field.rb +9 -0
  27. data/app/helpers/okonomi_ui_kit/components/forms/search_field.rb +9 -0
  28. data/app/helpers/okonomi_ui_kit/components/forms/select.rb +57 -0
  29. data/app/helpers/okonomi_ui_kit/components/forms/show_if.rb +28 -0
  30. data/app/helpers/okonomi_ui_kit/components/forms/telephone_field.rb +9 -0
  31. data/app/helpers/okonomi_ui_kit/components/forms/text_area.rb +9 -0
  32. data/app/helpers/okonomi_ui_kit/components/forms/text_field.rb +9 -0
  33. data/app/helpers/okonomi_ui_kit/components/forms/time_field.rb +9 -0
  34. data/app/helpers/okonomi_ui_kit/components/forms/upload_field.rb +25 -0
  35. data/app/helpers/okonomi_ui_kit/components/forms/url_field.rb +9 -0
  36. data/app/helpers/okonomi_ui_kit/components/forms.rb +6 -0
  37. data/app/helpers/okonomi_ui_kit/components/icon.rb +6 -6
  38. data/app/helpers/okonomi_ui_kit/components/link_to.rb +7 -7
  39. data/app/helpers/okonomi_ui_kit/components/navigation.rb +98 -0
  40. data/app/helpers/okonomi_ui_kit/components/page.rb +7 -7
  41. data/app/helpers/okonomi_ui_kit/components/table.rb +7 -8
  42. data/app/helpers/okonomi_ui_kit/components/typography.rb +16 -16
  43. data/app/helpers/okonomi_ui_kit/components.rb +4 -0
  44. data/app/helpers/okonomi_ui_kit/configs.rb +4 -0
  45. data/app/helpers/okonomi_ui_kit/form_builder.rb +39 -130
  46. data/app/helpers/okonomi_ui_kit/form_component.rb +7 -0
  47. data/app/helpers/okonomi_ui_kit/svg_icons.rb +5 -5
  48. data/app/helpers/okonomi_ui_kit/t_w_merge.rb +33 -27
  49. data/app/helpers/okonomi_ui_kit/ui_helper.rb +17 -58
  50. data/app/views/okonomi/components/confirmation_modal/_confirmation_modal.html.erb +76 -0
  51. data/app/views/okonomi/components/forms/check_box_with_label/_check_box_with_label.html.erb +6 -0
  52. data/app/views/okonomi/components/forms/field/_field.html.erb +3 -0
  53. data/app/views/okonomi/components/forms/field_set/_field_set.html.erb +3 -0
  54. data/app/views/okonomi/components/forms/upload_field/_upload_field.html.erb +1 -0
  55. data/app/views/okonomi/components/navigation/_link.html.erb +18 -0
  56. data/app/views/okonomi/components/navigation/_navigation.html.erb +4 -0
  57. data/app/views/okonomi/forms/tailwind/_checkbox_label.html.erb +2 -2
  58. data/app/views/okonomi/forms/tailwind/_field.html.erb +6 -6
  59. data/app/views/okonomi/forms/tailwind/_multi_select.html.erb +2 -4
  60. data/app/views/okonomi/forms/tailwind/_upload_field.html.erb +10 -10
  61. data/config/importmap.rb +1 -1
  62. data/lib/okonomi_ui_kit/engine.rb +0 -1
  63. data/lib/okonomi_ui_kit/version.rb +1 -1
  64. metadata +36 -10
  65. data/app/helpers/okonomi_ui_kit/navigation_helper.rb +0 -72
  66. data/app/helpers/okonomi_ui_kit/theme.rb +0 -136
  67. data/app/helpers/okonomi_ui_kit/theme_helper.rb +0 -17
  68. data/app/views/okonomi/forms/tailwind/_field_set.html.erb +0 -3
  69. data/app/views/okonomi/modals/_confirmation_modal.html.erb +0 -77
  70. data/app/views/okonomi/navigation/_link.html.erb +0 -15
  71. data/app/views/okonomi/navigation/_menu.html.erb +0 -3
  72. data/app/views/okonomi/navigation/_navbar.html.erb +0 -105
@@ -5,11 +5,9 @@
5
5
  <% associated_class = association.klass %>
6
6
  <% associated_records = options[:collection] || associated_class.all %>
7
7
 
8
- <% p associated_records %>
9
-
10
- <div class="grid grid-cols-2 gap-2">
8
+ <div class="<%= component.style(:wrapper) %>">
11
9
  <% associated_records.each do |record| %>
12
- <div class="flex items-center">
10
+ <div class="<%= component.style(:item) %>">
13
11
  <% id = "#{method}_#{record.id}" %>
14
12
  <%= form.check_box_with_label method, { label: record.send(options[:label] || :name), multiple: true, id: id, checked: form.object.send(method).include?(record) }, record.id, nil %>
15
13
  </div>
@@ -1,24 +1,24 @@
1
1
  <div
2
2
  data-controller="upload"
3
3
  data-upload-target="dropzone"
4
- class="border-2 border-dashed border-gray-300 rounded-md p-6 text-center cursor-pointer hover:bg-gray-50 relative"
4
+ class="<%= component.style(:dropzone) %>"
5
5
  >
6
- <%= form.label method, class: "block cursor-pointer" do %>
7
- <div class="flex flex-col items-center text-gray-600 space-y-2">
8
- <div data-upload-target="preview" class="w-full flex justify-center items-center">
6
+ <%= form.label method, class: component.style(:label) do %>
7
+ <div class="<%= component.style(:content) %>">
8
+ <div data-upload-target="preview" class="<%= component.style(:preview) %>">
9
9
  <% if form.object.send(method).attached? %>
10
10
  <% blob = form.object.send(method).blob %>
11
11
  <% if blob.image? %>
12
- <%= image_tag url_for(blob), class: "max-h-32" %>
12
+ <%= image_tag url_for(blob), class: component.style(:preview_image) %>
13
13
  <% else %>
14
- <%= ui.icon("heroicons/solid/document", class: "size-12 text-gray-400") %>
14
+ <%= ui.icon("heroicons/solid/document", class: component.style(:icon)) %>
15
15
  <% end %>
16
16
  <% else %>
17
- <%= ui.icon("heroicons/solid/plus", class: "size-12 w-12 text-gray-400") %>
17
+ <%= ui.icon("heroicons/solid/plus", class: component.style(:icon)) %>
18
18
  <% end %>
19
19
  </div>
20
20
 
21
- <p class="text-sm text-gray-500" data-upload-target="filename">
21
+ <p class="<%= component.style(:filename) %>" data-upload-target="filename">
22
22
  <% if form.object.send(method).attached? %>
23
23
  <%= form.object.send(method).filename %>
24
24
  <% else %>
@@ -28,7 +28,7 @@
28
28
  </div>
29
29
 
30
30
  <%= form.file_field method,
31
- class: "hidden",
31
+ class: component.style(:file_input),
32
32
  data: {
33
33
  upload_target: "input",
34
34
  action: "change->upload#updatePreview"
@@ -39,7 +39,7 @@
39
39
 
40
40
  <button type="button"
41
41
  data-action="upload#clear"
42
- class="absolute top-2 right-2 bg-red-100 text-red-700 px-2 py-1 text-xs rounded hover:bg-red-200">
42
+ class="<%= component.style(:clear_button) %>">
43
43
  Clear
44
44
  </button>
45
45
  </div>
data/config/importmap.rb CHANGED
@@ -4,4 +4,4 @@ pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
4
4
  pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
5
5
 
6
6
  pin "okonomi_ui_kit", to: "okonomi_ui_kit/application.js", preload: true
7
- pin_all_from OkonomiUiKit::Engine.root.join("app/javascript/okonomi_ui_kit/controllers"), under: "controllers", to: "okonomi_ui_kit/controllers"
7
+ pin_all_from OkonomiUiKit::Engine.root.join("app/javascript/okonomi_ui_kit/controllers"), under: "controllers", to: "okonomi_ui_kit/controllers"
@@ -22,7 +22,6 @@ module OkonomiUiKit
22
22
  ActiveSupport.on_load(:action_view) do
23
23
  include OkonomiUiKit::ApplicationHelper
24
24
  include OkonomiUiKit::AttributeSectionHelper
25
- include OkonomiUiKit::NavigationHelper
26
25
  include OkonomiUiKit::UiHelper
27
26
 
28
27
  ActionView::Base.field_error_proc = ->(html_tag, _instance) { html_tag.html_safe }
@@ -1,3 +1,3 @@
1
1
  module OkonomiUiKit
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: okonomi_ui_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Okonomi GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-01 00:00:00.000000000 Z
11
+ date: 2025-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -1358,6 +1358,7 @@ files:
1358
1358
  - app/helpers/okonomi_ui_kit/application_helper.rb
1359
1359
  - app/helpers/okonomi_ui_kit/attribute_section_helper.rb
1360
1360
  - app/helpers/okonomi_ui_kit/component.rb
1361
+ - app/helpers/okonomi_ui_kit/components.rb
1361
1362
  - app/helpers/okonomi_ui_kit/components/alert.rb
1362
1363
  - app/helpers/okonomi_ui_kit/components/badge.rb
1363
1364
  - app/helpers/okonomi_ui_kit/components/breadcrumbs.rb
@@ -1365,18 +1366,41 @@ files:
1365
1366
  - app/helpers/okonomi_ui_kit/components/button_tag.rb
1366
1367
  - app/helpers/okonomi_ui_kit/components/button_to.rb
1367
1368
  - app/helpers/okonomi_ui_kit/components/code.rb
1369
+ - app/helpers/okonomi_ui_kit/components/confirmation_modal.rb
1370
+ - app/helpers/okonomi_ui_kit/components/forms.rb
1371
+ - app/helpers/okonomi_ui_kit/components/forms/check_box_with_label.rb
1372
+ - app/helpers/okonomi_ui_kit/components/forms/collection_select.rb
1373
+ - app/helpers/okonomi_ui_kit/components/forms/date_field.rb
1374
+ - app/helpers/okonomi_ui_kit/components/forms/datetime_local_field.rb
1375
+ - app/helpers/okonomi_ui_kit/components/forms/email_field.rb
1376
+ - app/helpers/okonomi_ui_kit/components/forms/field.rb
1377
+ - app/helpers/okonomi_ui_kit/components/forms/field_set.rb
1378
+ - app/helpers/okonomi_ui_kit/components/forms/input_base.rb
1379
+ - app/helpers/okonomi_ui_kit/components/forms/label.rb
1380
+ - app/helpers/okonomi_ui_kit/components/forms/multi_select.rb
1381
+ - app/helpers/okonomi_ui_kit/components/forms/number_field.rb
1382
+ - app/helpers/okonomi_ui_kit/components/forms/password_field.rb
1383
+ - app/helpers/okonomi_ui_kit/components/forms/search_field.rb
1384
+ - app/helpers/okonomi_ui_kit/components/forms/select.rb
1385
+ - app/helpers/okonomi_ui_kit/components/forms/show_if.rb
1386
+ - app/helpers/okonomi_ui_kit/components/forms/telephone_field.rb
1387
+ - app/helpers/okonomi_ui_kit/components/forms/text_area.rb
1388
+ - app/helpers/okonomi_ui_kit/components/forms/text_field.rb
1389
+ - app/helpers/okonomi_ui_kit/components/forms/time_field.rb
1390
+ - app/helpers/okonomi_ui_kit/components/forms/upload_field.rb
1391
+ - app/helpers/okonomi_ui_kit/components/forms/url_field.rb
1368
1392
  - app/helpers/okonomi_ui_kit/components/icon.rb
1369
1393
  - app/helpers/okonomi_ui_kit/components/link_to.rb
1394
+ - app/helpers/okonomi_ui_kit/components/navigation.rb
1370
1395
  - app/helpers/okonomi_ui_kit/components/page.rb
1371
1396
  - app/helpers/okonomi_ui_kit/components/table.rb
1372
1397
  - app/helpers/okonomi_ui_kit/components/typography.rb
1373
1398
  - app/helpers/okonomi_ui_kit/config.rb
1399
+ - app/helpers/okonomi_ui_kit/configs.rb
1374
1400
  - app/helpers/okonomi_ui_kit/form_builder.rb
1375
- - app/helpers/okonomi_ui_kit/navigation_helper.rb
1401
+ - app/helpers/okonomi_ui_kit/form_component.rb
1376
1402
  - app/helpers/okonomi_ui_kit/svg_icons.rb
1377
1403
  - app/helpers/okonomi_ui_kit/t_w_merge.rb
1378
- - app/helpers/okonomi_ui_kit/theme.rb
1379
- - app/helpers/okonomi_ui_kit/theme_helper.rb
1380
1404
  - app/helpers/okonomi_ui_kit/ui_helper.rb
1381
1405
  - app/javascript/okonomi_ui_kit/application.js
1382
1406
  - app/javascript/okonomi_ui_kit/controllers/dropdown_controller.js
@@ -1394,20 +1418,22 @@ files:
1394
1418
  - app/views/okonomi/components/alert/_alert.html.erb
1395
1419
  - app/views/okonomi/components/breadcrumbs/_breadcrumbs.html.erb
1396
1420
  - app/views/okonomi/components/code/_code.html.erb
1421
+ - app/views/okonomi/components/confirmation_modal/_confirmation_modal.html.erb
1422
+ - app/views/okonomi/components/forms/check_box_with_label/_check_box_with_label.html.erb
1423
+ - app/views/okonomi/components/forms/field/_field.html.erb
1424
+ - app/views/okonomi/components/forms/field_set/_field_set.html.erb
1425
+ - app/views/okonomi/components/forms/upload_field/_upload_field.html.erb
1397
1426
  - app/views/okonomi/components/icon/_icon.html.erb
1427
+ - app/views/okonomi/components/navigation/_link.html.erb
1428
+ - app/views/okonomi/components/navigation/_navigation.html.erb
1398
1429
  - app/views/okonomi/components/page/_page.html.erb
1399
1430
  - app/views/okonomi/components/table/_table.html.erb
1400
1431
  - app/views/okonomi/components/typography/_typography.html.erb
1401
1432
  - app/views/okonomi/forms/tailwind/_checkbox_label.html.erb
1402
1433
  - app/views/okonomi/forms/tailwind/_field.html.erb
1403
- - app/views/okonomi/forms/tailwind/_field_set.html.erb
1404
1434
  - app/views/okonomi/forms/tailwind/_multi_select.html.erb
1405
1435
  - app/views/okonomi/forms/tailwind/_radio_button.html.erb
1406
1436
  - app/views/okonomi/forms/tailwind/_upload_field.html.erb
1407
- - app/views/okonomi/modals/_confirmation_modal.html.erb
1408
- - app/views/okonomi/navigation/_link.html.erb
1409
- - app/views/okonomi/navigation/_menu.html.erb
1410
- - app/views/okonomi/navigation/_navbar.html.erb
1411
1437
  - app/views/okonomi/page_builder/_page.html.erb
1412
1438
  - app/views/okonomi/tables/_table.html.erb
1413
1439
  - config/importmap.rb
@@ -1,72 +0,0 @@
1
- module OkonomiUiKit
2
- module NavigationHelper
3
- def navigation_menu(**options, &block)
4
- builder = NavigationBuilder.new(self)
5
- render 'okonomi/navigation/menu', builder: builder, options: options, &block
6
- end
7
-
8
- class NavigationBuilder
9
- include ActionView::Helpers::TagHelper
10
- include ActionView::Helpers::CaptureHelper
11
-
12
- def initialize(template)
13
- @template = template
14
- end
15
-
16
- def group(title, &block)
17
- group_builder = NavigationGroupBuilder.new(@template)
18
- content = capture(group_builder, &block)
19
-
20
- tag.li do
21
- tag.div(title, class: "text-xs/6 font-semibold text-gray-400") +
22
- tag.ul(content, role: "list", class: "-mx-2 mt-2 space-y-1")
23
- end
24
- end
25
-
26
- def profile_section(&block)
27
- content = capture(&block)
28
- tag.li(content, class: "-mx-6 mt-auto")
29
- end
30
-
31
- private
32
-
33
- def tag
34
- @template.tag
35
- end
36
-
37
- def capture(*args, &block)
38
- @template.capture(*args, &block)
39
- end
40
- end
41
-
42
- class NavigationGroupBuilder
43
- include ActionView::Helpers::TagHelper
44
- include ActionView::Helpers::CaptureHelper
45
-
46
- def initialize(template)
47
- @template = template
48
- end
49
-
50
- def nav_link(title, path, icon: nil, initials: nil, exact: false)
51
- tag.li do
52
- @template.render "okonomi/navigation/link",
53
- path: path,
54
- title: title,
55
- icon: icon,
56
- initials: initials,
57
- exact: exact
58
- end
59
- end
60
-
61
- private
62
-
63
- def tag
64
- @template.tag
65
- end
66
-
67
- def capture(*args, &block)
68
- @template.capture(*args, &block)
69
- end
70
- end
71
- end
72
- end
@@ -1,136 +0,0 @@
1
- module OkonomiUiKit
2
- module Theme
3
- LIGHT_THEME = {
4
- components: {
5
- link: {
6
- root: "hover:cursor-pointer text-sm",
7
- outlined: {
8
- root: "inline-flex border items-center justify-center px-2 py-1 rounded-md font-medium focus:outline-none focus:ring-2 focus:ring-offset-2",
9
- colors: {
10
- default: "bg-white text-default-700 border-default-700 hover:bg-default-50",
11
- primary: "bg-white text-primary-600 border-primary-600 hover:bg-primary-50",
12
- secondary: "bg-white text-secondary-600 border-secondary-600 hover:bg-secondary-50",
13
- success: "bg-white text-success-600 border-success-600 hover:bg-success-50",
14
- danger: "bg-white text-danger-600 border-danger-600 hover:bg-danger-50",
15
- warning: "bg-white text-warning-600 border-warning-600 hover:bg-warning-50",
16
- info: "bg-white text-info-600 border-info-600 hover:bg-info-50"
17
- }
18
- },
19
- contained: {
20
- root: "inline-flex border items-center justify-center px-2 py-1 rounded-md font-medium focus:outline-none focus:ring-2 focus:ring-offset-2",
21
- colors: {
22
- default: "border-default-700 bg-default-600 text-white hover:bg-default-700",
23
- primary: "border-primary-700 bg-primary-600 text-white hover:bg-primary-700",
24
- secondary: "border-secondary-700 bg-secondary-600 text-white hover:bg-secondary-700",
25
- success: "border-success-700 bg-success-600 text-white hover:bg-success-700",
26
- danger: "border-danger-700 bg-danger-600 text-white hover:bg-danger-700",
27
- warning: "border-warning-700 bg-warning-600 text-white hover:bg-warning-700",
28
- info: "border-info-700 bg-info-600 text-white hover:bg-info-700"
29
- }
30
- },
31
- text: {
32
- root: "text-base",
33
- colors: {
34
- default: "text-default-700 hover:underline",
35
- primary: "text-primary-600 hover:underline",
36
- secondary: "text-secondary-600 hover:underline",
37
- success: "text-success-600 hover:underline",
38
- danger: "text-danger-600 hover:underline",
39
- warning: "text-warning-600 hover:underline",
40
- info: "text-info-600 hover:underline"
41
- }
42
- }
43
- },
44
- input: {
45
- types: {
46
- text: {
47
- root: "w-full border-0 px-3 py-2 rounded-md ring-1 focus:outline-none focus-within:ring-1",
48
- error: "bg-danger-100 text-danger-400 ring-danger-400 focus:ring-danger-600",
49
- valid: "text-default-700 ring-gray-300 focus-within:ring-gray-400",
50
- disabled: "disabled:bg-gray-50 disabled:cursor-not-allowed"
51
- }
52
- }
53
- },
54
- select: {
55
- root: "col-start-1 row-start-1 w-full appearance-none rounded-md py-2 pr-8 pl-3 text-base outline-1 focus:outline-none sm:text-sm/6",
56
- error: "bg-danger-100 text-danger-400 ring-1 ring-danger-400",
57
- valid: "bg-white outline-default-300 text-default-700",
58
- wrapper: "grid grid-cols-1",
59
- icon: {
60
- file: 'heroicons/solid/chevron-down',
61
- class: "pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500 sm:size-4"
62
- }
63
- },
64
- label: {
65
- root: "block text-sm/6 font-medium text-default-700"
66
- },
67
- checkbox: {
68
- wrapper: "flex gap-4 items-center",
69
- input: {
70
- root: "cursor-pointer size-5 rounded-sm border-gray-300 text-primary-600 focus:ring-0 focus:ring-primary-600"
71
- },
72
- label: {
73
- root: "cursor-pointer font-medium text-gray-700"
74
- },
75
- hint: {
76
- root: "cursor-pointer text-sm text-gray-400"
77
- }
78
- },
79
- modal: {
80
- backdrop: "fixed inset-0 bg-gray-500/75 transition-opacity duration-300 ease-out opacity-0",
81
- container: "fixed inset-0 z-10 w-screen overflow-y-auto",
82
- wrapper: "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",
83
- panel: {
84
- base: "relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all duration-300 ease-out sm:my-8 sm:w-full sm:p-6 opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
85
- sizes: {
86
- sm: "sm:max-w-sm",
87
- md: "sm:max-w-lg",
88
- lg: "sm:max-w-2xl",
89
- xl: "sm:max-w-4xl"
90
- }
91
- },
92
- close_button: {
93
- wrapper: "absolute top-0 right-0 hidden pt-4 pr-4 sm:block",
94
- button: "rounded-md bg-white text-gray-400 hover:text-gray-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-none",
95
- icon: {
96
- file: "heroicons/outline/x-mark",
97
- class: "size-6"
98
- }
99
- },
100
- icon: {
101
- wrapper: "mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",
102
- class: "size-6",
103
- variants: {
104
- warning: {
105
- wrapper: "bg-red-100",
106
- icon: "text-red-600",
107
- file: "heroicons/outline/exclamation-triangle"
108
- },
109
- info: {
110
- wrapper: "bg-blue-100",
111
- icon: "text-blue-600",
112
- file: "heroicons/outline/information-circle"
113
- },
114
- success: {
115
- wrapper: "bg-green-100",
116
- icon: "text-green-600",
117
- file: "heroicons/outline/check-circle"
118
- }
119
- }
120
- },
121
- content: {
122
- wrapper: "sm:flex sm:items-start",
123
- text_wrapper: "mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",
124
- title: "text-base font-semibold text-gray-900",
125
- message: "mt-2 text-sm text-gray-500"
126
- },
127
- actions: {
128
- wrapper: "mt-5 sm:mt-4 sm:flex sm:flex-row-reverse"
129
- }
130
- }
131
- }
132
- }
133
-
134
- DEFAULT_THEME = LIGHT_THEME
135
- end
136
- end
@@ -1,17 +0,0 @@
1
- module OkonomiUiKit
2
- module ThemeHelper
3
- def theme(t = {}, &block)
4
- old_theme = theme
5
-
6
- @_okonomi_ui_kit_theme = {}.merge(old_theme).merge(t || {})
7
-
8
- yield(@_okonomi_ui_kit_theme)
9
-
10
- @_okonomi_ui_kit_theme = old_theme
11
- end
12
-
13
- def get_theme
14
- @_okonomi_ui_kit_theme ||= OkonomiUiKit::Theme::DEFAULT_THEME
15
- end
16
- end
17
- end
@@ -1,3 +0,0 @@
1
- <div class="w-full flex flex-col gap-4 col-span-1 sm:col-span-3 md:col-span-5">
2
- <%= yield %>
3
- </div>
@@ -1,77 +0,0 @@
1
- <div data-controller="modal"
2
- data-modal-size-value="<%= options[:size] %>"
3
- <% if options[:auto_open] %>data-modal-auto-open-value="true"<% end %>
4
- class="relative z-10"
5
- style="display: none;"
6
- data-modal-target="container"
7
- <%= ui.modal_data_attributes(options) %>>
8
-
9
- <!-- Backdrop -->
10
- <div class="<%= ui.get_theme.dig(:components, :modal, :backdrop) %>"
11
- data-modal-target="backdrop"
12
- data-action="click->modal#close"
13
- aria-hidden="true"></div>
14
-
15
- <!-- Modal container -->
16
- <div class="<%= ui.get_theme.dig(:components, :modal, :container) %>">
17
- <div class="<%= ui.get_theme.dig(:components, :modal, :wrapper) %>">
18
- <!-- Modal panel -->
19
- <div class="<%= ui.modal_panel_class(options[:size]) %>"
20
- data-modal-target="panel"
21
- role="dialog"
22
- aria-modal="true"
23
- aria-labelledby="modal-title">
24
-
25
- <!-- Close button -->
26
- <div class="<%= ui.get_theme.dig(:components, :modal, :close_button, :wrapper) %>">
27
- <button type="button"
28
- class="<%= ui.get_theme.dig(:components, :modal, :close_button, :button) %>"
29
- data-action="click->modal#close">
30
- <span class="sr-only">Close</span>
31
- <%= ui.icon(ui.get_theme.dig(:components, :modal, :close_button, :icon, :file),
32
- class: ui.get_theme.dig(:components, :modal, :close_button, :icon, :class)) %>
33
- </button>
34
- </div>
35
-
36
- <!-- Content -->
37
- <div class="<%= ui.get_theme.dig(:components, :modal, :content, :wrapper) %>">
38
- <!-- Icon -->
39
- <div class="<%= ui.modal_icon_wrapper_class(options[:variant]) %>">
40
- <%= ui.icon(ui.get_theme.dig(:components, :modal, :icon, :variants, options[:variant], :file),
41
- class: [ui.get_theme.dig(:components, :modal, :icon, :class),
42
- ui.get_theme.dig(:components, :modal, :icon, :variants, options[:variant], :icon)].join(' ')) %>
43
- </div>
44
-
45
- <!-- Text content -->
46
- <div class="<%= ui.get_theme.dig(:components, :modal, :content, :text_wrapper) %>">
47
- <h3 id="modal-title" class="<%= ui.get_theme.dig(:components, :modal, :content, :title) %>">
48
- <%= options[:title] %>
49
- </h3>
50
- <div class="<%= ui.get_theme.dig(:components, :modal, :content, :message) %>">
51
- <p><%= options[:message] %></p>
52
- </div>
53
- </div>
54
- </div>
55
-
56
- <!-- Actions -->
57
- <div class="<%= ui.get_theme.dig(:components, :modal, :actions, :wrapper) %>">
58
- <% if options[:has_custom_actions] %>
59
- <%= yield %>
60
- <% else %>
61
- <% button_color = options[:variant] == :warning ? :danger : options[:variant] %>
62
- <button type="button"
63
- class="<%= ui.button_class(variant: :contained, color: button_color) %> sm:ml-3 sm:w-auto"
64
- data-action="click->modal#confirm">
65
- <%= options[:confirm_text] %>
66
- </button>
67
- <button type="button"
68
- class="<%= ui.button_class(variant: :outlined, color: :default) %> mt-3 sm:mt-0 sm:w-auto"
69
- data-action="click->modal#close">
70
- <%= options[:cancel_text] %>
71
- </button>
72
- <% end %>
73
- </div>
74
- </div>
75
- </div>
76
- </div>
77
- </div>
@@ -1,15 +0,0 @@
1
- <%
2
- options = {
3
- exact: defined?(exact) ? exact : false,
4
- class: "group flex gap-x-3 rounded-md p-2 text-sm/6 font-semibold hover:bg-gray-50 hover:text-primary-600 text-gray-700",
5
- active_class: "group flex gap-x-3 rounded-md p-2 text-sm/6 font-semibold hover:bg-gray-50 hover:text-primary-600 bg-gray-50 text-primary-600",
6
- }
7
- %>
8
- <%= active_link_to path, options do %>
9
- <% if defined?(initials) && initials.present? %>
10
- <span class="flex size-6 shrink-0 items-center justify-center rounded-lg border border-gray-200 bg-white text-[0.625rem] font-medium text-gray-400 group-hover:border-primary-600 group-hover:text-primary-600"><%= initials %></span>
11
- <% elsif defined?(icon) && icon.present? %>
12
- <%= ui.icon icon, class: "size-6 text-gray-400 group-hover:text-primary-600" %>
13
- <% end %>
14
- <%= title %>
15
- <% end %>
@@ -1,3 +0,0 @@
1
- <ul role="list" class="flex flex-1 flex-col gap-y-7">
2
- <%= yield(builder) %>
3
- </ul>
@@ -1,105 +0,0 @@
1
- <nav class="border-b border-gray-200 bg-white">
2
- <div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
3
- <div class="flex h-16 justify-between">
4
- <div class="flex">
5
- <div class="flex shrink-0 items-center">
6
- <img class="block h-8 w-auto lg:hidden" src="https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=primary&shade=600" alt="Your Company" />
7
- <img class="hidden h-8 w-auto lg:block" src="https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=primary&shade=600" alt="Your Company" />
8
- </div>
9
- <div class="hidden sm:-my-px sm:ml-6 sm:flex sm:space-x-8">
10
- <!-- Current: "border-primary-500 text-gray-900", Default: "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700" -->
11
- <a href="#" class="inline-flex items-center border-b-2 border-primary-500 px-1 pt-1 text-sm font-medium text-gray-900" aria-current="page">Dashboard</a>
12
- <a href="#" class="inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">Team</a>
13
- <a href="#" class="inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">Projects</a>
14
- <a href="#" class="inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">Calendar</a>
15
- </div>
16
- </div>
17
- <div class="hidden sm:ml-6 sm:flex sm:items-center">
18
- <button type="button" class="relative rounded-full bg-white p-1 text-gray-400 hover:text-gray-500 focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 focus:outline-hidden">
19
- <span class="absolute -inset-1.5"></span>
20
- <span class="sr-only">View notifications</span>
21
- <svg class="size-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
22
- <path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0" />
23
- </svg>
24
- </button>
25
-
26
- <!-- Profile dropdown -->
27
- <div class="relative ml-3">
28
- <div>
29
- <button type="button" class="relative flex max-w-xs items-center rounded-full bg-white text-sm focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2" id="user-menu-button" aria-expanded="false" aria-haspopup="true">
30
- <span class="absolute -inset-1.5"></span>
31
- <span class="sr-only">Open user menu</span>
32
- <img class="size-8 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="" />
33
- </button>
34
- </div>
35
-
36
- <!--
37
- Dropdown menu, show/hide based on menu state.
38
-
39
- Entering: "transition ease-out duration-200"
40
- From: "transform opacity-0 scale-95"
41
- To: "transform opacity-100 scale-100"
42
- Leaving: "transition ease-in duration-75"
43
- From: "transform opacity-100 scale-100"
44
- To: "transform opacity-0 scale-95"
45
- -->
46
- <div class="absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5 focus:outline-hidden" role="menu" aria-orientation="vertical" aria-labelledby="user-menu-button" tabindex="-1">
47
- <!-- Active: "bg-gray-100 outline-hidden", Not Active: "" -->
48
- <a href="#" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1" id="user-menu-item-0">Your Profile</a>
49
- <a href="#" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1" id="user-menu-item-1">Settings</a>
50
- <a href="#" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1" id="user-menu-item-2">Sign out</a>
51
- </div>
52
- </div>
53
- </div>
54
- <div class="-mr-2 flex items-center sm:hidden">
55
- <!-- Mobile menu button -->
56
- <button type="button" class="relative inline-flex items-center justify-center rounded-md bg-white p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 focus:outline-hidden" aria-controls="mobile-menu" aria-expanded="false">
57
- <span class="absolute -inset-0.5"></span>
58
- <span class="sr-only">Open main menu</span>
59
- <!-- Menu open: "hidden", Menu closed: "block" -->
60
- <svg class="block size-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
61
- <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
62
- </svg>
63
- <!-- Menu open: "block", Menu closed: "hidden" -->
64
- <svg class="hidden size-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
65
- <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
66
- </svg>
67
- </button>
68
- </div>
69
- </div>
70
- </div>
71
-
72
- <!-- Mobile menu, show/hide based on menu state. -->
73
- <div class="sm:hidden" id="mobile-menu">
74
- <div class="space-y-1 pt-2 pb-3">
75
- <!-- Current: "border-primary-500 bg-primary-50 text-primary-700", Default: "border-transparent text-gray-600 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800" -->
76
- <a href="#" class="block border-l-4 border-primary-500 bg-primary-50 py-2 pr-4 pl-3 text-base font-medium text-primary-700" aria-current="page">Dashboard</a>
77
- <a href="#" class="block border-l-4 border-transparent py-2 pr-4 pl-3 text-base font-medium text-gray-600 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800">Team</a>
78
- <a href="#" class="block border-l-4 border-transparent py-2 pr-4 pl-3 text-base font-medium text-gray-600 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800">Projects</a>
79
- <a href="#" class="block border-l-4 border-transparent py-2 pr-4 pl-3 text-base font-medium text-gray-600 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800">Calendar</a>
80
- </div>
81
- <div class="border-t border-gray-200 pt-4 pb-3">
82
- <div class="flex items-center px-4">
83
- <div class="shrink-0">
84
- <img class="size-10 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="" />
85
- </div>
86
- <div class="ml-3">
87
- <div class="text-base font-medium text-gray-800">Tom Cook</div>
88
- <div class="text-sm font-medium text-gray-500">tom@example.com</div>
89
- </div>
90
- <button type="button" class="relative ml-auto shrink-0 rounded-full bg-white p-1 text-gray-400 hover:text-gray-500 focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 focus:outline-hidden">
91
- <span class="absolute -inset-1.5"></span>
92
- <span class="sr-only">View notifications</span>
93
- <svg class="size-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
94
- <path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0" />
95
- </svg>
96
- </button>
97
- </div>
98
- <div class="mt-3 space-y-1">
99
- <a href="#" class="block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800">Your Profile</a>
100
- <a href="#" class="block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800">Settings</a>
101
- <a href="#" class="block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800">Sign out</a>
102
- </div>
103
- </div>
104
- </div>
105
- </nav>