@hjmds/react 1.17.2 → 1.19.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/dist/activity-chip.d.ts +33 -0
- package/dist/activity-chip.d.ts.map +1 -0
- package/dist/activity-chip.js +24 -0
- package/dist/activity-chip.js.map +1 -0
- package/dist/advanced-display.d.ts.map +1 -1
- package/dist/advanced-display.js +41 -9
- package/dist/advanced-display.js.map +1 -1
- package/dist/advanced-forms.d.ts.map +1 -1
- package/dist/advanced-forms.js +22 -9
- package/dist/advanced-forms.js.map +1 -1
- package/dist/agreement.d.ts.map +1 -1
- package/dist/agreement.js +17 -11
- package/dist/agreement.js.map +1 -1
- package/dist/auth-screen.d.ts.map +1 -1
- package/dist/auth-screen.js +15 -2
- package/dist/auth-screen.js.map +1 -1
- package/dist/avatar-blobatar-motion.d.ts.map +1 -1
- package/dist/avatar-blobatar-motion.js +10 -2
- package/dist/avatar-blobatar-motion.js.map +1 -1
- package/dist/bottom-navigation.d.ts.map +1 -1
- package/dist/bottom-navigation.js +2 -2
- package/dist/bottom-navigation.js.map +1 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +10 -2
- package/dist/calendar.js.map +1 -1
- package/dist/carousel-motion.d.ts +1 -0
- package/dist/carousel-motion.d.ts.map +1 -1
- package/dist/carousel-motion.js +4 -3
- package/dist/carousel-motion.js.map +1 -1
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +22 -4
- package/dist/carousel.js.map +1 -1
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +28 -4
- package/dist/collapsible.js.map +1 -1
- package/dist/collection-rail.d.ts.map +1 -1
- package/dist/collection-rail.js +19 -1
- package/dist/collection-rail.js.map +1 -1
- package/dist/color-picker.d.ts.map +1 -1
- package/dist/color-picker.js +12 -4
- package/dist/color-picker.js.map +1 -1
- package/dist/command-palette.d.ts.map +1 -1
- package/dist/command-palette.js +14 -2
- package/dist/command-palette.js.map +1 -1
- package/dist/content-transition.d.ts +2 -1
- package/dist/content-transition.d.ts.map +1 -1
- package/dist/content-transition.js +2 -2
- package/dist/content-transition.js.map +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +31 -10
- package/dist/context-menu.js.map +1 -1
- package/dist/date-entry.d.ts +1 -1
- package/dist/date-entry.d.ts.map +1 -1
- package/dist/date-entry.js +20 -7
- package/dist/date-entry.js.map +1 -1
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +22 -6
- package/dist/date-picker.js.map +1 -1
- package/dist/display.d.ts +11 -1
- package/dist/display.d.ts.map +1 -1
- package/dist/display.js +13 -4
- package/dist/display.js.map +1 -1
- package/dist/duration-field.d.ts +2 -2
- package/dist/duration-field.d.ts.map +1 -1
- package/dist/duration-field.js +11 -3
- package/dist/duration-field.js.map +1 -1
- package/dist/evidence.d.ts +1 -1
- package/dist/evidence.js +1 -1
- package/dist/evidence.js.map +1 -1
- package/dist/feedback.d.ts +1 -0
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +7 -2
- package/dist/feedback.js.map +1 -1
- package/dist/field-group.d.ts +4 -2
- package/dist/field-group.d.ts.map +1 -1
- package/dist/field-group.js +4 -3
- package/dist/field-group.js.map +1 -1
- package/dist/file-picker.d.ts.map +1 -1
- package/dist/file-picker.js +15 -5
- package/dist/file-picker.js.map +1 -1
- package/dist/forms.d.ts +2 -2
- package/dist/forms.js +1 -1
- package/dist/forms.js.map +1 -1
- package/dist/gravity-letters.d.ts.map +1 -1
- package/dist/gravity-letters.js +9 -1
- package/dist/gravity-letters.js.map +1 -1
- package/dist/grid-reveal.d.ts.map +1 -1
- package/dist/grid-reveal.js +9 -1
- package/dist/grid-reveal.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/inline-confirm.d.ts.map +1 -1
- package/dist/inline-confirm.js +25 -4
- package/dist/inline-confirm.js.map +1 -1
- package/dist/internal/document-resource.d.ts.map +1 -1
- package/dist/internal/document-resource.js +2 -2
- package/dist/internal/document-resource.js.map +1 -1
- package/dist/layout.d.ts +8 -2
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js.map +1 -1
- package/dist/masonry.d.ts.map +1 -1
- package/dist/masonry.js +2 -1
- package/dist/masonry.js.map +1 -1
- package/dist/mentions.d.ts.map +1 -1
- package/dist/mentions.js +12 -4
- package/dist/mentions.js.map +1 -1
- package/dist/menu-morph.js +1 -1
- package/dist/menu-morph.js.map +1 -1
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +43 -19
- package/dist/menubar.js.map +1 -1
- package/dist/modal.d.ts.map +1 -1
- package/dist/modal.js +15 -4
- package/dist/modal.js.map +1 -1
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +8 -2
- package/dist/navigation.js.map +1 -1
- package/dist/number-field.d.ts.map +1 -1
- package/dist/number-field.js +3 -1
- package/dist/number-field.js.map +1 -1
- package/dist/overlay-stack.d.ts.map +1 -1
- package/dist/overlay-stack.js +23 -6
- package/dist/overlay-stack.js.map +1 -1
- package/dist/overlays.d.ts.map +1 -1
- package/dist/overlays.js +8 -0
- package/dist/overlays.js.map +1 -1
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +16 -4
- package/dist/pagination.js.map +1 -1
- package/dist/saved-items.d.ts.map +1 -1
- package/dist/saved-items.js +6 -1
- package/dist/saved-items.js.map +1 -1
- package/dist/screen-flows.d.ts +1 -2
- package/dist/screen-flows.d.ts.map +1 -1
- package/dist/screen-flows.js +120 -16
- package/dist/screen-flows.js.map +1 -1
- package/dist/screens.d.ts +1 -1
- package/dist/screens.d.ts.map +1 -1
- package/dist/screens.js +38 -10
- package/dist/screens.js.map +1 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +6 -1
- package/dist/select.js.map +1 -1
- package/dist/side-panel.d.ts.map +1 -1
- package/dist/side-panel.js +11 -2
- package/dist/side-panel.js.map +1 -1
- package/dist/sidebar.d.ts.map +1 -1
- package/dist/sidebar.js +8 -1
- package/dist/sidebar.js.map +1 -1
- package/dist/skip-nav.d.ts.map +1 -1
- package/dist/skip-nav.js +16 -3
- package/dist/skip-nav.js.map +1 -1
- package/dist/sortable.d.ts.map +1 -1
- package/dist/sortable.js +2 -1
- package/dist/sortable.js.map +1 -1
- package/dist/splitter.d.ts.map +1 -1
- package/dist/splitter.js +23 -11
- package/dist/splitter.js.map +1 -1
- package/dist/statistic-motion.d.ts.map +1 -1
- package/dist/statistic-motion.js +30 -2
- package/dist/statistic-motion.js.map +1 -1
- package/dist/status-text.d.ts +11 -0
- package/dist/status-text.d.ts.map +1 -0
- package/dist/status-text.js +7 -0
- package/dist/status-text.js.map +1 -0
- package/dist/styles.css +53 -7
- package/dist/styles.layered.css +53 -7
- package/dist/supplemental-display.d.ts.map +1 -1
- package/dist/supplemental-display.js +19 -8
- package/dist/supplemental-display.js.map +1 -1
- package/dist/supplemental-navigation.d.ts.map +1 -1
- package/dist/supplemental-navigation.js +10 -1
- package/dist/supplemental-navigation.js.map +1 -1
- package/dist/tags-input.d.ts.map +1 -1
- package/dist/tags-input.js +18 -8
- package/dist/tags-input.js.map +1 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +11 -0
- package/dist/theme.js.map +1 -1
- package/dist/toast.d.ts.map +1 -1
- package/dist/toast.js +41 -16
- package/dist/toast.js.map +1 -1
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +6 -1
- package/dist/toggle-group.js.map +1 -1
- package/dist/tour.d.ts.map +1 -1
- package/dist/tour.js +15 -2
- package/dist/tour.js.map +1 -1
- package/dist/transfer-list.d.ts +1 -1
- package/dist/transfer-list.d.ts.map +1 -1
- package/dist/transfer-list.js +52 -7
- package/dist/transfer-list.js.map +1 -1
- package/dist/tree.d.ts.map +1 -1
- package/dist/tree.js +41 -8
- package/dist/tree.js.map +1 -1
- package/dist/virtual-list.d.ts.map +1 -1
- package/dist/virtual-list.js +44 -7
- package/dist/virtual-list.js.map +1 -1
- package/package.json +13 -3
package/dist/tags-input.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags-input.d.ts","sourceRoot":"","sources":["../src/tags-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"tags-input.d.ts","sourceRoot":"","sources":["../src/tags-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,+CAA+C,CAAC;AAUvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IACjD,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACnD;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC3C,gEAAgE;IAChE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC7C,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gGAAgG;IAChG,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEH,eAAO,MAAM,SAAS;WA/Bb,MAAM;WACN,SAAS,MAAM,EAAE;kBACV,SAAS,MAAM,EAAE;mBAChB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI;IAChD,6EAA6E;eAClE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI;IAClD;;;OAGG;oBACa,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;aAC9B,eAAe;iBACX,SAAS,kBAAkB,EAAE;IAC1C,gEAAgE;wBAC5C,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM;IAC3C;;;;OAIG;kBACW,SAAS,mBAAmB,EAAE;IAC5C,wDAAwD;uBACrC,MAAM;kBACX,MAAM;kBACN,MAAM;eACT,OAAO;gBACN,MAAM;IAClB,gGAAgG;kBAClF,uBAAuB;qDAiLrC,CAAC"}
|
package/dist/tags-input.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { removeTagAt, resolveTagsInputActiveSuggestion, resolveTagsInputCommit, tagsInputBehaviorDefaults, tagsInputRecipe, } from "@hjmds/design-contracts/components/tags-input";
|
|
3
|
-
import { forwardRef, useRef, useState, } from "react";
|
|
3
|
+
import { forwardRef, useId, useRef, useState, } from "react";
|
|
4
4
|
import { classNames, composeRefs, useControllableState } from "./internal.js";
|
|
5
5
|
export const TagsInput = forwardRef(function TagsInput({ label, tags: controlledTags, defaultTags, onTagsChange, onReject, onDraftChange, policy, commitKeys = tagsInputRecipe.defaults.commitKeys, suggestions, suggestionsLabel, composeRemoveLabel, placeholder, description, disabled = false, className, layoutStyle, }, forwardedRef) {
|
|
6
6
|
const [tags, setTags] = useControllableState({
|
|
@@ -13,15 +13,20 @@ export const TagsInput = forwardRef(function TagsInput({ label, tags: controlled
|
|
|
13
13
|
// removes it. Removing on the first press loses work with no warning.
|
|
14
14
|
const [armedIndex, setArmedIndex] = useState(null);
|
|
15
15
|
const [activeSuggestionId, setActiveSuggestionId] = useState(null);
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const [suggestionsDismissed, setSuggestionsDismissed] = useState(false);
|
|
17
|
+
const hasSuggestions = (suggestions?.length ?? 0) > 0 && draft.trim().length > 0;
|
|
18
|
+
const openSuggestions = hasSuggestions && !suggestionsDismissed;
|
|
19
|
+
const activeSuggestion = suggestions?.find((item) => item.id === activeSuggestionId && !item.disabled) ?? null;
|
|
18
20
|
const inputRef = useRef(null);
|
|
19
|
-
const id = `hjm-tags-${
|
|
21
|
+
const id = `hjm-tags-${useId().replaceAll(":", "")}`;
|
|
20
22
|
const changeDraft = (next) => {
|
|
21
23
|
setDraft(next);
|
|
24
|
+
setSuggestionsDismissed(false);
|
|
22
25
|
onDraftChange?.(next);
|
|
23
26
|
};
|
|
24
27
|
const commit = (value) => {
|
|
28
|
+
if (disabled)
|
|
29
|
+
return;
|
|
25
30
|
const result = resolveTagsInputCommit(tags, value, policy ?? {});
|
|
26
31
|
if (!result.accepted) {
|
|
27
32
|
onReject?.(result);
|
|
@@ -39,15 +44,20 @@ export const TagsInput = forwardRef(function TagsInput({ label, tags: controlled
|
|
|
39
44
|
inputRef.current?.focus();
|
|
40
45
|
};
|
|
41
46
|
const onKeyDown = (event) => {
|
|
47
|
+
// IME confirmation keys belong to the composition, not tag submission.
|
|
48
|
+
if (disabled || event.nativeEvent.isComposing || event.keyCode === 229)
|
|
49
|
+
return;
|
|
42
50
|
const key = event.key;
|
|
43
|
-
if (
|
|
51
|
+
if (hasSuggestions && (key === "ArrowDown" || key === "ArrowUp")) {
|
|
44
52
|
event.preventDefault();
|
|
53
|
+
setSuggestionsDismissed(false);
|
|
45
54
|
setActiveSuggestionId(resolveTagsInputActiveSuggestion(suggestions ?? [], activeSuggestionId, key === "ArrowDown" ? "next" : "previous"));
|
|
46
55
|
return;
|
|
47
56
|
}
|
|
48
|
-
if (key === "Escape" &&
|
|
57
|
+
if (key === "Escape" && openSuggestions) {
|
|
49
58
|
// Dismissing the candidate list must not clear what the user typed.
|
|
50
59
|
event.preventDefault();
|
|
60
|
+
setSuggestionsDismissed(true);
|
|
51
61
|
setActiveSuggestionId(null);
|
|
52
62
|
return;
|
|
53
63
|
}
|
|
@@ -78,11 +88,11 @@ export const TagsInput = forwardRef(function TagsInput({ label, tags: controlled
|
|
|
78
88
|
"--hjm-tags-gap": `${tagsInputRecipe.frame.gap}px`,
|
|
79
89
|
"--hjm-tags-tag-min-height": `${tagsInputRecipe.tag.minHeight}px`,
|
|
80
90
|
"--hjm-tags-remove-target": `${tagsInputRecipe.remove.minTouchTarget}px`,
|
|
81
|
-
}, onClick: () => inputRef.current?.focus(), children: [_jsx("ul", { className: "hjm-tags-input__list", children: tags.map((tag, index) => (_jsxs("li", { className: "hjm-tags-input__tag", "data-armed": armedIndex === index || undefined, children: [_jsx("span", { children: tag }), _jsx("button", { type: "button", "aria-label": composeRemoveLabel(tag), className: "hjm-tags-input__remove", disabled: disabled, onClick: () => remove(index), children: "\u00D7" })] }, `${tag}-${index}`))) }), _jsx("input", { ref: composeRefs(inputRef, forwardedRef), id: id, type: "text", className: "hjm-tags-input__input", value: draft, placeholder: placeholder, disabled: disabled, "aria-describedby": description ? `${id}-description` : undefined, role: suggestions ? "combobox" : undefined, "aria-expanded": suggestions ? openSuggestions : undefined, "aria-controls": suggestions && openSuggestions ? `${id}-suggestions` : undefined, "aria-activedescendant": activeSuggestion ? `${id}-suggestion-${activeSuggestion.id}` : undefined, "aria-autocomplete": suggestions ? "list" : undefined, onChange: (event) => { changeDraft(event.target.value); setArmedIndex(null); setActiveSuggestionId(null); }, onKeyDown: onKeyDown, onBlur: () => { if (commitKeys.includes("Blur"))
|
|
91
|
+
}, onClick: () => inputRef.current?.focus(), children: [_jsx("ul", { className: "hjm-tags-input__list", children: tags.map((tag, index) => (_jsxs("li", { className: "hjm-tags-input__tag", "data-armed": armedIndex === index || undefined, children: [_jsx("span", { children: tag }), _jsx("button", { type: "button", "aria-label": composeRemoveLabel(tag), className: "hjm-tags-input__remove", disabled: disabled, onClick: () => remove(index), children: "\u00D7" })] }, `${tag}-${index}`))) }), _jsx("input", { ref: composeRefs(inputRef, forwardedRef), id: id, type: "text", className: "hjm-tags-input__input", value: draft, placeholder: placeholder, disabled: disabled, "aria-describedby": description ? `${id}-description` : undefined, role: suggestions ? "combobox" : undefined, "aria-expanded": suggestions ? openSuggestions : undefined, "aria-controls": suggestions && openSuggestions ? `${id}-suggestions` : undefined, "aria-activedescendant": openSuggestions && activeSuggestion ? `${id}-suggestion-${activeSuggestion.id}` : undefined, "aria-autocomplete": suggestions ? "list" : undefined, onChange: (event) => { changeDraft(event.target.value); setArmedIndex(null); setActiveSuggestionId(null); }, onKeyDown: onKeyDown, onBlur: () => { if (commitKeys.includes("Blur"))
|
|
82
92
|
commit(draft); setArmedIndex(null); } })] }), openSuggestions ? (_jsx("ul", { id: `${id}-suggestions`, role: "listbox", "aria-label": suggestionsLabel, className: "hjm-tags-input__suggestions", children: (suggestions ?? []).map((item) => (_jsx("li", { id: `${id}-suggestion-${item.id}`, role: "option", "aria-selected": item.id === activeSuggestionId, "aria-disabled": item.disabled || undefined, className: "hjm-tags-input__suggestion", onMouseDown: (event) => {
|
|
83
93
|
// Commit before blur so the draft is still there to replace.
|
|
84
94
|
event.preventDefault();
|
|
85
|
-
if (!item.disabled)
|
|
95
|
+
if (!disabled && !item.disabled)
|
|
86
96
|
commit(item.value ?? item.label);
|
|
87
97
|
}, onMouseEnter: () => { if (!item.disabled)
|
|
88
98
|
setActiveSuggestionId(item.id); }, children: item.label }, item.id))) })) : null, description ? _jsx("p", { id: `${id}-description`, className: "hjm-tags-input__description", children: description }) : null] }));
|
package/dist/tags-input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags-input.js","sourceRoot":"","sources":["../src/tags-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,gCAAgC,EAChC,sBAAsB,EACtB,yBAAyB,EACzB,eAAe,GAKhB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,UAAU,EACV,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAmC9E,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAmC,SAAS,SAAS,CACtF,EACE,KAAK,EACL,IAAI,EAAE,cAAc,EACpB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,MAAM,EACN,UAAU,GAAG,eAAe,CAAC,QAAQ,CAAC,UAAU,EAChD,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,WAAW,GACZ,EACD,YAAY;IAEZ,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,oBAAoB,CAAoB;QAC9D,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;QAClE,YAAY,EAAE,WAAW,IAAI,EAAE;QAC/B,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;KAClE,CAAC,CAAC;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACv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CAAC","sourcesContent":["import {\n removeTagAt,\n resolveTagsInputActiveSuggestion,\n resolveTagsInputCommit,\n tagsInputBehaviorDefaults,\n tagsInputRecipe,\n type TagsInputCommitKey,\n type TagsInputCommitResult,\n type TagsInputPolicy,\n type TagsInputSuggestion,\n} from \"@hjmds/design-contracts/components/tags-input\";\nimport {\n forwardRef,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n} from \"react\";\nimport { classNames, composeRefs, useControllableState } from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type TagsInputProps = Readonly<{\n label: string;\n tags?: readonly string[];\n defaultTags?: readonly string[];\n onTagsChange?: (tags: readonly string[]) => void;\n /** Fires when a value could not be committed, with the contract's reason. */\n onReject?: (result: TagsInputCommitResult) => void;\n /**\n * The text being typed. A product filtering `suggestions` cannot do it\n * without this — the draft lives here, not in the product's state.\n */\n onDraftChange?: (draft: string) => void;\n policy?: TagsInputPolicy;\n commitKeys?: readonly TagsInputCommitKey[];\n /** Composes one tag's remove-control name from the tag text. */\n composeRemoveLabel: (tag: string) => string;\n /**\n * Candidates for the current draft, already filtered by the product. Present\n * them and the field becomes the multi-select combobox case without a second\n * value shape.\n */\n suggestions?: readonly TagsInputSuggestion[];\n /** Localized accessible name for the candidate list. */\n suggestionsLabel?: string;\n placeholder?: string;\n description?: string;\n disabled?: boolean;\n className?: string;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const TagsInput = forwardRef<HTMLInputElement, TagsInputProps>(function TagsInput(\n {\n label,\n tags: controlledTags,\n defaultTags,\n onTagsChange,\n onReject,\n onDraftChange,\n policy,\n commitKeys = tagsInputRecipe.defaults.commitKeys,\n suggestions,\n suggestionsLabel,\n composeRemoveLabel,\n placeholder,\n description,\n disabled = false,\n className,\n layoutStyle,\n },\n forwardedRef,\n) {\n const [tags, setTags] = useControllableState<readonly string[]>({\n ...(controlledTags === undefined ? {} : { value: controlledTags }),\n defaultValue: defaultTags ?? [],\n ...(onTagsChange === undefined ? {} : { onChange: onTagsChange }),\n });\n const [draft, setDraft] = useState(\"\");\n // Backspace on an empty field selects the last tag first; a second press\n // removes it. Removing on the first press loses work with no warning.\n const [armedIndex, setArmedIndex] = useState<number | null>(null);\n const [activeSuggestionId, setActiveSuggestionId] = useState<string | null>(null);\n const openSuggestions = (suggestions?.length ?? 0) > 0 && draft.trim().length > 0;\n const activeSuggestion = suggestions?.find((item) => item.id === activeSuggestionId) ?? null;\n const inputRef = useRef<HTMLInputElement>(null);\n const id = `hjm-tags-${label.replace(/\\s+/gu, \"-\")}`;\n\n const changeDraft = (next: string) => {\n setDraft(next);\n onDraftChange?.(next);\n };\n const commit = (value: string) => {\n const result = resolveTagsInputCommit(tags, value, policy ?? {});\n if (!result.accepted) { onReject?.(result); return; }\n setTags([...tags, result.value]);\n setDraft(\"\");\n onDraftChange?.(\"\");\n setArmedIndex(null);\n setActiveSuggestionId(null);\n };\n const remove = (index: number) => {\n setTags(removeTagAt(tags, index));\n setArmedIndex(null);\n inputRef.current?.focus();\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n const key = event.key;\n if (openSuggestions && (key === \"ArrowDown\" || key === \"ArrowUp\")) {\n event.preventDefault();\n setActiveSuggestionId(resolveTagsInputActiveSuggestion(\n suggestions ?? [],\n activeSuggestionId,\n key === \"ArrowDown\" ? \"next\" : \"previous\",\n ));\n return;\n }\n if (key === \"Escape\" && activeSuggestionId !== null) {\n // Dismissing the candidate list must not clear what the user typed.\n event.preventDefault();\n setActiveSuggestionId(null);\n return;\n }\n const isCommitKey =\n (key === \"Enter\" && commitKeys.includes(\"Enter\")) ||\n (key === \",\" && commitKeys.includes(\"Comma\")) ||\n (key === \" \" && commitKeys.includes(\"Space\"));\n if (isCommitKey) {\n event.preventDefault();\n // A highlighted candidate wins over the raw text; otherwise the typed\n // value commits, which is what makes this different from a Select.\n commit(activeSuggestion ? activeSuggestion.value ?? activeSuggestion.label : draft);\n return;\n }\n if (key !== \"Backspace\" || draft.length > 0 || tags.length === 0) {\n if (key !== \"Backspace\") setArmedIndex(null);\n return;\n }\n event.preventDefault();\n const last = tags.length - 1;\n if (armedIndex === last || tagsInputBehaviorDefaults.backspaceRemovesLastTag) remove(last);\n else setArmedIndex(last);\n };\n\n return (\n <div style={layoutStyle} className={classNames(\"hjm-tags-input\", className)} data-disabled={disabled || undefined}>\n <label className=\"hjm-tags-input__label\" htmlFor={id}>{label}</label>\n <div\n className=\"hjm-tags-input__frame\"\n style={{\n \"--hjm-tags-min-height\": `${tagsInputRecipe.frame.minHeight}px`,\n \"--hjm-tags-gap\": `${tagsInputRecipe.frame.gap}px`,\n \"--hjm-tags-tag-min-height\": `${tagsInputRecipe.tag.minHeight}px`,\n \"--hjm-tags-remove-target\": `${tagsInputRecipe.remove.minTouchTarget}px`,\n } as CSSProperties}\n onClick={() => inputRef.current?.focus()}\n >\n <ul className=\"hjm-tags-input__list\">\n {tags.map((tag, index) => (\n <li key={`${tag}-${index}`} className=\"hjm-tags-input__tag\" data-armed={armedIndex === index || undefined}>\n <span>{tag}</span>\n <button\n type=\"button\"\n aria-label={composeRemoveLabel(tag)}\n className=\"hjm-tags-input__remove\"\n disabled={disabled}\n onClick={() => remove(index)}\n >\n ×\n </button>\n </li>\n ))}\n </ul>\n <input\n ref={composeRefs(inputRef, forwardedRef)}\n id={id}\n type=\"text\"\n className=\"hjm-tags-input__input\"\n value={draft}\n placeholder={placeholder}\n disabled={disabled}\n aria-describedby={description ? `${id}-description` : undefined}\n role={suggestions ? \"combobox\" : undefined}\n aria-expanded={suggestions ? openSuggestions : undefined}\n aria-controls={suggestions && openSuggestions ? `${id}-suggestions` : undefined}\n aria-activedescendant={activeSuggestion ? `${id}-suggestion-${activeSuggestion.id}` : undefined}\n aria-autocomplete={suggestions ? \"list\" : undefined}\n onChange={(event) => { changeDraft(event.target.value); setArmedIndex(null); setActiveSuggestionId(null); }}\n onKeyDown={onKeyDown}\n onBlur={() => { if (commitKeys.includes(\"Blur\")) commit(draft); setArmedIndex(null); }}\n />\n </div>\n {openSuggestions ? (\n <ul id={`${id}-suggestions`} role=\"listbox\" aria-label={suggestionsLabel} className=\"hjm-tags-input__suggestions\">\n {(suggestions ?? []).map((item) => (\n <li\n key={item.id}\n id={`${id}-suggestion-${item.id}`}\n role=\"option\"\n aria-selected={item.id === activeSuggestionId}\n aria-disabled={item.disabled || undefined}\n className=\"hjm-tags-input__suggestion\"\n onMouseDown={(event) => {\n // Commit before blur so the draft is still there to replace.\n event.preventDefault();\n if (!item.disabled) commit(item.value ?? item.label);\n }}\n onMouseEnter={() => { if (!item.disabled) setActiveSuggestionId(item.id); }}\n >\n {item.label}\n </li>\n ))}\n </ul>\n ) : null}\n {description ? <p id={`${id}-description`} className=\"hjm-tags-input__description\">{description}</p> : null}\n </div>\n );\n});\n"]}
|
|
1
|
+
{"version":3,"file":"tags-input.js","sourceRoot":"","sources":["../src/tags-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,gCAAgC,EAChC,sBAAsB,EACtB,yBAAyB,EACzB,eAAe,GAKhB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAmC9E,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAmC,SAAS,SAAS,CACtF,EACE,KAAK,EACL,IAAI,EAAE,cAAc,EACpB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,MAAM,EACN,UAAU,GAAG,eAAe,CAAC,QAAQ,CAAC,UAAU,EAChD,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,WAAW,GACZ,EACD,YAAY;IAE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EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACjC,aAEE,EAAE,EAAE,GAAG,EAAE,eAAe,IAAI,CAAC,EAAE,EAAE,EACjC,IAAI,EAAC,QAAQ,mBACE,IAAI,CAAC,EAAE,KAAK,kBAAkB,mBAC9B,IAAI,CAAC,QAAQ,IAAI,SAAS,EACzC,SAAS,EAAC,4BAA4B,EACtC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;wBACrB,6DAA6D;wBAC7D,KAAK,CAAC,cAAc,EAAE,CAAC;wBACvB,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ;4BAAE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;oBACpE,CAAC,EACD,YAAY,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ;wBAAE,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAE1E,IAAI,CAAC,KAAK,IAbN,IAAI,CAAC,EAAE,CAcT,CACN,CAAC,GACC,CACN,CAAC,CAAC,CAAC,IAAI,EACP,WAAW,CAAC,CAAC,CAAC,YAAG,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,SAAS,EAAC,6BAA6B,YAAE,WAAW,GAAK,CAAC,CAAC,CAAC,IAAI,IACvG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import {\n removeTagAt,\n resolveTagsInputActiveSuggestion,\n resolveTagsInputCommit,\n tagsInputBehaviorDefaults,\n tagsInputRecipe,\n type TagsInputCommitKey,\n type TagsInputCommitResult,\n type TagsInputPolicy,\n type TagsInputSuggestion,\n} from \"@hjmds/design-contracts/components/tags-input\";\nimport {\n forwardRef,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n} from \"react\";\nimport { classNames, composeRefs, useControllableState } from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type TagsInputProps = Readonly<{\n label: string;\n tags?: readonly string[];\n defaultTags?: readonly string[];\n onTagsChange?: (tags: readonly string[]) => void;\n /** Fires when a value could not be committed, with the contract's reason. */\n onReject?: (result: TagsInputCommitResult) => void;\n /**\n * The text being typed. A product filtering `suggestions` cannot do it\n * without this — the draft lives here, not in the product's state.\n */\n onDraftChange?: (draft: string) => void;\n policy?: TagsInputPolicy;\n commitKeys?: readonly TagsInputCommitKey[];\n /** Composes one tag's remove-control name from the tag text. */\n composeRemoveLabel: (tag: string) => string;\n /**\n * Candidates for the current draft, already filtered by the product. Present\n * them and the field becomes the multi-select combobox case without a second\n * value shape.\n */\n suggestions?: readonly TagsInputSuggestion[];\n /** Localized accessible name for the candidate list. */\n suggestionsLabel?: string;\n placeholder?: string;\n description?: string;\n disabled?: boolean;\n className?: string;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const TagsInput = forwardRef<HTMLInputElement, TagsInputProps>(function TagsInput(\n {\n label,\n tags: controlledTags,\n defaultTags,\n onTagsChange,\n onReject,\n onDraftChange,\n policy,\n commitKeys = tagsInputRecipe.defaults.commitKeys,\n suggestions,\n suggestionsLabel,\n composeRemoveLabel,\n placeholder,\n description,\n disabled = false,\n className,\n layoutStyle,\n },\n forwardedRef,\n) {\n const [tags, setTags] = useControllableState<readonly string[]>({\n ...(controlledTags === undefined ? {} : { value: controlledTags }),\n defaultValue: defaultTags ?? [],\n ...(onTagsChange === undefined ? {} : { onChange: onTagsChange }),\n });\n const [draft, setDraft] = useState(\"\");\n // Backspace on an empty field selects the last tag first; a second press\n // removes it. Removing on the first press loses work with no warning.\n const [armedIndex, setArmedIndex] = useState<number | null>(null);\n const [activeSuggestionId, setActiveSuggestionId] = useState<string | null>(null);\n const [suggestionsDismissed, setSuggestionsDismissed] = useState(false);\n const hasSuggestions = (suggestions?.length ?? 0) > 0 && draft.trim().length > 0;\n const openSuggestions = hasSuggestions && !suggestionsDismissed;\n const activeSuggestion = suggestions?.find((item) => item.id === activeSuggestionId && !item.disabled) ?? null;\n const inputRef = useRef<HTMLInputElement>(null);\n const id = `hjm-tags-${useId().replaceAll(\":\", \"\")}`;\n\n const changeDraft = (next: string) => {\n setDraft(next);\n setSuggestionsDismissed(false);\n onDraftChange?.(next);\n };\n const commit = (value: string) => {\n if (disabled) return;\n const result = resolveTagsInputCommit(tags, value, policy ?? {});\n if (!result.accepted) { onReject?.(result); return; }\n setTags([...tags, result.value]);\n setDraft(\"\");\n onDraftChange?.(\"\");\n setArmedIndex(null);\n setActiveSuggestionId(null);\n };\n const remove = (index: number) => {\n setTags(removeTagAt(tags, index));\n setArmedIndex(null);\n inputRef.current?.focus();\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n // IME confirmation keys belong to the composition, not tag submission.\n if (disabled || event.nativeEvent.isComposing || event.keyCode === 229) return;\n const key = event.key;\n if (hasSuggestions && (key === \"ArrowDown\" || key === \"ArrowUp\")) {\n event.preventDefault();\n setSuggestionsDismissed(false);\n setActiveSuggestionId(resolveTagsInputActiveSuggestion(\n suggestions ?? [],\n activeSuggestionId,\n key === \"ArrowDown\" ? \"next\" : \"previous\",\n ));\n return;\n }\n if (key === \"Escape\" && openSuggestions) {\n // Dismissing the candidate list must not clear what the user typed.\n event.preventDefault();\n setSuggestionsDismissed(true);\n setActiveSuggestionId(null);\n return;\n }\n const isCommitKey =\n (key === \"Enter\" && commitKeys.includes(\"Enter\")) ||\n (key === \",\" && commitKeys.includes(\"Comma\")) ||\n (key === \" \" && commitKeys.includes(\"Space\"));\n if (isCommitKey) {\n event.preventDefault();\n // A highlighted candidate wins over the raw text; otherwise the typed\n // value commits, which is what makes this different from a Select.\n commit(activeSuggestion ? activeSuggestion.value ?? activeSuggestion.label : draft);\n return;\n }\n if (key !== \"Backspace\" || draft.length > 0 || tags.length === 0) {\n if (key !== \"Backspace\") setArmedIndex(null);\n return;\n }\n event.preventDefault();\n const last = tags.length - 1;\n if (armedIndex === last || tagsInputBehaviorDefaults.backspaceRemovesLastTag) remove(last);\n else setArmedIndex(last);\n };\n\n return (\n <div style={layoutStyle} className={classNames(\"hjm-tags-input\", className)} data-disabled={disabled || undefined}>\n <label className=\"hjm-tags-input__label\" htmlFor={id}>{label}</label>\n <div\n className=\"hjm-tags-input__frame\"\n style={{\n \"--hjm-tags-min-height\": `${tagsInputRecipe.frame.minHeight}px`,\n \"--hjm-tags-gap\": `${tagsInputRecipe.frame.gap}px`,\n \"--hjm-tags-tag-min-height\": `${tagsInputRecipe.tag.minHeight}px`,\n \"--hjm-tags-remove-target\": `${tagsInputRecipe.remove.minTouchTarget}px`,\n } as CSSProperties}\n onClick={() => inputRef.current?.focus()}\n >\n <ul className=\"hjm-tags-input__list\">\n {tags.map((tag, index) => (\n <li key={`${tag}-${index}`} className=\"hjm-tags-input__tag\" data-armed={armedIndex === index || undefined}>\n <span>{tag}</span>\n <button\n type=\"button\"\n aria-label={composeRemoveLabel(tag)}\n className=\"hjm-tags-input__remove\"\n disabled={disabled}\n onClick={() => remove(index)}\n >\n ×\n </button>\n </li>\n ))}\n </ul>\n <input\n ref={composeRefs(inputRef, forwardedRef)}\n id={id}\n type=\"text\"\n className=\"hjm-tags-input__input\"\n value={draft}\n placeholder={placeholder}\n disabled={disabled}\n aria-describedby={description ? `${id}-description` : undefined}\n role={suggestions ? \"combobox\" : undefined}\n aria-expanded={suggestions ? openSuggestions : undefined}\n aria-controls={suggestions && openSuggestions ? `${id}-suggestions` : undefined}\n aria-activedescendant={openSuggestions && activeSuggestion ? `${id}-suggestion-${activeSuggestion.id}` : undefined}\n aria-autocomplete={suggestions ? \"list\" : undefined}\n onChange={(event) => { changeDraft(event.target.value); setArmedIndex(null); setActiveSuggestionId(null); }}\n onKeyDown={onKeyDown}\n onBlur={() => { if (commitKeys.includes(\"Blur\")) commit(draft); setArmedIndex(null); }}\n />\n </div>\n {openSuggestions ? (\n <ul id={`${id}-suggestions`} role=\"listbox\" aria-label={suggestionsLabel} className=\"hjm-tags-input__suggestions\">\n {(suggestions ?? []).map((item) => (\n <li\n key={item.id}\n id={`${id}-suggestion-${item.id}`}\n role=\"option\"\n aria-selected={item.id === activeSuggestionId}\n aria-disabled={item.disabled || undefined}\n className=\"hjm-tags-input__suggestion\"\n onMouseDown={(event) => {\n // Commit before blur so the draft is still there to replace.\n event.preventDefault();\n if (!disabled && !item.disabled) commit(item.value ?? item.label);\n }}\n onMouseEnter={() => { if (!item.disabled) setActiveSuggestionId(item.id); }}\n >\n {item.label}\n </li>\n ))}\n </ul>\n ) : null}\n {description ? <p id={`${id}-description`} className=\"hjm-tags-input__description\">{description}</p> : null}\n </div>\n );\n});\n"]}
|
package/dist/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,2DAA2D,CAAC;AAgBnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG,aAAa,GACvC,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAmB7C,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,yBAAyB,GAC/B,aAAa,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,2DAA2D,CAAC;AAgBnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG,aAAa,GACvC,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAmB7C,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,yBAAyB,GAC/B,aAAa,CA8Lf"}
|
package/dist/theme.js
CHANGED
|
@@ -154,6 +154,17 @@ export function createHjmThemeStyle(value) {
|
|
|
154
154
|
style["--hjm-toast-action-background"] = resolveColorReference(toastRecipe.action.background, palette);
|
|
155
155
|
style["--hjm-toast-action-color"] = resolveColorReference(toastRecipe.action.color, palette);
|
|
156
156
|
style["--hjm-toast-description-color"] = resolveColorReference(toastRecipe.description.color, palette);
|
|
157
|
+
// Panel toast (2026-10-10): media column, step progress and action alignment come from the same recipe Native reads.
|
|
158
|
+
style["--hjm-toast-media-size"] = `${toastRecipe.media.size}px`;
|
|
159
|
+
style["--hjm-toast-action-align"] = toastRecipe.action.align;
|
|
160
|
+
style["--hjm-toast-pressed-opacity"] = toastRecipe.states.pressedOpacity;
|
|
161
|
+
style["--hjm-toast-progress-gap"] = `${toastRecipe.progress.gap}px`;
|
|
162
|
+
style["--hjm-toast-progress-dot"] = `${toastRecipe.progress.dotSize}px`;
|
|
163
|
+
style["--hjm-toast-progress-current-scale"] = String(toastRecipe.progress.currentScale);
|
|
164
|
+
style["--hjm-toast-progress-done"] = resolveColorReference(toastRecipe.progress.doneColor, palette);
|
|
165
|
+
style["--hjm-toast-progress-upcoming"] = resolveColorReference(toastRecipe.progress.upcomingColor, palette);
|
|
166
|
+
style["--hjm-toast-progress-label"] = resolveColorReference(toastRecipe.progress.labelColor, palette);
|
|
167
|
+
style["--hjm-toast-progress-current-label"] = resolveColorReference(toastRecipe.progress.currentLabelColor, palette);
|
|
157
168
|
const toastExit = toastRecipe.transition.web.exit;
|
|
158
169
|
style["--hjm-toast-exit-duration"] = environment.reducedMotion ? "0ms" : `${toastExit.duration}ms`;
|
|
159
170
|
style["--hjm-toast-exit-easing"] = `cubic-bezier(${easing[toastExit.easing].join(", ")})`;
|
package/dist/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,y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AG,GAAG,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACtE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACjE,2EAA2E;QAC3E,yEAAyE;QACzE,KAAK,CAAC,wBAAwB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1C,GAAG,oBAAoB,CAAC,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC;IACxE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { resolveSurfaceFillOpacity } from \"@hjmds/design-contracts/palette-contrast\";\nimport {\n backdrop,\n control,\n easing,\n fontFamily,\n resolveFontFamilyStack,\n fontWeight,\n motion,\n layer,\n radius,\n shadow,\n spacing,\n stroke,\n typography,\n} from \"@hjmds/design-contracts/foundations\";\nimport { resolveColorReference } from \"@hjmds/design-contracts/color-references\";\nimport { focusIndicatorContract } from \"@hjmds/design-contracts/contracts\";\nimport {\n visibleControlHeight,\n type DesignSystemProviderValue,\n} from \"@hjmds/design-contracts/components/design-system-provider\";\nimport { buttonRecipe, fieldRecipe } from \"@hjmds/design-contracts/recipes/base\";\nimport {\n bottomNavigationRecipe,\n comboboxRecipe,\n dialogRecipe,\n listRowRecipe,\n menuRecipe,\n searchFieldRecipe,\n selectRecipe,\n sheetRecipe,\n skeletonRecipe,\n tooltipRecipe,\n switchRecipe,\n toastRecipe,\n} from \"@hjmds/design-contracts/recipes\";\nimport type { CSSProperties } from \"react\";\n\nexport type HjmThemeStyle = CSSProperties &\n Record<`--hjm-${string}`, string | number>;\n\nfunction kebab(value: string): string {\n return value.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\ntype ShadowToken = Readonly<{ color: string; opacity: number; radius: number; offsetY: number }>;\n\n// RN shadow token -> CSS; blur = radius, as react-native-web maps it.\nfunction shadowCss(token: ShadowToken, offsetX = 0): string {\n const hex = token.color.replace(\"#\", \"\");\n const [r, g, b] = [0, 2, 4].map((start) => Number.parseInt(hex.slice(start, start + 2), 16));\n return `${offsetX}px ${token.offsetY}px ${token.radius}px rgb(${r} ${g} ${b} / ${Math.round(token.opacity * 100)}%)`;\n}\n\nfunction rem(value: number): string {\n return `${Number((value / 16).toFixed(5))}rem`;\n}\n\nexport function createHjmThemeStyle(\n value: DesignSystemProviderValue,\n): HjmThemeStyle {\n const { environment, palette } = value;\n const profileTokens = value.designProfile?.tokens;\n const style: HjmThemeStyle = {\n \"--hjm-backdrop-modal\": `color-mix(in srgb, ${backdrop.modal.color} ${backdrop.modal.opacity * 100}%, transparent)`,\n \"--hjm-text-scale\": environment.textScale,\n \"--hjm-motion-scale\": environment.reducedMotion ? 0 : 1,\n colorScheme: environment.theme,\n backgroundColor: palette.theme.bg,\n color: palette.theme.text,\n };\n\n for (const [name, color] of Object.entries(palette.theme)) {\n style[`--hjm-color-${kebab(name)}`] = color;\n }\n for (const [name, color] of Object.entries(palette.statusAccents)) {\n style[`--hjm-accent-${kebab(name)}`] = color;\n }\n for (const [name, color] of Object.entries(palette.statusAccentFills)) {\n style[`--hjm-accent-fill-${kebab(name)}`] = color;\n }\n for (const [name, value] of Object.entries(spacing)) {\n style[`--hjm-space-${kebab(name)}`] = `${value}px`;\n }\n for (const [name, value] of Object.entries(profileTokens?.radius ?? radius)) {\n style[`--hjm-radius-${kebab(name)}`] = `${value}px`;\n }\n for (const [name, value] of Object.entries(profileTokens?.typography ?? typography)) {\n style[`--hjm-type-${kebab(name)}-size`] =\n `calc(${rem(value.fontSize)} * var(--hjm-text-scale))`;\n style[`--hjm-type-${kebab(name)}-line-height`] =\n `calc(${rem(value.lineHeight)} * var(--hjm-text-scale))`;\n style[`--hjm-type-${kebab(name)}-weight`] = value.fontWeight;\n }\n for (const [name, value] of Object.entries(fontWeight)) {\n style[`--hjm-font-weight-${kebab(name)}`] = value;\n }\n for (const [name, value] of Object.entries(motion)) {\n style[`--hjm-motion-${kebab(name)}`] = environment.reducedMotion\n ? \"0ms\"\n : `${value}ms`;\n }\n\n style[\"--hjm-font-family-ui\"] = (profileTokens?.fontFamily.ui ?? fontFamily.ui).join(\", \");\n style[\"--hjm-font-family-code\"] = (profileTokens?.fontFamily.code ?? fontFamily.code).join(\", \");\n // Roles resolve from the nearest Provider, including portal/nested reset contexts.\n for (const role of [\"display\", \"reading\"] as const) {\n style[`--hjm-font-family-${role}`] = resolveFontFamilyStack(profileTokens?.fontFamily ?? fontFamily, role).join(\", \");\n }\n for (const [name, value] of Object.entries(stroke)) {\n style[`--hjm-stroke-${kebab(name)}`] = `${value}px`;\n }\n // Unset before 1.4.1, so focus rules were invalid and drew no ring.\n style[\"--hjm-color-focus\"] = resolveColorReference(focusIndicatorContract.color, palette);\n style[\"--hjm-focus-width\"] = `${focusIndicatorContract.width}px`;\n style[\"--hjm-focus-offset\"] = `${focusIndicatorContract.offset}px`;\n style[\"--hjm-bottom-navigation-pressed-background\"] = resolveColorReference(\n bottomNavigationRecipe.states.pressedBackground,\n palette,\n );\n // Row rhythm and the leading frame come from the recipe so the stylesheet\n // does not carry a second copy of the same numbers.\n style[\"--hjm-list-row-gap\"] = rem(listRowRecipe.gap);\n style[\"--hjm-list-row-leading-size\"] = rem(listRowRecipe.leadingSize);\n for (const [name, value] of Object.entries(switchRecipe.sizes)) {\n style[`--hjm-switch-${kebab(name)}-width`] = rem(value.width);\n style[`--hjm-switch-${kebab(name)}-height`] = rem(value.height);\n style[`--hjm-switch-${kebab(name)}-thumb`] = rem(value.thumb);\n style[`--hjm-switch-${kebab(name)}-inset`] = rem(value.inset);\n style[`--hjm-switch-${kebab(name)}-offset`] = rem(\n value.width - value.thumb - value.inset * 2,\n );\n }\n for (const [name, value] of Object.entries(listRowRecipe.density)) {\n style[`--hjm-list-row-${kebab(name)}-one-line`] = rem(value.oneLineMinHeight);\n style[`--hjm-list-row-${kebab(name)}-two-line`] = rem(value.twoLineMinHeight);\n style[`--hjm-list-row-${kebab(name)}-padding-inline`] = rem(value.paddingHorizontal);\n style[`--hjm-list-row-${kebab(name)}-padding-block`] = rem(value.paddingVertical);\n }\n // The recipe owns these; a second copy in the stylesheet drifts silently\n // because the gates read that file as text only. Block and text heights\n // already resolve through --hjm-space-*, so they are not re-emitted.\n const skeletonCurve = easing[skeletonRecipe.animation.easing];\n style[\"--hjm-skeleton-circle-size\"] =\n `${skeletonRecipe.shapes.circle.defaultHeight}px`;\n style[\"--hjm-skeleton-duration\"] = `${skeletonRecipe.animation.duration}ms`;\n style[\"--hjm-skeleton-easing\"] = `cubic-bezier(${skeletonCurve.join(\", \")})`;\n style[\"--hjm-skeleton-from-opacity\"] = skeletonRecipe.animation.fromOpacity;\n style[\"--hjm-skeleton-to-opacity\"] = skeletonRecipe.animation.toOpacity;\n // Export the shared order instead of keeping a second numeric scale in CSS.\n for (const [name, value] of Object.entries(layer)) {\n style[`--hjm-layer-${kebab(name)}`] = value;\n }\n for (const [name, token] of Object.entries(profileTokens?.shadow ?? shadow)) {\n style[`--hjm-shadow-${kebab(name)}`] = shadowCss(token);\n }\n const surfaceMaterial = value.designProfile?.material.surface;\n // Defaults are emitted on every Provider, so a nested neutral profile clears\n // inherited glass/clay. Unsupported transparency remains an opaque CSS fill.\n style[\"--hjm-surface-blur\"] = surfaceMaterial?.blurStrength ? `blur(${surfaceMaterial.blurStrength * 32}px)` : \"none\";\n style[\"--hjm-surface-fill-opacity\"] = surfaceMaterial?.blurStrength ? resolveSurfaceFillOpacity(surfaceMaterial.fillOpacity, palette.theme) : 1;\n const insetShadow = surfaceMaterial?.insetShadows.length\n ? surfaceMaterial.insetShadows.map(token => `inset ${shadowCss(token, token.offsetX)}`).join(\", \")\n : \"\";\n style[\"--hjm-surface-inset-shadow\"] = insetShadow || \"none\";\n style[\"--hjm-surface-raised-shadow\"] = shadowCss(profileTokens?.shadow.floating ?? shadow.floating) + (insetShadow ? `, ${insetShadow}` : \"\");\n // BottomCTA overlaps content above it (bottomCtaRecipe rationale). Profile\n // strength is shared, but its shadow must cast upward rather than behind the\n // footer; preserve the stylesheet-only legacy path when no profile is supplied.\n style[\"--hjm-bottom-cta-shadow\"] = profileTokens\n ? shadowCss({ ...profileTokens.shadow.floating, offsetY: -Math.abs(profileTokens.shadow.floating.offsetY) })\n : \"none\";\n // Toast body metrics follow a selected profile; emit legacy values when no profile is selected\n // instead of inheriting a parent profile or changing standalone presentation.\n style[\"--hjm-toast-title-line-height\"] = profileTokens ? \"var(--hjm-type-body-line-height)\" : \"1.35\";\n style[\"--hjm-toast-description-line-height\"] = profileTokens ? \"var(--hjm-type-body-line-height)\" : \"1.45\";\n // Overlay chrome and sizes come from the recipes Native reads (1.5.0).\n for (const [name, chrome] of [[\"dialog\", dialogRecipe.content], [\"sheet\", sheetRecipe.content], [\"toast\", toastRecipe.surface]] as const) {\n style[`--hjm-${name}-background`] = resolveColorReference(chrome.background, palette);\n style[`--hjm-${name}-border`] = resolveColorReference(chrome.border, palette);\n style[`--hjm-${name}-border-width`] = `${chrome.borderWidth}px`;\n style[`--hjm-${name}-radius`] = `var(--hjm-radius-${chrome.radius})`;\n // Recipes select the floating role. Resolve its value from the profile so\n // dialogs, sheets and toasts cannot retain neutral shadows after a theme switch.\n style[`--hjm-${name}-shadow`] = shadowCss(profileTokens?.shadow.floating ?? chrome.shadow);\n }\n style[\"--hjm-sheet-max-height\"] = `${sheetRecipe.content.maxHeightRatio * 100}dvh`;\n style[\"--hjm-sheet-max-width\"] = `${sheetRecipe.web.maxWidth}px`;\n style[\"--hjm-sheet-handle-width\"] = `${sheetRecipe.handle.width}px`;\n style[\"--hjm-sheet-handle-height\"] = `${sheetRecipe.handle.height}px`;\n style[\"--hjm-sheet-handle-color\"] = resolveColorReference(sheetRecipe.handle.color, palette);\n for (const [name, ratio] of Object.entries(sheetRecipe.sizes)) {\n if (ratio !== null) style[`--hjm-sheet-size-${name}`] = `${ratio * 100}dvh`;\n }\n // Toast badge/action colours resolve from the recipe so Web and Native share one tone table (1.10.0).\n for (const [tone, contract] of Object.entries(toastRecipe.tones)) {\n style[`--hjm-toast-accent-${tone}`] = resolveColorReference(contract.accent, palette);\n style[`--hjm-toast-badge-${tone}`] = resolveColorReference(contract.badge, palette);\n }\n style[\"--hjm-toast-badge-size\"] = `${toastRecipe.icon.badgeDiameter}px`;\n style[\"--hjm-toast-action-background\"] = resolveColorReference(toastRecipe.action.background, palette);\n style[\"--hjm-toast-action-color\"] = resolveColorReference(toastRecipe.action.color, palette);\n style[\"--hjm-toast-description-color\"] = resolveColorReference(toastRecipe.description.color, palette);\n const toastExit = toastRecipe.transition.web.exit;\n style[\"--hjm-toast-exit-duration\"] = environment.reducedMotion ? \"0ms\" : `${toastExit.duration}ms`;\n style[\"--hjm-toast-exit-easing\"] = `cubic-bezier(${easing[toastExit.easing].join(\", \")})`;\n // SearchField geometry comes from searchFieldRecipe (2026-10-06 follow-up). Web had drawn TextField's\n // 16px padding for both sizes and a 44px clear button even at `medium`, where the recipe and Native\n // use a 36 circle with a 4px hit slop (44 target, 36 footprint).\n for (const [name, size] of Object.entries(searchFieldRecipe.sizes)) {\n style[`--hjm-search-field-padding-${name}`] = `${size.paddingHorizontal}px`;\n style[`--hjm-search-field-gap-${name}`] = `${size.gap}px`;\n style[`--hjm-search-field-clear-${name}`] = `${size.clearDiameter}px`;\n style[`--hjm-search-field-clear-slop-${name}`] = `${size.clearHitSlop}px`;\n }\n style[\"--hjm-tooltip-max-width\"] = `${tooltipRecipe.content.maxWidth}px`;\n style[\"--hjm-tooltip-padding\"] = `${tooltipRecipe.surface.padding}px`;\n // Floating collection surfaces read their padding from the recipe (2026-10-06): the stylesheet's 4 had drifted from 8.\n style[\"--hjm-menu-padding\"] = `${menuRecipe.surface.padding}px`;\n style[\"--hjm-select-popover-padding\"] = `${selectRecipe.popover.padding}px`;\n style[\"--hjm-combobox-popover-padding\"] = `${comboboxRecipe.popover.padding}px`;\n style[\"--hjm-tooltip-collision-padding\"] = `${tooltipRecipe.positioning.collisionPadding}px`;\n style[\"--hjm-button-pressed-opacity\"] = buttonRecipe.opacity.pressed;\n style[\"--hjm-button-disabled-opacity\"] = buttonRecipe.opacity.disabled;\n style[\"--hjm-field-border-width\"] = `${fieldRecipe.borderWidth}px`;\n style[\"--hjm-field-focus-ring-width\"] = `${fieldRecipe.focusRingWidth}px`;\n style[\"--hjm-field-disabled-opacity\"] = fieldRecipe.disabledOpacity;\n style[\"--hjm-control-min-touch-target\"] = `${control.minTouchTarget}px`;\n style[\"--hjm-control-field-height\"] = `${control.fieldHeight}px`;\n style[\"--hjm-field-multiline-min-height\"] = rem(fieldRecipe.multilineMinHeight);\n style[\"--hjm-field-padding-block\"] = rem(fieldRecipe.paddingVertical);\n for (const [name, value] of Object.entries(control.buttonHeight)) {\n // The axis is applied to the emitted variables rather than to each rule so\n // that every stylesheet consumer of a control height honours it at once.\n style[`--hjm-control-button-${kebab(name)}`] =\n `${visibleControlHeight(value, environment.minimumVisualTarget)}px`;\n }\n\n return style;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EACL,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,EACV,sBAAsB,EACtB,UAAU,EACV,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,MAAM,EACN,UAAU,GACX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EACL,oBAAoB,GAErB,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,UAAU,EACV,iBAAiB,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AAW,CAAC,WAAW,IAAI,CAAC;IACnE,KAAK,CAAC,8BAA8B,CAAC,GAAG,GAAG,WAAW,CAAC,cAAc,IAAI,CAAC;IAC1E,KAAK,CAAC,8BAA8B,CAAC,GAAG,WAAW,CAAC,eAAe,CAAC;IACpE,KAAK,CAAC,gCAAgC,CAAC,GAAG,GAAG,OAAO,CAAC,cAAc,IAAI,CAAC;IACxE,KAAK,CAAC,4BAA4B,CAAC,GAAG,GAAG,OAAO,CAAC,WAAW,IAAI,CAAC;IACjE,KAAK,CAAC,kCAAkC,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAChF,KAAK,CAAC,2BAA2B,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACtE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACjE,2EAA2E;QAC3E,yEAAyE;QACzE,KAAK,CAAC,wBAAwB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1C,GAAG,oBAAoB,CAAC,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC;IACxE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { resolveSurfaceFillOpacity } from \"@hjmds/design-contracts/palette-contrast\";\nimport {\n backdrop,\n control,\n easing,\n fontFamily,\n resolveFontFamilyStack,\n fontWeight,\n motion,\n layer,\n radius,\n shadow,\n spacing,\n stroke,\n typography,\n} from \"@hjmds/design-contracts/foundations\";\nimport { resolveColorReference } from \"@hjmds/design-contracts/color-references\";\nimport { focusIndicatorContract } from \"@hjmds/design-contracts/contracts\";\nimport {\n visibleControlHeight,\n type DesignSystemProviderValue,\n} from \"@hjmds/design-contracts/components/design-system-provider\";\nimport { buttonRecipe, fieldRecipe } from \"@hjmds/design-contracts/recipes/base\";\nimport {\n bottomNavigationRecipe,\n comboboxRecipe,\n dialogRecipe,\n listRowRecipe,\n menuRecipe,\n searchFieldRecipe,\n selectRecipe,\n sheetRecipe,\n skeletonRecipe,\n tooltipRecipe,\n switchRecipe,\n toastRecipe,\n} from \"@hjmds/design-contracts/recipes\";\nimport type { CSSProperties } from \"react\";\n\nexport type HjmThemeStyle = CSSProperties &\n Record<`--hjm-${string}`, string | number>;\n\nfunction kebab(value: string): string {\n return value.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\ntype ShadowToken = Readonly<{ color: string; opacity: number; radius: number; offsetY: number }>;\n\n// RN shadow token -> CSS; blur = radius, as react-native-web maps it.\nfunction shadowCss(token: ShadowToken, offsetX = 0): string {\n const hex = token.color.replace(\"#\", \"\");\n const [r, g, b] = [0, 2, 4].map((start) => Number.parseInt(hex.slice(start, start + 2), 16));\n return `${offsetX}px ${token.offsetY}px ${token.radius}px rgb(${r} ${g} ${b} / ${Math.round(token.opacity * 100)}%)`;\n}\n\nfunction rem(value: number): string {\n return `${Number((value / 16).toFixed(5))}rem`;\n}\n\nexport function createHjmThemeStyle(\n value: DesignSystemProviderValue,\n): HjmThemeStyle {\n const { environment, palette } = value;\n const profileTokens = value.designProfile?.tokens;\n const style: HjmThemeStyle = {\n \"--hjm-backdrop-modal\": `color-mix(in srgb, ${backdrop.modal.color} ${backdrop.modal.opacity * 100}%, transparent)`,\n \"--hjm-text-scale\": environment.textScale,\n \"--hjm-motion-scale\": environment.reducedMotion ? 0 : 1,\n colorScheme: environment.theme,\n backgroundColor: palette.theme.bg,\n color: palette.theme.text,\n };\n\n for (const [name, color] of Object.entries(palette.theme)) {\n style[`--hjm-color-${kebab(name)}`] = color;\n }\n for (const [name, color] of Object.entries(palette.statusAccents)) {\n style[`--hjm-accent-${kebab(name)}`] = color;\n }\n for (const [name, color] of Object.entries(palette.statusAccentFills)) {\n style[`--hjm-accent-fill-${kebab(name)}`] = color;\n }\n for (const [name, value] of Object.entries(spacing)) {\n style[`--hjm-space-${kebab(name)}`] = `${value}px`;\n }\n for (const [name, value] of Object.entries(profileTokens?.radius ?? radius)) {\n style[`--hjm-radius-${kebab(name)}`] = `${value}px`;\n }\n for (const [name, value] of Object.entries(profileTokens?.typography ?? typography)) {\n style[`--hjm-type-${kebab(name)}-size`] =\n `calc(${rem(value.fontSize)} * var(--hjm-text-scale))`;\n style[`--hjm-type-${kebab(name)}-line-height`] =\n `calc(${rem(value.lineHeight)} * var(--hjm-text-scale))`;\n style[`--hjm-type-${kebab(name)}-weight`] = value.fontWeight;\n }\n for (const [name, value] of Object.entries(fontWeight)) {\n style[`--hjm-font-weight-${kebab(name)}`] = value;\n }\n for (const [name, value] of Object.entries(motion)) {\n style[`--hjm-motion-${kebab(name)}`] = environment.reducedMotion\n ? \"0ms\"\n : `${value}ms`;\n }\n\n style[\"--hjm-font-family-ui\"] = (profileTokens?.fontFamily.ui ?? fontFamily.ui).join(\", \");\n style[\"--hjm-font-family-code\"] = (profileTokens?.fontFamily.code ?? fontFamily.code).join(\", \");\n // Roles resolve from the nearest Provider, including portal/nested reset contexts.\n for (const role of [\"display\", \"reading\"] as const) {\n style[`--hjm-font-family-${role}`] = resolveFontFamilyStack(profileTokens?.fontFamily ?? fontFamily, role).join(\", \");\n }\n for (const [name, value] of Object.entries(stroke)) {\n style[`--hjm-stroke-${kebab(name)}`] = `${value}px`;\n }\n // Unset before 1.4.1, so focus rules were invalid and drew no ring.\n style[\"--hjm-color-focus\"] = resolveColorReference(focusIndicatorContract.color, palette);\n style[\"--hjm-focus-width\"] = `${focusIndicatorContract.width}px`;\n style[\"--hjm-focus-offset\"] = `${focusIndicatorContract.offset}px`;\n style[\"--hjm-bottom-navigation-pressed-background\"] = resolveColorReference(\n bottomNavigationRecipe.states.pressedBackground,\n palette,\n );\n // Row rhythm and the leading frame come from the recipe so the stylesheet\n // does not carry a second copy of the same numbers.\n style[\"--hjm-list-row-gap\"] = rem(listRowRecipe.gap);\n style[\"--hjm-list-row-leading-size\"] = rem(listRowRecipe.leadingSize);\n for (const [name, value] of Object.entries(switchRecipe.sizes)) {\n style[`--hjm-switch-${kebab(name)}-width`] = rem(value.width);\n style[`--hjm-switch-${kebab(name)}-height`] = rem(value.height);\n style[`--hjm-switch-${kebab(name)}-thumb`] = rem(value.thumb);\n style[`--hjm-switch-${kebab(name)}-inset`] = rem(value.inset);\n style[`--hjm-switch-${kebab(name)}-offset`] = rem(\n value.width - value.thumb - value.inset * 2,\n );\n }\n for (const [name, value] of Object.entries(listRowRecipe.density)) {\n style[`--hjm-list-row-${kebab(name)}-one-line`] = rem(value.oneLineMinHeight);\n style[`--hjm-list-row-${kebab(name)}-two-line`] = rem(value.twoLineMinHeight);\n style[`--hjm-list-row-${kebab(name)}-padding-inline`] = rem(value.paddingHorizontal);\n style[`--hjm-list-row-${kebab(name)}-padding-block`] = rem(value.paddingVertical);\n }\n // The recipe owns these; a second copy in the stylesheet drifts silently\n // because the gates read that file as text only. Block and text heights\n // already resolve through --hjm-space-*, so they are not re-emitted.\n const skeletonCurve = easing[skeletonRecipe.animation.easing];\n style[\"--hjm-skeleton-circle-size\"] =\n `${skeletonRecipe.shapes.circle.defaultHeight}px`;\n style[\"--hjm-skeleton-duration\"] = `${skeletonRecipe.animation.duration}ms`;\n style[\"--hjm-skeleton-easing\"] = `cubic-bezier(${skeletonCurve.join(\", \")})`;\n style[\"--hjm-skeleton-from-opacity\"] = skeletonRecipe.animation.fromOpacity;\n style[\"--hjm-skeleton-to-opacity\"] = skeletonRecipe.animation.toOpacity;\n // Export the shared order instead of keeping a second numeric scale in CSS.\n for (const [name, value] of Object.entries(layer)) {\n style[`--hjm-layer-${kebab(name)}`] = value;\n }\n for (const [name, token] of Object.entries(profileTokens?.shadow ?? shadow)) {\n style[`--hjm-shadow-${kebab(name)}`] = shadowCss(token);\n }\n const surfaceMaterial = value.designProfile?.material.surface;\n // Defaults are emitted on every Provider, so a nested neutral profile clears\n // inherited glass/clay. Unsupported transparency remains an opaque CSS fill.\n style[\"--hjm-surface-blur\"] = surfaceMaterial?.blurStrength ? `blur(${surfaceMaterial.blurStrength * 32}px)` : \"none\";\n style[\"--hjm-surface-fill-opacity\"] = surfaceMaterial?.blurStrength ? resolveSurfaceFillOpacity(surfaceMaterial.fillOpacity, palette.theme) : 1;\n const insetShadow = surfaceMaterial?.insetShadows.length\n ? surfaceMaterial.insetShadows.map(token => `inset ${shadowCss(token, token.offsetX)}`).join(\", \")\n : \"\";\n style[\"--hjm-surface-inset-shadow\"] = insetShadow || \"none\";\n style[\"--hjm-surface-raised-shadow\"] = shadowCss(profileTokens?.shadow.floating ?? shadow.floating) + (insetShadow ? `, ${insetShadow}` : \"\");\n // BottomCTA overlaps content above it (bottomCtaRecipe rationale). Profile\n // strength is shared, but its shadow must cast upward rather than behind the\n // footer; preserve the stylesheet-only legacy path when no profile is supplied.\n style[\"--hjm-bottom-cta-shadow\"] = profileTokens\n ? shadowCss({ ...profileTokens.shadow.floating, offsetY: -Math.abs(profileTokens.shadow.floating.offsetY) })\n : \"none\";\n // Toast body metrics follow a selected profile; emit legacy values when no profile is selected\n // instead of inheriting a parent profile or changing standalone presentation.\n style[\"--hjm-toast-title-line-height\"] = profileTokens ? \"var(--hjm-type-body-line-height)\" : \"1.35\";\n style[\"--hjm-toast-description-line-height\"] = profileTokens ? \"var(--hjm-type-body-line-height)\" : \"1.45\";\n // Overlay chrome and sizes come from the recipes Native reads (1.5.0).\n for (const [name, chrome] of [[\"dialog\", dialogRecipe.content], [\"sheet\", sheetRecipe.content], [\"toast\", toastRecipe.surface]] as const) {\n style[`--hjm-${name}-background`] = resolveColorReference(chrome.background, palette);\n style[`--hjm-${name}-border`] = resolveColorReference(chrome.border, palette);\n style[`--hjm-${name}-border-width`] = `${chrome.borderWidth}px`;\n style[`--hjm-${name}-radius`] = `var(--hjm-radius-${chrome.radius})`;\n // Recipes select the floating role. Resolve its value from the profile so\n // dialogs, sheets and toasts cannot retain neutral shadows after a theme switch.\n style[`--hjm-${name}-shadow`] = shadowCss(profileTokens?.shadow.floating ?? chrome.shadow);\n }\n style[\"--hjm-sheet-max-height\"] = `${sheetRecipe.content.maxHeightRatio * 100}dvh`;\n style[\"--hjm-sheet-max-width\"] = `${sheetRecipe.web.maxWidth}px`;\n style[\"--hjm-sheet-handle-width\"] = `${sheetRecipe.handle.width}px`;\n style[\"--hjm-sheet-handle-height\"] = `${sheetRecipe.handle.height}px`;\n style[\"--hjm-sheet-handle-color\"] = resolveColorReference(sheetRecipe.handle.color, palette);\n for (const [name, ratio] of Object.entries(sheetRecipe.sizes)) {\n if (ratio !== null) style[`--hjm-sheet-size-${name}`] = `${ratio * 100}dvh`;\n }\n // Toast badge/action colours resolve from the recipe so Web and Native share one tone table (1.10.0).\n for (const [tone, contract] of Object.entries(toastRecipe.tones)) {\n style[`--hjm-toast-accent-${tone}`] = resolveColorReference(contract.accent, palette);\n style[`--hjm-toast-badge-${tone}`] = resolveColorReference(contract.badge, palette);\n }\n style[\"--hjm-toast-badge-size\"] = `${toastRecipe.icon.badgeDiameter}px`;\n style[\"--hjm-toast-action-background\"] = resolveColorReference(toastRecipe.action.background, palette);\n style[\"--hjm-toast-action-color\"] = resolveColorReference(toastRecipe.action.color, palette);\n style[\"--hjm-toast-description-color\"] = resolveColorReference(toastRecipe.description.color, palette);\n // Panel toast (2026-10-10): media column, step progress and action alignment come from the same recipe Native reads.\n style[\"--hjm-toast-media-size\"] = `${toastRecipe.media.size}px`;\n style[\"--hjm-toast-action-align\"] = toastRecipe.action.align;\n style[\"--hjm-toast-pressed-opacity\"] = toastRecipe.states.pressedOpacity;\n style[\"--hjm-toast-progress-gap\"] = `${toastRecipe.progress.gap}px`;\n style[\"--hjm-toast-progress-dot\"] = `${toastRecipe.progress.dotSize}px`;\n style[\"--hjm-toast-progress-current-scale\"] = String(toastRecipe.progress.currentScale);\n style[\"--hjm-toast-progress-done\"] = resolveColorReference(toastRecipe.progress.doneColor, palette);\n style[\"--hjm-toast-progress-upcoming\"] = resolveColorReference(toastRecipe.progress.upcomingColor, palette);\n style[\"--hjm-toast-progress-label\"] = resolveColorReference(toastRecipe.progress.labelColor, palette);\n style[\"--hjm-toast-progress-current-label\"] = resolveColorReference(toastRecipe.progress.currentLabelColor, palette);\n const toastExit = toastRecipe.transition.web.exit;\n style[\"--hjm-toast-exit-duration\"] = environment.reducedMotion ? \"0ms\" : `${toastExit.duration}ms`;\n style[\"--hjm-toast-exit-easing\"] = `cubic-bezier(${easing[toastExit.easing].join(\", \")})`;\n // SearchField geometry comes from searchFieldRecipe (2026-10-06 follow-up). Web had drawn TextField's\n // 16px padding for both sizes and a 44px clear button even at `medium`, where the recipe and Native\n // use a 36 circle with a 4px hit slop (44 target, 36 footprint).\n for (const [name, size] of Object.entries(searchFieldRecipe.sizes)) {\n style[`--hjm-search-field-padding-${name}`] = `${size.paddingHorizontal}px`;\n style[`--hjm-search-field-gap-${name}`] = `${size.gap}px`;\n style[`--hjm-search-field-clear-${name}`] = `${size.clearDiameter}px`;\n style[`--hjm-search-field-clear-slop-${name}`] = `${size.clearHitSlop}px`;\n }\n style[\"--hjm-tooltip-max-width\"] = `${tooltipRecipe.content.maxWidth}px`;\n style[\"--hjm-tooltip-padding\"] = `${tooltipRecipe.surface.padding}px`;\n // Floating collection surfaces read their padding from the recipe (2026-10-06): the stylesheet's 4 had drifted from 8.\n style[\"--hjm-menu-padding\"] = `${menuRecipe.surface.padding}px`;\n style[\"--hjm-select-popover-padding\"] = `${selectRecipe.popover.padding}px`;\n style[\"--hjm-combobox-popover-padding\"] = `${comboboxRecipe.popover.padding}px`;\n style[\"--hjm-tooltip-collision-padding\"] = `${tooltipRecipe.positioning.collisionPadding}px`;\n style[\"--hjm-button-pressed-opacity\"] = buttonRecipe.opacity.pressed;\n style[\"--hjm-button-disabled-opacity\"] = buttonRecipe.opacity.disabled;\n style[\"--hjm-field-border-width\"] = `${fieldRecipe.borderWidth}px`;\n style[\"--hjm-field-focus-ring-width\"] = `${fieldRecipe.focusRingWidth}px`;\n style[\"--hjm-field-disabled-opacity\"] = fieldRecipe.disabledOpacity;\n style[\"--hjm-control-min-touch-target\"] = `${control.minTouchTarget}px`;\n style[\"--hjm-control-field-height\"] = `${control.fieldHeight}px`;\n style[\"--hjm-field-multiline-min-height\"] = rem(fieldRecipe.multilineMinHeight);\n style[\"--hjm-field-padding-block\"] = rem(fieldRecipe.paddingVertical);\n for (const [name, value] of Object.entries(control.buttonHeight)) {\n // The axis is applied to the emitted variables rather than to each rule so\n // that every stylesheet consumer of a control height honours it at once.\n style[`--hjm-control-button-${kebab(name)}`] =\n `${visibleControlHeight(value, environment.minimumVisualTarget)}px`;\n }\n\n return style;\n}\n"]}
|
package/dist/toast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../src/toast.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../src/toast.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,OAAO,EACZ,KAAK,mBAAmB,EAExB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAEvB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC5B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAYL,KAAK,cAAc,EAEnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAwLf,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,GACjF,QAAQ,CAAC;IACP,UAAU,EAAE,eAAe,CAAC;IAC5B,gBAAgB,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACxD,CAAC,CAAC;AAEL,wFAAwF;AACxF,eAAO,MAAM,KAAK;gBALF,eAAe;s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ACd,eAAe,EACf,MAAM,EACN,YAAgB,EAChB,MAAM,EACN,UAAU,GACX,EAAE,kBAAkB,+BA8NpB"}
|
package/dist/toast.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { isLargeTextScale } from "@hjmds/design-contracts/components/design-system-provider";
|
|
3
|
-
import { createToastStore, resolveToastDescriptor, } from "@hjmds/design-contracts/components/toast";
|
|
3
|
+
import { createToastStore, createToastSession, resolveToastDescriptor, } from "@hjmds/design-contracts/components/toast";
|
|
4
4
|
import { toastRecipe, } from "@hjmds/design-contracts/recipes";
|
|
5
5
|
import { createContext, forwardRef, useContext, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore, } from "react";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
@@ -19,7 +19,15 @@ const toneGlyphPaths = {
|
|
|
19
19
|
function ToneGlyph({ tone }) {
|
|
20
20
|
return (_jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", focusable: "false", children: _jsx("path", { d: toneGlyphPaths[toastRecipe.tones[tone].mark] }) }));
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
// Steps read as an ordered list with `aria-current="step"`; the dots are decoration beside each label,
|
|
23
|
+
// so state never depends on colour alone (WCAG 1.4.1).
|
|
24
|
+
function ToastProgress({ progress }) {
|
|
25
|
+
return (_jsx("ol", { className: "hjm-toast__progress", children: progress.steps.map((step, index) => {
|
|
26
|
+
const state = index < progress.current ? "done" : index === progress.current ? "current" : "upcoming";
|
|
27
|
+
return (_jsxs("li", { className: "hjm-toast__progress-step", "data-state": state, "aria-current": state === "current" ? "step" : undefined, children: [_jsx("span", { className: "hjm-toast__progress-dot", "aria-hidden": "true" }), _jsx("span", { className: "hjm-toast__progress-label", children: step })] }, `${index}-${step}`));
|
|
28
|
+
}) }));
|
|
29
|
+
}
|
|
30
|
+
const ToastCard = forwardRef(function ToastCard({ descriptor, phase, onAction, onPress, onDismiss, onPointerPause, onPointerResume, onFocusPause, onFocusResume, locale, className, htmlProps, }, ref) {
|
|
23
31
|
const baseId = useId().replaceAll(":", "");
|
|
24
32
|
const titleId = `${baseId}-toast-title`;
|
|
25
33
|
const descriptionId = `${baseId}-toast-description`;
|
|
@@ -34,7 +42,11 @@ const ToastCard = forwardRef(function ToastCard({ descriptor, phase, onAction, o
|
|
|
34
42
|
htmlProps?.onBlurCapture?.(event);
|
|
35
43
|
if (!event.currentTarget.contains(event.relatedTarget))
|
|
36
44
|
onFocusResume?.();
|
|
37
|
-
}, onKeyDown: handleKeyDown, children: [_jsx("span", { className: "hjm-visually-hidden", role: descriptor.priority === "high" ? "alert" : "status", children: descriptor.announcement }),
|
|
45
|
+
}, onKeyDown: handleKeyDown, children: [_jsx("span", { className: "hjm-visually-hidden", role: descriptor.priority === "high" ? "alert" : "status", children: descriptor.announcement }), descriptor.press ? (
|
|
46
|
+
// A sibling button covers the card without nesting action/close buttons in a button.
|
|
47
|
+
_jsx("button", { type: "button", className: "hjm-toast__press", "aria-label": descriptor.press.accessibilityLabel, "aria-describedby": descriptionId, disabled: phase !== "visible", onClick: onPress })) : null, _jsx("span", { className: "hjm-toast__tone-mark", "aria-hidden": "true" }), descriptor.media === null ? (_jsx("span", { className: "hjm-toast__icon", "aria-hidden": "true", children: _jsx(ToneGlyph, { tone: descriptor.tone }) })) : (
|
|
48
|
+
// Product media (mascot, avatar) takes the badge column; it is decorative, the copy carries meaning.
|
|
49
|
+
_jsx("span", { className: "hjm-toast__media", "aria-hidden": "true", children: descriptor.media })), _jsxs("span", { className: "hjm-toast__content", children: [descriptor.title ? (_jsx("strong", { id: titleId, className: "hjm-toast__title", children: descriptor.title })) : null, _jsx("span", { id: descriptionId, className: "hjm-toast__description", children: descriptor.description }), descriptor.progress ? _jsx(ToastProgress, { progress: descriptor.progress }) : null] }), descriptor.action ? (_jsx("button", { type: "button", className: "hjm-toast__action", "aria-label": descriptor.action.accessibilityLabel, onClick: onAction, children: descriptor.action.label })) : null, _jsx("button", { type: "button", className: "hjm-toast__close", "aria-label": descriptor.closeLabel, onClick: () => onDismiss("close-action"), children: _jsx("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", focusable: "false", children: _jsx("path", { d: "M18 6 6 18M6 6l12 12" }) }) })] }));
|
|
38
50
|
});
|
|
39
51
|
/** Controlled single-toast renderer; ToastProvider supplies the full FIFO lifecycle. */
|
|
40
52
|
export const Toast = forwardRef(function Toast(
|
|
@@ -43,19 +55,30 @@ export const Toast = forwardRef(function Toast(
|
|
|
43
55
|
// consumers that already pass them, so the rest is forwarded (the card keeps its own role/labelling).
|
|
44
56
|
{ descriptor, onDismissRequest, className, ...htmlProps }, ref) {
|
|
45
57
|
const resolved = resolveToastDescriptor(descriptor);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
// Controlled rendering leaves timing/removal to the host, but shares the store's
|
|
59
|
+
// once-per-revision invocation and callback-then-dismiss semantics.
|
|
60
|
+
const session = useMemo(() => {
|
|
61
|
+
const next = createToastSession(descriptor);
|
|
62
|
+
next.show();
|
|
63
|
+
return next;
|
|
49
64
|
}, [descriptor]);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
65
|
+
const invoke = (kind) => {
|
|
66
|
+
if (session.getSnapshot().phase !== "visible")
|
|
67
|
+
return;
|
|
68
|
+
try {
|
|
69
|
+
if (kind === "press")
|
|
70
|
+
session.invokePress();
|
|
71
|
+
else
|
|
72
|
+
session.invokeAction();
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
const snapshot = session.getSnapshot();
|
|
76
|
+
if (snapshot.phase === "closing" && snapshot.dismissReason) {
|
|
77
|
+
onDismissRequest(snapshot.dismissReason);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return (_jsx(ToastCard, { ref: ref, descriptor: resolved, phase: "visible", ...(className === undefined ? {} : { className }), htmlProps: htmlProps, onDismiss: (reason) => { session.dismiss(reason); onDismissRequest(reason); }, onAction: () => invoke("action"), onPress: () => invoke("press") }));
|
|
59
82
|
});
|
|
60
83
|
const ToastContext = createContext(null);
|
|
61
84
|
export function useToast() {
|
|
@@ -76,7 +99,7 @@ function renderStoreToast(snapshot, store, locale) {
|
|
|
76
99
|
if (snapshot.phase !== "visible" && snapshot.phase !== "closing")
|
|
77
100
|
return null;
|
|
78
101
|
const id = snapshot.descriptor.id;
|
|
79
|
-
return (_jsx(ToastCard, { descriptor: snapshot.descriptor, phase: snapshot.phase, ...(locale === undefined ? {} : { locale }), onAction: () => store.invokeAction(id), onDismiss: (reason) => store.dismiss(id, reason), onPointerPause: () => store.pause(id, "pointer"), onPointerResume: () => store.resume(id, "pointer"), onFocusPause: () => store.pause(id, "focus"), onFocusResume: () => store.resume(id, "focus") }, id));
|
|
102
|
+
return (_jsx(ToastCard, { descriptor: snapshot.descriptor, phase: snapshot.phase, ...(locale === undefined ? {} : { locale }), onAction: () => store.invokeAction(id), onPress: () => store.invokePress(id), onDismiss: (reason) => store.dismiss(id, reason), onPointerPause: () => store.pause(id, "pointer"), onPointerResume: () => store.resume(id, "pointer"), onFocusPause: () => store.pause(id, "focus"), onFocusResume: () => store.resume(id, "focus") }, id));
|
|
80
103
|
}
|
|
81
104
|
export function ToastProvider({ children, label, placement = toastRecipe.defaults.placement, store, initialToasts = [], maxVisible, maxQueued, duplicatePolicy, timerUpdatePolicy, overflowPolicy, portalContainer, locale, bottomOffset = 0, hotkey, hotkeyHelp, }) {
|
|
82
105
|
if (label.trim().length === 0)
|
|
@@ -206,6 +229,8 @@ export function ToastProvider({ children, label, placement = toastRecipe.default
|
|
|
206
229
|
window.addEventListener("pagehide", pause);
|
|
207
230
|
window.addEventListener("pageshow", resume);
|
|
208
231
|
document.addEventListener("visibilitychange", handleVisibility);
|
|
232
|
+
// A provider may mount while its tab is already hidden, before any change event.
|
|
233
|
+
handleVisibility();
|
|
209
234
|
return () => {
|
|
210
235
|
window.removeEventListener("blur", pause);
|
|
211
236
|
window.removeEventListener("focus", resume);
|