File tree Expand file tree Collapse file tree 18 files changed +96
-25
lines changed Expand file tree Collapse file tree 18 files changed +96
-25
lines changed Original file line number Diff line number Diff line change @@ -4,19 +4,8 @@ div[data-controller="inputs-range-group"] {
4
4
}
5
5
6
6
.hourly-rate {
7
- display : flex ;
8
- flex-direction : row ;
9
7
background-color : #{$gray-900 } ;
10
- border-radius : $border-radius ;
11
- padding : 8px 4px ;
12
-
13
8
color : #{$gray-400 } ;
14
- text-align : center ;
15
- font-size : 18px ;
16
- font-style : normal ;
17
- font-weight : 700 ;
18
- line-height : 24px ;
19
- letter-spacing : 0.18px ;
20
9
}
21
10
22
11
.cost {
Original file line number Diff line number Diff line change @@ -42,12 +42,14 @@ <h6 class="h6"><%- title %></h6>
42
42
< div class ="tick-unit ">
43
43
< div class ="tick " data-inputs-range-group-target ="tick "> </ div >
44
44
45
+ <!-- large screen content -->
45
46
< div class ="d-none d-lg-flex flex-column text-nowrap mt-2 tick-text " data-inputs-range-group-target ="tickText ">
46
47
< % for info in item { %>
47
48
< div class ="legal-text fw-bold " > < %- info %> </ div >
48
49
< % } %>
49
50
</ div >
50
51
52
+ <!-- small screen content -->
51
53
< div class ="d-block d-lg-none ">
52
54
< div class ="flex-column text-nowrap mt-2 tick-text " data-inputs-range-group-target ="smScreenText ">
53
55
< % for info in item { %>
Original file line number Diff line number Diff line change @@ -4,8 +4,16 @@ export default class extends Controller {
4
4
static targets = [ "input" , "value" ]
5
5
6
6
choose ( e ) {
7
- this . inputTarget . value = e . target . innerHTML
8
- this . valueTarget . innerHTML = e . target . innerHTML
7
+ this . setValue ( e . target . innerHTML )
8
+ }
9
+
10
+ resetSelect ( ) {
11
+ this . setValue ( this . element . dataset . initial )
12
+ }
13
+
14
+ setValue ( value ) {
15
+ this . inputTarget . value = value
16
+ this . valueTarget . innerHTML = value
9
17
this . inputTarget . dispatchEvent ( new Event ( 'change' ) )
10
18
}
11
19
}
Original file line number Diff line number Diff line change 2
2
use crate::components::dropdown::Dropdown;
3
3
use crate::components::stimulus::stimulus_target::StimulusTarget;
4
4
%>
5
- < div data-controller ="inputs-select ">
5
+ < div data-controller ="inputs-select " data-initial =" <%- value.clone() %> " >
6
6
7
7
< % let mut dropdown = Dropdown::new()
8
8
.items(options)
29
29
30
30
< %+ dropdown %>
31
31
32
- < input type ="hidden " name ="<%= name %> " value ="<%= value %> " data-inputs-select-target ="input " < %- value_target %> data-action="< %- action %> " />
32
+ < input type ="hidden " name ="<%= name %> " value ="<%= value %> " data-inputs-select-target ="input " < %- value_target %> data-action="< %- action %> reset- > inputs-select#resetSelect " />
33
33
</ div >
Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ impl Switch {
60
60
self
61
61
}
62
62
63
- pub fn start_toggled ( mut self ) -> Switch {
64
- self . initial_state = State :: Right ;
63
+ pub fn default_position ( mut self , state : State ) -> Switch {
64
+ self . initial_state = state ;
65
65
self
66
66
}
67
67
Original file line number Diff line number Diff line change @@ -7,11 +7,12 @@ div[data-controller="inputs-switch"] {
7
7
}
8
8
9
9
.label {
10
- padding : 8px 20 px ;
10
+ padding : 8px 40 px ;
11
11
border-radius : 5rem ;
12
12
text-align : center ;
13
13
display : flex ;
14
14
justify-content : center ;
15
+ align-items : center ;
15
16
@extend .gap-2 ;
16
17
}
17
18
Original file line number Diff line number Diff line change @@ -33,4 +33,10 @@ div[data-controller="inputs-text-editable-header"] {
33
33
padding : 0px ;
34
34
margin-bottom : -2px ; // compensate for border space
35
35
}
36
+
37
+ #title {
38
+ & .error {
39
+ border-bottom : 1px solid #{$error }
40
+ }
41
+ }
36
42
}
Original file line number Diff line number Diff line change @@ -31,9 +31,11 @@ export default class extends Controller {
31
31
error ( e ) {
32
32
this . errorTarget . innerHTML = e . detail
33
33
this . errorTarget . style . display = "block"
34
+ this . headerTarget . classList . add ( "error" )
34
35
}
35
36
36
37
clear ( ) {
37
38
this . errorTarget . style . display = "none"
39
+ this . headerTarget . classList . remove ( "error" )
38
40
}
39
41
}
Original file line number Diff line number Diff line change 5
5
< div class ="editable-header-container " style ="display: block "
6
6
data-action ="click->inputs-text-editable-header#toggleEditor ">
7
7
< < %= header_type.to_string() %> class="align-items-center < %= header_type.to_string() %> d-flex gap-3">
8
- < span data-inputs-text-editable-header-target ="header ">
8
+ < span data-inputs-text-editable-header-target ="header " id =" title " >
9
9
< %= value %>
10
10
</ span >
11
11
Original file line number Diff line number Diff line change
1
+ use pgml_components:: component;
2
+ use sailfish:: TemplateOnce ;
3
+
4
+ #[ derive( TemplateOnce , Default ) ]
5
+ #[ template( path = "lists/item/template.html" ) ]
6
+ pub struct Item {
7
+ value : String ,
8
+ }
9
+
10
+ impl Item {
11
+ pub fn new ( ) -> Item {
12
+ Item {
13
+ value : String :: from ( "Your list item" ) ,
14
+ }
15
+ }
16
+
17
+ pub fn value ( mut self , value : & str ) -> Item {
18
+ self . value = value. into ( ) ;
19
+ self
20
+ }
21
+ }
22
+
23
+ component ! ( Item ) ;
Original file line number Diff line number Diff line change
1
+ < div class ="list-group-item d-flex align-items-center gap-2 ">
2
+ < img loading ="lazy " src ="/dashboard/static/images/icons/checkmark.svg " width ="15 " height ="11 " alt ="Checkmark ">
3
+ < %- value %>
4
+ </ div >
Original file line number Diff line number Diff line change
1
+ // This file is automatically generated.
2
+ // You shouldn't modify it manually.
3
+
4
+ // src/components/lists/item
5
+ pub mod item;
6
+ pub use item:: Item ;
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ pub mod inputs;
32
32
pub mod left_nav_menu;
33
33
pub use left_nav_menu:: LeftNavMenu ;
34
34
35
+ // src/components/lists
36
+ pub mod lists;
37
+
35
38
// src/components/modal
36
39
pub mod modal;
37
40
pub use modal:: Modal ;
Original file line number Diff line number Diff line change @@ -97,13 +97,24 @@ $slate-shade-800: #2B274C;
97
97
$slate-shade-900 : #1D1A33 ;
98
98
$slate-shade-1000 : #0E0D19 ;
99
99
100
+ $magenta-shade-100 : #E6008A ;
101
+ $magenta-shade-200 : #cf007c ;
102
+ $magenta-shade-300 : #b8006e ;
103
+ $magenta-shade-400 : #a10060 ;
104
+ $magenta-shade-500 : #8a0052 ;
105
+ $magenta-shade-600 : #730045 ;
106
+ $magenta-shade-700 : #5c0037 ;
107
+ $magenta-shade-800 : #450029 ;
108
+ $magenta-shade-900 : #2e001b ;
109
+ $magenta-shade-1000 : #17000d ;
110
+
100
111
// Colors
101
112
$primary : #0D0D0E ;
102
113
$secondary : $gray-100 ;
103
114
$danger : $peach-shade-100 ;
104
115
$error : $peach-shade-100 ;
105
116
$purple : $slate-tint-100 ;
106
- $pink : #e7477c ;
117
+ $pink : $magenta-shade-100 ;
107
118
$hp-white : #{$gray-200 } ;
108
119
109
120
// Background Colors
Original file line number Diff line number Diff line change 5
5
align-items : center ;
6
6
}
7
7
8
- .version-badge {
9
- @extend .badge ;
8
+ .eyebrow-badge {
10
9
text-transform : uppercase ;
11
10
color : #{$pink } ;
12
11
}
Original file line number Diff line number Diff line change 256
256
background : transparent ;
257
257
caret-color : #{$input-color } ;
258
258
}
259
+
260
+ .hourly-rate {
261
+ display : flex ;
262
+ flex-direction : row ;
263
+ gap : .5rem ;
264
+ background-color : #{$gray-900 } ;
265
+ border-radius : $border-radius ;
266
+ padding : 16px 20px ;
267
+
268
+ color : #{$gray-400 } ;
269
+ text-align : center ;
270
+ font-size : 18px ;
271
+ font-style : normal ;
272
+ font-weight : 700 ;
273
+ line-height : 24px ;
274
+ letter-spacing : 0.18px ;
275
+ }
Original file line number Diff line number Diff line change 7
7
use crate::components::stimulus::stimulus_action::StimulusAction;
8
8
// use crate::components::stimulus::stimulus_action::StimulusEvents;
9
9
use crate::components::inputs::select::Select;
10
- use crate::components::inputs::switch::Switch;
10
+ use crate::components::inputs::switch::{ Switch, State} ;
11
11
%>
12
12
13
13
< div class ="min-height: 100vh; " data-controller ="playground ">
@@ -223,7 +223,7 @@ <h3 class="h3">Inputs</h3>
223
223
.name("switch"))
224
224
.left("CPU", "memory")
225
225
.right("GPU", "mode_fan")
226
- .start_toggled( ) %>
226
+ .default_position(State::Right ) %>
227
227
</ div >
228
228
< div >
229
229
< button data-action ="click->playground#resetSwitch "> Reset Switch</ button >
Original file line number Diff line number Diff line change 30
30
< %+ WebAppLeftNav::new( upper_left_nav, lower_left_nav, dropdown_nav ) %>
31
31
32
32
< div class ="clear-from-under-navbar flex-grow-1 min-vw-0 ">
33
- < div class ="px-5 py-3 " style ="position: absolute ">
33
+ < div class ="px-4 px-sm- 5 py-3 " style ="position: absolute ">
34
34
< %- Breadcrumbs::render( breadcrumbs ) %>
35
35
</ div >
36
36
You can’t perform that action at this time.
0 commit comments