silex_ui 0.2.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +184 -0
- data/LICENSE.txt +6 -0
- data/README.md +97 -7
- data/app/assets/javascripts/silex_ui/controllers/clipboard_controller.js +10 -10
- data/app/assets/javascripts/silex_ui/controllers/dropdown_controller.js +24 -0
- data/app/assets/javascripts/silex_ui/controllers/inline_edit_controller.js +39 -0
- data/app/assets/javascripts/silex_ui/controllers/remote_modal_controller.js +22 -0
- data/app/assets/javascripts/silex_ui/controllers/sidebar_controller.js +34 -0
- data/app/assets/javascripts/silex_ui/controllers/theme_controller.js +43 -0
- data/app/assets/javascripts/silex_ui/controllers/tooltip_controller.js +65 -0
- data/app/assets/javascripts/silex_ui/index.js +22 -1
- data/app/assets/stylesheets/silex_ui/theme.css +528 -42
- data/app/components/silex_ui/action_list_component.rb +76 -0
- data/app/components/silex_ui/alert_component.html.erb +14 -6
- data/app/components/silex_ui/alert_component.rb +24 -12
- data/app/components/silex_ui/avatar_component.rb +56 -0
- data/app/components/silex_ui/badge_component.rb +21 -17
- data/app/components/silex_ui/base_component.rb +10 -3
- data/app/components/silex_ui/breakdown_component.html.erb +20 -6
- data/app/components/silex_ui/breakdown_component.rb +21 -4
- data/app/components/silex_ui/button_component.rb +31 -16
- data/app/components/silex_ui/card_component.html.erb +7 -4
- data/app/components/silex_ui/card_component.rb +9 -6
- data/app/components/silex_ui/copy_button_component.rb +17 -8
- data/app/components/silex_ui/dropdown_component.html.erb +13 -0
- data/app/components/silex_ui/dropdown_component.rb +82 -0
- data/app/components/silex_ui/empty_state_component.html.erb +13 -0
- data/app/components/silex_ui/empty_state_component.rb +6 -9
- data/app/components/silex_ui/field_component.html.erb +4 -4
- data/app/components/silex_ui/field_component.rb +8 -5
- data/app/components/silex_ui/filter_bar_component.html.erb +22 -0
- data/app/components/silex_ui/filter_bar_component.rb +54 -0
- data/app/components/silex_ui/filter_field_component.html.erb +10 -0
- data/app/components/silex_ui/filter_field_component.rb +69 -0
- data/app/components/silex_ui/flash_component.html.erb +1 -1
- data/app/components/silex_ui/icon_component.rb +211 -0
- data/app/components/silex_ui/inline_edit_component.html.erb +23 -0
- data/app/components/silex_ui/inline_edit_component.rb +47 -0
- data/app/components/silex_ui/modal_component.html.erb +4 -2
- data/app/components/silex_ui/modal_component.rb +3 -2
- data/app/components/silex_ui/nav_component.html.erb +5 -4
- data/app/components/silex_ui/nav_component.rb +22 -7
- data/app/components/silex_ui/page_header_component.html.erb +38 -10
- data/app/components/silex_ui/page_header_component.rb +97 -11
- data/app/components/silex_ui/pagination_component.html.erb +11 -10
- data/app/components/silex_ui/pagination_component.rb +1 -2
- data/app/components/silex_ui/panel_component.html.erb +27 -0
- data/app/components/silex_ui/panel_component.rb +60 -0
- data/app/components/silex_ui/progress_component.html.erb +21 -0
- data/app/components/silex_ui/progress_component.rb +42 -0
- data/app/components/silex_ui/remote_modal_component.html.erb +30 -0
- data/app/components/silex_ui/remote_modal_component.rb +54 -0
- data/app/components/silex_ui/section_component.html.erb +5 -2
- data/app/components/silex_ui/section_component.rb +8 -8
- data/app/components/silex_ui/shell_component.html.erb +40 -0
- data/app/components/silex_ui/shell_component.rb +106 -0
- data/app/components/silex_ui/stat_card_component.html.erb +31 -6
- data/app/components/silex_ui/stat_card_component.rb +48 -28
- data/app/components/silex_ui/stat_grid_component.rb +8 -18
- data/app/components/silex_ui/table_component.html.erb +10 -8
- data/app/components/silex_ui/table_component.rb +52 -20
- data/app/components/silex_ui/theme_toggle_component.html.erb +11 -0
- data/app/components/silex_ui/theme_toggle_component.rb +29 -0
- data/app/components/silex_ui/tones.rb +72 -0
- data/app/views/silex_ui/catalogue/_specimen.html.erb +4 -4
- data/app/views/silex_ui/catalogue/show.html.erb +332 -187
- data/lib/silex_ui/version.rb +1 -1
- data/lib/silex_ui.rb +8 -0
- metadata +31 -2
|
@@ -1,251 +1,396 @@
|
|
|
1
1
|
<% content_for :title, "Catalogue — silex_ui #{SilexUi::VERSION}" %>
|
|
2
2
|
|
|
3
|
-
<div class="
|
|
3
|
+
<div class="min-h-screen bg-surface-50">
|
|
4
4
|
<%= render SilexUi::PageHeaderComponent.new(
|
|
5
5
|
title: "silex_ui",
|
|
6
|
+
icon: "sparkles",
|
|
6
7
|
subtitle: "Le design system des applications Le Silex — version #{SilexUi::VERSION}.",
|
|
7
8
|
document_title: false) do |header| %>
|
|
8
|
-
<% header.
|
|
9
|
-
|
|
10
|
-
Cette page n'existe qu'en développement. Chaque composant y figure dans toutes ses variantes :
|
|
11
|
-
ce qui manque ici manque au design system.
|
|
12
|
-
</p>
|
|
9
|
+
<% header.with_actions do %>
|
|
10
|
+
<%= render SilexUi::ThemeToggleComponent.new %>
|
|
13
11
|
<% end %>
|
|
14
|
-
<% end %>
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<% {
|
|
19
|
-
"sand — le sol" => %w[bg-sand-50 bg-sand-100 bg-sand-200 bg-sand-300],
|
|
20
|
-
"ink — le texte" => %w[bg-ink-300 bg-ink-400 bg-ink-600 bg-ink-900],
|
|
21
|
-
"alert — ce qui a lapsé" => %w[bg-alert-50 bg-alert-100 bg-alert-300 bg-alert-700],
|
|
22
|
-
"warn — ce qui bascule" => %w[bg-warn-50 bg-warn-100 bg-warn-300 bg-warn-700],
|
|
23
|
-
"ok — ce qui est en règle" => %w[bg-ok-50 bg-ok-100 bg-ok-300 bg-ok-700],
|
|
24
|
-
"info — sans urgence" => %w[bg-info-50 bg-info-100 bg-info-300 bg-info-700]
|
|
25
|
-
}.each do |family, swatches| %>
|
|
26
|
-
<div>
|
|
27
|
-
<p class="mb-2 text-xs font-light tracking-widest text-ink-400 uppercase"><%= family %></p>
|
|
28
|
-
<div class="flex overflow-hidden rounded-sm border border-sand-200">
|
|
29
|
-
<% swatches.each do |swatch| %>
|
|
30
|
-
<div class="h-12 flex-1 <%= swatch %>" title="<%= swatch %>"></div>
|
|
31
|
-
<% end %>
|
|
32
|
-
</div>
|
|
33
|
-
<p class="mt-1 text-xs font-light text-ink-300"><%= swatches.map { |s| s.split("-").last }.join(" · ") %></p>
|
|
34
|
-
</div>
|
|
35
|
-
<% end %>
|
|
36
|
-
</div>
|
|
13
|
+
<% header.with_crumb label: "Design system" %>
|
|
14
|
+
<% header.with_crumb label: "Catalogue" %>
|
|
37
15
|
<% end %>
|
|
38
16
|
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<p class="text-xs font-light text-ink-400">Mention secondaire, pour ce qui accompagne sans appeler.</p>
|
|
45
|
-
</div>
|
|
46
|
-
<% end %>
|
|
17
|
+
<div class="mx-auto max-w-6xl px-6 pb-24">
|
|
18
|
+
<p class="py-6 text-sm text-ink-500">
|
|
19
|
+
Cette page n'existe qu'en développement. Chaque composant y figure dans toutes ses variantes :
|
|
20
|
+
ce qui manque ici manque au design system.
|
|
21
|
+
</p>
|
|
47
22
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
23
|
+
<%= render SilexUi::SectionComponent.new(title: "Palette", icon: "sliders") do %>
|
|
24
|
+
<div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
|
|
25
|
+
<% {
|
|
26
|
+
"surface — les fonds" => %w[bg-surface-0 bg-surface-50 bg-surface-100 bg-surface-200 bg-surface-300],
|
|
27
|
+
"ink — le texte" => %w[bg-ink-300 bg-ink-400 bg-ink-500 bg-ink-700 bg-ink-900],
|
|
28
|
+
"brand — l'accent" => %w[bg-brand-50 bg-brand-100 bg-brand-300 bg-brand-500 bg-brand-700],
|
|
29
|
+
"ok — ce qui est en règle" => %w[bg-ok-50 bg-ok-100 bg-ok-300 bg-ok-500 bg-ok-700],
|
|
30
|
+
"warn — ce qui bascule" => %w[bg-warn-50 bg-warn-100 bg-warn-300 bg-warn-500 bg-warn-700],
|
|
31
|
+
"alert — ce qui a lapsé" => %w[bg-alert-50 bg-alert-100 bg-alert-300 bg-alert-500 bg-alert-700],
|
|
32
|
+
"info — sans urgence" => %w[bg-info-50 bg-info-100 bg-info-300 bg-info-500 bg-info-700],
|
|
33
|
+
"catégories" => %w[bg-purple-500 bg-pink-500 bg-teal-500 bg-cyan-500 bg-ink-400]
|
|
34
|
+
}.each do |family, swatches| %>
|
|
35
|
+
<div>
|
|
36
|
+
<p class="mb-2 text-[13px] font-semibold text-ink-700"><%= family %></p>
|
|
37
|
+
<div class="flex overflow-hidden rounded-badge border border-surface-200">
|
|
38
|
+
<% swatches.each do |swatch| %>
|
|
39
|
+
<div class="h-11 flex-1 <%= swatch %>" title="<%= swatch %>"></div>
|
|
40
|
+
<% end %>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
54
43
|
<% end %>
|
|
55
44
|
</div>
|
|
56
45
|
<% end %>
|
|
57
46
|
|
|
58
|
-
<%= render
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
<%= render SilexUi::SectionComponent.new(title: "Typographie", icon: "document", class: "mt-12") do |section| %>
|
|
48
|
+
<% section.with_actions do %>
|
|
49
|
+
<p class="text-xs text-ink-400">Atkinson Hyperlegible — la police du Silex, dessinée pour la lisibilité</p>
|
|
50
|
+
<% end %>
|
|
51
|
+
|
|
52
|
+
<div class="space-y-3 rounded-surface border border-surface-200 bg-surface-0 p-5">
|
|
53
|
+
<p class="text-2xl font-bold text-ink-900">Titre de page</p>
|
|
54
|
+
<p class="text-[13px] font-bold tracking-wider text-ink-700 uppercase">Titre de section</p>
|
|
55
|
+
<p class="text-sm text-ink-900">Texte courant — ce qu'on lit vraiment.</p>
|
|
56
|
+
<p class="text-[13px] text-ink-500">Libellé secondaire, sous un chiffre ou devant un champ.</p>
|
|
57
|
+
<p class="text-xs text-ink-400">Mention discrète, pour ce qui accompagne sans appeler.</p>
|
|
63
58
|
</div>
|
|
64
59
|
<% end %>
|
|
65
|
-
<% end %>
|
|
66
60
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
<%= render SilexUi::SectionComponent.new(title: "Icônes", icon: "grid", class: "mt-12") do |section| %>
|
|
62
|
+
<% section.with_actions do %>
|
|
63
|
+
<p class="text-xs text-ink-400">Heroicons 2.2 (MIT), en SVG inline — aucune dépendance externe</p>
|
|
64
|
+
<% end %>
|
|
65
|
+
|
|
66
|
+
<div class="grid grid-cols-4 gap-3 sm:grid-cols-6 lg:grid-cols-8">
|
|
67
|
+
<% SilexUi::IconComponent::NAMES.each do |name| %>
|
|
68
|
+
<div class="flex flex-col items-center gap-2 rounded-surface border border-surface-200 bg-surface-0 p-3 text-ink-500">
|
|
69
|
+
<%= render SilexUi::IconComponent.new(name: name, size: :lg) %>
|
|
70
|
+
<span class="truncate text-[11px] text-ink-400"><%= name %></span>
|
|
71
|
+
</div>
|
|
74
72
|
<% end %>
|
|
75
|
-
<%= render SilexUi::BadgeComponent.new(label: "cliquable", href: "#") %>
|
|
76
73
|
</div>
|
|
77
74
|
<% end %>
|
|
78
75
|
|
|
79
|
-
<%= render
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
<%= render SilexUi::SectionComponent.new(title: "Boutons", icon: "bolt", class: "mt-12") do %>
|
|
77
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
78
|
+
locals: { title: "Variantes", code: 'SilexUi::ButtonComponent.new(label: "Ajouter", href: "#", icon: "plus")' } do %>
|
|
79
|
+
<div class="flex flex-wrap items-center gap-3">
|
|
80
|
+
<% SilexUi::ButtonComponent::VARIANTS.each_key do |variant| %>
|
|
81
|
+
<%= render SilexUi::ButtonComponent.new(label: variant.to_s.titleize, href: "#", variant: variant, icon: "plus") %>
|
|
82
|
+
<% end %>
|
|
83
|
+
</div>
|
|
84
|
+
<% end %>
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<% grid.with_stat value: 37, label: "Expirent sous 30 j", tone: :warn, href: "#" %>
|
|
93
|
-
<% grid.with_stat value: 12, label: "Expirés", tone: :alert, href: "#",
|
|
94
|
-
trend: { value: 3, positive: false } %>
|
|
95
|
-
<% grid.with_stat value: 96, label: "Sans repo", hint: "sur 1 240" %>
|
|
86
|
+
<%= render layout: "silex_ui/catalogue/specimen", locals: { title: "Tailles" } do %>
|
|
87
|
+
<div class="flex flex-wrap items-center gap-3">
|
|
88
|
+
<% SilexUi::ButtonComponent::SIZES.each_key do |size| %>
|
|
89
|
+
<%= render SilexUi::ButtonComponent.new(label: size.to_s, href: "#", size: size, icon: "check") %>
|
|
90
|
+
<% end %>
|
|
91
|
+
</div>
|
|
96
92
|
<% end %>
|
|
97
93
|
<% end %>
|
|
98
94
|
|
|
99
|
-
<%= render
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
95
|
+
<%= render SilexUi::SectionComponent.new(title: "Pastilles", icon: "tag", class: "mt-12") do %>
|
|
96
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
97
|
+
locals: { title: "Tons", note: "Cinq états, quatre familles",
|
|
98
|
+
code: 'SilexUi::BadgeComponent.new(label: "expiré", tone: :alert, icon: "alert")' } do %>
|
|
99
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
100
|
+
<% SilexUi::BaseComponent::TONES.each do |tone| %>
|
|
101
|
+
<%= render SilexUi::BadgeComponent.new(label: tone.to_s, tone: tone) %>
|
|
102
|
+
<% end %>
|
|
103
|
+
<%= render SilexUi::BadgeComponent.new(label: "avec icône", tone: :ok, icon: "success") %>
|
|
104
|
+
<%= render SilexUi::BadgeComponent.new(tone: :alert, icon: "alert", title: "Sans libellé") %>
|
|
105
|
+
<%= render SilexUi::BadgeComponent.new(label: "cliquable", tone: :brand, href: "#") %>
|
|
106
|
+
</div>
|
|
107
|
+
<% end %>
|
|
108
|
+
|
|
109
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
110
|
+
locals: { title: "Bouton de copie", note: "Confirme, puis reprend son libellé",
|
|
111
|
+
code: 'SilexUi::CopyButtonComponent.new(value: website.domain, label: "Copier")' } do %>
|
|
112
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
113
|
+
<%= render SilexUi::CopyButtonComponent.new(value: "bali-surf-camp.fr", label: "Copier le domaine") %>
|
|
114
|
+
<%= render SilexUi::CopyButtonComponent.new(value: "bali-surf-camp.fr") %>
|
|
115
|
+
</div>
|
|
116
|
+
<% end %>
|
|
108
117
|
<% end %>
|
|
109
|
-
<% end %>
|
|
110
118
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<%= site.registrar.titleize %>
|
|
119
|
+
<%= render SilexUi::SectionComponent.new(title: "Compteurs", icon: "chart", class: "mt-12") do %>
|
|
120
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
121
|
+
locals: { title: "Grille de statistiques", note: "Survole une carte",
|
|
122
|
+
code: 'grid.with_stat(value: 12, label: "Expirés", tone: :alert, icon: "alert", href: "#")' } do %>
|
|
123
|
+
<%= render SilexUi::StatGridComponent.new do |grid| %>
|
|
124
|
+
<% grid.with_stat value: number_with_delimiter(1_240), label: "Domaines", icon: "globe", href: "#" %>
|
|
125
|
+
<% grid.with_stat value: 37, label: "Expirent sous 30 j", tone: :warn, icon: "clock", href: "#" %>
|
|
126
|
+
<% grid.with_stat value: 12, label: "Expirés", tone: :alert, icon: "alert", href: "#",
|
|
127
|
+
alert: true, trend: { value: 3, positive: false } %>
|
|
128
|
+
<% grid.with_stat value: 96, label: "Sans repo", tone: :info, icon: "code", hint: "sur 1 240" %>
|
|
122
129
|
<% end %>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
<% end %>
|
|
131
|
+
|
|
132
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
133
|
+
locals: { title: "Répartition", code: 'SilexUi::BreakdownComponent.new(title: "Par registrar", items: [...])' } do %>
|
|
134
|
+
<div class="max-w-xs">
|
|
135
|
+
<%= render SilexUi::BreakdownComponent.new(title: "Par registrar", icon: "database", items: [
|
|
136
|
+
{ label: "OVH", count: 612, href: "#" },
|
|
137
|
+
{ label: "Netim", count: 428, href: "#" },
|
|
138
|
+
{ label: "Gandi", count: 200 }
|
|
139
|
+
]) %>
|
|
140
|
+
</div>
|
|
141
|
+
<% end %>
|
|
142
|
+
<% end %>
|
|
143
|
+
|
|
144
|
+
<%= render SilexUi::SectionComponent.new(title: "Tableaux", icon: "grid", class: "mt-12") do %>
|
|
145
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
146
|
+
locals: { title: "Colonnes déclarées, tri, lignes colorées",
|
|
147
|
+
code: 'table.with_column(header: "Domaine", sort: url, direction: :asc) { |site| site.domain }' } do %>
|
|
148
|
+
<%= render SilexUi::TableComponent.new(rows: @sites,
|
|
149
|
+
row_class: ->(site) { "bg-alert-50/60" if site.expired }) do |table| %>
|
|
150
|
+
<% table.with_column(header: "Domaine", sort: "#", direction: :asc) do |site| %>
|
|
151
|
+
<span class="font-semibold"><%= site.domain %></span>
|
|
152
|
+
<% end %>
|
|
153
|
+
<% table.with_column(header: "Registrar", sort: "#", cell_class: "text-ink-500") { |site| site.registrar.titleize } %>
|
|
154
|
+
<% table.with_column(header: "État") do |site| %>
|
|
155
|
+
<%= render SilexUi::BadgeComponent.new(label: site.expired ? "expiré" : "actif",
|
|
156
|
+
tone: site.expired ? :alert : :ok, icon: site.expired ? "alert" : "success") %>
|
|
157
|
+
<% end %>
|
|
158
|
+
<% table.with_column(align: :right) do |site| %>
|
|
159
|
+
<%= render SilexUi::ButtonComponent.new(label: "Éditer", href: "#", variant: :ghost, size: :sm, icon: "edit") %>
|
|
160
|
+
<% end %>
|
|
126
161
|
<% end %>
|
|
127
|
-
|
|
128
|
-
|
|
162
|
+
<% end %>
|
|
163
|
+
|
|
164
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
165
|
+
locals: { title: "Tableau vide", note: "L'état vide remplace le tableau, il ne le décore pas" } do %>
|
|
166
|
+
<%= render SilexUi::TableComponent.new(rows: [], empty_message: "Aucun domaine ne correspond.") do |table| %>
|
|
167
|
+
<% table.with_column(header: "Domaine") { |site| site.domain } %>
|
|
129
168
|
<% end %>
|
|
130
169
|
<% end %>
|
|
131
|
-
<% end %>
|
|
132
170
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
171
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
172
|
+
locals: { title: "Pagination",
|
|
173
|
+
code: 'SilexUi::PaginationComponent.new(pagination: @pagination, page_url: ->(page) { path(page:) })' } do %>
|
|
174
|
+
<%= render SilexUi::PaginationComponent.new(pagination: @pagination, page_url: ->(_page) { "#" }) %>
|
|
137
175
|
<% end %>
|
|
138
176
|
<% end %>
|
|
139
177
|
|
|
140
|
-
<%= render
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
178
|
+
<%= render SilexUi::SectionComponent.new(title: "Messages", icon: "bell", class: "mt-12") do %>
|
|
179
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
180
|
+
locals: { title: "Bandeaux", code: 'SilexUi::AlertComponent.new(tone: :warn, title: "…", text: "…")' } do %>
|
|
181
|
+
<div class="space-y-3">
|
|
182
|
+
<%= render SilexUi::AlertComponent.new(tone: :info, title: "Synchronisation",
|
|
183
|
+
text: "Le dernier passage remonte à trois heures.") %>
|
|
184
|
+
<%= render SilexUi::AlertComponent.new(tone: :warn, title: "Registrar muet",
|
|
185
|
+
text: "OVH n'a pas répondu au dernier passage ; les dates d'expiration datent d'hier.") %>
|
|
186
|
+
<%= render SilexUi::AlertComponent.new(tone: :alert, title: "Jeton refusé",
|
|
187
|
+
text: "La clé NETIM a expiré, plus aucune disponibilité n'est vérifiée.") %>
|
|
188
|
+
<%= render SilexUi::AlertComponent.new(tone: :ok, text: "Catalogue à jour.") %>
|
|
189
|
+
</div>
|
|
190
|
+
<% end %>
|
|
146
191
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<%= render SilexUi::AlertComponent.new(tone: :warn, title: "Registrar muet",
|
|
154
|
-
text: "OVH n'a pas répondu au dernier passage ; les dates d'expiration datent d'hier.") %>
|
|
155
|
-
<%= render SilexUi::AlertComponent.new(tone: :alert, title: "Jeton refusé",
|
|
156
|
-
text: "La clé NETIM a expiré, plus aucune disponibilité n'est vérifiée.") %>
|
|
157
|
-
<%= render SilexUi::AlertComponent.new(tone: :ok, text: "Catalogue à jour.") %>
|
|
158
|
-
</div>
|
|
192
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
193
|
+
locals: { title: "État vide", code: 'SilexUi::EmptyStateComponent.new(message: "…", icon: "folder")' } do %>
|
|
194
|
+
<%= render SilexUi::EmptyStateComponent.new(message: "Rien à afficher pour le moment.", icon: "search") do %>
|
|
195
|
+
<%= render SilexUi::ButtonComponent.new(label: "Ajouter le premier", href: "#", variant: :secondary, icon: "plus") %>
|
|
196
|
+
<% end %>
|
|
197
|
+
<% end %>
|
|
159
198
|
<% end %>
|
|
160
199
|
|
|
161
|
-
<%= render
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
200
|
+
<%= render SilexUi::SectionComponent.new(title: "Surfaces", icon: "folder", class: "mt-12") do %>
|
|
201
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
202
|
+
locals: { title: "Cartes", code: 'SilexUi::CardComponent.new(title: "…", icon: "…", href: "…")' } do %>
|
|
203
|
+
<div class="grid gap-5 md:grid-cols-3">
|
|
204
|
+
<%= render SilexUi::CardComponent.new(title: "Simple", icon: "document") do %>
|
|
205
|
+
Une surface blanche sur le fond, pour ce qui doit se détacher du flux.
|
|
206
|
+
<% end %>
|
|
207
|
+
|
|
208
|
+
<%= render SilexUi::CardComponent.new(title: "Avec pied", icon: "refresh") do |card| %>
|
|
209
|
+
<% card.with_footer do %>Dernière synchro il y a 3 h<% end %>
|
|
210
|
+
Le pied porte ce qui date ou qualifie le contenu.
|
|
211
|
+
<% end %>
|
|
212
|
+
|
|
213
|
+
<%= render SilexUi::CardComponent.new(title: "Cliquable", icon: "link", href: "#") do %>
|
|
214
|
+
Toute la carte devient la cible, pas seulement son titre.
|
|
215
|
+
<% end %>
|
|
216
|
+
</div>
|
|
165
217
|
<% end %>
|
|
166
|
-
<% end %>
|
|
167
|
-
<% end %>
|
|
168
218
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
<% end %>
|
|
219
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
220
|
+
locals: { title: "Modale", note: "Bâtie sur <dialog> : focus, Échap et fond inerte gérés par le navigateur" } do %>
|
|
221
|
+
<%= render SilexUi::ModalComponent.new(id: "catalogue-modal", title: "Supprimer le domaine ?") do |modal| %>
|
|
222
|
+
<% modal.with_trigger do %>
|
|
223
|
+
<%= render SilexUi::ButtonComponent.new(label: "Ouvrir la modale", variant: :secondary, icon: "trash") %>
|
|
224
|
+
<% end %>
|
|
176
225
|
|
|
177
|
-
|
|
178
|
-
<% card.with_footer do %>Dernière synchro il y a 3 h<% end %>
|
|
179
|
-
Le pied porte ce qui date ou qualifie le contenu.
|
|
180
|
-
<% end %>
|
|
226
|
+
<p>Cette action est définitive. Le domaine sortira du catalogue et de toutes ses répartitions.</p>
|
|
181
227
|
|
|
182
|
-
|
|
183
|
-
|
|
228
|
+
<% modal.with_footer do %>
|
|
229
|
+
<%= render SilexUi::ButtonComponent.new(label: "Annuler", variant: :ghost,
|
|
230
|
+
data: { action: "silex-ui--modal#close" }) %>
|
|
231
|
+
<%= render SilexUi::ButtonComponent.new(label: "Supprimer", variant: :danger, icon: "trash") %>
|
|
232
|
+
<% end %>
|
|
184
233
|
<% end %>
|
|
185
|
-
|
|
234
|
+
<% end %>
|
|
186
235
|
<% end %>
|
|
187
236
|
|
|
188
|
-
<%= render
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
237
|
+
<%= render SilexUi::SectionComponent.new(title: "Formulaires", icon: "edit", class: "mt-12") do %>
|
|
238
|
+
<%= form_with url: "#", method: :get do |f| %>
|
|
239
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
240
|
+
locals: { title: "Champs", note: "Deux densités : md pour les barres de filtres, lg pour les pages",
|
|
241
|
+
code: 'SilexUi::FieldComponent.new(form: f, attribute: :domain, label: "Domaine", size: :lg)' } do %>
|
|
242
|
+
<div class="grid max-w-2xl gap-5 md:grid-cols-2">
|
|
243
|
+
<%= render SilexUi::FieldComponent.new(form: f, attribute: :domain, label: "Domaine", size: :lg,
|
|
244
|
+
input_html: { placeholder: "exemple.fr" }) %>
|
|
245
|
+
<%= render SilexUi::FieldComponent.new(form: f, attribute: :registrar, label: "Registrar", size: :lg,
|
|
246
|
+
type: :select, collection: %w[OVH Netim Gandi], include_blank: "—") %>
|
|
247
|
+
<%= render SilexUi::FieldComponent.new(form: f, attribute: :expires_at, label: "Expiration",
|
|
248
|
+
type: :date, hint: "Densité md, celle des barres de filtres") %>
|
|
249
|
+
<%= render SilexUi::FieldComponent.new(form: f, attribute: :active, label: "Rattaché à une lune",
|
|
250
|
+
type: :boolean) %>
|
|
251
|
+
<%= render SilexUi::FieldComponent.new(form: f, attribute: :notes, label: "Notes", size: :lg,
|
|
252
|
+
type: :textarea, input_html: { rows: 2 }, class: "md:col-span-2") %>
|
|
253
|
+
</div>
|
|
193
254
|
<% end %>
|
|
255
|
+
<% end %>
|
|
256
|
+
<% end %>
|
|
257
|
+
|
|
258
|
+
<%= render SilexUi::SectionComponent.new(title: "En-têtes et panneaux", icon: "document", class: "mt-12") do %>
|
|
259
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
260
|
+
locals: { title: "En-tête de page", note: "`:hero` pour les listes, `:banner` pour les tableaux de bord",
|
|
261
|
+
code: 'SilexUi::PageHeaderComponent.new(title: "Sites", icon: "globe", variant: :hero)' } do %>
|
|
262
|
+
<div class="space-y-4 overflow-hidden rounded-surface border border-surface-200">
|
|
263
|
+
<%= render SilexUi::PageHeaderComponent.new(title: "Sites", icon: "globe", document_title: false) do |header| %>
|
|
264
|
+
<% header.with_meta do %>1 309 domaines<% end %>
|
|
265
|
+
<% header.with_crumb label: "Accueil", href: "#" %>
|
|
266
|
+
<% header.with_crumb label: "Sites" %>
|
|
267
|
+
<% header.with_actions do %>
|
|
268
|
+
<%= render SilexUi::ButtonComponent.new(label: "Ajouter", icon: "plus") %>
|
|
269
|
+
<% end %>
|
|
270
|
+
<% end %>
|
|
271
|
+
</div>
|
|
272
|
+
|
|
273
|
+
<div class="mt-4">
|
|
274
|
+
<%= render SilexUi::PageHeaderComponent.new(title: "Bonjour, Théo 👋", variant: :banner,
|
|
275
|
+
subtitle: "Bienvenue sur votre espace", document_title: false) do |header| %>
|
|
276
|
+
<% header.with_aside do %>
|
|
277
|
+
<span class="block text-sm text-white/90">jeudi</span>
|
|
278
|
+
<span class="block text-lg font-bold">10 septembre 2026</span>
|
|
279
|
+
<% end %>
|
|
280
|
+
<% end %>
|
|
281
|
+
</div>
|
|
282
|
+
<% end %>
|
|
283
|
+
|
|
284
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
285
|
+
locals: { title: "Panneau", note: "La surface blanche dans laquelle vit tout contenu",
|
|
286
|
+
code: 'SilexUi::PanelComponent.new(title: "Progression du mois", icon: "chart")' } do %>
|
|
287
|
+
<%= render SilexUi::PanelComponent.new(title: "Progression du mois", icon: "chart") do |panel| %>
|
|
288
|
+
<% panel.with_action label: "Voir détails", href: "#" %>
|
|
194
289
|
|
|
195
|
-
|
|
290
|
+
<%= render SilexUi::ProgressComponent.new(label: "Objectif mensuel", value: 66_865, total: 260_420,
|
|
291
|
+
from: "66 865 € réalisés", to: "Objectif : 260 420 €") %>
|
|
292
|
+
<% end %>
|
|
293
|
+
<% end %>
|
|
196
294
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
295
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
296
|
+
locals: { title: "Liste d'actions", note: "Une pastille, ce qu'il faut faire, et où le faire",
|
|
297
|
+
code: 'list.with_item(title: "…", subtitle: "…", icon: "alert", tone: :alert, href: path)' } do %>
|
|
298
|
+
<%= render SilexUi::PanelComponent.new(title: "Actions requises", icon: "alert", tone: :warn) do %>
|
|
299
|
+
<%= render SilexUi::ActionListComponent.new do |list| %>
|
|
300
|
+
<% list.with_item title: "130 campagnes sans budget", subtitle: "Budget non défini pour le mois en cours",
|
|
301
|
+
icon: "alert", tone: :alert, href: "#" %>
|
|
302
|
+
<% list.with_item title: "188 liens non publiés", subtitle: "En attente de publication",
|
|
303
|
+
icon: "clock", tone: :warn, href: "#" %>
|
|
304
|
+
<% list.with_item title: "1 028 erreurs ancre/lien", subtitle: "Vérification requise",
|
|
305
|
+
icon: "link", tone: :purple, href: "#", meta: "il y a 3 h" %>
|
|
306
|
+
<% end %>
|
|
201
307
|
<% end %>
|
|
202
308
|
<% end %>
|
|
203
309
|
<% end %>
|
|
204
|
-
<% end %>
|
|
205
310
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
311
|
+
<%= render SilexUi::SectionComponent.new(title: "Ossature", icon: "grid", class: "mt-12") do |section| %>
|
|
312
|
+
<% section.with_actions do %>
|
|
313
|
+
<p class="text-xs text-ink-400">Le rail du Silex : 80px, l'icône en carré violet, la barre d'accent sur la section courante</p>
|
|
314
|
+
<% end %>
|
|
315
|
+
|
|
316
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
317
|
+
locals: { title: "Rail et page", note: "Sous 768px, le rail cède à une barre supérieure et un panneau qui coulisse",
|
|
318
|
+
code: 'shell.with_item(icon: "globe", href: path, label: "Sites", active: true)' } do %>
|
|
319
|
+
<%# Le rail est en position fixe : dans le catalogue on l'imite à l'échelle. %>
|
|
320
|
+
<div class="flex gap-4 overflow-hidden rounded-surface border border-surface-200 bg-surface-50 p-4">
|
|
321
|
+
<div class="flex w-20 flex-col items-center gap-3 border-r border-surface-200 pr-4">
|
|
322
|
+
<span class="flex size-icon-tile items-center justify-center rounded-surface bg-gradient-to-br from-brand-500 to-brand-700 text-lg font-bold text-white shadow-card">N</span>
|
|
323
|
+
|
|
324
|
+
<% [ [ "home", true ], [ "globe", false ], [ "search", false ], [ "settings", false ] ].each do |name, active| %>
|
|
325
|
+
<span class="relative flex justify-center">
|
|
326
|
+
<% if active %>
|
|
327
|
+
<span class="absolute top-1/2 left-0 h-10 w-1 -translate-y-1/2 rounded-r bg-purple-500"></span>
|
|
328
|
+
<% end %>
|
|
329
|
+
<span class="flex size-icon-tile items-center justify-center rounded-surface border-2 <%= active ? "border-purple-500 bg-purple-500/10 text-purple-500 ring-3 ring-purple-500/20" : "border-purple-500/20 bg-purple-500/5 text-ink-500" %>">
|
|
330
|
+
<%= render SilexUi::IconComponent.new(name: name, size: :lg) %>
|
|
331
|
+
</span>
|
|
332
|
+
</span>
|
|
333
|
+
<% end %>
|
|
334
|
+
|
|
335
|
+
<span class="mt-4"><%= render SilexUi::AvatarComponent.new(name: "Théo Galais", size: :lg) %></span>
|
|
336
|
+
</div>
|
|
337
|
+
|
|
338
|
+
<div class="flex-1 text-sm text-ink-500">
|
|
339
|
+
<p class="font-semibold text-ink-900">La page</p>
|
|
340
|
+
<p class="mt-1">Le rail est fixe, la page défile seule sous lui.</p>
|
|
341
|
+
</div>
|
|
222
342
|
</div>
|
|
223
343
|
<% end %>
|
|
224
|
-
<% end %>
|
|
225
|
-
<% end %>
|
|
226
344
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
345
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
346
|
+
locals: { title: "Avatars", note: "Une image quand il y en a une, les initiales sinon",
|
|
347
|
+
code: 'SilexUi::AvatarComponent.new(name: current_user.display_name, size: :lg)' } do %>
|
|
348
|
+
<div class="flex flex-wrap items-center gap-3">
|
|
349
|
+
<%= render SilexUi::AvatarComponent.new(name: "Théo Galais", size: :sm) %>
|
|
350
|
+
<%= render SilexUi::AvatarComponent.new(name: "Théo Galais") %>
|
|
351
|
+
<%= render SilexUi::AvatarComponent.new(name: "Théo Galais", size: :lg) %>
|
|
352
|
+
<%= render SilexUi::AvatarComponent.new(name: "silex", size: :lg, square: true) %>
|
|
353
|
+
</div>
|
|
354
|
+
<% end %>
|
|
355
|
+
|
|
356
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
357
|
+
locals: { title: "Menu déroulant", note: "Se ferme au clic dehors, à Échap, et à la navigation",
|
|
358
|
+
code: 'menu.with_item(label: "Déconnexion", href: path, method: :delete, tone: :alert)' } do %>
|
|
359
|
+
<%= render SilexUi::DropdownComponent.new(placement: :down) do |menu| %>
|
|
360
|
+
<% menu.with_trigger do %>
|
|
361
|
+
<%= render SilexUi::ButtonComponent.new(label: "Mon compte", variant: :secondary, icon: "chevron-down") %>
|
|
362
|
+
<% end %>
|
|
363
|
+
|
|
364
|
+
<% menu.with_header do %>
|
|
365
|
+
<div class="flex items-center gap-2.5">
|
|
366
|
+
<%= render SilexUi::AvatarComponent.new(name: "Théo Galais") %>
|
|
367
|
+
<div class="min-w-0">
|
|
368
|
+
<p class="truncate text-sm font-semibold text-ink-900">Théo Galais</p>
|
|
369
|
+
<p class="truncate text-xs text-ink-500">theo@le-silex.com</p>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
<% end %>
|
|
373
|
+
|
|
374
|
+
<% menu.with_item label: "Réglages", href: "#", icon: "settings" %>
|
|
375
|
+
<% menu.with_item label: "Notifications", href: "#", icon: "bell" %>
|
|
376
|
+
<% menu.with_item label: "Déconnexion", href: "#", icon: "close", tone: :alert %>
|
|
237
377
|
<% end %>
|
|
238
378
|
<% end %>
|
|
239
379
|
<% end %>
|
|
240
380
|
|
|
241
|
-
<%= render
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
381
|
+
<%= render SilexUi::SectionComponent.new(title: "Navigation", icon: "home", class: "mt-12") do %>
|
|
382
|
+
<%= render layout: "silex_ui/catalogue/specimen",
|
|
383
|
+
locals: { title: "Barre de navigation", code: 'nav.with_item(label: "Sites", href: path, icon: "globe", active: true)' } do %>
|
|
384
|
+
<%= render SilexUi::NavComponent.new(brand: "Network", brand_href: "#") do |nav| %>
|
|
385
|
+
<% nav.with_item label: "Tableau de bord", href: "#", icon: "home", active: true %>
|
|
386
|
+
<% nav.with_item label: "Sites", href: "#", icon: "globe" %>
|
|
387
|
+
<% nav.with_item label: "Réglages", href: "#", icon: "settings" %>
|
|
388
|
+
<% nav.with_aside do %>
|
|
389
|
+
<span>theo@le-silex.com</span>
|
|
390
|
+
<%= render SilexUi::ThemeToggleComponent.new %>
|
|
391
|
+
<% end %>
|
|
247
392
|
<% end %>
|
|
248
393
|
<% end %>
|
|
249
394
|
<% end %>
|
|
250
|
-
|
|
395
|
+
</div>
|
|
251
396
|
</div>
|
data/lib/silex_ui/version.rb
CHANGED