@apliteni/apliteni-ui 0.77.0 → 0.79.0
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/guidelines/file-drop.md +87 -0
- package/package.json +1 -1
- package/react/README.md +114 -0
- package/react/dist/index.css +309 -2
- package/react/dist/index.d.ts +105 -1
- package/react/dist/index.js +920 -297
- package/src/index.css +1 -0
- package/src/inline.js +2 -0
- package/src/styles/file-drop.css +83 -0
- package/src/styles/tap-zone.css +42 -2
package/src/index.css
CHANGED
package/src/inline.js
CHANGED
|
@@ -38,6 +38,7 @@ export const styles = {
|
|
|
38
38
|
segmented: read('styles/segmented.css'),
|
|
39
39
|
tabs: read('styles/tabs.css'),
|
|
40
40
|
input: read('styles/input.css'),
|
|
41
|
+
fileDrop: read('styles/file-drop.css'),
|
|
41
42
|
dropdown: read('styles/dropdown.css'),
|
|
42
43
|
tooltip: read('styles/tooltip.css'),
|
|
43
44
|
nav: read('styles/nav.css'),
|
|
@@ -73,6 +74,7 @@ export const cssText = [
|
|
|
73
74
|
styles.segmented,
|
|
74
75
|
styles.tabs,
|
|
75
76
|
styles.input,
|
|
77
|
+
styles.fileDrop,
|
|
76
78
|
styles.dropdown,
|
|
77
79
|
styles.tooltip,
|
|
78
80
|
styles.nav,
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* File drop — .ui-drop. One row at rest; the field-sized box stays with .ui-file.
|
|
2
|
+
* why: docs/specification.md#react-file-drop */
|
|
3
|
+
.ui-drop { position: relative; }
|
|
4
|
+
|
|
5
|
+
/* What the region accepts the file for, above the control. */
|
|
6
|
+
.ui-drop > * + .ui-drop__row { margin-top: var(--space-3); }
|
|
7
|
+
|
|
8
|
+
.ui-drop__row {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
align-items: center;
|
|
12
|
+
/* One height at rest, whichever control is in it: the picker button carries a
|
|
13
|
+
glyph and a note beside it does not. */
|
|
14
|
+
min-height: var(--space-8);
|
|
15
|
+
gap: var(--space-2) var(--space-3);
|
|
16
|
+
font-size: var(--text-sm);
|
|
17
|
+
color: var(--text);
|
|
18
|
+
overflow-wrap: anywhere;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ui-drop__note { margin: 0; }
|
|
22
|
+
|
|
23
|
+
/* The file in hand is a stack, not a line: the name owns the top tier, what the
|
|
24
|
+
page has a rule about sits under it, and the track runs the width below both.
|
|
25
|
+
One line asked to carry all three truncates the name to nothing at 320. */
|
|
26
|
+
.ui-drop__file { display: grid; flex: 1 1 auto; gap: var(--space-2); min-width: 0; }
|
|
27
|
+
|
|
28
|
+
/* The name tier. Never wraps: the actions stay on the name's line at every
|
|
29
|
+
width, and the name gives way to them by truncating. */
|
|
30
|
+
.ui-drop__line { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-3); min-width: 0; }
|
|
31
|
+
|
|
32
|
+
/* The extension is the half that says what kind of file this is, so the stem
|
|
33
|
+
gives way and the tail never does — `frankfurt-settlement-state….pdf`, the
|
|
34
|
+
way Finder, Drive and Dropbox cut a name. */
|
|
35
|
+
.ui-drop__name { display: flex; flex: 1 1 auto; min-width: var(--space-10); color: var(--strong); font-weight: var(--weight-medium); }
|
|
36
|
+
.ui-drop__stem { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
37
|
+
.ui-drop__ext { flex: none; }
|
|
38
|
+
|
|
39
|
+
/* The facts tier: the size while it uploads, the message when it fails. Never
|
|
40
|
+
wraps either — a second tier of text here would be a third tier on the row. */
|
|
41
|
+
.ui-drop__facts { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-3); min-width: 0; }
|
|
42
|
+
.ui-drop__size { flex: none; white-space: nowrap; }
|
|
43
|
+
.ui-drop__word { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
|
|
44
|
+
|
|
45
|
+
/* A status the track does not already draw is a circled mark and a word,
|
|
46
|
+
because colour alone is not a status. */
|
|
47
|
+
.ui-drop__state { display: inline-flex; flex: 0 1 auto; align-items: center; gap: var(--space-2); min-width: 0; }
|
|
48
|
+
.ui-drop__state svg { width: 16px; height: 16px; flex: none; stroke-width: 2.4; }
|
|
49
|
+
.ui-drop__error { color: var(--pink); }
|
|
50
|
+
|
|
51
|
+
/* Closes the name's line on the edge the content ends on, in every state. */
|
|
52
|
+
.ui-drop__actions { display: flex; flex: none; align-items: center; gap: var(--space-2); margin-left: auto; }
|
|
53
|
+
|
|
54
|
+
/* The width of the row it reports on, so 40% reads as 40% rather than as a dash.
|
|
55
|
+
The ground is the kit's token for sunken tracks; --surface-3 was invisible. */
|
|
56
|
+
.ui-drop__bar {
|
|
57
|
+
display: block;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 6px;
|
|
60
|
+
border-radius: var(--radius-pill);
|
|
61
|
+
background: var(--surface-2); /* ring-gap: inherit — a progress track holds no focus target. */
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
}
|
|
64
|
+
.ui-drop__bar span { display: block; height: 100%; background: var(--accent); }
|
|
65
|
+
|
|
66
|
+
/* Covers the region rather than joining it, so the row keeps its place. */
|
|
67
|
+
.ui-drop__target {
|
|
68
|
+
position: absolute;
|
|
69
|
+
inset: 0;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
padding: var(--space-3);
|
|
74
|
+
border: 1px dashed var(--accent);
|
|
75
|
+
border-radius: var(--radius-md);
|
|
76
|
+
background: var(--surface); /* ring-gap: inherit — the target is painted while a file is over the region and holds no focus target. */
|
|
77
|
+
color: var(--strong);
|
|
78
|
+
font-size: var(--text-sm);
|
|
79
|
+
text-align: center;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ui-drop.is-disabled .ui-drop__row { /* muted-ink: state — the drop accepts nothing */ color: var(--disabled-ink); }
|
|
83
|
+
.ui-drop.is-disabled .ui-drop__name { /* muted-ink: state — the drop accepts nothing */ color: var(--disabled-ink); }
|
package/src/styles/tap-zone.css
CHANGED
|
@@ -27,6 +27,11 @@
|
|
|
27
27
|
/* 44 − 24: two zones fit between two of the smallest marks the kit draws. */
|
|
28
28
|
--tap-gap: var(--space-5, 20px);
|
|
29
29
|
|
|
30
|
+
/* For a container of BORDERED controls at the smallest mark: `100%` on the
|
|
31
|
+
layer is the padding box, so one of those measures two less there and
|
|
32
|
+
--tap-gap stops its layer short. The floor, less that box. */
|
|
33
|
+
--tap-gap-bordered: calc(var(--tap-min) - var(--tap-aa) + 2px);
|
|
34
|
+
|
|
30
35
|
/* Clear space to the nearest neighbour, declared by the container that knows
|
|
31
36
|
its own gap; a zone takes half on each side.
|
|
32
37
|
|
|
@@ -50,7 +55,12 @@
|
|
|
50
55
|
.ui-toast__action,
|
|
51
56
|
.ui-drawer__close,
|
|
52
57
|
.ui-snippet__copy,
|
|
53
|
-
.ui-footer__social
|
|
58
|
+
.ui-footer__social,
|
|
59
|
+
/* Already relative in react/src/DatePicker.css — restated because this
|
|
60
|
+
gate reads the kit's own sheets and cannot see that one, and a carrier
|
|
61
|
+
whose containing block it cannot find is a layer that measures against
|
|
62
|
+
whatever ancestor happens to be positioned. */
|
|
63
|
+
.ui-datepicker__opt
|
|
54
64
|
) { position: relative; }
|
|
55
65
|
|
|
56
66
|
/* The layer: centred, transparent, sized to the floor, clamped to half the
|
|
@@ -64,7 +74,8 @@
|
|
|
64
74
|
.ui-drawer__close,
|
|
65
75
|
.ui-snippet__copy,
|
|
66
76
|
.ui-footer__social,
|
|
67
|
-
.ui-switch
|
|
77
|
+
.ui-switch,
|
|
78
|
+
.ui-datepicker__opt
|
|
68
79
|
)::after {
|
|
69
80
|
content: "";
|
|
70
81
|
position: absolute;
|
|
@@ -128,6 +139,15 @@
|
|
|
128
139
|
mark's zone 9px inside `Revoke`. Nothing down, because a dense table's
|
|
129
140
|
rows share an edge and its padding is not clearance to spend. */
|
|
130
141
|
.ui-table__act .ui-btn + .ui-btn { margin-inline-start: var(--tap-gap) !important; }
|
|
142
|
+
|
|
143
|
+
/* A file drop's pair opens both ways: the row's own floor leaves clearance
|
|
144
|
+
under a button shorter than the target, and the panel's padding is below. */
|
|
145
|
+
.ui-drop__row { --tap-clear-y: var(--tap-gap); }
|
|
146
|
+
.ui-drop__actions {
|
|
147
|
+
gap: var(--tap-gap) !important;
|
|
148
|
+
--tap-clear-x: var(--tap-gap);
|
|
149
|
+
--tap-clear-y: var(--tap-gap);
|
|
150
|
+
}
|
|
131
151
|
.ui-table__act { --tap-clear-x: var(--tap-gap); --tap-clear-y: 0px; }
|
|
132
152
|
|
|
133
153
|
/* Down only, like the nine rows below: a toast is a full row at this width,
|
|
@@ -155,6 +175,26 @@
|
|
|
155
175
|
--tap-clear-y: var(--tap-gap);
|
|
156
176
|
}
|
|
157
177
|
|
|
178
|
+
/* `.ui-seg`'s shape at seven columns: cells packed across — that tight track
|
|
179
|
+
IS the control — opening down, where the sheet has the room. The rows
|
|
180
|
+
inherit both clearances. React-only, so the browser half below reports no
|
|
181
|
+
subject and react/src/DatePicker.test.tsx holds these declarations. */
|
|
182
|
+
.ui-datepicker__grid {
|
|
183
|
+
row-gap: var(--tap-gap) !important;
|
|
184
|
+
--tap-clear-x: var(--space-1, 4px);
|
|
185
|
+
--tap-clear-y: var(--tap-gap);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Neither axis is opened: the room is already there, a hundred pixels to the
|
|
189
|
+
caption and twelve to the grid, which is how `.ui-tabs__list` declares its
|
|
190
|
+
own. The bordered step, because both controls are bordered at --tap-aa. */
|
|
191
|
+
.ui-datepicker__head { --tap-clear-x: var(--tap-gap-bordered); --tap-clear-y: var(--tap-gap-bordered); }
|
|
192
|
+
|
|
193
|
+
/* The row scrolls, so its own block padding is the clearance — anything
|
|
194
|
+
past the chip is clipped rather than hit. The chips are already wider
|
|
195
|
+
than the floor, so the gap across stays the kit's. */
|
|
196
|
+
.ui-datepicker__presets { --tap-clear-x: var(--space-1, 4px); --tap-clear-y: var(--tap-gap-bordered); }
|
|
197
|
+
|
|
158
198
|
/* Both ways: fixed squares cannot overflow the way labels can, and a drawer
|
|
159
199
|
header spends its column gap on the title. Not the accent picker — its
|
|
160
200
|
swatches are on no carrier list, so opening it bought no reach. */
|