@0001-labs/design-system-1 0.3.0-alpha.25 → 0.3.0-alpha.27
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/DS1/0-face/generated/toast-assets.ts +1 -1
- package/DS1/1-root/cjk.css +1 -1
- package/DS1/1-root/fonts.css +1 -1
- package/DS1/1-root/notice.css +4 -1
- package/DS1/1-root/one.css +1 -1
- package/DS1/1-root/one.semantic.css +1 -1
- package/DS1/1-root/table.css +26 -2
- package/DS1/2-core/ds-tooltip.ts +23 -1
- package/DS1/2-core/generated/ds-icon-map.ts +1 -3
- package/DS1/2-core/generated/icons-extra.ts +1 -2
- package/DS1/2-core/generated/icons-immediate.ts +1 -1
- package/DS1/2-core/styles/ds-tooltip.css +3 -2
- package/DS1/3-unit/ds-accordion.ts +7 -18
- package/DS1/3-unit/ds-calendar.ts +4 -4
- package/DS1/3-unit/ds-table.ts +52 -4
- package/DS1/3-unit/styles/ds-accordion.css +25 -12
- package/DS1/3-unit/styles/ds-calendar.css +11 -11
- package/DS1/react/accordion.ts +1 -1
- package/DS1/x-icon/warning.svg +1 -1
- package/dist/0-face/generated/toast-assets.js +1 -1
- package/dist/2-core/ds-tooltip.d.ts +6 -0
- package/dist/2-core/ds-tooltip.d.ts.map +1 -1
- package/dist/2-core/ds-tooltip.js +27 -1
- package/dist/2-core/generated/ds-icon-map.d.ts +2 -3
- package/dist/2-core/generated/ds-icon-map.d.ts.map +1 -1
- package/dist/2-core/generated/ds-icon-map.js +1 -3
- package/dist/2-core/generated/icons-extra.d.ts.map +1 -1
- package/dist/2-core/generated/icons-extra.js +1 -2
- package/dist/2-core/generated/icons-immediate.d.ts +1 -1
- package/dist/2-core/generated/icons-immediate.d.ts.map +1 -1
- package/dist/2-core/generated/icons-immediate.js +1 -1
- package/dist/3-unit/ds-accordion.d.ts +3 -2
- package/dist/3-unit/ds-accordion.d.ts.map +1 -1
- package/dist/3-unit/ds-accordion.js +7 -18
- package/dist/3-unit/ds-calendar.d.ts +1 -1
- package/dist/3-unit/ds-calendar.js +4 -4
- package/dist/3-unit/ds-table.d.ts +13 -0
- package/dist/3-unit/ds-table.d.ts.map +1 -1
- package/dist/3-unit/ds-table.js +57 -4
- package/dist/design-system-1.bundle.js +235 -180
- package/dist/design-system-1.bundle.js.map +1 -1
- package/dist/design-system-1.bundle.min.js +405 -380
- package/dist/design-system-1.bundle.min.js.map +1 -1
- package/dist/feedback.js +17 -17
- package/dist/feedback.js.map +1 -1
- package/dist/{icons-extra-C0E3yQpX.js → icons-extra-CRxxWFjX.js} +2 -3
- package/dist/{icons-extra-C0E3yQpX.js.map → icons-extra-CRxxWFjX.js.map} +1 -1
- package/dist/{icons-extra-BbbpXocy.js → icons-extra-H5pqCM_R.js} +2 -5
- package/dist/{icons-extra-BbbpXocy.js.map → icons-extra-H5pqCM_R.js.map} +1 -1
- package/dist/react/accordion.js +1 -1
- package/package.json +1 -1
- package/DS1/x-icon/triangle.svg +0 -3
|
@@ -14,5 +14,5 @@ export const toastIcons: Readonly<Record<ToastIconName, string>> = {
|
|
|
14
14
|
"check": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M6.68649 11.884L12.443 6.13601L11.736 5.42715L6.68835 10.4827L4.26399 8.0501L3.55696 8.74525L6.68649 11.884Z\" fill=\"currentColor\"/>\n</svg>\n",
|
|
15
15
|
"close": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12.1215 4.58087L8.70453 7.99397L12.1176 11.4169L11.4106 12.112L7.99847 8.69108L4.58636 12.112L3.87836 11.4031L7.29535 7.99005L3.88226 4.56716L4.58929 3.87201L8.0014 7.29294L11.4145 3.87201L12.1215 4.58087Z\" fill=\"currentColor\"/>\n</svg>\n",
|
|
16
16
|
"notifications": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M4.5 11.5V7.5C4.5 5.567 6.067 4 8 4C9.933 4 11.5 5.567 11.5 7.5V11.5M3 11.5H13M8 2.5V4M6.5 13.5H9.5\" stroke=\"currentColor\" stroke-width=\"0.92\"/>\n</svg>\n",
|
|
17
|
-
"warning": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path
|
|
17
|
+
"warning": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.5 3.3H8.5V10.3H7.5V3.3ZM7.5 11.3H8.5V12.3H7.5V11.3Z\" fill=\"currentColor\"/>\n</svg>\n",
|
|
18
18
|
};
|
package/DS1/1-root/cjk.css
CHANGED
package/DS1/1-root/fonts.css
CHANGED
package/DS1/1-root/notice.css
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* the danger colour. The `ds-notice` element draws the same parts.
|
|
13
13
|
*
|
|
14
14
|
* ds-notice the block: mark, words, dismiss
|
|
15
|
-
* ds-notice__mark the
|
|
15
|
+
* ds-notice__mark the mark, a picture's 4px corners; holds an icon in its ink
|
|
16
16
|
* ds-notice__title one line in the medium face
|
|
17
17
|
* ds-notice__text lines of one square
|
|
18
18
|
* ds-notice__actions buttons or links on one row
|
|
@@ -84,6 +84,9 @@
|
|
|
84
84
|
height: var(--ds-control-height);
|
|
85
85
|
margin-block: calc((var(--ds-unit) - var(--ds-control-height)) / 2);
|
|
86
86
|
overflow: hidden;
|
|
87
|
+
/* Rounded as every icon tile is (Joachim, 19 October 2026). */
|
|
88
|
+
border-radius: var(--ds-radius);
|
|
89
|
+
corner-shape: var(--ds-corner-shape, round);
|
|
87
90
|
background: var(--ds-notice-mark);
|
|
88
91
|
color: var(--ds-notice-mark-ink);
|
|
89
92
|
--ds-icon-color: var(--ds-notice-mark-ink);
|
package/DS1/1-root/one.css
CHANGED
package/DS1/1-root/table.css
CHANGED
|
@@ -19,7 +19,13 @@
|
|
|
19
19
|
*
|
|
20
20
|
* `data-sheet` makes it a spreadsheet: every cell four squares by one (80 by
|
|
21
21
|
* 20), its 1px lines at its end and foot so the words have 79 by 19, set 4px
|
|
22
|
-
* in on the sixteen
|
|
22
|
+
* in on the sixteen. Words that do not fit fade out over the last square
|
|
23
|
+
* where they are cut, never an ellipsis: put them in `.ds-table__words`,
|
|
24
|
+
* which carries the fade (a mask, so it fades to whatever is behind: the
|
|
25
|
+
* paper, a selected or hovered cell's fill). A table marked `data-fit`
|
|
26
|
+
* (`<ds-table sheet>` is) measures its cells and marks the cut ones
|
|
27
|
+
* `data-cut="end"`, or `"start"` for a number it has scrolled to its end, so
|
|
28
|
+
* words that fit never fade; without it every cell's end fades. Column letters and the row numbers
|
|
23
29
|
* (`.ds-table__letters`, `.ds-table__number`, two squares wide) stay in place
|
|
24
30
|
* while the sheet scrolls both ways inside `.ds-table-scroll`; give the table
|
|
25
31
|
* `--ds-table-columns` (the number of data columns) and the scroll a height
|
|
@@ -161,11 +167,29 @@
|
|
|
161
167
|
border-bottom: 1px solid var(--ds-table-rule);
|
|
162
168
|
border-inline-end: 1px solid var(--ds-table-rule);
|
|
163
169
|
overflow: hidden;
|
|
164
|
-
text-overflow: ellipsis;
|
|
165
170
|
}
|
|
166
171
|
.ds-table[data-sheet] :is(th, td):last-child {
|
|
167
172
|
padding-inline-end: var(--ds-table-text);
|
|
168
173
|
}
|
|
174
|
+
.ds-table[data-sheet] .ds-table__words {
|
|
175
|
+
--ds-table-fade-to: right;
|
|
176
|
+
--ds-table-fade-from: left;
|
|
177
|
+
display: block;
|
|
178
|
+
overflow: hidden;
|
|
179
|
+
white-space: nowrap;
|
|
180
|
+
}
|
|
181
|
+
.ds-table[data-sheet]:dir(rtl) .ds-table__words {
|
|
182
|
+
--ds-table-fade-to: left;
|
|
183
|
+
--ds-table-fade-from: right;
|
|
184
|
+
}
|
|
185
|
+
/* Cut words fade over their last square to nothing, at the edge where they are cut. */
|
|
186
|
+
.ds-table[data-sheet]:not([data-fit]) .ds-table__words,
|
|
187
|
+
.ds-table[data-sheet] .ds-table__words[data-cut="end"] {
|
|
188
|
+
mask-image: linear-gradient(to var(--ds-table-fade-to), #000 calc(100% - var(--ds-table-row)), transparent);
|
|
189
|
+
}
|
|
190
|
+
.ds-table[data-sheet] .ds-table__words[data-cut="start"] {
|
|
191
|
+
mask-image: linear-gradient(to var(--ds-table-fade-from), #000 calc(100% - var(--ds-table-row)), transparent);
|
|
192
|
+
}
|
|
169
193
|
.ds-table[data-sheet] .ds-table__number {
|
|
170
194
|
width: var(--ds-table-index);
|
|
171
195
|
max-width: var(--ds-table-index);
|
package/DS1/2-core/ds-tooltip.ts
CHANGED
|
@@ -100,7 +100,29 @@ export class Tooltip extends LitElement {
|
|
|
100
100
|
trigger.setAttribute("aria-describedby", [...ids, this.description.id].join(" "));
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
updated(): void {
|
|
103
|
+
updated(): void {
|
|
104
|
+
this.describe();
|
|
105
|
+
if (this._visible) this.place();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Keeps the bubble inside the window, as the page's tooltips do (0-face/tooltips.ts): four
|
|
110
|
+
* pixels from its edges, and below the control when there is no room above (or above when
|
|
111
|
+
* `placement="bottom"` has no room below). A tooltip at a frame's edge is never cut short.
|
|
112
|
+
*/
|
|
113
|
+
private place(): void {
|
|
114
|
+
const bubble = this.shadowRoot?.querySelector<HTMLElement>(".bubble");
|
|
115
|
+
if (!bubble || bubble.hidden) return;
|
|
116
|
+
const edge = 4 * (parseFloat(getComputedStyle(this).getPropertyValue("--ds-sf")) || 1);
|
|
117
|
+
bubble.style.removeProperty("--ds-tooltip-shift");
|
|
118
|
+
bubble.dataset.side = this.placement === "bottom" ? "bottom" : "top";
|
|
119
|
+
let box = bubble.getBoundingClientRect();
|
|
120
|
+
if (bubble.dataset.side === "top" && box.top < edge) bubble.dataset.side = "bottom";
|
|
121
|
+
else if (bubble.dataset.side === "bottom" && box.bottom > innerHeight - edge) bubble.dataset.side = "top";
|
|
122
|
+
box = bubble.getBoundingClientRect();
|
|
123
|
+
const shift = box.left < edge ? edge - box.left : box.right > innerWidth - edge ? innerWidth - edge - box.right : 0;
|
|
124
|
+
if (shift) bubble.style.setProperty("--ds-tooltip-shift", `${shift}px`);
|
|
125
|
+
}
|
|
104
126
|
|
|
105
127
|
render() {
|
|
106
128
|
return html`<slot @slotchange=${this.describe}></slot>
|
|
@@ -322,7 +322,6 @@ export const iconNameToSvgMap = {
|
|
|
322
322
|
"toggle": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M3 5L7.5 8L3 11Z\" fill=\"currentColor\"/>\n<path d=\"M9.5 7.5H13.5V8.5H9.5Z\" fill=\"currentColor\"/>\n</svg>",
|
|
323
323
|
"train": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g stroke=\"currentColor\" stroke-width=\"0.92\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3.25\" y=\"1.75\" width=\"9.5\" height=\"9.5\" rx=\"2.25\"/><path d=\"M3.25 7H12.75\"/><path d=\"M5.75 9.25H5.76M10.24 9.25H10.25\"/><path d=\"M5.25 11.25L3.75 14M10.75 11.25L12.25 14\"/></g>\n</svg>",
|
|
324
324
|
"transfer": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g stroke=\"currentColor\" stroke-width=\"0.92\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 5.5H12.5M10 3L12.5 5.5L10 8\"/><path d=\"M13 10.5H3.5M6 8L3.5 10.5L6 13\"/></g>\n</svg>",
|
|
325
|
-
"triangle": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 1.8L15.2 14.3H0.8L8 1.8ZM8 3.8L2.53 13.3H13.47L8 3.8Z\" fill=\"#1E1E1E\"/>\n</svg>",
|
|
326
325
|
"tv": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g stroke=\"currentColor\" stroke-width=\"0.92\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"1.75\" y=\"3.25\" width=\"12.5\" height=\"8.5\" rx=\"1.75\"/><path d=\"M5.5 13.75H10.5\"/><path d=\"M7 6V9L9.5 7.5Z\"/></g>\n</svg>",
|
|
327
326
|
"underline": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5.5 3.25V8A2.5 2.5 0 0 0 10.5 8V3.25M4 12.75H12\" stroke=\"currentColor\" stroke-width=\"1.1\"/>\n</svg>",
|
|
328
327
|
"undo": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 12 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M1 4L4 1M1 4L4 7M1 4H8C9.65685 4 11 5.34315 11 7V9\" stroke=\"currentColor\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"none\"/>\n</svg></svg>",
|
|
@@ -341,7 +340,7 @@ export const iconNameToSvgMap = {
|
|
|
341
340
|
"views": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"7\" cy=\"7\" r=\"4.5\" stroke=\"currentColor\" stroke-width=\"0.92\"/>\n<path d=\"M10.2 10.2L13.5 13.5\" stroke=\"currentColor\" stroke-width=\"0.92\"/>\n</svg>",
|
|
342
341
|
"vimeo": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M3 8.5l1 1s1.5 -1.102 2 -.5c.509 .609 1.863 7.65 2.5 9c.556 1.184 1.978 2.89 4 1.5c2 -1.5 7.5 -5.5 8.5 -11.5c.444 -2.661 -1 -4 -2.5 -4c-2 0 -4.047 1.202 -4.5 4c2.05 -1.254 2.551 1 1.5 3c-1.052 2 -2 3 -2.5 3c-.49 0 -.924 -1.165 -1.5 -3.5c-.59 -2.42 -.5 -6.5 -3 -6.5s-5.5 4.5 -5.5 4.5\"/>\n</svg></svg>",
|
|
343
342
|
"wallet": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g stroke=\"currentColor\" stroke-width=\"0.92\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12.25 5.25V4.25C12.25 3.7 11.8 3.25 11.25 3.25H3.75C2.92 3.25 2.25 3.92 2.25 4.75\"/><rect x=\"2.25\" y=\"4.75\" width=\"11.5\" height=\"8\" rx=\"1.75\"/><path d=\"M13.75 7.5H11.25C10.42 7.5 9.75 8.17 9.75 9C9.75 9.83 10.42 10.5 11.25 10.5H13.75\"/></g>\n</svg>",
|
|
344
|
-
"warning": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path
|
|
343
|
+
"warning": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.5 3.3H8.5V10.3H7.5V3.3ZM7.5 11.3H8.5V12.3H7.5V11.3Z\" fill=\"currentColor\"/>\n</svg>",
|
|
345
344
|
"wifi": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g stroke=\"currentColor\" stroke-width=\"0.92\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M1.75 6.25C5.2 3.25 10.8 3.25 14.25 6.25\"/><path d=\"M3.75 8.5C6.2 6.5 9.8 6.5 12.25 8.5\"/><path d=\"M5.75 10.75C7.05 9.75 8.95 9.75 10.25 10.75\"/><path d=\"M8 12.99V13\"/></g>\n</svg>",
|
|
346
345
|
"window": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<rect x=\"2.5\" y=\"3.5\" width=\"11\" height=\"9\" stroke=\"currentColor\"/>\n<path d=\"M2.5 6H13.5\" stroke=\"currentColor\"/>\n</svg>",
|
|
347
346
|
"work": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13.8153 4.78289C13.8153 4.20267 13.3448 3.73213 12.7646 3.73213H8H3.23544C2.65521 3.73213 2.18468 4.20267 2.18468 4.78289V7.31419H13.8153L13.8153 4.78289ZM2.18468 8V11.2171C2.18468 11.7973 2.65521 12.2679 3.23544 12.2679H12.7646C13.3448 12.2679 13.8153 11.7973 13.8153 11.2171L13.8153 8L9.33239 7.98014V8.63222C9.33239 8.92233 9.09712 9.1576 8.807 9.1576H8H7.19299C6.90287 9.1576 6.66761 8.92233 6.66761 8.63222V7.98014L2.18468 8Z\" fill=\"currentColor\"/>\n</svg>",
|
|
@@ -670,7 +669,6 @@ export const iconNames = [
|
|
|
670
669
|
"toggle",
|
|
671
670
|
"train",
|
|
672
671
|
"transfer",
|
|
673
|
-
"triangle",
|
|
674
672
|
"tv",
|
|
675
673
|
"underline",
|
|
676
674
|
"undo",
|
|
@@ -278,7 +278,6 @@ export const icons: Readonly<Record<string, string>> = {
|
|
|
278
278
|
"toggle": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M3 5L7.5 8L3 11Z\" fill=\"currentColor\"/>\n<path d=\"M9.5 7.5H13.5V8.5H9.5Z\" fill=\"currentColor\"/>\n</svg>",
|
|
279
279
|
"train": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g stroke=\"currentColor\" stroke-width=\"0.92\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3.25\" y=\"1.75\" width=\"9.5\" height=\"9.5\" rx=\"2.25\"/><path d=\"M3.25 7H12.75\"/><path d=\"M5.75 9.25H5.76M10.24 9.25H10.25\"/><path d=\"M5.25 11.25L3.75 14M10.75 11.25L12.25 14\"/></g>\n</svg>",
|
|
280
280
|
"transfer": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g stroke=\"currentColor\" stroke-width=\"0.92\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 5.5H12.5M10 3L12.5 5.5L10 8\"/><path d=\"M13 10.5H3.5M6 8L3.5 10.5L6 13\"/></g>\n</svg>",
|
|
281
|
-
"triangle": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 1.8L15.2 14.3H0.8L8 1.8ZM8 3.8L2.53 13.3H13.47L8 3.8Z\" fill=\"#1E1E1E\"/>\n</svg>",
|
|
282
281
|
"tv": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g stroke=\"currentColor\" stroke-width=\"0.92\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"1.75\" y=\"3.25\" width=\"12.5\" height=\"8.5\" rx=\"1.75\"/><path d=\"M5.5 13.75H10.5\"/><path d=\"M7 6V9L9.5 7.5Z\"/></g>\n</svg>",
|
|
283
282
|
"underline": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5.5 3.25V8A2.5 2.5 0 0 0 10.5 8V3.25M4 12.75H12\" stroke=\"currentColor\" stroke-width=\"1.1\"/>\n</svg>",
|
|
284
283
|
"undo": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 12 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M1 4L4 1M1 4L4 7M1 4H8C9.65685 4 11 5.34315 11 7V9\" stroke=\"currentColor\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"none\"/>\n</svg></svg>",
|
|
@@ -291,7 +290,7 @@ export const icons: Readonly<Record<string, string>> = {
|
|
|
291
290
|
"video": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<rect x=\"2.5\" y=\"4.5\" width=\"8\" height=\"7\" stroke=\"currentColor\"/>\n<path d=\"M10.5 7L13.5 5V11L10.5 9\" stroke=\"currentColor\"/>\n</svg>",
|
|
292
291
|
"vimeo": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M3 8.5l1 1s1.5 -1.102 2 -.5c.509 .609 1.863 7.65 2.5 9c.556 1.184 1.978 2.89 4 1.5c2 -1.5 7.5 -5.5 8.5 -11.5c.444 -2.661 -1 -4 -2.5 -4c-2 0 -4.047 1.202 -4.5 4c2.05 -1.254 2.551 1 1.5 3c-1.052 2 -2 3 -2.5 3c-.49 0 -.924 -1.165 -1.5 -3.5c-.59 -2.42 -.5 -6.5 -3 -6.5s-5.5 4.5 -5.5 4.5\"/>\n</svg></svg>",
|
|
293
292
|
"wallet": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g stroke=\"currentColor\" stroke-width=\"0.92\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12.25 5.25V4.25C12.25 3.7 11.8 3.25 11.25 3.25H3.75C2.92 3.25 2.25 3.92 2.25 4.75\"/><rect x=\"2.25\" y=\"4.75\" width=\"11.5\" height=\"8\" rx=\"1.75\"/><path d=\"M13.75 7.5H11.25C10.42 7.5 9.75 8.17 9.75 9C9.75 9.83 10.42 10.5 11.25 10.5H13.75\"/></g>\n</svg>",
|
|
294
|
-
"warning": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path
|
|
293
|
+
"warning": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.5 3.3H8.5V10.3H7.5V3.3ZM7.5 11.3H8.5V12.3H7.5V11.3Z\" fill=\"currentColor\"/>\n</svg>",
|
|
295
294
|
"wifi": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g stroke=\"currentColor\" stroke-width=\"0.92\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M1.75 6.25C5.2 3.25 10.8 3.25 14.25 6.25\"/><path d=\"M3.75 8.5C6.2 6.5 9.8 6.5 12.25 8.5\"/><path d=\"M5.75 10.75C7.05 9.75 8.95 9.75 10.25 10.75\"/><path d=\"M8 12.99V13\"/></g>\n</svg>",
|
|
296
295
|
"window": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<rect x=\"2.5\" y=\"3.5\" width=\"11\" height=\"9\" stroke=\"currentColor\"/>\n<path d=\"M2.5 6H13.5\" stroke=\"currentColor\"/>\n</svg>",
|
|
297
296
|
"work": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13.8153 4.78289C13.8153 4.20267 13.3448 3.73213 12.7646 3.73213H8H3.23544C2.65521 3.73213 2.18468 4.20267 2.18468 4.78289V7.31419H13.8153L13.8153 4.78289ZM2.18468 8V11.2171C2.18468 11.7973 2.65521 12.2679 3.23544 12.2679H12.7646C13.3448 12.2679 13.8153 11.7973 13.8153 11.2171L13.8153 8L9.33239 7.98014V8.63222C9.33239 8.92233 9.09712 9.1576 8.807 9.1576H8H7.19299C6.90287 9.1576 6.66761 8.92233 6.66761 8.63222V7.98014L2.18468 8Z\" fill=\"currentColor\"/>\n</svg>",
|
|
@@ -46,4 +46,4 @@ export const icons: Readonly<Record<string, string>> = {
|
|
|
46
46
|
"up": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.49645 3.48222V16H8.50702L8.50841 3.48259L11.4156 6.38982L12.1095 5.68299L8.00173 1.57524L3.8905 5.68647L4.59784 6.39381L7.49645 3.48222Z\" fill=\"currentColor\"/>\n</svg>",
|
|
47
47
|
"views": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"7\" cy=\"7\" r=\"4.5\" stroke=\"currentColor\" stroke-width=\"0.92\"/>\n<path d=\"M10.2 10.2L13.5 13.5\" stroke=\"currentColor\" stroke-width=\"0.92\"/>\n</svg>"
|
|
48
48
|
}
|
|
49
|
-
export const deferredIconNames = ["1x","1xdots","1xgrid","1xlines","2x","2xdots","2xgrid","2xgrid-alt","2xgrid-alt-2","2xgrid-alt-3","2xlines","4x4","airtable","archive-alt","arrange-archive","arrange-check","arrange-chevron","arrange-connect","arrange-draft","arrange-dropdown","arrange-home","arrange-link","arrange-menu","arrange-more","arrange-page","arrange-plus","arrange-site","attach","audio","avatar","badge-bands","badge-bands-3d","badge-blue-fan","badge-blue-fan-3d","badge-bricks","badge-bricks-3d","badge-broken-stripes","badge-broken-stripes-3d","badge-checker","badge-checker-3d","badge-diamond","badge-diamond-3d","badge-fan","badge-fan-3d","badge-fan-dark","badge-fan-dark-3d","badge-halves","badge-halves-3d","badge-halves-green","badge-halves-green-3d","badge-red","badge-red-3d","badge-red-blue-bricks","badge-red-blue-bricks-3d","badge-round-fan","badge-round-fan-3d","badge-shard","badge-shard-3d","badge-split-circle","badge-split-circle-3d","badge-tall-bricks","badge-tall-bricks-3d","badge-weave","badge-weave-3d","bag-alt","bank","banknote","block-accordion","block-banner","block-breadcrumbs","block-button","block-divider","block-forms","block-group","block-heading","block-image","block-logo-marquee","block-page-progress","block-section","block-table","block-tabs","block-text","bold","bolt","book","book-alt","box","briefcase","building","bullet","callout","car","card","cart","categories","check-alt","chevron-down","chevron-left","chevron-right","chevron-up","cloud","code","code-block","coffee","coins","color","column","comment","connect","content","cursor","curve","default","dictate","dislike","divider","dot-bank","dot-banknote","dot-banknotes","dot-card","dot-coin","dot-coins","dot-happy","dot-neutral","dot-receipt","dot-sad","dot-safe","dot-transfer","dot-wallet","download","drive","drop","dropbox","dumbbell","equation","exercise","eye","eye-off","facebook","figma","flame","flip","food","form","fuel","gallery","game","gift","github","globe","group","group-alt","group-alt-2","h1","h2","h3","handle","head","heart","help","help-alt","history","home-alt","icon","image","in","income","indent","info","instagram","italic","item","jpbank","key","keyboard","life","like","link","linkedin","list-line","lock-filled","logo-marquee","loom","map","medical","mention","menu","minimize","minimize-alt","minus","money","moon","move","music","music-alt","navigation-check","note-alt","note-alt-2","note-lines","notifications","notion","numbered","offline","open-alt","open-source","outdent","page","page-18","page-alt","page-note","panel","password-see","password-unsee","pattern-call-to-action","pattern-card","pattern-feature","pattern-hero","pause","paw","pdf","people","percent","phone","pill","plane","play-alt","postal","present","quote","reaction","receipt","redo","refresh","refund","relationships","repeat","rewind","rewind-30","rewind-30-alt","rotate","row","safe","school","school-alt","search-30","see-30","settings","shield","shield-alt","shirt","shop","sign-in","sign-out","slack","slash","sparkle","star-alt","star-alt-2","start","status","status-alt","status-filled","stop","strike","sun","system","table","tag","templates","text","ticket","title","title-struck","titlestyle","todo","toggle","train","transfer","
|
|
49
|
+
export const deferredIconNames = ["1x","1xdots","1xgrid","1xlines","2x","2xdots","2xgrid","2xgrid-alt","2xgrid-alt-2","2xgrid-alt-3","2xlines","4x4","airtable","archive-alt","arrange-archive","arrange-check","arrange-chevron","arrange-connect","arrange-draft","arrange-dropdown","arrange-home","arrange-link","arrange-menu","arrange-more","arrange-page","arrange-plus","arrange-site","attach","audio","avatar","badge-bands","badge-bands-3d","badge-blue-fan","badge-blue-fan-3d","badge-bricks","badge-bricks-3d","badge-broken-stripes","badge-broken-stripes-3d","badge-checker","badge-checker-3d","badge-diamond","badge-diamond-3d","badge-fan","badge-fan-3d","badge-fan-dark","badge-fan-dark-3d","badge-halves","badge-halves-3d","badge-halves-green","badge-halves-green-3d","badge-red","badge-red-3d","badge-red-blue-bricks","badge-red-blue-bricks-3d","badge-round-fan","badge-round-fan-3d","badge-shard","badge-shard-3d","badge-split-circle","badge-split-circle-3d","badge-tall-bricks","badge-tall-bricks-3d","badge-weave","badge-weave-3d","bag-alt","bank","banknote","block-accordion","block-banner","block-breadcrumbs","block-button","block-divider","block-forms","block-group","block-heading","block-image","block-logo-marquee","block-page-progress","block-section","block-table","block-tabs","block-text","bold","bolt","book","book-alt","box","briefcase","building","bullet","callout","car","card","cart","categories","check-alt","chevron-down","chevron-left","chevron-right","chevron-up","cloud","code","code-block","coffee","coins","color","column","comment","connect","content","cursor","curve","default","dictate","dislike","divider","dot-bank","dot-banknote","dot-banknotes","dot-card","dot-coin","dot-coins","dot-happy","dot-neutral","dot-receipt","dot-sad","dot-safe","dot-transfer","dot-wallet","download","drive","drop","dropbox","dumbbell","equation","exercise","eye","eye-off","facebook","figma","flame","flip","food","form","fuel","gallery","game","gift","github","globe","group","group-alt","group-alt-2","h1","h2","h3","handle","head","heart","help","help-alt","history","home-alt","icon","image","in","income","indent","info","instagram","italic","item","jpbank","key","keyboard","life","like","link","linkedin","list-line","lock-filled","logo-marquee","loom","map","medical","mention","menu","minimize","minimize-alt","minus","money","moon","move","music","music-alt","navigation-check","note-alt","note-alt-2","note-lines","notifications","notion","numbered","offline","open-alt","open-source","outdent","page","page-18","page-alt","page-note","panel","password-see","password-unsee","pattern-call-to-action","pattern-card","pattern-feature","pattern-hero","pause","paw","pdf","people","percent","phone","pill","plane","play-alt","postal","present","quote","reaction","receipt","redo","refresh","refund","relationships","repeat","rewind","rewind-30","rewind-30-alt","rotate","row","safe","school","school-alt","search-30","see-30","settings","shield","shield-alt","shirt","shop","sign-in","sign-out","slack","slash","sparkle","star-alt","star-alt-2","start","status","status-alt","status-filled","stop","strike","sun","system","table","tag","templates","text","ticket","title","title-struck","titlestyle","todo","toggle","train","transfer","tv","underline","undo","ungroup","unhead","unicon","untitle","up-right","upload","video","vimeo","wallet","warning","wifi","window","work","wrench","x-brand","youtube"] as const
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
position: absolute;
|
|
11
11
|
left: 50%;
|
|
12
12
|
bottom: calc(100% + 2px * var(--ds-sf, var(--sf, 1)));
|
|
13
|
-
|
|
13
|
+
/* Centred over its control, shifted to stay four pixels inside the window (ds-tooltip.ts). */
|
|
14
|
+
transform: translateX(calc(-50% + var(--ds-tooltip-shift, 0px)));
|
|
14
15
|
z-index: var(--ds-tooltip-z-index, 1000);
|
|
15
16
|
width: max-content;
|
|
16
17
|
max-width: min(calc(320px * var(--ds-sf, var(--sf, 1))), calc(100vw - 20px));
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
|
|
33
34
|
.bubble[hidden] { display: none; }
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
.bubble[data-side="bottom"] {
|
|
36
37
|
bottom: auto;
|
|
37
38
|
top: calc(100% + 2px * var(--ds-sf, var(--sf, 1)));
|
|
38
39
|
}
|
|
@@ -3,11 +3,12 @@ import "../2-core/ds-text";
|
|
|
3
3
|
import "../2-core/ds-icon";
|
|
4
4
|
import "../2-core/ds-button";
|
|
5
5
|
import { define } from "../0-face/define";
|
|
6
|
-
import "./ds-row";
|
|
7
6
|
import styles from "./styles/ds-accordion.css?inline";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
|
-
* Native accordion using <details>/<summary> (no JS toggle logic)
|
|
9
|
+
* Native accordion using <details>/<summary> (no JS toggle logic): the
|
|
10
|
+
* summary one square high at the start, the library's chevron-down at its
|
|
11
|
+
* end (turned over when open), the details from the square below.
|
|
11
12
|
*
|
|
12
13
|
* Usage (with translation text):
|
|
13
14
|
* <ds-accordion summary="How it began" details="Designed in Hokkaido"></ds-accordion>
|
|
@@ -86,22 +87,10 @@ export class Accordion extends LitElement {
|
|
|
86
87
|
return html`
|
|
87
88
|
<details ?open=${this.open}>
|
|
88
89
|
<summary>
|
|
89
|
-
<
|
|
90
|
-
<ds-text .text=${this.summary} ?literal=${this.literal}></ds-text>
|
|
91
|
-
<ds-icon class="chevron" aria-hidden="true">
|
|
92
|
-
|
|
93
|
-
viewBox="0 0 10.157 8.219"
|
|
94
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
95
|
-
aria-hidden="true"
|
|
96
|
-
focusable="false"
|
|
97
|
-
>
|
|
98
|
-
<path
|
|
99
|
-
d="M5.078 8.219L0 3.141L1.414 1.727L5.078 5.391L8.743 1.727L10.157 3.141L5.078 8.219Z"
|
|
100
|
-
fill="currentColor"
|
|
101
|
-
/>
|
|
102
|
-
</svg>
|
|
103
|
-
</ds-icon>
|
|
104
|
-
</ds-row>
|
|
90
|
+
<span class="summaryRow">
|
|
91
|
+
<ds-text class="summaryText" .text=${this.summary} ?literal=${this.literal}></ds-text>
|
|
92
|
+
<ds-icon class="chevron" type="chevron-down" size="large" aria-hidden="true"></ds-icon>
|
|
93
|
+
</span>
|
|
105
94
|
</summary>
|
|
106
95
|
|
|
107
96
|
<div class="detailsBody">
|
|
@@ -145,7 +145,7 @@ const openPickers = new Set<Calendar>();
|
|
|
145
145
|
* @fires navigate - A person moved to another month; `{ month }`.
|
|
146
146
|
* @fires ds-calendar-toggle - A picker's month opened or closed; `{ open }`.
|
|
147
147
|
*
|
|
148
|
-
* A selectable calendar
|
|
148
|
+
* A selectable calendar shows Clear right under its dates while something is chosen, and `clear()`
|
|
149
149
|
* empties the value from code; both fire `change` with an empty value.
|
|
150
150
|
*
|
|
151
151
|
* @example
|
|
@@ -503,9 +503,9 @@ export class Calendar extends CalendarBase {
|
|
|
503
503
|
}
|
|
504
504
|
|
|
505
505
|
private renderClear() {
|
|
506
|
-
if (!this.selectable || this.embedded || this.required) return nothing;
|
|
506
|
+
if (!this.selectable || this.embedded || this.required || !this.value) return nothing;
|
|
507
507
|
return html`<div class="foot" part="foot">
|
|
508
|
-
<button class="ds-button ds-button--secondary clear-value" part="clear" type="button"
|
|
508
|
+
<button class="ds-button ds-button--secondary clear-value" part="clear" type="button" @click=${() => this.clear()}>${this.words("Clear")}</button>
|
|
509
509
|
</div>`;
|
|
510
510
|
}
|
|
511
511
|
|
|
@@ -609,7 +609,7 @@ export class Calendar extends CalendarBase {
|
|
|
609
609
|
type="button"
|
|
610
610
|
aria-label=${`${title}, ${this.words("Choose a month and year")}`}
|
|
611
611
|
@click=${this.levelUp}
|
|
612
|
-
><span class="title-text" id="title" aria-live="polite">${title}</span
|
|
612
|
+
><span class="title-text" id="title" aria-live="polite">${title}</span></button>`}
|
|
613
613
|
<span class="controls">
|
|
614
614
|
${this.noToday || this.squaresPerDay < 2 ? nothing : html`<button class="ds-button today-button" part="today" type="button" @click=${() => this.showToday()}>${this.words("Today")}</button>`}
|
|
615
615
|
${arrow("previous")}
|
package/DS1/3-unit/ds-table.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// `sheet` it is a spreadsheet: every cell four squares by one, lettered
|
|
5
5
|
// columns and numbered rows held in place while it scrolls both ways, and with
|
|
6
6
|
// `reorderable` its rows move by the grip on their number: dragged with a
|
|
7
|
-
// mouse, after a long press on a touch screen, or with Alt+↑/↓.
|
|
7
|
+
// mouse, after a long press on a touch screen, or with Alt+↑/↓. A sheet's
|
|
8
|
+
// words that do not fit fade out over their last square, never an ellipsis.
|
|
8
9
|
|
|
9
10
|
import { LitElement, html, nothing, unsafeCSS, type PropertyValues } from "lit";
|
|
10
11
|
import { getText } from "../0-face/i18n";
|
|
@@ -102,6 +103,9 @@ export class DsTable extends LitElement {
|
|
|
102
103
|
/** A move waiting for the page's data, and the time it settles back without it. */
|
|
103
104
|
private settle: { from: number; to: number; timer: ReturnType<typeof setTimeout> } | undefined;
|
|
104
105
|
private status = "";
|
|
106
|
+
/** Measures the cells again when the sheet's size changes, as its scale does. */
|
|
107
|
+
private resize: ResizeObserver | undefined;
|
|
108
|
+
private watched: Element | undefined;
|
|
105
109
|
|
|
106
110
|
constructor() {
|
|
107
111
|
super();
|
|
@@ -114,8 +118,16 @@ export class DsTable extends LitElement {
|
|
|
114
118
|
|
|
115
119
|
static styles = [unsafeCSS(metrics), unsafeCSS(table), unsafeCSS(styles)];
|
|
116
120
|
|
|
121
|
+
connectedCallback() {
|
|
122
|
+
super.connectedCallback();
|
|
123
|
+
// The faces may arrive after the first measure and change every width.
|
|
124
|
+
void document.fonts?.ready.then(() => { if (this.isConnected && this.sheet) this.fit(); });
|
|
125
|
+
}
|
|
126
|
+
|
|
117
127
|
disconnectedCallback() {
|
|
118
128
|
super.disconnectedCallback();
|
|
129
|
+
this.resize?.disconnect();
|
|
130
|
+
this.watched = undefined;
|
|
119
131
|
this.release();
|
|
120
132
|
if (this.settle) clearTimeout(this.settle.timer);
|
|
121
133
|
this.settle = undefined;
|
|
@@ -128,6 +140,42 @@ export class DsTable extends LitElement {
|
|
|
128
140
|
if (this.grip >= this.data.length) this.grip = Math.max(0, this.data.length - 1);
|
|
129
141
|
}
|
|
130
142
|
|
|
143
|
+
protected updated(changed: PropertyValues<this>) {
|
|
144
|
+
super.updated(changed);
|
|
145
|
+
if (!this.sheet) return;
|
|
146
|
+
// Before the first paint, so words that fit never show a fade.
|
|
147
|
+
if (["data", "columns", "footer", "sheet"].some(name => changed.has(name as keyof DsTable))) this.fit();
|
|
148
|
+
const table = this.table;
|
|
149
|
+
if (!table || table === this.watched || typeof ResizeObserver === "undefined") return;
|
|
150
|
+
this.resize ??= new ResizeObserver(() => this.fit());
|
|
151
|
+
this.resize.disconnect();
|
|
152
|
+
this.resize.observe(table);
|
|
153
|
+
this.watched = table;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Marks the cells whose words are cut, so only they fade where they are
|
|
158
|
+
* cut; a label fades at its end. A number always shows its last digits and loses its first: in a
|
|
159
|
+
* left-to-right sheet it is scrolled to its end and fades at its start;
|
|
160
|
+
* in a right-to-left one its digits already overflow on the left, the
|
|
161
|
+
* cell's end. All the reads come before any write, so it lays out once.
|
|
162
|
+
*/
|
|
163
|
+
private fit() {
|
|
164
|
+
const words = [...this.renderRoot.querySelectorAll<HTMLElement>(".ds-table__words")];
|
|
165
|
+
if (!words.length) return;
|
|
166
|
+
const rtl = getComputedStyle(words[0]!).direction === "rtl";
|
|
167
|
+
const over = words.map(element => element.scrollWidth - element.clientWidth);
|
|
168
|
+
const scrolled = words.map((element, index) => !rtl && over[index]! > 0 && Boolean(element.parentElement?.matches("td[data-numeric]")));
|
|
169
|
+
words.forEach((element, index) => {
|
|
170
|
+
const left = scrolled[index] ? over[index]! : 0;
|
|
171
|
+
if (element.scrollLeft !== left) element.scrollLeft = left;
|
|
172
|
+
});
|
|
173
|
+
words.forEach((element, index) => {
|
|
174
|
+
const cut = over[index]! <= 0 ? undefined : scrolled[index] ? "start" : "end";
|
|
175
|
+
if (element.dataset.cut !== cut) { if (cut) element.dataset.cut = cut; else delete element.dataset.cut; }
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
131
179
|
private resolvedColumns(): TableColumn[] {
|
|
132
180
|
const named = this.columns.length > 0;
|
|
133
181
|
const given = named
|
|
@@ -156,7 +204,7 @@ export class DsTable extends LitElement {
|
|
|
156
204
|
private sheetRow(row: TableRow, columns: TableColumn[], number: string, index?: number) {
|
|
157
205
|
const grip = this.reorderable && index !== undefined;
|
|
158
206
|
return html`<tr><th scope="row" class="ds-table__number">${grip ? this.gripCell(number, index) : number}</th>${columns.map((column, index) =>
|
|
159
|
-
html`<td ?data-numeric=${column.numeric}>${text(cell(row, column.key, index))}</td>`)}</tr>`;
|
|
207
|
+
html`<td ?data-numeric=${column.numeric}><span class="ds-table__words">${text(cell(row, column.key, index))}</span></td>`)}</tr>`;
|
|
160
208
|
}
|
|
161
209
|
|
|
162
210
|
private gripCell(number: string, index: number) {
|
|
@@ -398,10 +446,10 @@ export class DsTable extends LitElement {
|
|
|
398
446
|
private renderSheet(columns: TableColumn[]) {
|
|
399
447
|
return html`
|
|
400
448
|
<div class="ds-table-scroll" part="scroll" @pointerdown=${this.press} @touchmove=${{ handleEvent: this.holdTouch, passive: false }} @contextmenu=${this.holdMenu}>
|
|
401
|
-
<table class="ds-table" part="table" data-sheet ?data-reorderable=${this.reorderable} style=${`--ds-table-columns: ${columns.length}`} aria-label=${this.label ?? nothing}>
|
|
449
|
+
<table class="ds-table" part="table" data-sheet data-fit ?data-reorderable=${this.reorderable} style=${`--ds-table-columns: ${columns.length}`} aria-label=${this.label ?? nothing}>
|
|
402
450
|
<thead>
|
|
403
451
|
<tr class="ds-table__letters" aria-hidden="true"><td class="ds-table__number"></td>${columns.map((_, index) => html`<td>${columnLetter(index)}</td>`)}</tr>
|
|
404
|
-
<tr><td class="ds-table__number"></td>${columns.map(column => html`<th scope="col" ?data-numeric=${column.numeric}>${column.label}</th>`)}</tr>
|
|
452
|
+
<tr><td class="ds-table__number"></td>${columns.map(column => html`<th scope="col" ?data-numeric=${column.numeric}><span class="ds-table__words">${column.label}</span></th>`)}</tr>
|
|
405
453
|
</thead>
|
|
406
454
|
<tbody>${this.data.map((row, index) => this.sheetRow(row, columns, String(index + 1), index))}</tbody>
|
|
407
455
|
${this.footer ? html`<tfoot>${this.sheetRow(this.footer, columns, "")}</tfoot>` : nothing}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
/* ds-accordion.css
|
|
2
|
-
|
|
1
|
+
/* ds-accordion.css
|
|
2
|
+
* The summary is a row one square high: its words at the start on the sixteen, the library's
|
|
3
|
+
* chevron-down (16px, in the title grey) at its end, turned over when open. The pointer fills the
|
|
4
|
+
* row 4px past its words and chevron, keeping them where they stand; keyboard focus rings it.
|
|
5
|
+
* The details start on the square below, their lines one square each. */
|
|
3
6
|
@import "../../1-root/component-metrics.css";
|
|
4
7
|
|
|
5
8
|
:host {
|
|
@@ -15,37 +18,47 @@ details {
|
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
summary {
|
|
21
|
+
display: block;
|
|
22
|
+
margin-inline: calc(-4px * var(--ds-sf, 1));
|
|
23
|
+
padding-inline: calc(4px * var(--ds-sf, 1));
|
|
24
|
+
border-radius: var(--ds-radius);
|
|
18
25
|
cursor: pointer;
|
|
19
26
|
user-select: none;
|
|
20
27
|
list-style: none;
|
|
21
28
|
outline: none;
|
|
22
29
|
}
|
|
23
|
-
|
|
24
30
|
summary::-webkit-details-marker {
|
|
25
31
|
display: none;
|
|
26
32
|
}
|
|
33
|
+
summary:hover { background: var(--ds-row-fill-hover, var(--ds-fill)); }
|
|
34
|
+
summary:focus-visible { outline: 2px solid var(--ds-focus-ring); outline-offset: -2px; }
|
|
27
35
|
|
|
28
36
|
.summaryRow {
|
|
29
|
-
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: flex-end;
|
|
39
|
+
gap: calc(4px * var(--ds-sf, 1));
|
|
40
|
+
min-height: var(--ds-unit);
|
|
41
|
+
line-height: var(--ds-type-lineheight-default);
|
|
30
42
|
}
|
|
43
|
+
.summaryText { flex: 1 1 auto; min-width: 0; }
|
|
31
44
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
.chevron {
|
|
46
|
+
flex: 0 0 auto;
|
|
47
|
+
color: var(--ds-title-color);
|
|
35
48
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
details[open] .chevron { transform: rotate(180deg); }
|
|
50
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
51
|
+
.chevron { transition: transform 140ms ease; }
|
|
39
52
|
}
|
|
40
53
|
|
|
41
54
|
.detailsBody {
|
|
42
|
-
padding
|
|
55
|
+
padding: 0;
|
|
43
56
|
}
|
|
44
57
|
|
|
45
58
|
.detailsText {
|
|
46
59
|
display: block;
|
|
47
60
|
white-space: normal;
|
|
48
|
-
text-align:
|
|
61
|
+
text-align: start;
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
:host([control="slotted"]) { width: 100%; }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* on the grid lines; today is a red disc nine tenths of a square across.
|
|
7
7
|
*
|
|
8
8
|
* A picker is a field's face: one control high at the foot of its square,
|
|
9
|
-
*
|
|
9
|
+
* as wide as its words (it hugs them, as a button does), its words 4px in and the chevron-down icon
|
|
10
10
|
* (16px, 2px from the end) at its end; a range is one value. Its month opens on the menu's frame, half a square from
|
|
11
11
|
* the field: a 1px line, half a square inside it, no shadow, so eight squares
|
|
12
12
|
* wide. Inside, on whole squares: the first and last day to type (each with
|
|
@@ -93,9 +93,9 @@
|
|
|
93
93
|
.nav:hover:not(:disabled) { background: var(--ds-fill); color: var(--ds-text-color); }
|
|
94
94
|
:host(:dir(rtl)) .nav > ds-icon { transform: scaleX(-1); }
|
|
95
95
|
|
|
96
|
-
/* The title as a button: pressing it travels up to the months of the year,
|
|
97
|
-
* One control high at the square's foot, the words on the sixteen where the
|
|
98
|
-
* pointer filling it 4px past them. */
|
|
96
|
+
/* The title as a plain button, its words alone: pressing it travels up to the months of the year,
|
|
97
|
+
* then to twelve years. One control high at the square's foot, the words on the sixteen where the
|
|
98
|
+
* title stands, the pointer filling it 4px past them at each side. */
|
|
99
99
|
.title-button {
|
|
100
100
|
display: inline-flex;
|
|
101
101
|
flex: 0 1 auto;
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
max-width: 100%;
|
|
105
105
|
height: var(--ds-control-height);
|
|
106
106
|
margin: 0 0 0 calc(-4px * var(--ds-sf, 1));
|
|
107
|
-
padding: 0
|
|
107
|
+
padding: 0 calc(4px * var(--ds-sf, 1));
|
|
108
108
|
border: 0;
|
|
109
109
|
border-radius: var(--ds-radius);
|
|
110
110
|
background: transparent;
|
|
@@ -115,11 +115,10 @@
|
|
|
115
115
|
letter-spacing: inherit;
|
|
116
116
|
cursor: pointer;
|
|
117
117
|
}
|
|
118
|
-
:host(:dir(rtl)) .title-button { margin: 0 calc(-4px * var(--ds-sf, 1)) 0 0;
|
|
118
|
+
:host(:dir(rtl)) .title-button { margin: 0 calc(-4px * var(--ds-sf, 1)) 0 0; }
|
|
119
119
|
.title-button:hover { background: var(--ds-fill); }
|
|
120
120
|
.title-button:focus-visible { outline: 2px solid var(--ds-focus-ring); outline-offset: -2px; }
|
|
121
121
|
.title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
122
|
-
.title-button > ds-icon { flex: 0 0 auto; color: var(--ds-title-color); }
|
|
123
122
|
|
|
124
123
|
/* The months of a year, or twelve years: cells whole squares wide, three across a narrow month
|
|
125
124
|
* and four across a wider one, each row one square, one square apart. The area keeps the days'
|
|
@@ -170,12 +169,12 @@
|
|
|
170
169
|
.pick[data-selected] .pick-mark { background: var(--ds-calendar-selected); color: var(--ds-calendar-selected-ink); }
|
|
171
170
|
.pick:disabled { color: var(--ds-title-color); cursor: default; opacity: 0.5; }
|
|
172
171
|
|
|
173
|
-
/* Clear: a button one control high
|
|
172
|
+
/* Clear, only while something is chosen: a button one control high, centred on the square right under the dates. */
|
|
174
173
|
.foot {
|
|
175
174
|
display: flex;
|
|
176
175
|
align-items: flex-end;
|
|
176
|
+
justify-content: center;
|
|
177
177
|
height: var(--ds-unit);
|
|
178
|
-
margin-block-start: var(--ds-unit);
|
|
179
178
|
}
|
|
180
179
|
|
|
181
180
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -378,8 +377,8 @@
|
|
|
378
377
|
|
|
379
378
|
/* The picker: a field that opens the small month. */
|
|
380
379
|
:host([picker]) {
|
|
381
|
-
--ds-calendar-picker-width: calc(10 * var(--ds-unit));
|
|
382
380
|
display: inline-flex;
|
|
381
|
+
max-width: 100%;
|
|
383
382
|
align-items: flex-end;
|
|
384
383
|
vertical-align: bottom;
|
|
385
384
|
height: var(--ds-unit);
|
|
@@ -389,7 +388,8 @@
|
|
|
389
388
|
display: inline-flex;
|
|
390
389
|
align-items: center;
|
|
391
390
|
gap: calc(4px * var(--ds-sf, 1));
|
|
392
|
-
width: var(--ds-calendar-picker-width);
|
|
391
|
+
width: var(--ds-calendar-picker-width, max-content);
|
|
392
|
+
max-width: 100%;
|
|
393
393
|
padding-inline: calc(4px * var(--ds-sf, 1)) calc(2px * var(--ds-sf, 1));
|
|
394
394
|
text-align: start;
|
|
395
395
|
cursor: pointer;
|
package/DS1/react/accordion.ts
CHANGED
|
@@ -27,7 +27,7 @@ export const Accordion = forwardRef<AccordionElement, AccordionProps>(function A
|
|
|
27
27
|
ref: (element: AccordionElement | null) => {host.current = element; if (typeof ref === "function") ref(element); else if (ref) ref.current = element;},
|
|
28
28
|
}, h("ds-button", {slot: "trigger", control: "slotted", choice: true, disabled},
|
|
29
29
|
h("button", {type: "button", role: triggerRole, disabled, "aria-expanded": expanded, "aria-controls": id}, summary,
|
|
30
|
-
h("ds-icon", {type:
|
|
30
|
+
h("ds-icon", {type: "chevron-down", size: "large", "aria-hidden": "true", style: {marginInlineStart: "auto", flex: "0 0 auto", color: "var(--ds-title-color)", transform: expanded ? "rotate(180deg)" : undefined}}))),
|
|
31
31
|
actions == null ? null : h("div", {slot: "actions"}, actions),
|
|
32
32
|
h("div", {slot: "details", id, hidden: !expanded}, children));
|
|
33
33
|
});
|
package/DS1/x-icon/warning.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path
|
|
2
|
+
<path d="M7.5 3.3H8.5V10.3H7.5V3.3ZM7.5 11.3H8.5V12.3H7.5V11.3Z" fill="currentColor"/>
|
|
3
3
|
</svg>
|
|
@@ -10,5 +10,5 @@ export const toastIcons = {
|
|
|
10
10
|
"check": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M6.68649 11.884L12.443 6.13601L11.736 5.42715L6.68835 10.4827L4.26399 8.0501L3.55696 8.74525L6.68649 11.884Z\" fill=\"currentColor\"/>\n</svg>\n",
|
|
11
11
|
"close": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12.1215 4.58087L8.70453 7.99397L12.1176 11.4169L11.4106 12.112L7.99847 8.69108L4.58636 12.112L3.87836 11.4031L7.29535 7.99005L3.88226 4.56716L4.58929 3.87201L8.0014 7.29294L11.4145 3.87201L12.1215 4.58087Z\" fill=\"currentColor\"/>\n</svg>\n",
|
|
12
12
|
"notifications": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M4.5 11.5V7.5C4.5 5.567 6.067 4 8 4C9.933 4 11.5 5.567 11.5 7.5V11.5M3 11.5H13M8 2.5V4M6.5 13.5H9.5\" stroke=\"currentColor\" stroke-width=\"0.92\"/>\n</svg>\n",
|
|
13
|
-
"warning": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path
|
|
13
|
+
"warning": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.5 3.3H8.5V10.3H7.5V3.3ZM7.5 11.3H8.5V12.3H7.5V11.3Z\" fill=\"currentColor\"/>\n</svg>\n",
|
|
14
14
|
};
|
|
@@ -38,6 +38,12 @@ export declare class Tooltip extends LitElement {
|
|
|
38
38
|
private releaseDescription;
|
|
39
39
|
private describe;
|
|
40
40
|
updated(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Keeps the bubble inside the window, as the page's tooltips do (0-face/tooltips.ts): four
|
|
43
|
+
* pixels from its edges, and below the control when there is no room above (or above when
|
|
44
|
+
* `placement="bottom"` has no room below). A tooltip at a frame's edge is never cut short.
|
|
45
|
+
*/
|
|
46
|
+
private place;
|
|
41
47
|
render(): import("lit").TemplateResult<1>;
|
|
42
48
|
}
|
|
43
49
|
declare global {
|