ngwr 0.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 (74) hide show
  1. package/button/button.component.ts +132 -0
  2. package/button/button.module.ts +11 -0
  3. package/button/index.ts +2 -0
  4. package/core/types/convert-input.ts +2 -0
  5. package/core/types/index.ts +3 -0
  6. package/core/types/indexable.ts +3 -0
  7. package/core/types/ng-class.ts +11 -0
  8. package/core/util/convert.ts +63 -0
  9. package/core/util/index.ts +1 -0
  10. package/divider/divider.component.ts +13 -0
  11. package/divider/divider.module.ts +10 -0
  12. package/divider/index.ts +2 -0
  13. package/extended-input/extended-input.component.html +13 -0
  14. package/extended-input/extended-input.component.ts +77 -0
  15. package/extended-input/extended-input.module.ts +17 -0
  16. package/extended-input/index.ts +2 -0
  17. package/form/form-error.component.ts +20 -0
  18. package/form/form-item.component.ts +60 -0
  19. package/form/form.module.ts +17 -0
  20. package/form/index.ts +3 -0
  21. package/icon/icon.component.ts +45 -0
  22. package/icon/icons.ts +229 -0
  23. package/icon/index.ts +3 -0
  24. package/icon/walrus-icons-registry.service.ts +20 -0
  25. package/icon/walrus-icons.module.ts +8 -0
  26. package/index.ts +1 -0
  27. package/input/index.ts +2 -0
  28. package/input/input.directive.ts +65 -0
  29. package/input/input.module.ts +16 -0
  30. package/ng-package.json +11 -0
  31. package/package.json +27 -0
  32. package/password-input/index.ts +2 -0
  33. package/password-input/password-input.component.html +10 -0
  34. package/password-input/password-input.component.ts +56 -0
  35. package/password-input/password-input.module.ts +28 -0
  36. package/public-api.ts +10 -0
  37. package/skeleton/index.ts +2 -0
  38. package/skeleton/skeleton.component.ts +38 -0
  39. package/skeleton/skeleton.module.ts +11 -0
  40. package/spinner/index.ts +2 -0
  41. package/spinner/spinner.component.ts +11 -0
  42. package/spinner/spinner.module.ts +10 -0
  43. package/styles/components/_index.scss +15 -0
  44. package/styles/components/alert.scss +28 -0
  45. package/styles/components/button.scss +115 -0
  46. package/styles/components/card.scss +41 -0
  47. package/styles/components/divider.scss +19 -0
  48. package/styles/components/dropdown.scss +128 -0
  49. package/styles/components/extended-input.scss +64 -0
  50. package/styles/components/form.scss +85 -0
  51. package/styles/components/heading.scss +25 -0
  52. package/styles/components/icon.scss +32 -0
  53. package/styles/components/input.scss +43 -0
  54. package/styles/components/password-input.scss +31 -0
  55. package/styles/components/skeleton.scss +58 -0
  56. package/styles/components/spinner.scss +44 -0
  57. package/styles/components/tag.scss +70 -0
  58. package/styles/components/tooltip.scss +60 -0
  59. package/styles/functions.scss +184 -0
  60. package/styles/grid.scss +177 -0
  61. package/styles/index.scss +165 -0
  62. package/styles/mixins/_index.scss +22 -0
  63. package/styles/mixins/alert.scss +7 -0
  64. package/styles/mixins/button.scss +56 -0
  65. package/styles/mixins/reset-component.scss +13 -0
  66. package/styles/mixins/tag.scss +68 -0
  67. package/styles/reset.scss +104 -0
  68. package/styles/root.scss +31 -0
  69. package/styles/vars.scss +1075 -0
  70. package/tag/index.ts +2 -0
  71. package/tag/tag.component.ts +92 -0
  72. package/tag/tag.module.ts +11 -0
  73. package/tsconfig.lib.json +15 -0
  74. package/tsconfig.lib.prod.json +10 -0
@@ -0,0 +1,15 @@
1
+ @import 'alert';
2
+ @import 'button';
3
+ @import 'card';
4
+ @import 'divider';
5
+ @import 'dropdown';
6
+ @import 'extended-input';
7
+ @import 'form';
8
+ @import 'heading';
9
+ @import 'icon';
10
+ @import 'input';
11
+ @import 'password-input';
12
+ @import 'skeleton';
13
+ @import 'spinner';
14
+ @import 'tag';
15
+ @import 'tooltip';
@@ -0,0 +1,28 @@
1
+ @import '../vars';
2
+ @import '../mixins';
3
+
4
+ $alert-prefix: #{$prefix}-alert;
5
+
6
+ .#{$alert-prefix} {
7
+ display: flex;
8
+ align-items: center;
9
+ width: 100%;
10
+
11
+ margin-bottom: 0.5rem;
12
+
13
+ word-wrap: break-word;
14
+ font-size: $font-size-base;
15
+ font-weight: $font-weight-base;
16
+ line-height: $line-height-base;
17
+
18
+ padding: 0.5rem 0.75rem;
19
+ border-radius: 0.375rem;
20
+
21
+ user-select: none;
22
+
23
+ @each $color, $value in $theme-colors {
24
+ &.#{$alert-prefix}-#{$color} {
25
+ @include alert-colors-generate($value);
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,115 @@
1
+ @import '../vars';
2
+ @import '../mixins';
3
+
4
+ $btn-prefix: #{$prefix}-btn;
5
+
6
+ .#{$btn-prefix} {
7
+ display: inline-flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ height: auto;
11
+
12
+ padding: calc(#{$btn-padding-y} + 1px) $btn-padding-x;
13
+ border-radius: $btn-border-radius;
14
+
15
+ font-family: $font-family;
16
+ //line-height: $btn-line-height;
17
+ text-align: center;
18
+ vertical-align: middle;
19
+
20
+ cursor: pointer;
21
+ user-select: none;
22
+
23
+ position: relative;
24
+
25
+ transition: $transition-primary;
26
+
27
+ &__text {
28
+ font-size: $btn-font-size;
29
+ font-weight: $btn-font-weight;
30
+ }
31
+
32
+ &--block {
33
+ width: 100%;
34
+ }
35
+
36
+ &--rounded {
37
+ border-radius: $btn-round-border-radius;
38
+ padding: $btn-round-padding-y $btn-round-padding-x;
39
+ }
40
+
41
+ & > wr-icon {
42
+ width: 1rem;
43
+ height: 1rem;
44
+ margin-right: 0.375rem;
45
+ }
46
+
47
+ & > wr-spin {
48
+ position: absolute;
49
+ z-index: 1;
50
+ top: 50%;
51
+ transform: translateY(-50%);
52
+ margin-left: auto;
53
+ margin-right: auto;
54
+ }
55
+
56
+ &--small {
57
+ padding: 0.25rem 0.5rem;
58
+
59
+ .#{$btn-prefix} {
60
+ &__text {
61
+ font-size: $btn-font-size / 1.25;
62
+ }
63
+ }
64
+
65
+ & > wr-icon {
66
+ width: 0.75rem;
67
+ height: 0.75rem;
68
+ margin-right: 0.25rem;
69
+ }
70
+ }
71
+
72
+ &--loading {
73
+ pointer-events: none;
74
+
75
+ .#{$btn-prefix} {
76
+ &__text {
77
+ opacity: 0;
78
+ }
79
+ }
80
+
81
+ & > wr-icon {
82
+ opacity: 0;
83
+ }
84
+ }
85
+ }
86
+
87
+ @each $color, $value in $theme-colors {
88
+ .#{$btn-prefix}-#{$color} {
89
+ @include button-variant($value);
90
+
91
+ &:disabled,
92
+ &.#{$btn-prefix}--disabled {
93
+ color: var(--color-medium);
94
+ background-color: var(--color-light);
95
+ box-shadow: none;
96
+ pointer-events: none;
97
+ }
98
+ }
99
+ }
100
+
101
+ @each $color, $value in $theme-colors {
102
+ .#{$btn-prefix}-#{$color} {
103
+ &.#{$btn-prefix}--outlined {
104
+ @include button-outline-variant($value);
105
+
106
+ &:disabled,
107
+ &.#{$btn-prefix}--disabled {
108
+ color: var(--color-medium);
109
+ background-color: transparent;
110
+ box-shadow: inset 0 0 0 1px var(--color-light);
111
+ pointer-events: none;
112
+ }
113
+ }
114
+ }
115
+ }
@@ -0,0 +1,41 @@
1
+ @import '../vars';
2
+ @import '../mixins';
3
+
4
+ $card-prefix: #{$prefix}-card;
5
+
6
+ .#{$card-prefix} {
7
+ display: flex;
8
+ flex-direction: column;
9
+ align-content: baseline;
10
+ justify-content: center;
11
+
12
+ background: $color-white;
13
+ border-radius: 0.75rem;
14
+
15
+ padding: 1.5rem 1.25rem;
16
+ box-shadow: $shadow-1-down;
17
+
18
+ &--hoverable {
19
+ transition: $transition-base;
20
+
21
+ &:hover {
22
+ cursor: pointer;
23
+ box-shadow: $box-shadow-base;
24
+
25
+ .#{$card-prefix}__title {
26
+ color: $color-secondary;
27
+ }
28
+ }
29
+ }
30
+
31
+ &__title {
32
+ color: $color-dark;
33
+ font-size: 1.125rem;
34
+ font-weight: 500;
35
+ line-height: 1;
36
+
37
+ margin-bottom: 0.5rem;
38
+
39
+ transition: $transition-base;
40
+ }
41
+ }
@@ -0,0 +1,19 @@
1
+ @import '../vars';
2
+ @import '../mixins';
3
+
4
+ $divider-prefix: #{$prefix}-divider;
5
+
6
+ .#{$divider-prefix} {
7
+ display: block;
8
+
9
+ width: 100%;
10
+ height: 1px;
11
+
12
+ margin-top: 4px;
13
+ margin-bottom: 4px;
14
+
15
+ background: $color-light;
16
+
17
+ user-select: none;
18
+ pointer-events: none;
19
+ }
@@ -0,0 +1,128 @@
1
+ @import '../vars';
2
+ @import '../mixins';
3
+
4
+ $dropdown-prefix: #{$prefix}-dropdown;
5
+
6
+ .#{$dropdown-prefix} {
7
+ @include reset-component();
8
+
9
+ position: absolute;
10
+ top: -9999px;
11
+ left: -9999px;
12
+ z-index: $zindex-dropdown;
13
+ display: block;
14
+
15
+ &::before {
16
+ position: absolute;
17
+ top: -$popover-distance + $popover-arrow-width;
18
+ right: 0;
19
+ bottom: -$popover-distance + $popover-arrow-width;
20
+ left: -7px;
21
+ z-index: -9999;
22
+ opacity: 0.0001;
23
+ content: ' ';
24
+ }
25
+
26
+ &-trigger {
27
+ &:hover {
28
+ cursor: pointer;
29
+ }
30
+ }
31
+
32
+ &-wrap {
33
+ position: relative;
34
+ }
35
+
36
+ &-hidden,
37
+ &-menu-hidden,
38
+ &-menu-submenu-hidden {
39
+ display: none;
40
+ }
41
+
42
+ &-menu {
43
+ display: flex;
44
+ flex-direction: column;
45
+ align-items: baseline;
46
+ position: relative;
47
+ margin: 0;
48
+ padding: 1rem;
49
+ text-align: left;
50
+ list-style-type: none;
51
+ background-color: $dropdown-menu-bg;
52
+ background-clip: padding-box;
53
+ border-radius: $border-radius-base;
54
+ outline: none;
55
+ box-shadow: $box-shadow-base;
56
+
57
+ &-submenu-popup {
58
+ position: absolute;
59
+ z-index: $zindex-dropdown;
60
+ background: transparent;
61
+ box-shadow: none;
62
+ transform-origin: 0 0;
63
+
64
+ ul,
65
+ li {
66
+ list-style: none;
67
+ }
68
+
69
+ ul {
70
+ margin-right: 0.3em;
71
+ margin-left: 0.3em;
72
+ }
73
+ }
74
+
75
+ // ======================= Item Content =======================
76
+ &-item {
77
+ position: relative;
78
+ display: flex;
79
+ align-items: center;
80
+ color: $color-dark;
81
+ transition: all 0.15s linear;
82
+
83
+ &:hover {
84
+ color: $color-secondary;
85
+ }
86
+ }
87
+
88
+ &-item,
89
+ &-submenu-title {
90
+ clear: both;
91
+ font-weight: normal;
92
+ white-space: nowrap;
93
+ cursor: pointer;
94
+ margin: 0 0 1rem;
95
+
96
+ &:last-child {
97
+ margin-bottom: 0;
98
+ }
99
+
100
+ }
101
+ }
102
+
103
+ &.#{$dropdown-prefix}-slide-down-enter,
104
+ &.#{$dropdown-prefix}-slide-down-appear,
105
+ &.#{$dropdown-prefix}-slide-down-enter,
106
+ &.#{$dropdown-prefix}-slide-down-appear,
107
+ &.#{$dropdown-prefix}-slide-down-enter,
108
+ &.#{$dropdown-prefix}-slide-down-appear {
109
+ animation-name: antSlideUpIn;
110
+ }
111
+ }
112
+
113
+ .wr-dropdown-menu {
114
+ & > ul {
115
+ list-style: inherit;
116
+ margin: 0;
117
+ padding: 0;
118
+ }
119
+ }
120
+
121
+ .wr-dropdown {
122
+ top: 0;
123
+ left: 0;
124
+ position: relative;
125
+ width: 100%;
126
+ margin-top: 6px;
127
+ margin-bottom: 6px;
128
+ }
@@ -0,0 +1,64 @@
1
+ @import '../vars';
2
+ @import '../mixins';
3
+
4
+ $extended-input-prefix: #{$prefix}-extended-input;
5
+
6
+ .#{$extended-input-prefix} {
7
+ display: flex;
8
+ align-items: center;
9
+
10
+ overflow: hidden;
11
+
12
+ transition: $transition-primary;
13
+ width: 100%;
14
+
15
+ &--has-suffix {
16
+ & > .wr-input {
17
+ border-top-right-radius: 0;
18
+ border-bottom-right-radius: 0;
19
+ }
20
+ }
21
+
22
+ &--has-prefix {
23
+ & > .wr-input {
24
+ border-top-left-radius: 0;
25
+ border-bottom-left-radius: 0;
26
+ }
27
+ }
28
+
29
+ &-suffix,
30
+ &-prefix {
31
+ display: inline-flex;
32
+ align-items: center;
33
+ background: rgba($color-light, 0.5);
34
+ border: 1px solid $color-light;
35
+
36
+ padding-left: $input-padding-y;
37
+ padding-right: $input-padding-y;
38
+
39
+ height: 100%;
40
+ max-width: 50%;
41
+
42
+ user-select: none;
43
+ pointer-events: none;
44
+
45
+ &__text {
46
+ color: $color-medium;
47
+ overflow: hidden;
48
+ text-overflow: ellipsis;
49
+ white-space: nowrap;
50
+ }
51
+ }
52
+
53
+ &-suffix {
54
+ border-top-right-radius: $input-border-radius;
55
+ border-bottom-right-radius: $input-border-radius;
56
+ border-left: 0;
57
+ }
58
+
59
+ &-prefix {
60
+ border-top-left-radius: $input-border-radius;
61
+ border-bottom-left-radius: $input-border-radius;
62
+ border-right: 0;
63
+ }
64
+ }
@@ -0,0 +1,85 @@
1
+ @import '../vars';
2
+ @import '../mixins';
3
+
4
+ $form-prefix: #{$prefix}-form;
5
+ $input-prefix: #{$prefix}-input;
6
+ $password-input-prefix: #{$prefix}-password-input;
7
+ $extended-input-prefix: #{$prefix}-extended-input;
8
+
9
+ .#{$form-prefix} {
10
+ &-item {
11
+ @include column;
12
+ margin-bottom: 1rem;
13
+
14
+ & > * {
15
+ width: 100%;
16
+ }
17
+
18
+ & > label {
19
+ display: inline-flex;
20
+ align-items: center;
21
+ color: $color-medium;
22
+ font-size: 0.875rem;
23
+ font-weight: 400;
24
+ line-height: 1;
25
+ margin-bottom: 0.5rem;
26
+ transition: $transition-base;
27
+
28
+ & > nz-switch {
29
+ margin-left: 0.5rem;
30
+ }
31
+
32
+ & > nz-radio-group {
33
+ margin-left: 0.5rem;
34
+
35
+ .ant-radio-button-wrapper {
36
+ font-size: 0.625rem;
37
+ height: 0.825rem !important;
38
+ line-height: calc(1rem - 4px) !important;
39
+
40
+ &:first-child {
41
+ border-top-left-radius: 50rem;
42
+ border-bottom-left-radius: 50rem;
43
+ }
44
+ &:last-child {
45
+ border-top-right-radius: 50rem;
46
+ border-bottom-right-radius: 50rem;
47
+ }
48
+ }
49
+ }
50
+ }
51
+
52
+ &--has-error {
53
+ & > label {
54
+ color: $color-danger;
55
+ }
56
+ & .#{$input-prefix} {
57
+ box-shadow: inset 0 0 0 1px $color-danger;
58
+ }
59
+ & .#{$extended-input-prefix} {
60
+ &-suffix,
61
+ &-prefix {
62
+ border-color: $color-danger;
63
+ background: rgba($color-danger, 0.25);
64
+
65
+ &__text {
66
+ color: $color-danger;
67
+ }
68
+ }
69
+ }
70
+
71
+ & > nz-select {
72
+ .ant-select-selector {
73
+ box-shadow: inset 0 0 0 1px $color-danger;
74
+ }
75
+ }
76
+ }
77
+ }
78
+
79
+ &-error {
80
+ color: $color-danger;
81
+ font-size: 0.75rem;
82
+ opacity: 0.75;
83
+ margin-top: 0.25rem;
84
+ }
85
+ }
@@ -0,0 +1,25 @@
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
+ }
@@ -0,0 +1,32 @@
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
+ }
@@ -0,0 +1,43 @@
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
+ }
@@ -0,0 +1,31 @@
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
+ }
@@ -0,0 +1,58 @@
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
+ }