@ably/ui 11.7.1 → 12.0.0-dev.31bc8d9
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.
- package/README.md +6 -9
- package/core/.DS_Store +0 -0
- package/core/Code/component.css +2 -0
- package/core/ContactFooter.jsx +8 -8
- package/core/DropdownMenu.jsx +1 -1
- package/core/FeaturedLink/component.css +0 -15
- package/core/FeaturedLink/component.js +1 -1
- package/core/FeaturedLink.jsx +17 -6
- package/core/Flash/component.css +0 -4
- package/core/Flash.jsx +1 -1
- package/core/Footer/component.css +3 -3
- package/core/Footer.jsx +14 -14
- package/core/Meganav/component.css +6 -6
- package/core/Meganav.jsx +23 -12
- package/core/MeganavBlogPostsList.jsx +17 -6
- package/core/MeganavContentCompany.jsx +17 -6
- package/core/MeganavContentProducts.jsx +19 -8
- package/core/MeganavItemsMobile.jsx +17 -6
- package/core/MeganavItemsSignedIn.jsx +17 -6
- package/core/MeganavSearch.jsx +17 -6
- package/core/MeganavSearchPanel.jsx +17 -6
- package/core/MeganavSearchSuggestions.jsx +17 -6
- package/core/Notice/component.js +1 -1
- package/core/Notice.jsx +4 -4
- package/core/Showcase/component.css +2 -0
- package/core/Showcase/component.js +6 -1
- package/core/Showcase.jsx +3 -0
- package/core/Uptime/component.css +4 -3
- package/core/Uptime/component.js +6 -1
- package/core/Uptime.jsx +65 -28
- package/core/fonts/jetBrains-mono.css +3 -0
- package/core/fonts/manrope.css +3 -0
- package/core/scripts.js +1 -1
- package/core/styles.css +232 -124
- package/package.json +2 -5
- package/src/core/.DS_Store +0 -0
- package/src/core/ContactFooter/component.jsx +8 -8
- package/src/core/DropdownMenu/component.jsx +1 -1
- package/src/core/FeaturedLink/component.js +0 -1
- package/src/core/FeaturedLink/component.jsx +27 -4
- package/src/core/Flash/component.css +0 -4
- package/src/core/Flash/component.jsx +1 -1
- package/src/core/Footer/component.css +3 -3
- package/src/core/Footer/component.jsx +14 -14
- package/src/core/Meganav/component.css +6 -6
- package/src/core/MeganavContentProducts/component.jsx +2 -2
- package/src/core/Notice/component.jsx +3 -3
- package/src/core/fonts/jetBrains-mono.css +3 -0
- package/src/core/fonts/manrope.css +3 -0
- package/src/core/react-renderer.js +7 -4
- package/src/core/styles/buttons.css +5 -5
- package/src/core/styles/forms.css +5 -5
- package/src/core/styles/properties.css +153 -52
- package/src/core/styles/text.css +68 -61
- package/src/core/styles.components.css +1 -1
- package/src/core/utils/syntax-highlighter.css +2 -0
- package/tailwind.config.js +194 -69
- package/tailwind.extend.js +1 -4
- package/src/core/Code/component.html.erb +0 -3
- package/src/core/Code/component.rb +0 -12
- package/src/core/ContactFooter/component.html.erb +0 -32
- package/src/core/ContactFooter/component.rb +0 -13
- package/src/core/CustomerLogos/component.html.erb +0 -9
- package/src/core/CustomerLogos/component.rb +0 -14
- package/src/core/FeatureFooter/component.html.erb +0 -54
- package/src/core/FeatureFooter/component.rb +0 -30
- package/src/core/FeaturedLink/component.css +0 -15
- package/src/core/FeaturedLink/component.html.erb +0 -6
- package/src/core/FeaturedLink/component.rb +0 -19
- package/src/core/Footer/component.html.erb +0 -256
- package/src/core/Footer/component.rb +0 -14
- package/src/core/Icon/component.html.erb +0 -3
- package/src/core/Icon/component.rb +0 -25
- package/src/core/Loader/component.html.erb +0 -18
- package/src/core/Loader/component.rb +0 -19
- package/src/core/Logo/component.html.erb +0 -3
- package/src/core/Logo/component.rb +0 -31
- package/src/core/Meganav/component.html.erb +0 -31
- package/src/core/Meganav/component.rb +0 -60
- package/src/core/MeganavBlogPostsList/component.html.erb +0 -5
- package/src/core/MeganavBlogPostsList/component.rb +0 -13
- package/src/core/MeganavContentCompany/component.html.erb +0 -90
- package/src/core/MeganavContentCompany/component.rb +0 -14
- package/src/core/MeganavContentDevelopers/component.html.erb +0 -129
- package/src/core/MeganavContentDevelopers/component.rb +0 -13
- package/src/core/MeganavContentProducts/component.html.erb +0 -83
- package/src/core/MeganavContentProducts/component.rb +0 -14
- package/src/core/MeganavContentUseCases/component.html.erb +0 -135
- package/src/core/MeganavContentUseCases/component.rb +0 -13
- package/src/core/MeganavControl/component.html.erb +0 -6
- package/src/core/MeganavControl/component.rb +0 -20
- package/src/core/MeganavControlMobileDropdown/component.html.erb +0 -7
- package/src/core/MeganavControlMobileDropdown/component.rb +0 -11
- package/src/core/MeganavControlMobilePanelClose/component.html.erb +0 -12
- package/src/core/MeganavControlMobilePanelClose/component.rb +0 -12
- package/src/core/MeganavControlMobilePanelOpen/component.html.erb +0 -7
- package/src/core/MeganavControlMobilePanelOpen/component.rb +0 -9
- package/src/core/MeganavItemsDesktop/component.html.erb +0 -17
- package/src/core/MeganavItemsDesktop/component.rb +0 -23
- package/src/core/MeganavItemsMobile/component.html.erb +0 -75
- package/src/core/MeganavItemsMobile/component.rb +0 -21
- package/src/core/MeganavItemsSignedIn/component.html.erb +0 -53
- package/src/core/MeganavItemsSignedIn/component.rb +0 -33
- package/src/core/MeganavSearch/component.html.erb +0 -15
- package/src/core/MeganavSearch/component.rb +0 -13
- package/src/core/MeganavSearchAutocomplete/component.html.erb +0 -6
- package/src/core/MeganavSearchAutocomplete/component.rb +0 -6
- package/src/core/MeganavSearchPanel/component.html.erb +0 -22
- package/src/core/MeganavSearchPanel/component.rb +0 -13
- package/src/core/MeganavSearchSuggestions/component.html.erb +0 -22
- package/src/core/MeganavSearchSuggestions/component.rb +0 -18
- package/src/core/Notice/component.html.erb +0 -16
- package/src/core/Notice/component.rb +0 -29
- package/src/core/Showcase/component.css +0 -30
- package/src/core/Showcase/component.html.erb +0 -76
- package/src/core/Showcase/component.js +0 -180
- package/src/core/Showcase/component.jsx +0 -0
- package/src/core/Showcase/component.rb +0 -190
- package/src/core/SignOutLink/component.html.erb +0 -1
- package/src/core/SignOutLink/component.rb +0 -17
- package/src/core/Slider/component.html.erb +0 -28
- package/src/core/Slider/component.rb +0 -38
- package/src/core/Uptime/component.css +0 -128
- package/src/core/Uptime/component.html.erb +0 -0
- package/src/core/Uptime/component.js +0 -1
- package/src/core/Uptime/component.jsx +0 -186
- package/src/core/Uptime/component.rb +0 -7
- package/src/core/core.rb +0 -81
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
module AblyUi
|
|
2
|
-
module Core
|
|
3
|
-
class Showcase < ViewComponent::Base
|
|
4
|
-
include AblyUi::Core::Util
|
|
5
|
-
def initialize(companies: default_companies, layout: 'quotes')
|
|
6
|
-
@random_id = append_random_postfix('showcase-slides')
|
|
7
|
-
@companies = companies
|
|
8
|
-
@layout = layout
|
|
9
|
-
@companies_data_cache = nil
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def companies_data
|
|
13
|
-
@companies_data_cache ||=
|
|
14
|
-
@companies.map do |key|
|
|
15
|
-
logo = company_logos[key]
|
|
16
|
-
logo[:layout] = @layout
|
|
17
|
-
|
|
18
|
-
content = @layout != 'quotes' ? case_studies : quotations
|
|
19
|
-
|
|
20
|
-
if !content[key]
|
|
21
|
-
# Exception errors can not be rescued
|
|
22
|
-
raise Exception.new "Showcase Error: Can't find content item [#{key}] for layout [#{@layout}]"
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
logo.merge(content[key])
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def default_companies
|
|
30
|
-
%i[hubspot vitac split]
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def company_logos
|
|
34
|
-
{
|
|
35
|
-
hubspot: {
|
|
36
|
-
name: 'Hubspot',
|
|
37
|
-
logo:
|
|
38
|
-
asset_path('ably_ui/core/images/cust-logo-hubspot-col-pos.png'),
|
|
39
|
-
logo2x:
|
|
40
|
-
asset_path('ably_ui/core/images/cust-logo-hubspot-col-pos@2x.png')
|
|
41
|
-
},
|
|
42
|
-
vitac: {
|
|
43
|
-
name: 'Vitac',
|
|
44
|
-
logo: asset_path('ably_ui/core/images/cust-logo-vitac-col-pos.png'),
|
|
45
|
-
logo2x:
|
|
46
|
-
asset_path('ably_ui/core/images/cust-logo-vitac-col-pos@2x.png')
|
|
47
|
-
},
|
|
48
|
-
split: {
|
|
49
|
-
name: 'Split',
|
|
50
|
-
logo: asset_path('ably_ui/core/images/cust-logo-split-col-pos.png'),
|
|
51
|
-
logo2x:
|
|
52
|
-
asset_path('ably_ui/core/images/cust-logo-split-col-pos@2x.png')
|
|
53
|
-
},
|
|
54
|
-
lightspeed: {
|
|
55
|
-
name: 'Lightspeed',
|
|
56
|
-
logo:
|
|
57
|
-
asset_path(
|
|
58
|
-
'ably_ui/core/images/cust-logo-lightspeed-syst-col-pos.png'
|
|
59
|
-
),
|
|
60
|
-
logo2x:
|
|
61
|
-
asset_path(
|
|
62
|
-
'ably_ui/core/images/cust-logo-lightspeed-syst-col-pos@2x.png'
|
|
63
|
-
)
|
|
64
|
-
},
|
|
65
|
-
australian_open: {
|
|
66
|
-
name: 'Australian Open',
|
|
67
|
-
logo:
|
|
68
|
-
asset_path('ably_ui/core/images/cust-logo-ausopen-col-pos.png'),
|
|
69
|
-
logo2x:
|
|
70
|
-
asset_path('ably_ui/core/images/cust-logo-ausopen-col-pos@2x.png')
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def quotations
|
|
76
|
-
{
|
|
77
|
-
hubspot: {
|
|
78
|
-
quote:
|
|
79
|
-
"Ably’s realtime infrastructure layer seamlessly supports HubSpot's entire realtime needs and helps us meet technical, business, and product development requirements.",
|
|
80
|
-
author: {
|
|
81
|
-
name: 'Max Freiert',
|
|
82
|
-
thumbnail:
|
|
83
|
-
asset_path(
|
|
84
|
-
'ably_ui/core/images/cust-photo-hubspot-max-freiert.jpg'
|
|
85
|
-
),
|
|
86
|
-
title: 'Product Group Lead / HubSpot'
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
vitac: {
|
|
90
|
-
quote:
|
|
91
|
-
'In a high-stakes, highly competitive industry, VITAC sought a provider that could operate realtime infrastructure for transporting live data to end-users via a complex, multi-hop process. In media accessibility environments - where there’s zero margin for error - Ably’s infrastructure performs and exceeds expectations.',
|
|
92
|
-
author: {
|
|
93
|
-
name: 'Joe Antonio',
|
|
94
|
-
thumbnail:
|
|
95
|
-
asset_path(
|
|
96
|
-
'ably_ui/core/images/cust-photo-vitac-joe-antonio.jpg'
|
|
97
|
-
),
|
|
98
|
-
title: 'Chief Information Officer / VITAC'
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
split: {
|
|
102
|
-
quote:
|
|
103
|
-
'You miss so much by not using a platform like Ably. When you need to implement a new feature, the capabilities are there, ready to go. Or when you need to scale, the capacity is seamlessly available. There’s no need to even think about these things. Building on Ably was the only logical choice because we managed to bypass a hefty DevOps debt and rapidly ship our new streaming capabilities while keeping our architecture as simple and reliable as possible.',
|
|
104
|
-
author: {
|
|
105
|
-
name: 'Pato Echagüe',
|
|
106
|
-
thumbnail:
|
|
107
|
-
asset_path(
|
|
108
|
-
'ably_ui/core/images/cust-photo-split-pato-echague.jpg'
|
|
109
|
-
),
|
|
110
|
-
title: 'Chief Technical Officer / Split'
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
def case_studies
|
|
117
|
-
{
|
|
118
|
-
hubspot: {
|
|
119
|
-
columns: [
|
|
120
|
-
{
|
|
121
|
-
heading: '$600k',
|
|
122
|
-
text: 'annual savings on infrastructure and DevOps'
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
heading: 'LIVE CHAT AND REMOTE COLLABORATION',
|
|
126
|
-
text:
|
|
127
|
-
"Ably’s realtime platform seamlessly supports HubSpot's entire realtime needs and helps us meet technical, business, and product development, requirements.",
|
|
128
|
-
button: {
|
|
129
|
-
label: 'View case study',
|
|
130
|
-
href: '#'
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
},
|
|
135
|
-
lightspeed: {
|
|
136
|
-
columns: [
|
|
137
|
-
{
|
|
138
|
-
heading: '75 million',
|
|
139
|
-
text: 'Students supported in 28,000 schools in 38 countries'
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
heading: 'REMOTE LEARNING AND DEVICE MANAGEMENT',
|
|
143
|
-
text:
|
|
144
|
-
'Lightspeed Systems relies on Ably’s realtime platform to enable realtime student safety for remote and classroom learning solutions at scale.',
|
|
145
|
-
button: {
|
|
146
|
-
label: 'View case study',
|
|
147
|
-
href: '#'
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
]
|
|
151
|
-
},
|
|
152
|
-
australian_open: {
|
|
153
|
-
columns: [
|
|
154
|
-
{
|
|
155
|
-
heading: '1.2 million',
|
|
156
|
-
text: 'Fans receiving billions of realtime messages'
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
heading: 'SPORTS, MEDIA, & AUDIENCE ENGAGEMENT',
|
|
160
|
-
text:
|
|
161
|
-
'Only Ably meets The Australian Open’s exacting performance targets, reliably delivering realtime scores, updates and commentary to a huge global fan base.',
|
|
162
|
-
button: {
|
|
163
|
-
label: 'View case study',
|
|
164
|
-
href: '#'
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
},
|
|
169
|
-
split: {
|
|
170
|
-
columns: [
|
|
171
|
-
{
|
|
172
|
-
heading: '>1 trillion',
|
|
173
|
-
text: 'Monthly feature flags sent over Ably’s network'
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
heading: 'REALTIME FEATURE FLAGS AND ANALYTICS',
|
|
177
|
-
text:
|
|
178
|
-
'Ably’s realtime platform and SSE support enable Split to deliver more than one trillion business-critical feature flags to tens of millions of client apps every month.',
|
|
179
|
-
button: {
|
|
180
|
-
label: 'View case study',
|
|
181
|
-
href: '#'
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
]
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
end
|
|
188
|
-
end
|
|
189
|
-
end
|
|
190
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<%= link_to @session_data[:logOut][:text], abs_url(@session_data[:logOut][:href]), method: :delete, class: @classes, data: { id: "meganav-link" } %>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
module AblyUi
|
|
4
|
-
module Core
|
|
5
|
-
class SignOutLink < ViewComponent::Base
|
|
6
|
-
include Util
|
|
7
|
-
|
|
8
|
-
attr_reader :url_base
|
|
9
|
-
|
|
10
|
-
def initialize(session_data: {}, classes: [], url_base:)
|
|
11
|
-
@session_data = session_data
|
|
12
|
-
@classes = classes
|
|
13
|
-
@url_base = url_base
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<%= tag.div class: "w-full overflow-x-hidden", data: { id: "slider" }, style: "--dynamic-grid-columns-count: #{slides.length}; --dynamic-grid-column-min-width: #{slide_min_width}; --dynamic-grid-column-max-width: #{slide_max_width};" do %>
|
|
2
|
-
<%= tag.ol class: "grid ui-grid-gap grid-cols-dynamic transform transition-transform #{classes}", data: { id: "slider-strip" }, **additional_attributes do %>
|
|
3
|
-
<% slides.each do |slide| %>
|
|
4
|
-
<%= slide %>
|
|
5
|
-
<% end %>
|
|
6
|
-
<% end %>
|
|
7
|
-
|
|
8
|
-
<div class="hidden justify-center items-center my-24" data-id="slider-controls">
|
|
9
|
-
<button type="button" class="p-0 w-24 h-24 flex items-center focus:outline-gui-focus" data-id="slider-previous">
|
|
10
|
-
<%= render(AblyUi::Core::Icon.new(name: "icon-gui-disclosure-arrow", size: "1.5rem", color: "text-cool-black", additional_css: "transform rotate-180")) %>
|
|
11
|
-
</button>
|
|
12
|
-
|
|
13
|
-
<ul class="flex justify-center items-center mx-32 relative h-24">
|
|
14
|
-
<% slides.each do |slide| %>
|
|
15
|
-
<li>
|
|
16
|
-
<span
|
|
17
|
-
class="ui-slider-marker text-cool-black"
|
|
18
|
-
data-id="slider-marker"
|
|
19
|
-
>⬤</span> <%# ⬤ %>
|
|
20
|
-
</li>
|
|
21
|
-
<% end %>
|
|
22
|
-
</ul>
|
|
23
|
-
|
|
24
|
-
<button type="button" class="p-0 w-24 h-24 flex items-center focus:outline-gui-focus" data-id="slider-next">
|
|
25
|
-
<%= render(AblyUi::Core::Icon.new(name: "icon-gui-disclosure-arrow", size: "1.5rem", color: "text-cool-black")) %>
|
|
26
|
-
</button>
|
|
27
|
-
</div>
|
|
28
|
-
<% end %>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
module AblyUi
|
|
2
|
-
module Core
|
|
3
|
-
class Slider < ViewComponent::Base
|
|
4
|
-
attr_reader :classes,
|
|
5
|
-
:additional_attributes,
|
|
6
|
-
:slide_min_width,
|
|
7
|
-
:slide_max_width
|
|
8
|
-
|
|
9
|
-
renders_many :slides, 'Slide'
|
|
10
|
-
|
|
11
|
-
def initialize(
|
|
12
|
-
classes: '',
|
|
13
|
-
slide_min_width: '16.875rem',
|
|
14
|
-
slide_max_width: '1fr',
|
|
15
|
-
**additional_attributes
|
|
16
|
-
)
|
|
17
|
-
@classes = classes
|
|
18
|
-
@additional_attributes = additional_attributes
|
|
19
|
-
@slide_min_width = slide_min_width
|
|
20
|
-
@slide_max_width = slide_max_width
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
class Slide < ViewComponent::Base
|
|
24
|
-
attr_reader :classes
|
|
25
|
-
|
|
26
|
-
def initialize(classes: '')
|
|
27
|
-
@classes = classes
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def call
|
|
31
|
-
tag.li class: classes, data: { id: 'slider-slide' } do
|
|
32
|
-
content
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
@layer components {
|
|
2
|
-
.ui-uptime-widget {
|
|
3
|
-
--status-up: var(--uptime-color-up);
|
|
4
|
-
--status-trouble: var(--uptime-color-trouble);
|
|
5
|
-
--status-down: var(--uptime-color-down);
|
|
6
|
-
--ui-uptime-key-size: 1.625rem;
|
|
7
|
-
--tooltip-offset: 3.5rem;
|
|
8
|
-
|
|
9
|
-
@apply font-sans antialiased;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.ui-uptime-list {
|
|
13
|
-
@apply flex flex-wrap flex-row list-none p-0 m-0 items-center;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.ui-uptime-day {
|
|
17
|
-
@apply h-40 relative flex-auto p-0 my-0 mx-1 bg-cool-black;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.ui-uptime-day span {
|
|
21
|
-
@apply absolute text-p3 border rounded-lg border-light-grey;
|
|
22
|
-
@apply py-12 px-16 shadow-tooltip text-cool-black;
|
|
23
|
-
@apply bg-white text-left z-10 hidden;
|
|
24
|
-
@apply overflow-y-hidden not-italic leading-tight;
|
|
25
|
-
@apply whitespace-nowrap;
|
|
26
|
-
|
|
27
|
-
transform: translateX(-50%);
|
|
28
|
-
max-height: 12rem;
|
|
29
|
-
bottom: 130%;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.ui-uptime-day:hover {
|
|
33
|
-
filter: brightness(1.2);
|
|
34
|
-
@apply z-10;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.ui-uptime-day:hover span {
|
|
38
|
-
display: block;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.ui-uptime-day.ui-uptime-align-left span {
|
|
42
|
-
left: 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.ui-uptime-day.ui-uptime-align-right span {
|
|
46
|
-
right: 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.ui-uptime-day .ui-uptime-width-wide {
|
|
50
|
-
@apply whitespace-normal;
|
|
51
|
-
width: 8rem;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.ui-uptime-day .ui-uptime-width-extra-wide {
|
|
55
|
-
@apply whitespace-normal;
|
|
56
|
-
width: 12rem;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.ui-uptime-seperator {
|
|
60
|
-
@apply my-12 h-1 w-full relative;
|
|
61
|
-
@apply sm:w-32 sm:h-80 sm:m-0 sm:bg-none;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.ui-uptime-seperator:before {
|
|
65
|
-
content: "";
|
|
66
|
-
left: 48%;
|
|
67
|
-
@apply sm:absolute sm:h-full sm:w-1 sm:bg-dark-grey sm:z-0;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.ui-uptime-up {
|
|
71
|
-
background: var(--status-up);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.ui-uptime-trouble {
|
|
75
|
-
background: var(--status-trouble);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.ui-uptime-down {
|
|
79
|
-
background: var(--status-down);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.ui-uptime-legend {
|
|
83
|
-
@apply flex flex-col sm:flex-row sm:items-center;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.ui-uptime-key {
|
|
87
|
-
@apply block mt-16 mr-20 bg-transparent;
|
|
88
|
-
@apply sm:inline-block sm:mt-0;
|
|
89
|
-
@apply font-light text-p2 text-white block sm:inline-flex items-center;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.ui-uptime-key:first-child {
|
|
93
|
-
@apply mt-0;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.ui-uptime-key::before {
|
|
97
|
-
content: " ";
|
|
98
|
-
width: var(--ui-uptime-key-size);
|
|
99
|
-
height: var(--ui-uptime-key-size);
|
|
100
|
-
@apply inline-block mr-16 bg-cool-black align-text-bottom rounded-full;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.ui-uptime-key.ui-uptime-up:before {
|
|
104
|
-
background: var(--status-up);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.ui-uptime-key.ui-uptime-trouble:before {
|
|
108
|
-
background: var(--status-trouble);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.ui-uptime-key.ui-uptime-down:before {
|
|
112
|
-
background: var(--status-down);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.ui-uptime-footer {
|
|
116
|
-
@apply mt-40 flex justify-between items-start flex-col;
|
|
117
|
-
@apply sm:flex-row sm:items-center;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.ui-uptime-link-back {
|
|
121
|
-
@apply mt-40 whitespace-nowrap;
|
|
122
|
-
@apply sm:mt-0;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.ui-uptime-link-back a {
|
|
126
|
-
@apply text-p1 text-gui-default font-medium no-underline;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./component.css";
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
import T from "prop-types";
|
|
3
|
-
|
|
4
|
-
import FeaturedLink from "../FeaturedLink/component.jsx";
|
|
5
|
-
|
|
6
|
-
export const themes = {
|
|
7
|
-
light: {
|
|
8
|
-
text: "text-cool-black",
|
|
9
|
-
iconColor: "text-cool-black",
|
|
10
|
-
},
|
|
11
|
-
dark: {
|
|
12
|
-
text: "text-white",
|
|
13
|
-
iconColor: "text-white",
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const ThemeContext = React.createContext();
|
|
18
|
-
|
|
19
|
-
function StatusLegend({ metadata, textColor }) {
|
|
20
|
-
const items = Object.entries(metadata[0]).map((e) => {
|
|
21
|
-
const [id, text] = e;
|
|
22
|
-
const classname = `ui-uptime-key ui-uptime-${id} ${textColor}`;
|
|
23
|
-
return (
|
|
24
|
-
<span key={id} className={classname}>
|
|
25
|
-
{text}
|
|
26
|
-
</span>
|
|
27
|
-
);
|
|
28
|
-
});
|
|
29
|
-
return <div className="ui-uptime-legend">{items}</div>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function applyAlignment(value, i, count = 8) {
|
|
33
|
-
const before = i < value + count;
|
|
34
|
-
const after = i > value - count;
|
|
35
|
-
|
|
36
|
-
if (i > 0 && !(before && after)) return null;
|
|
37
|
-
|
|
38
|
-
const align = i === 0 || i > value ? "left" : "right";
|
|
39
|
-
const diff = value - i;
|
|
40
|
-
const amount = Math.abs(diff) || 0;
|
|
41
|
-
const sign = i > value ? -1 : 1;
|
|
42
|
-
|
|
43
|
-
return { align, amount, sign };
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function UptimeGraph({ collection }) {
|
|
47
|
-
// add 30 day split deliminators
|
|
48
|
-
collection.splice(29, 0, null);
|
|
49
|
-
collection.splice(60, 0, null);
|
|
50
|
-
|
|
51
|
-
const MAX_TOOLTIP_CHAR_LENGTH = 80;
|
|
52
|
-
|
|
53
|
-
const items = collection.map((row, i) => {
|
|
54
|
-
if (!row) return <li key={i} className="ui-uptime-seperator"></li>;
|
|
55
|
-
|
|
56
|
-
const [alignment = {}] = [0, 29, 60, 91].map((value) => applyAlignment(value, i)).filter((s) => s);
|
|
57
|
-
const { align = null, amount = null, sign = null } = alignment;
|
|
58
|
-
const labelAlign = alignment && `ui-uptime-align-${align}`;
|
|
59
|
-
const classname = `ui-uptime-day ui-uptime-${row.class} ${labelAlign}`.trim();
|
|
60
|
-
|
|
61
|
-
const { label } = row;
|
|
62
|
-
const { length } = label.trim();
|
|
63
|
-
|
|
64
|
-
const tooltext = length < MAX_TOOLTIP_CHAR_LENGTH ? label : label.slice(0, MAX_TOOLTIP_CHAR_LENGTH - 1) + "…";
|
|
65
|
-
const width = (length > MAX_TOOLTIP_CHAR_LENGTH - 10 && "extra-wide") || (length > MAX_TOOLTIP_CHAR_LENGTH / 2 && "wide") || "normal";
|
|
66
|
-
const translateX = Math.min((Math.max(amount - 1, 0) * 10) >> 0, 50) * sign;
|
|
67
|
-
const transform = align ? { transform: `translateX(${translateX}%)` } : {};
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<li key={i} className={classname}>
|
|
71
|
-
<span className={`ui-uptime-width-${width}`} style={transform}>
|
|
72
|
-
{tooltext}
|
|
73
|
-
</span>
|
|
74
|
-
</li>
|
|
75
|
-
);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<div className="ui-uptime-graph">
|
|
80
|
-
<ul className="ui-uptime-list">{items}</ul>
|
|
81
|
-
</div>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function StatusCtaLink({ href, text }) {
|
|
86
|
-
return (
|
|
87
|
-
<div className="ui-uptime-link-back">
|
|
88
|
-
<ThemeContext.Consumer>
|
|
89
|
-
{({ iconColor }) => (
|
|
90
|
-
<FeaturedLink url={href} iconColor={iconColor}>
|
|
91
|
-
{text}
|
|
92
|
-
</FeaturedLink>
|
|
93
|
-
)}
|
|
94
|
-
</ThemeContext.Consumer>
|
|
95
|
-
</div>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function StatusFooter({ metadata, href, text }) {
|
|
100
|
-
return (
|
|
101
|
-
<div className="ui-uptime-footer">
|
|
102
|
-
<ThemeContext.Consumer>{({ text }) => <StatusLegend {...{ metadata }} textColor={text} />}</ThemeContext.Consumer>
|
|
103
|
-
<StatusCtaLink {...{ href, text }} />
|
|
104
|
-
</div>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function handleError(err) {
|
|
109
|
-
// output a message and normalise schema
|
|
110
|
-
console.warn("Uptime Error", err);
|
|
111
|
-
const { message } = err || {};
|
|
112
|
-
return { error: true, message };
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export default function Uptime({ serverUrl, linkTo = null, theme = "light" }) {
|
|
116
|
-
if (!serverUrl) throw new Error("Server endpoint URL required");
|
|
117
|
-
|
|
118
|
-
const [data, setData] = useState(null);
|
|
119
|
-
const { collection, metadata } = data || {};
|
|
120
|
-
const showFooterRow = linkTo?.href && linkTo?.text;
|
|
121
|
-
|
|
122
|
-
useEffect(() => {
|
|
123
|
-
const fetchEndpointJson = async () => {
|
|
124
|
-
let payload = null;
|
|
125
|
-
try {
|
|
126
|
-
payload = await fetch(serverUrl);
|
|
127
|
-
payload = await payload.json();
|
|
128
|
-
const { chart_data: collection, chart_legend: metadata } = payload;
|
|
129
|
-
payload = { collection, metadata };
|
|
130
|
-
} catch (err) {
|
|
131
|
-
payload = handleError(err);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
setData(payload);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
fetchEndpointJson();
|
|
138
|
-
}, []);
|
|
139
|
-
|
|
140
|
-
if (data && data.error) {
|
|
141
|
-
return (
|
|
142
|
-
<div
|
|
143
|
-
className={`flex sm:flex-row justify-center items-center p-24 border rounded font-sans font-light text-p2 ${themes[theme].text}`}
|
|
144
|
-
data-id="uptime-error"
|
|
145
|
-
>
|
|
146
|
-
Sorry, we can’t retrieve uptime data right now.
|
|
147
|
-
</div>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return (
|
|
152
|
-
data && (
|
|
153
|
-
<ThemeContext.Provider value={themes[theme]}>
|
|
154
|
-
<div className="ui-uptime-widget" data-id="uptime">
|
|
155
|
-
<UptimeGraph {...{ collection }} />
|
|
156
|
-
{showFooterRow && <StatusFooter {...{ metadata, ...linkTo }} />}
|
|
157
|
-
</div>
|
|
158
|
-
</ThemeContext.Provider>
|
|
159
|
-
)
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
UptimeGraph.propTypes = {
|
|
163
|
-
collection: T.array,
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
StatusLegend.propTypes = {
|
|
167
|
-
metadata: T.array,
|
|
168
|
-
textColor: T.string,
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
StatusFooter.propTypes = {
|
|
172
|
-
metadata: T.array,
|
|
173
|
-
href: T.string,
|
|
174
|
-
text: T.string,
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
StatusCtaLink.propTypes = {
|
|
178
|
-
href: T.string,
|
|
179
|
-
text: T.string,
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
Uptime.propTypes = {
|
|
183
|
-
serverUrl: T.string,
|
|
184
|
-
linkTo: T.object,
|
|
185
|
-
theme: T.oneOf(["light", "dark"]),
|
|
186
|
-
};
|
package/src/core/core.rb
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
MEGANAV_DATA =
|
|
4
|
-
JSON.parse(
|
|
5
|
-
File.read(File.join(File.dirname(__FILE__), 'meganav', 'component.json'))
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
module AblyUi
|
|
9
|
-
module Core
|
|
10
|
-
module MeganavConfig
|
|
11
|
-
def theme_setup(theme_name)
|
|
12
|
-
@theme_name = theme_name
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def themes
|
|
16
|
-
MEGANAV_DATA['themes'].deep_transform_keys do |key|
|
|
17
|
-
key.underscore.to_sym
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def panels
|
|
22
|
-
MEGANAV_DATA['panels'].map do |panel|
|
|
23
|
-
panel.deep_transform_keys { |key| key.underscore.to_sym }
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def theme(style)
|
|
28
|
-
themes[@theme_name][style]
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
module SharedAssets
|
|
33
|
-
def ably_logo
|
|
34
|
-
asset_path 'ably_ui/core/images/ably-logo.png'
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def ably_stack_path
|
|
38
|
-
asset_path 'ably_ui/core/images/ably-stack.svg'
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def aws_logo_path
|
|
42
|
-
asset_path 'ably_ui/core/images/icon-tech-aws.svg'
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def highest_performer
|
|
46
|
-
asset_path 'ably_ui/core/images/high-performer-2023.svg'
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def highest_user_adoption
|
|
50
|
-
asset_path 'ably_ui/core/images/highest-user-adoption-2023.svg'
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def best_support
|
|
54
|
-
asset_path 'ably_ui/core/images/best-support-2023.svg'
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def fastest_implementation
|
|
58
|
-
asset_path 'ably_ui/core/images/fastest-implementation-2023.svg'
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
module Util
|
|
63
|
-
# For components which use relative links we need an option to set a base URL because they might be used
|
|
64
|
-
# on a different domain (like pages.ably.com). The below sets a default method to be used in templates but
|
|
65
|
-
# requires the definition of url_base.
|
|
66
|
-
DEFAULT_URL_BASE = ''
|
|
67
|
-
|
|
68
|
-
def abs_url(path)
|
|
69
|
-
"#{url_base}#{path}"
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
# This is useful where we need to use an HTML id (like in aria-controls attribute) but we know the component
|
|
73
|
-
# might be used multiple times per page so we can't just hard code one in HTML.
|
|
74
|
-
# eg. my-component -> my-component-uur0cj2h
|
|
75
|
-
# credits https://gist.github.com/mbajur/2aba832a6df3fc31fe7a82d3109cb626
|
|
76
|
-
def append_random_postfix(id)
|
|
77
|
-
"#{id}-#{rand(36**8).to_s(36)}"
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
end
|