actual-css 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +116 -0
- package/README.md +67 -45
- package/components.json +33 -13
- package/dist/actual.full.css +607 -502
- package/dist/actual.full.js +1 -1
- package/dist/actual.full.min.css +1 -1
- package/docs/design-notes/app-ui.md +1 -1
- package/docs/design-notes/column-layout.md +103 -520
- package/docs/design-notes/forced-colors.md +12 -1
- package/docs/design-notes/naming.md +1 -1
- package/docs/design-notes/surface-reparenting.md +8 -9
- package/docs/navigation.json +2 -0
- package/docs/pages/components/accordion.md +55 -1
- package/docs/pages/components/alert.md +9 -15
- package/docs/pages/components/badge.md +6 -7
- package/docs/pages/components/bleed.md +42 -0
- package/docs/pages/components/button.md +30 -4
- package/docs/pages/components/card.md +21 -86
- package/docs/pages/components/close.md +48 -0
- package/docs/pages/components/data-list.md +26 -1
- package/docs/pages/components/dialog.md +16 -16
- package/docs/pages/components/drawer.md +9 -9
- package/docs/pages/components/navbar.md +5 -5
- package/docs/pages/components/spinner.md +3 -3
- package/docs/pages/components/table.md +3 -2
- package/docs/pages/enhancements/overview.md +5 -0
- package/docs/pages/enhancements/tooltip.md +3 -1
- package/docs/pages/examples/overview.md +3 -1
- package/docs/pages/forms/choice-cards.md +39 -0
- package/docs/pages/forms/combobox.md +23 -11
- package/docs/pages/forms/input-policy.md +59 -0
- package/docs/pages/forms/joined-controls.md +2 -5
- package/docs/pages/forms/overview.md +6 -0
- package/docs/pages/forms/validation.md +37 -1
- package/docs/pages/foundations/theming.md +64 -18
- package/docs/pages/foundations/tokens.md +50 -13
- package/docs/pages/foundations/typography.md +10 -0
- package/docs/pages/guides/introduction.md +17 -24
- package/docs/pages/guides/modular-import.md +53 -6
- package/docs/pages/guides/progressive-enhancement.md +9 -5
- package/docs/pages/guides/tailwind.md +17 -5
- package/docs/pages/layout/column-layout.md +92 -54
- package/docs/pages/layout/media.md +1 -1
- package/docs/pages/layout/overview.md +1 -1
- package/docs/pages/utilities/overview.md +1 -1
- package/docs/pages/utilities/sizing-wrapping.md +5 -3
- package/llms.txt +24 -4
- package/package.json +7 -6
- package/reserved-classes.json +5 -30
- package/skills/actual-css/PROJECT.md.example +65 -0
- package/skills/actual-css/README.md +64 -0
- package/skills/actual-css/SKILL.md +234 -0
- package/skills/actual-css/references/accessibility.md +44 -0
- package/skills/actual-css/references/api-and-vocabulary.md +94 -0
- package/skills/actual-css/references/enhancements.md +59 -0
- package/skills/actual-css/references/forms.md +49 -0
- package/skills/actual-css/references/layout-and-theming.md +82 -0
- package/skills/actual-css/references/review-checklist.md +51 -0
- package/skills/actual-css/scripts/inspect-actual-css.mjs +171 -0
- package/src/css/components/accordion.css +44 -7
- package/src/css/components/alert.css +23 -43
- package/src/css/components/app-nav.css +9 -0
- package/src/css/components/badge.css +11 -39
- package/src/css/components/bleed.css +79 -0
- package/src/css/components/button.css +6 -17
- package/src/css/components/card.css +7 -40
- package/src/css/components/close.css +91 -0
- package/src/css/components/data-list.css +18 -0
- package/src/css/components/drawer.css +15 -56
- package/src/css/components/fab.css +10 -0
- package/src/css/components/flyout.css +1 -0
- package/src/css/components/index.css +2 -0
- package/src/css/components/join.css +36 -20
- package/src/css/components/menu.css +12 -0
- package/src/css/components/modal.css +10 -57
- package/src/css/components/navbar.css +27 -0
- package/src/css/core/base.css +2 -0
- package/src/css/core/focus.css +9 -3
- package/src/css/core/theme.css +25 -43
- package/src/css/core/tokens.css +3 -1
- package/src/css/core/variants.css +15 -36
- package/src/css/forms/choice-card.css +74 -4
- package/src/css/forms/choice.css +2 -3
- package/src/css/forms/control.css +15 -8
- package/src/css/forms/custom-select.css +4 -4
- package/src/css/forms/form.css +6 -0
- package/src/css/forms/native.css +4 -4
- package/src/css/forms/range.css +23 -8
- package/src/css/forms/switch.css +2 -3
- package/src/css/layout/app-layout.css +1 -1
- package/src/css/layout/column-layout.css +26 -111
- package/src/css/utilities/extra.css +7 -6
- package/src/js/dialog.js +95 -24
- package/src/js/enhance.js +7 -3
- package/src/js/escape.js +1 -0
- package/src/js/flyout.js +10 -1
- package/src/js/focus-group.js +2 -1
- package/src/js/keys.js +14 -0
- package/src/js/menu.js +2 -1
- package/src/js/status.js +19 -0
- package/src/js/surface.js +12 -8
- package/src/js/tab.js +2 -1
- package/src/js/tooltip.js +18 -1
- package/src/js/validation.js +36 -6
- package/dist/actual.css +0 -863
- package/dist/actual.js +0 -1
- package/dist/actual.min.css +0 -1
package/src/js/tooltip.js
CHANGED
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
* for tooltips that are never triggered. AJAX-loaded triggers
|
|
24
24
|
* work automatically via bubbling delegated listeners.
|
|
25
25
|
*
|
|
26
|
+
* Snapshot, not reactive: generated tooltip text is synchronized when
|
|
27
|
+
* the tooltip is shown. Changes to data-tooltip do not rewrite
|
|
28
|
+
* a tooltip that is already shown. Always-visible generated
|
|
29
|
+
* tooltips therefore keep their initial text; use an explicit
|
|
30
|
+
* tooltip when its content must update dynamically.
|
|
31
|
+
*
|
|
26
32
|
* Show: hover + focus (150ms delay), click toggle, or always visible
|
|
27
33
|
* Hide: focus leaving the trigger (focusout), pointer leave, Escape
|
|
28
34
|
*
|
|
@@ -367,7 +373,10 @@ function ensureTip(trigger) {
|
|
|
367
373
|
const text = trigger.getAttribute("data-tooltip");
|
|
368
374
|
const doc = trigger.ownerDocument;
|
|
369
375
|
|
|
370
|
-
// shorthand: data-tooltip="text" → create element lazily
|
|
376
|
+
// shorthand: data-tooltip="text" → create element lazily.
|
|
377
|
+
// Shorthand content is always text. Never use innerHTML here:
|
|
378
|
+
// data-tooltip may hold application/user-provided strings. Rich content
|
|
379
|
+
// belongs in an explicit author-owned tooltip.
|
|
371
380
|
if (text) {
|
|
372
381
|
tip = doc.createElement("div");
|
|
373
382
|
tip.className = CLASSES.tooltip;
|
|
@@ -467,6 +476,14 @@ function show(tip, ref, immediate = false) {
|
|
|
467
476
|
const state = tipStates.get(tip);
|
|
468
477
|
if (!state) return;
|
|
469
478
|
|
|
479
|
+
// Shorthand tips copy data-tooltip text at creation; re-read it on every
|
|
480
|
+
// show so a "Copy" → "Copied!" update is reflected without rewiring.
|
|
481
|
+
// Text only, never innerHTML — see the note at creation above.
|
|
482
|
+
if (state.generated) {
|
|
483
|
+
const text = ref.getAttribute("data-tooltip");
|
|
484
|
+
if (text && tip.textContent !== text) tip.textContent = text;
|
|
485
|
+
}
|
|
486
|
+
|
|
470
487
|
state.activeRef = ref;
|
|
471
488
|
const mode = positionModeFor(ref);
|
|
472
489
|
state.space = mode.space;
|
package/src/js/validation.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* DOM tears down everything, including the managed novalidate attribute.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import
|
|
20
|
+
import { enhancementSelector, registerEnhancement } from "./enhance.js";
|
|
21
21
|
import { EVENTS } from "./events.js";
|
|
22
22
|
import { CLASSES } from "./selectors.js";
|
|
23
23
|
|
|
@@ -86,9 +86,40 @@ const rules = {
|
|
|
86
86
|
alnum(v) {
|
|
87
87
|
return /^[a-z0-9]+$/i.test(v);
|
|
88
88
|
},
|
|
89
|
+
// Options are literal tokens: no quoting, no escaping, no whitespace. A
|
|
90
|
+
// missing option is a configuration error and fails rather than passing
|
|
91
|
+
// silently. Comparison is case-sensitive; the value is trimmed to compare.
|
|
92
|
+
"starts-with"(v, _el, ...prefixes) {
|
|
93
|
+
const value = v.trim();
|
|
94
|
+
return prefixes.length > 0 && prefixes.some((prefix) => value.startsWith(prefix));
|
|
95
|
+
},
|
|
96
|
+
"ends-with"(v, _el, ...suffixes) {
|
|
97
|
+
const value = v.trim();
|
|
98
|
+
return suffixes.length > 0 && suffixes.some((suffix) => value.endsWith(suffix));
|
|
99
|
+
},
|
|
89
100
|
date(v) {
|
|
90
101
|
return isValidDate(v);
|
|
91
102
|
},
|
|
103
|
+
// Telephone origin policy, not telephone validation. A local number carries
|
|
104
|
+
// nothing but its digits after the usual separators are ignored, so a value
|
|
105
|
+
// with letters or stray symbols is not a number and fails instead of reading
|
|
106
|
+
// as local. Local numbering still belongs to the application and the server;
|
|
107
|
+
// an explicit international number must match an allowed prefix. No prefixes
|
|
108
|
+
// means local-only: local input passes, any explicit international notation
|
|
109
|
+
// fails. The entered value is analyzed, never rewritten.
|
|
110
|
+
"tel-prefix"(value, _el, ...prefixes) {
|
|
111
|
+
let v = value.trim().replace(/[\s()./-]+/g, "");
|
|
112
|
+
if (v.startsWith("00")) {
|
|
113
|
+
v = `+${v.slice(2)}`;
|
|
114
|
+
}
|
|
115
|
+
if (!/^\+?\d+$/.test(v)) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
if (!v.startsWith("+")) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
return prefixes.some((prefix) => v.startsWith(prefix));
|
|
122
|
+
},
|
|
92
123
|
};
|
|
93
124
|
|
|
94
125
|
function isFormElement(el) {
|
|
@@ -404,10 +435,9 @@ export class FormValidator {
|
|
|
404
435
|
}
|
|
405
436
|
}
|
|
406
437
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}
|
|
438
|
+
// Registered by name, not through a bare enhance(), so applyEnhancement()
|
|
439
|
+
// refreshes it like the other token behaviors. The token only means
|
|
440
|
+
// something on a form.
|
|
441
|
+
registerEnhancement("validation", (el) => (isFormElement(el) ? connectForm(el) : undefined));
|
|
412
442
|
|
|
413
443
|
export default FormValidator;
|