@lablup/ui-common 0.1.0-alpha.7 → 0.1.0-alpha.8
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
CHANGED
|
@@ -74,7 +74,7 @@ import "@lablup/ui-common/styles/themes/orange-dark.css";
|
|
|
74
74
|
|
|
75
75
|
The package ships the theming mechanism and one default palette, the Lablup
|
|
76
76
|
brand orange. A product with its own visual identity defines its own
|
|
77
|
-
`[data-theme]` blocks over the same
|
|
77
|
+
`[data-theme]` blocks over the same 115 token names and ships them itself,
|
|
78
78
|
rather than the package accumulating everyone's palettes. The source product
|
|
79
79
|
does exactly that with its five families.
|
|
80
80
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.stat-card{gap:var(--token-paddingSM,.5rem);min-width:0;overflow:hidden}.stat-card__header{justify-content:space-between;align-items:center;gap:var(--token-paddingXS,.25rem);display:flex}.stat-card__label{font-size:var(--token-fontSizeSM,.75rem);color:var(--token-colorTextSecondary,#ffffff73);text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;text-overflow:ellipsis;font-weight:600;overflow:hidden}.stat-card__icon{border-radius:var(--token-borderRadiusSM,.25rem);background:var(--token-colorFillSecondary,#ffffff0a);width:28px;height:28px;color:var(--token-colorTextSecondary,#fff9);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.stat-card__body{flex-direction:column;gap:4px;display:flex}.stat-card__value-row{flex-wrap:wrap;align-items:baseline;gap:.3em;display:inline-flex}.stat-card__value-line{justify-content:space-between;align-items:center;gap:var(--token-paddingSM,.5rem);min-width:0;display:flex}.stat-card__sparkline{flex-shrink:0;align-items:center;display:inline-flex}.stat-card__value{font-size:var(--token-fontSizeHeading2,1.75rem);color:var(--token-colorText,#141414);font-variant-numeric:tabular-nums;font-weight:600;line-height:1.1}.stat-card__value-suffix{font-size:var(--token-fontSize,.875rem);color:var(--token-colorTextSecondary,#ffffff73);font-weight:400}.stat-card__trend{font-size:var(--token-fontSizeSM,.75rem);align-items:center;gap:4px;font-weight:500;display:inline-flex}.stat-card__trend--up{color:var(--token-colorSuccess,#52c41a)}.stat-card__trend--down{color:var(--token-colorError,#f5222d)}.stat-card__trend--flat{color:var(--token-colorTextSecondary,#ffffff73)}.stat-card__hint{font-size:var(--token-fontSizeSM,.75rem);color:var(--token-colorTextSecondary,#ffffff73);line-height:1.4}.stat-card.stat-card--prominent{padding:var(--token-paddingLG,1.5rem)}.stat-card--prominent{background:linear-gradient(135deg, var(--token-colorBgContainer,#fff) 0%, color-mix(in srgb, var(--token-colorPrimary,#8b5cf6) 4%, transparent) 100%)}.stat-card--prominent:hover{border-color:color-mix(in srgb, var(--token-colorPrimary,#8b5cf6) 30%, transparent)}.stat-card--prominent .stat-card__value{font-size:var(--token-fontSizeHeading1,2.25rem)}.stat-card--prominent .stat-card__icon{width:34px;height:34px}.stat-card.stat-card--compact{padding:var(--token-paddingSM,.5rem)}.stat-card--compact .stat-card__value{font-size:var(--token-fontSizeHeading3,1.5rem)}.stat-card--tone-success .stat-card__value{color:var(--token-colorSuccess,#52c41a)}.stat-card--tone-success .stat-card__icon{color:var(--token-colorSuccess,#52c41a);background:#52c41a1f}.stat-card--tone-warning .stat-card__value{color:var(--token-colorWarning,#faad14)}.stat-card--tone-warning .stat-card__icon{color:var(--token-colorWarning,#faad14);background:#faad1424}.stat-card--tone-danger .stat-card__value{color:var(--token-colorError,#f5222d)}.stat-card--tone-danger .stat-card__icon{color:var(--token-colorError,#f5222d);background:#f5222d1f}.stat-card--tone-info .stat-card__value{color:var(--token-colorPrimary,#8b5cf6)}.stat-card--tone-info .stat-card__icon{color:var(--token-colorPrimary,#8b5cf6);background:#6a35fc1f}.stat-card--tone-success{--corner-accent-color:var(--token-colorSuccess,#52c41a)}.stat-card--tone-warning{--corner-accent-color:var(--token-colorWarning,#faad14)}.stat-card--tone-danger{--corner-accent-color:var(--token-colorError,#f5222d)}.stat-card--tone-info{--corner-accent-color:var(--token-colorPrimary,#8b5cf6)}@media (prefers-reduced-motion:reduce){.stat-card__trend{transition:none}}
|
|
1
|
+
.stat-card{gap:var(--token-paddingSM,.5rem);min-width:0;overflow:hidden}.stat-card__header{justify-content:space-between;align-items:center;gap:var(--token-paddingXS,.25rem);display:flex}.stat-card__label{font-size:var(--token-fontSizeSM,.75rem);color:var(--token-colorTextSecondary,#ffffff73);text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;text-overflow:ellipsis;font-weight:600;overflow:hidden}.stat-card__icon{border-radius:var(--token-borderRadiusSM,.25rem);background:var(--token-colorFillSecondary,#ffffff0a);width:28px;height:28px;color:var(--token-colorTextSecondary,#fff9);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.stat-card__body{flex-direction:column;gap:4px;display:flex}.stat-card__value-row{flex-wrap:wrap;align-items:baseline;gap:.3em;display:inline-flex}.stat-card__value-line{justify-content:space-between;align-items:center;gap:var(--token-paddingSM,.5rem);min-width:0;display:flex}.stat-card__sparkline{flex-shrink:0;align-items:center;display:inline-flex}.stat-card__value{font-size:var(--token-fontSizeHeading2,1.75rem);color:var(--token-colorText,#141414);font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;min-width:0;font-weight:600;line-height:1.1;overflow:hidden}.stat-card__value-suffix{font-size:var(--token-fontSize,.875rem);color:var(--token-colorTextSecondary,#ffffff73);font-weight:400}.stat-card__trend{font-size:var(--token-fontSizeSM,.75rem);align-items:center;gap:4px;font-weight:500;display:inline-flex}.stat-card__trend--up{color:var(--token-colorSuccess,#52c41a)}.stat-card__trend--down{color:var(--token-colorError,#f5222d)}.stat-card__trend--flat{color:var(--token-colorTextSecondary,#ffffff73)}.stat-card__hint{font-size:var(--token-fontSizeSM,.75rem);color:var(--token-colorTextSecondary,#ffffff73);line-height:1.4}.stat-card.stat-card--prominent{padding:var(--token-paddingLG,1.5rem)}.stat-card--prominent{background:linear-gradient(135deg, var(--token-colorBgContainer,#fff) 0%, color-mix(in srgb, var(--token-colorPrimary,#8b5cf6) 4%, transparent) 100%)}.stat-card--prominent:hover{border-color:color-mix(in srgb, var(--token-colorPrimary,#8b5cf6) 30%, transparent)}.stat-card--prominent .stat-card__value{font-size:var(--token-fontSizeHeading1,2.25rem)}.stat-card--prominent .stat-card__icon{width:34px;height:34px}.stat-card.stat-card--compact{padding:var(--token-paddingSM,.5rem)}.stat-card--compact .stat-card__value{font-size:var(--token-fontSizeHeading3,1.5rem)}.stat-card--tone-success .stat-card__value{color:var(--token-colorSuccess,#52c41a)}.stat-card--tone-success .stat-card__icon{color:var(--token-colorSuccess,#52c41a);background:#52c41a1f}.stat-card--tone-warning .stat-card__value{color:var(--token-colorWarning,#faad14)}.stat-card--tone-warning .stat-card__icon{color:var(--token-colorWarning,#faad14);background:#faad1424}.stat-card--tone-danger .stat-card__value{color:var(--token-colorError,#f5222d)}.stat-card--tone-danger .stat-card__icon{color:var(--token-colorError,#f5222d);background:#f5222d1f}.stat-card--tone-info .stat-card__value{color:var(--token-colorPrimary,#8b5cf6)}.stat-card--tone-info .stat-card__icon{color:var(--token-colorPrimary,#8b5cf6);background:#6a35fc1f}.stat-card--tone-success{--corner-accent-color:var(--token-colorSuccess,#52c41a)}.stat-card--tone-warning{--corner-accent-color:var(--token-colorWarning,#faad14)}.stat-card--tone-danger{--corner-accent-color:var(--token-colorError,#f5222d)}.stat-card--tone-info{--corner-accent-color:var(--token-colorPrimary,#8b5cf6)}@media (prefers-reduced-motion:reduce){.stat-card__trend{transition:none}}
|
package/dist/styles/base.css
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @lablup/ui-common design tokens
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
4
|
+
* The 115 `--token-*` custom properties every component in this package
|
|
5
5
|
* reads. This file is the token contract: renaming or removing an entry is
|
|
6
6
|
* a breaking change, exactly like renaming a prop (see CONTRIBUTING.md).
|
|
7
7
|
*
|
|
8
|
+
* It also carries one block of element rules, at the end: the scrollbar. A
|
|
9
|
+
* scrollbar is painted by the browser on a box this package does not own, so
|
|
10
|
+
* there is no component to hang the rules on and a consumer that wants a
|
|
11
|
+
* themed bar has nowhere to put one that every scrollable surface inherits.
|
|
12
|
+
* The rest of the file is custom properties only.
|
|
13
|
+
*
|
|
8
14
|
* Colour and button values are the Lablup brand default, theme family
|
|
9
15
|
* "orange", colour scheme "light", which is also the one theme this package
|
|
10
16
|
* ships as a stylesheet (`styles/themes/orange-light.css` and its dark
|
|
@@ -16,7 +22,7 @@
|
|
|
16
22
|
* call site.
|
|
17
23
|
*
|
|
18
24
|
* A product with its own visual identity defines its own `[data-theme]`
|
|
19
|
-
* blocks over these
|
|
25
|
+
* blocks over these 115 names and ships them itself, the way the source
|
|
20
26
|
* product does with its five families. This package carries the mechanism and
|
|
21
27
|
* one default, not a catalogue of somebody else's palettes.
|
|
22
28
|
*
|
|
@@ -156,6 +162,13 @@
|
|
|
156
162
|
--token-paddingXL: 2rem;
|
|
157
163
|
--token-paddingXS: 0.25rem;
|
|
158
164
|
--token-paddingXXS: 0.125rem;
|
|
165
|
+
/* One size for every theme. A theme family may restyle the track and the
|
|
166
|
+
thumb, but must not restate the size: `[data-theme="..."]
|
|
167
|
+
::-webkit-scrollbar` outranks the global rule on specificity, so a wider
|
|
168
|
+
bar declared there cannot be corrected from here, and a sidebar rail is
|
|
169
|
+
the surface that pays for it. `scrollbar.test.ts` keeps it that way. */
|
|
170
|
+
--token-scrollbarSize: 0.5rem; /* 8px */
|
|
171
|
+
--token-scrollbarRadius: 0.25rem; /* 4px */
|
|
159
172
|
--token-motionDurationFast: 0.1s;
|
|
160
173
|
--token-motionDurationMid: 0.2s;
|
|
161
174
|
--token-motionDurationSlow: 0.3s;
|
|
@@ -187,3 +200,37 @@
|
|
|
187
200
|
--token-buttonSecondaryShadowHover:
|
|
188
201
|
0 2px 6px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
|
|
189
202
|
}
|
|
203
|
+
|
|
204
|
+
/* ============================================
|
|
205
|
+
Scrollbar
|
|
206
|
+
|
|
207
|
+
The only element rules in this file. Both halves are needed because the two
|
|
208
|
+
engines expose different surfaces, and neither one alone themes a bar.
|
|
209
|
+
============================================ */
|
|
210
|
+
|
|
211
|
+
/* Firefox has no ::-webkit pseudo-elements. Both properties are inherited, so
|
|
212
|
+
declaring them once on the root themes every scrollable descendant, and a
|
|
213
|
+
surface that hides its own bar (see `Tabs.css`) still overrides them
|
|
214
|
+
locally. */
|
|
215
|
+
:root {
|
|
216
|
+
scrollbar-width: thin;
|
|
217
|
+
scrollbar-color: var(--token-colorBorder, #d9d9d9) transparent;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
::-webkit-scrollbar {
|
|
221
|
+
width: var(--token-scrollbarSize, 0.5rem);
|
|
222
|
+
height: var(--token-scrollbarSize, 0.5rem);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
::-webkit-scrollbar-track {
|
|
226
|
+
background: transparent;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
::-webkit-scrollbar-thumb {
|
|
230
|
+
background-color: var(--token-colorBorder, #d9d9d9);
|
|
231
|
+
border-radius: var(--token-scrollbarRadius, 0.25rem);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
::-webkit-scrollbar-thumb:hover {
|
|
235
|
+
background-color: var(--token-colorTextTertiary, #737373);
|
|
236
|
+
}
|
package/package.json
CHANGED