@aitrien/motifspec 1.26.0 → 1.27.1
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/CHANGELOG.md +23 -0
- package/README.md +2 -2
- package/dist/codex.css +165 -2
- package/dist/codex.js +423 -104
- package/dist/contrast.md +9 -1
- package/dist/icons.svg +1 -0
- package/dist/tokens.css +5 -1
- package/dist/tokens.js +83 -1
- package/dist/tokens.json +83 -1
- package/docs/components/_groups.json +1 -0
- package/docs/components/button-and-link.md +19 -1
- package/docs/components/choice.md +104 -0
- package/docs/components/date-picker.md +108 -0
- package/docs/components/dialog.md +148 -0
- package/docs/components/field.md +181 -0
- package/docs/components/icon.md +3 -0
- package/docs/hugo.md +1 -0
- package/docs/layouts/dashboard.md +3 -3
- package/icons/manifest.json +8 -4
- package/icons/svg/calendar_today.svg +1 -0
- package/layouts/_partials/motifspec/field.html +53 -0
- package/package.json +1 -1
- package/scripts/lib.mjs +4 -0
- package/tokens/color.json +74 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
Every release of MotifSpec (named brand-codex until 1.10.0), newest first. Entries before 1.10.0 keep the names they were released under. Versions follow the rules in `CONVENTIONS.md`: renaming or removing a semantic token is major, adding tokens, components or icons is minor, and changing a value or fixing a description is a patch. `npm run build` fails if the version in `package.json` has no entry here.
|
|
4
4
|
|
|
5
|
+
## [1.27.1] - 2026-11-19
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- `codex.js` works with Turbo (Rails), or anything that changes the page without a reload. It sets each page's elements up again after every `turbo:load`, `turbo:frame-load` and `turbo:morph`, so the theme toggle, alert dismiss buttons, copy buttons, tabs, search, date pickers and the rest work after a visit or a redirect, not only on the first full load. Listeners on the document are set once, no element is set up twice, and a calendar, dialog or menu left open is closed before Turbo caches the page.
|
|
9
|
+
|
|
10
|
+
## [1.27.0] - 2026-11-19
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Field (`field.md`, shared): a text field, select or text area with its label on the top border. The label rests where the text goes and moves to the border when the field has focus or a value, with no script. Focus doubles the field's border in `color.accent.border`, with no ring outside it. Hints, errors, "(optional)", disabled fields, `--mono` and `--short` controls, and fieldsets. In Hugo, `motifspec/field.html` writes one.
|
|
14
|
+
- Choice (`choice.md`, shared): checkboxes, radio buttons and switches (a checkbox with `role="switch"`), as native inputs in the accent colour.
|
|
15
|
+
- Date picker (`date-picker.md`, shared): a date field with a calendar, opened from a button `codex.js` shows. The month and the year open grids of their own (twenty years at a time), the keyboard moves through each, and the calendar is a fixed size, opening above the field when there's more room there and scrolling with it.
|
|
16
|
+
- Dialog (`dialog.md`, shared): a native `<dialog>` with a head, a close button and the actions in a recessed band; `--wide` for a form. `[data-dialog-open]` and `[data-dialog-close]` open and close it, and a click outside closes it unless it has `data-dialog-keep`. On a phone it docks to the bottom, and a form fills the screen.
|
|
17
|
+
- A danger button (`cx-button--danger`) for confirming a destructive action in a dialog, on the new `color.status.danger.fill`, `color.status.danger.fill-hover` and `color.text.on-danger`.
|
|
18
|
+
- `color.surface.selected` for the chosen item among options, such as a calendar's date, and the `calendar` icon.
|
|
19
|
+
- A Forms group on the Components page, and the dialog in Messages.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- The dashboard layout's form controls and dialog are available.
|
|
23
|
+
- A component preview grows while a dialog or calendar is open in it.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
- An alert no longer takes the full height of a flex column, such as a dashboard's main region.
|
|
27
|
+
|
|
5
28
|
## [1.26.0] - 2026-11-18
|
|
6
29
|
|
|
7
30
|
### Added
|
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ Pin an exact version, as a Hugo site pins a tag: the version you install is the
|
|
|
79
79
|
|---|---|
|
|
80
80
|
| `@aitrien/motifspec/codex.css` | Tokens, fonts and every component. Its font URLs are `../fonts/…`, so a bundler that copies assets (Vite, webpack, Parcel) resolves them from the package. Without a bundler, serve `dist/` and `fonts/` side by side. |
|
|
81
81
|
| `@aitrien/motifspec/tokens.css`, `fonts.css`, `chroma.css` | The parts on their own: tokens only, `@font-face` only, syntax highlighting only. |
|
|
82
|
-
| `@aitrien/motifspec/codex.js` | Behaviour: theme toggle, copy buttons, TOC, tooltips. Load with `defer`. |
|
|
82
|
+
| `@aitrien/motifspec/codex.js` | Behaviour: theme toggle, copy buttons, TOC, tooltips, alerts, toasts, date pickers, dialogs. Load with `defer`. With Turbo (Rails), it sets each new page up after every visit, so it needs nothing more. |
|
|
83
83
|
| `@aitrien/motifspec/theme-init.js` | Inline it in `<head>` before the stylesheet so a stored theme applies before first paint. |
|
|
84
84
|
| `@aitrien/motifspec/plate.js`, `backdrop.html`, `backdrop-foot.html`, `backdrop-side.html` | The contour backdrop and its motion (`backdrop.md`). |
|
|
85
85
|
| `@aitrien/motifspec/icons.svg` | The icon sprite. Inline it once in `<body>`. |
|
|
@@ -169,7 +169,7 @@ layouts/ Hugo partials (_partials/motifspec/) and Markdown render hoo
|
|
|
169
169
|
docs/syntax-highlighting.md
|
|
170
170
|
fonts/ Self-hosted WOFF2 (Latin subsets) and their OFL licences
|
|
171
171
|
scripts/ validate, build, audit, check (the rule checker projects run), pack-check, release, and docs with docs-reference (motifspec.com and its generated pages)
|
|
172
|
-
js/codex.js Theme toggle, copy buttons, tooltip dismissal, TOC docking and active section, search, tabs and the component preview
|
|
172
|
+
js/codex.js Theme toggle, copy buttons, tooltip dismissal, TOC docking and active section, search, tabs, alerts, toasts, date pickers, dialogs and the component preview
|
|
173
173
|
js/theme-init.js One-line <head> snippet that applies a stored theme before first paint
|
|
174
174
|
js/plate.js Contour survey generator for the backdrop and the specimen plate: draws the static contours at build time and animates them in the browser
|
|
175
175
|
site/ motifspec.com: a Hugo site whose pages are made from this README's sections, docs/, CONVENTIONS.md and CHANGELOG.md
|
package/dist/codex.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
|
|
3
3
|
@font-face { font-family: "Yarndings 12"; src: url("../fonts/yarndings-12-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
|
|
4
4
|
|
|
5
|
-
/* MotifSpec 1.
|
|
5
|
+
/* MotifSpec 1.27.1 — generated from tokens/*.json. Do not edit.
|
|
6
6
|
Themes: semantic colours use light-dark(); color-scheme follows the system unless
|
|
7
7
|
<html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
|
|
8
8
|
:root {
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
--cx-color-surface-hover: light-dark(var(--cx-primitive-color-ash-100), var(--cx-primitive-color-ash-800));
|
|
105
105
|
--cx-color-surface-inverse: light-dark(var(--cx-primitive-color-ash-900), var(--cx-primitive-color-ash-100));
|
|
106
106
|
--cx-color-surface-highlight: light-dark(var(--cx-primitive-color-sap-100), var(--cx-primitive-color-sap-800));
|
|
107
|
+
--cx-color-surface-selected: light-dark(var(--cx-primitive-color-sap-100), var(--cx-primitive-color-sap-800));
|
|
107
108
|
|
|
108
109
|
/* color.text */
|
|
109
110
|
--cx-color-text-primary: light-dark(var(--cx-primitive-color-ash-950), var(--cx-primitive-color-ash-100));
|
|
@@ -112,6 +113,7 @@
|
|
|
112
113
|
--cx-color-text-accent: light-dark(var(--cx-primitive-color-sap-700), var(--cx-primitive-color-sap-300));
|
|
113
114
|
--cx-color-text-inverse: light-dark(var(--cx-primitive-color-ash-50), var(--cx-primitive-color-ash-900));
|
|
114
115
|
--cx-color-text-on-accent: light-dark(var(--cx-primitive-color-ash-0), var(--cx-primitive-color-ash-1000));
|
|
116
|
+
--cx-color-text-on-danger: light-dark(var(--cx-primitive-color-ash-0), var(--cx-primitive-color-ash-1000));
|
|
115
117
|
|
|
116
118
|
/* color.link */
|
|
117
119
|
--cx-color-link-rest: light-dark(var(--cx-primitive-color-sap-800), var(--cx-primitive-color-sap-300));
|
|
@@ -145,6 +147,8 @@
|
|
|
145
147
|
--cx-color-status-danger-text: light-dark(var(--cx-primitive-color-madder-700), var(--cx-primitive-color-madder-300));
|
|
146
148
|
--cx-color-status-danger-surface: light-dark(var(--cx-primitive-color-madder-50), var(--cx-primitive-color-madder-950));
|
|
147
149
|
--cx-color-status-danger-border: light-dark(var(--cx-primitive-color-madder-600), var(--cx-primitive-color-madder-400));
|
|
150
|
+
--cx-color-status-danger-fill: light-dark(var(--cx-primitive-color-madder-700), var(--cx-primitive-color-madder-300));
|
|
151
|
+
--cx-color-status-danger-fill-hover: light-dark(var(--cx-primitive-color-madder-800), var(--cx-primitive-color-madder-200));
|
|
148
152
|
--cx-color-status-info-text: light-dark(var(--cx-primitive-color-woad-700), var(--cx-primitive-color-woad-300));
|
|
149
153
|
--cx-color-status-info-surface: light-dark(var(--cx-primitive-color-woad-50), var(--cx-primitive-color-woad-950));
|
|
150
154
|
--cx-color-status-info-border: light-dark(var(--cx-primitive-color-woad-600), var(--cx-primitive-color-woad-400));
|
|
@@ -1007,6 +1011,8 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
|
|
|
1007
1011
|
.cx-button:hover { background: var(--cx-color-surface-hover); }
|
|
1008
1012
|
.cx-button--primary { border-color: var(--cx-color-accent-fill-rest); background: var(--cx-color-accent-fill-rest); color: var(--cx-color-text-on-accent); }
|
|
1009
1013
|
.cx-button--primary:hover { border-color: var(--cx-color-accent-fill-hover); background: var(--cx-color-accent-fill-hover); }
|
|
1014
|
+
.cx-button--danger { border-color: var(--cx-color-status-danger-fill); background: var(--cx-color-status-danger-fill); color: var(--cx-color-text-on-danger); }
|
|
1015
|
+
.cx-button--danger:hover { border-color: var(--cx-color-status-danger-fill-hover); background: var(--cx-color-status-danger-fill-hover); }
|
|
1010
1016
|
.cx-button[disabled], .cx-button[aria-disabled="true"] { cursor: not-allowed; border-style: dashed; background: transparent; color: var(--cx-color-text-muted); }
|
|
1011
1017
|
.cx-button--sm { min-height: var(--cx-size-target-min); padding-inline: var(--cx-space-inset-md); }
|
|
1012
1018
|
.cx-button__arrow { display: inline-block; transition: transform var(--cx-motion-duration-fast) var(--cx-motion-easing-standard); }
|
|
@@ -1186,7 +1192,7 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
|
|
|
1186
1192
|
display: flex; align-items: flex-start; gap: var(--cx-space-inline-md); padding: var(--cx-space-inset-md);
|
|
1187
1193
|
border: var(--cx-border-width-hairline) solid var(--_border); border-block-start-width: var(--cx-border-width-emphasis);
|
|
1188
1194
|
background: var(--_bg); color: var(--cx-color-text-primary); line-height: var(--cx-font-line-height-ui);
|
|
1189
|
-
|
|
1195
|
+
width: 100%; /* a whole row in a flex row too; flex-basis would take the full height in a flex column */
|
|
1190
1196
|
}
|
|
1191
1197
|
.cx-alert[hidden] { display: none; }
|
|
1192
1198
|
:where(main) > .cx-alert { margin-block-end: var(--cx-space-stack-lg); }
|
|
@@ -1229,6 +1235,163 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
|
|
|
1229
1235
|
.cx-toasts .cx-toast.is-shown { opacity: 1; transform: none; }
|
|
1230
1236
|
.cx-toasts .cx-toast.is-leaving { transition-timing-function: var(--cx-motion-easing-exit); }
|
|
1231
1237
|
|
|
1238
|
+
/* ------------------------------------------------------------ field (field.md) */
|
|
1239
|
+
/* A text field, select or text area with its label on the top border. The label rests where the text goes and moves
|
|
1240
|
+
up to the border when the field has focus or a value: the control's placeholder is " " (or an example), so
|
|
1241
|
+
:placeholder-shown means empty. The label's lower half is the field's own surface, hiding the border behind it,
|
|
1242
|
+
and its upper half is clear, so it sits on whatever the field is on. */
|
|
1243
|
+
.cx-field { display: flex; flex-direction: column; gap: var(--cx-space-stack-xs); width: 100%; min-width: 0; } /* fills its container, in a flex row too */
|
|
1244
|
+
.cx-field__box { position: relative; display: flex; margin-block-start: var(--cx-space-inset-xs); --_field: var(--cx-color-surface-raised); }
|
|
1245
|
+
.cx-field__control {
|
|
1246
|
+
flex: 1; min-width: 0; width: 100%; margin: 0; min-height: calc(var(--cx-size-target-control) + var(--cx-space-inset-xs) * 2);
|
|
1247
|
+
padding: var(--cx-space-inset-xs) var(--cx-space-inset-sm); border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); border-radius: var(--cx-radius-control);
|
|
1248
|
+
background: var(--_field); color: var(--cx-color-text-primary); font: inherit; font-size: var(--cx-font-size-body); line-height: var(--cx-font-line-height-ui);
|
|
1249
|
+
}
|
|
1250
|
+
.cx-field__control--mono { font-family: var(--cx-font-family-mono); font-size: var(--cx-font-size-small); }
|
|
1251
|
+
.cx-field__control--short { flex: none; max-width: var(--cx-size-column-sidebar); }
|
|
1252
|
+
textarea.cx-field__control { min-height: calc(var(--cx-size-target-control) * 2.5); resize: vertical; }
|
|
1253
|
+
select.cx-field__control { appearance: none; padding-inline-end: calc(var(--cx-space-inset-sm) * 2 + var(--cx-size-icon-md)); cursor: pointer; }
|
|
1254
|
+
.cx-field__box > .cx-icon { position: absolute; inset-inline-end: var(--cx-space-inset-sm); top: 50%; translate: 0 -50%; color: var(--cx-color-text-secondary); pointer-events: none; }
|
|
1255
|
+
.cx-field__control::placeholder { color: transparent; }
|
|
1256
|
+
.cx-field__control:focus::placeholder { color: var(--cx-color-text-muted); }
|
|
1257
|
+
.cx-field__control:hover:not(:disabled, :focus-visible) { border-color: var(--cx-color-text-secondary); }
|
|
1258
|
+
/* focus: the field's own border turns accent and doubles, with no ring outside it; the inner line changes from the
|
|
1259
|
+
field's surface to accent, so the change shows without colour vision too */
|
|
1260
|
+
.cx-field__control:focus-visible { outline: none; border-color: var(--cx-color-accent-border); box-shadow: inset 0 0 0 var(--cx-border-width-hairline) var(--cx-color-accent-border); }
|
|
1261
|
+
.cx-field__control[aria-invalid="true"]:not(:focus-visible) { border-color: var(--cx-color-status-danger-border); box-shadow: inset 0 0 0 var(--cx-border-width-hairline) var(--cx-color-status-danger-border); }
|
|
1262
|
+
.cx-field__control:disabled { --_field: var(--cx-color-surface-sunken); color: var(--cx-color-text-muted); border-style: dashed; cursor: not-allowed; }
|
|
1263
|
+
.cx-field__box:has(.cx-field__control:disabled) { --_field: var(--cx-color-surface-sunken); }
|
|
1264
|
+
.cx-field__label {
|
|
1265
|
+
position: absolute; inset-inline-start: calc(var(--cx-space-inset-sm) + var(--cx-border-width-hairline)); top: 50%; translate: 0 -50%;
|
|
1266
|
+
max-width: calc(100% - var(--cx-space-inset-sm) * 2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; pointer-events: none;
|
|
1267
|
+
color: var(--cx-color-text-secondary); font-size: var(--cx-font-size-body); line-height: var(--cx-font-line-height-ui);
|
|
1268
|
+
transition-property: top, translate, font-size, color, padding, margin; transition-duration: var(--cx-motion-duration-base); transition-timing-function: var(--cx-motion-easing-standard);
|
|
1269
|
+
}
|
|
1270
|
+
.cx-field__box--area > .cx-field__label { top: var(--cx-space-inset-sm); translate: 0 0; }
|
|
1271
|
+
.cx-field__control:is(:focus, :not(:placeholder-shown), :autofill, :disabled) + .cx-field__label, select.cx-field__control + .cx-field__label {
|
|
1272
|
+
top: 0; translate: 0 -50%; font-size: var(--cx-font-size-label); padding-inline: var(--cx-space-inset-xs); margin-inline-start: calc(var(--cx-space-inset-xs) * -1);
|
|
1273
|
+
background: linear-gradient(to bottom, transparent 50%, var(--_field) 50%);
|
|
1274
|
+
}
|
|
1275
|
+
.cx-field__control:focus + .cx-field__label { color: var(--cx-color-text-accent); font-weight: var(--cx-font-weight-strong); }
|
|
1276
|
+
.cx-field__control[aria-invalid="true"] + .cx-field__label { color: var(--cx-color-status-danger-text); }
|
|
1277
|
+
.cx-field__optional { color: var(--cx-color-text-muted); }
|
|
1278
|
+
.cx-field__hint { margin: 0; font-size: var(--cx-font-size-small); color: var(--cx-color-text-secondary); line-height: var(--cx-font-line-height-ui); }
|
|
1279
|
+
.cx-field__error { margin: 0; display: flex; align-items: center; gap: var(--cx-space-inline-xs); font-size: var(--cx-font-size-small); font-weight: var(--cx-font-weight-strong); color: var(--cx-color-status-danger-text); line-height: var(--cx-font-line-height-ui); }
|
|
1280
|
+
.cx-field__error[hidden] { display: none; }
|
|
1281
|
+
.cx-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--cx-space-stack-md); }
|
|
1282
|
+
.cx-fieldset > legend { padding: 0; margin-block-end: var(--cx-space-stack-sm); font-size: var(--cx-font-size-body); font-weight: var(--cx-font-weight-strong); line-height: var(--cx-font-line-height-ui); }
|
|
1283
|
+
@media (prefers-reduced-motion: reduce) { .cx-field__label { transition: none; } }
|
|
1284
|
+
|
|
1285
|
+
/* ------------------------------------------------------------ choice (choice.md) */
|
|
1286
|
+
/* A checkbox, radio button or switch with its label beside it: native inputs, in the accent colour */
|
|
1287
|
+
.cx-choices { display: flex; flex-direction: column; gap: var(--cx-space-stack-sm); }
|
|
1288
|
+
.cx-choice { display: flex; align-items: flex-start; gap: var(--cx-space-inline-sm); min-height: var(--cx-size-target-min); font-size: var(--cx-font-size-small); line-height: var(--cx-font-line-height-ui); cursor: pointer; }
|
|
1289
|
+
.cx-choice:has(input:disabled) { color: var(--cx-color-text-muted); cursor: not-allowed; }
|
|
1290
|
+
.cx-choice__text { display: flex; flex-direction: column; gap: var(--cx-space-stack-xs); padding-block-start: var(--cx-border-width-emphasis); }
|
|
1291
|
+
.cx-choice input { flex: none; margin: 0; cursor: inherit; }
|
|
1292
|
+
.cx-choice input:is([type="checkbox"]:not([role="switch"]), [type="radio"]) { width: var(--cx-size-icon-md); height: var(--cx-size-icon-md); accent-color: var(--cx-color-accent-fill-rest); }
|
|
1293
|
+
.cx-choice input[role="switch"] {
|
|
1294
|
+
appearance: none; width: var(--cx-size-target-touch); height: var(--cx-size-target-min); border-radius: var(--cx-radius-pill);
|
|
1295
|
+
border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); background-color: var(--cx-color-surface-sunken);
|
|
1296
|
+
background-image: radial-gradient(circle closest-side, var(--cx-color-text-secondary) 70%, transparent 74%);
|
|
1297
|
+
background-size: var(--cx-size-target-min) 100%; background-repeat: no-repeat; background-position: left center;
|
|
1298
|
+
transition: background-position var(--cx-motion-duration-fast) var(--cx-motion-easing-standard);
|
|
1299
|
+
}
|
|
1300
|
+
.cx-choice input[role="switch"]:checked { border-color: var(--cx-color-accent-fill-rest); background-color: var(--cx-color-accent-fill-rest); background-image: radial-gradient(circle closest-side, var(--cx-color-text-on-accent) 70%, transparent 74%); background-position: right center; }
|
|
1301
|
+
.cx-choice input[role="switch"]:disabled { border-style: dashed; }
|
|
1302
|
+
.cx-choice input:focus-visible { outline: var(--cx-border-focus-width) solid var(--cx-color-focus-ring); outline-offset: var(--cx-border-focus-offset); }
|
|
1303
|
+
|
|
1304
|
+
/* ------------------------------------------------------------ date picker (date-picker.md) */
|
|
1305
|
+
/* A date field with a button that opens a calendar: codex.js shows the button and builds one calendar for the page.
|
|
1306
|
+
The calendar is a fixed size (seven touch-size days), so neither arrow nor either button moves as months change. */
|
|
1307
|
+
.cx-field__box--date > .cx-field__control { border-inline-end: 0; }
|
|
1308
|
+
.cx-date__button {
|
|
1309
|
+
flex: none; display: grid; place-items: center; width: calc(var(--cx-size-target-control) + var(--cx-space-inset-xs) * 2); padding: 0;
|
|
1310
|
+
border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); background: var(--_field); color: var(--cx-color-text-secondary); cursor: pointer;
|
|
1311
|
+
}
|
|
1312
|
+
.cx-date__button[hidden] { display: none; }
|
|
1313
|
+
.cx-field__box--date:has(.cx-date__button[hidden]) > .cx-field__control { border-inline-end: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); }
|
|
1314
|
+
.cx-date__button:hover { background: var(--cx-color-surface-hover); color: var(--cx-color-text-primary); }
|
|
1315
|
+
.cx-date__button:focus-visible { outline: none; border-color: var(--cx-color-accent-border); box-shadow: inset 0 0 0 var(--cx-border-width-hairline) var(--cx-color-accent-border); color: var(--cx-color-text-primary); }
|
|
1316
|
+
.cx-calendar {
|
|
1317
|
+
position: absolute; inset: auto; box-sizing: content-box; width: calc(var(--cx-size-target-touch) * 7); margin: 0; padding: var(--cx-space-inset-sm);
|
|
1318
|
+
border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); background: var(--cx-color-surface-raised); color: var(--cx-color-text-primary);
|
|
1319
|
+
}
|
|
1320
|
+
.cx-calendar__head { display: grid; grid-template-columns: var(--cx-size-target-control) minmax(0, 1fr) var(--cx-size-target-control); align-items: center; padding-block-end: var(--cx-space-inset-xs); }
|
|
1321
|
+
.cx-calendar__pickers { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--cx-space-inline-xs); }
|
|
1322
|
+
.cx-calendar__nav, .cx-calendar__pick, .cx-calendar__day, .cx-calendar__cell, .cx-calendar__foot button {
|
|
1323
|
+
margin: 0; padding: 0; border: 0; border-radius: var(--cx-radius-pill); background: transparent; color: var(--cx-color-text-primary); font: inherit; cursor: pointer;
|
|
1324
|
+
}
|
|
1325
|
+
.cx-calendar__nav { display: grid; place-items: center; width: var(--cx-size-target-control); height: var(--cx-size-target-control); color: var(--cx-color-text-secondary); }
|
|
1326
|
+
.cx-calendar__pick { display: inline-flex; align-items: center; justify-content: center; gap: var(--cx-space-inline-xs); width: 100%; min-height: var(--cx-size-target-control); white-space: nowrap; font-weight: var(--cx-font-weight-strong); font-variant-numeric: tabular-nums; }
|
|
1327
|
+
.cx-calendar__pick .cx-icon { color: var(--cx-color-text-secondary); transition: transform var(--cx-motion-duration-fast) var(--cx-motion-easing-standard); }
|
|
1328
|
+
.cx-calendar__pick[aria-expanded="true"] { background: var(--cx-color-surface-selected); }
|
|
1329
|
+
.cx-calendar__pick[aria-expanded="true"] .cx-icon { transform: rotate(180deg); }
|
|
1330
|
+
.cx-calendar__grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
|
|
1331
|
+
.cx-calendar__grid th { padding-block: var(--cx-space-inset-xs); font-family: var(--cx-font-family-mono); font-size: var(--cx-font-size-label); font-weight: var(--cx-font-weight-ui); letter-spacing: var(--cx-font-tracking-label); text-transform: uppercase; color: var(--cx-color-text-muted); }
|
|
1332
|
+
.cx-calendar__grid td { padding: 0; }
|
|
1333
|
+
.cx-calendar__day { display: grid; place-items: center; width: var(--cx-size-target-touch); height: var(--cx-size-target-touch); font-size: var(--cx-font-size-small); font-variant-numeric: tabular-nums; }
|
|
1334
|
+
.cx-calendar__day.is-other { color: var(--cx-color-text-muted); }
|
|
1335
|
+
.cx-calendar__list { display: grid; gap: var(--cx-space-inset-xs); align-content: center; min-height: calc(var(--cx-size-target-touch) * 6 + var(--cx-font-size-label) * 1.6 + var(--cx-space-inset-xs) * 2); }
|
|
1336
|
+
.cx-calendar__list[hidden], .cx-calendar__grid[hidden] { display: none; }
|
|
1337
|
+
.cx-calendar__list--months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1338
|
+
.cx-calendar__list--years { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
1339
|
+
.cx-calendar__cell { min-height: var(--cx-size-target-control); font-size: var(--cx-font-size-small); font-variant-numeric: tabular-nums; }
|
|
1340
|
+
.cx-calendar__nav:hover, .cx-calendar__pick:hover, .cx-calendar__day:hover, .cx-calendar__cell:hover { background: var(--cx-color-surface-hover); color: var(--cx-color-text-primary); }
|
|
1341
|
+
.cx-calendar :is(.cx-calendar__day, .cx-calendar__cell)[aria-current="date"] { box-shadow: inset 0 0 0 var(--cx-border-width-hairline) var(--cx-color-border-strong); font-weight: var(--cx-font-weight-strong); }
|
|
1342
|
+
.cx-calendar :is(.cx-calendar__day, .cx-calendar__cell)[aria-pressed="true"] { background: var(--cx-color-surface-selected); font-weight: var(--cx-font-weight-strong); }
|
|
1343
|
+
.cx-calendar__foot { display: flex; justify-content: space-between; gap: var(--cx-space-inline-sm); margin-block-start: var(--cx-space-inset-xs); padding-block-start: var(--cx-space-inset-xs); border-block-start: var(--cx-border-width-hairline) solid var(--cx-color-border-subtle); }
|
|
1344
|
+
.cx-calendar__foot button { min-height: var(--cx-size-target-control); padding-inline: var(--cx-space-inset-sm); border-radius: 0; color: var(--cx-color-text-accent); font-size: var(--cx-font-size-small); font-weight: var(--cx-font-weight-strong); }
|
|
1345
|
+
.cx-calendar__foot button:hover { text-decoration: underline; }
|
|
1346
|
+
.cx-calendar button:focus-visible { outline: var(--cx-border-focus-width) solid var(--cx-color-focus-ring); outline-offset: calc(var(--cx-border-focus-width) * -1); }
|
|
1347
|
+
@media (prefers-reduced-motion: reduce) { .cx-calendar__pick .cx-icon { transition: none; } }
|
|
1348
|
+
|
|
1349
|
+
/* ------------------------------------------------------------ dialog (dialog.md) */
|
|
1350
|
+
/* A native <dialog> opened with showModal(): a head with the title and a close button, the body, and the actions in a
|
|
1351
|
+
recessed band. It fades and rises in; on a phone it docks to the bottom, and a wide one (a form) fills the screen. */
|
|
1352
|
+
.cx-dialog {
|
|
1353
|
+
width: min(100% - 2 * var(--cx-space-gutter-page), var(--cx-size-measure-caption));
|
|
1354
|
+
padding: 0; border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); background: var(--cx-color-surface-raised); color: var(--cx-color-text-primary);
|
|
1355
|
+
flex-direction: column;
|
|
1356
|
+
}
|
|
1357
|
+
.cx-dialog:modal { max-height: calc(100% - 2 * var(--cx-space-gutter-page)); overflow: hidden; } /* the window's height, only when open */
|
|
1358
|
+
.cx-dialog--wide { width: min(100% - 2 * var(--cx-space-gutter-page), 1.6 * var(--cx-size-column-card)); }
|
|
1359
|
+
.cx-dialog[open] { display: flex; }
|
|
1360
|
+
.cx-dialog > form { display: contents; }
|
|
1361
|
+
.cx-dialog::backdrop { background: color-mix(in srgb, var(--cx-color-scrim) var(--cx-color-wash-scrim), transparent); }
|
|
1362
|
+
.cx-dialog__head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--cx-space-inline-sm); padding: var(--cx-space-inset-md) var(--cx-space-inset-lg); border-block-end: var(--cx-border-width-hairline) solid var(--cx-color-border-subtle); }
|
|
1363
|
+
/* two classes, so an article's heading styles (.cx-prose h2) don't reach into a dialog placed in one */
|
|
1364
|
+
.cx-dialog .cx-dialog__title { margin: 0; padding: 0; border: 0; font-size: var(--cx-font-size-heading-4); font-weight: var(--cx-font-weight-heading); line-height: var(--cx-font-line-height-heading); letter-spacing: normal; text-wrap: balance; }
|
|
1365
|
+
.cx-dialog .cx-dialog__head > * { margin-block: 0; }
|
|
1366
|
+
.cx-dialog__close {
|
|
1367
|
+
flex: none; display: grid; place-items: center; width: var(--cx-size-target-control); height: var(--cx-size-target-control); margin-inline-end: calc(var(--cx-space-inset-sm) * -1);
|
|
1368
|
+
padding: 0; border: 0; border-radius: var(--cx-radius-pill); background: transparent; color: var(--cx-color-text-secondary); cursor: pointer;
|
|
1369
|
+
}
|
|
1370
|
+
.cx-dialog__close:hover { background: var(--cx-color-surface-hover); color: var(--cx-color-text-primary); }
|
|
1371
|
+
.cx-dialog__close:focus-visible { outline: var(--cx-border-focus-width) solid var(--cx-color-focus-ring); outline-offset: calc(var(--cx-border-focus-width) * -1); }
|
|
1372
|
+
.cx-dialog__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--cx-space-stack-md); padding: var(--cx-space-inset-lg); }
|
|
1373
|
+
.cx-dialog .cx-dialog__body > p { margin: 0; color: var(--cx-color-text-secondary); max-width: var(--cx-size-measure-prose); }
|
|
1374
|
+
.cx-dialog__actions { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--cx-space-inline-sm); padding: var(--cx-space-inset-md) var(--cx-space-inset-lg); border-block-start: var(--cx-border-width-hairline) solid var(--cx-color-border-subtle); background: var(--cx-color-surface-sunken); }
|
|
1375
|
+
.cx-dialog, .cx-dialog::backdrop {
|
|
1376
|
+
transition: opacity var(--cx-motion-duration-base) var(--cx-motion-easing-enter), translate var(--cx-motion-duration-base) var(--cx-motion-easing-enter),
|
|
1377
|
+
overlay var(--cx-motion-duration-base) allow-discrete, display var(--cx-motion-duration-base) allow-discrete;
|
|
1378
|
+
}
|
|
1379
|
+
dialog.cx-dialog:not([open]), dialog.cx-dialog:not([open])::backdrop { opacity: 0; transition-timing-function: var(--cx-motion-easing-exit); }
|
|
1380
|
+
dialog.cx-dialog:not([open]) { translate: 0 calc(6 * var(--cx-motion-distance-nudge)); }
|
|
1381
|
+
@starting-style {
|
|
1382
|
+
.cx-dialog[open], .cx-dialog[open]::backdrop { opacity: 0; }
|
|
1383
|
+
.cx-dialog[open] { translate: 0 calc(6 * var(--cx-motion-distance-nudge)); }
|
|
1384
|
+
}
|
|
1385
|
+
@media (prefers-reduced-motion: reduce) { .cx-dialog, .cx-dialog::backdrop { transition: none; } }
|
|
1386
|
+
html:has(.cx-dialog[open]) { overflow: hidden; }
|
|
1387
|
+
@media (width < 48rem) {
|
|
1388
|
+
.cx-dialog:not(.cx-dialog--wide) { width: 100%; max-width: none; margin: auto 0 0; border-width: var(--cx-border-width-hairline) 0 0; }
|
|
1389
|
+
.cx-dialog:not(.cx-dialog--wide) .cx-dialog__actions { flex-direction: column-reverse; }
|
|
1390
|
+
.cx-dialog:not(.cx-dialog--wide) .cx-dialog__actions .cx-button { width: 100%; justify-content: center; }
|
|
1391
|
+
.cx-dialog--wide { width: 100%; max-width: none; margin: 0; border-width: 0; }
|
|
1392
|
+
.cx-dialog--wide:modal { height: 100%; max-height: none; }
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1232
1395
|
/* ------------------------------------------------------------ data table */
|
|
1233
1396
|
.cx-table { position: relative; min-width: 0; overflow-x: auto; border: var(--cx-border-width-hairline) solid var(--cx-color-border-default); background: var(--cx-color-surface-raised); }
|
|
1234
1397
|
.cx-table table { width: 100%; border-collapse: collapse; font-size: var(--cx-font-size-small); line-height: var(--cx-font-line-height-ui); }
|