claritas-web-framework 6.0.0-beta-12 → 6.0.0-beta-14

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/index.html CHANGED
@@ -9,10 +9,112 @@
9
9
 
10
10
  <body>
11
11
  <div class="container">
12
- <details class="card">
13
- <summary class="card--header">Title</summary>
14
- <div class="card--body">Body</div>
15
- </details>
12
+ <form>
13
+ <div class="form--field">
14
+ <label for="exampleInputEmail1" class="form--label">Email address</label>
15
+ <div class="form--control">
16
+ <input
17
+ type="email"
18
+ id="exampleInputEmail1"
19
+ name="exampleInputEmail1"
20
+ placeholder="Email address"
21
+ required
22
+ />
23
+ </div>
24
+ <small>We'll never share your email with anyone else.</small>
25
+ </div>
26
+
27
+ <div class="form--field">
28
+ <div class="form--control form--control-toggle">
29
+ <input type="checkbox" class="input--toggle input--danger" id="exampleToggle1" name="exampleToggle1" />
30
+ <label class="form--label" for="exampleToggle1">Remember</label>
31
+ </div>
32
+ </div>
33
+
34
+ <div class="form--field">
35
+ <label for="exampleInputPassword1" class="form--label">Password</label>
36
+ <div class="form--control">
37
+ <input
38
+ type="password"
39
+ id="exampleInputPassword1"
40
+ name="exampleInputPassword1"
41
+ placeholder="Password"
42
+ required
43
+ />
44
+ </div>
45
+ </div>
46
+
47
+ <div class="form--field">
48
+ <label for="exampleInputDisabled1" class="form--label">Disabled</label>
49
+ <div class="form--control">
50
+ <input
51
+ type="text"
52
+ id="exampleInputDisabled1"
53
+ name="exampleInputDisabled1"
54
+ placeholder="Some text..."
55
+ disabled
56
+ />
57
+ </div>
58
+ </div>
59
+
60
+ <div class="form--field">
61
+ <label class="form--label" for="exampleSelect1">Colour</label>
62
+ <div class="form--control">
63
+ <select id="exampleSelect1" name="exampleSelect1">
64
+ <option value="">--Please Select --</option>
65
+ <option value="1">Red</option>
66
+ <option value="2">Blue</option>
67
+ </select>
68
+ </div>
69
+ </div>
70
+
71
+ <div class="form--field display--flex">
72
+ <div class="form--control form--control-radio margin-right--3">
73
+ <input type="radio" id="exampleRadio1" name="yesno" class="input--success" />
74
+ <label class="form--label" for="exampleRadio1">Yes</label>
75
+ </div>
76
+ <div class="form--control form--control-radio">
77
+ <input type="radio" id="exampleRadio2" name="yesno" />
78
+ <label class="form--label" for="exampleRadio2">No</label>
79
+ </div>
80
+ </div>
81
+
82
+ <div class="form--field">
83
+ <label for="exampleTextarea1" class="form--label">Message</label>
84
+ <div class="form--control">
85
+ <textarea
86
+ class="input--success"
87
+ id="exampleTextarea1"
88
+ name="exampleTextarea1"
89
+ placeholder="Message..."
90
+ rows="4"
91
+ ></textarea>
92
+ </div>
93
+ </div>
94
+
95
+ <div class="form--field">
96
+ <label for="exampleRange1" class="form--label">Range</label>
97
+ <div class="form--control">
98
+ <input type="range" class="" id="exampleRange1" name="exampleRangle1" min="0" max="11" />
99
+ </div>
100
+ </div>
101
+
102
+ <div class="form--field">
103
+ <div class="form--control form--control-checkbox">
104
+ <input type="checkbox" class="input--danger" id="exampleCheck1" name="exampleCheck1" />
105
+ <label class="form--label" for="exampleCheck1">Check me out</label>
106
+ </div>
107
+ </div>
108
+
109
+ <div class="form--field">
110
+ <label class="form--label" for="exampleFile1">Choose your file...</label>
111
+ <div class="form--control">
112
+ <input type="file" id="exampleFile1" name="exampleFile1" />
113
+ </div>
114
+ </div>
115
+
116
+ <button type="submit" class="button button--primary">Submit</button>
117
+ </form>
16
118
  </div>
17
119
  </body>
18
120
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claritas-web-framework",
3
- "version": "6.0.0-beta-12",
3
+ "version": "6.0.0-beta-14",
4
4
  "updated": "13/10/2022",
5
5
  "description": "The CSS framework built for Claritas front end.",
6
6
  "main": "index.js",
@@ -594,6 +594,8 @@ $input-font-size-small: $input-button-font-size-small !default;
594
594
 
595
595
  $input-focus-box-shadow: $input-button-focus-box-shadow !default;
596
596
 
597
+ $input-size: calc(($font-size-base * $line-height-base + ($input-padding-y * 2)) + 2px) !default;
598
+
597
599
  // Button
598
600
  $button-border-width: $input-button-border-width !default;
599
601
  $button-border-style: $input-button-border-style !default;
@@ -35,6 +35,7 @@ progress,
35
35
  appearance: none;
36
36
  width: 100%;
37
37
  transition: $form-transition;
38
+ position: relative;
38
39
 
39
40
  &:hover {
40
41
  border-color: $input-border-color-hover;
@@ -79,7 +80,7 @@ progress,
79
80
  border-color: $value;
80
81
 
81
82
  &:hover {
82
- border-color: shadow-color($value, $link-shade-percentage);
83
+ border-color: shade-color($value, $link-shade-percentage);
83
84
  }
84
85
 
85
86
  &:focus {
@@ -94,7 +95,7 @@ progress,
94
95
  border-color: $value;
95
96
 
96
97
  &:hover {
97
- border-color: shadow-color($value, $link-shade-percentage);
98
+ border-color: shade-color($value, $link-shade-percentage);
98
99
  }
99
100
 
100
101
  &:focus {
@@ -175,3 +176,4 @@ textarea {
175
176
  @import "./form/select";
176
177
  @import "./form/text";
177
178
  @import "./form/textarea";
179
+ @import "./form/toggle";
@@ -1,95 +1,79 @@
1
1
  input[type="checkbox"] {
2
- appearance: none;
3
- font-size: $spacer;
4
- height: calc($spacer * 1.5);
5
- width: calc($spacer * 1.5);
6
- min-width: calc($spacer * 1.5);
7
- display: inline-block;
8
- vertical-align: text-bottom;
9
- position: relative;
10
- margin-right: calc($spacer * 0.5);
11
- padding: 0;
2
+ flex-shrink: 0;
12
3
 
13
- &::before {
14
- content: "";
15
- position: absolute;
16
- margin: auto;
17
- left: 0;
18
- right: 0;
19
- bottom: 0;
20
- top: 0;
21
- overflow: hidden;
22
- }
23
-
24
- &:checked {
25
- background-color: $primary;
26
- border-color: $primary;
27
-
28
- &::before {
29
- border-right: 2px solid $white;
30
- border-bottom: 2px solid $white;
31
- height: 65%;
32
- width: 32.5%;
33
- transform: rotate(45deg) translateY(-15%) translateX(-15%);
34
- }
4
+ &:not(.input--toggle) {
5
+ height: $input-size;
6
+ width: $input-size;
7
+ vertical-align: text-bottom;
8
+ margin-right: $spacer;
9
+ padding: 0;
35
10
 
36
- &:disabled,
37
- &.disabled,
38
- &[aria-disabled="true"] {
39
- background-color: rgba($primary, 0.4);
40
- border-color: rgba($primary, 0.8);
11
+ @include media-breakpoint-up("desktop") {
12
+ height: calc($input-size * 0.75);
13
+ width: calc($input-size * 0.75);
14
+ margin-right: calc($spacer * 0.5);
41
15
  }
42
- }
43
16
 
44
- &:indeterminate,
45
- &[aria-checked="mixed"] {
46
17
  &::before {
47
- border: 2px solid $white;
48
- height: 0;
49
- width: 65%;
18
+ content: "";
19
+ position: absolute;
20
+ margin: auto;
21
+ left: 0;
22
+ right: 0;
23
+ bottom: 0;
24
+ top: 0;
25
+ overflow: hidden;
50
26
  }
51
- }
52
27
 
53
- &.input--toggle {
54
- width: calc($spacer * 3);
55
- border-radius: $border-radius-round;
28
+ &:checked {
29
+ background-color: $primary;
30
+ border-color: $primary;
56
31
 
57
- &::before {
58
- height: 0;
59
- width: 0;
60
- left: 0.25em;
61
- right: auto;
62
- border: 0.5em solid transparent;
63
- border-radius: $border-radius-round;
64
- background: $input-border-color;
65
- transition: transform 0.2s;
32
+ &::before {
33
+ border-right: 2px solid $white;
34
+ border-bottom: 2px solid $white;
35
+ height: 65%;
36
+ width: 32.5%;
37
+ transform: rotate(45deg) translateY(-15%) translateX(-15%);
38
+ }
39
+
40
+ &:disabled,
41
+ &.disabled,
42
+ &[aria-disabled="true"] {
43
+ background-color: rgba($primary, 0.4);
44
+ border-color: rgba($primary, 0.8);
45
+ }
66
46
  }
67
47
 
68
- &:checked {
48
+ &:indeterminate,
49
+ &[aria-checked="mixed"] {
69
50
  &::before {
70
- transform: translateX(1.5em);
51
+ border: 2px solid $white;
71
52
  height: 0;
72
- width: 0;
73
- background: $white;
53
+ width: 65%;
74
54
  }
75
55
  }
76
- }
77
-
78
- &.input--large {
79
- height: calc($spacer * 2);
80
- width: calc($spacer * 2);
81
56
 
82
- &.input--toggle {
83
- width: calc($spacer * 4);
57
+ &.input--large {
58
+ height: calc($spacer * 2);
59
+ width: calc($spacer * 2);
60
+ }
61
+ }
84
62
 
85
- &::before {
86
- border-width: 0.75em;
63
+ @each $key, $value in $colors {
64
+ &.input--#{$key} {
65
+ &:checked {
66
+ background-color: $value;
67
+ border-color: $value;
87
68
  }
69
+ }
70
+ }
88
71
 
72
+ @each $key, $value in $theme-colors {
73
+ &.input--#{$key} {
89
74
  &:checked {
90
- &::before {
91
- transform: translateX(2em);
92
- }
75
+ background-color: $value;
76
+ border-color: $value;
93
77
  }
94
78
  }
95
79
  }
@@ -1,6 +1,5 @@
1
1
  progress {
2
2
  background-color: transparent;
3
- appearance: none;
4
3
  border-radius: $border-radius-round;
5
4
  height: $spacer;
6
5
  overflow: hidden;
@@ -1,15 +1,20 @@
1
+ @use "sass:map";
2
+
1
3
  input[type="radio"] {
2
- appearance: none;
3
- height: calc($spacer * 1.5);
4
- width: calc($spacer * 1.5);
5
- min-width: calc($spacer * 1.5);
6
- display: inline-block;
4
+ flex-shrink: 0;
5
+ height: $input-size;
6
+ width: $input-size;
7
7
  vertical-align: text-bottom;
8
- position: relative;
9
- margin-right: calc($spacer * 0.5);
8
+ margin-right: $spacer;
10
9
  border-radius: $border-radius-round;
11
10
  padding: 0;
12
11
 
12
+ @include media-breakpoint-up("desktop") {
13
+ height: calc($input-size * 0.75);
14
+ width: calc($input-size * 0.75);
15
+ margin-right: calc($spacer * 0.5);
16
+ }
17
+
13
18
  &::before {
14
19
  content: "";
15
20
  position: absolute;
@@ -21,16 +26,15 @@ input[type="radio"] {
21
26
  overflow: hidden;
22
27
  }
23
28
 
24
- &::before {
25
- height: 0;
26
- width: 0;
27
- }
28
-
29
29
  &:checked {
30
30
  &::before {
31
- border: 5px solid transparent;
31
+ border: 8px solid $input-background-color;
32
32
  border-radius: $border-radius-round;
33
33
  background: $primary;
34
+
35
+ @include media-breakpoint-up("desktop") {
36
+ border-width: 5px;
37
+ }
34
38
  }
35
39
 
36
40
  &:disabled,
@@ -44,4 +48,44 @@ input[type="radio"] {
44
48
  }
45
49
  }
46
50
  }
51
+
52
+ @each $key, $value in $colors {
53
+ &.input--#{$key} {
54
+ &:checked {
55
+ &::before {
56
+ background: $value;
57
+ }
58
+
59
+ &:disabled,
60
+ &.disabled,
61
+ &[aria-disabled="true"] {
62
+ border-color: rgba($value, 0.4);
63
+
64
+ &::before {
65
+ background: rgba($value, 0.4);
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+
72
+ @each $key, $value in $theme-colors {
73
+ &.input--#{$key} {
74
+ &:checked {
75
+ &::before {
76
+ background: $value;
77
+ }
78
+
79
+ &:disabled,
80
+ &.disabled,
81
+ &[aria-disabled="true"] {
82
+ border-color: rgba($value, 0.4);
83
+
84
+ &::before {
85
+ background: rgba($value, 0.4);
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
47
91
  }
@@ -1,7 +1,6 @@
1
1
  select {
2
2
  padding: $input-padding-y calc($spacer * 2) $input-padding-y $input-padding-x;
3
3
  padding-start: calc($spacer - 3px);
4
- appearance: none;
5
4
 
6
5
  &:not([multiple]) {
7
6
  background-image: escape-svg($form-select-indicator);
@@ -0,0 +1,101 @@
1
+ input[type="checkbox"] {
2
+ &.input--toggle {
3
+ height: $input-size;
4
+ width: calc($input-size * 2);
5
+ vertical-align: text-bottom;
6
+ margin-right: $spacer;
7
+ border-radius: $border-radius-round;
8
+ padding: 0;
9
+
10
+ @include media-breakpoint-up("desktop") {
11
+ height: calc($input-size * 0.75);
12
+ width: calc(($input-size * 0.75) * 2);
13
+ margin-right: calc($spacer * 0.5);
14
+ }
15
+
16
+ &::before {
17
+ content: "";
18
+ position: absolute;
19
+ margin: auto;
20
+ left: 0;
21
+ right: 50%;
22
+ bottom: 0;
23
+ top: 0;
24
+ overflow: hidden;
25
+ border: 8px solid $input-background-color;
26
+ border-radius: $border-radius-round;
27
+ background: $input-border-color;
28
+ transition: left 0.2s, right 0.2s, border 0.2s;
29
+
30
+ @include media-breakpoint-up("desktop") {
31
+ border-width: 5px;
32
+ }
33
+ }
34
+
35
+ &:checked {
36
+ background: $primary;
37
+
38
+ &::before {
39
+ background: $white;
40
+ left: 50%;
41
+ right: 0;
42
+ border-color: $primary;
43
+ }
44
+
45
+ &:disabled,
46
+ &.disabled,
47
+ &[aria-disabled="true"] {
48
+ background-color: $white;
49
+ border-color: rgba($primary, 0.4);
50
+
51
+ &::before {
52
+ background: rgba($primary, 0.4);
53
+ }
54
+ }
55
+ }
56
+
57
+ @each $key, $value in $colors {
58
+ &.input--#{$key} {
59
+ &:checked {
60
+ background: $value;
61
+
62
+ &::before {
63
+ border-color: $value;
64
+ }
65
+
66
+ &:disabled,
67
+ &.disabled,
68
+ &[aria-disabled="true"] {
69
+ border-color: rgba($value, 0.4);
70
+
71
+ &::before {
72
+ background: rgba($value, 0.4);
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
78
+
79
+ @each $key, $value in $theme-colors {
80
+ &.input--#{$key} {
81
+ &:checked {
82
+ background: $value;
83
+
84
+ &::before {
85
+ border-color: $value;
86
+ }
87
+
88
+ &:disabled,
89
+ &.disabled,
90
+ &[aria-disabled="true"] {
91
+ border-color: rgba($value, 0.4);
92
+
93
+ &::before {
94
+ background: rgba($value, 0.4);
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }