@richardmcquiston01/dashboard-widgets-toolkit 0.2.0 → 0.4.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.
- package/README.md +90 -8
- package/dist/core.cjs +642 -69
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +61 -18
- package/dist/core.d.ts +61 -18
- package/dist/core.js +623 -70
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +642 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +623 -70
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +1516 -86
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +155 -14
- package/dist/react.d.ts +155 -14
- package/dist/react.js +1514 -88
- package/dist/react.js.map +1 -1
- package/dist/{scale-Bhjc5Eqt.d.cts → scale-dWDGE1zW.d.cts} +327 -118
- package/dist/{scale-Bhjc5Eqt.d.ts → scale-dWDGE1zW.d.ts} +327 -118
- package/dist/styles.css +154 -6
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* the page sets data-theme="light"; data-theme="dark" or a "dark" class on
|
|
8
8
|
* <html> forces it.
|
|
9
9
|
*
|
|
10
|
-
* Chart
|
|
11
|
-
* validated for
|
|
10
|
+
* Chart colors are the dataviz reference palette: eight categorical slots
|
|
11
|
+
* validated for color-vision deficiency, each stepped separately for the
|
|
12
12
|
* dark surface (not an automatic flip).
|
|
13
13
|
*/
|
|
14
14
|
|
|
@@ -132,6 +132,29 @@
|
|
|
132
132
|
grid-column: 1 / -1;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/* Twelve-column grid: used when any widget sets `width`. A widget spans
|
|
136
|
+
--dwt-width twelfths; narrower grids give widgets more room. */
|
|
137
|
+
:where(.dwt-grid--twelve) {
|
|
138
|
+
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
139
|
+
container-type: inline-size;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:where(.dwt-grid--twelve > .dwt-card) {
|
|
143
|
+
grid-column: span var(--dwt-width, 4);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@container (max-width: 900px) {
|
|
147
|
+
:where(.dwt-grid--twelve > .dwt-card) {
|
|
148
|
+
grid-column: span min(12, calc(var(--dwt-width, 4) * 2));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@container (max-width: 560px) {
|
|
153
|
+
:where(.dwt-grid--twelve > .dwt-card) {
|
|
154
|
+
grid-column: 1 / -1;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
135
158
|
@media (max-width: 640px) {
|
|
136
159
|
:where(.dwt-card--size-large) {
|
|
137
160
|
grid-column: auto;
|
|
@@ -230,10 +253,30 @@
|
|
|
230
253
|
}
|
|
231
254
|
|
|
232
255
|
:where(.dwt-icon-button) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
256
|
+
display: inline-flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
justify-content: center;
|
|
259
|
+
box-sizing: border-box;
|
|
260
|
+
width: 28px;
|
|
261
|
+
height: 28px;
|
|
262
|
+
padding: 0;
|
|
263
|
+
line-height: 1;
|
|
264
|
+
background: var(--dwt-surface, transparent);
|
|
265
|
+
border-color: var(--dwt-border);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
:where(.dwt-external-icon) {
|
|
269
|
+
margin-left: 0.25em;
|
|
270
|
+
vertical-align: -0.1em;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
:where(.dwt-visually-hidden) {
|
|
274
|
+
position: absolute;
|
|
275
|
+
width: 1px;
|
|
276
|
+
height: 1px;
|
|
277
|
+
overflow: hidden;
|
|
278
|
+
clip-path: inset(50%);
|
|
279
|
+
white-space: nowrap;
|
|
237
280
|
}
|
|
238
281
|
|
|
239
282
|
:where(
|
|
@@ -552,3 +595,108 @@
|
|
|
552
595
|
border: 1px solid CanvasText;
|
|
553
596
|
}
|
|
554
597
|
}
|
|
598
|
+
|
|
599
|
+
/* Detail view ------------------------------------------------------------- */
|
|
600
|
+
|
|
601
|
+
:where(.dwt-card-title-button) {
|
|
602
|
+
all: unset;
|
|
603
|
+
cursor: pointer;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
:where(.dwt-card-title-button:hover) {
|
|
607
|
+
text-decoration: underline;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
:where(.dwt-detail-dialog) {
|
|
611
|
+
/* CSS resets (Tailwind's preflight) zero margins, which un-centers a modal. */
|
|
612
|
+
margin: auto;
|
|
613
|
+
box-sizing: border-box;
|
|
614
|
+
width: min(960px, 100vw - 32px);
|
|
615
|
+
max-height: calc(100vh - 32px);
|
|
616
|
+
padding: 0;
|
|
617
|
+
overflow: auto;
|
|
618
|
+
color: var(--dwt-text);
|
|
619
|
+
background: var(--dwt-surface);
|
|
620
|
+
border: 1px solid var(--dwt-border);
|
|
621
|
+
border-radius: var(--dwt-radius, 8px);
|
|
622
|
+
font-family: var(--dwt-font);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
:where(.dwt-detail-dialog)::backdrop {
|
|
626
|
+
background: rgba(0, 0, 0, 0.5);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
:where(.dwt-detail-dialog-body) {
|
|
630
|
+
position: relative;
|
|
631
|
+
padding: 20px;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
:where(.dwt-detail-close) {
|
|
635
|
+
position: absolute;
|
|
636
|
+
top: 16px;
|
|
637
|
+
right: 16px;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
:where(.dwt-detail-title) {
|
|
641
|
+
margin: 0 72px 12px 0;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
:where(.dwt-detail-controls) {
|
|
645
|
+
display: flex;
|
|
646
|
+
flex-wrap: wrap;
|
|
647
|
+
gap: 12px;
|
|
648
|
+
margin-bottom: 8px;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
:where(.dwt-detail-field) {
|
|
652
|
+
display: flex;
|
|
653
|
+
flex-direction: column;
|
|
654
|
+
gap: 4px;
|
|
655
|
+
font-size: 0.8125rem;
|
|
656
|
+
color: var(--dwt-text-secondary);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
:where(.dwt-detail-field input) {
|
|
660
|
+
font: inherit;
|
|
661
|
+
color: var(--dwt-text);
|
|
662
|
+
background: var(--dwt-surface);
|
|
663
|
+
border: 1px solid var(--dwt-border);
|
|
664
|
+
border-radius: 6px;
|
|
665
|
+
padding: 4px 8px;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
:where(.dwt-detail-summary) {
|
|
669
|
+
margin: 8px 0;
|
|
670
|
+
font-size: 0.8125rem;
|
|
671
|
+
color: var(--dwt-text-secondary);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
:where(.dwt-detail-sort) {
|
|
675
|
+
all: unset;
|
|
676
|
+
cursor: pointer;
|
|
677
|
+
font-weight: inherit;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
:where(.dwt-detail-sort:focus-visible) {
|
|
681
|
+
outline: 2px solid var(--dwt-focus);
|
|
682
|
+
outline-offset: 2px;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
:where(.dwt-detail-pager) {
|
|
686
|
+
display: flex;
|
|
687
|
+
align-items: center;
|
|
688
|
+
justify-content: center;
|
|
689
|
+
gap: 12px;
|
|
690
|
+
margin-top: 12px;
|
|
691
|
+
font-size: 0.875rem;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
@media (max-width: 640px) {
|
|
695
|
+
:where(.dwt-detail-dialog) {
|
|
696
|
+
width: 100vw;
|
|
697
|
+
max-width: 100vw;
|
|
698
|
+
height: 100vh;
|
|
699
|
+
max-height: 100vh;
|
|
700
|
+
border-radius: 0;
|
|
701
|
+
}
|
|
702
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@richardmcquiston01/dashboard-widgets-toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Framework-agnostic dashboard widget toolkit: typed widget definitions and data payloads (KPI, gauge, table, bar list, alert list, chart), user layout (order, hide, minimise), and React renderers. Bring your own data providers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dashboard",
|