@parallelogram-js/dashboard 0.0.0-stage → 0.1.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 (77) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1390 -2
  4. package/dist/parallelogram-dashboard.css +9401 -0
  5. package/dist/parallelogram-dashboard.css.map +1 -0
  6. package/dist/parallelogram-dashboard.min.css +1 -0
  7. package/package.json +72 -4
  8. package/scss/_base.scss +403 -0
  9. package/scss/_datetime.scss +50 -0
  10. package/scss/_icon.scss +40 -0
  11. package/scss/_index.scss +60 -0
  12. package/scss/_mixins.scss +396 -0
  13. package/scss/_tokens.scss +340 -0
  14. package/scss/_utilities.scss +464 -0
  15. package/scss/_variables.scss +219 -0
  16. package/scss/components/_accordion.scss +297 -0
  17. package/scss/components/_actionbar.scss +333 -0
  18. package/scss/components/_alert.scss +183 -0
  19. package/scss/components/_avatar.scss +203 -0
  20. package/scss/components/_badge.scss +176 -0
  21. package/scss/components/_banner.scss +344 -0
  22. package/scss/components/_breadcrumb.scss +220 -0
  23. package/scss/components/_button.scss +264 -0
  24. package/scss/components/_card.scss +256 -0
  25. package/scss/components/_chart.scss +246 -0
  26. package/scss/components/_command.scss +267 -0
  27. package/scss/components/_dashboard.scss +681 -0
  28. package/scss/components/_data-list.scss +280 -0
  29. package/scss/components/_dropdown.scss +318 -0
  30. package/scss/components/_empty.scss +226 -0
  31. package/scss/components/_filebrowser.scss +906 -0
  32. package/scss/components/_form-layout.scss +332 -0
  33. package/scss/components/_input.scss +310 -0
  34. package/scss/components/_list.scss +130 -0
  35. package/scss/components/_media.scss +239 -0
  36. package/scss/components/_modal.scss +298 -0
  37. package/scss/components/_navbar.scss +312 -0
  38. package/scss/components/_notification.scss +59 -0
  39. package/scss/components/_pageheader.scss +99 -0
  40. package/scss/components/_pagination.scss +165 -0
  41. package/scss/components/_progress.scss +333 -0
  42. package/scss/components/_separator.scss +129 -0
  43. package/scss/components/_sheet.scss +286 -0
  44. package/scss/components/_sidebar.scss +324 -0
  45. package/scss/components/_skeleton.scss +246 -0
  46. package/scss/components/_stat.scss +218 -0
  47. package/scss/components/_table.scss +589 -0
  48. package/scss/components/_tabs.scss +266 -0
  49. package/scss/components/_timeline.scss +339 -0
  50. package/scss/components/_toast.scss +259 -0
  51. package/scss/components/_toolbar.scss +301 -0
  52. package/scss/components/_tooltip.scss +250 -0
  53. package/scss/main.scss +6 -0
  54. package/src/js/behaviours/accordion.js +58 -0
  55. package/src/js/behaviours/action-bar-list.js +406 -0
  56. package/src/js/behaviours/action-bar.js +29 -0
  57. package/src/js/behaviours/chart.js +339 -0
  58. package/src/js/behaviours/collapsible.js +34 -0
  59. package/src/js/behaviours/editable-table.js +91 -0
  60. package/src/js/behaviours/expandable.js +80 -0
  61. package/src/js/behaviours/overflow-actions.js +137 -0
  62. package/src/js/behaviours/publish-schedule.js +91 -0
  63. package/src/js/behaviours/search-clear.js +19 -0
  64. package/src/js/behaviours/segmented-control.js +43 -0
  65. package/src/js/behaviours/submenu.js +73 -0
  66. package/src/js/behaviours/table-columns.js +77 -0
  67. package/src/js/behaviours/table-paste.js +305 -0
  68. package/src/js/behaviours/table-reorder.js +252 -0
  69. package/src/js/behaviours/table-sort.js +101 -0
  70. package/src/js/behaviours/tabs.js +148 -0
  71. package/src/js/behaviours/toast-manager.js +106 -0
  72. package/src/js/behaviours/toggle.js +186 -0
  73. package/src/js/behaviours/unsaved-guard.js +88 -0
  74. package/src/js/core-loader.js +26 -0
  75. package/src/js/index.js +85 -0
  76. package/src/js/polyfills/dialog-commands.js +20 -0
  77. package/src/js/util/dom.js +39 -0
@@ -0,0 +1,312 @@
1
+ // ==========================================================================
2
+ // Navbar Component
3
+ // ==========================================================================
4
+
5
+ @use "../variables" as *;
6
+ @use "../mixins" as *;
7
+
8
+ // --------------------------------------------------------------------------
9
+ // Base Navbar
10
+ // --------------------------------------------------------------------------
11
+
12
+ .navbar {
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: space-between;
16
+ height: $navbar-height;
17
+ padding: 0 $spacing-sm;
18
+ background-color: var(--bg);
19
+ border-bottom: 1px solid var(--border);
20
+
21
+ @include md {
22
+ padding: 0 $spacing-lg;
23
+ }
24
+
25
+ // --------------------------------------------------------------------------
26
+ // Variants
27
+ // --------------------------------------------------------------------------
28
+
29
+ // Sticky navbar
30
+ &--sticky {
31
+ position: sticky;
32
+ top: 0;
33
+ z-index: $z-sticky;
34
+ }
35
+
36
+ // Fixed navbar
37
+ &--fixed {
38
+ position: fixed;
39
+ top: 0;
40
+ left: 0;
41
+ right: 0;
42
+ z-index: $z-fixed;
43
+ }
44
+
45
+ // Transparent (for hero sections)
46
+ &--transparent {
47
+ background-color: transparent;
48
+ border-bottom: none;
49
+ }
50
+
51
+ // Elevated
52
+ &--elevated {
53
+ border-bottom: none;
54
+ box-shadow: $shadow-sm;
55
+ }
56
+
57
+ // --------------------------------------------------------------------------
58
+ // Elements
59
+ // --------------------------------------------------------------------------
60
+
61
+ &__brand {
62
+ display: flex;
63
+ align-items: center;
64
+ gap: $spacing-xs;
65
+ font-weight: $font-weight-semibold;
66
+ font-size: $font-size-lg;
67
+ color: var(--fg);
68
+ flex-shrink: 0;
69
+ }
70
+
71
+ &__logo {
72
+ width: 2rem;
73
+ height: 2rem;
74
+ }
75
+
76
+ &__nav {
77
+ display: none;
78
+ align-items: center;
79
+ gap: $spacing-3xs;
80
+
81
+ @include md {
82
+ display: flex;
83
+ }
84
+ }
85
+
86
+ &__item {
87
+ display: flex;
88
+ align-items: center;
89
+ gap: $spacing-2xs;
90
+ padding: $spacing-2xs $spacing-xs;
91
+ font-size: $font-size-sm;
92
+ font-weight: $font-weight-medium;
93
+ color: var(--fg-muted);
94
+ border-radius: $radius-md;
95
+ @include interactive;
96
+
97
+ &:hover {
98
+ color: var(--fg);
99
+ background-color: var(--accent);
100
+ }
101
+
102
+ &[aria-current="page"],
103
+ &--active {
104
+ color: var(--fg);
105
+ background-color: var(--accent);
106
+ }
107
+
108
+ &:disabled,
109
+ &[aria-disabled="true"],
110
+ &--disabled {
111
+ @include disabled;
112
+ }
113
+ }
114
+
115
+ &__actions {
116
+ display: flex;
117
+ align-items: center;
118
+ gap: $spacing-2xs;
119
+ flex-shrink: 0;
120
+ }
121
+
122
+ // Mobile menu toggle
123
+ &__toggle {
124
+ display: flex;
125
+ align-items: center;
126
+ justify-content: center;
127
+ width: 2.5rem;
128
+ height: 2.5rem;
129
+ border-radius: $radius-md;
130
+ @include interactive;
131
+
132
+ @include md {
133
+ display: none;
134
+ }
135
+
136
+ &:hover {
137
+ background-color: var(--accent);
138
+ }
139
+
140
+ svg {
141
+ width: $icon-size-lg;
142
+ height: $icon-size-lg;
143
+ }
144
+ }
145
+
146
+ // Search box
147
+ &__search {
148
+ position: relative;
149
+ display: none;
150
+
151
+ @include lg {
152
+ display: block;
153
+ }
154
+ }
155
+
156
+ &__search-input {
157
+ width: 16rem;
158
+ height: 2.25rem;
159
+ padding: 0 $spacing-xs 0 $spacing-xl;
160
+ font-size: $font-size-sm;
161
+ background-color: var(--bg-muted);
162
+ border: 1px solid transparent;
163
+ border-radius: $radius-md;
164
+ @include transition-colors;
165
+
166
+ &::placeholder {
167
+ color: var(--fg-muted);
168
+ }
169
+
170
+ &:focus {
171
+ @include focus-ring;
172
+ background-color: var(--bg);
173
+ border-color: var(--border);
174
+ }
175
+ }
176
+
177
+ &__search-icon {
178
+ position: absolute;
179
+ left: $spacing-2xs;
180
+ top: 50%;
181
+ transform: translateY(-50%);
182
+ width: $icon-size-md;
183
+ height: $icon-size-md;
184
+ color: var(--fg-muted);
185
+ pointer-events: none;
186
+ }
187
+
188
+ &__search-kbd {
189
+ position: absolute;
190
+ right: $spacing-2xs;
191
+ top: 50%;
192
+ transform: translateY(-50%);
193
+ padding: 0.125rem $spacing-3xs;
194
+ font-family: $font-mono;
195
+ font-size: $font-size-xs;
196
+ color: var(--fg-muted);
197
+ background-color: var(--bg);
198
+ border: 1px solid var(--border);
199
+ border-radius: $radius-sm;
200
+ }
201
+ }
202
+
203
+ // --------------------------------------------------------------------------
204
+ // Mobile Navigation (fullscreen overlay)
205
+ // --------------------------------------------------------------------------
206
+
207
+ .navbarmobile {
208
+ position: fixed;
209
+ inset: 0;
210
+ z-index: $z-modal;
211
+ background-color: var(--bg);
212
+ padding: $spacing-sm;
213
+ display: none;
214
+ flex-direction: column;
215
+
216
+ &[open],
217
+ &--open {
218
+ display: flex;
219
+ }
220
+
221
+ @include md {
222
+ display: none !important;
223
+ }
224
+
225
+ &__header {
226
+ display: flex;
227
+ align-items: center;
228
+ justify-content: space-between;
229
+ margin-bottom: $spacing-lg;
230
+ }
231
+
232
+ &__close {
233
+ display: flex;
234
+ align-items: center;
235
+ justify-content: center;
236
+ width: 2.5rem;
237
+ height: 2.5rem;
238
+ border-radius: $radius-md;
239
+ @include interactive;
240
+
241
+ &:hover {
242
+ background-color: var(--accent);
243
+ }
244
+
245
+ svg {
246
+ width: $icon-size-lg;
247
+ height: $icon-size-lg;
248
+ }
249
+ }
250
+
251
+ &__nav {
252
+ display: flex;
253
+ flex-direction: column;
254
+ gap: $spacing-2xs;
255
+ flex: 1;
256
+ }
257
+
258
+ &__item {
259
+ display: flex;
260
+ align-items: center;
261
+ gap: $spacing-xs;
262
+ padding: $spacing-xs $spacing-sm;
263
+ font-size: $font-size-lg;
264
+ font-weight: $font-weight-medium;
265
+ color: var(--fg);
266
+ border-radius: $radius-md;
267
+ @include interactive;
268
+
269
+ &:hover,
270
+ &[aria-current="page"],
271
+ &--active {
272
+ background-color: var(--accent);
273
+ }
274
+ }
275
+
276
+ &__footer {
277
+ padding-top: $spacing-sm;
278
+ border-top: 1px solid var(--border);
279
+ }
280
+ }
281
+
282
+ // --------------------------------------------------------------------------
283
+ // Navbar with Sidebar offset
284
+ // --------------------------------------------------------------------------
285
+
286
+ .navbar--with-sidebar {
287
+ margin-left: $sidebar-width;
288
+
289
+ // Next to a .sidebar--collapsed rail
290
+ &.navbar--sidebar-collapsed {
291
+ margin-left: $sidebar-width-collapsed;
292
+ }
293
+
294
+ // Next to a .sidebar--right
295
+ &.navbar--sidebar-right {
296
+ margin-left: 0;
297
+ margin-right: $sidebar-width;
298
+
299
+ &.navbar--sidebar-collapsed {
300
+ margin-right: $sidebar-width-collapsed;
301
+ }
302
+ }
303
+
304
+ @include max-lg {
305
+ &,
306
+ &.navbar--sidebar-collapsed,
307
+ &.navbar--sidebar-right {
308
+ margin-left: 0;
309
+ margin-right: 0;
310
+ }
311
+ }
312
+ }
@@ -0,0 +1,59 @@
1
+ // ==========================================================================
2
+ // Notification Item Component
3
+ // Rows inside the header notifications dropdown panel
4
+ // ==========================================================================
5
+
6
+ @use "../variables" as *;
7
+
8
+ .notify {
9
+ &__item {
10
+ align-items: flex-start;
11
+ gap: $spacing-xs;
12
+
13
+ &--read {
14
+ opacity: 0.6;
15
+ }
16
+ }
17
+
18
+ &__dot {
19
+ flex-shrink: 0;
20
+ width: 0.5rem;
21
+ height: 0.5rem;
22
+ margin-top: 0.375rem;
23
+ border-radius: $radius-full;
24
+ background-color: var(--fg-muted);
25
+
26
+ &--info {
27
+ background-color: var(--info);
28
+ }
29
+
30
+ &--success {
31
+ background-color: var(--success);
32
+ }
33
+
34
+ &--warning {
35
+ background-color: var(--warning);
36
+ }
37
+
38
+ &--error {
39
+ background-color: var(--destructive);
40
+ }
41
+ }
42
+
43
+ &__body {
44
+ display: flex;
45
+ flex-direction: column;
46
+ gap: 0.125rem;
47
+ min-width: 0;
48
+ white-space: normal;
49
+ }
50
+
51
+ &__text {
52
+ color: var(--popover-fg);
53
+ }
54
+
55
+ &__time {
56
+ font-size: $font-size-xs;
57
+ color: var(--fg-muted);
58
+ }
59
+ }
@@ -0,0 +1,99 @@
1
+ // ==========================================================================
2
+ // Page Header Component
3
+ // ==========================================================================
4
+
5
+ @use "../variables" as *;
6
+ @use "../mixins" as *;
7
+
8
+ // --------------------------------------------------------------------------
9
+ // Base Page Header (title, description and actions; usually led by a .breadcrumb)
10
+ // --------------------------------------------------------------------------
11
+
12
+ .pageheader {
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: $spacing-2xs;
16
+ margin-bottom: $spacing-lg;
17
+
18
+ &__title {
19
+ font-size: $font-size-3xl;
20
+ font-weight: $font-weight-bold;
21
+ letter-spacing: $letter-spacing-tight;
22
+ line-height: $line-height-tight;
23
+ }
24
+
25
+ &__description {
26
+ font-size: $font-size-base;
27
+ color: var(--fg-muted);
28
+ max-width: 65ch;
29
+ }
30
+
31
+ &__actions {
32
+ display: flex;
33
+ flex-wrap: wrap;
34
+ align-items: center;
35
+ gap: $spacing-2xs;
36
+ margin-top: $spacing-2xs;
37
+ }
38
+
39
+ // With actions on same row
40
+ &--row {
41
+ flex-direction: row;
42
+ align-items: flex-start;
43
+ justify-content: space-between;
44
+ flex-wrap: wrap;
45
+ gap: $spacing-sm;
46
+
47
+ .pageheader__content {
48
+ display: flex;
49
+ flex-direction: column;
50
+ gap: $spacing-2xs;
51
+ }
52
+
53
+ .pageheader__actions {
54
+ margin-top: 0;
55
+ }
56
+ }
57
+
58
+ // Sticky: the title row (title and actions) pins under the dashboard header from tablet up, and
59
+ // gains a shadow once pinned. Its description follows it as a sibling, so it scrolls away.
60
+ &--sticky {
61
+ align-items: center;
62
+ margin-bottom: 0;
63
+ padding-bottom: $spacing-sm;
64
+
65
+ &:not(:has(+ .pageheader__description)) {
66
+ margin-bottom: $spacing-lg - $spacing-sm;
67
+ }
68
+
69
+ @include md {
70
+ position: sticky;
71
+ top: $navbar-height;
72
+ z-index: $z-sticky - 1;
73
+ margin-top: -$spacing-lg;
74
+ margin-inline: -$spacing-lg;
75
+ padding: $spacing-lg $spacing-lg $spacing-sm;
76
+ background-color: var(--bg);
77
+
78
+ @supports (animation-timeline: scroll()) {
79
+ animation: pageheader-pinned linear both;
80
+ animation-timeline: scroll(root);
81
+ animation-range: 0 $spacing-lg;
82
+ }
83
+ }
84
+
85
+ + .pageheader__description {
86
+ margin-bottom: $spacing-lg;
87
+ }
88
+ }
89
+ }
90
+
91
+ @keyframes pageheader-pinned {
92
+ from {
93
+ box-shadow: 0 1px 0 transparent, 0 6px 12px -6px transparent;
94
+ }
95
+
96
+ to {
97
+ box-shadow: 0 1px 0 var(--border), 0 6px 12px -6px rgb(0 0 0 / 0.12);
98
+ }
99
+ }
@@ -0,0 +1,165 @@
1
+ // ==========================================================================
2
+ // Pagination Component
3
+ // ==========================================================================
4
+
5
+ @use "../variables" as *;
6
+ @use "../mixins" as *;
7
+
8
+ // --------------------------------------------------------------------------
9
+ // Base Pagination
10
+ // --------------------------------------------------------------------------
11
+
12
+ .pagination {
13
+ display: flex;
14
+ align-items: center;
15
+ gap: $spacing-3xs;
16
+
17
+ // --------------------------------------------------------------------------
18
+ // Elements
19
+ // --------------------------------------------------------------------------
20
+
21
+ &__item {
22
+ @include flex-center;
23
+ @include interactive;
24
+ min-width: $btn-height-sm;
25
+ height: $btn-height-sm;
26
+ padding: 0 $spacing-2xs;
27
+ font-size: $font-size-sm;
28
+ font-weight: $font-weight-medium;
29
+ color: var(--fg);
30
+ background-color: transparent;
31
+ border: 1px solid transparent;
32
+ border-radius: $radius-md;
33
+
34
+ &:hover:not(:disabled, [aria-disabled="true"], [aria-current="page"], .pagination__item--active) {
35
+ background-color: var(--accent);
36
+ }
37
+
38
+ &[aria-current="page"],
39
+ &--active {
40
+ background-color: var(--primary);
41
+ color: var(--primary-fg);
42
+ border-color: var(--primary);
43
+
44
+ &:hover {
45
+ background-color: var(--primary-hover);
46
+ }
47
+ }
48
+
49
+ &:disabled,
50
+ &[aria-disabled="true"],
51
+ &--disabled {
52
+ @include disabled;
53
+ }
54
+ }
55
+
56
+ &__ellipsis {
57
+ @include flex-center;
58
+ min-width: $btn-height-sm;
59
+ height: $btn-height-sm;
60
+ color: var(--fg-muted);
61
+ font-size: $font-size-sm;
62
+ }
63
+
64
+ &__prev,
65
+ &__next {
66
+ @extend .pagination__item;
67
+ }
68
+
69
+ // --------------------------------------------------------------------------
70
+ // Variants
71
+ // --------------------------------------------------------------------------
72
+
73
+ &--outline {
74
+ .pagination__item {
75
+ border-color: var(--border);
76
+
77
+ &:hover:not(:disabled, [aria-disabled="true"], [aria-current="page"], .pagination__item--active) {
78
+ border-color: var(--border);
79
+ background-color: var(--accent);
80
+ }
81
+
82
+ &[aria-current="page"],
83
+ &--active {
84
+ border-color: var(--primary);
85
+ }
86
+ }
87
+ }
88
+
89
+ &--sm {
90
+ gap: $spacing-3xs;
91
+
92
+ .pagination__item,
93
+ .pagination__ellipsis {
94
+ min-width: 1.75rem;
95
+ height: 1.75rem;
96
+ font-size: $font-size-xs;
97
+ }
98
+ }
99
+
100
+ &--lg {
101
+ gap: $spacing-2xs;
102
+
103
+ .pagination__item,
104
+ .pagination__ellipsis {
105
+ min-width: $btn-height-md;
106
+ height: $btn-height-md;
107
+ padding: 0 $spacing-xs;
108
+ }
109
+ }
110
+ }
111
+
112
+ // --------------------------------------------------------------------------
113
+ // Pagination Info
114
+ // --------------------------------------------------------------------------
115
+
116
+ .pagination__info {
117
+ display: flex;
118
+ // Wraps whenever the count, page size and page links don't fit on one line
119
+ flex-wrap: wrap;
120
+ align-items: center;
121
+ justify-content: space-between;
122
+ gap: $spacing-sm;
123
+ width: 100%;
124
+ font-size: $font-size-sm;
125
+ color: var(--fg-muted);
126
+ }
127
+
128
+ .pagination__text {
129
+ display: flex;
130
+ align-items: center;
131
+ gap: $spacing-3xs;
132
+ flex-shrink: 0;
133
+
134
+ strong {
135
+ font-weight: $font-weight-semibold;
136
+ color: var(--fg);
137
+ }
138
+ }
139
+
140
+ .pagination__select {
141
+ display: flex;
142
+ align-items: center;
143
+ gap: $spacing-2xs;
144
+ flex-shrink: 0;
145
+ }
146
+
147
+ // --------------------------------------------------------------------------
148
+ // Responsive
149
+ // --------------------------------------------------------------------------
150
+
151
+ @include max-sm {
152
+ .pagination {
153
+ &__item:not(.pagination__prev):not(.pagination__next):not([aria-current="page"], .pagination__item--active) {
154
+ display: none;
155
+ }
156
+
157
+ &__ellipsis {
158
+ display: none;
159
+ }
160
+ }
161
+
162
+ .pagination__info {
163
+ gap: $spacing-xs;
164
+ }
165
+ }