lesli_view 1.1.7 → 1.1.8

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 (89) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/lesli_view/view.css +3122 -2430
  3. data/lib/lesli_view/charts/general/general.css +25 -0
  4. data/lib/lesli_view/charts/{general.html.erb → general/general.html.erb} +5 -5
  5. data/lib/lesli_view/components/header/header.css +33 -0
  6. data/lib/lesli_view/components/{header.html.erb → header/header.html.erb} +9 -9
  7. data/lib/lesli_view/components/panel/panel.css +49 -0
  8. data/lib/lesli_view/components/panel/panel.html.erb +55 -0
  9. data/lib/lesli_view/components/tabs/tabs.css +57 -0
  10. data/lib/lesli_view/components/{tabs.html.erb → tabs/tabs.html.erb} +9 -9
  11. data/lib/lesli_view/components/timeline/timeline.css +48 -0
  12. data/lib/lesli_view/components/timeline/timeline.html.erb +42 -0
  13. data/lib/lesli_view/components/{toolbar.css → toolbar/toolbar.css} +8 -5
  14. data/lib/lesli_view/components/{toolbar.html.erb → toolbar/toolbar.html.erb} +2 -2
  15. data/lib/lesli_view/elements/avatar/avatar.css +36 -0
  16. data/lib/lesli_view/elements/avatar/avatar.html.erb +7 -0
  17. data/lib/lesli_view/elements/avatar.rb +6 -6
  18. data/lib/lesli_view/elements/{button.css → button/button.css} +82 -82
  19. data/lib/lesli_view/elements/button.rb +1 -1
  20. data/lib/lesli_view/elements/empty/empty.css +25 -0
  21. data/lib/lesli_view/elements/{empty.html.erb → empty/empty.html.erb} +6 -6
  22. data/lib/lesli_view/elements/table/table-chart.css +9 -0
  23. data/lib/lesli_view/elements/{table-chart.html.erb → table/table-chart.html.erb} +2 -2
  24. data/lib/lesli_view/elements/{table.css → table/table.css} +17 -14
  25. data/lib/lesli_view/elements/{table.html.erb → table/table.html.erb} +1 -1
  26. data/lib/lesli_view/forms/builder.rb +1 -1
  27. data/lib/lesli_view/forms/form.css +26 -23
  28. data/lib/lesli_view/items/actions/actions.css +13 -0
  29. data/lib/lesli_view/items/{actions.html.erb → actions/actions.html.erb} +3 -3
  30. data/lib/lesli_view/items/activities/activities.css +5 -0
  31. data/lib/lesli_view/items/{activities.html.erb → activities/activities.html.erb} +1 -1
  32. data/lib/lesli_view/items/attachment/attachment.css +41 -0
  33. data/lib/lesli_view/items/attachment/attachment.html.erb +45 -0
  34. data/lib/lesli_view/items/attachments/attachments.css +33 -0
  35. data/lib/lesli_view/items/{attachments.html.erb → attachments/attachments.html.erb} +8 -8
  36. data/lib/lesli_view/items/discussion/discussion.css +17 -0
  37. data/lib/lesli_view/items/discussion/discussion.html.erb +12 -0
  38. data/lib/lesli_view/items/discussions/discussions.css +25 -0
  39. data/lib/lesli_view/items/{discussions.html.erb → discussions/discussions.html.erb} +7 -7
  40. data/lib/lesli_view/items/task/task.css +41 -0
  41. data/lib/lesli_view/items/{task.html.erb → task/task.html.erb} +6 -6
  42. data/lib/lesli_view/items/tasks/tasks.css +21 -0
  43. data/lib/lesli_view/items/{tasks.html.erb → tasks/tasks.html.erb} +5 -5
  44. data/lib/lesli_view/layout/container/container.css +13 -0
  45. data/lib/lesli_view/layout/{container.html.erb → container/container.html.erb} +2 -2
  46. data/lib/lesli_view/layout/navigation_sidebar/navigation_sidebar.css +68 -0
  47. data/lib/lesli_view/layout/navigation_sidebar/navigation_sidebar.html.erb +52 -0
  48. data/lib/lesli_view/partials/announcements/announcements.css +50 -0
  49. data/lib/lesli_view/partials/announcements/announcements.html.erb +23 -0
  50. data/lib/lesli_view/partials/announcements.rb +33 -0
  51. data/lib/lesli_view/partials/engine_spec/engine_spec.css +37 -0
  52. data/lib/lesli_view/partials/engine_spec/engine_spec.html.erb +38 -0
  53. data/lib/lesli_view/partials/error/error.css +38 -0
  54. data/lib/lesli_view/partials/error/error.html.erb +14 -0
  55. data/lib/lesli_view/partials/error.rb +24 -0
  56. data/lib/lesli_view/partials/header/header.css +54 -0
  57. data/lib/lesli_view/partials/header/header.html.erb +31 -0
  58. data/lib/lesli_view/partials/header.rb +22 -0
  59. data/lib/lesli_view/partials/notifications/notifications.css +38 -0
  60. data/lib/lesli_view/partials/notifications/notifications.html.erb +7 -0
  61. data/lib/lesli_view/partials/notifications.rb +28 -0
  62. data/lib/lesli_view/version.rb +2 -2
  63. data/lib/lesli_view/widgets/calendar/calendar.css +57 -0
  64. data/lib/lesli_view/widgets/calendar/calendar.html.erb +44 -0
  65. data/lib/lesli_view/widgets/chart/chart.css +21 -0
  66. data/lib/lesli_view/widgets/{chart.html.erb → chart/chart.html.erb} +5 -5
  67. data/lib/lesli_view/widgets/count/count.css +21 -0
  68. data/lib/lesli_view/widgets/count/count.html.erb +18 -0
  69. data/lib/lesli_view/widgets/date/date.css +29 -0
  70. data/lib/lesli_view/widgets/date/date.html.erb +24 -0
  71. data/lib/lesli_view/widgets/weather/weather.css +81 -0
  72. data/lib/lesli_view/widgets/weather/weather.html.erb +46 -0
  73. data/lib/lesli_view.rb +4 -0
  74. data/readme.md +1 -1
  75. metadata +68 -34
  76. data/lib/lesli_view/components/panel.html.erb +0 -55
  77. data/lib/lesli_view/components/timeline.html.erb +0 -42
  78. data/lib/lesli_view/elements/avatar.html.erb +0 -7
  79. data/lib/lesli_view/forms/form.scss +0 -35
  80. data/lib/lesli_view/items/attachment.html.erb +0 -45
  81. data/lib/lesli_view/items/discussion.html.erb +0 -12
  82. data/lib/lesli_view/layout/navigation_sidebar.css +0 -19
  83. data/lib/lesli_view/layout/navigation_sidebar.html.erb +0 -52
  84. data/lib/lesli_view/partials/engine_spec.html.erb +0 -38
  85. data/lib/lesli_view/widgets/calendar.html.erb +0 -44
  86. data/lib/lesli_view/widgets/count.html.erb +0 -18
  87. data/lib/lesli_view/widgets/date.html.erb +0 -24
  88. data/lib/lesli_view/widgets/weather.html.erb +0 -46
  89. /data/lib/lesli_view/elements/{button.html.erb → button/button.html.erb} +0 -0
@@ -0,0 +1,41 @@
1
+ @layer components {
2
+ .lesli-attachment {
3
+ @apply flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 rounded-xl border border-neutral-200 bg-white p-4;
4
+ }
5
+
6
+ .lesli-attachment-details {
7
+ @apply flex min-w-0 items-center gap-3;
8
+ }
9
+
10
+ .lesli-attachment-icon {
11
+ @apply shrink-0 text-3xl text-[var(--lesli-color-primary)];
12
+ }
13
+
14
+ .lesli-attachment-text {
15
+ @apply min-w-0;
16
+ }
17
+
18
+ .lesli-attachment-name {
19
+ @apply truncate text-sm font-medium text-neutral-900;
20
+ }
21
+
22
+ .lesli-attachment-metadata {
23
+ @apply mt-1 text-xs text-neutral-500;
24
+ }
25
+
26
+ .lesli-attachment-actions {
27
+ @apply flex shrink-0 items-center gap-2;
28
+ }
29
+
30
+ .lesli-attachment-download {
31
+ @apply inline-flex items-center gap-2 rounded-lg border border-neutral-300 px-3 py-2 text-sm font-medium text-neutral-700 transition-colors hover:border-neutral-400 hover:bg-neutral-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--lesli-color-primary)];
32
+ }
33
+
34
+ .lesli-attachment-remove {
35
+ @apply inline-flex items-center rounded-lg px-3 py-2 text-sm font-medium text-danger-600 transition-colors hover:bg-danger-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-danger-500/40;
36
+ }
37
+
38
+ .lesli-attachment-remove-form {
39
+ @apply inline-flex;
40
+ }
41
+ }
@@ -0,0 +1,45 @@
1
+ <li
2
+ id="<%= dom_id(resource) %>"
3
+ class="lesli-attachment">
4
+ <div class="lesli-attachment-details">
5
+ <span
6
+ class="material-symbols-outlined lesli-attachment-icon"
7
+ aria-hidden="true">
8
+ attach_file
9
+ </span>
10
+
11
+ <div class="lesli-attachment-text">
12
+ <p class="lesli-attachment-name" title="<%= filename %>">
13
+ <%= display_name %>
14
+ </p>
15
+ <p class="lesli-attachment-metadata">
16
+ <%= details %>
17
+ </p>
18
+ </div>
19
+ </div>
20
+
21
+ <div class="lesli-attachment-actions">
22
+ <%= link_to(
23
+ I18n.t("lesli.items.attachments_download", default: "Download"),
24
+ path,
25
+ class: "lesli-attachment-download",
26
+ data: { turbo: false }
27
+ ) %>
28
+
29
+ <%= button_to(
30
+ I18n.t("lesli.items.attachments_remove", default: "Remove"),
31
+ path,
32
+ method: :delete,
33
+ class: "lesli-attachment-remove",
34
+ form: {
35
+ class: "lesli-attachment-remove-form",
36
+ data: {
37
+ turbo_confirm: I18n.t(
38
+ "lesli.items.attachments_confirm_remove",
39
+ default: "Remove this file?"
40
+ )
41
+ }
42
+ }
43
+ ) %>
44
+ </div>
45
+ </li>
@@ -0,0 +1,33 @@
1
+ @layer components {
2
+ .lesli-items-attachments {
3
+ @apply rounded-2xl border border-neutral-200 bg-white p-6 shadow-sm;
4
+ }
5
+
6
+ .lesli-items-attachments-form {
7
+ @apply grid gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(12rem,0.35fr)_auto] lg:items-end;
8
+ }
9
+
10
+ .lesli-items-attachments-label {
11
+ @apply mb-2 block text-sm font-medium text-neutral-700;
12
+ }
13
+
14
+ .lesli-items-attachments-input {
15
+ @apply block w-full cursor-pointer rounded-lg border border-neutral-300 bg-white text-sm text-neutral-700 file:mr-4 file:border-0 file:bg-neutral-100 file:px-4 file:py-2.5 file:text-sm file:font-medium file:text-neutral-700 hover:file:bg-neutral-200 focus:outline-none focus:ring-2 focus:ring-[var(--lesli-color-primary)];
16
+ }
17
+
18
+ .lesli-items-attachments-error {
19
+ @apply mt-2 text-sm text-danger-600;
20
+ }
21
+
22
+ .lesli-items-attachments-divider {
23
+ @apply my-6 border-0 border-t border-neutral-200;
24
+ }
25
+
26
+ .lesli-items-attachments-list {
27
+ @apply m-0 list-none space-y-3 p-0;
28
+ }
29
+
30
+ .lesli-items-attachments-empty {
31
+ @apply py-6 text-center text-sm text-neutral-500;
32
+ }
33
+ }
@@ -30,7 +30,7 @@ Building a better future, one line of code at a time.
30
30
  // ·
31
31
  %>
32
32
  <article
33
- class="lesli-items-attachments rounded-2xl border border-slate-200 bg-white p-6 shadow-sm"
33
+ class="lesli-items-attachments"
34
34
  id="<%= dom_id(resource, :attachments) %>">
35
35
  <%= form_with(
36
36
  scope: scope_key,
@@ -39,21 +39,21 @@ Building a better future, one line of code at a time.
39
39
  url: create_path,
40
40
  multipart: true
41
41
  ) do |form| %>
42
- <div class="grid gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(12rem,0.35fr)_auto] lg:items-end">
42
+ <div class="lesli-items-attachments-form">
43
43
  <div>
44
44
  <%= form.label(
45
45
  :file,
46
46
  I18n.t("lesli.items.attachments_choose_file", default: "Choose a file"),
47
- class: "mb-2 block text-sm font-medium text-slate-700"
47
+ class: "lesli-items-attachments-label"
48
48
  ) %>
49
49
  <%= form.file_field(
50
50
  :file,
51
51
  required: true,
52
52
  accept: accepted_content_types,
53
- class: "block w-full cursor-pointer rounded-lg border border-slate-300 bg-white text-sm text-slate-700 file:mr-4 file:border-0 file:bg-slate-100 file:px-4 file:py-2.5 file:text-sm file:font-medium file:text-slate-700 hover:file:bg-slate-200 focus:outline-none focus:ring-2 focus:ring-[var(--lesli-color-primary)]"
53
+ class: "lesli-items-attachments-input"
54
54
  ) %>
55
55
  <% if attachment.errors[:file].any? %>
56
- <p class="mt-2 text-sm text-red-600">
56
+ <p class="lesli-items-attachments-error">
57
57
  <%= attachment.errors[:file].to_sentence %>
58
58
  </p>
59
59
  <% end %>
@@ -80,10 +80,10 @@ Building a better future, one line of code at a time.
80
80
  </div>
81
81
  <% end %>
82
82
 
83
- <hr class="my-6 border-0 border-t border-slate-200">
83
+ <hr class="lesli-items-attachments-divider">
84
84
 
85
85
  <% if attachments.any? %>
86
- <ul class="m-0 list-none space-y-3 p-0">
86
+ <ul class="lesli-items-attachments-list">
87
87
  <% attachments.each do |item| %>
88
88
  <%= render LesliView::Items::Attachment.new(
89
89
  item,
@@ -92,7 +92,7 @@ Building a better future, one line of code at a time.
92
92
  <% end %>
93
93
  </ul>
94
94
  <% else %>
95
- <p class="py-6 text-center text-sm text-slate-500">
95
+ <p class="lesli-items-attachments-empty">
96
96
  <%= I18n.t(
97
97
  "lesli.items.attachments_empty",
98
98
  default: "No files have been attached yet."
@@ -0,0 +1,17 @@
1
+ @layer components {
2
+ .lesli-discussion {
3
+ @apply flex flex-col gap-3 sm:flex-row sm:gap-4 border-b border-neutral-200 pb-6 last:border-b-0 last:pb-0;
4
+ }
5
+
6
+ .lesli-discussion-metadata {
7
+ @apply shrink-0 text-sm leading-5 text-neutral-500 sm:w-40 sm:text-right;
8
+ }
9
+
10
+ .lesli-discussion-author {
11
+ @apply block font-semibold text-neutral-800;
12
+ }
13
+
14
+ .lesli-discussion-message {
15
+ @apply min-w-0 flex-1 whitespace-pre-wrap break-words text-neutral-700;
16
+ }
17
+ }
@@ -0,0 +1,12 @@
1
+ <li class="lesli-items-discussions-comments-comment lesli-discussion">
2
+ <div class="lesli-discussion-metadata">
3
+ <strong class="lesli-discussion-author">
4
+ <%= author_name %>
5
+ </strong>
6
+ <time datetime="<%= created_at_iso8601 %>">
7
+ <%= created_at_label %>
8
+ </time>
9
+ </div>
10
+
11
+ <div class="lesli-discussion-message"><%= discussion.message %></div>
12
+ </li>
@@ -0,0 +1,25 @@
1
+ @layer components {
2
+ .lesli-items-discussions {
3
+ @apply p-4 sm:p-8 bg-white;
4
+ }
5
+
6
+ .lesli-items-discussions-form {
7
+ @apply p-4;
8
+ }
9
+
10
+ .lesli-items-discussions-error {
11
+ @apply mt-2 text-sm text-danger-600;
12
+ }
13
+
14
+ .lesli-items-discussions-divider {
15
+ @apply my-6 border-0 border-t border-neutral-200;
16
+ }
17
+
18
+ .lesli-items-discussions-list {
19
+ @apply m-0 list-none space-y-6 p-0;
20
+ }
21
+
22
+ .lesli-items-discussions-empty {
23
+ @apply py-6 text-center text-sm text-neutral-500;
24
+ }
25
+ }
@@ -30,9 +30,9 @@ Building a better future, one line of code at a time.
30
30
  // ·
31
31
  %>
32
32
  <article
33
- class="lesli-items-discussions bg-white p-4 sm:p-8"
33
+ class="lesli-items-discussions"
34
34
  id="<%= dom_id(resource, :discussions) %>">
35
- <div class="lesli-items-discussions-form p-4">
35
+ <div class="lesli-items-discussions-form lesli-items-discussions-form">
36
36
  <%= form_with(
37
37
  scope: scope_key,
38
38
  model: comment,
@@ -41,7 +41,7 @@ Building a better future, one line of code at a time.
41
41
  ) do |form| %>
42
42
  <%= form.field_control_textarea(:message, rows: 4) %>
43
43
  <% if comment.errors[:message].any? %>
44
- <p class="mt-2 text-sm text-red-600">
44
+ <p class="lesli-items-discussions-error">
45
45
  <%= comment.errors.full_messages_for(:message).to_sentence %>
46
46
  </p>
47
47
  <% end %>
@@ -51,19 +51,19 @@ Building a better future, one line of code at a time.
51
51
  ) %>
52
52
  <% end %>
53
53
  </div>
54
- <hr class="my-6 border-0 border-t border-slate-200">
54
+ <hr class="lesli-items-discussions-divider">
55
55
 
56
- <div class="lesli-items-discussions-container p-4">
56
+ <div class="lesli-items-discussions-container lesli-items-discussions-form">
57
57
  <% if discussions.any? %>
58
58
  <ul
59
59
  id="<%= "#{scope_key}-lesli-items-discussions-list" %>"
60
- class="m-0 list-none space-y-6 p-0">
60
+ class="lesli-items-discussions-list">
61
61
  <% discussions.each do |item| %>
62
62
  <%= render(LesliView::Items::Discussion.new(item)) %>
63
63
  <% end %>
64
64
  </ul>
65
65
  <% else %>
66
- <p class="py-6 text-center text-sm text-slate-500">
66
+ <p class="lesli-items-discussions-empty">
67
67
  <%= I18n.t(
68
68
  "lesli.items.discussions_empty",
69
69
  default: "No comments have been added yet."
@@ -0,0 +1,41 @@
1
+ @layer components {
2
+ .lesli-task {
3
+ @apply rounded-xl border transition-colors;
4
+ }
5
+
6
+ .lesli-task-done {
7
+ @apply border-neutral-200 bg-neutral-50 hover:border-neutral-300 hover:bg-neutral-100;
8
+ }
9
+
10
+ .lesli-task-pending {
11
+ @apply border-neutral-200 hover:border-neutral-300 hover:bg-neutral-50;
12
+ }
13
+
14
+ .lesli-task-button {
15
+ @apply flex w-full cursor-pointer items-center rounded-xl px-4 py-3 text-left text-sm font-medium text-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--lesli-color-primary)];
16
+ }
17
+
18
+ .lesli-task-content {
19
+ @apply flex min-w-0 items-center gap-3;
20
+ }
21
+
22
+ .lesli-task-icon {
23
+ @apply shrink-0 text-xl leading-none;
24
+ }
25
+
26
+ .lesli-task-done-icon {
27
+ @apply text-neutral-400;
28
+ }
29
+
30
+ .lesli-task-pending-icon {
31
+ @apply text-[var(--lesli-color-primary)];
32
+ }
33
+
34
+ .lesli-task-done-title {
35
+ @apply min-w-0 break-words text-neutral-500 line-through;
36
+ }
37
+
38
+ .lesli-task-title {
39
+ @apply min-w-0 break-words;
40
+ }
41
+ }
@@ -32,7 +32,7 @@ Building a better future, one line of code at a time.
32
32
 
33
33
  <li
34
34
  id="<%= dom_id(@resource, @scope_key) %>"
35
- class="lesli-items-tasks-item rounded-xl border transition-colors <%= @resource.done ? "lesli-items-tasks-task-done border-slate-200 bg-slate-50 hover:border-slate-300 hover:bg-slate-100" : "border-slate-200 hover:border-slate-300 hover:bg-slate-50" %>">
35
+ class="lesli-items-tasks-item lesli-task <%= @resource.done ? "lesli-items-tasks-task-done lesli-task-done" : "lesli-task-pending" %>">
36
36
  <%= form_with(
37
37
  url: helpers.polymorphic_path(@resource),
38
38
  method: :patch,
@@ -46,20 +46,20 @@ Building a better future, one line of code at a time.
46
46
  label: toggle_label,
47
47
  pressed: @resource.done?
48
48
  },
49
- class: "flex w-full cursor-pointer items-center rounded-xl px-4 py-3 text-left text-sm font-medium text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--lesli-color-primary)]"
49
+ class: "lesli-task-button"
50
50
  ) do %>
51
- <span class="flex min-w-0 items-center gap-3">
51
+ <span class="lesli-task-content">
52
52
  <span
53
- class="material-symbols-outlined shrink-0 text-xl leading-none <%= @resource.done ? "text-slate-400" : "text-[var(--lesli-color-primary)]" %>"
53
+ class="material-symbols-outlined lesli-task-icon <%= @resource.done ? "lesli-task-done-icon" : "lesli-task-pending-icon" %>"
54
54
  aria-hidden="true">
55
55
  <%= @resource.done ? "check_box" : "check_box_outline_blank" %>
56
56
  </span>
57
57
  <% if @resource.done? %>
58
- <del class="min-w-0 break-words text-slate-500 line-through">
58
+ <del class="lesli-task-done-title">
59
59
  <%= @resource.title %>
60
60
  </del>
61
61
  <% else %>
62
- <span class="min-w-0 break-words">
62
+ <span class="lesli-task-title">
63
63
  <%= @resource.title %>
64
64
  </span>
65
65
  <% end %>
@@ -0,0 +1,21 @@
1
+ @layer components {
2
+ .lesli-items-tasks {
3
+ @apply rounded-2xl border border-neutral-200 bg-white p-6 shadow-sm;
4
+ }
5
+
6
+ .lesli-items-tasks-error {
7
+ @apply mt-2 text-sm text-danger-600;
8
+ }
9
+
10
+ .lesli-items-tasks-divider {
11
+ @apply my-6 border-0 border-t border-neutral-200;
12
+ }
13
+
14
+ .lesli-items-tasks-list {
15
+ @apply m-0 list-none space-y-3 p-0;
16
+ }
17
+
18
+ .lesli-items-tasks-empty {
19
+ @apply py-6 text-center text-sm text-neutral-500;
20
+ }
21
+ }
@@ -30,7 +30,7 @@ Building a better future, one line of code at a time.
30
30
  // ·
31
31
  %>
32
32
  <article
33
- class="lesli-items-tasks rounded-2xl border border-slate-200 bg-white p-6 shadow-sm"
33
+ class="lesli-items-tasks"
34
34
  id="<%= dom_id(@resource, :tasks) %>">
35
35
  <div class="lesli-items-tasks-form">
36
36
  <%= form_with(
@@ -41,7 +41,7 @@ Building a better future, one line of code at a time.
41
41
  ) do |form| %>
42
42
  <%= form.field_control_text :title %>
43
43
  <% if task.errors[:title].any? %>
44
- <p class="mt-2 text-sm text-red-600">
44
+ <p class="lesli-items-tasks-error">
45
45
  <%= task.errors.full_messages_for(:title).to_sentence %>
46
46
  </p>
47
47
  <% end %>
@@ -51,19 +51,19 @@ Building a better future, one line of code at a time.
51
51
  ) %>
52
52
  <% end %>
53
53
  </div>
54
- <hr class="my-6 border-0 border-t border-slate-200">
54
+ <hr class="lesli-items-tasks-divider">
55
55
 
56
56
  <div class="lesli-items-tasks-container">
57
57
  <% if tasks.any? %>
58
58
  <ul
59
59
  id="<%= "#{scope_key}-lesli-items-tasks-list" %>"
60
- class="m-0 list-none space-y-3 p-0">
60
+ class="lesli-items-tasks-list">
61
61
  <% tasks.each do |item| %>
62
62
  <%= render(LesliView::Items::Task.new(item, scope_key)) %>
63
63
  <% end %>
64
64
  </ul>
65
65
  <% else %>
66
- <p class="py-6 text-center text-sm text-slate-500">
66
+ <p class="lesli-items-tasks-empty">
67
67
  <%= I18n.t(
68
68
  "lesli.items.tasks_empty",
69
69
  default: "No tasks have been added yet."
@@ -0,0 +1,13 @@
1
+ @layer components {
2
+ .lesli-container {
3
+ @apply mx-auto block w-full px-4 sm:px-6 lg:px-8;
4
+ }
5
+
6
+ .lesli-container-responsive {
7
+ @apply container;
8
+ }
9
+
10
+ .lesli-container-wide {
11
+ @apply max-w-7xl;
12
+ }
13
+ }
@@ -1,8 +1,8 @@
1
1
 
2
2
  <%
3
3
  container_class = class_names(
4
- "lesli-application-container mx-auto block w-full px-4 sm:px-6 lg:px-8",
5
- dashboard ? "container" : "max-w-7xl"
4
+ "lesli-application-container lesli-container",
5
+ dashboard ? "lesli-container-responsive" : "lesli-container-wide"
6
6
  )
7
7
  %>
8
8
 
@@ -0,0 +1,68 @@
1
+ @layer components {
2
+ .lesli-navigation-sidebar-link {
3
+ @apply flex min-h-11 items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/20;
4
+ }
5
+
6
+ .lesli-navigation-sidebar-active {
7
+ @apply bg-primary-soft text-primary-strong;
8
+ }
9
+
10
+ .lesli-navigation-sidebar-inactive {
11
+ @apply text-neutral-700 hover:bg-neutral-100;
12
+ }
13
+
14
+ .lesli-navigation-sidebar-icon {
15
+ @apply text-lg;
16
+ }
17
+
18
+ .lesli-navigation-sidebar-label {
19
+ @apply min-w-0 flex-1 truncate;
20
+ }
21
+
22
+ .lesli-navigation-sidebar-description {
23
+ @apply text-xs text-neutral-500;
24
+ }
25
+
26
+ .lesli-navigation-sidebar-mobile {
27
+ @apply block lg:hidden overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-sm;
28
+ }
29
+
30
+ .lesli-navigation-sidebar-summary {
31
+ @apply flex min-h-11 cursor-pointer list-none items-center justify-between gap-3 px-4 py-2.5 text-sm font-semibold text-neutral-700 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-inset focus-visible:ring-primary/20 [&::-webkit-details-marker]:hidden;
32
+ }
33
+
34
+ .lesli-navigation-sidebar-selected {
35
+ @apply flex min-w-0 items-center gap-3;
36
+ }
37
+
38
+ .lesli-navigation-sidebar-selected-icon {
39
+ @apply shrink-0 text-lg text-neutral-400;
40
+ }
41
+
42
+ .lesli-navigation-sidebar-selected-label {
43
+ @apply truncate;
44
+ }
45
+
46
+ .lesli-navigation-sidebar-chevron {
47
+ @apply shrink-0 text-xl text-neutral-400 transition-transform;
48
+ }
49
+
50
+ .lesli-navigation-sidebar-mobile-content {
51
+ @apply max-h-72 overflow-y-auto border-t border-neutral-200 p-2;
52
+ }
53
+
54
+ .lesli-navigation-sidebar-list {
55
+ @apply space-y-1;
56
+ }
57
+
58
+ .lesli-navigation-sidebar-desktop {
59
+ @apply hidden lg:block rounded-xl border border-neutral-200 bg-white p-3 shadow-sm lg:sticky lg:top-4 lg:w-60 lg:shrink-0;
60
+ }
61
+
62
+ .lesli-navigation-sidebar-heading {
63
+ @apply px-3 pb-2 text-xs font-semibold uppercase tracking-wide text-neutral-500;
64
+ }
65
+ .lesli-navigation-sidebar-mobile[open] .lesli-navigation-sidebar-chevron {
66
+ @apply rotate-180;
67
+ }
68
+ }
@@ -0,0 +1,52 @@
1
+ <%
2
+ selected_icon = items.find { |item| item[:selected] }&.dig(:icon) || "ri-folder-line"
3
+
4
+ navigation_items = capture do
5
+ items.each do |item|
6
+ selected = item[:selected]
7
+ %>
8
+ <li>
9
+ <%= link_to item[:path],
10
+ class: class_names(
11
+ "lesli-navigation-sidebar-link",
12
+ "lesli-navigation-sidebar-active" => selected,
13
+ "lesli-navigation-sidebar-inactive" => !selected
14
+ ),
15
+ aria: { current: ("page" if selected) },
16
+ data: { turbo_frame: "_top" } do %>
17
+ <span class="<%= item[:icon] || 'ri-folder-line' %> lesli-navigation-sidebar-icon" aria-hidden="true"></span>
18
+ <span class="lesli-navigation-sidebar-label"><%= item[:label] %></span>
19
+ <% if item[:count] %><span class="lesli-navigation-sidebar-description"><%= item[:count] %></span><% end %>
20
+ <% end %>
21
+ </li>
22
+ <%
23
+ end
24
+ end
25
+ %>
26
+
27
+ <details class="lesli-navigation-sidebar-mobile lesli-navigation-sidebar-mobile">
28
+ <summary
29
+ class="lesli-navigation-sidebar-summary"
30
+ aria-label="<%= selected_label %>">
31
+ <span class="lesli-navigation-sidebar-selected">
32
+ <span class="<%= selected_icon %> lesli-navigation-sidebar-selected-icon" aria-hidden="true"></span>
33
+ <span class="lesli-navigation-sidebar-selected-label"><%= selected_label %></span>
34
+ </span>
35
+ <span class="material-symbols lesli-navigation-sidebar-chevron" aria-hidden="true">expand_more</span>
36
+ </summary>
37
+
38
+ <nav class="lesli-navigation-sidebar-mobile-content" aria-label="<%= label %>">
39
+ <ul class="lesli-navigation-sidebar-list">
40
+ <%= navigation_items %>
41
+ </ul>
42
+ </nav>
43
+ </details>
44
+
45
+ <nav class="lesli-navigation-sidebar-desktop lesli-navigation-sidebar-desktop" aria-label="<%= label %>">
46
+ <p class="lesli-navigation-sidebar-heading">
47
+ <%= label %>
48
+ </p>
49
+ <ul class="lesli-navigation-sidebar-list">
50
+ <%= navigation_items %>
51
+ </ul>
52
+ </nav>
@@ -0,0 +1,50 @@
1
+ @layer components {
2
+ .lesli-announcements {
3
+ @apply mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8 mt-6 space-y-3;
4
+ }
5
+
6
+ .lesli-announcements-banner {
7
+ @apply flex items-center gap-3 rounded-lg border-2 p-4 shadow-sm;
8
+ }
9
+
10
+ .lesli-announcements-icon {
11
+ @apply shrink-0;
12
+ }
13
+
14
+ .lesli-announcements-content {
15
+ @apply min-w-0 flex-1;
16
+ }
17
+
18
+ .lesli-announcements-category {
19
+ @apply sr-only;
20
+ }
21
+
22
+ .lesli-announcements-message {
23
+ @apply whitespace-pre-wrap break-words font-medium;
24
+ }
25
+
26
+ .lesli-announcements-link {
27
+ @apply mt-2 inline-block rounded underline underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-2;
28
+ }
29
+
30
+ .lesli-announcements-dismiss {
31
+ @apply inline-flex h-10 w-10 shrink-0 items-center justify-center rounded hover:bg-black/5 focus-visible:outline-2 focus-visible:outline-offset-2;
32
+ }
33
+
34
+ .lesli-announcements-banner.is-info {
35
+ @apply border-info-300 bg-info-50 text-info-900;
36
+ }
37
+
38
+ .lesli-announcements-banner.is-success {
39
+ @apply border-success-300 bg-success-50 text-success-900;
40
+ }
41
+
42
+ .lesli-announcements-banner.is-warning {
43
+ @apply border-warning-300 bg-warning-50 text-warning-900;
44
+ }
45
+
46
+ .lesli-announcements-banner.is-danger {
47
+ @apply border-danger-300 bg-danger-50 text-danger-900;
48
+ }
49
+
50
+ }
@@ -0,0 +1,23 @@
1
+ <section id="application-lesli-announcements" class="lesli-announcements" aria-label="<%= label %>">
2
+ <% announcements.each do |announcement| %>
3
+ <% category = category_for(announcement) %>
4
+ <div id="announcement-<%= announcement.fetch(:id) %>" class="lesli-announcements-banner is-<%= category %>">
5
+ <span class="material-symbols lesli-announcements-icon" aria-hidden="true"><%= ICONS.fetch(category) %></span>
6
+ <div class="lesli-announcements-content">
7
+ <span class="lesli-announcements-category"><%= announcement.fetch(:category_label) %></span>
8
+ <p id="announcement-<%= announcement.fetch(:id) %>-message" class="lesli-announcements-message"><%= announcement.fetch(:message) %></p>
9
+ <% if announcement[:url].present? %>
10
+ <%= link_to link_label, announcement[:url],
11
+ class: "lesli-announcements-link", data: { turbo_frame: "_top" } %>
12
+ <% end %>
13
+ </div>
14
+ <% if announcement[:dismiss_url].present? %>
15
+ <%= button_to announcement[:dismiss_url], method: :post,
16
+ class: "lesli-announcements-dismiss",
17
+ aria: { label: dismiss_label, describedby: "announcement-#{announcement.fetch(:id)}-message" } do %>
18
+ <span class="material-symbols" aria-hidden="true">close</span>
19
+ <% end %>
20
+ <% end %>
21
+ </div>
22
+ <% end %>
23
+ </section>