@ardium-ui/ui 3.4.4 → 3.5.0

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 (55) hide show
  1. package/esm2022/lib/_internal/disablable-component.mjs +1 -1
  2. package/esm2022/lib/buttons/icon-button/icon-button.module.mjs +2 -2
  3. package/esm2022/lib/calendar/calendar.component.mjs +437 -0
  4. package/esm2022/lib/calendar/calendar.defaults.mjs +26 -0
  5. package/esm2022/lib/calendar/calendar.internal-types.mjs +2 -0
  6. package/esm2022/lib/calendar/calendar.module.mjs +24 -0
  7. package/esm2022/lib/calendar/calendar.types.mjs +6 -0
  8. package/esm2022/lib/calendar/index.mjs +5 -0
  9. package/esm2022/lib/calendar/views/days-view/days-view.component.mjs +282 -0
  10. package/esm2022/lib/calendar/views/days-view/days-view.helpers.mjs +65 -0
  11. package/esm2022/lib/calendar/views/months-view/months-view.component.mjs +245 -0
  12. package/esm2022/lib/calendar/views/months-view/months-view.helpers.mjs +22 -0
  13. package/esm2022/lib/calendar/views/years-view/years-view.component.mjs +244 -0
  14. package/esm2022/lib/calendar/views/years-view/years-view.helpers.mjs +14 -0
  15. package/esm2022/lib/inputs/date-input/date-input.component.mjs +357 -0
  16. package/esm2022/lib/inputs/date-input/date-input.defaults.mjs +38 -0
  17. package/esm2022/lib/inputs/date-input/date-input.directive.mjs +59 -0
  18. package/esm2022/lib/inputs/date-input/date-input.module.mjs +50 -0
  19. package/esm2022/lib/inputs/date-input/date-input.serializers.mjs +49 -0
  20. package/esm2022/lib/inputs/date-input/date-input.types.mjs +5 -0
  21. package/esm2022/lib/inputs/date-input/index.mjs +6 -0
  22. package/esm2022/public-api.mjs +3 -2
  23. package/fesm2022/ardium-ui-ui.mjs +1878 -52
  24. package/fesm2022/ardium-ui-ui.mjs.map +1 -1
  25. package/lib/_internal/disablable-component.d.ts +1 -1
  26. package/lib/calendar/calendar.component.d.ts +94 -0
  27. package/lib/calendar/calendar.defaults.d.ts +18 -0
  28. package/lib/calendar/calendar.internal-types.d.ts +4 -0
  29. package/lib/calendar/calendar.module.d.ts +14 -0
  30. package/lib/calendar/calendar.types.d.ts +83 -0
  31. package/lib/calendar/index.d.ts +4 -0
  32. package/lib/calendar/views/days-view/days-view.component.d.ts +68 -0
  33. package/lib/calendar/views/days-view/days-view.helpers.d.ts +20 -0
  34. package/lib/calendar/views/months-view/months-view.component.d.ts +61 -0
  35. package/lib/calendar/views/months-view/months-view.helpers.d.ts +3 -0
  36. package/lib/calendar/views/years-view/years-view.component.d.ts +59 -0
  37. package/lib/calendar/views/years-view/years-view.helpers.d.ts +3 -0
  38. package/lib/inputs/date-input/date-input.component.d.ts +95 -0
  39. package/lib/inputs/date-input/date-input.defaults.d.ts +30 -0
  40. package/lib/inputs/date-input/date-input.directive.d.ts +33 -0
  41. package/lib/inputs/date-input/date-input.module.d.ts +14 -0
  42. package/lib/inputs/date-input/date-input.serializers.d.ts +3 -0
  43. package/lib/inputs/date-input/date-input.types.d.ts +16 -0
  44. package/lib/inputs/date-input/index.d.ts +5 -0
  45. package/package.json +1 -1
  46. package/prebuilt-themes/default/calendar-OLD.css +294 -0
  47. package/prebuilt-themes/default/calendar-OLD.css.map +1 -0
  48. package/prebuilt-themes/default/calendar.css +100 -80
  49. package/prebuilt-themes/default/calendar.css.map +1 -1
  50. package/prebuilt-themes/default/inputs/date-input.css +68 -0
  51. package/prebuilt-themes/default/inputs/date-input.css.map +1 -0
  52. package/public-api.d.ts +2 -0
  53. package/themes/default/calendar-OLD.scss +183 -0
  54. package/themes/default/calendar.scss +120 -98
  55. package/themes/default/inputs/date-input.scss +32 -0
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Should be applied to the first element in the component's template.
3
+ */
4
+ ard-date-input .ard-date-input {
5
+ position: relative;
6
+ font-family: "Roboto", sans-serif;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: stretch;
10
+ gap: 0.625em;
11
+ cursor: text;
12
+ box-sizing: border-box;
13
+ font-size: 1rem;
14
+ line-height: 1.25em;
15
+ padding-left: 0.375rem;
16
+ }
17
+ ard-date-input .ard-date-input .ard-input-container {
18
+ flex-grow: 1;
19
+ text-size-adjust: 100%;
20
+ display: flex;
21
+ align-items: center;
22
+ }
23
+ ard-date-input .ard-date-input .ard-input-container .ard-placeholder {
24
+ font: inherit;
25
+ opacity: 60%;
26
+ white-space: nowrap;
27
+ overflow: hidden;
28
+ text-overflow: ellipsis;
29
+ max-width: 100%;
30
+ pointer-events: none;
31
+ }
32
+ ard-date-input .ard-date-input .ard-input-container input {
33
+ border: none;
34
+ background: transparent;
35
+ outline: none;
36
+ font: inherit;
37
+ padding: 0;
38
+ display: block;
39
+ width: 100%;
40
+ }
41
+ ard-date-input .ard-date-input.ard-compact {
42
+ height: 1.5625em;
43
+ font-size: 0.85em;
44
+ line-height: 1;
45
+ }
46
+ ard-date-input .ard-date-input .ard-date-input__value-container {
47
+ flex-grow: 1;
48
+ }
49
+ ard-date-input .ard-date-input .ard-date-input__placeholder {
50
+ position: absolute;
51
+ }
52
+ ard-date-input .ard-date-input .ard-date-input__input-container {
53
+ position: absolute;
54
+ inset: 0;
55
+ }
56
+ ard-date-input .ard-date-input .ard-date-input__input-container.ard-date-input__input-container-hidden {
57
+ position: absolute;
58
+ opacity: 0;
59
+ appearance: none;
60
+ }
61
+ ard-date-input .ard-date-input .ard-date-input__input-container input {
62
+ box-sizing: border-box;
63
+ width: 100%;
64
+ height: 100%;
65
+ padding: 0 2.625rem 0 0.375rem;
66
+ }
67
+
68
+ /*# sourceMappingURL=date-input.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../../../../../projects/ui/src/themes/default/inputs/_shared.scss","../../../../../projects/ui/src/themes/default/inputs/date-input.scss"],"names":[],"mappings":"AAEA;AAAA;AAAA;ACCA;EDGE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;ECTA;;ADWA;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAIJ;EACE;EACA;EACA;;ACvCF;EACE;;AAEF;EACE;;AAEF;EACI;EACA;;AAEF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA","file":"date-input.css"}
package/public-api.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './lib/option';
7
7
  export * from './lib/select';
8
8
  export * from './lib/file-inputs/file-drop-area';
9
9
  export * from './lib/file-inputs/file-input';
10
+ export * from './lib/inputs/date-input';
10
11
  export * from './lib/inputs/hex-input';
11
12
  export * from './lib/inputs/number-input';
12
13
  export * from './lib/buttons/button';
@@ -22,6 +23,7 @@ export * from './lib/slider';
22
23
  export * from './lib/star/star-button';
23
24
  export * from './lib/star/star-input';
24
25
  export * from './lib/statebox';
26
+ export * from './lib/calendar';
25
27
  export * from './lib/checkbox-list';
26
28
  export * from './lib/badge';
27
29
  export * from './lib/progress-bar';
@@ -0,0 +1,183 @@
1
+ @use './dropdown-arrow.scss' as DA;
2
+ @use './mixins.scss' as DM;
3
+ @use './coloring.scss' as CM;
4
+ @use '../variables' as ARD;
5
+
6
+ .ard-calendar {
7
+ @include CM.typeColors();
8
+ width: 18.5rem;
9
+ background: ARD.$bg;
10
+ user-select: none;
11
+
12
+ .ard-calendar-header-container {
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: stretch;
16
+
17
+ .ard-calendar-days-view-header {
18
+ width: 100%;
19
+ display: flex;
20
+ justify-content: space-between;
21
+
22
+ .ard-calendar-header-button .ard-button-content {
23
+ display: flex;
24
+ gap: 0.375rem;
25
+ align-items: center;
26
+
27
+ .ard-dropdown-arrow {
28
+ @include DA.dropdown-arrow();
29
+ }
30
+ }
31
+ .ard-calendar-arrows {
32
+ display: flex;
33
+ gap: 0.375rem;
34
+
35
+ > ard-fab {
36
+ margin: 0;
37
+ }
38
+ }
39
+ }
40
+ }
41
+ //! main container
42
+ .ard-calendar-main-container {
43
+ padding: 0.375rem;
44
+ padding-top: 0;
45
+ }
46
+ //! calendar entries
47
+ .ard-calendar-entry {
48
+ z-index: 1;
49
+ cursor: pointer;
50
+ outline: none;
51
+
52
+ .ard-calendar-entry-button {
53
+ $_margin: 0.125rem;
54
+ background: transparent;
55
+ border: 1px solid transparent;
56
+ width: calc(100% - #{$_margin * 2});
57
+ height: calc(100% - #{$_margin * 2});
58
+ padding: 0;
59
+ position: relative;
60
+ border-radius: 9999px;
61
+ cursor: pointer;
62
+ margin: $_margin;
63
+
64
+ .ard-focus-overlay {
65
+ @include DM.focus-overlay();
66
+ z-index: -1;
67
+ background: var(--ard-cmpcl--bg-colored);
68
+ border: 2px solid transparent;
69
+ transition:
70
+ border-color 0.2s ease,
71
+ opacity 0.2s ease;
72
+ }
73
+ }
74
+ &.ard-calendar-entry-empty {
75
+ cursor: default;
76
+ pointer-events: none;
77
+ }
78
+ &.ard-calendar-today {
79
+ .ard-calendar-entry-button {
80
+ border-color: ARD.$detail;
81
+ }
82
+ }
83
+ &.ard-calendar-entry-highlighted {
84
+ .ard-focus-overlay {
85
+ opacity: 20%;
86
+ }
87
+ }
88
+ &.ard-calendar-entry-selected {
89
+ .ard-calendar-entry-button {
90
+ color: var(--ard-cmpcl--on-bg-colored);
91
+ }
92
+ .ard-focus-overlay {
93
+ opacity: 100%;
94
+ }
95
+
96
+ &.ard-calendar-today {
97
+ .ard-focus-overlay {
98
+ border-color: ARD.$bg;
99
+ }
100
+ }
101
+ }
102
+ }
103
+ //! days view
104
+ .ard-calendar-grid {
105
+ display: grid;
106
+ grid-template-columns: repeat(7, 1fr);
107
+
108
+ > * {
109
+ max-width: 100%;
110
+ box-sizing: border-box;
111
+ aspect-ratio: 1;
112
+ }
113
+ }
114
+ .ard-calendar-day-labels {
115
+ font-size: 0.8125rem;
116
+ color: ARD.$text3;
117
+ height: 1.25rem;
118
+ position: relative;
119
+
120
+ > * {
121
+ display: flex;
122
+ align-items: center;
123
+ justify-content: center;
124
+ aspect-ratio: unset;
125
+ }
126
+ &::after {
127
+ content: '';
128
+ position: absolute;
129
+ width: 100%;
130
+ height: 1px;
131
+ background: ARD.$detail-ultralight;
132
+ bottom: 0;
133
+ }
134
+ }
135
+ .ard-calendar-main-grid {
136
+ position: relative;
137
+
138
+ &.ard-reserve-top-row {
139
+ padding-top: 100% / 7;
140
+ }
141
+ .ard-calendar-floating-month {
142
+ position: absolute;
143
+ top: 0;
144
+ left: 0;
145
+ width: 100%;
146
+ box-sizing: border-box;
147
+ aspect-ratio: 7;
148
+ padding-left: 0.5rem;
149
+ display: flex;
150
+ align-items: center;
151
+ font-size: 0.875rem;
152
+ font-weight: 500;
153
+ color: ARD.$text3;
154
+ letter-spacing: 0.5px;
155
+ }
156
+ }
157
+ //! years & months view
158
+ .ard-calendar-simple-grid {
159
+ border-top: 1px solid ARD.$detail-ultralight;
160
+ margin-top: 0.25rem;
161
+ display: grid;
162
+ grid-template-columns: repeat(4, 1fr);
163
+ grid-template-rows: repeat(6, 1fr);
164
+
165
+ > * {
166
+ max-width: 100%;
167
+ box-sizing: border-box;
168
+ aspect-ratio: 7/4; //it has to be the same height as in the days view
169
+ //before it was 7/7 (1) because there are 7 entries in a single row
170
+ //now there are 4 entries, and thus 7/4
171
+ }
172
+ }
173
+ //! interactions
174
+ &.ard-calendar-nointeract {
175
+ .ard-calendar-main-container {
176
+ pointer-events: none;
177
+ }
178
+ }
179
+ //! static height
180
+ &.ard-calendar-static-height {
181
+ height: 19.5rem;
182
+ }
183
+ }
@@ -3,89 +3,143 @@
3
3
  @use './coloring.scss' as CM;
4
4
  @use '../variables' as ARD;
5
5
 
6
+ $grid-size: 2.5rem;
7
+
6
8
  .ard-calendar {
7
9
  @include CM.typeColors();
8
10
  width: 18.5rem;
9
- background: ARD.$bg;
10
11
  user-select: none;
11
12
 
12
- .ard-calendar-header-container {
13
- display: flex;
14
- align-items: center;
15
- justify-content: stretch;
16
-
17
- .ard-calendar-days-view-header {
18
- width: 100%;
13
+ //! top toolbar
14
+ .ard-calendar__top-toolbar {
15
+ .ard-calendar__calendar-header {
19
16
  display: flex;
20
17
  justify-content: space-between;
18
+ align-items: center;
19
+ width: 100%;
20
+ padding: 0.75rem 0;
21
21
 
22
- .ard-calendar-header-button .ard-button-content {
23
- display: flex;
24
- gap: 0.375rem;
25
- align-items: center;
26
-
27
- .ard-dropdown-arrow {
28
- @include DA.dropdown-arrow();
29
- }
22
+ .ard-dropdown-arrow {
23
+ @include DA.dropdown-arrow();
30
24
  }
31
- .ard-calendar-arrows {
32
- display: flex;
33
- gap: 0.375rem;
25
+ }
26
+ }
27
+ .ard-years-view {
28
+ .ard-dropdown-arrow {
29
+ rotate: 180deg;
30
+ }
31
+ }
32
+ //! weekdays
33
+ .ard-calendar__weekdays {
34
+ display: grid;
35
+ grid-template-columns: repeat(7, $grid-size);
36
+ align-items: center;
37
+ padding: 0 0.375rem 0.5rem 0.375rem;
34
38
 
35
- > ard-fab {
36
- margin: 0;
37
- }
38
- }
39
+ .ard-calendar__weekday {
40
+ text-align: center;
41
+ font-size: 0.875rem;
42
+ font-weight: 500;
43
+ color: ARD.$text;
39
44
  }
40
45
  }
41
- //! main container
42
- .ard-calendar-main-container {
46
+ //! days grid
47
+ .ard-calendar__days-grid {
43
48
  padding: 0.375rem;
44
49
  padding-top: 0;
50
+ display: grid;
51
+ grid-template-columns: repeat(7, $grid-size);
52
+ position: relative;
53
+ outline: none;
54
+
55
+ > * {
56
+ max-width: 100%;
57
+ box-sizing: border-box;
58
+ aspect-ratio: 1;
59
+ }
60
+ &.ard-reserve-top-row {
61
+ padding-top: $grid-size;
62
+ }
63
+ .ard-calendar__floating-month {
64
+ position: absolute;
65
+ top: 0;
66
+ left: 0;
67
+ width: 100%;
68
+ box-sizing: border-box;
69
+ aspect-ratio: 7;
70
+ padding-left: 1rem;
71
+ display: flex;
72
+ align-items: center;
73
+ font-size: 0.875rem;
74
+ font-weight: 500;
75
+ color: ARD.$text3;
76
+ letter-spacing: 0.5px;
77
+ z-index: 2;
78
+ pointer-events: none;
79
+ }
80
+ }
81
+ //! years grid
82
+ .ard-calendar__simple-grid {
83
+ border-top: 1px solid ARD.$detail-ultralight;
84
+ margin-top: 0.25rem;
85
+ display: grid;
86
+ grid-template-columns: repeat(4, 1fr);
87
+ grid-template-rows: repeat(6, $grid-size);
88
+ position: relative;
89
+ outline: none;
90
+
91
+ > * {
92
+ max-width: 100%;
93
+ box-sizing: border-box;
94
+ aspect-ratio: 7/4; //it has to be the same height as in the days view
95
+ //before it was 7/7 (1) because there are 7 entries in a single row
96
+ //now there are 4 entries, and thus 7/4
97
+ }
45
98
  }
46
- //! calendar entries
47
- .ard-calendar-entry {
99
+ //! common in both grids
100
+ .ard-calendar__entry {
48
101
  z-index: 1;
49
102
  cursor: pointer;
50
103
  outline: none;
104
+ padding: 0.125rem;
51
105
 
52
- .ard-calendar-entry-button {
53
- $_margin: 0.125rem;
106
+ .ard-calendar__entry-button {
107
+ width: 100%;
108
+ height: 100%;
109
+ padding: 0;
110
+ display: flex;
111
+ align-items: center;
112
+ justify-content: center;
113
+ font-size: 0.875rem;;
54
114
  background: transparent;
55
115
  border: 1px solid transparent;
56
- width: calc(100% - #{$_margin * 2});
57
- height: calc(100% - #{$_margin * 2});
58
- padding: 0;
59
- position: relative;
60
116
  border-radius: 9999px;
117
+ position: relative;
61
118
  cursor: pointer;
62
- margin: $_margin;
63
119
 
64
120
  .ard-focus-overlay {
65
121
  @include DM.focus-overlay();
66
122
  z-index: -1;
67
123
  background: var(--ard-cmpcl--bg-colored);
68
124
  border: 2px solid transparent;
69
- transition:
70
- border-color 0.2s ease,
71
- opacity 0.2s ease;
125
+ transition: border-color 0.1s ease, opacity 0.1s ease;
72
126
  }
73
127
  }
74
- &.ard-calendar-entry-empty {
128
+ &.ard-calendar__entry-empty {
75
129
  cursor: default;
76
130
  }
77
131
  &.ard-calendar-today {
78
- .ard-calendar-entry-button {
132
+ .ard-calendar__entry-button {
79
133
  border-color: ARD.$detail;
80
134
  }
81
135
  }
82
- &.ard-calendar-entry-highlighted {
136
+ &.ard-calendar__entry-highlighted {
83
137
  .ard-focus-overlay {
84
138
  opacity: 20%;
85
139
  }
86
140
  }
87
- &.ard-calendar-entry-selected {
88
- .ard-calendar-entry-button {
141
+ &.ard-calendar__entry-selected {
142
+ .ard-calendar__entry-button {
89
143
  color: var(--ard-cmpcl--on-bg-colored);
90
144
  }
91
145
  .ard-focus-overlay {
@@ -98,19 +152,24 @@
98
152
  }
99
153
  }
100
154
  }
101
- }
102
- //! days view
103
- .ard-calendar-grid {
104
- display: grid;
105
- grid-template-columns: repeat(7, 1fr);
155
+ &.ard-calendar__entry-disabled {
156
+ pointer-events: none;
157
+ opacity: 50%;
106
158
 
107
- > * {
108
- max-width: 100%;
109
- box-sizing: border-box;
110
- aspect-ratio: 1;
159
+ .ard-calendar__entry-button {
160
+ cursor: default;
161
+ }
162
+ .ard-focus-overlay {
163
+ background: var(--ard-cmpcl--overlay);
164
+ }
165
+ &.ard-calendar__entry-highlighted {
166
+ .ard-focus-overlay {
167
+ opacity: 15%;
168
+ }
169
+ }
111
170
  }
112
171
  }
113
- .ard-calendar-day-labels {
172
+ .ard-calendar__day-labels {
114
173
  font-size: 0.8125rem;
115
174
  color: ARD.$text3;
116
175
  height: 1.25rem;
@@ -131,52 +190,15 @@
131
190
  bottom: 0;
132
191
  }
133
192
  }
134
- .ard-calendar-main-grid {
135
- position: relative;
136
-
137
- &.ard-reserve-top-row {
138
- padding-top: 100% / 7;
139
- }
140
- .ard-calendar-floating-month {
141
- position: absolute;
142
- top: 0;
143
- left: 0;
144
- width: 100%;
145
- box-sizing: border-box;
146
- aspect-ratio: 7;
147
- padding-left: 0.5rem;
148
- display: flex;
149
- align-items: center;
150
- font-size: 0.875rem;
151
- font-weight: 500;
152
- color: ARD.$text3;
153
- letter-spacing: 0.5px;
154
- }
155
- }
156
- //! years & months view
157
- .ard-calendar-simple-grid {
158
- border-top: 1px solid ARD.$detail-ultralight;
159
- margin-top: 0.25rem;
160
- display: grid;
161
- grid-template-columns: repeat(4, 1fr);
162
- grid-template-rows: repeat(6, 1fr);
163
-
164
- > * {
165
- max-width: 100%;
166
- box-sizing: border-box;
167
- aspect-ratio: 7/4; //it has to be the same height as in the days view
168
- //before it was 7/7 (1) because there are 7 entries in a single row
169
- //now there are 4 entries, and thus 7/4
170
- }
171
- }
172
- //! interactions
173
- &.ard-calendar-nointeract {
174
- .ard-calendar-main-container {
175
- pointer-events: none;
176
- }
193
+ }
194
+ .ard-readonly,
195
+ .ard-disabled {
196
+ .ard-calendar {
197
+ pointer-events: none;
177
198
  }
178
- //! static height
179
- &.ard-calendar-static-height {
180
- height: 19.5rem;
199
+ }
200
+ .ard-disabled {
201
+ .ard-calendar {
202
+ opacity: 50%;
181
203
  }
182
204
  }
@@ -0,0 +1,32 @@
1
+ @use './shared' as S;
2
+ @use '../../variables' as ARD;
3
+
4
+ ard-date-input
5
+ .ard-date-input {
6
+ @include S.genericInput();
7
+ padding-left: 0.375rem;
8
+
9
+ .ard-date-input__value-container {
10
+ flex-grow: 1;
11
+ }
12
+ .ard-date-input__placeholder {
13
+ position: absolute;
14
+ }
15
+ .ard-date-input__input-container {
16
+ position: absolute;
17
+ inset: 0;
18
+
19
+ &.ard-date-input__input-container-hidden {
20
+ position: absolute;
21
+ opacity: 0;
22
+ appearance: none;
23
+ }
24
+
25
+ input {
26
+ box-sizing: border-box;
27
+ width: 100%;
28
+ height: 100%;
29
+ padding: 0 2.625rem 0 0.375rem;
30
+ }
31
+ }
32
+ }