@parallelogram-js/dashboard 0.0.0-stage → 0.1.2

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 (78) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1391 -2
  4. package/dist/parallelogram-dashboard.css +9478 -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 +61 -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/_auth.scss +98 -0
  20. package/scss/components/_avatar.scss +203 -0
  21. package/scss/components/_badge.scss +176 -0
  22. package/scss/components/_banner.scss +344 -0
  23. package/scss/components/_breadcrumb.scss +220 -0
  24. package/scss/components/_button.scss +264 -0
  25. package/scss/components/_card.scss +256 -0
  26. package/scss/components/_chart.scss +246 -0
  27. package/scss/components/_command.scss +267 -0
  28. package/scss/components/_dashboard.scss +681 -0
  29. package/scss/components/_data-list.scss +280 -0
  30. package/scss/components/_dropdown.scss +318 -0
  31. package/scss/components/_empty.scss +226 -0
  32. package/scss/components/_filebrowser.scss +906 -0
  33. package/scss/components/_form-layout.scss +332 -0
  34. package/scss/components/_input.scss +310 -0
  35. package/scss/components/_list.scss +130 -0
  36. package/scss/components/_media.scss +239 -0
  37. package/scss/components/_modal.scss +298 -0
  38. package/scss/components/_navbar.scss +312 -0
  39. package/scss/components/_notification.scss +59 -0
  40. package/scss/components/_pageheader.scss +99 -0
  41. package/scss/components/_pagination.scss +165 -0
  42. package/scss/components/_progress.scss +333 -0
  43. package/scss/components/_separator.scss +129 -0
  44. package/scss/components/_sheet.scss +286 -0
  45. package/scss/components/_sidebar.scss +324 -0
  46. package/scss/components/_skeleton.scss +246 -0
  47. package/scss/components/_stat.scss +218 -0
  48. package/scss/components/_table.scss +589 -0
  49. package/scss/components/_tabs.scss +266 -0
  50. package/scss/components/_timeline.scss +339 -0
  51. package/scss/components/_toast.scss +259 -0
  52. package/scss/components/_toolbar.scss +301 -0
  53. package/scss/components/_tooltip.scss +250 -0
  54. package/scss/main.scss +6 -0
  55. package/src/js/behaviours/accordion.js +58 -0
  56. package/src/js/behaviours/action-bar-list.js +406 -0
  57. package/src/js/behaviours/action-bar.js +29 -0
  58. package/src/js/behaviours/chart.js +339 -0
  59. package/src/js/behaviours/collapsible.js +34 -0
  60. package/src/js/behaviours/editable-table.js +91 -0
  61. package/src/js/behaviours/expandable.js +80 -0
  62. package/src/js/behaviours/overflow-actions.js +137 -0
  63. package/src/js/behaviours/publish-schedule.js +91 -0
  64. package/src/js/behaviours/search-clear.js +19 -0
  65. package/src/js/behaviours/segmented-control.js +43 -0
  66. package/src/js/behaviours/submenu.js +73 -0
  67. package/src/js/behaviours/table-columns.js +77 -0
  68. package/src/js/behaviours/table-paste.js +305 -0
  69. package/src/js/behaviours/table-reorder.js +252 -0
  70. package/src/js/behaviours/table-sort.js +101 -0
  71. package/src/js/behaviours/tabs.js +148 -0
  72. package/src/js/behaviours/toast-manager.js +106 -0
  73. package/src/js/behaviours/toggle.js +186 -0
  74. package/src/js/behaviours/unsaved-guard.js +88 -0
  75. package/src/js/core-loader.js +26 -0
  76. package/src/js/index.js +85 -0
  77. package/src/js/polyfills/dialog-commands.js +20 -0
  78. package/src/js/util/dom.js +39 -0
@@ -0,0 +1,183 @@
1
+ // ==========================================================================
2
+ // Alert Component
3
+ // ==========================================================================
4
+
5
+ @use "../variables" as *;
6
+ @use "../mixins" as *;
7
+
8
+ // --------------------------------------------------------------------------
9
+ // Base Alert
10
+ // --------------------------------------------------------------------------
11
+
12
+ .alert {
13
+ position: relative;
14
+ display: flex;
15
+ gap: $spacing-xs;
16
+ padding: $spacing-sm;
17
+ border-radius: $radius;
18
+ border: 1px solid var(--border);
19
+ background-color: var(--bg);
20
+ color: var(--fg);
21
+
22
+ // --------------------------------------------------------------------------
23
+ // Variants
24
+ // --------------------------------------------------------------------------
25
+
26
+ // Info
27
+ &--info {
28
+ background-color: var(--info-muted);
29
+ border-color: var(--info);
30
+ color: var(--info-muted-fg);
31
+
32
+ .alert__icon {
33
+ color: var(--info);
34
+ }
35
+ }
36
+
37
+ // Success
38
+ &--success {
39
+ background-color: var(--success-muted);
40
+ border-color: var(--success);
41
+ color: var(--success-muted-fg);
42
+
43
+ .alert__icon {
44
+ color: var(--success);
45
+ }
46
+ }
47
+
48
+ // Warning
49
+ &--warning {
50
+ background-color: var(--warning-muted);
51
+ border-color: var(--warning);
52
+ color: var(--warning-muted-fg);
53
+
54
+ .alert__icon {
55
+ color: var(--warning);
56
+ }
57
+ }
58
+
59
+ // Error / Destructive
60
+ &--error,
61
+ &--destructive {
62
+ background-color: var(--destructive-muted);
63
+ border-color: var(--destructive);
64
+ color: var(--destructive-muted-fg);
65
+
66
+ .alert__icon {
67
+ color: var(--destructive);
68
+ }
69
+ }
70
+
71
+ // --------------------------------------------------------------------------
72
+ // Elements
73
+ // --------------------------------------------------------------------------
74
+
75
+ &__icon {
76
+ flex-shrink: 0;
77
+ width: $icon-size-md;
78
+ height: $icon-size-md;
79
+ margin-top: 0.125rem;
80
+ }
81
+
82
+ &__content {
83
+ flex: 1;
84
+ display: flex;
85
+ flex-direction: column;
86
+ gap: $spacing-3xs;
87
+ }
88
+
89
+ &__title {
90
+ font-size: $font-size-sm;
91
+ font-weight: $font-weight-semibold;
92
+ line-height: $line-height-tight;
93
+ }
94
+
95
+ &__description {
96
+ font-size: $font-size-sm;
97
+ line-height: $line-height-normal;
98
+ }
99
+
100
+ &__close {
101
+ position: absolute;
102
+ top: $spacing-xs;
103
+ right: $spacing-xs;
104
+ display: inline-flex;
105
+ align-items: center;
106
+ justify-content: center;
107
+ width: 1.5rem;
108
+ height: 1.5rem;
109
+ border-radius: $radius-sm;
110
+ color: var(--fg-muted);
111
+ cursor: pointer;
112
+ @include transition-colors;
113
+
114
+ &:hover {
115
+ color: var(--fg);
116
+ background-color: var(--accent);
117
+ }
118
+
119
+ &:focus-visible {
120
+ @include focus-ring;
121
+ }
122
+
123
+ svg {
124
+ width: $icon-size-sm;
125
+ height: $icon-size-sm;
126
+ }
127
+ }
128
+
129
+ // Add padding for close button
130
+ &--closable {
131
+ padding-right: $spacing-2xl;
132
+ }
133
+
134
+ // --------------------------------------------------------------------------
135
+ // Layout Variants
136
+ // --------------------------------------------------------------------------
137
+
138
+ // Centered content
139
+ &--centered {
140
+ text-align: center;
141
+ flex-direction: column;
142
+ align-items: center;
143
+
144
+ .alert__icon {
145
+ margin-top: 0;
146
+ }
147
+ }
148
+
149
+ // Compact (inline style)
150
+ &--compact {
151
+ padding: $spacing-2xs $spacing-xs;
152
+ gap: $spacing-2xs;
153
+
154
+ .alert__icon {
155
+ width: $icon-size-sm;
156
+ height: $icon-size-sm;
157
+ margin-top: 0.0625rem;
158
+ }
159
+
160
+ .alert__title {
161
+ font-size: $font-size-xs;
162
+ }
163
+
164
+ .alert__description {
165
+ font-size: $font-size-xs;
166
+ }
167
+ }
168
+ }
169
+
170
+ // --------------------------------------------------------------------------
171
+ // Alert Banner (full-width, no radius)
172
+ // --------------------------------------------------------------------------
173
+
174
+ .alert-banner {
175
+ @extend .alert;
176
+ border-radius: 0;
177
+ border-left: none;
178
+ border-right: none;
179
+
180
+ &:first-child {
181
+ border-top: none;
182
+ }
183
+ }
@@ -0,0 +1,98 @@
1
+ // ==========================================================================
2
+ // Auth Component
3
+ // ==========================================================================
4
+ //
5
+ // A centred page for signing in, resetting a password and other screens
6
+ // shown before the dashboard shell: a card with a logo, title and
7
+ // description over the form, and a footer for the way back.
8
+
9
+ @use "../variables" as *;
10
+
11
+ .auth {
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: center;
15
+ min-height: 100vh;
16
+ padding: $spacing-sm;
17
+
18
+ &__container {
19
+ width: 100%;
20
+ max-width: 24rem;
21
+
22
+ &--wide {
23
+ max-width: 42rem;
24
+ }
25
+ }
26
+
27
+ &__header {
28
+ text-align: center;
29
+ margin-bottom: $spacing-lg;
30
+ }
31
+
32
+ &__logo {
33
+ display: inline-flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ width: 3rem;
37
+ height: 3rem;
38
+ margin-bottom: $spacing-sm;
39
+ color: var(--primary);
40
+ }
41
+
42
+ &__title {
43
+ font-size: $font-size-2xl;
44
+ font-weight: $font-weight-semibold;
45
+ letter-spacing: $letter-spacing-tight;
46
+ color: var(--fg);
47
+ }
48
+
49
+ &__description {
50
+ font-size: $font-size-sm;
51
+ color: var(--fg-muted);
52
+ margin-top: $spacing-3xs;
53
+ }
54
+
55
+ &__footer {
56
+ text-align: center;
57
+ margin-top: $spacing-lg;
58
+ padding-top: $spacing-lg;
59
+ border-top: 1px solid var(--border);
60
+ font-size: $font-size-sm;
61
+ color: var(--fg-muted);
62
+ }
63
+
64
+ &__back {
65
+ display: inline-flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ gap: $spacing-2xs;
69
+ font-size: $font-size-sm;
70
+ color: var(--fg-muted);
71
+ text-decoration: none;
72
+
73
+ &:hover {
74
+ color: var(--fg);
75
+ }
76
+ }
77
+
78
+ &__icon {
79
+ display: inline-flex;
80
+ align-items: center;
81
+ justify-content: center;
82
+ width: 4rem;
83
+ height: 4rem;
84
+ border-radius: $radius-full;
85
+ background-color: var(--bg-muted);
86
+ color: var(--fg-muted);
87
+
88
+ &--success {
89
+ background-color: var(--success-muted);
90
+ color: var(--success);
91
+ }
92
+
93
+ &--error {
94
+ background-color: var(--destructive-muted);
95
+ color: var(--destructive);
96
+ }
97
+ }
98
+ }
@@ -0,0 +1,203 @@
1
+ // ==========================================================================
2
+ // Avatar Component
3
+ // ==========================================================================
4
+
5
+ @use "../variables" as *;
6
+ @use "../mixins" as *;
7
+
8
+ // --------------------------------------------------------------------------
9
+ // Base Avatar
10
+ // --------------------------------------------------------------------------
11
+
12
+ .avatar {
13
+ position: relative;
14
+ display: inline-flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ width: 2.5rem;
18
+ height: 2.5rem;
19
+ border-radius: $radius-full;
20
+ background-color: var(--bg-muted);
21
+ flex-shrink: 0;
22
+
23
+ // Clipping lives on the children so the status dot can sit over the edge
24
+ &__image {
25
+ width: 100%;
26
+ height: 100%;
27
+ border-radius: inherit;
28
+ object-fit: cover;
29
+ }
30
+
31
+ &__fallback {
32
+ width: 100%;
33
+ height: 100%;
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: center;
37
+ border-radius: inherit;
38
+ overflow: hidden;
39
+ // Initials sit on the brand colour unless a theme sets --avatar-bg and --avatar-fg
40
+ background-color: var(--avatar-bg, var(--primary));
41
+ color: var(--avatar-fg, var(--primary-fg));
42
+ font-weight: $font-weight-medium;
43
+ text-transform: uppercase;
44
+ }
45
+
46
+ // --------------------------------------------------------------------------
47
+ // Sizes
48
+ // --------------------------------------------------------------------------
49
+
50
+ &--xs {
51
+ width: 1.5rem;
52
+ height: 1.5rem;
53
+ font-size: $font-size-xs;
54
+ }
55
+
56
+ &--sm {
57
+ width: 2rem;
58
+ height: 2rem;
59
+ font-size: $font-size-xs;
60
+ }
61
+
62
+ &--md {
63
+ width: 2.5rem;
64
+ height: 2.5rem;
65
+ font-size: $font-size-sm;
66
+ }
67
+
68
+ &--lg {
69
+ width: 3rem;
70
+ height: 3rem;
71
+ font-size: $font-size-base;
72
+ }
73
+
74
+ &--xl {
75
+ width: 4rem;
76
+ height: 4rem;
77
+ font-size: $font-size-lg;
78
+ }
79
+
80
+ &--2xl {
81
+ width: 5rem;
82
+ height: 5rem;
83
+ font-size: $font-size-xl;
84
+ }
85
+
86
+ // --------------------------------------------------------------------------
87
+ // Shapes
88
+ // --------------------------------------------------------------------------
89
+
90
+ &--square {
91
+ border-radius: $radius;
92
+ }
93
+
94
+ // --------------------------------------------------------------------------
95
+ // Status Indicator
96
+ // --------------------------------------------------------------------------
97
+
98
+ &__status {
99
+ position: absolute;
100
+ z-index: 1;
101
+ bottom: 0;
102
+ right: 0;
103
+ width: 0.75rem;
104
+ height: 0.75rem;
105
+ border: 2px solid var(--bg);
106
+ border-radius: $radius-full;
107
+ background-color: var(--fg-muted);
108
+
109
+ &--online {
110
+ background-color: var(--success);
111
+ }
112
+
113
+ &--offline {
114
+ background-color: var(--fg-subtle);
115
+ }
116
+
117
+ &--busy {
118
+ background-color: var(--destructive);
119
+ }
120
+
121
+ &--away {
122
+ background-color: var(--warning);
123
+ }
124
+ }
125
+
126
+ &--xs &__status,
127
+ &--sm &__status {
128
+ width: 0.5rem;
129
+ height: 0.5rem;
130
+ border-width: 1px;
131
+ }
132
+
133
+ &--md &__status {
134
+ width: 0.75rem;
135
+ height: 0.75rem;
136
+ }
137
+
138
+ &--lg &__status,
139
+ &--xl &__status,
140
+ &--2xl &__status {
141
+ width: 1rem;
142
+ height: 1rem;
143
+ }
144
+ }
145
+
146
+ // --------------------------------------------------------------------------
147
+ // Avatar Group
148
+ // --------------------------------------------------------------------------
149
+
150
+ // Laid out left to right in reading order; each avatar overlaps the one before it
151
+ .avatar__group {
152
+ display: inline-flex;
153
+ align-items: center;
154
+
155
+ > .avatar,
156
+ > .avatar__group-overflow {
157
+ border: 2px solid var(--bg);
158
+ margin-left: -0.75rem;
159
+
160
+ &:first-child {
161
+ margin-left: 0;
162
+ }
163
+ }
164
+
165
+ &--sm {
166
+ > .avatar,
167
+ > .avatar__group-overflow {
168
+ margin-left: -0.5rem;
169
+ }
170
+
171
+ > .avatar__group-overflow {
172
+ width: 2rem;
173
+ height: 2rem;
174
+ }
175
+ }
176
+
177
+ &--lg {
178
+ > .avatar,
179
+ > .avatar__group-overflow {
180
+ margin-left: -1rem;
181
+ }
182
+
183
+ > .avatar__group-overflow {
184
+ width: 3rem;
185
+ height: 3rem;
186
+ font-size: $font-size-sm;
187
+ }
188
+ }
189
+ }
190
+
191
+ .avatar__group-overflow {
192
+ display: inline-flex;
193
+ align-items: center;
194
+ justify-content: center;
195
+ flex-shrink: 0;
196
+ width: 2.5rem;
197
+ height: 2.5rem;
198
+ border-radius: $radius-full;
199
+ background-color: var(--bg-muted);
200
+ color: var(--fg-muted);
201
+ font-size: $font-size-xs;
202
+ font-weight: $font-weight-medium;
203
+ }
@@ -0,0 +1,176 @@
1
+ // ==========================================================================
2
+ // Badge Component
3
+ // ==========================================================================
4
+
5
+ @use "../variables" as *;
6
+ @use "../mixins" as *;
7
+
8
+ // --------------------------------------------------------------------------
9
+ // Base Badge
10
+ // --------------------------------------------------------------------------
11
+
12
+ .badge {
13
+ display: inline-flex;
14
+ align-items: center;
15
+ gap: $spacing-3xs;
16
+ padding: 0.125rem $spacing-2xs;
17
+ font-size: $font-size-xs;
18
+ font-weight: $font-weight-medium;
19
+ line-height: $line-height-tight;
20
+ // Don't inherit a heading's tight tracking when a badge sits in a title
21
+ letter-spacing: normal;
22
+ border-radius: $radius-md;
23
+ white-space: nowrap;
24
+ @include transition-colors;
25
+
26
+ // --------------------------------------------------------------------------
27
+ // Variants
28
+ // --------------------------------------------------------------------------
29
+
30
+ // Primary (default): the bare block carries primary styling so size and
31
+ // shape modifiers keep it; colour variants below override it by source order
32
+ &,
33
+ &--primary {
34
+ background-color: var(--primary);
35
+ color: var(--primary-fg);
36
+ }
37
+
38
+ // Secondary
39
+ &--secondary {
40
+ background-color: var(--secondary);
41
+ color: var(--secondary-fg);
42
+ }
43
+
44
+ // Outline
45
+ &--outline {
46
+ background-color: transparent;
47
+ border: 1px solid var(--border);
48
+ color: var(--fg);
49
+ }
50
+
51
+ // Destructive
52
+ &--destructive {
53
+ background-color: var(--destructive);
54
+ color: var(--destructive-fg);
55
+ }
56
+
57
+ // Destructive muted
58
+ &--destructive-muted {
59
+ background-color: var(--destructive-muted);
60
+ color: var(--destructive-muted-fg);
61
+ }
62
+
63
+ // Success
64
+ &--success {
65
+ background-color: var(--success);
66
+ color: var(--success-fg);
67
+ }
68
+
69
+ // Success muted
70
+ &--success-muted {
71
+ background-color: var(--success-muted);
72
+ color: var(--success-muted-fg);
73
+ }
74
+
75
+ // Warning
76
+ &--warning {
77
+ background-color: var(--warning);
78
+ color: var(--warning-fg);
79
+ }
80
+
81
+ // Warning muted
82
+ &--warning-muted {
83
+ background-color: var(--warning-muted);
84
+ color: var(--warning-muted-fg);
85
+ }
86
+
87
+ // Info
88
+ &--info {
89
+ background-color: var(--info);
90
+ color: var(--info-fg);
91
+ }
92
+
93
+ // Info muted
94
+ &--info-muted {
95
+ background-color: var(--info-muted);
96
+ color: var(--info-muted-fg);
97
+ }
98
+
99
+ // --------------------------------------------------------------------------
100
+ // Sizes
101
+ // --------------------------------------------------------------------------
102
+
103
+ &--sm {
104
+ padding: 0 $spacing-3xs;
105
+ font-size: 0.625rem;
106
+ }
107
+
108
+ &--lg {
109
+ padding: $spacing-3xs $spacing-xs;
110
+ font-size: $font-size-sm;
111
+ }
112
+
113
+ // --------------------------------------------------------------------------
114
+ // Shapes
115
+ // --------------------------------------------------------------------------
116
+
117
+ &--pill {
118
+ border-radius: $radius-full;
119
+ }
120
+
121
+ // Dot indicator (no text, just a colored dot)
122
+ &--dot {
123
+ width: 0.5rem;
124
+ height: 0.5rem;
125
+ padding: 0;
126
+ border-radius: $radius-full;
127
+ }
128
+
129
+ // --------------------------------------------------------------------------
130
+ // Elements
131
+ // --------------------------------------------------------------------------
132
+
133
+ &__icon {
134
+ width: $icon-size-sm;
135
+ height: $icon-size-sm;
136
+ flex-shrink: 0;
137
+
138
+ &--only {
139
+ margin: 0 calc($spacing-3xs * -1);
140
+ }
141
+ }
142
+
143
+ // Removable badge
144
+ &__remove {
145
+ display: inline-flex;
146
+ align-items: center;
147
+ justify-content: center;
148
+ width: 1rem;
149
+ height: 1rem;
150
+ margin-left: $spacing-3xs;
151
+ margin-right: calc($spacing-3xs * -1);
152
+ border-radius: $radius-sm;
153
+ cursor: pointer;
154
+ opacity: 0.7;
155
+ @include transition-opacity;
156
+
157
+ &:hover {
158
+ opacity: 1;
159
+ }
160
+
161
+ svg {
162
+ width: 0.75rem;
163
+ height: 0.75rem;
164
+ }
165
+ }
166
+ }
167
+
168
+ // --------------------------------------------------------------------------
169
+ // Badge Group
170
+ // --------------------------------------------------------------------------
171
+
172
+ .badge__group {
173
+ display: flex;
174
+ flex-wrap: wrap;
175
+ gap: $spacing-3xs;
176
+ }