@0001-labs/design-system-1 0.3.0-alpha.22 → 0.3.0-alpha.24
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/bento.ts +13 -4
- package/DS1/0-face/translations/da.json +5 -0
- package/DS1/0-face/translations/de.json +5 -0
- package/DS1/0-face/translations/en.json +5 -0
- package/DS1/0-face/translations/es.json +5 -0
- package/DS1/0-face/translations/fi.json +5 -0
- package/DS1/0-face/translations/fr.json +5 -0
- package/DS1/0-face/translations/is.json +5 -0
- package/DS1/0-face/translations/it.json +5 -0
- package/DS1/0-face/translations/ja.json +5 -0
- package/DS1/0-face/translations/ko.json +5 -0
- package/DS1/0-face/translations/nb.json +5 -0
- package/DS1/0-face/translations/pt-BR.json +5 -0
- package/DS1/0-face/translations/pt.json +5 -0
- package/DS1/0-face/translations/sv.json +5 -0
- package/DS1/0-face/translations/zh.json +5 -0
- package/DS1/1-root/bento.css +25 -12
- package/DS1/1-root/cjk.css +1 -1
- package/DS1/1-root/controls.css +22 -32
- package/DS1/1-root/fonts.css +1 -1
- package/DS1/1-root/one.css +1 -1
- package/DS1/1-root/one.semantic.css +1 -1
- package/DS1/2-core/ds-switch.ts +2 -2
- package/DS1/2-core/styles/ds-checkbox.css +11 -7
- package/DS1/2-core/styles/ds-radio.css +5 -2
- package/DS1/2-core/styles/ds-switch.css +7 -23
- package/DS1/3-unit/ds-bento.ts +8 -1
- package/DS1/3-unit/ds-calendar.ts +232 -17
- package/DS1/3-unit/styles/ds-bento.css +16 -10
- package/DS1/3-unit/styles/ds-calendar.css +116 -14
- package/dist/0-face/bento.d.ts +6 -2
- package/dist/0-face/bento.d.ts.map +1 -1
- package/dist/0-face/bento.js +12 -4
- package/dist/0-face/translations/da.json +5 -0
- package/dist/0-face/translations/de.json +5 -0
- package/dist/0-face/translations/en.json +5 -0
- package/dist/0-face/translations/es.json +5 -0
- package/dist/0-face/translations/fi.json +5 -0
- package/dist/0-face/translations/fr.json +5 -0
- package/dist/0-face/translations/is.json +5 -0
- package/dist/0-face/translations/it.json +5 -0
- package/dist/0-face/translations/ja.json +5 -0
- package/dist/0-face/translations/ko.json +5 -0
- package/dist/0-face/translations/nb.json +5 -0
- package/dist/0-face/translations/pt-BR.json +5 -0
- package/dist/0-face/translations/pt.json +5 -0
- package/dist/0-face/translations/sv.json +5 -0
- package/dist/0-face/translations/zh.json +5 -0
- package/dist/2-core/ds-switch.d.ts +2 -2
- package/dist/2-core/ds-switch.d.ts.map +1 -1
- package/dist/2-core/ds-switch.js +2 -2
- package/dist/3-unit/ds-bento.d.ts +12 -0
- package/dist/3-unit/ds-bento.d.ts.map +1 -1
- package/dist/3-unit/ds-bento.js +4 -1
- package/dist/3-unit/ds-calendar.d.ts +47 -2
- package/dist/3-unit/ds-calendar.d.ts.map +1 -1
- package/dist/3-unit/ds-calendar.js +227 -18
- package/dist/design-system-1.bundle.js +252 -28
- package/dist/design-system-1.bundle.js.map +1 -1
- package/dist/design-system-1.bundle.min.js +1623 -1477
- package/dist/design-system-1.bundle.min.js.map +1 -1
- package/dist/{shared-words-DAVSET4Z.js → shared-words-BDyeT1zO.js} +89 -14
- package/dist/shared-words-BDyeT1zO.js.map +1 -0
- package/dist/{shared-words-CyZYc_De.js → shared-words-LuszeoCp.js} +76 -1
- package/dist/shared-words-LuszeoCp.js.map +1 -0
- package/package.json +1 -1
- package/dist/shared-words-CyZYc_De.js.map +0 -1
- package/dist/shared-words-DAVSET4Z.js.map +0 -1
package/DS1/0-face/bento.ts
CHANGED
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
* A tile's `data-place` is its square across, its square down, its width and
|
|
20
20
|
* its height, in whole squares counted from 0. Tiles are placed a square
|
|
21
21
|
* apart; a tile a square away from another, with the two overlapping along
|
|
22
|
-
* that side, reaches towards it.
|
|
22
|
+
* that side, reaches towards it. A tile can have a place per layout,
|
|
23
|
+
* `data-place-phone="0 0 12 7"`, taken while the bento says
|
|
24
|
+
* `data-layout="phone"`; the page sets the layout and the columns for it.
|
|
23
25
|
*/
|
|
24
26
|
|
|
25
27
|
/** A tile's place in squares: across, down, wide, high. */
|
|
@@ -51,10 +53,17 @@ export function bentoReach(places: readonly BentoPlace[]): BentoReach[] {
|
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
/**
|
|
56
|
+
/** A tile's place in the bento's layout: `data-place-<layout>` where the bento names one and the tile has it, else `data-place`. */
|
|
57
|
+
export function tilePlace(tile: HTMLElement, layout = ""): BentoPlace | undefined {
|
|
58
|
+
const own = layout ? tile.getAttribute(`data-place-${layout}`) : null;
|
|
59
|
+
return bentoPlace(own ?? tile.dataset.place);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Places one squares bento's tiles: their squares and their reach, as custom properties. The bento's `data-layout` (or `layout`) picks each tile's place for that layout. */
|
|
55
63
|
export function placeBento(bento: HTMLElement): void {
|
|
64
|
+
const layout = bento.dataset.layout ?? bento.getAttribute("layout") ?? "";
|
|
56
65
|
const tiles = [...bento.children].filter((child): child is HTMLElement => child instanceof HTMLElement && !child.hidden);
|
|
57
|
-
const placed = tiles.map(tile => ({ tile, place:
|
|
66
|
+
const placed = tiles.map(tile => ({ tile, place: tilePlace(tile, layout) })).filter((entry): entry is { tile: HTMLElement; place: BentoPlace } => !!entry.place);
|
|
58
67
|
const reach = bentoReach(placed.map(entry => entry.place));
|
|
59
68
|
placed.forEach(({ tile, place: [x, y, w, h] }, index) => {
|
|
60
69
|
const sides = reach[index]!;
|
|
@@ -77,7 +86,7 @@ export function placeBentos(root: ParentNode = document): () => void {
|
|
|
77
86
|
});
|
|
78
87
|
for (const bento of bentos) {
|
|
79
88
|
placeBento(bento);
|
|
80
|
-
observer.observe(bento, { childList: true, subtree: false, attributes: true, attributeFilter: ["data-place", "hidden"] });
|
|
89
|
+
observer.observe(bento, { childList: true, subtree: false, attributes: true, attributeFilter: ["data-place", "data-layout", "hidden"] });
|
|
81
90
|
for (const tile of bento.children) observer.observe(tile, { attributes: true, attributeFilter: ["data-place", "hidden"] });
|
|
82
91
|
}
|
|
83
92
|
return () => observer.disconnect();
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Page Down",
|
|
112
112
|
"Previous month": "Forrige måned",
|
|
113
113
|
"Next month": "Næste måned",
|
|
114
|
+
"Previous year": "Forrige år",
|
|
115
|
+
"Next year": "Næste år",
|
|
116
|
+
"Earlier years": "Tidligere år",
|
|
117
|
+
"Later years": "Senere år",
|
|
118
|
+
"Choose a month and year": "Vælg måned og år",
|
|
114
119
|
"Choose a date": "Vælg en dato",
|
|
115
120
|
"Date": "Dato",
|
|
116
121
|
"W{week}": "U{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Bild ab",
|
|
112
112
|
"Previous month": "Vorheriger Monat",
|
|
113
113
|
"Next month": "Nächster Monat",
|
|
114
|
+
"Previous year": "Vorheriges Jahr",
|
|
115
|
+
"Next year": "Nächstes Jahr",
|
|
116
|
+
"Earlier years": "Frühere Jahre",
|
|
117
|
+
"Later years": "Spätere Jahre",
|
|
118
|
+
"Choose a month and year": "Monat und Jahr wählen",
|
|
114
119
|
"Choose a date": "Datum wählen",
|
|
115
120
|
"Date": "Datum",
|
|
116
121
|
"W{week}": "KW{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "PgDn",
|
|
112
112
|
"Previous month": "Previous month",
|
|
113
113
|
"Next month": "Next month",
|
|
114
|
+
"Previous year": "Previous year",
|
|
115
|
+
"Next year": "Next year",
|
|
116
|
+
"Earlier years": "Earlier years",
|
|
117
|
+
"Later years": "Later years",
|
|
118
|
+
"Choose a month and year": "Choose a month and year",
|
|
114
119
|
"Choose a date": "Choose a date",
|
|
115
120
|
"Date": "Date",
|
|
116
121
|
"W{week}": "W{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Av Pág",
|
|
112
112
|
"Previous month": "Mes anterior",
|
|
113
113
|
"Next month": "Mes siguiente",
|
|
114
|
+
"Previous year": "Año anterior",
|
|
115
|
+
"Next year": "Año siguiente",
|
|
116
|
+
"Earlier years": "Años anteriores",
|
|
117
|
+
"Later years": "Años siguientes",
|
|
118
|
+
"Choose a month and year": "Elegir mes y año",
|
|
114
119
|
"Choose a date": "Elegir una fecha",
|
|
115
120
|
"Date": "Fecha",
|
|
116
121
|
"W{week}": "S{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Page Down",
|
|
112
112
|
"Previous month": "Edellinen kuukausi",
|
|
113
113
|
"Next month": "Seuraava kuukausi",
|
|
114
|
+
"Previous year": "Edellinen vuosi",
|
|
115
|
+
"Next year": "Seuraava vuosi",
|
|
116
|
+
"Earlier years": "Aiemmat vuodet",
|
|
117
|
+
"Later years": "Myöhemmät vuodet",
|
|
118
|
+
"Choose a month and year": "Valitse kuukausi ja vuosi",
|
|
114
119
|
"Choose a date": "Valitse päivämäärä",
|
|
115
120
|
"Date": "Päivämäärä",
|
|
116
121
|
"W{week}": "Vk{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Page suiv.",
|
|
112
112
|
"Previous month": "Mois précédent",
|
|
113
113
|
"Next month": "Mois suivant",
|
|
114
|
+
"Previous year": "Année précédente",
|
|
115
|
+
"Next year": "Année suivante",
|
|
116
|
+
"Earlier years": "Années précédentes",
|
|
117
|
+
"Later years": "Années suivantes",
|
|
118
|
+
"Choose a month and year": "Choisir le mois et l’année",
|
|
114
119
|
"Choose a date": "Choisir une date",
|
|
115
120
|
"Date": "Date",
|
|
116
121
|
"W{week}": "S{week}",
|
|
@@ -104,6 +104,11 @@
|
|
|
104
104
|
"key.pagedown": "Page Down",
|
|
105
105
|
"Previous month": "Fyrri mánuður",
|
|
106
106
|
"Next month": "Næsti mánuður",
|
|
107
|
+
"Previous year": "Fyrra ár",
|
|
108
|
+
"Next year": "Næsta ár",
|
|
109
|
+
"Earlier years": "Fyrri ár",
|
|
110
|
+
"Later years": "Síðari ár",
|
|
111
|
+
"Choose a month and year": "Velja mánuð og ár",
|
|
107
112
|
"Choose a date": "Veldu dagsetningu",
|
|
108
113
|
"Date": "Dagsetning",
|
|
109
114
|
"W{week}": "V{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Pag giù",
|
|
112
112
|
"Previous month": "Mese precedente",
|
|
113
113
|
"Next month": "Mese successivo",
|
|
114
|
+
"Previous year": "Anno precedente",
|
|
115
|
+
"Next year": "Anno successivo",
|
|
116
|
+
"Earlier years": "Anni precedenti",
|
|
117
|
+
"Later years": "Anni successivi",
|
|
118
|
+
"Choose a month and year": "Scegli mese e anno",
|
|
114
119
|
"Choose a date": "Scegli una data",
|
|
115
120
|
"Date": "Data",
|
|
116
121
|
"W{week}": "S{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Page Down",
|
|
112
112
|
"Previous month": "前の月",
|
|
113
113
|
"Next month": "次の月",
|
|
114
|
+
"Previous year": "前の年",
|
|
115
|
+
"Next year": "次の年",
|
|
116
|
+
"Earlier years": "前の12年",
|
|
117
|
+
"Later years": "次の12年",
|
|
118
|
+
"Choose a month and year": "年と月を選択",
|
|
114
119
|
"Choose a date": "日付を選択",
|
|
115
120
|
"Date": "日付",
|
|
116
121
|
"W{week}": "第{week}週",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Page Down",
|
|
112
112
|
"Previous month": "이전 달",
|
|
113
113
|
"Next month": "다음 달",
|
|
114
|
+
"Previous year": "이전 연도",
|
|
115
|
+
"Next year": "다음 연도",
|
|
116
|
+
"Earlier years": "이전 연도들",
|
|
117
|
+
"Later years": "다음 연도들",
|
|
118
|
+
"Choose a month and year": "연도와 월 선택",
|
|
114
119
|
"Choose a date": "날짜 선택",
|
|
115
120
|
"Date": "날짜",
|
|
116
121
|
"W{week}": "{week}주",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Page Down",
|
|
112
112
|
"Previous month": "Forrige måned",
|
|
113
113
|
"Next month": "Neste måned",
|
|
114
|
+
"Previous year": "Forrige år",
|
|
115
|
+
"Next year": "Neste år",
|
|
116
|
+
"Earlier years": "Tidligere år",
|
|
117
|
+
"Later years": "Senere år",
|
|
118
|
+
"Choose a month and year": "Velg måned og år",
|
|
114
119
|
"Choose a date": "Velg en dato",
|
|
115
120
|
"Date": "Dato",
|
|
116
121
|
"W{week}": "U{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Page Down",
|
|
112
112
|
"Previous month": "Mês anterior",
|
|
113
113
|
"Next month": "Próximo mês",
|
|
114
|
+
"Previous year": "Ano anterior",
|
|
115
|
+
"Next year": "Próximo ano",
|
|
116
|
+
"Earlier years": "Anos anteriores",
|
|
117
|
+
"Later years": "Anos seguintes",
|
|
118
|
+
"Choose a month and year": "Escolher mês e ano",
|
|
114
119
|
"Choose a date": "Escolher uma data",
|
|
115
120
|
"Date": "Data",
|
|
116
121
|
"W{week}": "S{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Page Down",
|
|
112
112
|
"Previous month": "Mês anterior",
|
|
113
113
|
"Next month": "Mês seguinte",
|
|
114
|
+
"Previous year": "Ano anterior",
|
|
115
|
+
"Next year": "Ano seguinte",
|
|
116
|
+
"Earlier years": "Anos anteriores",
|
|
117
|
+
"Later years": "Anos seguintes",
|
|
118
|
+
"Choose a month and year": "Escolher mês e ano",
|
|
114
119
|
"Choose a date": "Escolher uma data",
|
|
115
120
|
"Date": "Data",
|
|
116
121
|
"W{week}": "S{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Page Down",
|
|
112
112
|
"Previous month": "Föregående månad",
|
|
113
113
|
"Next month": "Nästa månad",
|
|
114
|
+
"Previous year": "Föregående år",
|
|
115
|
+
"Next year": "Nästa år",
|
|
116
|
+
"Earlier years": "Tidigare år",
|
|
117
|
+
"Later years": "Senare år",
|
|
118
|
+
"Choose a month and year": "Välj månad och år",
|
|
114
119
|
"Choose a date": "Välj ett datum",
|
|
115
120
|
"Date": "Datum",
|
|
116
121
|
"W{week}": "V{week}",
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
"key.pagedown": "Page Down",
|
|
112
112
|
"Previous month": "上个月",
|
|
113
113
|
"Next month": "下个月",
|
|
114
|
+
"Previous year": "上一年",
|
|
115
|
+
"Next year": "下一年",
|
|
116
|
+
"Earlier years": "更早的年份",
|
|
117
|
+
"Later years": "更晚的年份",
|
|
118
|
+
"Choose a month and year": "选择月份和年份",
|
|
114
119
|
"Choose a date": "选择日期",
|
|
115
120
|
"Date": "日期",
|
|
116
121
|
"W{week}": "第{week}周",
|
package/DS1/1-root/bento.css
CHANGED
|
@@ -24,16 +24,24 @@
|
|
|
24
24
|
* data-rows="2" a tile two rows high (to 6)
|
|
25
25
|
* data-place="0 0 15 7" a tile's square, width and height in squares
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* `data-fit` lets a squares bento's columns share a measure other than its
|
|
28
|
+
* squares (each tile still reaches a quarter square, so the gap is a column
|
|
29
|
+
* less half a square); `data-layout` (say `phone`) makes `placeBento()` take each tile's
|
|
30
|
+
* `data-place-phone` where it has one, a place per layout.
|
|
31
|
+
*
|
|
32
|
+
* Tokens: `--ds-bento-unit` (the square, `--ds-unit` by default),
|
|
33
|
+
* `--ds-bento-gap` (half of it), `--ds-bento-columns`, `--ds-bento-row`,
|
|
34
|
+
* `--ds-bento-padding` (a squares tile that is not a card, one square), and
|
|
35
|
+
* on a tile `--ds-bento-span`, `--ds-bento-rows`.
|
|
29
36
|
*/
|
|
30
37
|
|
|
31
38
|
.ds-bento {
|
|
32
|
-
--ds-bento-
|
|
39
|
+
--ds-bento-unit: var(--ds-unit);
|
|
40
|
+
--ds-bento-gap: calc(var(--ds-bento-unit) / 2);
|
|
33
41
|
box-sizing: border-box;
|
|
34
42
|
display: grid;
|
|
35
43
|
grid-template-columns: repeat(var(--ds-bento-columns, 3), minmax(0, 1fr));
|
|
36
|
-
grid-auto-rows: minmax(var(--ds-bento-row, calc(10 * var(--ds-unit))), auto);
|
|
44
|
+
grid-auto-rows: minmax(var(--ds-bento-row, calc(10 * var(--ds-bento-unit))), auto);
|
|
37
45
|
grid-auto-flow: row dense;
|
|
38
46
|
gap: var(--ds-bento-gap);
|
|
39
47
|
margin: 0;
|
|
@@ -69,15 +77,20 @@
|
|
|
69
77
|
|
|
70
78
|
/* Squares: every tile on whole squares, a square apart, its surface a quarter square nearer each neighbour. */
|
|
71
79
|
.ds-bento[data-squares] {
|
|
72
|
-
--ds-bento-reach: calc(var(--ds-unit) / 4);
|
|
80
|
+
--ds-bento-reach: calc(var(--ds-bento-unit) / 4);
|
|
73
81
|
/* Exactly its squares wide: each column one square. */
|
|
74
|
-
width: calc(var(--ds-bento-columns, 48) * var(--ds-unit));
|
|
82
|
+
width: calc(var(--ds-bento-columns, 48) * var(--ds-bento-unit));
|
|
75
83
|
max-width: none;
|
|
76
|
-
grid-template-columns: repeat(var(--ds-bento-columns, 48), var(--ds-unit));
|
|
77
|
-
grid-auto-rows: var(--ds-unit);
|
|
84
|
+
grid-template-columns: repeat(var(--ds-bento-columns, 48), var(--ds-bento-unit));
|
|
85
|
+
grid-auto-rows: var(--ds-bento-unit);
|
|
78
86
|
grid-auto-flow: row;
|
|
79
87
|
gap: 0;
|
|
80
88
|
}
|
|
89
|
+
/* Fit: the columns share a measure narrower (or wider) than the squares, the rows still one square. */
|
|
90
|
+
.ds-bento[data-squares][data-fit] {
|
|
91
|
+
width: auto;
|
|
92
|
+
grid-template-columns: repeat(var(--ds-bento-columns, 48), minmax(0, 1fr));
|
|
93
|
+
}
|
|
81
94
|
.ds-bento[data-squares] > * {
|
|
82
95
|
--ds-bento-inset-top: calc(var(--ds-bento-reach) * var(--ds-bento-top, 0));
|
|
83
96
|
--ds-bento-inset-end: calc(var(--ds-bento-reach) * var(--ds-bento-end, 0));
|
|
@@ -90,8 +103,8 @@
|
|
|
90
103
|
/* A card grows its own padding by the reach (card.css); any other tile is padded here, a square inside. */
|
|
91
104
|
.ds-bento[data-squares] > :not(.ds-card, ds-card) {
|
|
92
105
|
padding:
|
|
93
|
-
calc(var(--ds-unit) + var(--ds-bento-inset-top))
|
|
94
|
-
calc(var(--ds-unit) + var(--ds-bento-inset-end))
|
|
95
|
-
calc(var(--ds-unit) + var(--ds-bento-inset-bottom))
|
|
96
|
-
calc(var(--ds-unit) + var(--ds-bento-inset-start));
|
|
106
|
+
calc(var(--ds-bento-padding, var(--ds-bento-unit)) + var(--ds-bento-inset-top))
|
|
107
|
+
calc(var(--ds-bento-padding, var(--ds-bento-unit)) + var(--ds-bento-inset-end))
|
|
108
|
+
calc(var(--ds-bento-padding, var(--ds-bento-unit)) + var(--ds-bento-inset-bottom))
|
|
109
|
+
calc(var(--ds-bento-padding, var(--ds-bento-unit)) + var(--ds-bento-inset-start));
|
|
97
110
|
}
|
package/DS1/1-root/cjk.css
CHANGED
package/DS1/1-root/controls.css
CHANGED
|
@@ -226,8 +226,10 @@ textarea.ds-input {
|
|
|
226
226
|
|
|
227
227
|
/*
|
|
228
228
|
* `.ds-checkbox` and `.ds-radio` are the `ds-checkbox` and `ds-radio` elements'
|
|
229
|
-
* faces on a native `<input>`: one square on the field's
|
|
230
|
-
* line
|
|
229
|
+
* faces on a native `<input>`: a box one control (16px) square on the field's
|
|
230
|
+
* ground with a 1px line, standing as an icon does, on the lower sixteen at the
|
|
231
|
+
* start of its square, so it takes one square and the words begin on the next
|
|
232
|
+
* (Joachim, 19 October 2026). The checkbox has the corners of a control and fills with the accent,
|
|
231
233
|
* the check (`x-icon/check.svg`) in its ink; the radio is a circle with a dot
|
|
232
234
|
* half a square across in the text colour.
|
|
233
235
|
*/
|
|
@@ -238,10 +240,12 @@ textarea.ds-input {
|
|
|
238
240
|
display: inline-grid;
|
|
239
241
|
flex: 0 0 auto;
|
|
240
242
|
place-items: center;
|
|
241
|
-
vertical-align:
|
|
242
|
-
width: var(--ds-
|
|
243
|
-
height: var(--ds-
|
|
243
|
+
vertical-align: top;
|
|
244
|
+
width: var(--ds-control-height);
|
|
245
|
+
height: var(--ds-control-height);
|
|
244
246
|
margin: 0;
|
|
247
|
+
margin-block-start: calc(var(--ds-row-height) - var(--ds-control-height));
|
|
248
|
+
margin-inline-end: calc(var(--ds-row-height) - var(--ds-control-height));
|
|
245
249
|
padding: 0;
|
|
246
250
|
border: 1px solid var(--ds-border-color);
|
|
247
251
|
background: var(--ds-input-background);
|
|
@@ -267,13 +271,13 @@ textarea.ds-input {
|
|
|
267
271
|
}
|
|
268
272
|
|
|
269
273
|
.ds-checkbox::before {
|
|
270
|
-
width:
|
|
271
|
-
height:
|
|
274
|
+
width: var(--ds-control-height);
|
|
275
|
+
height: var(--ds-control-height);
|
|
272
276
|
mask: var(--ds-checkbox-mark) center / contain no-repeat;
|
|
273
277
|
}
|
|
274
278
|
|
|
275
279
|
.ds-checkbox:indeterminate::before {
|
|
276
|
-
width: calc(var(--ds-
|
|
280
|
+
width: calc(var(--ds-control-height) / 2);
|
|
277
281
|
height: calc(2px * var(--ds-sf));
|
|
278
282
|
mask: none;
|
|
279
283
|
}
|
|
@@ -284,8 +288,8 @@ textarea.ds-input {
|
|
|
284
288
|
}
|
|
285
289
|
|
|
286
290
|
.ds-radio::before {
|
|
287
|
-
width: calc(var(--ds-
|
|
288
|
-
height: calc(var(--ds-
|
|
291
|
+
width: calc(var(--ds-control-height) / 2);
|
|
292
|
+
height: calc(var(--ds-control-height) / 2);
|
|
289
293
|
border-radius: 50%;
|
|
290
294
|
}
|
|
291
295
|
|
|
@@ -297,8 +301,9 @@ textarea.ds-input {
|
|
|
297
301
|
/*
|
|
298
302
|
* `.ds-switch` is the `ds-switch` element's look on a native
|
|
299
303
|
* `<button role="switch" aria-checked>`: two control heights wide, its thumb
|
|
300
|
-
* one control high less a 2px inset, travelling one control height.
|
|
301
|
-
*
|
|
304
|
+
* one control high less a 2px inset, travelling one control height. A pill with a white
|
|
305
|
+
* round thumb, grey when off and the darker green when on, whatever the page's accent: the
|
|
306
|
+
* one switch (Joachim, 19 October 2026).
|
|
302
307
|
*/
|
|
303
308
|
|
|
304
309
|
.ds-switch {
|
|
@@ -314,9 +319,9 @@ textarea.ds-input {
|
|
|
314
319
|
margin: 0;
|
|
315
320
|
padding: calc(2px * var(--ds-sf));
|
|
316
321
|
border: 0;
|
|
317
|
-
border-radius: var(--ds-
|
|
322
|
+
border-radius: var(--ds-choice-unit);
|
|
318
323
|
background: var(--ds-fill);
|
|
319
|
-
color: var(--ds-
|
|
324
|
+
color: var(--ds-white);
|
|
320
325
|
cursor: pointer;
|
|
321
326
|
touch-action: manipulation;
|
|
322
327
|
}
|
|
@@ -326,35 +331,20 @@ textarea.ds-input {
|
|
|
326
331
|
display: block;
|
|
327
332
|
width: calc(var(--ds-choice-unit) - 4px * var(--ds-sf));
|
|
328
333
|
height: 100%;
|
|
329
|
-
border-radius:
|
|
330
|
-
background:
|
|
334
|
+
border-radius: 50%;
|
|
335
|
+
background: var(--ds-white);
|
|
331
336
|
transform: translateX(0);
|
|
332
337
|
transition: transform 140ms ease;
|
|
333
338
|
}
|
|
334
339
|
|
|
335
340
|
.ds-switch[aria-checked="true"] {
|
|
336
|
-
background: var(--ds-
|
|
337
|
-
color: var(--ds-button-text-color-on-accent);
|
|
341
|
+
background: var(--ds-switch-track-on);
|
|
338
342
|
}
|
|
339
343
|
|
|
340
344
|
.ds-switch[aria-checked="true"]::after {
|
|
341
345
|
transform: translateX(var(--ds-choice-unit));
|
|
342
346
|
}
|
|
343
347
|
|
|
344
|
-
.ds-switch--rounded {
|
|
345
|
-
border-radius: var(--ds-choice-unit);
|
|
346
|
-
color: var(--ds-white);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.ds-switch--rounded::after {
|
|
350
|
-
border-radius: 50%;
|
|
351
|
-
background: var(--ds-white);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.ds-switch--rounded[aria-checked="true"] {
|
|
355
|
-
background: var(--ds-switch-track-on);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
348
|
@media (prefers-reduced-motion: reduce) {
|
|
359
349
|
.ds-switch::after {
|
|
360
350
|
transition: none;
|
package/DS1/1-root/fonts.css
CHANGED
package/DS1/1-root/one.css
CHANGED
package/DS1/2-core/ds-switch.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { LitElement, html, unsafeCSS } from "lit";
|
|
|
2
2
|
import { define } from "../0-face/define";
|
|
3
3
|
import styles from "./styles/ds-switch.css?inline";
|
|
4
4
|
|
|
5
|
-
/** The
|
|
6
|
-
|
|
5
|
+
/** The switch: a pill with a white round thumb, grey when off and the darker green when on,
|
|
6
|
+
whatever the page's accent. The slotted button retains native activation and refs. */
|
|
7
7
|
export class Switch extends LitElement {
|
|
8
8
|
static styles = unsafeCSS(styles);
|
|
9
9
|
focus(options?: FocusOptions) { this.querySelector<HTMLButtonElement>(":scope > button")?.focus(options); }
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
@import "../../1-root/component-metrics.css";
|
|
2
2
|
|
|
3
|
+
/* One square, the box one control (16px) square on its lower sixteen at its start, as an icon
|
|
4
|
+
stands, so the words begin on the next square (Joachim, 19 October 2026). */
|
|
3
5
|
:host {
|
|
4
6
|
--ds-choice-unit: calc(var(--ds-1) * var(--ds-sf));
|
|
5
|
-
display: inline-
|
|
7
|
+
display: inline-grid;
|
|
8
|
+
align-items: end;
|
|
9
|
+
justify-items: start;
|
|
6
10
|
flex: 0 0 auto;
|
|
7
|
-
vertical-align:
|
|
11
|
+
vertical-align: top;
|
|
8
12
|
width: var(--ds-choice-unit);
|
|
9
13
|
height: var(--ds-choice-unit);
|
|
10
14
|
}
|
|
@@ -14,9 +18,9 @@
|
|
|
14
18
|
box-sizing: border-box !important;
|
|
15
19
|
display: grid !important;
|
|
16
20
|
place-items: center !important;
|
|
17
|
-
width:
|
|
21
|
+
width: var(--ds-control-height) !important;
|
|
18
22
|
min-width: 0 !important;
|
|
19
|
-
height:
|
|
23
|
+
height: var(--ds-control-height) !important;
|
|
20
24
|
min-height: 0 !important;
|
|
21
25
|
margin: 0 !important;
|
|
22
26
|
padding: 0 !important;
|
|
@@ -31,15 +35,15 @@
|
|
|
31
35
|
::slotted(input:checked), ::slotted(input:indeterminate) { background: var(--ds-accent-color) !important; }
|
|
32
36
|
::slotted(input)::before {
|
|
33
37
|
content: "";
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
38
|
+
width: var(--ds-control-height);
|
|
39
|
+
height: var(--ds-control-height);
|
|
36
40
|
background: currentColor;
|
|
37
41
|
mask: var(--ds-checkbox-mark) center / contain no-repeat;
|
|
38
42
|
opacity: 0;
|
|
39
43
|
}
|
|
40
44
|
::slotted(input:checked)::before { opacity: 1; }
|
|
41
45
|
::slotted(input:indeterminate)::before {
|
|
42
|
-
width: calc(var(--ds-
|
|
46
|
+
width: calc(var(--ds-control-height) / 2);
|
|
43
47
|
height: calc(2px * var(--ds-sf));
|
|
44
48
|
mask: none;
|
|
45
49
|
opacity: 1;
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
height: var(--ds-unit);
|
|
10
10
|
}
|
|
11
11
|
:host([hidden]) { display: none !important; }
|
|
12
|
+
/* A plain radio as the checkbox: a 16px circle on its square's lower sixteen, at its start. */
|
|
13
|
+
:host(:not([choice])) { display: inline-grid; align-items: end; justify-items: start; vertical-align: top; }
|
|
14
|
+
:host(:not([choice])) ::slotted(input[type="radio"]) { width: var(--ds-control-height) !important; height: var(--ds-control-height) !important; }
|
|
12
15
|
::slotted(input[type="radio"]) {
|
|
13
16
|
appearance: none !important;
|
|
14
17
|
box-sizing: border-box !important;
|
|
@@ -30,8 +33,8 @@
|
|
|
30
33
|
::slotted(input[hidden]) { display: none !important; }
|
|
31
34
|
::slotted(input)::before {
|
|
32
35
|
content: "";
|
|
33
|
-
width: calc(var(--ds-
|
|
34
|
-
height: calc(var(--ds-
|
|
36
|
+
width: calc(var(--ds-control-height) / 2);
|
|
37
|
+
height: calc(var(--ds-control-height) / 2);
|
|
35
38
|
border-radius: 50%;
|
|
36
39
|
background: currentColor;
|
|
37
40
|
opacity: 0;
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
padding: calc(2px * var(--ds-sf)) !important;
|
|
22
22
|
margin: 0 !important;
|
|
23
23
|
border: 0 !important;
|
|
24
|
-
border-radius: var(--ds-
|
|
25
|
-
corner-shape:
|
|
24
|
+
border-radius: var(--ds-choice-unit) !important;
|
|
25
|
+
corner-shape: round !important;
|
|
26
26
|
background: var(--ds-fill) !important;
|
|
27
|
-
color: var(--ds-
|
|
27
|
+
color: var(--ds-white) !important;
|
|
28
28
|
box-shadow: none !important;
|
|
29
29
|
cursor: pointer !important;
|
|
30
30
|
touch-action: manipulation;
|
|
@@ -34,32 +34,16 @@
|
|
|
34
34
|
display: block;
|
|
35
35
|
width: calc(var(--ds-choice-unit) - 4px * var(--ds-sf));
|
|
36
36
|
height: 100%;
|
|
37
|
-
border-radius:
|
|
38
|
-
corner-shape:
|
|
39
|
-
background:
|
|
37
|
+
border-radius: 50%;
|
|
38
|
+
corner-shape: round;
|
|
39
|
+
background: var(--ds-white);
|
|
40
40
|
transform: translateX(0);
|
|
41
41
|
transition: transform 140ms ease;
|
|
42
42
|
}
|
|
43
43
|
::slotted(button[aria-checked="true"]) {
|
|
44
|
-
background: var(--ds-
|
|
45
|
-
color: var(--ds-button-text-color-on-accent) !important;
|
|
44
|
+
background: var(--ds-switch-track-on) !important;
|
|
46
45
|
}
|
|
47
46
|
::slotted(button[aria-checked="true"])::after { transform: translateX(var(--ds-choice-unit)); }
|
|
48
47
|
::slotted(button:focus-visible) { outline: 2px solid var(--ds-focus-ring) !important; outline-offset: 1px !important; }
|
|
49
48
|
::slotted(button:disabled) { cursor: default !important; opacity: .5 !important; }
|
|
50
49
|
@media (prefers-reduced-motion: reduce) { ::slotted(button)::after { transition: none; } }
|
|
51
|
-
|
|
52
|
-
/* Rounded switches keep their shape and white thumb independently of page accents. */
|
|
53
|
-
:host([rounded]) ::slotted(button) {
|
|
54
|
-
border-radius: var(--ds-choice-unit) !important;
|
|
55
|
-
corner-shape: round !important;
|
|
56
|
-
color: var(--ds-white) !important;
|
|
57
|
-
}
|
|
58
|
-
:host([rounded]) ::slotted(button)::after {
|
|
59
|
-
border-radius: 50%;
|
|
60
|
-
corner-shape: round;
|
|
61
|
-
background: var(--ds-white);
|
|
62
|
-
}
|
|
63
|
-
:host([rounded]) ::slotted(button[aria-checked="true"]) {
|
|
64
|
-
background: var(--ds-switch-track-on) !important;
|
|
65
|
-
}
|
package/DS1/3-unit/ds-bento.ts
CHANGED
|
@@ -16,12 +16,18 @@ export class Bento extends LitElement {
|
|
|
16
16
|
static properties = {
|
|
17
17
|
columns: { type: Number, reflect: true },
|
|
18
18
|
squares: { type: Boolean, reflect: true },
|
|
19
|
+
fit: { type: Boolean, reflect: true },
|
|
20
|
+
layout: { type: String, reflect: true },
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
/** The number of columns (flow, three by default), or the squares across (`squares`, 48 by default). */
|
|
22
24
|
declare columns: number | undefined;
|
|
23
25
|
/** Places every tile on whole squares by its `data-place`. */
|
|
24
26
|
declare squares: boolean;
|
|
27
|
+
/** With `squares`, lets the columns share a measure other than the squares. */
|
|
28
|
+
declare fit: boolean;
|
|
29
|
+
/** Takes each tile's `data-place-<layout>` where it has one (say `phone`). */
|
|
30
|
+
declare layout: string | undefined;
|
|
25
31
|
|
|
26
32
|
static styles = [unsafeCSS(metrics), unsafeCSS(styles)];
|
|
27
33
|
|
|
@@ -30,12 +36,13 @@ export class Bento extends LitElement {
|
|
|
30
36
|
constructor() {
|
|
31
37
|
super();
|
|
32
38
|
this.squares = false;
|
|
39
|
+
this.fit = false;
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
connectedCallback() {
|
|
36
43
|
super.connectedCallback();
|
|
37
44
|
this.observer = new MutationObserver(() => this.place());
|
|
38
|
-
this.observer.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ["data-place", "hidden"] });
|
|
45
|
+
this.observer.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ["data-place", "hidden"], attributeOldValue: false });
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
disconnectedCallback() {
|