@lablup/ui-common 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +1 -1
- package/dist/assets/components/BaseCard/BaseCard.css +1 -1
- package/dist/assets/components/Button/Button.css +1 -1
- package/dist/assets/components/DataTable/DataTable.css +1 -1
- package/dist/assets/components/Drawer/Drawer.css +1 -1
- package/dist/assets/components/EmptyState/EmptyState.css +1 -1
- package/dist/assets/components/ErrorState/ErrorState.css +1 -1
- package/dist/assets/components/PageHeader/PageHeader.css +1 -1
- package/dist/assets/components/Select/Select.css +1 -0
- package/dist/assets/components/StatCard/StatCard.css +1 -1
- package/dist/assets/components/Tabs/Tabs.css +1 -1
- package/dist/assets/components/Tooltip/Tooltip.css +1 -1
- package/dist/components/DataTable/DataTable.d.ts +50 -6
- package/dist/components/DataTable/DataTable2.js +205 -133
- package/dist/components/DataTable/DataTable2.js.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +12 -1
- package/dist/components/Drawer/Drawer2.js +69 -51
- package/dist/components/Drawer/Drawer2.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +10 -3
- package/dist/components/EmptyState/EmptyState2.js +31 -48
- package/dist/components/EmptyState/EmptyState2.js.map +1 -1
- package/dist/components/EmptyState/index.d.ts +6 -1
- package/dist/components/ErrorState/ErrorState.d.ts +17 -4
- package/dist/components/ErrorState/ErrorState2.js +20 -23
- package/dist/components/ErrorState/ErrorState2.js.map +1 -1
- package/dist/components/ErrorState/index.d.ts +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +14 -1
- package/dist/components/PageHeader/PageHeader2.js +40 -24
- package/dist/components/PageHeader/PageHeader2.js.map +1 -1
- package/dist/components/Select/Select.d.ts +38 -0
- package/dist/components/Select/Select2.js +313 -0
- package/dist/components/Select/Select2.js.map +1 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/index.js +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +11 -1
- package/dist/components/Skeleton/Skeleton2.js +8 -6
- package/dist/components/Skeleton/Skeleton2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonCard.d.ts +3 -1
- package/dist/components/Skeleton/SkeletonCard2.js +13 -3
- package/dist/components/Skeleton/SkeletonCard2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonChart2.js +5 -0
- package/dist/components/Skeleton/SkeletonChart2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonRow.d.ts +3 -1
- package/dist/components/Skeleton/SkeletonRow2.js +9 -3
- package/dist/components/Skeleton/SkeletonRow2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonText.d.ts +3 -1
- package/dist/components/Skeleton/SkeletonText2.js +7 -5
- package/dist/components/Skeleton/SkeletonText2.js.map +1 -1
- package/dist/components/StatCard/StatCard.d.ts +10 -1
- package/dist/components/StatCard/StatCard2.js +30 -30
- package/dist/components/StatCard/StatCard2.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +10 -23
- package/dist/components/Tabs/Tabs2.js +127 -146
- package/dist/components/Tabs/Tabs2.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/Tabs/index.js +2 -3
- package/dist/components/Tooltip/Tooltip.d.ts +15 -1
- package/dist/components/Tooltip/Tooltip2.js +77 -47
- package/dist/components/Tooltip/Tooltip2.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -6
- package/dist/styles/base.css +101 -10
- package/dist/styles/themes/orange-dark.css +3 -0
- package/dist/styles/themes/orange-light.css +6 -1
- package/package.json +1 -1
- package/dist/components/EmptyState/illustrations.d.ts +0 -51
- package/dist/components/EmptyState/illustrations.js +0 -571
- package/dist/components/EmptyState/illustrations.js.map +0 -1
- package/dist/components/Tabs/tabTags.d.ts +0 -9
- package/dist/components/Tabs/tabTags.js +0 -11
- package/dist/components/Tabs/tabTags.js.map +0 -1
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 119 `--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,25 +22,38 @@
|
|
|
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 119 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
|
*
|
|
23
29
|
* Every component also gives every token reference here its own inline
|
|
24
30
|
* fallback, so a consumer that imports a component without this stylesheet
|
|
25
|
-
* still gets a rendered (unthemed) result.
|
|
31
|
+
* still gets a rendered (unthemed) result. Focus indicators are the one
|
|
32
|
+
* exception, and deliberately so: see below.
|
|
26
33
|
*
|
|
27
34
|
* Those inline fallbacks are NOT all equal to the values above, and no single
|
|
28
|
-
* theme would make them agree
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
35
|
+
* theme would make them agree. The largest group is `--token-colorPrimary`,
|
|
36
|
+
* written as `#8b5cf6` at 28 call sites, which is a `stained-light` accent
|
|
37
|
+
* this package does not ship and does not agree with the `#ff7a00` declared
|
|
38
|
+
* below. They were inherited verbatim from the source product, where they were
|
|
39
|
+
* already dead code, since the token is always defined and the fallback never
|
|
40
|
+
* applies.
|
|
34
41
|
*
|
|
35
42
|
* Consequence: importing a component WITHOUT this stylesheet renders, but not
|
|
36
43
|
* in the documented default palette. Import `styles/base.css`. Aligning the
|
|
37
44
|
* fallbacks is a deliberate visual change and is still out of scope.
|
|
45
|
+
*
|
|
46
|
+
* The exception, added for issue #7: a declaration that paints a focus
|
|
47
|
+
* indicator carries NO colour literal. It reads
|
|
48
|
+
* `var(--token-focusRingColor, var(--token-colorPrimary))`, or mixes the
|
|
49
|
+
* accent with the text colour inline, and stops there. A fallback literal
|
|
50
|
+
* cannot serve a focus ring, because WCAG 2.2 SC 1.4.11 requires 3:1 against
|
|
51
|
+
* the surface the indicator lands on and a fixed value cannot know that
|
|
52
|
+
* surface: the `#8b5cf6` these sites used to carry measures 3.85:1 in one
|
|
53
|
+
* palette and the `#ff7a00` below measures 2.37:1. "Renders unthemed" and
|
|
54
|
+
* "meets the contrast floor" are not both achievable from a constant, and for
|
|
55
|
+
* an accessibility affordance the second one wins. Everywhere else the rule in
|
|
56
|
+
* CONTRIBUTING.md stands unchanged: give the token a fallback.
|
|
38
57
|
*/
|
|
39
58
|
|
|
40
59
|
:root {
|
|
@@ -42,6 +61,16 @@
|
|
|
42
61
|
--token-borderRadiusLG: 0.5rem;
|
|
43
62
|
--token-borderRadiusSM: 0.25rem;
|
|
44
63
|
--token-borderRadiusXL: 0.75rem;
|
|
64
|
+
/* One height ladder for every form control, so a text field, a picker and a
|
|
65
|
+
button standing next to each other in a filter row land on the same top
|
|
66
|
+
and bottom edge. Only `Button` reads it today, at SM and LG; the middle
|
|
67
|
+
rung is declared with them because a ladder missing its default is not a
|
|
68
|
+
ladder, and the first control that needs a 40px box would otherwise
|
|
69
|
+
invent a literal, which is the defect this replaces. rem-based like the
|
|
70
|
+
rest of the scale, so controls grow with browser zoom (WCAG 1.4.4). */
|
|
71
|
+
--token-controlHeightSM: 2rem; /* 32px */
|
|
72
|
+
--token-controlHeight: 2.5rem; /* 40px */
|
|
73
|
+
--token-controlHeightLG: 2.75rem; /* 44px, the WCAG 2.1 touch target */
|
|
45
74
|
--token-boxShadow:
|
|
46
75
|
0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02),
|
|
47
76
|
0 2px 4px 0 rgba(0, 0, 0, 0.02);
|
|
@@ -102,6 +131,7 @@
|
|
|
102
131
|
--token-colorPrimary: #ff7a00;
|
|
103
132
|
--token-colorPrimaryActive: #cc6200;
|
|
104
133
|
--token-colorPrimaryBg: rgba(255, 122, 0, 0.1);
|
|
134
|
+
--token-colorPrimaryBgHover: rgba(255, 122, 0, 0.16);
|
|
105
135
|
--token-colorPrimaryBorder: rgba(255, 122, 0, 0.2);
|
|
106
136
|
--token-colorSuccess: #007a63;
|
|
107
137
|
--token-colorSuccessActive: #005244;
|
|
@@ -111,10 +141,25 @@
|
|
|
111
141
|
--token-colorSuccessBoxShadow: 0 4px 12px rgba(0, 189, 155, 0.15);
|
|
112
142
|
--token-colorWarning: #9a5d00;
|
|
113
143
|
--token-colorText: #141414;
|
|
144
|
+
/* Both #767676 rather than the #bfbfbf a disabled or placeholder value is
|
|
145
|
+
* usually given: that measures 2.2:1 on white, and text a reader is expected
|
|
146
|
+
* to read (a placeholder naming the field, a disabled value explaining why it
|
|
147
|
+
* cannot be changed) is not exempt from the 4.5:1 floor. */
|
|
148
|
+
--token-colorTextDisabled: #767676;
|
|
149
|
+
--token-colorTextPlaceholder: #767676;
|
|
114
150
|
--token-colorTextQuaternary: #bfbfbf;
|
|
115
151
|
--token-colorTextSecondary: #595959;
|
|
116
152
|
--token-colorTextTertiary: #737373;
|
|
117
|
-
--token-
|
|
153
|
+
/* Not --token-colorPrimary. That accent is chosen for brand and measures
|
|
154
|
+
* 2.37:1 against --token-colorFillSecondary here, under the 3:1 floor WCAG
|
|
155
|
+
* 2.2 SC 1.4.11 sets for the visual indicator of a component state. This is
|
|
156
|
+
* color-mix(in srgb, #ff7a00 70%, #141414) resolved to a literal, which
|
|
157
|
+
* measures 4.18:1 at its worst. It is written resolved rather than as a
|
|
158
|
+
* color-mix() call because a custom property holds an unparsed token stream:
|
|
159
|
+
* an unsupported color-mix() would substitute successfully and only then
|
|
160
|
+
* invalidate the outline shorthand at computed-value time, leaving
|
|
161
|
+
* outline-style: none and no ring at all, with no var() fallback firing. */
|
|
162
|
+
--token-focusRingColor: #b95b06;
|
|
118
163
|
--token-focusRingOffset: 2px;
|
|
119
164
|
--token-focusRingStyle: solid;
|
|
120
165
|
--token-focusRingWidth: 2px;
|
|
@@ -125,6 +170,11 @@
|
|
|
125
170
|
--token-fontSizeLG: 1rem;
|
|
126
171
|
--token-fontSizeSM: 0.75rem;
|
|
127
172
|
--token-fontSizeXL: 1.25rem;
|
|
173
|
+
/* The step above XL, for a value that is displayed rather than read as a
|
|
174
|
+
heading. The ladder had XXS but no XXL, so a component with a large
|
|
175
|
+
numeric readout had nothing to reach for and took a heading token
|
|
176
|
+
instead. Both products that define this name already declare 1.5rem. */
|
|
177
|
+
--token-fontSizeXXL: 1.5rem;
|
|
128
178
|
--token-fontSizeXXS: 0.5rem;
|
|
129
179
|
--token-marginXXS: 4px;
|
|
130
180
|
--token-padding: 0.75rem;
|
|
@@ -134,6 +184,13 @@
|
|
|
134
184
|
--token-paddingXL: 2rem;
|
|
135
185
|
--token-paddingXS: 0.25rem;
|
|
136
186
|
--token-paddingXXS: 0.125rem;
|
|
187
|
+
/* One size for every theme. A theme family may restyle the track and the
|
|
188
|
+
thumb, but must not restate the size: `[data-theme="..."]
|
|
189
|
+
::-webkit-scrollbar` outranks the global rule on specificity, so a wider
|
|
190
|
+
bar declared there cannot be corrected from here, and a sidebar rail is
|
|
191
|
+
the surface that pays for it. `scrollbar.test.ts` keeps it that way. */
|
|
192
|
+
--token-scrollbarSize: 0.5rem; /* 8px */
|
|
193
|
+
--token-scrollbarRadius: 0.25rem; /* 4px */
|
|
137
194
|
--token-motionDurationFast: 0.1s;
|
|
138
195
|
--token-motionDurationMid: 0.2s;
|
|
139
196
|
--token-motionDurationSlow: 0.3s;
|
|
@@ -165,3 +222,37 @@
|
|
|
165
222
|
--token-buttonSecondaryShadowHover:
|
|
166
223
|
0 2px 6px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
|
|
167
224
|
}
|
|
225
|
+
|
|
226
|
+
/* ============================================
|
|
227
|
+
Scrollbar
|
|
228
|
+
|
|
229
|
+
The only element rules in this file. Both halves are needed because the two
|
|
230
|
+
engines expose different surfaces, and neither one alone themes a bar.
|
|
231
|
+
============================================ */
|
|
232
|
+
|
|
233
|
+
/* Firefox has no ::-webkit pseudo-elements. Both properties are inherited, so
|
|
234
|
+
declaring them once on the root themes every scrollable descendant, and a
|
|
235
|
+
surface that hides its own bar (see `Tabs.css`) still overrides them
|
|
236
|
+
locally. */
|
|
237
|
+
:root {
|
|
238
|
+
scrollbar-width: thin;
|
|
239
|
+
scrollbar-color: var(--token-colorBorder, #d9d9d9) transparent;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
::-webkit-scrollbar {
|
|
243
|
+
width: var(--token-scrollbarSize, 0.5rem);
|
|
244
|
+
height: var(--token-scrollbarSize, 0.5rem);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
::-webkit-scrollbar-track {
|
|
248
|
+
background: transparent;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
::-webkit-scrollbar-thumb {
|
|
252
|
+
background-color: var(--token-colorBorder, #d9d9d9);
|
|
253
|
+
border-radius: var(--token-scrollbarRadius, 0.25rem);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
::-webkit-scrollbar-thumb:hover {
|
|
257
|
+
background-color: var(--token-colorTextTertiary, #737373);
|
|
258
|
+
}
|
|
@@ -60,6 +60,9 @@
|
|
|
60
60
|
--token-colorTextSecondary: #b3b3b3;
|
|
61
61
|
--token-colorTextTertiary: #8c8c8c;
|
|
62
62
|
--token-colorWarning: #d89614;
|
|
63
|
+
/* Left as the brand accent lightened for dark: it already measures 7.00:1 at
|
|
64
|
+
* its worst against this theme's six surfaces, so the 70% text mix its light
|
|
65
|
+
* counterpart needs would lower it to 6.42:1 for no benefit. */
|
|
63
66
|
--token-focusRingColor: #ff9729;
|
|
64
67
|
--token-focusRingOffset: 2px;
|
|
65
68
|
--token-focusRingStyle: solid;
|
|
@@ -60,7 +60,12 @@
|
|
|
60
60
|
--token-colorTextSecondary: #595959;
|
|
61
61
|
--token-colorTextTertiary: #737373;
|
|
62
62
|
--token-colorWarning: #9a5d00;
|
|
63
|
-
|
|
63
|
+
/* color-mix(in srgb, #ff7a00 70%, #141414) resolved to a literal. The bare
|
|
64
|
+
* accent measures 2.37:1 against --token-colorFillSecondary, under the 3:1
|
|
65
|
+
* floor of WCAG 2.2 SC 1.4.11; this measures 4.18:1 at its worst. See the
|
|
66
|
+
* note on the same token in ../base.css for why it is resolved here rather
|
|
67
|
+
* than left as a color-mix() call. */
|
|
68
|
+
--token-focusRingColor: #b95b06;
|
|
64
69
|
--token-focusRingOffset: 2px;
|
|
65
70
|
--token-focusRingStyle: solid;
|
|
66
71
|
--token-focusRingWidth: 2px;
|
package/package.json
CHANGED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EmptyState Illustrations
|
|
3
|
-
*
|
|
4
|
-
* SVG illustration components for different empty state contexts.
|
|
5
|
-
* All illustrations are inline React components for optimal performance.
|
|
6
|
-
* Each component is memoized to prevent unnecessary re-renders.
|
|
7
|
-
*/
|
|
8
|
-
interface IllustrationProps {
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Chat illustration - Speech bubbles with sparkles
|
|
13
|
-
*/
|
|
14
|
-
export declare const ChatIllustration: import('react').NamedExoticComponent<IllustrationProps>;
|
|
15
|
-
/**
|
|
16
|
-
* Models illustration - Package/download box
|
|
17
|
-
*/
|
|
18
|
-
export declare const ModelsIllustration: import('react').NamedExoticComponent<IllustrationProps>;
|
|
19
|
-
/**
|
|
20
|
-
* Creations illustration - Gallery frame
|
|
21
|
-
*/
|
|
22
|
-
export declare const CreationsIllustration: import('react').NamedExoticComponent<IllustrationProps>;
|
|
23
|
-
/**
|
|
24
|
-
* Benchmark illustration - Speedometer
|
|
25
|
-
*/
|
|
26
|
-
export declare const BenchmarkIllustration: import('react').NamedExoticComponent<IllustrationProps>;
|
|
27
|
-
/**
|
|
28
|
-
* Logs illustration - Document stack
|
|
29
|
-
*/
|
|
30
|
-
export declare const LogsIllustration: import('react').NamedExoticComponent<IllustrationProps>;
|
|
31
|
-
/**
|
|
32
|
-
* Statistics illustration - Chart placeholder
|
|
33
|
-
*/
|
|
34
|
-
export declare const StatisticsIllustration: import('react').NamedExoticComponent<IllustrationProps>;
|
|
35
|
-
/**
|
|
36
|
-
* Error illustration - Warning/error state
|
|
37
|
-
*/
|
|
38
|
-
export declare const ErrorIllustration: import('react').NamedExoticComponent<IllustrationProps>;
|
|
39
|
-
/**
|
|
40
|
-
* Text illustration - Document with bookmark
|
|
41
|
-
*/
|
|
42
|
-
export declare const TextIllustration: import('react').NamedExoticComponent<IllustrationProps>;
|
|
43
|
-
/**
|
|
44
|
-
* Schedule illustration - Calendar with clock
|
|
45
|
-
*/
|
|
46
|
-
export declare const ScheduleIllustration: import('react').NamedExoticComponent<IllustrationProps>;
|
|
47
|
-
/**
|
|
48
|
-
* Generic illustration - Placeholder icon
|
|
49
|
-
*/
|
|
50
|
-
export declare const GenericIllustration: import('react').NamedExoticComponent<IllustrationProps>;
|
|
51
|
-
export {};
|