@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,396 @@
1
+ // ==========================================================================
2
+ // Mixins & Utilities
3
+ // ==========================================================================
4
+
5
+ @use "variables" as *;
6
+
7
+ // --------------------------------------------------------------------------
8
+ // Focus Ring (shadcn style)
9
+ // --------------------------------------------------------------------------
10
+
11
+ // Every focus ring shares one rule, so the declarations are written once however many
12
+ // components use it
13
+ %focus-ring {
14
+ outline: var(--framework-focus-width) solid var(--framework-focus-color);
15
+ outline-offset: var(--framework-focus-offset);
16
+ }
17
+
18
+ @mixin focus-ring {
19
+ @extend %focus-ring;
20
+ }
21
+
22
+ @mixin focus-visible-ring {
23
+ &:focus-visible {
24
+ @include focus-ring;
25
+ }
26
+ }
27
+
28
+ // --------------------------------------------------------------------------
29
+ // Transitions
30
+ // --------------------------------------------------------------------------
31
+
32
+ // Each transition is one shorthand built on the --transition-* tokens in _variables.scss, which
33
+ // take their timing from core's --framework-transition-duration and -easing
34
+
35
+ @mixin transition-default {
36
+ transition: var(--transition-default);
37
+ }
38
+
39
+ @mixin transition-colors {
40
+ transition: var(--transition-colors);
41
+ }
42
+
43
+ @mixin transition-transform {
44
+ transition: var(--transition-transform);
45
+ }
46
+
47
+ @mixin transition-opacity {
48
+ transition: var(--transition-opacity);
49
+ }
50
+
51
+ // --------------------------------------------------------------------------
52
+ // Typography
53
+ // --------------------------------------------------------------------------
54
+
55
+ @mixin text-body {
56
+ font-size: $font-size-base;
57
+ line-height: $line-height-normal;
58
+ }
59
+
60
+ @mixin text-small {
61
+ font-size: $font-size-sm;
62
+ line-height: $line-height-normal;
63
+ }
64
+
65
+ @mixin text-muted {
66
+ color: var(--fg-muted);
67
+ }
68
+
69
+ @mixin text-truncate {
70
+ overflow: hidden;
71
+ text-overflow: ellipsis;
72
+ white-space: nowrap;
73
+ }
74
+
75
+ @mixin text-clamp($lines: 2) {
76
+ display: -webkit-box;
77
+ -webkit-line-clamp: $lines;
78
+ -webkit-box-orient: vertical;
79
+ overflow: hidden;
80
+ }
81
+
82
+ // --------------------------------------------------------------------------
83
+ // Layout
84
+ // --------------------------------------------------------------------------
85
+
86
+ @mixin flex-center {
87
+ display: flex;
88
+ align-items: center;
89
+ justify-content: center;
90
+ }
91
+
92
+ @mixin flex-between {
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: space-between;
96
+ }
97
+
98
+ @mixin flex-start {
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: flex-start;
102
+ }
103
+
104
+ @mixin absolute-center {
105
+ position: absolute;
106
+ top: 50%;
107
+ left: 50%;
108
+ transform: translate(-50%, -50%);
109
+ }
110
+
111
+ @mixin absolute-fill {
112
+ position: absolute;
113
+ top: 0;
114
+ right: 0;
115
+ bottom: 0;
116
+ left: 0;
117
+ }
118
+
119
+ // --------------------------------------------------------------------------
120
+ // Interactive States
121
+ // --------------------------------------------------------------------------
122
+
123
+ @mixin interactive {
124
+ cursor: pointer;
125
+ user-select: none;
126
+ @include transition-default;
127
+ @include focus-visible-ring;
128
+ }
129
+
130
+ @mixin disabled {
131
+ pointer-events: none;
132
+ opacity: 0.5;
133
+ }
134
+
135
+ // --------------------------------------------------------------------------
136
+ // Borders
137
+ // --------------------------------------------------------------------------
138
+
139
+ @mixin border {
140
+ border: 1px solid var(--border);
141
+ }
142
+
143
+ @mixin border-top {
144
+ border-top: 1px solid var(--border);
145
+ }
146
+
147
+ @mixin border-bottom {
148
+ border-bottom: 1px solid var(--border);
149
+ }
150
+
151
+ @mixin border-left {
152
+ border-left: 1px solid var(--border);
153
+ }
154
+
155
+ @mixin border-right {
156
+ border-right: 1px solid var(--border);
157
+ }
158
+
159
+ // --------------------------------------------------------------------------
160
+ // Scrollbar Styling
161
+ // --------------------------------------------------------------------------
162
+
163
+ // Every thin scrollbar shares one set of rules, so the five rules are written once however many
164
+ // components use it
165
+ %scrollbar-thin {
166
+ scrollbar-width: thin;
167
+ scrollbar-color: var(--fg-subtle) transparent;
168
+
169
+ &::-webkit-scrollbar {
170
+ width: 8px;
171
+ height: 8px;
172
+ }
173
+
174
+ &::-webkit-scrollbar-track {
175
+ background: transparent;
176
+ }
177
+
178
+ &::-webkit-scrollbar-thumb {
179
+ background-color: var(--fg-subtle);
180
+ border-radius: $radius-full;
181
+ border: 2px solid transparent;
182
+ background-clip: content-box;
183
+ }
184
+
185
+ &::-webkit-scrollbar-thumb:hover {
186
+ background-color: var(--fg-muted);
187
+ }
188
+ }
189
+
190
+ // --------------------------------------------------------------------------
191
+ // Chrome Regions
192
+ // --------------------------------------------------------------------------
193
+
194
+ /// Points the general tokens at a chrome region's own ($chrome-tokens), so everything inside the
195
+ /// region follows them; popovers that open inside it (picked out by their roles) go back to the
196
+ /// page's values.
197
+ @mixin chrome-region($region) {
198
+ @each $name in $chrome-remapped {
199
+ --#{$name}: var(--#{$region}-#{$name});
200
+ }
201
+ color: var(--fg);
202
+ background-color: var(--bg);
203
+
204
+ :where([popover], [role="menu"], [role="dialog"], [role="tooltip"], .navmenu__tooltip) {
205
+ @each $name in $chrome-remapped {
206
+ --#{$name}: var(--page-#{$name});
207
+ }
208
+ }
209
+ }
210
+
211
+ /// A region's head (logo cell, title bar), coloured by the region's head-* tokens.
212
+ @mixin chrome-head($region) {
213
+ @each $name in (bg, fg, fg-muted, accent, accent-fg, border) {
214
+ --#{$name}: var(--#{$region}-head-#{$name});
215
+ }
216
+ color: var(--fg);
217
+ background-color: var(--bg);
218
+ }
219
+
220
+ @mixin scrollbar-thin {
221
+ @extend %scrollbar-thin;
222
+ }
223
+
224
+ @mixin scrollbar-hidden {
225
+ scrollbar-width: none;
226
+ -ms-overflow-style: none;
227
+
228
+ &::-webkit-scrollbar {
229
+ display: none;
230
+ }
231
+ }
232
+
233
+ // --------------------------------------------------------------------------
234
+ // Responsive Breakpoints
235
+ // --------------------------------------------------------------------------
236
+
237
+ @mixin sm {
238
+ @media (min-width: $breakpoint-sm) {
239
+ @content;
240
+ }
241
+ }
242
+
243
+ @mixin md {
244
+ @media (min-width: $breakpoint-md) {
245
+ @content;
246
+ }
247
+ }
248
+
249
+ @mixin lg {
250
+ @media (min-width: $breakpoint-lg) {
251
+ @content;
252
+ }
253
+ }
254
+
255
+ @mixin xl {
256
+ @media (min-width: $breakpoint-xl) {
257
+ @content;
258
+ }
259
+ }
260
+
261
+ @mixin xxl {
262
+ @media (min-width: $breakpoint-2xl) {
263
+ @content;
264
+ }
265
+ }
266
+
267
+ // Max-width variants (mobile-first exceptions)
268
+ @mixin max-sm {
269
+ @media (max-width: #{$breakpoint-sm - 1px}) {
270
+ @content;
271
+ }
272
+ }
273
+
274
+ @mixin max-md {
275
+ @media (max-width: #{$breakpoint-md - 1px}) {
276
+ @content;
277
+ }
278
+ }
279
+
280
+ @mixin max-lg {
281
+ @media (max-width: #{$breakpoint-lg - 1px}) {
282
+ @content;
283
+ }
284
+ }
285
+
286
+ // --------------------------------------------------------------------------
287
+ // Visibility
288
+ // --------------------------------------------------------------------------
289
+
290
+ @mixin sr-only {
291
+ position: absolute;
292
+ width: 1px;
293
+ height: 1px;
294
+ padding: 0;
295
+ margin: -1px;
296
+ overflow: hidden;
297
+ clip: rect(0, 0, 0, 0);
298
+ white-space: nowrap;
299
+ border: 0;
300
+ }
301
+
302
+ // --------------------------------------------------------------------------
303
+ // Animation Keyframes
304
+ // --------------------------------------------------------------------------
305
+
306
+ @mixin fade-in {
307
+ animation: fade-in $transition-base $transition-easing;
308
+ }
309
+
310
+ @mixin slide-in-from-top {
311
+ animation: slide-in-from-top $transition-base $transition-easing;
312
+ }
313
+
314
+ @mixin slide-in-from-bottom {
315
+ animation: slide-in-from-bottom $transition-base $transition-easing;
316
+ }
317
+
318
+ // Keyframe definitions
319
+ @keyframes fade-in {
320
+ from {
321
+ opacity: 0;
322
+ }
323
+ to {
324
+ opacity: 1;
325
+ }
326
+ }
327
+
328
+ @keyframes fade-out {
329
+ from {
330
+ opacity: 1;
331
+ }
332
+ to {
333
+ opacity: 0;
334
+ }
335
+ }
336
+
337
+ @keyframes slide-in-from-top {
338
+ from {
339
+ opacity: 0;
340
+ transform: translateY(-0.5rem);
341
+ }
342
+ to {
343
+ opacity: 1;
344
+ transform: translateY(0);
345
+ }
346
+ }
347
+
348
+ @keyframes slide-in-from-bottom {
349
+ from {
350
+ opacity: 0;
351
+ transform: translateY(0.5rem);
352
+ }
353
+ to {
354
+ opacity: 1;
355
+ transform: translateY(0);
356
+ }
357
+ }
358
+
359
+ @keyframes slide-in-from-left {
360
+ from {
361
+ opacity: 0;
362
+ transform: translateX(-0.5rem);
363
+ }
364
+ to {
365
+ opacity: 1;
366
+ transform: translateX(0);
367
+ }
368
+ }
369
+
370
+ @keyframes slide-in-from-right {
371
+ from {
372
+ opacity: 0;
373
+ transform: translateX(0.5rem);
374
+ }
375
+ to {
376
+ opacity: 1;
377
+ transform: translateX(0);
378
+ }
379
+ }
380
+
381
+ @keyframes scale-in {
382
+ from {
383
+ opacity: 0;
384
+ transform: scale(0.95);
385
+ }
386
+ to {
387
+ opacity: 1;
388
+ transform: scale(1);
389
+ }
390
+ }
391
+
392
+ @keyframes spin {
393
+ to {
394
+ transform: rotate(360deg);
395
+ }
396
+ }