okonomi_ui_kit 0.1.11 → 0.1.12
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/app/assets/builds/okonomi_ui_kit/application.tailwind.css +10 -0
- data/app/helpers/okonomi_ui_kit/components/button_to.rb +1 -1
- data/app/helpers/okonomi_ui_kit/components/navigation.rb +10 -2
- data/app/helpers/okonomi_ui_kit/components/progress_bar.rb +86 -0
- data/app/views/okonomi/components/navigation/_link.html.erb +1 -10
- data/app/views/okonomi/components/progress_bar/_progress_bar.html.erb +15 -0
- data/lib/okonomi_ui_kit/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 551db2538043fad1c9fd39808d842e59677d1d24e63594062a5a9ef2192c8a4c
|
4
|
+
data.tar.gz: ca47522f33cb4bbbb4a41ebefc1f71ae456859f26a619ec1d710675d21f8bfd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 101472f2cb7772ae3d003d608350823f66aac3c72af5d83ffe4eb57034d946702d40444b632ac2ab23d1f593cdb075e98b4a228cd5387198533837734fea0d38
|
7
|
+
data.tar.gz: 0e9ec912fc8c2c1a4d1dbc867b1b6a991bcb4c18e45a739e3aef92e58978ece45d3e09419cbf4e52898475f1ea00e23d4aeb29ed321336c8a923c5a96afe1557
|
@@ -142,6 +142,7 @@
|
|
142
142
|
--tracking-wider: 0.05em;
|
143
143
|
--leading-tight: 1.25;
|
144
144
|
--leading-relaxed: 1.625;
|
145
|
+
--radius-xs: 0.125rem;
|
145
146
|
--radius-sm: 0.25rem;
|
146
147
|
--radius-md: 0.375rem;
|
147
148
|
--radius-lg: 0.5rem;
|
@@ -1134,6 +1135,9 @@
|
|
1134
1135
|
.rounded-xl {
|
1135
1136
|
border-radius: var(--radius-xl);
|
1136
1137
|
}
|
1138
|
+
.rounded-xs {
|
1139
|
+
border-radius: var(--radius-xs);
|
1140
|
+
}
|
1137
1141
|
.rounded-l-md {
|
1138
1142
|
border-top-left-radius: var(--radius-md);
|
1139
1143
|
border-bottom-left-radius: var(--radius-md);
|
@@ -1347,6 +1351,9 @@
|
|
1347
1351
|
background-color: color-mix(in oklab, var(--color-gray-500) 75%, transparent);
|
1348
1352
|
}
|
1349
1353
|
}
|
1354
|
+
.bg-gray-600 {
|
1355
|
+
background-color: var(--color-gray-600);
|
1356
|
+
}
|
1350
1357
|
.bg-gray-900 {
|
1351
1358
|
background-color: var(--color-gray-900);
|
1352
1359
|
}
|
@@ -1832,6 +1839,9 @@
|
|
1832
1839
|
.opacity-100 {
|
1833
1840
|
opacity: 100%;
|
1834
1841
|
}
|
1842
|
+
.mix-blend-difference {
|
1843
|
+
mix-blend-mode: difference;
|
1844
|
+
}
|
1835
1845
|
.shadow {
|
1836
1846
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
1837
1847
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
@@ -74,14 +74,22 @@ module OkonomiUiKit
|
|
74
74
|
@links = []
|
75
75
|
end
|
76
76
|
|
77
|
-
def nav_link(title, path, icon: nil, initials: nil, exact: false)
|
77
|
+
def nav_link(title, path, icon: nil, initials: nil, exact: false, target: nil)
|
78
|
+
options = {
|
79
|
+
exact: exact,
|
80
|
+
class: style(:link, :base),
|
81
|
+
active_class: style(:link, :active)
|
82
|
+
}
|
83
|
+
|
84
|
+
options[:target] = target if target.present?
|
85
|
+
|
78
86
|
@links << view.tag.li do
|
79
87
|
view.render "okonomi/components/navigation/link",
|
80
88
|
path: path,
|
81
89
|
title: title,
|
82
90
|
icon: icon,
|
83
91
|
initials: initials,
|
84
|
-
|
92
|
+
options: options,
|
85
93
|
style_helper: self
|
86
94
|
end
|
87
95
|
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
module OkonomiUiKit
|
2
|
+
module Components
|
3
|
+
class ProgressBar < OkonomiUiKit::Component
|
4
|
+
def render(value, options = {})
|
5
|
+
options = options.with_indifferent_access
|
6
|
+
|
7
|
+
# Extract options
|
8
|
+
color = (options.delete(:color) || :primary).to_sym
|
9
|
+
size = (options.delete(:size) || :md).to_sym
|
10
|
+
text = options.delete(:text)
|
11
|
+
|
12
|
+
# Ensure value is between 0 and 1
|
13
|
+
value = [ [ value.to_f, 0.0 ].max, 1.0 ].min
|
14
|
+
percentage = (value * 100).round
|
15
|
+
|
16
|
+
# Build classes
|
17
|
+
container_classes = tw_merge(
|
18
|
+
style(:container, :root),
|
19
|
+
style(:container, :sizes, size),
|
20
|
+
options.delete(:class)
|
21
|
+
)
|
22
|
+
|
23
|
+
bar_classes = tw_merge(
|
24
|
+
style(:bar, :root),
|
25
|
+
style(:bar, :colors, color),
|
26
|
+
style(:bar, :sizes, size),
|
27
|
+
percentage < 100 ? "animate-pulse" : nil
|
28
|
+
)
|
29
|
+
|
30
|
+
text_classes = tw_merge(
|
31
|
+
style(:text, :root),
|
32
|
+
style(:text, :sizes, size)
|
33
|
+
)
|
34
|
+
|
35
|
+
view.render(
|
36
|
+
template_path,
|
37
|
+
value: value,
|
38
|
+
percentage: percentage,
|
39
|
+
text: text,
|
40
|
+
container_classes: container_classes,
|
41
|
+
bar_classes: bar_classes,
|
42
|
+
text_classes: text_classes,
|
43
|
+
options: options
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
register_styles :default do
|
48
|
+
{
|
49
|
+
container: {
|
50
|
+
root: "w-full bg-gray-200 rounded-sm overflow-hidden relative",
|
51
|
+
sizes: {
|
52
|
+
sm: "h-2",
|
53
|
+
md: "h-4",
|
54
|
+
lg: "h-6"
|
55
|
+
}
|
56
|
+
},
|
57
|
+
bar: {
|
58
|
+
root: "h-full transition-all duration-300 ease-out",
|
59
|
+
colors: {
|
60
|
+
primary: "bg-primary-600",
|
61
|
+
secondary: "bg-secondary-600",
|
62
|
+
success: "bg-success-600",
|
63
|
+
danger: "bg-danger-600",
|
64
|
+
warning: "bg-warning-600",
|
65
|
+
info: "bg-info-600",
|
66
|
+
default: "bg-gray-600"
|
67
|
+
},
|
68
|
+
sizes: {
|
69
|
+
sm: "h-2",
|
70
|
+
md: "h-4",
|
71
|
+
lg: "h-6"
|
72
|
+
}
|
73
|
+
},
|
74
|
+
text: {
|
75
|
+
root: "absolute inset-0 flex items-center justify-center font-medium text-white mix-blend-difference",
|
76
|
+
sizes: {
|
77
|
+
sm: "text-xs",
|
78
|
+
md: "text-sm",
|
79
|
+
lg: "text-base"
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -1,13 +1,4 @@
|
|
1
|
-
<%
|
2
|
-
# Get the main view context that has access to helpers
|
3
|
-
view_context = style_helper.view
|
4
|
-
|
5
|
-
options = {
|
6
|
-
exact: defined?(exact) ? exact : false,
|
7
|
-
class: style_helper.style(:link, :base),
|
8
|
-
active_class: style_helper.style(:link, :active)
|
9
|
-
}
|
10
|
-
%>
|
1
|
+
<% view_context = style_helper.view %>
|
11
2
|
<%= view_context.active_link_to path, options do %>
|
12
3
|
<% if defined?(initials) && initials.present? %>
|
13
4
|
<span class="<%= style_helper.style(:link, :initials, :base) %>"><%= initials %></span>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div
|
2
|
+
role="progressbar"
|
3
|
+
aria-valuenow="<%= percentage %>"
|
4
|
+
aria-valuemin="0"
|
5
|
+
aria-valuemax="100"
|
6
|
+
class="<%= container_classes %>"
|
7
|
+
<%= tag.attributes(options) %>
|
8
|
+
>
|
9
|
+
<div class="<%= bar_classes %>" style="width: <%= percentage %>%"></div>
|
10
|
+
<% if text.present? %>
|
11
|
+
<div class="<%= text_classes %>">
|
12
|
+
<%= text %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
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.
|
4
|
+
version: 0.1.12
|
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-
|
11
|
+
date: 2025-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -1397,6 +1397,7 @@ files:
|
|
1397
1397
|
- app/helpers/okonomi_ui_kit/components/page.rb
|
1398
1398
|
- app/helpers/okonomi_ui_kit/components/page_header.rb
|
1399
1399
|
- app/helpers/okonomi_ui_kit/components/page_section.rb
|
1400
|
+
- app/helpers/okonomi_ui_kit/components/progress_bar.rb
|
1400
1401
|
- app/helpers/okonomi_ui_kit/components/table.rb
|
1401
1402
|
- app/helpers/okonomi_ui_kit/components/typography.rb
|
1402
1403
|
- app/helpers/okonomi_ui_kit/config.rb
|
@@ -1434,6 +1435,7 @@ files:
|
|
1434
1435
|
- app/views/okonomi/components/page/_page.html.erb
|
1435
1436
|
- app/views/okonomi/components/page_header/_page_header.html.erb
|
1436
1437
|
- app/views/okonomi/components/page_section/_page_section.html.erb
|
1438
|
+
- app/views/okonomi/components/progress_bar/_progress_bar.html.erb
|
1437
1439
|
- app/views/okonomi/components/table/_table.html.erb
|
1438
1440
|
- app/views/okonomi/components/typography/_typography.html.erb
|
1439
1441
|
- app/views/okonomi/forms/tailwind/_checkbox_label.html.erb
|