claritas-web-framework 6.0.0-beta-11 → 6.0.0-beta-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.
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-11",
3
+ "version": "6.0.0-beta-13",
4
4
  "updated": "13/10/2022",
5
5
  "description": "The CSS framework built for Claritas front end.",
6
6
  "main": "index.js",
@@ -14,13 +14,13 @@
14
14
  "url": "git+ssh://10.10.10.21/GitRepositories/ClaWebFramework"
15
15
  },
16
16
  "author": "David Brooks",
17
- "license": "ISC",
17
+ "license": "UNLICENSED",
18
18
  "devDependencies": {
19
19
  "@alexlafroscia/postcss-color-mod-function": "^4.0.0",
20
20
  "@babel/eslint-plugin": "^7.19.1",
21
21
  "css-loader": "^6.7.1",
22
22
  "cssnano": "^5.1.13",
23
- "eslint": "^8.25.0",
23
+ "eslint": "^8.26.0",
24
24
  "eslint-config-prettier": "^8.5.0",
25
25
  "eslint-plugin-prettier": "^4.2.1",
26
26
  "find-unused-sass-variables": "^4.0.4",
@@ -1,4 +1,6 @@
1
- // Bootstrap functions
1
+ @use "sass:map";
2
+
3
+ // Functions
2
4
  //
3
5
  // Utility mixins and functions for evaluating source code across our variables, maps, and mixins.
4
6
 
@@ -229,7 +231,7 @@ $_luminance-list: 0.0008 0.001 0.0011 0.0013 0.0015 0.0017 0.002 0.0022 0.0025 0
229
231
  );
230
232
  }
231
233
 
232
- @return (map-get($rgb, "r") * 0.2126) + (map-get($rgb, "g") * 0.7152) + (map-get($rgb, "b") * 0.0722);
234
+ @return (map.get($rgb, "r") * 0.2126) + (map.get($rgb, "g") * 0.7152) + (map.get($rgb, "b") * 0.0722);
233
235
  }
234
236
 
235
237
  // Return opaque color
@@ -331,7 +333,7 @@ $_luminance-list: 0.0008 0.001 0.0011 0.0013 0.0015 0.0017 0.002 0.0022 0.0025 0
331
333
  "%": 1%,
332
334
  );
333
335
  @if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
334
- $result: $result * map-get($unit-map, $dividend-unit);
336
+ $result: $result * map.get($unit-map, $dividend-unit);
335
337
  }
336
338
  @return $result;
337
339
  }
@@ -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;
@@ -693,5 +695,5 @@ $nav-tab-card-item-padding: calc(($input-button-padding-y) - 1px) $input-button-
693
695
  // Breadcrumbs
694
696
  $breadcrumb-color: $medium !default;
695
697
  $breadcrumb-link-color: $medium !default;
696
- $breadcrumb-link-color-hover: shade-color($breadcrumb-color, $link-shade-percentage) !default;
698
+ $breadcrumb-link-color-hover: shade-color($breadcrumb-link-color, $link-shade-percentage) !default;
697
699
  $breadcrumb-indicator: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 512'><path fill='#{$breadcrumb-color}' d='M89.45 87.5l143.1 152c4.375 4.625 6.562 10.56 6.562 16.5c0 5.937-2.188 11.87-6.562 16.5l-143.1 152C80.33 434.1 65.14 434.5 55.52 425.4c-9.688-9.125-10.03-24.38-.9375-33.94l128.4-135.5l-128.4-135.5C45.49 110.9 45.83 95.75 55.52 86.56C65.14 77.47 80.33 77.87 89.45 87.5z'/></svg>") !default;
@@ -1,3 +1,4 @@
1
+ @use "sass:map";
1
2
  // Breakpoint viewport sizes and media queries.
2
3
  //
3
4
  // Breakpoints are defined as a map of (name: minimum width), order from small to large:
@@ -24,7 +25,7 @@
24
25
  // >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
25
26
  // 576px
26
27
  @function breakpoint-min($name, $breakpoints: $breakpoints) {
27
- $min: map-get($breakpoints, $name);
28
+ $min: map.get($breakpoints, $name);
28
29
  @return if($min != 0, $min, null);
29
30
  }
30
31
 
@@ -7,6 +7,7 @@
7
7
  // Licensed under MIT (https://github.com/twbs/rfs/blob/main/LICENSE)
8
8
 
9
9
  // Configuration
10
+ @use "sass:map";
10
11
 
11
12
  // Base value
12
13
  $rfs-base-value: 1.25rem !default;
@@ -89,7 +90,7 @@ $rfs-base-value-unit: unit($rfs-base-value);
89
90
  "%": 1%,
90
91
  );
91
92
  @if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
92
- $result: $result * map-get($unit-map, $dividend-unit);
93
+ $result: $result * map.get($unit-map, $dividend-unit);
93
94
  }
94
95
  @return $result;
95
96
  }
@@ -19,7 +19,6 @@
19
19
 
20
20
  input,
21
21
  textarea,
22
- range,
23
22
  output,
24
23
  select,
25
24
  progress,
@@ -36,6 +35,7 @@ progress,
36
35
  appearance: none;
37
36
  width: 100%;
38
37
  transition: $form-transition;
38
+ position: relative;
39
39
 
40
40
  &:hover {
41
41
  border-color: $input-border-color-hover;
@@ -80,7 +80,7 @@ progress,
80
80
  border-color: $value;
81
81
 
82
82
  &:hover {
83
- border-color: shadow-color($value, $link-shade-percentage);
83
+ border-color: shade-color($value, $link-shade-percentage);
84
84
  }
85
85
 
86
86
  &:focus {
@@ -95,7 +95,7 @@ progress,
95
95
  border-color: $value;
96
96
 
97
97
  &:hover {
98
- border-color: shadow-color($value, $link-shade-percentage);
98
+ border-color: shade-color($value, $link-shade-percentage);
99
99
  }
100
100
 
101
101
  &:focus {
@@ -176,3 +176,4 @@ textarea {
176
176
  @import "./form/select";
177
177
  @import "./form/text";
178
178
  @import "./form/textarea";
179
+ @import "./form/toggle";
@@ -1,95 +1,77 @@
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
+ &:not(.input--toggle) {
3
+ height: $input-size;
4
+ width: $input-size;
5
+ vertical-align: text-bottom;
6
+ margin-right: $spacer;
7
+ padding: 0;
12
8
 
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
- }
35
-
36
- &:disabled,
37
- &.disabled,
38
- &[aria-disabled="true"] {
39
- background-color: rgba($primary, 0.4);
40
- border-color: rgba($primary, 0.8);
9
+ @include media-breakpoint-up("desktop") {
10
+ height: calc($input-size * 0.75);
11
+ width: calc($input-size * 0.75);
12
+ margin-right: calc($spacer * 0.5);
41
13
  }
42
- }
43
14
 
44
- &:indeterminate,
45
- &[aria-checked="mixed"] {
46
15
  &::before {
47
- border: 2px solid $white;
48
- height: 0;
49
- width: 65%;
16
+ content: "";
17
+ position: absolute;
18
+ margin: auto;
19
+ left: 0;
20
+ right: 0;
21
+ bottom: 0;
22
+ top: 0;
23
+ overflow: hidden;
50
24
  }
51
- }
52
25
 
53
- &.input--toggle {
54
- width: calc($spacer * 3);
55
- border-radius: $border-radius-round;
26
+ &:checked {
27
+ background-color: $primary;
28
+ border-color: $primary;
56
29
 
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;
30
+ &::before {
31
+ border-right: 2px solid $white;
32
+ border-bottom: 2px solid $white;
33
+ height: 65%;
34
+ width: 32.5%;
35
+ transform: rotate(45deg) translateY(-15%) translateX(-15%);
36
+ }
37
+
38
+ &:disabled,
39
+ &.disabled,
40
+ &[aria-disabled="true"] {
41
+ background-color: rgba($primary, 0.4);
42
+ border-color: rgba($primary, 0.8);
43
+ }
66
44
  }
67
45
 
68
- &:checked {
46
+ &:indeterminate,
47
+ &[aria-checked="mixed"] {
69
48
  &::before {
70
- transform: translateX(1.5em);
49
+ border: 2px solid $white;
71
50
  height: 0;
72
- width: 0;
73
- background: $white;
51
+ width: 65%;
74
52
  }
75
53
  }
76
- }
77
-
78
- &.input--large {
79
- height: calc($spacer * 2);
80
- width: calc($spacer * 2);
81
54
 
82
- &.input--toggle {
83
- width: calc($spacer * 4);
55
+ &.input--large {
56
+ height: calc($spacer * 2);
57
+ width: calc($spacer * 2);
58
+ }
59
+ }
84
60
 
85
- &::before {
86
- border-width: 0.75em;
61
+ @each $key, $value in $colors {
62
+ &.input--#{$key} {
63
+ &:checked {
64
+ background-color: $value;
65
+ border-color: $value;
87
66
  }
67
+ }
68
+ }
88
69
 
70
+ @each $key, $value in $theme-colors {
71
+ &.input--#{$key} {
89
72
  &:checked {
90
- &::before {
91
- transform: translateX(2em);
92
- }
73
+ background-color: $value;
74
+ border-color: $value;
93
75
  }
94
76
  }
95
77
  }
@@ -14,7 +14,6 @@
14
14
  & button,
15
15
  & input,
16
16
  & textarea,
17
- & range,
18
17
  & output,
19
18
  & select,
20
19
  & progress,
@@ -27,7 +26,6 @@
27
26
  & button,
28
27
  & input,
29
28
  & textarea,
30
- & range,
31
29
  & output,
32
30
  & select,
33
31
  & progress,
@@ -51,7 +49,6 @@
51
49
  & button,
52
50
  & input,
53
51
  & textarea,
54
- & range,
55
52
  & output,
56
53
  & select,
57
54
  & progress,
@@ -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,19 @@
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
+ height: $input-size;
5
+ width: $input-size;
7
6
  vertical-align: text-bottom;
8
- position: relative;
9
- margin-right: calc($spacer * 0.5);
7
+ margin-right: $spacer;
10
8
  border-radius: $border-radius-round;
11
9
  padding: 0;
12
10
 
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);
15
+ }
16
+
13
17
  &::before {
14
18
  content: "";
15
19
  position: absolute;
@@ -21,16 +25,15 @@ input[type="radio"] {
21
25
  overflow: hidden;
22
26
  }
23
27
 
24
- &::before {
25
- height: 0;
26
- width: 0;
27
- }
28
-
29
28
  &:checked {
30
29
  &::before {
31
- border: 5px solid transparent;
30
+ border: 8px solid $input-background-color;
32
31
  border-radius: $border-radius-round;
33
32
  background: $primary;
33
+
34
+ @include media-breakpoint-up("desktop") {
35
+ border-width: 5px;
36
+ }
34
37
  }
35
38
 
36
39
  &:disabled,
@@ -44,4 +47,44 @@ input[type="radio"] {
44
47
  }
45
48
  }
46
49
  }
50
+
51
+ @each $key, $value in $colors {
52
+ &.input--#{$key} {
53
+ &:checked {
54
+ &::before {
55
+ background: $value;
56
+ }
57
+
58
+ &:disabled,
59
+ &.disabled,
60
+ &[aria-disabled="true"] {
61
+ border-color: rgba($value, 0.4);
62
+
63
+ &::before {
64
+ background: rgba($value, 0.4);
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ @each $key, $value in $theme-colors {
72
+ &.input--#{$key} {
73
+ &:checked {
74
+ &::before {
75
+ background: $value;
76
+ }
77
+
78
+ &:disabled,
79
+ &.disabled,
80
+ &[aria-disabled="true"] {
81
+ border-color: rgba($value, 0.4);
82
+
83
+ &::before {
84
+ background: rgba($value, 0.4);
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
47
90
  }
@@ -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
+ }
@@ -7,13 +7,13 @@
7
7
  order: #{$value} !important;
8
8
  }
9
9
  }
10
- }
11
- }
12
10
 
13
- .order--first {
14
- order: -1 !important;
15
- }
11
+ .order-#{$infix}-first {
12
+ order: -1 !important;
13
+ }
16
14
 
17
- .order--last {
18
- order: 13 !important;
15
+ .order-#{$infix}-last {
16
+ order: 13 !important;
17
+ }
18
+ }
19
19
  }
@@ -1,3 +1,5 @@
1
+ @use "sass:map";
2
+
1
3
  $positions: (static, relative, absolute, fixed, sticky) !default;
2
4
  $position-ints: (0, 25, 50, 75, 100) !default;
3
5
 
@@ -8,7 +10,7 @@ $position-ints: (0, 25, 50, 75, 100) !default;
8
10
  @each $value in $positions {
9
11
  .position-#{$infix}-#{$value} {
10
12
  position: #{$value} !important;
11
- z-index: map-get($zindexes, $value);
13
+ z-index: map.get($zindexes, $value);
12
14
  }
13
15
  }
14
16
 
@@ -14,7 +14,6 @@
14
14
  & button,
15
15
  & input,
16
16
  & textarea,
17
- & range,
18
17
  & output,
19
18
  & select,
20
19
  & progress,
@@ -27,7 +26,6 @@
27
26
  & button,
28
27
  & input,
29
28
  & textarea,
30
- & range,
31
29
  & output,
32
30
  & select,
33
31
  & progress,
@@ -51,7 +49,6 @@
51
49
  & button,
52
50
  & input,
53
51
  & textarea,
54
- & range,
55
52
  & output,
56
53
  & select,
57
54
  & progress,
@@ -15,7 +15,6 @@
15
15
 
16
16
  input,
17
17
  textarea,
18
- range,
19
18
  output,
20
19
  select,
21
20
  progress,