ngwr 0.0.6 → 0.0.7

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 (73) hide show
  1. package/README.md +14 -9
  2. package/_core/constants/style-prefix.d.ts +1 -1
  3. package/_core/index.d.ts +1 -0
  4. package/_core/types/safe-any.d.ts +1 -0
  5. package/_core/util/convert.d.ts +2 -1
  6. package/button/button.component.d.ts +1 -1
  7. package/esm2020/_core/components/base.component.mjs +1 -1
  8. package/esm2020/_core/constants/style-prefix.mjs +1 -1
  9. package/esm2020/_core/index.mjs +2 -1
  10. package/esm2020/_core/types/safe-any.mjs +2 -0
  11. package/esm2020/_core/util/convert.mjs +3 -2
  12. package/esm2020/button/button.component.mjs +1 -1
  13. package/esm2020/button/button.module.mjs +3 -3
  14. package/esm2020/divider/divider.component.mjs +1 -1
  15. package/esm2020/divider/divider.module.mjs +1 -1
  16. package/esm2020/extended-input/extended-input.component.mjs +3 -3
  17. package/esm2020/extended-input/extended-input.module.mjs +6 -14
  18. package/esm2020/form/form-error.component.mjs +1 -1
  19. package/esm2020/form/form-item.component.mjs +1 -1
  20. package/esm2020/form/form.module.mjs +5 -13
  21. package/esm2020/icon/wr-icon.component.mjs +2 -2
  22. package/esm2020/icon/wr-icon.module.mjs +1 -1
  23. package/esm2020/icon/wr-icon.service.mjs +1 -1
  24. package/esm2020/input/input.directive.mjs +2 -2
  25. package/esm2020/input/input.module.mjs +5 -5
  26. package/esm2020/password-input/password-input.component.mjs +4 -4
  27. package/esm2020/password-input/password-input.module.mjs +11 -26
  28. package/esm2020/skeleton/skeleton.component.mjs +2 -2
  29. package/esm2020/skeleton/skeleton.module.mjs +7 -7
  30. package/esm2020/spinner/spinner.component.mjs +1 -1
  31. package/esm2020/spinner/spinner.module.mjs +1 -1
  32. package/esm2020/tag/tag.component.mjs +2 -2
  33. package/esm2020/tag/tag.module.mjs +2 -2
  34. package/extended-input/extended-input.component.d.ts +6 -5
  35. package/fesm2015/ngwr.mjs +55 -85
  36. package/fesm2015/ngwr.mjs.map +1 -1
  37. package/fesm2020/ngwr.mjs +55 -85
  38. package/fesm2020/ngwr.mjs.map +1 -1
  39. package/icon/wr-icon.component.d.ts +2 -1
  40. package/ngwr.min.css +8 -0
  41. package/package.json +1 -1
  42. package/password-input/password-input.component.d.ts +7 -6
  43. package/password-input/password-input.module.d.ts +4 -4
  44. package/skeleton/skeleton.module.d.ts +4 -4
  45. package/tag/tag.component.d.ts +2 -2
  46. package/styles/components/_index.scss +0 -15
  47. package/styles/components/alert.scss +0 -28
  48. package/styles/components/button.scss +0 -115
  49. package/styles/components/card.scss +0 -41
  50. package/styles/components/divider.scss +0 -19
  51. package/styles/components/dropdown.scss +0 -128
  52. package/styles/components/extended-input.scss +0 -64
  53. package/styles/components/form.scss +0 -85
  54. package/styles/components/heading.scss +0 -25
  55. package/styles/components/icon.scss +0 -32
  56. package/styles/components/input.scss +0 -43
  57. package/styles/components/password-input.scss +0 -31
  58. package/styles/components/skeleton.scss +0 -58
  59. package/styles/components/spinner.scss +0 -44
  60. package/styles/components/tag.scss +0 -70
  61. package/styles/components/tooltip.scss +0 -60
  62. package/styles/functions.scss +0 -184
  63. package/styles/grid.scss +0 -177
  64. package/styles/index.scss +0 -164
  65. package/styles/mixins/_index.scss +0 -22
  66. package/styles/mixins/alert.scss +0 -7
  67. package/styles/mixins/button.scss +0 -56
  68. package/styles/mixins/reset-component.scss +0 -13
  69. package/styles/mixins/tag.scss +0 -68
  70. package/styles/reset.scss +0 -104
  71. package/styles/root.scss +0 -31
  72. package/styles/vars.scss +0 -1075
  73. package/styles.css +0 -4
@@ -1,25 +0,0 @@
1
- @import '../vars';
2
-
3
- small {
4
- font-size: 0.75rem;
5
- color: inherit;
6
- opacity: 0.75;
7
- }
8
-
9
- .h1,.h2,.h3,.h4,.h5,.h6 {
10
- color: $heading-color;
11
- font-family: $headings-font-family;
12
- font-style: $headings-font-style;
13
- font-weight: $headings-font-weight;
14
- line-height: $headings-line-height;
15
- }
16
-
17
- @each $heading, $font-size in $heading-sizes {
18
- .h#{$heading} {
19
- font-size: $font-size;
20
- }
21
-
22
- h#{$heading} {
23
- @extend .h#{$heading};
24
- }
25
- }
@@ -1,32 +0,0 @@
1
- @import '../vars';
2
- @import '../mixins';
3
-
4
- $icon-prefix: #{$prefix}-icon;
5
-
6
- .#{$icon-prefix} {
7
- display: inline-block;
8
- color: inherit;
9
- font-style: normal;
10
- line-height: 0;
11
- text-align: center;
12
- text-transform: none;
13
- vertical-align: -0.125rem;
14
-
15
- box-sizing: content-box !important;
16
-
17
- contain: strict;
18
-
19
- fill: currentColor;
20
- width: 1.5rem;
21
- height: 1.5rem;
22
-
23
- * {
24
- line-height: 1;
25
- }
26
-
27
- svg {
28
- display: inline-block;
29
- width: 100%;
30
- height: 100%;
31
- }
32
- }
@@ -1,43 +0,0 @@
1
- @import '../vars';
2
- @import '../mixins';
3
-
4
- $input-prefix: #{$prefix}-input;
5
-
6
- .#{$input-prefix} {
7
- display: inline-flex;
8
- appearance: none;
9
-
10
- background: $color-white;
11
- box-shadow: inset 0 0 0 1px $color-light;
12
- border: none;
13
- border-radius: $input-border-radius;
14
-
15
- margin: 0;
16
- padding: $input-padding-y $input-padding-x;
17
-
18
- color: $color-dark;
19
- font-size: $input-font-size;
20
- font-weight: $input-font-weight;
21
- resize: none;
22
- font-family: inherit;
23
-
24
- transition: $transition-primary;
25
- width: 100%;
26
-
27
- &::placeholder {
28
-
29
- }
30
-
31
- &:active,
32
- &:focus {
33
- outline: none;
34
- box-shadow: inset 0 0 0 1px rgba($color-primary, 0.375), 0 0 0 2px rgba($color-primary, 0.05);
35
- }
36
-
37
- &disabled,
38
- &--disabled {
39
- color: var(--color-medium);
40
- background-color: rgba(var(--color-light-rgb), 0.5);
41
- cursor: not-allowed;
42
- }
43
- }
@@ -1,31 +0,0 @@
1
- @import '../vars';
2
- @import '../mixins';
3
-
4
- $password-input-prefix: #{$prefix}-password-input;
5
-
6
- .#{$password-input-prefix} {
7
- display: flex;
8
- position: relative;
9
-
10
- transition: $transition-primary;
11
- width: 100%;
12
-
13
- & > .wr-input {
14
- padding-right: $input-padding-y + 1.5rem;
15
- }
16
-
17
- &-icon {
18
- position: absolute;
19
- right: $input-padding-y;
20
- top: 50%;
21
- transform: translateY(-50%);
22
- height: 1.25rem;
23
- width: 1.25rem;
24
- color: $color-medium;
25
-
26
- &:hover {
27
- cursor: pointer;
28
- color: $color-primary;
29
- }
30
- }
31
- }
@@ -1,58 +0,0 @@
1
- @import '../vars';
2
- @import '../mixins';
3
-
4
- @keyframes shimmer {
5
- 0% { background-position: -400px 0;}
6
- 100% { background-position: 400px 0;}
7
- }
8
-
9
-
10
- $skeleton-prefix: #{$prefix}-skeleton;
11
-
12
- .#{$skeleton-prefix} {
13
- --skeleton-style: var(--color-dark);
14
-
15
- display: block;
16
-
17
- width: 100%;
18
- height: inherit;
19
-
20
- margin-top: 4px;
21
- margin-bottom: 4px;
22
-
23
- background: rgba(var(--skeleton-style), 0.25);
24
- border-radius: $border-radius-base;
25
-
26
- line-height: 10px;
27
-
28
- user-select: none;
29
- pointer-events: none;
30
-
31
- position: relative;
32
- overflow: hidden;
33
-
34
- &:after {
35
- content: '';
36
- position: absolute;
37
- top: 0;
38
- left: 0;
39
- width: 100%;
40
- height: 100%;
41
- background: linear-gradient(
42
- to right,
43
- rgba(var(--skeleton-style), 0.065) 8%,
44
- rgba(var(--skeleton-style), 0.135) 18%,
45
- rgba(var(--skeleton-style), 0.065) 33%
46
- );
47
- background-size: 800px 104px;
48
- animation-duration: 1s;
49
- animation-fill-mode: forwards;
50
- animation-iteration-count: infinite;
51
- animation-name: shimmer;
52
- animation-timing-function: linear;
53
- }
54
-
55
- & span {
56
- display: inline-block;
57
- }
58
- }
@@ -1,44 +0,0 @@
1
- @import '../vars';
2
- @import '../mixins';
3
-
4
- $spinner-prefix: #{$prefix}-spin;
5
-
6
- .#{$spinner-prefix} {
7
- display: inline-flex;
8
- flex-direction: column;
9
- align-items: center;
10
- justify-content: center;
11
-
12
- svg {
13
- width: 1em;
14
- height: 1em;
15
-
16
- animation: rotate 2s linear infinite;
17
-
18
- .path {
19
- stroke: currentColor;
20
- animation: dash 1.5s ease-in-out infinite;
21
- }
22
- }
23
- }
24
-
25
- @keyframes rotate {
26
- 100% {
27
- transform: rotate(360deg);
28
- }
29
- }
30
-
31
- @keyframes dash {
32
- 0% {
33
- stroke-dasharray: 1, 150;
34
- stroke-dashoffset: 0;
35
- }
36
- 50% {
37
- stroke-dasharray: 90, 150;
38
- stroke-dashoffset: -35;
39
- }
40
- 100% {
41
- stroke-dasharray: 90, 150;
42
- stroke-dashoffset: -124;
43
- }
44
- }
@@ -1,70 +0,0 @@
1
- @import '../vars';
2
- @import '../mixins';
3
-
4
- $tag-prefix: #{$prefix}-tag;
5
-
6
- .#{$tag-prefix} {
7
- display: inline-block;
8
- height: auto;
9
-
10
- white-space: nowrap;
11
-
12
- font-family: $font-family;
13
- font-size: 0.75rem;
14
- font-weight: 600;
15
-
16
- line-height: 1rem;
17
- vertical-align: middle;
18
-
19
- padding: 0.25rem 0.5rem;
20
- border-radius: 0.25rem;
21
-
22
- margin-right: 0.25rem;
23
-
24
- user-select: none;
25
- transition: $transition-primary;
26
-
27
- pointer-events: none;
28
-
29
- &:hover {
30
- cursor: pointer;
31
- }
32
-
33
- &--hoverable {
34
- pointer-events: all;
35
- }
36
-
37
- &--rounded {
38
- border-radius: $btn-round-border-radius;
39
- }
40
-
41
- @each $color, $value in $theme-colors {
42
- &.#{$tag-prefix}-#{$color} {
43
- @include tag-colors-generate($value);
44
- }
45
-
46
- &.#{$tag-prefix}-#{$color} {
47
- &.#{$tag-prefix}--outlined {
48
- @include tag-outline-colors-generate($value);
49
- }
50
- }
51
-
52
- &.#{$tag-prefix}-#{$color} {
53
- &.#{$tag-prefix}--transparent {
54
- @include tag-transparent-colors-generate($value);
55
- }
56
- }
57
- }
58
-
59
- & > wr-icon {
60
- width: 0.75rem;
61
- height: 0.75rem;
62
- margin-right: 0.125rem;
63
- }
64
-
65
- & > wr-spin {
66
- width: 0.75rem;
67
- height: 0.75rem;
68
- margin-right: 0.125rem;
69
- }
70
- }
@@ -1,60 +0,0 @@
1
- @import '../vars';
2
- @import '../mixins';
3
-
4
- $tooltip-prefix: #{$prefix}-tooltip;
5
-
6
- .#{$tooltip-prefix} {
7
- display: block;
8
-
9
- font-family: $font-family;
10
- font-size: 0.75rem;
11
- font-weight: 400;
12
-
13
- line-height: 1.2;
14
-
15
- padding: 0.25rem 0.5rem;
16
- border-radius: 0.25rem;
17
-
18
- margin-bottom: 0.5rem;
19
-
20
- color: $color-white;
21
- background: $color-dark;
22
-
23
- transition: $transition-primary;
24
-
25
- position: relative;
26
-
27
- &:after {
28
- content: '';
29
-
30
- position: absolute;
31
- bottom: -0.25rem;
32
- left: 0;
33
- right: 0;
34
- margin: 0 auto;
35
- width: 0;
36
- height: 0;
37
- border-left: 0.25rem solid transparent;
38
- border-right: 0.25rem solid transparent;
39
-
40
- border-top: 0.25rem solid $color-dark;
41
- }
42
-
43
- &__wrapper {
44
- cursor: pointer;
45
- }
46
-
47
- opacity: 1;
48
- animation: fade-in 0.125s linear forwards;
49
-
50
- @keyframes fade-in {
51
- 0% {
52
- transform: translateY(0.5rem);
53
- opacity: 0
54
- }
55
- 100% {
56
- transform: translateY(0);
57
- opacity: 1;
58
- }
59
- }
60
- }
@@ -1,184 +0,0 @@
1
- @function to-rgb($value) {
2
- @return red($value), green($value), blue($value);
3
- }
4
-
5
- @function map-loop($map, $func, $args...) {
6
- $_map: ();
7
-
8
- @each $key, $value in $map {
9
- // allow to pass the $key and $value of the map as an function argument
10
- $_args: ();
11
- @each $arg in $args {
12
- $_args: append($_args, if($arg == "$key", $key, if($arg == "$value", $value, $arg)));
13
- }
14
-
15
- $_map: map-merge($_map, ($key: call(get-function($func), $_args...)));
16
- }
17
-
18
- @return $_map;
19
- }
20
- $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 .0033 .0037 .004 .0044 .0048 .0052 .0056 .006 .0065 .007 .0075 .008 .0086 .0091 .0097 .0103 .011 .0116 .0123 .013 .0137 .0144 .0152 .016 .0168 .0176 .0185 .0194 .0203 .0212 .0222 .0232 .0242 .0252 .0262 .0273 .0284 .0296 .0307 .0319 .0331 .0343 .0356 .0369 .0382 .0395 .0409 .0423 .0437 .0452 .0467 .0482 .0497 .0513 .0529 .0545 .0561 .0578 .0595 .0612 .063 .0648 .0666 .0685 .0704 .0723 .0742 .0762 .0782 .0802 .0823 .0844 .0865 .0887 .0908 .0931 .0953 .0976 .0999 .1022 .1046 .107 .1095 .1119 .1144 .117 .1195 .1221 .1248 .1274 .1301 .1329 .1356 .1384 .1413 .1441 .147 .15 .1529 .1559 .159 .162 .1651 .1683 .1714 .1746 .1779 .1812 .1845 .1878 .1912 .1946 .1981 .2016 .2051 .2086 .2122 .2159 .2195 .2232 .227 .2307 .2346 .2384 .2423 .2462 .2502 .2542 .2582 .2623 .2664 .2705 .2747 .2789 .2831 .2874 .2918 .2961 .3005 .305 .3095 .314 .3185 .3231 .3278 .3325 .3372 .3419 .3467 .3515 .3564 .3613 .3663 .3712 .3763 .3813 .3864 .3916 .3968 .402 .4072 .4125 .4179 .4233 .4287 .4342 .4397 .4452 .4508 .4564 .4621 .4678 .4735 .4793 .4851 .491 .4969 .5029 .5089 .5149 .521 .5271 .5333 .5395 .5457 .552 .5583 .5647 .5711 .5776 .5841 .5906 .5972 .6038 .6105 .6172 .624 .6308 .6376 .6445 .6514 .6584 .6654 .6724 .6795 .6867 .6939 .7011 .7084 .7157 .7231 .7305 .7379 .7454 .7529 .7605 .7682 .7758 .7835 .7913 .7991 .807 .8148 .8228 .8308 .8388 .8469 .855 .8632 .8714 .8796 .8879 .8963 .9047 .9131 .9216 .9301 .9387 .9473 .956 .9647 .9734 .9823 .9911 1;
21
-
22
- @function color-contrast($background, $color-contrast-dark: $color-dark, $color-contrast-light: $color-white, $min-contrast-ratio: 4.5) {
23
- $foregrounds: $color-contrast-light, $color-contrast-dark, $color-white, $color-black;
24
- $max-ratio: 0;
25
- $max-ratio-color: null;
26
-
27
- @each $color in $foregrounds {
28
- $contrast-ratio: contrast-ratio($background, $color);
29
- @if $contrast-ratio > $min-contrast-ratio {
30
- @return $color;
31
- } @else if $contrast-ratio > $max-ratio {
32
- $max-ratio: $contrast-ratio;
33
- $max-ratio-color: $color;
34
- }
35
- }
36
-
37
- @warn "Found no color leading to #{$min-contrast-ratio}:1 contrast ratio against #{$background}...";
38
-
39
- @return $max-ratio-color;
40
- }
41
-
42
- @function contrast-ratio($background, $foreground: $color-light) {
43
- $l1: luminance($background);
44
- $l2: luminance(opaque($background, $foreground));
45
-
46
- @return if($l1 > $l2, divide($l1 + .05, $l2 + .05), divide($l2 + .05, $l1 + .05));
47
- }
48
- @function luminance($color) {
49
- $rgb: (
50
- "r": red($color),
51
- "g": green($color),
52
- "b": blue($color)
53
- );
54
-
55
- @each $name, $value in $rgb {
56
- $value: if(divide($value, 255) < .03928, divide(divide($value, 255), 12.92), nth($_luminance-list, $value + 1));
57
- $rgb: map-merge($rgb, ($name: $value));
58
- }
59
-
60
- @return (map-get($rgb, "r") * .2126) + (map-get($rgb, "g") * .7152) + (map-get($rgb, "b") * .0722);
61
- }
62
-
63
- // Return opaque color
64
- // opaque(#fff, rgba(0, 0, 0, .5)) => #808080
65
- @function opaque($background, $foreground) {
66
- @return mix(rgba($foreground, 1), $background, opacity($foreground) * 100);
67
- }
68
-
69
- @function tint-color($color, $weight) {
70
- @return mix(white, $color, $weight);
71
- }
72
-
73
- // Shade a color: mix a color with black
74
- @function shade-color($color, $weight) {
75
- @return mix(black, $color, $weight);
76
- }
77
-
78
- // Shade the color if the weight is positive, else tint it
79
- @function shift-color($color, $weight) {
80
- @return if($weight > 0, shade-color($color, $weight), tint-color($color, -$weight));
81
- }
82
- // scss-docs-end color-functions
83
-
84
- // Return valid calc
85
- @function add($value1, $value2, $return-calc: true) {
86
- @if $value1 == null {
87
- @return $value2;
88
- }
89
-
90
- @if $value2 == null {
91
- @return $value1;
92
- }
93
-
94
- @if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
95
- @return $value1 + $value2;
96
- }
97
-
98
- @return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(" + ") + $value2);
99
- }
100
-
101
- @function subtract($value1, $value2, $return-calc: true) {
102
- @if $value1 == null and $value2 == null {
103
- @return null;
104
- }
105
-
106
- @if $value1 == null {
107
- @return -$value2;
108
- }
109
-
110
- @if $value2 == null {
111
- @return $value1;
112
- }
113
-
114
- @if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
115
- @return $value1 - $value2;
116
- }
117
-
118
- @if type-of($value2) != number {
119
- $value2: unquote("(") + $value2 + unquote(")");
120
- }
121
-
122
- @return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2);
123
- }
124
-
125
- @function divide($dividend, $divisor, $precision: 10) {
126
- $sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
127
- $dividend: abs($dividend);
128
- $divisor: abs($divisor);
129
- @if $dividend == 0 {
130
- @return 0;
131
- }
132
- @if $divisor == 0 {
133
- @error "Cannot divide by 0";
134
- }
135
- $remainder: $dividend;
136
- $result: 0;
137
- $factor: 10;
138
- @while ($remainder > 0 and $precision >= 0) {
139
- $quotient: 0;
140
- @while ($remainder >= $divisor) {
141
- $remainder: $remainder - $divisor;
142
- $quotient: $quotient + 1;
143
- }
144
- $result: $result * 10 + $quotient;
145
- $factor: $factor * .1;
146
- $remainder: $remainder * 10;
147
- $precision: $precision - 1;
148
- @if ($precision < 0 and $remainder >= $divisor * 5) {
149
- $result: $result + 1;
150
- }
151
- }
152
- $result: $result * $factor * $sign;
153
- $dividend-unit: unit($dividend);
154
- $divisor-unit: unit($divisor);
155
- $unit-map: (
156
- "px": 1px,
157
- "rem": 1rem,
158
- "em": 1em,
159
- "%": 1%
160
- );
161
- @if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
162
- $result: $result * map-get($unit-map, $dividend-unit);
163
- }
164
- @return $result;
165
- }
166
-
167
- @function valid-radius($radius) {
168
- $return: ();
169
- @each $value in $radius {
170
- @if type-of($value) == number {
171
- $return: append($return, max($value, 0));
172
- } @else {
173
- $return: append($return, $value);
174
- }
175
- }
176
- @return $return;
177
- }
178
-
179
- // scss-docs-start border-radius-mixins
180
- @mixin border-radius($radius: $border-radius-base, $fallback-border-radius: false) {
181
- border-radius: valid-radius($radius);
182
- }
183
-
184
-