claritas-web-framework 7.0.1 → 8.0.1

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.
Files changed (65) hide show
  1. package/dist/index.css +276 -1
  2. package/dist/index.html +1 -1
  3. package/index.html +18 -7
  4. package/package.json +6 -5
  5. package/sass/_functions.scss +3 -145
  6. package/sass/_mixins.scss +0 -5
  7. package/sass/_reboot.scss +72 -410
  8. package/sass/_root.scss +11 -1
  9. package/sass/_variables.scss +120 -219
  10. package/sass/helpers/_grid.scss +11 -15
  11. package/sass/index.scss +2 -0
  12. package/sass/mixins/_button.scss +124 -232
  13. package/sass/mixins/_caret.scss +17 -10
  14. package/sass/mixins/_colors.scss +1 -1
  15. package/sass/mixins/_gradient.scss +0 -8
  16. package/sass/mixins/_group.scss +2 -2
  17. package/sass/mixins/_list.scss +1 -1
  18. package/sass/modules/_alert.scss +8 -8
  19. package/sass/modules/_breadcrumbs.scss +3 -3
  20. package/sass/modules/_button.scss +72 -96
  21. package/sass/modules/_card.scss +41 -56
  22. package/sass/modules/_close.scss +20 -10
  23. package/sass/modules/_details.scss +7 -25
  24. package/sass/modules/_dialog.scss +5 -5
  25. package/sass/modules/_dropdown.scss +28 -56
  26. package/sass/modules/_form.scss +167 -39
  27. package/sass/modules/_list.scss +19 -17
  28. package/sass/modules/_loader.scss +36 -36
  29. package/sass/modules/_nav.scss +95 -66
  30. package/sass/modules/_pill.scss +9 -22
  31. package/sass/modules/_table.scss +4 -4
  32. package/sass/modules/_tabs.scss +34 -57
  33. package/sass/modules/_tag.scss +11 -23
  34. package/sass/modules/_tile.scss +7 -7
  35. package/sass/modules/_tooltip.scss +13 -11
  36. package/sass/modules/form/_checkbox.scss +20 -21
  37. package/sass/modules/form/_file.scss +30 -25
  38. package/sass/modules/form/_formFieldGroup.scss +25 -37
  39. package/sass/modules/form/_output.scss +1 -1
  40. package/sass/modules/form/_progress.scss +20 -33
  41. package/sass/modules/form/_radio.scss +15 -39
  42. package/sass/modules/form/_range.scss +76 -24
  43. package/sass/modules/form/_select.scss +5 -5
  44. package/sass/modules/form/_switch.scss +1 -1
  45. package/sass/modules/form/_text.scss +20 -17
  46. package/sass/modules/form/_textarea.scss +1 -1
  47. package/sass/modules/form/_toggle.scss +23 -52
  48. package/webpack.config.js +5 -22
  49. package/webpack.plugins.js +15 -0
  50. package/webpack.rules.js +8 -0
  51. package/images/block.svg +0 -3
  52. package/images/check.svg +0 -3
  53. package/images/chevron-down.svg +0 -1
  54. package/images/menu.svg +0 -3
  55. package/images/remove.svg +0 -3
  56. package/images/subdirectory.svg +0 -3
  57. package/images/upload.svg +0 -3
  58. package/sass/mixins/_borderRadius.scss +0 -79
  59. package/sass/mixins/_boxShadow.scss +0 -22
  60. package/sass/mixins/_colors.temp.scss +0 -89
  61. package/sass/mixins/_pill.scss +0 -14
  62. package/sass/mixins/_rfs.scss +0 -297
  63. package/sass/mixins/_tag.scss +0 -52
  64. package/sass/mixins/_transition.scss +0 -27
  65. package/sass/modules/_button.old.scss +0 -215
@@ -2,27 +2,30 @@
2
2
  @use "./../../variables" as *;
3
3
 
4
4
  .input--text {
5
- border-color: transparent;
6
- box-shadow: none;
7
- border-radius: $border-radius-none;
8
- padding-left: 0;
9
- padding-right: 0;
10
- border-width: 0 0 1px;
5
+ --input-border-width: 0 0 1px;
11
6
 
12
- &:hover {
13
- border-color: $input-hover-border-color;
14
- box-shadow: none;
15
- }
7
+ --input-padding-x: 0;
8
+ --input-small-padding-x: 0;
9
+ --input-large-padding-x: 0;
10
+
11
+ --input-box-shadow: 0 0 0 0.125em hsl(var(--body-color-h) var(--body-color-s) var(--body-color-l) / 0%);
12
+ --input-hover-box-shadow: 0 0 0 0.125em hsl(var(--body-color-h) var(--body-color-s) var(--body-color-l) / 0%);
13
+ --input-focus-box-shadow: 0 0 0 0.125em hsl(var(--body-color-h) var(--body-color-s) var(--body-color-l) / 0%);
14
+ --input-active-box-shadow: 0 0 0 0.125em hsl(var(--body-color-h) var(--body-color-s) var(--body-color-l) / 0%);
15
+ --input-disabled-box-shadow: 0 0 0 0.125em hsl(var(--body-color-h) var(--body-color-s) var(--body-color-l) / 0%);
16
+
17
+ --input-border-radius: 0;
18
+ --input-small-border-radius: 0;
19
+ --input-large-border-radius: 0;
20
+ --input-round-border-radius: 0;
16
21
 
17
22
  @each $key, $value in $theme-colors {
18
23
  &.input--#{$key} {
19
- border-color: rgba($value, 50%);
20
- box-shadow: none;
21
-
22
- &:hover {
23
- border-color: $value;
24
- box-shadow: none;
25
- }
24
+ --input-box-shadow: 0 0 0 0.125em hsl(var(--#{$key}-h) var(--#{$key}-s) var(--#{$key}-l) / 0%);
25
+ --input-hover-box-shadow: 0 0 0 0.125em hsl(var(--#{$key}-h) var(--#{$key}-s) var(--#{$key}-l) / 0%);
26
+ --input-focus-box-shadow: 0 0 0 0.125em hsl(var(--#{$key}-h) var(--#{$key}-s) var(--#{$key}-l) / 0%);
27
+ --input-active-box-shadow: 0 0 0 0.125em hsl(var(--#{$key}-h) var(--#{$key}-s) var(--#{$key}-l) / 0%);
28
+ --input-disabled-box-shadow: 0 0 0 0.125em hsl(var(--#{$key}-h) var(--#{$key}-s) var(--#{$key}-l) / 0%);
26
29
  }
27
30
  }
28
31
  }
@@ -1,3 +1,3 @@
1
1
  textarea {
2
- white-space: normal;
2
+ --input-white-space: normal;
3
3
  }
@@ -5,25 +5,23 @@
5
5
  .form--control-toggle {
6
6
  & > * {
7
7
  &:not(:last-child) {
8
- margin-right: $spacer;
8
+ margin-right: var(--spacer);
9
9
 
10
10
  @include media-breakpoint-up("desktop") {
11
- margin-right: calc($spacer * 0.5);
11
+ margin-right: calc(var(--spacer) * 0.5);
12
12
  }
13
13
  }
14
14
  }
15
15
 
16
16
  & input[type="checkbox"] {
17
- height: $input-size;
18
- width: calc($input-size * 2);
19
- vertical-align: text-bottom;
20
- border-radius: $border-radius-round;
21
- padding: 0;
17
+ --input-width: auto;
18
+ --input-desktop-width: auto;
19
+ --input-padding-x: #{calc(($input-padding-x * 2) + 1px)};
22
20
 
23
- @include media-breakpoint-up("desktop") {
24
- height: calc($input-size * 0.75);
25
- width: calc(($input-size * 0.75) * 2);
26
- }
21
+ border-radius: var(--input-round-border-radius);
22
+ aspect-ratio: 2 / 1;
23
+ flex-shrink: 0;
24
+ vertical-align: text-bottom;
27
25
 
28
26
  &::before {
29
27
  content: "";
@@ -31,65 +29,38 @@
31
29
  margin: auto;
32
30
  inset: 0 50% 0 0;
33
31
  overflow: hidden;
34
- border: 6px solid $input-background-color;
35
- border-radius: $border-radius-round;
36
- background: $input-border-color;
37
- transition: left 0.2s, right 0.2s;
38
-
39
- @include media-breakpoint-up("desktop") {
40
- border-width: 4px;
41
- }
42
- }
43
-
44
- &:disabled,
45
- &.disabled,
46
- &[aria-disabled="true"] {
47
- &::before {
48
- border-color: $light;
49
- }
32
+ border-radius: var(--input-round-border-radius);
33
+ background: var(--input-border-color);
34
+ width: 35%;
35
+ aspect-ratio: 1;
36
+ transition:
37
+ left 0.2s,
38
+ right 0.2s;
50
39
  }
51
40
 
52
41
  &:checked {
53
- background: $input-detail-color;
42
+ background: var(--input-detail-background);
54
43
 
55
44
  &::before {
56
- background: $white;
45
+ background: var(--white);
57
46
  left: 50%;
58
47
  right: 0;
59
- border-color: $input-detail-color;
60
48
  }
61
49
 
62
50
  &:disabled,
63
51
  &.disabled,
64
52
  &[aria-disabled="true"] {
65
- background-color: $light;
66
- border-color: rgba($input-detail-color, 40%);
67
-
68
- &::before {
69
- background: rgba($input-detail-color, 40%);
70
- border-color: $light;
71
- }
53
+ background: var(--input-disabled-detail-background);
72
54
  }
73
55
  }
74
56
 
75
57
  @each $key, $value in $theme-colors {
76
58
  &.input--#{$key} {
77
- &:checked {
78
- background: $value;
79
-
80
- &::before {
81
- border-color: $value;
82
- }
59
+ --input-border-color: hsl(var(--#{$key}-h) var(--#{$key}-s) var(--#{$key}-l) / 65%);
83
60
 
84
- &:disabled,
85
- &.disabled,
86
- &[aria-disabled="true"] {
87
- border-color: rgba($value, 40%);
88
-
89
- &::before {
90
- background: rgba($value, 40%);
91
- }
92
- }
61
+ &:checked {
62
+ --input-detail-background: hsl(var(--#{$key}-h) var(--#{$key}-s) var(--#{$key}-l) / 100%);
63
+ --input-disabled-detail-background: hsl(var(--#{$key}-h) var(--#{$key}-s) var(--#{$key}-l) / 65%);
93
64
  }
94
65
  }
95
66
  }
package/webpack.config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const path = require("path");
2
- const MiniCssExtractPlugin = require("mini-css-extract-plugin");
3
- const HtmlWebpackPlugin = require("html-webpack-plugin");
2
+ const rules = require("./webpack.rules");
3
+ const plugins = require("./webpack.plugins");
4
4
 
5
5
  module.exports = {
6
6
  entry: "./index.js",
@@ -15,30 +15,13 @@ module.exports = {
15
15
  },
16
16
  open: true,
17
17
  liveReload: true,
18
- watchFiles: ["images/**/*", "js/**/*", "scss/**/*", "styles/**/*", "index.html", "index.js"],
18
+ watchFiles: ["sass/**/*", "index.html", "index.js"],
19
19
  hot: true,
20
20
  },
21
21
  target: "web",
22
22
  stats: {
23
23
  loggingDebug: ["sass-loader"],
24
24
  },
25
- plugins: [
26
- new HtmlWebpackPlugin({
27
- title: "Claritas Web Framework",
28
- template: path.resolve(path.join(__dirname, "index.html")),
29
- filename: "index.html", // output file
30
- }),
31
- new MiniCssExtractPlugin({
32
- filename: "./index.css",
33
- chunkFilename: "[id].css",
34
- }),
35
- ],
36
- module: {
37
- rules: [
38
- {
39
- test: /\.(?:css|scss)$/i,
40
- use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
41
- },
42
- ],
43
- },
25
+ plugins,
26
+ module: { rules },
44
27
  };
@@ -0,0 +1,15 @@
1
+ const path = require("path");
2
+ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
3
+ const HtmlWebpackPlugin = require("html-webpack-plugin");
4
+
5
+ module.exports = [
6
+ new HtmlWebpackPlugin({
7
+ title: "Claritas Web Framework",
8
+ template: path.resolve(path.join(__dirname, "index.html")),
9
+ filename: "index.html", // output file
10
+ }),
11
+ new MiniCssExtractPlugin({
12
+ filename: "./index.css",
13
+ chunkFilename: "[id].css",
14
+ }),
15
+ ];
@@ -0,0 +1,8 @@
1
+ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
2
+
3
+ module.exports = [
4
+ {
5
+ test: /\.(?:css|scss)$/i,
6
+ use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
7
+ },
8
+ ];
package/images/block.svg DELETED
@@ -1,3 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
2
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z" />
3
- </svg>
package/images/check.svg DELETED
@@ -1,3 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
2
- <path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" />
3
- </svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>
package/images/menu.svg DELETED
@@ -1,3 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
2
- <path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
3
- </svg>
package/images/remove.svg DELETED
@@ -1,3 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
2
- <path d="M19 13H5v-2h14v2z" />
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
2
- <path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z" />
3
- </svg>
package/images/upload.svg DELETED
@@ -1,3 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
2
- <path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z" />
3
- </svg>
@@ -1,79 +0,0 @@
1
- @use "sass:list";
2
- @use "./../variables" as *;
3
-
4
- // Single side border-radius
5
-
6
- // Helper function to replace negative values with 0
7
- @function valid-radius($radius) {
8
- $return: ();
9
-
10
- @each $value in $radius {
11
- @if type-of($value) == number {
12
- $return: list.append($return, max($value, 0));
13
- } @else {
14
- $return: list.append($return, $value);
15
- }
16
- }
17
-
18
- @return $return;
19
- }
20
-
21
- @mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
22
- @if $enable-rounded {
23
- border-radius: valid-radius($radius);
24
- } @else if $fallback-border-radius != false {
25
- border-radius: $fallback-border-radius;
26
- }
27
- }
28
-
29
- @mixin border-top-radius($radius: $border-radius) {
30
- @if $enable-rounded {
31
- border-top-left-radius: valid-radius($radius);
32
- border-top-right-radius: valid-radius($radius);
33
- }
34
- }
35
-
36
- @mixin border-end-radius($radius: $border-radius) {
37
- @if $enable-rounded {
38
- border-top-right-radius: valid-radius($radius);
39
- border-bottom-right-radius: valid-radius($radius);
40
- }
41
- }
42
-
43
- @mixin border-bottom-radius($radius: $border-radius) {
44
- @if $enable-rounded {
45
- border-bottom-right-radius: valid-radius($radius);
46
- border-bottom-left-radius: valid-radius($radius);
47
- }
48
- }
49
-
50
- @mixin border-start-radius($radius: $border-radius) {
51
- @if $enable-rounded {
52
- border-top-left-radius: valid-radius($radius);
53
- border-bottom-left-radius: valid-radius($radius);
54
- }
55
- }
56
-
57
- @mixin border-top-start-radius($radius: $border-radius) {
58
- @if $enable-rounded {
59
- border-top-left-radius: valid-radius($radius);
60
- }
61
- }
62
-
63
- @mixin border-top-end-radius($radius: $border-radius) {
64
- @if $enable-rounded {
65
- border-top-right-radius: valid-radius($radius);
66
- }
67
- }
68
-
69
- @mixin border-bottom-end-radius($radius: $border-radius) {
70
- @if $enable-rounded {
71
- border-bottom-right-radius: valid-radius($radius);
72
- }
73
- }
74
-
75
- @mixin border-bottom-start-radius($radius: $border-radius) {
76
- @if $enable-rounded {
77
- border-bottom-left-radius: valid-radius($radius);
78
- }
79
- }
@@ -1,22 +0,0 @@
1
- @use "sass:list";
2
- @use "./../variables" as *;
3
-
4
- @mixin box-shadow($shadow...) {
5
- @if $enable-shadows {
6
- $result: ();
7
-
8
- @each $value in $shadow {
9
- @if $value {
10
- $result: list.append($result, $value, "comma");
11
- }
12
-
13
- @if $value == none and length($shadow) > 1 {
14
- @warn "The keyword 'none' must be used as a single argument.";
15
- }
16
- }
17
-
18
- @if length($result) > 0 {
19
- box-shadow: $result;
20
- }
21
- }
22
- }
@@ -1,89 +0,0 @@
1
- @use "sass:color";
2
- @use "./../variables" as *;
3
- @use "./../functions" as *;
4
-
5
- /* --------------- Splits a colour into it's base hsla values --------------- */
6
- @mixin define-color-variables($title, $color) {
7
- --#{$title}-h: #{color.hue($color)};
8
- --#{$title}-s: #{color.saturation($color)};
9
- --#{$title}-l: #{color.lightness($color)};
10
- --#{$title}-a: #{color.alpha($color)};
11
- }
12
-
13
- @function hsl-color($title, $hue: 0deg, $lightness: 0%, $saturation: 0%, $alpha: 0) {
14
- @return hsl(
15
- calc(var(--#{$title}-h) + #{$hue}) calc(var(--#{$title}-s) + #{$saturation})
16
- calc(var(--#{$title}-l) + #{$lightness}) / calc(var(--#{$title}-a) + #{$alpha})
17
- );
18
- }
19
-
20
- @mixin make-color($title, $color) {
21
- // $value: define-color-variables($title, $color);
22
-
23
- // :root {
24
- @include define-color-variables($title, $color);
25
-
26
- // }
27
-
28
- color: hsl(var(--#{$title}-h) var(--#{$title}-s) var(--#{$title}-l) / var(--#{$title}-a));
29
- }
30
-
31
- // @mixin make-link-color($value, $shade: $link-shade-value, $title: "") {
32
- // $hsla: hsla(
33
- // #{var(--#{$value}-h)} var(--#{$value}-s) var(--#{$value}-l) / var(--#{$value}-a)
34
- // );
35
-
36
- // --#{$title}color: #{$hsla};
37
-
38
- // color: var(--#{$title}color) !important;
39
-
40
- // &:hover,
41
- // &:focus {
42
- // @include make-color($value, $shade: $link-shade-value, $title: "");
43
- // }
44
- // }
45
-
46
- // @mixin make-color($value, $shade: 0, $title: "") {
47
- // $hsla: hsl(
48
- // var(--#{$value}-h) var(--#{$value}-s) calc(var(--#{$value}-l) * $shade) /
49
- // var(--#{$value}-a)
50
- // );
51
-
52
- // --#{$title}color: #{$hsla};
53
-
54
- // color: var(--#{$title}color) !important;
55
-
56
- // & a {
57
- // @include make-link-color($value, $shade: $link-shade-value);
58
- // }
59
- // }
60
-
61
- // @mixin make-background-color($value, $title: "") {
62
- // $hsla: hsl(
63
- // var(--#{$value}-h) var(--#{$value}-s) var(--#{$value}-l) /
64
- // var(--#{$value}-a)
65
- // );
66
-
67
- // --#{$title}background-color: #{$hsla};
68
-
69
- // background-color: var(--#{$title}background-color) !important;
70
- // }
71
-
72
- // @mixin make-border-color($value, $title: "", $alpha: null) {
73
- // @if $alpha {
74
- // $hsla: hsl(var(--#{$value}-h) var(--#{$value}-s) var(--#{$value}-l) / #{$alpha});
75
-
76
- // --#{$title}border-color: #{$hsla};
77
- // } @else {
78
- // $hsla: hsl(
79
- // var(--#{$value}-h)
80
- // var(--#{$value}-s)
81
- // var(--#{$value}-l) /
82
- // var(--#{$value}-a)
83
- // );
84
-
85
- // --#{$title}border-color: #{$hsla};
86
- // }
87
-
88
- // border-color: var(--#{$title}border-color) !important;
89
- // }
@@ -1,14 +0,0 @@
1
- @use "sass:color";
2
- @use "./../variables" as *;
3
- @use "./../functions" as *;
4
- @use "./../mixins/gradient" as *;
5
-
6
- @mixin pill-variant($background, $color) {
7
- color: $color;
8
-
9
- @include gradient-background($background);
10
-
11
- &.pill--link {
12
- color: color.mix(black, $color, $link-shade-percentage);
13
- }
14
- }