@0001-labs/design-system-1 0.3.0-alpha.26 → 0.3.0-alpha.28
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/1-root/cjk.css +1 -1
- package/DS1/1-root/fonts.css +1 -1
- package/DS1/1-root/library-tokens.ts +1 -2
- package/DS1/1-root/one.css +1 -1
- package/DS1/1-root/palette.ts +3 -3
- package/DS1/3-unit/ds-accordion.ts +7 -18
- package/DS1/3-unit/ds-calendar.ts +4 -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/README.md +8 -4
- package/dist/1-root/library-tokens.d.ts.map +1 -1
- package/dist/1-root/library-tokens.js +1 -2
- package/dist/1-root/palette.d.ts +2 -2
- package/dist/1-root/palette.d.ts.map +1 -1
- package/dist/1-root/palette.js +3 -3
- 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/design-system-1.bundle.js +177 -187
- package/dist/design-system-1.bundle.js.map +1 -1
- package/dist/design-system-1.bundle.min.js +232 -244
- package/dist/design-system-1.bundle.min.js.map +1 -1
- package/dist/react/accordion.js +1 -1
- package/package.json +2 -2
- package/DS1/1-root/one.semantic.css +0 -735
package/DS1/1-root/cjk.css
CHANGED
package/DS1/1-root/fonts.css
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// How a published design library reaches Design system 1's components. A library is a stylesheet
|
|
2
|
-
// its owner edits in the libraries app,
|
|
3
|
-
// (one.semantic.css) and its native selectors. DS1's components draw from `--ds-*` tokens
|
|
2
|
+
// its owner edits in the libraries app, including older `--one-*` tokens and native selectors. DS1's components draw from `--ds-*` tokens
|
|
4
3
|
// (component-tokens.css, component-metrics.css) and, in some faces, one.css's own names
|
|
5
4
|
// (`--accent-color`). Publishing prepares the library
|
|
6
5
|
// (packages/css-validate/src/library.ts): after each `--one-*` token below that the library
|
package/DS1/1-root/one.css
CHANGED
package/DS1/1-root/palette.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Design system 1's palette: one list, named by colour. The Colours page (website/src/pages/colours.astro)
|
|
2
|
-
// draws it and the
|
|
2
|
+
// draws it and the shared stylesheet (palette.css) carries it as tokens, written by
|
|
3
3
|
// scripts/write-palette-css.ts. Change a colour here, then run that script.
|
|
4
4
|
//
|
|
5
5
|
// Every palette colour has a pastel (its hue and saturation at 90% lightness) and a dark-mode version
|
|
@@ -77,7 +77,7 @@ export function palette(): PaletteColour[] {
|
|
|
77
77
|
export const paletteStart = ' /* Palette: written by scripts/write-palette-css.ts from DS1/1-root/palette.ts. */';
|
|
78
78
|
export const paletteEnd = ' /* Palette: end */';
|
|
79
79
|
|
|
80
|
-
/** The
|
|
80
|
+
/** The shared tokens: each colour and its pastel, both following the reader's light or dark mode. */
|
|
81
81
|
export function paletteCss(): string {
|
|
82
82
|
const lines = [paletteStart];
|
|
83
83
|
for (const c of palette()) {
|
|
@@ -91,7 +91,7 @@ export function paletteCss(): string {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
* The palette on its own, for a page that does not take the
|
|
94
|
+
* The palette on its own, for a page that does not take the shared sheet: palette.css,
|
|
95
95
|
* imported by one.css and copied by Sync 1's `root` and `tokens` exports.
|
|
96
96
|
*/
|
|
97
97
|
export function paletteSheet(): string {
|
|
@@ -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")}
|
|
@@ -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/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A design system for building interfaces on a 20px grid. Typography, colour, spacing and components share the same rules.
|
|
4
4
|
|
|
5
|
-
Use
|
|
5
|
+
Use Lit Web Components directly in HTML, or through the React adapters. Change the design through CSS custom properties.
|
|
6
6
|
|
|
7
7
|
[Explore the system](https://designsystem1.com/) · [Try the workbench](https://designsystem1.com/app/) · [npm](https://www.npmjs.com/package/@0001-labs/design-system-1)
|
|
8
8
|
|
|
@@ -25,12 +25,16 @@ Then use the components in your HTML:
|
|
|
25
25
|
<ds-button>Save</ds-button>
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
For
|
|
28
|
+
For a plain HTML page, load the stylesheet and component module:
|
|
29
29
|
|
|
30
|
-
```
|
|
31
|
-
|
|
30
|
+
```html
|
|
31
|
+
<link rel="stylesheet" href="https://designsystem1.com/resources/design-system-1.css">
|
|
32
|
+
<script type="module" src="https://designsystem1.com/resources/design-system-1.js"></script>
|
|
33
|
+
<ds-button>Save</ds-button>
|
|
32
34
|
```
|
|
33
35
|
|
|
36
|
+
The module includes Lit. No package install or build step is needed for this setup.
|
|
37
|
+
|
|
34
38
|
The package is in alpha. APIs can change between releases.
|
|
35
39
|
|
|
36
40
|
## Four layers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library-tokens.d.ts","sourceRoot":"","sources":["../../DS1/1-root/library-tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"library-tokens.d.ts","sourceRoot":"","sources":["../../DS1/1-root/library-tokens.ts"],"names":[],"mappings":"AAWA,gGAAgG;AAChG,eAAO,MAAM,cAAc,8lEAyCoD,CAAC;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,wHAAwH;AACxH,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,wBAAwB,yGAA4G,CAAC;AAElJ;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD,4CAA4C;AAC5C,eAAO,MAAM,YAAY,GAAI,WAA+B,MAAM,WAA0D,CAAC;AAE7H,8GAA8G;AAC9G,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE/D"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// How a published design library reaches Design system 1's components. A library is a stylesheet
|
|
2
|
-
// its owner edits in the libraries app,
|
|
3
|
-
// (one.semantic.css) and its native selectors. DS1's components draw from `--ds-*` tokens
|
|
2
|
+
// its owner edits in the libraries app, including older `--one-*` tokens and native selectors. DS1's components draw from `--ds-*` tokens
|
|
4
3
|
// (component-tokens.css, component-metrics.css) and, in some faces, one.css's own names
|
|
5
4
|
// (`--accent-color`). Publishing prepares the library
|
|
6
5
|
// (packages/css-validate/src/library.ts): after each `--one-*` token below that the library
|
package/dist/1-root/palette.d.ts
CHANGED
|
@@ -25,10 +25,10 @@ export interface PaletteColour {
|
|
|
25
25
|
export declare function palette(): PaletteColour[];
|
|
26
26
|
export declare const paletteStart = " /* Palette: written by scripts/write-palette-css.ts from DS1/1-root/palette.ts. */";
|
|
27
27
|
export declare const paletteEnd = " /* Palette: end */";
|
|
28
|
-
/** The
|
|
28
|
+
/** The shared tokens: each colour and its pastel, both following the reader's light or dark mode. */
|
|
29
29
|
export declare function paletteCss(): string;
|
|
30
30
|
/**
|
|
31
|
-
* The palette on its own, for a page that does not take the
|
|
31
|
+
* The palette on its own, for a page that does not take the shared sheet: palette.css,
|
|
32
32
|
* imported by one.css and copied by Sync 1's `root` and `tokens` exports.
|
|
33
33
|
*/
|
|
34
34
|
export declare function paletteSheet(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../DS1/1-root/palette.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAOnC,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAGzD,CAAC;AAEF,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpC,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAOtC;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED,eAAO,MAAM,KAAK,GAAI,UAAU,GAAG,KAAG,OAA+B,CAAC;AAEtE,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIxC;AACD,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAwD;AACnG,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAA+D;AAEvG,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,KAAG,MAAmE,CAAC;AAE7G,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAC;IACrE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAC3D;AAED;8EAC8E;AAC9E,wBAAgB,OAAO,IAAI,aAAa,EAAE,CAezC;AAED,eAAO,MAAM,YAAY,yFAAyF,CAAC;AACnH,eAAO,MAAM,UAAU,yBAAyB,CAAC;AAEjD,
|
|
1
|
+
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../DS1/1-root/palette.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAOnC,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAGzD,CAAC;AAEF,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpC,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAOtC;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED,eAAO,MAAM,KAAK,GAAI,UAAU,GAAG,KAAG,OAA+B,CAAC;AAEtE,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIxC;AACD,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAwD;AACnG,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAA+D;AAEvG,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,KAAG,MAAmE,CAAC;AAE7G,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAC;IACrE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAC3D;AAED;8EAC8E;AAC9E,wBAAgB,OAAO,IAAI,aAAa,EAAE,CAezC;AAED,eAAO,MAAM,YAAY,yFAAyF,CAAC;AACnH,eAAO,MAAM,UAAU,yBAAyB,CAAC;AAEjD,qGAAqG;AACrG,wBAAgB,UAAU,IAAI,MAAM,CAUnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAarC"}
|
package/dist/1-root/palette.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Design system 1's palette: one list, named by colour. The Colours page (website/src/pages/colours.astro)
|
|
2
|
-
// draws it and the
|
|
2
|
+
// draws it and the shared stylesheet (palette.css) carries it as tokens, written by
|
|
3
3
|
// scripts/write-palette-css.ts. Change a colour here, then run that script.
|
|
4
4
|
//
|
|
5
5
|
// Every palette colour has a pastel (its hue and saturation at 90% lightness) and a dark-mode version
|
|
@@ -67,7 +67,7 @@ export function palette() {
|
|
|
67
67
|
}
|
|
68
68
|
export const paletteStart = ' /* Palette: written by scripts/write-palette-css.ts from DS1/1-root/palette.ts. */';
|
|
69
69
|
export const paletteEnd = ' /* Palette: end */';
|
|
70
|
-
/** The
|
|
70
|
+
/** The shared tokens: each colour and its pastel, both following the reader's light or dark mode. */
|
|
71
71
|
export function paletteCss() {
|
|
72
72
|
const lines = [paletteStart];
|
|
73
73
|
for (const c of palette()) {
|
|
@@ -82,7 +82,7 @@ export function paletteCss() {
|
|
|
82
82
|
return lines.join('\n');
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* The palette on its own, for a page that does not take the
|
|
85
|
+
* The palette on its own, for a page that does not take the shared sheet: palette.css,
|
|
86
86
|
* imported by one.css and copied by Sync 1's `root` and `tokens` exports.
|
|
87
87
|
*/
|
|
88
88
|
export function paletteSheet() {
|
|
@@ -2,9 +2,10 @@ import { LitElement } from "lit";
|
|
|
2
2
|
import "../2-core/ds-text";
|
|
3
3
|
import "../2-core/ds-icon";
|
|
4
4
|
import "../2-core/ds-button";
|
|
5
|
-
import "./ds-row";
|
|
6
5
|
/**
|
|
7
|
-
* Native accordion using <details>/<summary> (no JS toggle logic)
|
|
6
|
+
* Native accordion using <details>/<summary> (no JS toggle logic): the
|
|
7
|
+
* summary one square high at the start, the library's chevron-down at its
|
|
8
|
+
* end (turned over when open), the details from the square below.
|
|
8
9
|
*
|
|
9
10
|
* Usage (with translation text):
|
|
10
11
|
* <ds-accordion summary="How it began" details="Designed in Hokkaido"></ds-accordion>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-accordion.d.ts","sourceRoot":"","sources":["../../DS1/3-unit/ds-accordion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAClD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ds-accordion.d.ts","sourceRoot":"","sources":["../../DS1/3-unit/ds-accordion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAClD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,qBAAqB,CAAC;AAI7B;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,SAAU,SAAQ,UAAU;IACvC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;MAOf;IAEM,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IACxB,4EAA4E;IACpE,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,OAAO,CAAC;;IAmBpC,OAAO,CAAC,SAAS,CASf;IACF,OAAO;IAEP,MAAM,CAAC,MAAM,0BAAqB;IAElC,OAAO,CAAC,iBAAiB;IAYzB,MAAM;CAwBP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,SAAS,CAAC;KAC3B;CACF"}
|
|
@@ -3,10 +3,11 @@ 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
|
-
* Native accordion using <details>/<summary> (no JS toggle logic)
|
|
8
|
+
* Native accordion using <details>/<summary> (no JS toggle logic): the
|
|
9
|
+
* summary one square high at the start, the library's chevron-down at its
|
|
10
|
+
* end (turned over when open), the details from the square below.
|
|
10
11
|
*
|
|
11
12
|
* Usage (with translation text):
|
|
12
13
|
* <ds-accordion summary="How it began" details="Designed in Hokkaido"></ds-accordion>
|
|
@@ -67,22 +68,10 @@ export class Accordion extends LitElement {
|
|
|
67
68
|
return html `
|
|
68
69
|
<details ?open=${this.open}>
|
|
69
70
|
<summary>
|
|
70
|
-
<
|
|
71
|
-
<ds-text .text=${this.summary} ?literal=${this.literal}></ds-text>
|
|
72
|
-
<ds-icon class="chevron" aria-hidden="true">
|
|
73
|
-
|
|
74
|
-
viewBox="0 0 10.157 8.219"
|
|
75
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
76
|
-
aria-hidden="true"
|
|
77
|
-
focusable="false"
|
|
78
|
-
>
|
|
79
|
-
<path
|
|
80
|
-
d="M5.078 8.219L0 3.141L1.414 1.727L5.078 5.391L8.743 1.727L10.157 3.141L5.078 8.219Z"
|
|
81
|
-
fill="currentColor"
|
|
82
|
-
/>
|
|
83
|
-
</svg>
|
|
84
|
-
</ds-icon>
|
|
85
|
-
</ds-row>
|
|
71
|
+
<span class="summaryRow">
|
|
72
|
+
<ds-text class="summaryText" .text=${this.summary} ?literal=${this.literal}></ds-text>
|
|
73
|
+
<ds-icon class="chevron" type="chevron-down" size="large" aria-hidden="true"></ds-icon>
|
|
74
|
+
</span>
|
|
86
75
|
</summary>
|
|
87
76
|
|
|
88
77
|
<div class="detailsBody">
|
|
@@ -81,7 +81,7 @@ export declare function parseTypedDay(text: string): Day | null;
|
|
|
81
81
|
* @fires navigate - A person moved to another month; `{ month }`.
|
|
82
82
|
* @fires ds-calendar-toggle - A picker's month opened or closed; `{ open }`.
|
|
83
83
|
*
|
|
84
|
-
* A selectable calendar
|
|
84
|
+
* A selectable calendar shows Clear right under its dates while something is chosen, and `clear()`
|
|
85
85
|
* empties the value from code; both fire `change` with an empty value.
|
|
86
86
|
*
|
|
87
87
|
* @example
|
|
@@ -116,7 +116,7 @@ const openPickers = new Set();
|
|
|
116
116
|
* @fires navigate - A person moved to another month; `{ month }`.
|
|
117
117
|
* @fires ds-calendar-toggle - A picker's month opened or closed; `{ open }`.
|
|
118
118
|
*
|
|
119
|
-
* A selectable calendar
|
|
119
|
+
* A selectable calendar shows Clear right under its dates while something is chosen, and `clear()`
|
|
120
120
|
* empties the value from code; both fire `change` with an empty value.
|
|
121
121
|
*
|
|
122
122
|
* @example
|
|
@@ -553,10 +553,10 @@ export class Calendar extends CalendarBase {
|
|
|
553
553
|
><span class="pick-mark">${name(value)}</span></button>`)}</div>`)}</div>`;
|
|
554
554
|
}
|
|
555
555
|
renderClear() {
|
|
556
|
-
if (!this.selectable || this.embedded || this.required)
|
|
556
|
+
if (!this.selectable || this.embedded || this.required || !this.value)
|
|
557
557
|
return nothing;
|
|
558
558
|
return html `<div class="foot" part="foot">
|
|
559
|
-
<button class="ds-button ds-button--secondary clear-value" part="clear" type="button"
|
|
559
|
+
<button class="ds-button ds-button--secondary clear-value" part="clear" type="button" @click=${() => this.clear()}>${this.words("Clear")}</button>
|
|
560
560
|
</div>`;
|
|
561
561
|
}
|
|
562
562
|
/** The day holding the Tab stop: the one moved to, the selected day, today, or the first. */
|
|
@@ -605,7 +605,7 @@ export class Calendar extends CalendarBase {
|
|
|
605
605
|
type="button"
|
|
606
606
|
aria-label=${`${title}, ${this.words("Choose a month and year")}`}
|
|
607
607
|
@click=${this.levelUp}
|
|
608
|
-
><span class="title-text" id="title" aria-live="polite">${title}</span
|
|
608
|
+
><span class="title-text" id="title" aria-live="polite">${title}</span></button>`}
|
|
609
609
|
<span class="controls">
|
|
610
610
|
${this.noToday || this.squaresPerDay < 2 ? nothing : html `<button class="ds-button today-button" part="today" type="button" @click=${() => this.showToday()}>${this.words("Today")}</button>`}
|
|
611
611
|
${arrow("previous")}
|