phlexi-display 0.0.8 → 0.0.9

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: 2769fddc7548d65fe3c5a46fd31d56189f3275a5b859cf881d68d993cc054159
4
- data.tar.gz: 8c35481e0f3c1853951c7bbaf93d0d697b10ed76522a874e65c789d7f0810d7d
3
+ metadata.gz: d8bdee00afb4ba64c975ad0b2fcd6b1113bf3eedfa0474049650ac4ea0af6ae5
4
+ data.tar.gz: 86728cf4c552e5fdc8863a8da6b401daf4fff4efcf395b57c9626d0df91b2fae
5
5
  SHA512:
6
- metadata.gz: 04fd1351780c29293a0ca4a174b6411cb6426723556fe70372079ea28f6aad9284e903bda95253536785e462a75ca95c6bfab98c5551ee34b5400c154c2a5eff
7
- data.tar.gz: cc9ac9256806372cb5b309aa332ed8ed8f62a83150b408f9e083724704015d8bba408f2a1cb2174c3106308db592654de5853e8bd9af08a51bc996951062d618
6
+ metadata.gz: dc2c0b30616142b0b0e7a191578e84ad0d0793ab609a14350fff35f613c5625a7dc71882fc3b0061ac9515da82c5a995a244381b0f3836406a47a94f8ba8f4c3
7
+ data.tar.gz: 1ec56eb7660eaa66aa89ea3fc45659f68eb23782d7535c1d1e6f93b976579443625289a8d14d6cb5f702f0d9619bffa8baa73efd8a2ce584e4b38c1cb6e0ca2e
@@ -45,10 +45,6 @@ module Phlexi
45
45
  create_component(Components::String, :text, **, &)
46
46
  end
47
47
 
48
- def phone_tag(**, &)
49
- create_component(Components::String, :phone, **, &)
50
- end
51
-
52
48
  # Creates a number display tag for the field.
53
49
  #
54
50
  # @param attributes [Hash] Additional attributes for the number display.
@@ -125,6 +121,14 @@ module Phlexi
125
121
  create_component(Components::Email, :email, **, &)
126
122
  end
127
123
 
124
+ # Creates a email display tag for the field.
125
+ #
126
+ # @param attributes [Hash] Additional attributes for the phone display.
127
+ # @return [Components::Email] The email component.
128
+ def phone_tag(**, &)
129
+ create_component(Components::Phone, :phone, **, &)
130
+ end
131
+
128
132
  # Creates a url display tag for the field.
129
133
  #
130
134
  # @param attributes [Hash] Additional attributes for the url display.
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Phlexi
4
+ module Display
5
+ module Components
6
+ class Phone < Base
7
+ include Concerns::DisplaysValue
8
+
9
+ def render_value(value)
10
+ a(**attributes, href: "tel:#{value}", target: "_blank") {
11
+ icon
12
+ plain value
13
+ }
14
+ end
15
+
16
+ protected
17
+
18
+ def icon
19
+ icon_theme = themed(:prefixed_icon)
20
+ svg(
21
+ xmlns: "http://www.w3.org/2000/svg",
22
+ width: icon_theme ? nil : "24",
23
+ height: icon_theme ? nil : "24",
24
+ class: icon_theme,
25
+ viewbox: "0 0 24 24",
26
+ fill: "none",
27
+ stroke: "currentColor",
28
+ stroke_width: "2",
29
+ stroke_linecap: "round",
30
+ stroke_linejoin: "round"
31
+ ) do |s|
32
+ s.path(stroke: "none", d: "M0 0h24v24H0z", fill: "none")
33
+ s.path(
34
+ d: "M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2"
35
+ )
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlexi
4
4
  module Display
5
- VERSION = "0.0.8"
5
+ VERSION = "0.0.9"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlexi-display
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-05 00:00:00.000000000 Z
11
+ date: 2024-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex
@@ -214,6 +214,7 @@ files:
214
214
  - lib/phlexi/display/components/label.rb
215
215
  - lib/phlexi/display/components/number.rb
216
216
  - lib/phlexi/display/components/password.rb
217
+ - lib/phlexi/display/components/phone.rb
217
218
  - lib/phlexi/display/components/placeholder.rb
218
219
  - lib/phlexi/display/components/string.rb
219
220
  - lib/phlexi/display/components/time.rb