okonomi_ui_kit 0.1.11 → 0.1.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6b5c9889118d0c98bea77960f48a3ff9fb1fa514c5d4ebd9295efce29b63ab8
4
- data.tar.gz: 11b96764a850723bc49e3219357525ef8027325b36877dac95b21cb727d0b336
3
+ metadata.gz: adca3d7c87bf516fc8f0e4d46eaab53f413939422d69d764333c4567c4cb851c
4
+ data.tar.gz: 229d5bad01930a081e3ed1350ef7c4aff21f00c00aa30603f0e63f6dc062d324
5
5
  SHA512:
6
- metadata.gz: 2af055854b937f8e833e13faa2a9499442e0308c8f821dcaf3376c2127b37316320b0984e549e3a0f6a5d38693d4fac019ec13c4b329f2b04ba3a91e4fcc0597
7
- data.tar.gz: 84f37782710b0c70b2f395cdd03735d0d0535beb0a1e640ca770b96620d1b14bdd93d382424f460f03d4adb701daf9894cc8a9078378c275e4544eb71f92393e
6
+ metadata.gz: 66ad9faf08d8102a80cd968b8866dc7969d8e96698ba34a1498cabaadac92cd8cf04e0e1720574bd199d2b45a73c664737ad1e834499a5cd9edd28cb7314ca00
7
+ data.tar.gz: 6877453a2cc1440568b5aa85e34b47597dfbeca1a1de7ba01b121ea79a500bcabb24d99aae9499bfaecc4e8e279cb6e4c53c424ef09d2b3d16ba333e85b18175
@@ -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;
@@ -659,6 +660,9 @@
659
660
  .h-0 {
660
661
  height: calc(var(--spacing) * 0);
661
662
  }
663
+ .h-1 {
664
+ height: calc(var(--spacing) * 1);
665
+ }
662
666
  .h-2 {
663
667
  height: calc(var(--spacing) * 2);
664
668
  }
@@ -1134,6 +1138,9 @@
1134
1138
  .rounded-xl {
1135
1139
  border-radius: var(--radius-xl);
1136
1140
  }
1141
+ .rounded-xs {
1142
+ border-radius: var(--radius-xs);
1143
+ }
1137
1144
  .rounded-l-md {
1138
1145
  border-top-left-radius: var(--radius-md);
1139
1146
  border-bottom-left-radius: var(--radius-md);
@@ -1347,6 +1354,9 @@
1347
1354
  background-color: color-mix(in oklab, var(--color-gray-500) 75%, transparent);
1348
1355
  }
1349
1356
  }
1357
+ .bg-gray-600 {
1358
+ background-color: var(--color-gray-600);
1359
+ }
1350
1360
  .bg-gray-900 {
1351
1361
  background-color: var(--color-gray-900);
1352
1362
  }
@@ -1356,6 +1366,9 @@
1356
1366
  .bg-green-100 {
1357
1367
  background-color: var(--color-green-100);
1358
1368
  }
1369
+ .bg-green-500 {
1370
+ background-color: var(--color-green-500);
1371
+ }
1359
1372
  .bg-green-600 {
1360
1373
  background-color: var(--color-green-600);
1361
1374
  }
@@ -1832,6 +1845,9 @@
1832
1845
  .opacity-100 {
1833
1846
  opacity: 100%;
1834
1847
  }
1848
+ .mix-blend-difference {
1849
+ mix-blend-mode: difference;
1850
+ }
1835
1851
  .shadow {
1836
1852
  --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
1853
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -1971,6 +1987,10 @@
1971
1987
  --tw-duration: 300ms;
1972
1988
  transition-duration: 300ms;
1973
1989
  }
1990
+ .duration-500 {
1991
+ --tw-duration: 500ms;
1992
+ transition-duration: 500ms;
1993
+ }
1974
1994
  .ease-in {
1975
1995
  --tw-ease: var(--ease-in);
1976
1996
  transition-timing-function: var(--ease-in);
@@ -9,7 +9,7 @@ module OkonomiUiKit
9
9
 
10
10
  variant = (html_options.delete(:variant) || "contained").to_sym
11
11
  color = (html_options.delete(:color) || "default").to_sym
12
-
12
+
13
13
  # Extract icon configuration
14
14
  icon_config, html_options = extract_icon_config(html_options)
15
15
 
@@ -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
- exact: exact,
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
@@ -4,7 +4,6 @@ export default class extends Controller {
4
4
  static values = { fieldId: String, equals: String }
5
5
 
6
6
  connect() {
7
- console.log("FormFieldVisibilityController connected")
8
7
  this.field = document.getElementById(this.fieldIdValue)
9
8
  if (this.field) {
10
9
  this.toggle()
@@ -15,10 +14,10 @@ export default class extends Controller {
15
14
  toggle() {
16
15
  let currentValue
17
16
 
18
- if (this.field.type === "checkbox") {
19
- currentValue = this.field.checked ? this.field.value : null
17
+ if (this.field.type === "checkbox" || this.field.type === "radio") {
18
+ currentValue = this.field.checked ? this.field.value : null;
20
19
  } else {
21
- currentValue = this.field.value
20
+ currentValue = this.field.value;
22
21
  }
23
22
 
24
23
  const shouldShow = currentValue === this.equalsValue
@@ -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>
@@ -1,3 +1,3 @@
1
1
  module OkonomiUiKit
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: okonomi_ui_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.13
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-05 00:00:00.000000000 Z
11
+ date: 2025-08-07 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