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,25 @@
1
+ @layer components {
2
+ .lesli-chart {
3
+ @apply flex h-full min-w-0 flex-col;
4
+ }
5
+
6
+ .lesli-chart-header {
7
+ @apply mb-3;
8
+ }
9
+
10
+ .lesli-chart-heading {
11
+ @apply text-center text-xs font-medium text-neutral-500;
12
+ }
13
+
14
+ .lesli-chart-title {
15
+ @apply text-base font-semibold text-neutral-700;
16
+ }
17
+
18
+ .lesli-chart-subtitle {
19
+ @apply mt-1 text-sm leading-5 text-neutral-500;
20
+ }
21
+
22
+ .lesli-chart-canvas {
23
+ @apply min-w-0 flex-1;
24
+ }
25
+ }
@@ -1,26 +1,26 @@
1
1
  <div
2
- class="lesli-chart lesli-chart-<%= type %> flex h-full min-w-0 flex-col"
2
+ class="lesli-chart-<%= type %> lesli-chart"
3
3
  <% if title.present? %>aria-labelledby="<%= title_id %>"<% end %>>
4
4
 
5
5
  <% if title.present? || subtitle.present? %>
6
- <div class="mb-3">
6
+ <div class="lesli-chart-header">
7
7
  <% if title.present? %>
8
8
  <h3
9
9
  id="<%= title_id %>"
10
- class="<%= compact ? 'text-center text-xs font-medium text-slate-500' : 'text-base font-semibold text-slate-700' %>">
10
+ class="<%= compact ? 'lesli-chart-heading' : 'lesli-chart-title' %>">
11
11
  <%= title %>
12
12
  </h3>
13
13
  <% end %>
14
14
 
15
15
  <% if subtitle.present? %>
16
- <p class="mt-1 text-sm leading-5 text-slate-500"><%= subtitle %></p>
16
+ <p class="lesli-chart-subtitle"><%= subtitle %></p>
17
17
  <% end %>
18
18
  </div>
19
19
  <% end %>
20
20
 
21
21
  <div
22
22
  id="<%= id %>"
23
- class="min-w-0 flex-1"
23
+ class="lesli-chart-canvas"
24
24
  style="min-height: <%= height %>"></div>
25
25
  </div>
26
26
 
@@ -0,0 +1,33 @@
1
+ @layer components {
2
+ .lesli-header {
3
+ @apply mx-auto mt-16 mb-12 grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-5;
4
+ }
5
+
6
+ .lesli-header-text {
7
+ @apply min-w-0;
8
+ }
9
+
10
+ .lesli-header-heading {
11
+ @apply flex items-center gap-4;
12
+ }
13
+
14
+ .lesli-header-back {
15
+ @apply inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-2xl border border-primary bg-white text-primary-strong shadow-sm transition hover:bg-primary-soft hover:text-primary-strong focus:outline-none focus:ring-2 focus:ring-primary/30;
16
+ }
17
+
18
+ .lesli-header-back-icon {
19
+ @apply text-[26px] leading-none;
20
+ }
21
+
22
+ .lesli-header-title {
23
+ @apply text-3xl sm:text-4xl tracking-tight text-neutral-700;
24
+ }
25
+
26
+ .lesli-header-subtitle {
27
+ @apply text-sm leading-6 sm:text-base mt-2 max-w-2xl text-neutral-500;
28
+ }
29
+
30
+ .lesli-header-actions {
31
+ @apply flex flex-wrap items-start justify-self-end gap-3;
32
+ }
33
+ }
@@ -1,31 +1,31 @@
1
1
 
2
2
  <section
3
- class="mx-auto mt-16 mb-12 grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-5"
3
+ class="lesli-header"
4
4
  <% if title.present? %>aria-labelledby="<%= title_id %>"<% end %>>
5
5
 
6
- <div class="min-w-0">
7
- <div class="flex items-center gap-4">
6
+ <div class="lesli-header-text">
7
+ <div class="lesli-header-heading">
8
8
 
9
9
  <% if back? %>
10
10
  <%= link_to(
11
11
  back_path,
12
- class: "inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-2xl border border-sky-600 bg-white text-sky-700 shadow-sm transition hover:bg-sky-50 hover:text-sky-800 focus:outline-none focus:ring-2 focus:ring-sky-500/30",
12
+ class: "lesli-header-back",
13
13
  aria: { label: I18n.t("actions.back", default: "Go back") },
14
14
  data: { turbo_frame: "_top" }
15
15
  ) do %>
16
- <span class="material-symbols text-[26px] leading-none" aria-hidden="true">arrow_back</span>
16
+ <span class="material-symbols lesli-header-back-icon" aria-hidden="true">arrow_back</span>
17
17
  <% end %>
18
18
  <% end %>
19
19
 
20
- <div class="min-w-0">
20
+ <div class="lesli-header-text">
21
21
  <% if title.present? %>
22
- <h1 id="<%= title_id %>" class="text-3xl tracking-tight text-slate-700 sm:text-4xl">
22
+ <h1 id="<%= title_id %>" class="lesli-header-title">
23
23
  <%= title %>
24
24
  </h1>
25
25
  <% end %>
26
26
 
27
27
  <% if subtitle.present? %>
28
- <p class="mt-2 max-w-2xl text-sm leading-6 text-slate-500 sm:text-base">
28
+ <p class="lesli-header-subtitle">
29
29
  <%= subtitle %>
30
30
  </p>
31
31
  <% end %>
@@ -36,7 +36,7 @@
36
36
 
37
37
  <% if actions? %>
38
38
  <div
39
- class="flex flex-wrap items-start justify-self-end gap-3"
39
+ class="lesli-header-actions"
40
40
  role="group"
41
41
  aria-label="<%= I18n.t('actions.label', default: 'Page actions') %>">
42
42
  <% if new_path.present? %>
@@ -0,0 +1,49 @@
1
+ @layer components {
2
+ .lesli-panel {
3
+ @apply relative z-50;
4
+ }
5
+
6
+ .lesli-panel-overlay {
7
+ @apply fixed inset-0 z-40 bg-neutral-900/25;
8
+ }
9
+
10
+ .lesli-panel-dialog {
11
+ @apply fixed inset-y-0 right-0 z-50 flex h-dvh max-h-dvh w-full flex-col overflow-y-auto overscroll-contain bg-white shadow-2xl sm:max-w-2xl lg:max-w-3xl;
12
+ }
13
+
14
+ .lesli-panel-entering {
15
+ @apply transform transition ease-out duration-150;
16
+ }
17
+
18
+ .lesli-panel-hidden {
19
+ @apply translate-x-8 opacity-0;
20
+ }
21
+
22
+ .lesli-panel-visible {
23
+ @apply translate-x-0 opacity-100;
24
+ }
25
+
26
+ .lesli-panel-leaving {
27
+ @apply transform transition ease-in duration-100;
28
+ }
29
+
30
+ .lesli-panel-header {
31
+ @apply px-4 py-3 sm:px-6 sticky top-0 z-10 flex items-center justify-between gap-4 border-b border-neutral-200 bg-white;
32
+ }
33
+
34
+ .lesli-panel-title {
35
+ @apply min-w-0 truncate text-lg font-semibold text-neutral-900;
36
+ }
37
+
38
+ .lesli-panel-close {
39
+ @apply inline-flex size-11 shrink-0 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-neutral-100 hover:text-neutral-700 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/20;
40
+ }
41
+
42
+ .lesli-panel-icon {
43
+ @apply text-xl leading-none;
44
+ }
45
+
46
+ .lesli-panel-content {
47
+ @apply p-4 sm:p-6 min-w-0 flex-1;
48
+ }
49
+ }
@@ -0,0 +1,55 @@
1
+
2
+ <%
3
+ panel_title_id = "#{id}-title"
4
+ attributes = {
5
+ id: "#{id}-panel",
6
+ class: "lesli-panel",
7
+ "x-data": "{ open: false, trigger: null, openPanel() { this.trigger = document.activeElement; this.open = true; this.$nextTick(() => this.$refs.closeButton.focus()) }, closePanel() { this.open = false; this.$nextTick(() => this.trigger?.focus()) } }",
8
+ "x-cloak": true,
9
+ "@#{id}.window": "openPanel()",
10
+ "@keydown.escape.window": "if (open) closePanel()"
11
+ }
12
+ %>
13
+
14
+ <%= content_tag(:section, **attributes) do %>
15
+ <% if overlay %>
16
+ <div
17
+ class="lesli-panel-overlay"
18
+ aria-hidden="true"
19
+ x-show="open"
20
+ x-transition.opacity
21
+ @click="closePanel()">
22
+ </div>
23
+ <% end %>
24
+
25
+ <div
26
+ class="lesli-panel-dialog"
27
+ role="dialog"
28
+ aria-modal="<%= overlay %>"
29
+ aria-labelledby="<%= panel_title_id %>"
30
+ x-show="open"
31
+ x-transition:enter="lesli-panel-entering"
32
+ x-transition:enter-start="lesli-panel-hidden"
33
+ x-transition:enter-end="lesli-panel-visible"
34
+ x-transition:leave="lesli-panel-leaving"
35
+ x-transition:leave-start="lesli-panel-visible"
36
+ x-transition:leave-end="lesli-panel-hidden">
37
+ <div class="lesli-panel-header">
38
+ <h2 id="<%= panel_title_id %>" class="lesli-panel-title">
39
+ <%= title %>
40
+ </h2>
41
+ <button
42
+ type="button"
43
+ class="lesli-panel-close"
44
+ aria-label="Close panel"
45
+ x-ref="closeButton"
46
+ @click="closePanel()">
47
+ <span class="material-symbols lesli-panel-icon" aria-hidden="true">arrow_forward_ios</span>
48
+ </button>
49
+ </div>
50
+
51
+ <div class="lesli-panel-content">
52
+ <%= content %>
53
+ </div>
54
+ </div>
55
+ <% end %>
@@ -0,0 +1,57 @@
1
+ @layer components {
2
+ .lesli-tabs {
3
+ @apply min-w-0;
4
+ }
5
+
6
+ .lesli-tabs-vertical {
7
+ @apply flex items-start gap-6;
8
+ }
9
+
10
+ .lesli-tabs-vertical-navigation {
11
+ @apply w-48 shrink-0;
12
+ }
13
+
14
+ .lesli-tabs-horizontal-navigation {
15
+ @apply overflow-x-auto;
16
+ }
17
+
18
+ .lesli-tabs-vertical-list {
19
+ @apply flex w-full flex-col border-r border-neutral-200;
20
+ }
21
+
22
+ .lesli-tabs-horizontal-list {
23
+ @apply flex min-w-max border-b border-neutral-200;
24
+ }
25
+
26
+ .lesli-tabs-tab {
27
+ @apply inline-flex min-h-11 cursor-pointer items-center gap-2 whitespace-nowrap px-4 py-2.5 text-sm font-medium transition-colors duration-150 focus:outline-none focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset;
28
+ }
29
+
30
+ .lesli-tabs-vertical-tab {
31
+ @apply -mr-px w-full border-r-2 text-left;
32
+ }
33
+
34
+ .lesli-tabs-horizontal-tab {
35
+ @apply -mb-px justify-center border-b-2;
36
+ }
37
+
38
+ .lesli-tabs-active {
39
+ @apply border-primary text-primary-strong;
40
+ }
41
+
42
+ .lesli-tabs-inactive {
43
+ @apply border-transparent text-neutral-500 hover:text-neutral-700;
44
+ }
45
+
46
+ .lesli-tabs-icon {
47
+ @apply text-xl leading-none;
48
+ }
49
+
50
+ .lesli-tabs-content {
51
+ @apply min-w-0 flex-1;
52
+ }
53
+
54
+ .lesli-tabs-horizontal-content {
55
+ @apply pt-5;
56
+ }
57
+ }
@@ -2,7 +2,7 @@
2
2
  <% initial_tab = active_tab.presence || tabs.first&.tab_id %>
3
3
 
4
4
  <div
5
- class="lesli-tabs min-w-0<%= " flex items-start gap-6" if vertical %>"
5
+ class="lesli-tabs<%= " lesli-tabs-vertical" if vertical %>"
6
6
  x-data="{
7
7
  activeTab: '<%= j(initial_tab.to_s) %>',
8
8
  focusTab(event, offset) {
@@ -15,24 +15,24 @@
15
15
  }
16
16
  }">
17
17
 
18
- <div class="<%= vertical ? "w-48 shrink-0" : "overflow-x-auto" %>">
18
+ <div class="<%= vertical ? "lesli-tabs-vertical-navigation" : "lesli-tabs-horizontal-navigation" %>">
19
19
  <div
20
- class="<%= vertical ? "flex w-full flex-col border-r border-slate-200" : "flex min-w-max border-b border-slate-200" %>"
20
+ class="<%= vertical ? "lesli-tabs-vertical-list" : "lesli-tabs-horizontal-list" %>"
21
21
  role="tablist"
22
22
  aria-orientation="<%= vertical ? "vertical" : "horizontal" %>">
23
23
 
24
24
  <% tabs.each do |tab| %>
25
25
  <button
26
26
  id="<%= tab.tab_id %>-tab"
27
- class="inline-flex min-h-11 cursor-pointer items-center gap-2 whitespace-nowrap px-4 py-2.5 text-sm font-medium transition-colors duration-150 focus:outline-none focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-inset <%= vertical ? "-mr-px w-full border-r-2 text-left" : "-mb-px justify-center border-b-2" %>"
27
+ class="lesli-tabs-tab <%= vertical ? "lesli-tabs-vertical-tab" : "lesli-tabs-horizontal-tab" %>"
28
28
  type="button"
29
29
  role="tab"
30
30
  aria-controls="<%= tab.tab_id %>"
31
31
  :aria-selected="activeTab === '<%= j(tab.tab_id) %>'"
32
32
  :tabindex="activeTab === '<%= j(tab.tab_id) %>' ? 0 : -1"
33
33
  :class="{
34
- 'border-blue-600 text-blue-700': activeTab === '<%= j(tab.tab_id) %>',
35
- 'border-transparent text-slate-500 hover:text-slate-700': activeTab !== '<%= j(tab.tab_id) %>'
34
+ 'lesli-tabs-active': activeTab === '<%= j(tab.tab_id) %>',
35
+ 'lesli-tabs-inactive': activeTab !== '<%= j(tab.tab_id) %>'
36
36
  }"
37
37
  @click="activeTab = '<%= j(tab.tab_id) %>'"
38
38
  @keydown.right.prevent="focusTab($event, 1)"
@@ -41,7 +41,7 @@
41
41
  @keydown.up.prevent="focusTab($event, -1)">
42
42
 
43
43
  <% if tab.icon %>
44
- <span class="material-symbols-outlined text-xl leading-none" aria-hidden="true">
44
+ <span class="material-symbols-outlined lesli-tabs-icon" aria-hidden="true">
45
45
  <%= tab.icon %>
46
46
  </span>
47
47
  <% end %>
@@ -52,11 +52,11 @@
52
52
  </div>
53
53
  </div>
54
54
 
55
- <div class="min-w-0 flex-1<%= " pt-5" unless vertical %>">
55
+ <div class="lesli-tabs-content<%= " lesli-tabs-horizontal-content" unless vertical %>">
56
56
  <% tabs.each do |tab| %>
57
57
  <div
58
58
  id="<%= tab.tab_id %>"
59
- class="min-w-0"
59
+ class="lesli-tabs"
60
60
  role="tabpanel"
61
61
  aria-labelledby="<%= tab.tab_id %>-tab"
62
62
  tabindex="0"
@@ -0,0 +1,48 @@
1
+ @layer components {
2
+ .lesli-timeline {
3
+ @apply py-6;
4
+ }
5
+
6
+ .lesli-timeline-list {
7
+ @apply m-0 w-full list-none p-0;
8
+ }
9
+
10
+ .lesli-timeline-entry {
11
+ @apply grid grid-cols-[1.5rem_minmax(0,1fr)] gap-x-4 md:grid-cols-[minmax(8rem,auto)_1.5rem_minmax(0,1fr)] md:gap-x-6;
12
+ }
13
+
14
+ .lesli-timeline-date {
15
+ @apply col-start-2 mb-2 md:col-start-1 md:row-start-1 md:mb-0 md:pt-1 md:text-right min-w-0 text-xs font-bold uppercase tracking-[0.2em] text-neutral-500;
16
+ }
17
+
18
+ .lesli-timeline-actor {
19
+ @apply mt-1 block font-normal normal-case tracking-normal text-neutral-400;
20
+ }
21
+
22
+ .lesli-timeline-marker {
23
+ @apply col-start-1 row-span-2 row-start-1 md:col-start-2 relative flex justify-center;
24
+ }
25
+
26
+ .lesli-timeline-icon {
27
+ @apply relative z-10 bg-white text-xl leading-none text-[var(--lesli-color-primary)];
28
+ }
29
+
30
+ .lesli-timeline-connector {
31
+ @apply absolute top-7 bottom-0 left-1/2 w-px -translate-x-1/2 bg-neutral-300;
32
+ }
33
+
34
+ .lesli-timeline-content {
35
+ @apply col-start-2 row-start-2 md:col-start-3 md:row-start-1 min-w-0 pb-10;
36
+ }
37
+
38
+ .lesli-timeline-title {
39
+ @apply text-base font-semibold text-neutral-800;
40
+ }
41
+
42
+ .lesli-timeline-description {
43
+ @apply mt-1 text-sm leading-6 text-neutral-600;
44
+ }
45
+ .lesli-timeline-entry:last-child .lesli-timeline-connector {
46
+ @apply hidden;
47
+ }
48
+ }
@@ -0,0 +1,42 @@
1
+ <div class="lesli-timelines lesli-timeline">
2
+ <% if activities.any? %>
3
+ <ul class="lesli-timeline-list">
4
+ <% activities.each do |activity| %>
5
+ <li class="lesli-timeline-entry">
6
+ <div class="lesli-timeline-date">
7
+ <time><%= activity["date"] %></time>
8
+
9
+ <% if activity["actor"].present? %>
10
+ <span class="lesli-timeline-actor">
11
+ <%= activity["actor"] %>
12
+ </span>
13
+ <% end %>
14
+ </div>
15
+
16
+ <div class="lesli-timeline-marker">
17
+ <span
18
+ class="material-symbols-outlined lesli-timeline-icon"
19
+ aria-hidden="true">
20
+ <%= icon_for(activity) %>
21
+ </span>
22
+ <span class="lesli-timeline-connector" aria-hidden="true"></span>
23
+ </div>
24
+
25
+ <div class="lesli-timeline-content">
26
+ <h6 class="lesli-timeline-title">
27
+ <%= activity["operation"] %>
28
+ </h6>
29
+
30
+ <% if activity["description"].present? %>
31
+ <p class="lesli-timeline-description">
32
+ <%= activity["description"] %>
33
+ </p>
34
+ <% end %>
35
+ </div>
36
+ </li>
37
+ <% end %>
38
+ </ul>
39
+ <% else %>
40
+ <%= render LesliView::Elements::Empty.new(text: empty_text) %>
41
+ <% end %>
42
+ </div>
@@ -14,11 +14,11 @@
14
14
  }
15
15
 
16
16
  .lesli-toolbar__input {
17
- @apply block h-10 w-full rounded-lg border border-slate-300 bg-white py-2 pl-10 pr-10 text-sm text-slate-900 outline-none transition placeholder:text-slate-400 hover:border-slate-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/10;
17
+ @apply block h-10 w-full rounded-lg border border-neutral-300 bg-white py-2 pl-10 pr-10 text-sm text-neutral-900 outline-none transition placeholder:text-neutral-400 hover:border-neutral-400 focus:border-primary focus:ring-2 focus:ring-primary/10;
18
18
  }
19
19
 
20
20
  .lesli-toolbar__search-icon {
21
- @apply pointer-events-none absolute inset-y-0 left-3 flex items-center text-slate-400;
21
+ @apply pointer-events-none absolute inset-y-0 left-3 flex items-center text-neutral-400;
22
22
  }
23
23
 
24
24
  .lesli-toolbar__search-icon .material-symbols {
@@ -26,7 +26,7 @@
26
26
  }
27
27
 
28
28
  .lesli-toolbar__clear {
29
- @apply absolute right-1.5 top-1/2 inline-flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md text-slate-400 transition hover:bg-slate-100 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-500/30;
29
+ @apply absolute right-1.5 top-1/2 inline-flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md text-neutral-400 transition hover:bg-neutral-100 hover:text-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30;
30
30
  }
31
31
 
32
32
  .lesli-toolbar__clear .material-symbols {
@@ -39,11 +39,11 @@
39
39
 
40
40
  .lesli-toolbar__filters select,
41
41
  .lesli-toolbar__filters input {
42
- @apply h-10 min-w-0 max-w-full rounded-lg border border-slate-300 bg-white px-3 text-sm text-slate-700 outline-none transition hover:border-slate-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/10;
42
+ @apply h-10 min-w-0 max-w-full rounded-lg border border-neutral-300 bg-white px-3 text-sm text-neutral-700 outline-none transition hover:border-neutral-400 focus:border-primary focus:ring-2 focus:ring-primary/10;
43
43
  }
44
44
 
45
45
  .lesli-toolbar__submit {
46
- @apply inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-slate-300 bg-white text-slate-500 transition hover:border-sky-300 hover:bg-sky-50 hover:text-sky-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-500/20;
46
+ @apply inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-neutral-300 bg-white text-neutral-500 transition hover:border-primary-muted hover:bg-primary-soft hover:text-primary-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/20;
47
47
  }
48
48
 
49
49
  .lesli-toolbar__submit .material-symbols {
@@ -53,4 +53,7 @@
53
53
  .lesli-toolbar__actions {
54
54
  @apply ml-auto flex max-w-full flex-wrap items-center justify-end gap-2;
55
55
  }
56
+ .lesli-toolbar-accessible-label {
57
+ @apply sr-only;
58
+ }
56
59
  }
@@ -1,7 +1,7 @@
1
1
  <section class="lesli-toolbar" aria-label="<%= search_label %>">
2
2
  <%= form_with(url: form_url, method: :get, local: true, class: "lesli-toolbar__form", role: "search") do %>
3
3
  <div class="lesli-toolbar__search">
4
- <%= label_tag(search_name, search_label, class: "sr-only") %>
4
+ <%= label_tag(search_name, search_label, class: "lesli-toolbar-accessible-label") %>
5
5
 
6
6
  <span class="lesli-toolbar__search-icon" aria-hidden="true">
7
7
  <span class="material-symbols">search</span>
@@ -30,7 +30,7 @@
30
30
 
31
31
  <button class="lesli-toolbar__submit" type="submit">
32
32
  <span class="material-symbols" aria-hidden="true">search</span>
33
- <span class="sr-only"><%= search_label %></span>
33
+ <span class="lesli-toolbar-accessible-label"><%= search_label %></span>
34
34
  </button>
35
35
  <% end %>
36
36
 
@@ -0,0 +1,36 @@
1
+ @layer components {
2
+ .lesli-avatar {
3
+ @apply flex shrink-0 items-center justify-center overflow-hidden rounded-full border-[0.1px] border-neutral-400 bg-neutral-100;
4
+ }
5
+
6
+ .lesli-avatar-image {
7
+ @apply h-full w-full object-cover;
8
+ }
9
+
10
+ .lesli-avatar-initials {
11
+ @apply font-bold text-neutral-700;
12
+ }
13
+ .lesli-avatar-small-text {
14
+ @apply text-xl;
15
+ }
16
+
17
+ .lesli-avatar-small {
18
+ @apply size-[60px];
19
+ }
20
+
21
+ .lesli-avatar-medium-text {
22
+ @apply text-[2rem];
23
+ }
24
+
25
+ .lesli-avatar-medium {
26
+ @apply size-[120px];
27
+ }
28
+
29
+ .lesli-avatar-large-text {
30
+ @apply text-5xl;
31
+ }
32
+
33
+ .lesli-avatar-large {
34
+ @apply size-[180px];
35
+ }
36
+ }
@@ -0,0 +1,7 @@
1
+ <figure class="lesli-element-avatar <%= avatar_size %> lesli-avatar">
2
+ <% if image %>
3
+ <img class="lesli-avatar-image" src="<%= image %>" alt="Avatar image">
4
+ <% else %>
5
+ <span class="lesli-avatar-initials <%= font_size %>"><%= letter %></span>
6
+ <% end %>
7
+ </figure>
@@ -51,14 +51,14 @@ module LesliView
51
51
  def calculate_size
52
52
  case size
53
53
  when "small"
54
- @font_size = "text-xl"
55
- @avatar_size = "size-[60px]"
54
+ @font_size = "lesli-avatar-small-text"
55
+ @avatar_size = "lesli-avatar-small"
56
56
  when "medium"
57
- @font_size = "text-[2rem]"
58
- @avatar_size = "size-[120px]"
57
+ @font_size = "lesli-avatar-medium-text"
58
+ @avatar_size = "lesli-avatar-medium"
59
59
  when "large"
60
- @font_size = "text-5xl"
61
- @avatar_size = "size-[180px]"
60
+ @font_size = "lesli-avatar-large-text"
61
+ @avatar_size = "lesli-avatar-large"
62
62
  else
63
63
  raise ArgumentError, "Invalid size: #{size}"
64
64
  end