@hjmds/design-contracts 1.26.0 → 1.27.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/agreement.d.ts +1 -0
- package/dist/agreement.d.ts.map +1 -1
- package/dist/agreement.js +2 -1
- package/dist/agreement.js.map +1 -1
- package/dist/auth-screen.d.ts +1 -1
- package/dist/behaviors.d.ts +1 -1
- package/dist/calendar.d.ts +1 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +4 -1
- package/dist/calendar.js.map +1 -1
- package/dist/catalog.d.ts +78 -30
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +10 -5
- package/dist/catalog.js.map +1 -1
- package/dist/chart.d.ts +2 -0
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +1 -1
- package/dist/chart.js.map +1 -1
- package/dist/component-definitions.d.ts +1 -0
- package/dist/component-definitions.d.ts.map +1 -1
- package/dist/component-definitions.js +1 -0
- package/dist/component-definitions.js.map +1 -1
- package/dist/component-recipes.d.ts +53 -6
- package/dist/component-recipes.d.ts.map +1 -1
- package/dist/component-recipes.js +64 -10
- package/dist/component-recipes.js.map +1 -1
- package/dist/data-table.d.ts +11 -0
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +5 -0
- package/dist/data-table.js.map +1 -1
- package/dist/description-list.d.ts +3 -0
- package/dist/description-list.d.ts.map +1 -1
- package/dist/description-list.js +5 -1
- package/dist/description-list.js.map +1 -1
- package/dist/design-profile-layout.d.ts +28 -0
- package/dist/design-profile-layout.d.ts.map +1 -1
- package/dist/design-profile-layout.js +27 -3
- package/dist/design-profile-layout.js.map +1 -1
- package/dist/design-profile.d.ts.map +1 -1
- package/dist/design-profile.js +40 -8
- package/dist/design-profile.js.map +1 -1
- package/dist/field-group.d.ts +13 -0
- package/dist/field-group.d.ts.map +1 -1
- package/dist/field-group.js +17 -2
- package/dist/field-group.js.map +1 -1
- package/dist/foundations.d.ts +24 -11
- package/dist/foundations.d.ts.map +1 -1
- package/dist/foundations.js +40 -7
- package/dist/foundations.js.map +1 -1
- package/dist/heading.d.ts +5 -5
- package/dist/image-choice.d.ts +23 -0
- package/dist/image-choice.d.ts.map +1 -0
- package/dist/image-choice.js +26 -0
- package/dist/image-choice.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/masonry.d.ts +8 -0
- package/dist/masonry.d.ts.map +1 -1
- package/dist/masonry.js +12 -1
- package/dist/masonry.js.map +1 -1
- package/dist/number-field.d.ts +2 -2
- package/dist/number-field.d.ts.map +1 -1
- package/dist/number-field.js +4 -2
- package/dist/number-field.js.map +1 -1
- package/dist/qr-code-recipe.d.ts +1 -0
- package/dist/qr-code-recipe.d.ts.map +1 -1
- package/dist/qr-code-recipe.js +3 -1
- package/dist/qr-code-recipe.js.map +1 -1
- package/dist/recipes.d.ts +1 -1
- package/dist/recipes.d.ts.map +1 -1
- package/dist/recipes.js +1 -1
- package/dist/recipes.js.map +1 -1
- package/dist/result.d.ts +9 -0
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +5 -0
- package/dist/result.js.map +1 -1
- package/dist/screen-patterns.d.ts +139 -2
- package/dist/screen-patterns.d.ts.map +1 -1
- package/dist/screen-patterns.js +140 -1
- package/dist/screen-patterns.js.map +1 -1
- package/dist/sheet.d.ts +15 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +20 -1
- package/dist/sheet.js.map +1 -1
- package/dist/showcase.d.ts +27 -27
- package/dist/showcase.js +27 -27
- package/dist/showcase.js.map +1 -1
- package/dist/tag.d.ts +10 -2
- package/dist/tag.d.ts.map +1 -1
- package/dist/tag.js +3 -2
- package/dist/tag.js.map +1 -1
- package/dist/tags-input.d.ts +6 -0
- package/dist/tags-input.d.ts.map +1 -1
- package/dist/tags-input.js +3 -1
- package/dist/tags-input.js.map +1 -1
- package/dist/text-formats.d.ts +2 -2
- package/dist/top.d.ts +2 -2
- package/dist/transfer-list.d.ts +1 -1
- package/dist/transfer-list.d.ts.map +1 -1
- package/dist/transfer-list.js +2 -1
- package/dist/transfer-list.js.map +1 -1
- package/dist/upload-item.d.ts +1 -10
- package/dist/upload-item.d.ts.map +1 -1
- package/dist/upload-item.js +1 -2
- package/dist/upload-item.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/docs/activity-chip.md +4 -3
- package/docs/catalog-freeze.json +5 -2
- package/docs/chart.md +1 -1
- package/docs/consumer-policy.md +13 -6
- package/docs/description-list.md +4 -0
- package/docs/design-profile.md +28 -2
- package/docs/font-roles.md +1 -1
- package/docs/generated/component-maturity.md +5 -4
- package/docs/generated/renderer-evidence.json +92 -6
- package/docs/generated/renderer-evidence.md +5 -3
- package/docs/generated/showcase-manifest.json +49 -1
- package/docs/gravity-letters.md +7 -2
- package/docs/masonry.md +4 -2
- package/docs/screen-patterns.md +5 -2
- package/docs/showcase.md +7 -9
- package/docs/stable-promotion.md +13 -1
- package/docs/usage/README.md +40 -10
- package/docs/usage/SELECTION.md +30 -4
- package/docs/usage/STANDARD.md +11 -2
- package/docs/usage/components/account-switcher.md +98 -0
- package/docs/usage/components/activity-chip.md +4 -4
- package/docs/usage/components/badge.md +1 -1
- package/docs/usage/components/bezier-editor.md +99 -0
- package/docs/usage/components/bottom-cta.md +2 -1
- package/docs/usage/components/button.md +26 -12
- package/docs/usage/components/carousel.md +4 -4
- package/docs/usage/components/chart.md +1 -0
- package/docs/usage/components/chat-message.md +18 -12
- package/docs/usage/components/chat-screen.md +6 -3
- package/docs/usage/components/cohort-retention-table.md +83 -0
- package/docs/usage/components/collapsible.md +7 -2
- package/docs/usage/components/comment-thread-row.md +102 -0
- package/docs/usage/components/comment-thread-screen.md +27 -13
- package/docs/usage/components/composition-layout.md +1 -0
- package/docs/usage/components/context-menu.md +32 -15
- package/docs/usage/components/conversation-row.md +11 -4
- package/docs/usage/components/conversion-funnel.md +85 -0
- package/docs/usage/components/correlation-matrix.md +80 -0
- package/docs/usage/components/data-table.md +4 -0
- package/docs/usage/components/description-list.md +2 -1
- package/docs/usage/components/editor-screen.md +9 -5
- package/docs/usage/components/effect-surface.md +4 -2
- package/docs/usage/components/empty-state.md +2 -2
- package/docs/usage/components/event-attendance-card.md +104 -0
- package/docs/usage/components/expandable-search.md +105 -0
- package/docs/usage/components/file-picker.md +5 -0
- package/docs/usage/components/filter-recovery.md +97 -0
- package/docs/usage/components/follow-profile-card.md +100 -0
- package/docs/usage/components/heading.md +6 -2
- package/docs/usage/components/histogram-explorer.md +89 -0
- package/docs/usage/components/icon-button.md +18 -2
- package/docs/usage/components/icon-tile.md +12 -4
- package/docs/usage/components/image-choice-group.md +81 -0
- package/docs/usage/components/import-field-mapping.md +94 -0
- package/docs/usage/components/inline-edit.md +105 -0
- package/docs/usage/components/keyboard-avoidance-context.md +60 -0
- package/docs/usage/components/keyboard-avoiding.md +5 -1
- package/docs/usage/components/list-detail-screen.md +4 -4
- package/docs/usage/components/list.md +1 -1
- package/docs/usage/components/masonry.md +6 -7
- package/docs/usage/components/media-selection-screen.md +7 -5
- package/docs/usage/components/media-transport.md +104 -0
- package/docs/usage/components/message-composer.md +13 -3
- package/docs/usage/components/moderation-screen.md +5 -2
- package/docs/usage/components/notification-inbox-screen.md +3 -3
- package/docs/usage/components/notification-row.md +64 -8
- package/docs/usage/components/onboarding-screen.md +1 -1
- package/docs/usage/components/overview-screen.md +9 -3
- package/docs/usage/components/pagination.md +18 -3
- package/docs/usage/components/password-rules-field.md +90 -0
- package/docs/usage/components/permission-screen.md +1 -1
- package/docs/usage/components/photo-source-sheet.md +1 -1
- package/docs/usage/components/popover.md +6 -3
- package/docs/usage/components/pricing-choice.md +85 -0
- package/docs/usage/components/profile-summary.md +56 -8
- package/docs/usage/components/progress.md +3 -3
- package/docs/usage/components/qr-code.md +5 -9
- package/docs/usage/components/repeatable-field-group.md +92 -0
- package/docs/usage/components/reply-composer.md +83 -0
- package/docs/usage/components/reply-message.md +85 -0
- package/docs/usage/components/result.md +3 -3
- package/docs/usage/components/saved-items-screen.md +7 -5
- package/docs/usage/components/screen-layout.md +21 -10
- package/docs/usage/components/search-field.md +1 -1
- package/docs/usage/components/section.md +2 -2
- package/docs/usage/components/selection-action-bar.md +89 -0
- package/docs/usage/components/settings-screen.md +13 -11
- package/docs/usage/components/sheet.md +19 -7
- package/docs/usage/components/shortcut-recorder.md +77 -0
- package/docs/usage/components/split-action.md +94 -0
- package/docs/usage/components/streaming-answer.md +94 -0
- package/docs/usage/components/switch.md +6 -2
- package/docs/usage/components/table-column-settings.md +88 -0
- package/docs/usage/components/target-summary.md +79 -0
- package/docs/usage/components/text.md +11 -5
- package/docs/usage/components/toggle-feedback-button.md +94 -0
- package/docs/usage/components/top-bar.md +8 -12
- package/docs/usage/components/transfer-task.md +87 -0
- package/docs/usage/compositions/action-recovery-optimistic.md +18 -14
- package/docs/usage/compositions/action-recovery-save.md +18 -14
- package/docs/usage/compositions/action-recovery-undo.md +18 -14
- package/docs/usage/compositions/activity-status.md +1 -1
- package/docs/usage/compositions/adaptive-content.md +2 -1
- package/docs/usage/compositions/collection-detail.md +6 -5
- package/docs/usage/compositions/collection-editing.md +13 -6
- package/docs/usage/compositions/command-records.md +5 -4
- package/docs/usage/compositions/communication.md +7 -5
- package/docs/usage/compositions/compound-controls.md +7 -3
- package/docs/usage/compositions/content-transition-comparison.md +10 -5
- package/docs/usage/compositions/data-layouts.md +12 -16
- package/docs/usage/compositions/data-workflows.md +7 -4
- package/docs/usage/compositions/date-time-selection.md +5 -5
- package/docs/usage/compositions/design-profile-comparison.md +22 -6
- package/docs/usage/compositions/disclosure.md +14 -9
- package/docs/usage/compositions/document-resource.md +1 -1
- package/docs/usage/compositions/environment-matrix.md +16 -12
- package/docs/usage/compositions/expo-interactions.md +9 -8
- package/docs/usage/compositions/family-drawer.md +9 -5
- package/docs/usage/compositions/field-group.md +7 -3
- package/docs/usage/compositions/interaction-adapters.md +11 -9
- package/docs/usage/compositions/interaction-flow-apply.md +17 -15
- package/docs/usage/compositions/interaction-flow-search.md +11 -7
- package/docs/usage/compositions/live-list.md +12 -8
- package/docs/usage/compositions/navigation-bar-collection.md +8 -3
- package/docs/usage/compositions/optional-motion.md +2 -2
- package/docs/usage/compositions/paper-surface.md +11 -6
- package/docs/usage/compositions/purpose-input-comment.md +10 -4
- package/docs/usage/compositions/purpose-input-message.md +10 -4
- package/docs/usage/compositions/reference-first.md +4 -4
- package/docs/usage/compositions/reference-review.md +4 -4
- package/docs/usage/compositions/reference-settings.md +4 -4
- package/docs/usage/compositions/selection-motion.md +2 -1
- package/docs/usage/compositions/social-compositions.md +7 -6
- package/docs/usage/compositions/stea-event-ticket.md +2 -4
- package/docs/usage/compositions/stea-order-progress.md +19 -21
- package/docs/usage/compositions/stea-pixel-empty.md +26 -26
- package/docs/usage/compositions/task-controls.md +7 -2
- package/docs/usage/compositions/texture-comparison.md +5 -5
- package/docs/usage/compositions/toast-layout.md +7 -3
- package/docs/usage/compositions/toggle-feedback.md +1 -1
- package/docs/usage/compositions/visual-foundations.md +10 -5
- package/docs/usage/compositions/web-additions.md +5 -1
- package/docs/usage/screens/common-chat.md +5 -3
- package/docs/usage/screens/common-comments.md +14 -9
- package/docs/usage/screens/common-conversation-list.md +109 -0
- package/docs/usage/screens/common-inbox.md +5 -3
- package/docs/usage/screens/common-login.md +7 -4
- package/docs/usage/screens/common-profile.md +16 -12
- package/docs/usage/screens/common-saved.md +12 -8
- package/docs/usage/screens/common-search.md +16 -8
- package/docs/usage/screens/common-settings.md +12 -11
- package/docs/usage/screens/common-shell.md +12 -10
- package/docs/usage/screens/dashboard.md +59 -56
- package/docs/usage/screens/discovery-gallery.md +18 -9
- package/docs/usage/screens/flow-collection.md +10 -6
- package/docs/usage/screens/flow-editor.md +9 -6
- package/docs/usage/screens/flow-media.md +12 -7
- package/docs/usage/screens/flow-moderation.md +9 -3
- package/docs/usage/screens/flow-onboarding.md +13 -8
- package/docs/usage/screens/flow-permission.md +5 -3
- package/docs/usage/screens/landing.md +20 -14
- package/docs/usage/screens/mockup-studio.md +100 -88
- package/docs/usage/screens/notification-settings.md +9 -7
- package/docs/usage/screens/product-bento.md +22 -10
- package/docs/usage/screens/reference-comparison.md +2 -2
- package/docs/usage/tokens/font-roles.md +18 -2
- package/docs/usage/tokens/typography.md +22 -11
- package/package.json +7 -1
package/dist/screen-patterns.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { layout, spacing } from "./foundations.js";
|
|
1
|
+
import { glyph, layout, radius, spacing } from "./foundations.js";
|
|
2
2
|
export function resolveScreenContentState(state = { kind: "ready" }) {
|
|
3
3
|
if (!["ready", "loading", "empty", "error", "restricted"].includes(state.kind)) {
|
|
4
4
|
throw new TypeError("Unknown screen content state");
|
|
@@ -13,6 +13,39 @@ export function resolveScreenContentState(state = { kind: "ready" }) {
|
|
|
13
13
|
announcement: state.kind === "error" ? "assertive" : "polite",
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Native header band heights. Titled centered headers match the iOS navigation bar (44 control + 4 + 4);
|
|
18
|
+
* icon-only centered headers are compact (2026-10-14 야잘알 tab spacing, 2026-10-17 "상단 여백 줄여").
|
|
19
|
+
* Body top padding shrinks only under a compact header without a notice.
|
|
20
|
+
*/
|
|
21
|
+
export const screenHeaderRecipe = {
|
|
22
|
+
minHeight: 52,
|
|
23
|
+
paddingVertical: spacing.xxs,
|
|
24
|
+
compactMinHeight: 48,
|
|
25
|
+
compactPaddingVertical: 2,
|
|
26
|
+
compactBodyTop: spacing.xxs,
|
|
27
|
+
/**
|
|
28
|
+
* Heading levels for the route title, shared by Web and Native (2026-10-17 comparison: Native drew the
|
|
29
|
+
* title as regular-weight Text — 20 start / 18 centered — while Web used bold Heading levels).
|
|
30
|
+
*/
|
|
31
|
+
titleLevel: "level3",
|
|
32
|
+
centeredTitleLevel: "level5",
|
|
33
|
+
};
|
|
34
|
+
export const screenExitRecipe = {
|
|
35
|
+
/** Chevron arm length and stroke; close cross arm length. Drawn, not font glyphs, so every platform matches. */
|
|
36
|
+
chevronSize: 10,
|
|
37
|
+
closeSize: 14,
|
|
38
|
+
stroke: 2,
|
|
39
|
+
};
|
|
40
|
+
export function validateScreenExit(exit, hasLeading) {
|
|
41
|
+
if (exit.kind !== "back" && exit.kind !== "close")
|
|
42
|
+
throw new TypeError("Screen exit kind must be back or close");
|
|
43
|
+
if (!exit.label.trim())
|
|
44
|
+
throw new TypeError("Screen exit needs a localized accessible label");
|
|
45
|
+
if (hasLeading)
|
|
46
|
+
throw new TypeError("Screen exit owns the leading slot; do not also pass leading");
|
|
47
|
+
}
|
|
48
|
+
export const screenContentInsets = ["default", "none", "body-edge"];
|
|
16
49
|
// Reuse reading-width and spacing tokens; do not derive geometry from a product's device or artwork.
|
|
17
50
|
export const screenPatternRecipe = {
|
|
18
51
|
maxWidth: layout.readingMaxWidth,
|
|
@@ -43,6 +76,81 @@ export function canSubmitMessage({ value, disabled = false, pending = false, att
|
|
|
43
76
|
throw new RangeError("Attachment count must be a nonnegative integer");
|
|
44
77
|
return !disabled && !pending && (value.trim().length > 0 || attachmentCount > 0);
|
|
45
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Shared timeline geometry. 2026-10-16 user decision: the common chat standard follows the measured
|
|
81
|
+
* KakaoTalk iOS chat room (@3x capture: bubble ~35pt tall, radius ~14, run gap ~6, group gap ~12,
|
|
82
|
+
* avatar ~34, avatar gap 8). Brand colors and artwork are not copied; surfaces stay semantic tokens.
|
|
83
|
+
*/
|
|
84
|
+
export const chatMessageRecipe = {
|
|
85
|
+
avatarSize: 36,
|
|
86
|
+
avatarGap: spacing.xs,
|
|
87
|
+
authorGap: spacing.xxs,
|
|
88
|
+
metaGap: spacing.xxs,
|
|
89
|
+
bubbleRadius: 14,
|
|
90
|
+
bubblePaddingInline: 10,
|
|
91
|
+
bubblePaddingBlock: 6,
|
|
92
|
+
// Bubbles of one run read as a stack; a new author or minute starts a visibly separate group.
|
|
93
|
+
runGap: 6,
|
|
94
|
+
groupGap: spacing.sm,
|
|
95
|
+
// Flat-topped tip continuing the bubble's top edge; the tipped corner tightens to meet it.
|
|
96
|
+
tailWidth: 7,
|
|
97
|
+
tailHeight: 10,
|
|
98
|
+
tailCornerRadius: 4,
|
|
99
|
+
jumpToLatestGap: spacing.xs,
|
|
100
|
+
// Timeline side gutter (measured 10pt); header and composer keep the screen padding.
|
|
101
|
+
timelineInset: 10,
|
|
102
|
+
// Photos render without the bubble surface (measured reference: ~210pt wide, bubble radius).
|
|
103
|
+
mediaWidth: 210,
|
|
104
|
+
mediaGap: 2,
|
|
105
|
+
};
|
|
106
|
+
/** Column count for a photo set: pairs read as 2-up, other counts as 3-up; one photo spans the width. */
|
|
107
|
+
export function resolveChatMediaColumns(count) {
|
|
108
|
+
if (!Number.isSafeInteger(count) || count < 1)
|
|
109
|
+
throw new RangeError("Chat media requires at least one item");
|
|
110
|
+
return count === 1 ? 1 : count === 2 || count === 4 ? 2 : 3;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Long-press menu geometry measured from the Instagram iOS DM hold menu (2026-10-16 @3x capture):
|
|
114
|
+
* full-width reaction strip ~60pt with ~30pt emoji, the pressed bubble itself as preview, and a ~200pt
|
|
115
|
+
* action card aligned to the bubble's side with ~56pt rows. 12pt between the three blocks.
|
|
116
|
+
*/
|
|
117
|
+
/** Emoji row above a comment composer (Instagram comment sheet, 2026-10-16): evenly spread 44pt targets. */
|
|
118
|
+
export const composerQuickInsertRecipe = { itemSize: 44, emojiSize: 26, gap: spacing.xs };
|
|
119
|
+
export const holdMenuRecipe = {
|
|
120
|
+
inset: 10,
|
|
121
|
+
gap: spacing.sm,
|
|
122
|
+
stripHeight: 60,
|
|
123
|
+
stripItemSize: 48,
|
|
124
|
+
emojiSize: 28,
|
|
125
|
+
actionWidth: 200,
|
|
126
|
+
actionRowHeight: 56,
|
|
127
|
+
actionRadius: 18,
|
|
128
|
+
iconSize: 24,
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Runs break when the author or the displayed timestamp changes, so each minute shows its time once
|
|
132
|
+
* and a new minute re-introduces the author (KakaoTalk behavior). Products pass the same localized
|
|
133
|
+
* timestamp string they render; HJM never parses dates.
|
|
134
|
+
*/
|
|
135
|
+
export function resolveChatMessageGroups(items) {
|
|
136
|
+
const positions = new Map();
|
|
137
|
+
items.forEach((item, index) => {
|
|
138
|
+
if (!item.id.trim() || positions.has(item.id))
|
|
139
|
+
throw new TypeError("Chat messages require unique, nonempty ids");
|
|
140
|
+
const same = (other) => !!other && other.authorId === item.authorId && other.timestamp === item.timestamp;
|
|
141
|
+
const before = same(items[index - 1]), after = same(items[index + 1]);
|
|
142
|
+
positions.set(item.id, before ? (after ? "middle" : "last") : after ? "first" : "single");
|
|
143
|
+
});
|
|
144
|
+
return positions;
|
|
145
|
+
}
|
|
146
|
+
/** What one bubble shows for its run position; both renderers read this instead of re-deriving rules. */
|
|
147
|
+
export function resolveChatMessageGroupDisplay(position = "single") {
|
|
148
|
+
if (!["single", "first", "middle", "last"].includes(position))
|
|
149
|
+
throw new TypeError("Unknown chat message group position");
|
|
150
|
+
const starts = position === "single" || position === "first";
|
|
151
|
+
const ends = position === "single" || position === "last";
|
|
152
|
+
return { showAuthor: starts, showAvatar: starts, showTail: starts, showTimestamp: ends, spacingBefore: starts ? chatMessageRecipe.groupGap : chatMessageRecipe.runGap };
|
|
153
|
+
}
|
|
46
154
|
export function resolvePermissionAction(status) {
|
|
47
155
|
switch (status) {
|
|
48
156
|
case "prompt": return "request";
|
|
@@ -57,6 +165,37 @@ export function resolveOnboardingStep(total, index) {
|
|
|
57
165
|
throw new RangeError("Onboarding requires a valid step index");
|
|
58
166
|
return { first: index === 0, last: index === total - 1 };
|
|
59
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Shared comment-row geometry. 2026-10-16 user decision: comments follow the measured Instagram iOS
|
|
170
|
+
* comment sheet (@3x capture: avatar 32 / reply 24, avatar gap 8, like count under the heart,
|
|
171
|
+
* "Reply" as quiet text below the body, replies indented to the text column). Artwork is not copied.
|
|
172
|
+
*/
|
|
173
|
+
export const commentThreadRecipe = {
|
|
174
|
+
avatarSize: 32,
|
|
175
|
+
replyAvatarSize: 24,
|
|
176
|
+
avatarGap: spacing.xs,
|
|
177
|
+
lineGap: 2,
|
|
178
|
+
rowGap: spacing.sm,
|
|
179
|
+
// Replies align with the parent's text column instead of an arbitrary section inset.
|
|
180
|
+
replyIndent: 32 + spacing.xs,
|
|
181
|
+
// The heart keeps the 44pt touch target even though the measured reference draws a smaller glyph.
|
|
182
|
+
likeColumnWidth: 44,
|
|
183
|
+
// Optional photo/sticker under the body; the measured reference keeps it thumbnail-sized.
|
|
184
|
+
mediaMaxWidth: 160,
|
|
185
|
+
mediaRadius: radius.md,
|
|
186
|
+
// The trailing vertical-dots menu glyph; the button keeps the shared 44pt IconButton target.
|
|
187
|
+
menuGlyphSize: glyph.sm,
|
|
188
|
+
};
|
|
189
|
+
/** Danger actions (delete, block) always sit last so a destructive row is never the first target; order is otherwise kept. */
|
|
190
|
+
export function resolveCommentMenuItems(items) {
|
|
191
|
+
const ids = new Set();
|
|
192
|
+
for (const item of items) {
|
|
193
|
+
if (!item.id.trim() || ids.has(item.id) || !item.label.trim())
|
|
194
|
+
throw new TypeError("Comment menu items require unique ids and localized labels");
|
|
195
|
+
ids.add(item.id);
|
|
196
|
+
}
|
|
197
|
+
return [...items.filter(item => item.tone !== "danger"), ...items.filter(item => item.tone === "danger")];
|
|
198
|
+
}
|
|
60
199
|
/** Replies are one level deep; reject orphaned/duplicate records instead of silently losing them. */
|
|
61
200
|
export function validateCommentThread(items) {
|
|
62
201
|
const roots = new Set(items.filter(item => item.parentId === null).map(item => item.id));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-patterns.js","sourceRoot":"","sources":["../src/screen-patterns.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,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC","sourcesContent":["import { layout, spacing } from \"./foundations.js\";\n\n/** Initial load replaces the body; refresh/save errors belong beside retained content. */\nexport type ScreenContentState =\n | Readonly<{ kind: \"ready\" }>\n | Readonly<{ kind: \"loading\" | \"empty\" | \"error\" | \"restricted\"; title: string; description?: string }>;\n\nexport function resolveScreenContentState(state: ScreenContentState = { kind: \"ready\" }) {\n if (![\"ready\", \"loading\", \"empty\", \"error\", \"restricted\"].includes(state.kind)) {\n throw new TypeError(\"Unknown screen content state\");\n }\n if (state.kind !== \"ready\" && !state.title.trim()) {\n throw new TypeError(\"Screen state requires a localized title\");\n }\n return {\n kind: state.kind,\n replacesContent: state.kind !== \"ready\",\n busy: state.kind === \"loading\",\n announcement: state.kind === \"error\" ? \"assertive\" : \"polite\",\n } as const;\n}\n\n// Reuse reading-width and spacing tokens; do not derive geometry from a product's device or artwork.\nexport const screenPatternRecipe = {\n maxWidth: layout.readingMaxWidth,\n padding: spacing.md,\n sectionGap: spacing.xl,\n itemGap: spacing.sm,\n stateGap: spacing.md,\n // Compact screens must keep back/title/save on one row; scale this floor for large text instead of reserving a desktop-width title.\n headerMinWidth: layout.readingMaxWidth / 6,\n // Reserve the opposite edge for authorship and cap the composer so history remains visible.\n messageMaxWidth: \"84%\",\n // Social thumbnails stay compact; selection order and removal replace a second toolbar.\n attachmentSize: 80,\n attachmentRemoveSize: 24,\n reactionHoldMs: 450,\n reactionMoveTolerance: 10,\n reactionMenuWidth: 320,\n replySwipeDistance: 60,\n composerMinLines: 1,\n composerMaxLines: 5,\n} as const;\n\n/** Controlled composer: HJM never clears drafts or interprets a fulfilled callback as server delivery. */\nexport type MessageComposerDescriptor = Readonly<{\n value: string;\n label: string;\n sendLabel: string;\n /** Short visual copy may differ from the complete accessible input name. */\n placeholder?: string;\n description?: string;\n error?: string;\n invalid?: boolean;\n /** Newline remains the compatible default; desktop chat may explicitly opt into send. */\n submitMode?: \"newline\" | \"send\";\n disabled?: boolean;\n pending?: boolean;\n attachmentCount?: number;\n}>;\n/** Safari may report the final IME Enter as keyCode 229 after isComposing becomes false. */\nexport function shouldSubmitMessageKey(event: Readonly<{ key: string; shiftKey?: boolean; isComposing?: boolean; keyCode?: number }>, mode: \"newline\" | \"send\" = \"newline\"): boolean {\n return mode === \"send\" && event.key === \"Enter\" && !event.shiftKey && !event.isComposing && event.keyCode !== 229;\n}\nexport function canSubmitMessage({ value, disabled = false, pending = false, attachmentCount = 0 }: MessageComposerDescriptor): boolean {\n if (!Number.isSafeInteger(attachmentCount) || attachmentCount < 0) throw new RangeError(\"Attachment count must be a nonnegative integer\");\n return !disabled && !pending && (value.trim().length > 0 || attachmentCount > 0);\n}\n\n/** Bubble alignment expresses authorship, not delivery; delivery text always comes from the product receipt. */\nexport type ChatMessageDescriptor = Readonly<{\n direction: \"incoming\" | \"outgoing\";\n author: string;\n timestamp: string;\n deliveryLabel?: string;\n /** Inward drag reveals time (incoming right, outgoing left) while delivery state remains visible; default preserves existing captions. */\n timestampPresentation?: \"always\" | \"swipe\";\n /** Connected authorship tip; opt-in keeps existing card-like conversations unchanged. */\n bubbleTail?: boolean;\n}>;\n\n/** A denied permission goes to settings; rendering never requests OS access automatically. */\nexport type PermissionScreenStatus = \"prompt\" | \"denied\" | \"granted\" | \"unavailable\";\nexport function resolvePermissionAction(status:PermissionScreenStatus) {\n switch(status){case \"prompt\":return \"request\";case \"denied\":return \"settings\";case \"granted\":return \"continue\";case \"unavailable\":return null;default:throw new TypeError(\"Unknown permission state\");}\n}\nexport function resolveOnboardingStep(total:number,index:number){\n if(!Number.isInteger(total)||total<1||!Number.isInteger(index)||index<0||index>=total)throw new RangeError(\"Onboarding requires a valid step index\");\n return {first:index===0,last:index===total-1};\n}\n\n/** Replies are one level deep; reject orphaned/duplicate records instead of silently losing them. */\nexport function validateCommentThread(items:readonly {id:string;parentId:string|null}[]){\n const roots=new Set(items.filter(item=>item.parentId===null).map(item=>item.id));const ids=new Set<string>();\n for(const item of items){if(!item.id.trim()||ids.has(item.id))throw new TypeError(\"Comment ids must be unique and nonempty\");ids.add(item.id);if(item.parentId!==null&&(!roots.has(item.parentId)||item.parentId===item.id))throw new TypeError(\"Replies require an existing root comment\");}\n}\n\n/** Source bytes, permission requests, ordering and upload limits remain product-owned. */\nexport type MessageAttachmentDescriptor = Readonly<{ id: string; removeLabel: string; /** Local preparation can lock removal without locking text entry. */ disabled?: boolean }>;\nexport function validateMessageAttachments(attachments: readonly MessageAttachmentDescriptor[]): void {\n const ids = new Set<string>();\n for (const item of attachments) {\n if (!item.id.trim() || ids.has(item.id) || !item.removeLabel.trim()) throw new TypeError(\"Attachments require unique ids and localized removal labels\");\n ids.add(item.id);\n }\n}\n\n/** Require horizontal intent so a timeline scroll cannot accidentally start a reply. */\nexport function isReplySwipe(dx: number, dy: number): boolean {\n return Math.abs(dx) >= screenPatternRecipe.replySwipeDistance && Math.abs(dx) > Math.abs(dy) * 2;\n}\n\n/** The UI never infers permission or camera availability; product adapters own both. */\nexport type PhotoSource = \"library\" | \"camera\";\nexport type PhotoSourceLabels = Readonly<{ title:string; library:string; camera:string; cancel:string }>;\n\nexport type SavedItem = Readonly<{ id: string; title: string }>;\nexport type SavedCollection = Readonly<{ id: string; title: string; itemIds: readonly string[] }>;\nexport type SavedItemsLabels = Readonly<{ allItems: string; privateNotice: string; back: string; empty: string; createCollection: string }>;\n\n/** Unsave removes an item from every collection view without rewriting product-owned membership. */\nexport function resolveSavedItems<T extends SavedItem>(items:readonly T[],collections:readonly SavedCollection[],collectionId:string|null|undefined,selectedItemId:string|null|undefined){\n const ids=new Set<string>(),groups=new Set<string>();\n for(const item of items){if(!item.id.trim()||ids.has(item.id)||!item.title.trim())throw new TypeError(\"Saved items require unique ids and nonempty titles\");ids.add(item.id);}\n for(const group of collections){if(!group.id.trim()||groups.has(group.id)||!group.title.trim())throw new TypeError(\"Saved collections require unique ids and nonempty titles\");groups.add(group.id);}\n const collection=collections.find(item=>item.id===collectionId);\n // A deleted collection returns to the overview instead of showing a mislabeled all-posts view.\n const home=collectionId===undefined||(collectionId!==null&&!collection);\n const visible=home||collectionId===null?items:items.filter(item=>collection?.itemIds.includes(item.id));\n return {home,collection,visible,selected:home?undefined:visible.find(item=>item.id===selectedItemId)};\n}\n\n/**\n * SearchScreen phases (2026-10-06 search redesign, docs/screen-patterns.md#searchscreen-두-단계-검색).\n * Without a committed query (one-step search, the pre-1.13 behavior) any nonblank query is already\n * `results`. With one, typing a different query is `typing`: suggestions replace the results until the\n * user commits (Enter, a suggestion, a recent or suggested query). Comparing trimmed values keeps a\n * trailing space from flipping committed results back into suggestions.\n */\nexport type SearchScreenPhase = \"idle\" | \"typing\" | \"results\";\nexport function resolveSearchScreenPhase(query: string, committedQuery?: string): SearchScreenPhase {\n const typed = query.trim();\n if (!typed) return \"idle\";\n if (committedQuery === undefined) return \"results\";\n return typed === committedQuery.trim() ? \"results\" : \"typing\";\n}\n\n/**\n * The value a commit records, or `null` when there is nothing to commit. Blank commits are dropped\n * so a stray Enter never writes an empty recent search or fetches \"everything\".\n */\nexport function resolveSearchCommit(value: string): string | null {\n const next = value.trim();\n return next ? next : null;\n}\n\n/**\n * Why a committed search shows nothing. `filters` keeps the filter rail and offers \"clear all\";\n * `query` hides the rail (no filter can fix it) and offers suggested queries instead. Reference\n * services hide the rail on every zero result, which removes the only way to undo a filter.\n * `null` count means the result is still loading, so no cause is reported yet.\n */\nexport type SearchEmptyCause = \"none\" | \"filters\" | \"query\";\nexport function resolveSearchEmptyCause(count: number | null, appliedFilterCount: number): SearchEmptyCause {\n // Loading/nonempty results must not bypass the same count contract used by empty results.\n if ((count !== null && (count < 0 || !Number.isSafeInteger(count))) || !Number.isSafeInteger(appliedFilterCount) || appliedFilterCount < 0) {\n throw new RangeError(\"Search counts must be nonnegative integers\");\n }\n if (count === null || count > 0) return \"none\";\n return appliedFilterCount > 0 ? \"filters\" : \"query\";\n}\n\n/**\n * Index to focus after removing item `removedIndex` from a list that now has `remaining` items:\n * the item that slid into its place, else the new last item, else -1 (move to the fallback target).\n * Removing a focused chip or row would otherwise drop focus to <body>.\n */\nexport function resolveFocusAfterRemoval(removedIndex: number, remaining: number): number {\n if (!Number.isInteger(removedIndex) || removedIndex < 0 || !Number.isInteger(remaining) || remaining < 0) {\n throw new RangeError(\"Removal indexes must be nonnegative integers\");\n }\n return remaining === 0 ? -1 : Math.min(removedIndex, remaining - 1);\n}\n\n/** Recipe for the SearchScreen phase sections; geometry stays on shared spacing tokens. */\nexport const searchScreenRecipe = {\n /** Debounced typing delay; explicit submit remains a separate host action. */\n debounceMs: 300,\n /** Recent searches shown before the user types; reference services show 5–10 and let the rest scroll away. */\n recentVisible: 5,\n /** Suggestions under the \"search for ‘q’\" row. */\n suggestionVisible: 6,\n /** Skeleton rows while the first page of results loads. */\n loadingRows: 4,\n /** Between idle sections (recent, suggested). */\n sectionGap: spacing.xl,\n /** Section title to its list, and results header to applied filters. */\n headerGap: spacing.sm,\n /** Between chips in applied filters and suggested queries. */\n chipGap: spacing.xs,\n} as const;\n\n/** Keep finite negative delays at zero; reject values whose timer behavior varies by host. */\nexport function resolveSearchDebounceMs(value: number = searchScreenRecipe.debounceMs): number {\n if (!Number.isFinite(value)) throw new RangeError(\"Search debounceMs must be finite\");\n return Math.max(0, value);\n}\n\n/** Horizontal intent preserves vertical scrolling and uses one reveal distance across renderers. */\nexport function timestampRevealOffset(dx: number, dy: number): number {\n // A 12px dead zone and 2:1 direction bias avoid turning taps/list scrolling into a time gesture.\n return dx > 12 && dx > Math.abs(dy) * 2 ? Math.min(dx, 88) : 0;\n}\n\n/** Notification previews need an actor/type badge and a separate subject thumbnail.\n * Keep this geometry shared so inboxes do not recreate the same row per product. */\nexport const notificationRowRecipe = {\n gap: 12, contentGap: 4, avatarSize: 44, avatarBadgeSize: 20,\n thumbnailSize: 44, unreadSize: 6, previewLines: 2, paddingBlock: 12, paddingInline: 16,\n} as const;\n\n/** Shared profile identity geometry; product owns the avatar content. */\nexport const profileSummaryRecipe = Object.freeze({ avatarSize: 72 });\n\n/** Launcher artwork stays above its caption; product overlays may extend beyond the icon frame. */\nexport const iconTileRecipe = Object.freeze({ iconSize: 64, labelMaxWidth: 72, multilineLabelMaxWidth: 84, multilineLabelMinHeight: 44, ghostOpacity: 0.55, gap: 6, iconRadius: \"22%\" });\n"]}
|
|
1
|
+
{"version":3,"file":"screen-patterns.js","sourceRoot":"","sources":["../src/screen-patterns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAQlE,MAAM,UAAU,yBAAyB,CAAC,QAA4B,EAAE,IAAI,EAAE,OAAO,EAAE;IACrF,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/E,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAClD,MAAM,IAAI,SAAS,CAAC,yCAAyC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,eAAe,EAAE,KAAK,CAAC,IAAI,KAAK,OAAO;QACvC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,SAAS;QAC9B,YAAY,EAAE,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC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CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAED;oFACoF;AACpF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,GAAG,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE;IAC3D,aAAa,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE;CAC9E,CAAC;AAEX,yEAAyE;AACzE,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;AAEtE,mGAAmG;AACnG,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC","sourcesContent":["import { glyph, layout, radius, spacing } from \"./foundations.js\";\nimport type { MenuItemDescriptor } from \"./behaviors.js\";\n\n/** Initial load replaces the body; refresh/save errors belong beside retained content. */\nexport type ScreenContentState =\n | Readonly<{ kind: \"ready\" }>\n | Readonly<{ kind: \"loading\" | \"empty\" | \"error\" | \"restricted\"; title: string; description?: string }>;\n\nexport function resolveScreenContentState(state: ScreenContentState = { kind: \"ready\" }) {\n if (![\"ready\", \"loading\", \"empty\", \"error\", \"restricted\"].includes(state.kind)) {\n throw new TypeError(\"Unknown screen content state\");\n }\n if (state.kind !== \"ready\" && !state.title.trim()) {\n throw new TypeError(\"Screen state requires a localized title\");\n }\n return {\n kind: state.kind,\n replacesContent: state.kind !== \"ready\",\n busy: state.kind === \"loading\",\n announcement: state.kind === \"error\" ? \"assertive\" : \"polite\",\n } as const;\n}\n\n/**\n * Native header band heights. Titled centered headers match the iOS navigation bar (44 control + 4 + 4);\n * icon-only centered headers are compact (2026-10-14 야잘알 tab spacing, 2026-10-17 \"상단 여백 줄여\").\n * Body top padding shrinks only under a compact header without a notice.\n */\nexport const screenHeaderRecipe = {\n minHeight: 52,\n paddingVertical: spacing.xxs,\n compactMinHeight: 48,\n compactPaddingVertical: 2,\n compactBodyTop: spacing.xxs,\n /**\n * Heading levels for the route title, shared by Web and Native (2026-10-17 comparison: Native drew the\n * title as regular-weight Text — 20 start / 18 centered — while Web used bold Heading levels).\n */\n titleLevel: \"level3\",\n centeredTitleLevel: \"level5\",\n} as const;\n\n/**\n * Leaving a screen (back, close, \"설정 나가기\") is an icon-only button fixed at the header's leading edge\n * (2026-10-17 user rule: exits had drifted into body text buttons with mixed glyphs). The label is read\n * by assistive tech only. `back` mirrors in RTL; `close` is for modal-style routes.\n */\nexport type ScreenExitKind = \"back\" | \"close\";\nexport const screenExitRecipe = {\n /** Chevron arm length and stroke; close cross arm length. Drawn, not font glyphs, so every platform matches. */\n chevronSize: 10,\n closeSize: 14,\n stroke: 2,\n} as const;\nexport function validateScreenExit(exit: Readonly<{ kind: string; label: string }>, hasLeading: boolean) {\n if (exit.kind !== \"back\" && exit.kind !== \"close\") throw new TypeError(\"Screen exit kind must be back or close\");\n if (!exit.label.trim()) throw new TypeError(\"Screen exit needs a localized accessible label\");\n if (hasLeading) throw new TypeError(\"Screen exit owns the leading slot; do not also pass leading\");\n}\n\n/**\n * Who owns the screen gutters. `default`: the shared shell pads header, notice, body and footer. `none`: the host\n * route already insets everything (≈45 product call sites rely on this meaning, so it cannot change).\n * `body-edge`: header, notice and footer keep the shell padding; only the body's inline padding is 0 so full-width\n * list rows (ConversationRow, ListRow-based items) supply their own inset — review S5#9 measured DM avatars ~32pt\n * from the edge because body padding and row padding stacked (2026-10-17 user decision).\n */\nexport type ScreenContentInset = \"default\" | \"none\" | \"body-edge\";\nexport const screenContentInsets = [\"default\", \"none\", \"body-edge\"] as const satisfies readonly ScreenContentInset[];\n\n// Reuse reading-width and spacing tokens; do not derive geometry from a product's device or artwork.\nexport const screenPatternRecipe = {\n maxWidth: layout.readingMaxWidth,\n padding: spacing.md,\n sectionGap: spacing.xl,\n itemGap: spacing.sm,\n stateGap: spacing.md,\n // Compact screens must keep back/title/save on one row; scale this floor for large text instead of reserving a desktop-width title.\n headerMinWidth: layout.readingMaxWidth / 6,\n // Reserve the opposite edge for authorship and cap the composer so history remains visible.\n messageMaxWidth: \"84%\",\n // Social thumbnails stay compact; selection order and removal replace a second toolbar.\n attachmentSize: 80,\n attachmentRemoveSize: 24,\n reactionHoldMs: 450,\n reactionMoveTolerance: 10,\n reactionMenuWidth: 320,\n replySwipeDistance: 60,\n composerMinLines: 1,\n composerMaxLines: 5,\n} as const;\n\n/** Controlled composer: HJM never clears drafts or interprets a fulfilled callback as server delivery. */\nexport type MessageComposerDescriptor = Readonly<{\n value: string;\n label: string;\n sendLabel: string;\n /** Short visual copy may differ from the complete accessible input name. */\n placeholder?: string;\n description?: string;\n error?: string;\n invalid?: boolean;\n /** Newline remains the compatible default; desktop chat may explicitly opt into send. */\n submitMode?: \"newline\" | \"send\";\n disabled?: boolean;\n pending?: boolean;\n attachmentCount?: number;\n}>;\n/** Safari may report the final IME Enter as keyCode 229 after isComposing becomes false. */\nexport function shouldSubmitMessageKey(event: Readonly<{ key: string; shiftKey?: boolean; isComposing?: boolean; keyCode?: number }>, mode: \"newline\" | \"send\" = \"newline\"): boolean {\n return mode === \"send\" && event.key === \"Enter\" && !event.shiftKey && !event.isComposing && event.keyCode !== 229;\n}\nexport function canSubmitMessage({ value, disabled = false, pending = false, attachmentCount = 0 }: MessageComposerDescriptor): boolean {\n if (!Number.isSafeInteger(attachmentCount) || attachmentCount < 0) throw new RangeError(\"Attachment count must be a nonnegative integer\");\n return !disabled && !pending && (value.trim().length > 0 || attachmentCount > 0);\n}\n\n/**\n * Shared timeline geometry. 2026-10-16 user decision: the common chat standard follows the measured\n * KakaoTalk iOS chat room (@3x capture: bubble ~35pt tall, radius ~14, run gap ~6, group gap ~12,\n * avatar ~34, avatar gap 8). Brand colors and artwork are not copied; surfaces stay semantic tokens.\n */\nexport const chatMessageRecipe = {\n avatarSize: 36,\n avatarGap: spacing.xs,\n authorGap: spacing.xxs,\n metaGap: spacing.xxs,\n bubbleRadius: 14,\n bubblePaddingInline: 10,\n bubblePaddingBlock: 6,\n // Bubbles of one run read as a stack; a new author or minute starts a visibly separate group.\n runGap: 6,\n groupGap: spacing.sm,\n // Flat-topped tip continuing the bubble's top edge; the tipped corner tightens to meet it.\n tailWidth: 7,\n tailHeight: 10,\n tailCornerRadius: 4,\n jumpToLatestGap: spacing.xs,\n // Timeline side gutter (measured 10pt); header and composer keep the screen padding.\n timelineInset: 10,\n // Photos render without the bubble surface (measured reference: ~210pt wide, bubble radius).\n mediaWidth: 210,\n mediaGap: 2,\n} as const;\n\n/** Column count for a photo set: pairs read as 2-up, other counts as 3-up; one photo spans the width. */\nexport function resolveChatMediaColumns(count: number): 1 | 2 | 3 {\n if (!Number.isSafeInteger(count) || count < 1) throw new RangeError(\"Chat media requires at least one item\");\n return count === 1 ? 1 : count === 2 || count === 4 ? 2 : 3;\n}\n\n/**\n * Long-press menu geometry measured from the Instagram iOS DM hold menu (2026-10-16 @3x capture):\n * full-width reaction strip ~60pt with ~30pt emoji, the pressed bubble itself as preview, and a ~200pt\n * action card aligned to the bubble's side with ~56pt rows. 12pt between the three blocks.\n */\n/** Emoji row above a comment composer (Instagram comment sheet, 2026-10-16): evenly spread 44pt targets. */\nexport const composerQuickInsertRecipe = { itemSize: 44, emojiSize: 26, gap: spacing.xs } as const;\n\nexport const holdMenuRecipe = {\n inset: 10,\n gap: spacing.sm,\n stripHeight: 60,\n stripItemSize: 48,\n emojiSize: 28,\n actionWidth: 200,\n actionRowHeight: 56,\n actionRadius: 18,\n iconSize: 24,\n} as const;\n\n/** Position inside a run of consecutive messages from one author within one displayed minute. */\nexport type ChatMessageGroupPosition = \"single\" | \"first\" | \"middle\" | \"last\";\n\n/**\n * Runs break when the author or the displayed timestamp changes, so each minute shows its time once\n * and a new minute re-introduces the author (KakaoTalk behavior). Products pass the same localized\n * timestamp string they render; HJM never parses dates.\n */\nexport function resolveChatMessageGroups(items: readonly Readonly<{ id: string; authorId: string; timestamp: string }>[]): ReadonlyMap<string, ChatMessageGroupPosition> {\n const positions = new Map<string, ChatMessageGroupPosition>();\n items.forEach((item, index) => {\n if (!item.id.trim() || positions.has(item.id)) throw new TypeError(\"Chat messages require unique, nonempty ids\");\n const same = (other: (typeof items)[number] | undefined) => !!other && other.authorId === item.authorId && other.timestamp === item.timestamp;\n const before = same(items[index - 1]), after = same(items[index + 1]);\n positions.set(item.id, before ? (after ? \"middle\" : \"last\") : after ? \"first\" : \"single\");\n });\n return positions;\n}\n\n/** What one bubble shows for its run position; both renderers read this instead of re-deriving rules. */\nexport function resolveChatMessageGroupDisplay(position: ChatMessageGroupPosition = \"single\") {\n if (![\"single\", \"first\", \"middle\", \"last\"].includes(position)) throw new TypeError(\"Unknown chat message group position\");\n const starts = position === \"single\" || position === \"first\";\n const ends = position === \"single\" || position === \"last\";\n return { showAuthor: starts, showAvatar: starts, showTail: starts, showTimestamp: ends, spacingBefore: starts ? chatMessageRecipe.groupGap : chatMessageRecipe.runGap } as const;\n}\n\n/** Bubble alignment expresses authorship, not delivery; delivery text always comes from the product receipt. */\nexport type ChatMessageDescriptor = Readonly<{\n direction: \"incoming\" | \"outgoing\";\n author: string;\n timestamp: string;\n deliveryLabel?: string;\n /** Inward drag reveals time (incoming right, outgoing left) while delivery state remains visible; default shows time beside the last bubble of a run. */\n timestampPresentation?: \"always\" | \"swipe\";\n /** Authorship tip on the run's first bubble. Default on since the 2026-10-16 timeline standard. */\n bubbleTail?: boolean;\n /** From resolveChatMessageGroups; omitted means a standalone message. */\n groupPosition?: ChatMessageGroupPosition;\n}>;\n\n/** A denied permission goes to settings; rendering never requests OS access automatically. */\nexport type PermissionScreenStatus = \"prompt\" | \"denied\" | \"granted\" | \"unavailable\";\nexport function resolvePermissionAction(status:PermissionScreenStatus) {\n switch(status){case \"prompt\":return \"request\";case \"denied\":return \"settings\";case \"granted\":return \"continue\";case \"unavailable\":return null;default:throw new TypeError(\"Unknown permission state\");}\n}\nexport function resolveOnboardingStep(total:number,index:number){\n if(!Number.isInteger(total)||total<1||!Number.isInteger(index)||index<0||index>=total)throw new RangeError(\"Onboarding requires a valid step index\");\n return {first:index===0,last:index===total-1};\n}\n\n/**\n * Shared comment-row geometry. 2026-10-16 user decision: comments follow the measured Instagram iOS\n * comment sheet (@3x capture: avatar 32 / reply 24, avatar gap 8, like count under the heart,\n * \"Reply\" as quiet text below the body, replies indented to the text column). Artwork is not copied.\n */\nexport const commentThreadRecipe = {\n avatarSize: 32,\n replyAvatarSize: 24,\n avatarGap: spacing.xs,\n lineGap: 2,\n rowGap: spacing.sm,\n // Replies align with the parent's text column instead of an arbitrary section inset.\n replyIndent: 32 + spacing.xs,\n // The heart keeps the 44pt touch target even though the measured reference draws a smaller glyph.\n likeColumnWidth: 44,\n // Optional photo/sticker under the body; the measured reference keeps it thumbnail-sized.\n mediaMaxWidth: 160,\n mediaRadius: radius.md,\n // The trailing vertical-dots menu glyph; the button keeps the shared 44pt IconButton target.\n menuGlyphSize: glyph.sm,\n} as const;\n\n/**\n * Items of the HJM-owned per-comment \"more\" menu (2026-10-17: message/comment structure belongs to HJM, review S4#7).\n * Same vocabulary as Menu/ContextMenu; the product supplies only ids, localized labels, tone and availability.\n */\nexport type CommentMenuItemDescriptor<Key extends string = string> = Pick<MenuItemDescriptor<Key>, \"id\" | \"label\" | \"disabled\" | \"tone\">;\n/** Danger actions (delete, block) always sit last so a destructive row is never the first target; order is otherwise kept. */\nexport function resolveCommentMenuItems<Key extends string>(items: readonly CommentMenuItemDescriptor<Key>[]): readonly CommentMenuItemDescriptor<Key>[] {\n const ids = new Set<string>();\n for (const item of items) {\n if (!item.id.trim() || ids.has(item.id) || !item.label.trim()) throw new TypeError(\"Comment menu items require unique ids and localized labels\");\n ids.add(item.id);\n }\n return [...items.filter(item => item.tone !== \"danger\"), ...items.filter(item => item.tone === \"danger\")];\n}\n\n/** Replies are one level deep; reject orphaned/duplicate records instead of silently losing them. */\nexport function validateCommentThread(items:readonly {id:string;parentId:string|null}[]){\n const roots=new Set(items.filter(item=>item.parentId===null).map(item=>item.id));const ids=new Set<string>();\n for(const item of items){if(!item.id.trim()||ids.has(item.id))throw new TypeError(\"Comment ids must be unique and nonempty\");ids.add(item.id);if(item.parentId!==null&&(!roots.has(item.parentId)||item.parentId===item.id))throw new TypeError(\"Replies require an existing root comment\");}\n}\n\n/** Source bytes, permission requests, ordering and upload limits remain product-owned. */\nexport type MessageAttachmentDescriptor = Readonly<{ id: string; removeLabel: string; /** Local preparation can lock removal without locking text entry. */ disabled?: boolean }>;\nexport function validateMessageAttachments(attachments: readonly MessageAttachmentDescriptor[]): void {\n const ids = new Set<string>();\n for (const item of attachments) {\n if (!item.id.trim() || ids.has(item.id) || !item.removeLabel.trim()) throw new TypeError(\"Attachments require unique ids and localized removal labels\");\n ids.add(item.id);\n }\n}\n\n/** Require horizontal intent so a timeline scroll cannot accidentally start a reply. */\nexport function isReplySwipe(dx: number, dy: number): boolean {\n return Math.abs(dx) >= screenPatternRecipe.replySwipeDistance && Math.abs(dx) > Math.abs(dy) * 2;\n}\n\n/** The UI never infers permission or camera availability; product adapters own both. */\nexport type PhotoSource = \"library\" | \"camera\";\nexport type PhotoSourceLabels = Readonly<{ title:string; library:string; camera:string; cancel:string }>;\n\nexport type SavedItem = Readonly<{ id: string; title: string }>;\nexport type SavedCollection = Readonly<{ id: string; title: string; itemIds: readonly string[] }>;\nexport type SavedItemsLabels = Readonly<{ allItems: string; privateNotice: string; back: string; empty: string; createCollection: string }>;\n\n/** Unsave removes an item from every collection view without rewriting product-owned membership. */\nexport function resolveSavedItems<T extends SavedItem>(items:readonly T[],collections:readonly SavedCollection[],collectionId:string|null|undefined,selectedItemId:string|null|undefined){\n const ids=new Set<string>(),groups=new Set<string>();\n for(const item of items){if(!item.id.trim()||ids.has(item.id)||!item.title.trim())throw new TypeError(\"Saved items require unique ids and nonempty titles\");ids.add(item.id);}\n for(const group of collections){if(!group.id.trim()||groups.has(group.id)||!group.title.trim())throw new TypeError(\"Saved collections require unique ids and nonempty titles\");groups.add(group.id);}\n const collection=collections.find(item=>item.id===collectionId);\n // A deleted collection returns to the overview instead of showing a mislabeled all-posts view.\n const home=collectionId===undefined||(collectionId!==null&&!collection);\n const visible=home||collectionId===null?items:items.filter(item=>collection?.itemIds.includes(item.id));\n return {home,collection,visible,selected:home?undefined:visible.find(item=>item.id===selectedItemId)};\n}\n\n/**\n * SearchScreen phases (2026-10-06 search redesign, docs/screen-patterns.md#searchscreen-두-단계-검색).\n * Without a committed query (one-step search, the pre-1.13 behavior) any nonblank query is already\n * `results`. With one, typing a different query is `typing`: suggestions replace the results until the\n * user commits (Enter, a suggestion, a recent or suggested query). Comparing trimmed values keeps a\n * trailing space from flipping committed results back into suggestions.\n */\nexport type SearchScreenPhase = \"idle\" | \"typing\" | \"results\";\nexport function resolveSearchScreenPhase(query: string, committedQuery?: string): SearchScreenPhase {\n const typed = query.trim();\n if (!typed) return \"idle\";\n if (committedQuery === undefined) return \"results\";\n return typed === committedQuery.trim() ? \"results\" : \"typing\";\n}\n\n/**\n * The value a commit records, or `null` when there is nothing to commit. Blank commits are dropped\n * so a stray Enter never writes an empty recent search or fetches \"everything\".\n */\nexport function resolveSearchCommit(value: string): string | null {\n const next = value.trim();\n return next ? next : null;\n}\n\n/**\n * Why a committed search shows nothing. `filters` keeps the filter rail and offers \"clear all\";\n * `query` hides the rail (no filter can fix it) and offers suggested queries instead. Reference\n * services hide the rail on every zero result, which removes the only way to undo a filter.\n * `null` count means the result is still loading, so no cause is reported yet.\n */\nexport type SearchEmptyCause = \"none\" | \"filters\" | \"query\";\nexport function resolveSearchEmptyCause(count: number | null, appliedFilterCount: number): SearchEmptyCause {\n // Loading/nonempty results must not bypass the same count contract used by empty results.\n if ((count !== null && (count < 0 || !Number.isSafeInteger(count))) || !Number.isSafeInteger(appliedFilterCount) || appliedFilterCount < 0) {\n throw new RangeError(\"Search counts must be nonnegative integers\");\n }\n if (count === null || count > 0) return \"none\";\n return appliedFilterCount > 0 ? \"filters\" : \"query\";\n}\n\n/**\n * Index to focus after removing item `removedIndex` from a list that now has `remaining` items:\n * the item that slid into its place, else the new last item, else -1 (move to the fallback target).\n * Removing a focused chip or row would otherwise drop focus to <body>.\n */\nexport function resolveFocusAfterRemoval(removedIndex: number, remaining: number): number {\n if (!Number.isInteger(removedIndex) || removedIndex < 0 || !Number.isInteger(remaining) || remaining < 0) {\n throw new RangeError(\"Removal indexes must be nonnegative integers\");\n }\n return remaining === 0 ? -1 : Math.min(removedIndex, remaining - 1);\n}\n\n/** Recipe for the SearchScreen phase sections; geometry stays on shared spacing tokens. */\nexport const searchScreenRecipe = {\n /** Debounced typing delay; explicit submit remains a separate host action. */\n debounceMs: 300,\n /** Recent searches shown before the user types; reference services show 5–10 and let the rest scroll away. */\n recentVisible: 5,\n /** Suggestions under the \"search for ‘q’\" row. */\n suggestionVisible: 6,\n /** Skeleton rows while the first page of results loads. */\n loadingRows: 4,\n /** Between idle sections (recent, suggested). */\n sectionGap: spacing.xl,\n /** Section title to its list, and results header to applied filters. */\n headerGap: spacing.sm,\n /** Between chips in applied filters and suggested queries. */\n chipGap: spacing.xs,\n} as const;\n\n/** Keep finite negative delays at zero; reject values whose timer behavior varies by host. */\nexport function resolveSearchDebounceMs(value: number = searchScreenRecipe.debounceMs): number {\n if (!Number.isFinite(value)) throw new RangeError(\"Search debounceMs must be finite\");\n return Math.max(0, value);\n}\n\n/** Horizontal intent preserves vertical scrolling and uses one reveal distance across renderers. */\nexport function timestampRevealOffset(dx: number, dy: number): number {\n // A 12px dead zone and 2:1 direction bias avoid turning taps/list scrolling into a time gesture.\n return dx > 12 && dx > Math.abs(dy) * 2 ? Math.min(dx, 88) : 0;\n}\n\n/** Notification previews need an actor/type badge and a separate subject thumbnail.\n * Keep this geometry shared so inboxes do not recreate the same row per product. */\nexport const notificationRowRecipe = {\n gap: 12, contentGap: 4, avatarSize: 44, avatarBadgeSize: 20,\n thumbnailSize: 44, unreadSize: 6, previewLines: 2, paddingBlock: 12, paddingInline: 16,\n} as const;\n\n/** Shared profile identity geometry; product owns the avatar content. */\nexport const profileSummaryRecipe = Object.freeze({ avatarSize: 72 });\n\n/** Launcher artwork stays above its caption; product overlays may extend beyond the icon frame. */\nexport const iconTileRecipe = Object.freeze({ iconSize: 64, labelMaxWidth: 72, multilineLabelMaxWidth: 84, multilineLabelMinHeight: 44, ghostOpacity: 0.55, gap: 6, iconRadius: \"22%\" });\n"]}
|
package/dist/sheet.d.ts
CHANGED
|
@@ -29,7 +29,21 @@ export declare const sheetBehaviorDefaults: {
|
|
|
29
29
|
readonly dismissWhileBusy: false;
|
|
30
30
|
readonly outsideDismiss: true;
|
|
31
31
|
readonly escapeOrBackDismiss: true;
|
|
32
|
-
readonly swipeDismiss:
|
|
32
|
+
readonly swipeDismiss: true;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Bottom sheets close by dragging only (2026-10-16 user decision): no backdrop tap and no visible ×
|
|
36
|
+
* by default. Escape/system back and the handle's close action stay so keyboard, switch and
|
|
37
|
+
* screen-reader users can still dismiss without a drag gesture. Other placements keep the old defaults.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveSheetDismissPolicy(placement: string, override?: Partial<SheetDismissPolicy>): SheetDismissPolicy;
|
|
40
|
+
export declare function resolveSheetCloseButton(placement: string, showClose?: boolean): boolean;
|
|
41
|
+
/** Release thresholds for the drag-to-dismiss gesture shared by both renderers. */
|
|
42
|
+
export declare const sheetDragRecipe: {
|
|
43
|
+
readonly activationDistance: 6;
|
|
44
|
+
readonly dismissDistanceRatio: 0.25;
|
|
45
|
+
/** px per millisecond: a quick flick closes before the distance threshold. */
|
|
46
|
+
readonly dismissVelocity: 0.5;
|
|
33
47
|
};
|
|
34
48
|
/**
|
|
35
49
|
* Resolves an attempted close without platform knowledge. Programmatic close is
|
package/dist/sheet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../src/sheet.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,QAAQ,GACR,MAAM,GACN,SAAS,GACT,OAAO,GACP,cAAc,CAAC;AAEnB;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,MAAM,EAAE,SAAS,GAAG,kBAAkB,CAAC;CACxC,CAAC,CAAC;AAEH,iFAAiF;AACjF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAEH,MAAM,MAAM,cAAc,GACtB,QAAQ,CAAC;IACP,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACnE,CAAC,GACF,QAAQ,CAAC;IACP,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACxE,CAAC,CAAC;AAEP,eAAO,MAAM,qBAAqB;;;;;;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../src/sheet.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,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,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,OAAO,EACb,MAAM,GAAE,kBAA0C,GACjD,OAAO,CAUT;AAED,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,IAAI,IAAI,MAAM,CAAC;IACf,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CACV,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,OAAO,EACb,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC;IACX,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CACzC,CAAC,CAAC;AAEH;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,gBAAgB,UAAQ,GACvB,cAAc,CAgChB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtD,eAAO,MAAM,gBAAgB,sCAAwE,CAAC;AAEtG,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,IAAI,CAsB1E;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,WAAW,EAAE,EAC/B,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,QAAQ,GAAG,UAAU,GAC/B,WAAW,GAAG,IAAI,CASpB"}
|
package/dist/sheet.js
CHANGED
|
@@ -3,7 +3,26 @@ export const sheetBehaviorDefaults = {
|
|
|
3
3
|
dismissWhileBusy: false,
|
|
4
4
|
outsideDismiss: true,
|
|
5
5
|
escapeOrBackDismiss: true,
|
|
6
|
-
|
|
6
|
+
// 2026-10-16 user decision: dragging a bottom sheet down is a required way to close it.
|
|
7
|
+
swipeDismiss: true,
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Bottom sheets close by dragging only (2026-10-16 user decision): no backdrop tap and no visible ×
|
|
11
|
+
* by default. Escape/system back and the handle's close action stay so keyboard, switch and
|
|
12
|
+
* screen-reader users can still dismiss without a drag gesture. Other placements keep the old defaults.
|
|
13
|
+
*/
|
|
14
|
+
export function resolveSheetDismissPolicy(placement, override = {}) {
|
|
15
|
+
return { ...sheetBehaviorDefaults, ...(placement === "bottom" ? { outsideDismiss: false } : {}), ...override };
|
|
16
|
+
}
|
|
17
|
+
export function resolveSheetCloseButton(placement, showClose) {
|
|
18
|
+
return showClose ?? placement !== "bottom";
|
|
19
|
+
}
|
|
20
|
+
/** Release thresholds for the drag-to-dismiss gesture shared by both renderers. */
|
|
21
|
+
export const sheetDragRecipe = {
|
|
22
|
+
activationDistance: 6,
|
|
23
|
+
dismissDistanceRatio: 0.25,
|
|
24
|
+
/** px per millisecond: a quick flick closes before the distance threshold. */
|
|
25
|
+
dismissVelocity: 0.5,
|
|
7
26
|
};
|
|
8
27
|
/**
|
|
9
28
|
* Resolves an attempted close without platform knowledge. Programmatic close is
|
package/dist/sheet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../src/sheet.ts"],"names":[],"mappings":"AAsCA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE,IAAI;IACpB,mBAAmB,EAAE,IAAI;IACzB,YAAY,EAAE,KAAK;CACkB,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,MAA0B,EAC1B,IAAa,EACb,SAA6B,qBAAqB;IAElD,IAAI,MAAM,KAAK,cAAc;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,CAAC,MAAM,CAAC,WAAW;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB;QAAE,OAAO,KAAK,CAAC;IACnD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,cAAc,CAAC;IACvD,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MA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M,UAAU,sBAAsB,CACpC,OAA+B,EAC/B,OAAoB,EACpB,SAAgC;IAEhC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,UAAU,CAAC,4CAA4C,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IACD,MAAM,IAAI,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;IAC5D,0DAA0D;IAC1D,OAAO,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAE,CAAC;AACpE,CAAC","sourcesContent":["/** Why an open Sheet is being asked to close. */\nexport type SheetDismissReason =\n | \"close-action\"\n | \"escape\"\n | \"back\"\n | \"outside\"\n | \"swipe\"\n | \"programmatic\";\n\n/**\n * `trigger` only opens a Sheet. Every close reports the concrete dismiss reason\n * so renderers and product analytics do not have to infer it from platform events.\n */\nexport type SheetOpenChangeDetails = Readonly<{\n reason: \"trigger\" | SheetDismissReason;\n}>;\n\n/** User-dismiss policy. A controlled owner may always close programmatically. */\nexport type SheetDismissPolicy = Readonly<{\n dismissible: boolean;\n dismissWhileBusy: boolean;\n outsideDismiss: boolean;\n escapeOrBackDismiss: boolean;\n swipeDismiss: boolean;\n}>;\n\nexport type SheetOpenState =\n | Readonly<{\n open: boolean;\n defaultOpen?: never;\n onOpenChange(open: boolean, detail: SheetOpenChangeDetails): void;\n }>\n | Readonly<{\n open?: never;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, detail: SheetOpenChangeDetails) => void;\n }>;\n\nexport const sheetBehaviorDefaults = {\n dismissible: true,\n dismissWhileBusy: false,\n outsideDismiss: true,\n escapeOrBackDismiss: true,\n swipeDismiss: false,\n} as const satisfies SheetDismissPolicy;\n\n/**\n * Resolves an attempted close without platform knowledge. Programmatic close is\n * intentionally an owner override: a controlled `open={false}` cannot be vetoed\n * by a renderer, even while the Sheet is busy or not user-dismissible.\n */\nexport function canDismissSheet(\n reason: SheetDismissReason,\n busy: boolean,\n policy: SheetDismissPolicy = sheetBehaviorDefaults,\n): boolean {\n if (reason === \"programmatic\") return true;\n if (!policy.dismissible) return false;\n if (busy && !policy.dismissWhileBusy) return false;\n if (reason === \"outside\") return policy.outsideDismiss;\n if (reason === \"escape\" || reason === \"back\") {\n return policy.escapeOrBackDismiss;\n }\n if (reason === \"swipe\") return policy.swipeDismiss;\n return true;\n}\n\nexport type SheetLifecycle = Readonly<{\n open(): number;\n beginDismiss(): number | null;\n requestClose(\n reason: SheetDismissReason,\n busy: boolean,\n policy?: SheetDismissPolicy,\n ): boolean;\n completeDismiss(cycle: number): boolean;\n}>;\n\n/**\n * Makes persistent native Modal renderers settle each visible cycle once.\n * Platform adapters still decide when native dismissal has actually completed.\n */\nexport function createSheetLifecycle(\n initiallyVisible = false,\n): SheetLifecycle {\n let sequence = initiallyVisible ? 1 : 0;\n let activeCycle: number | null = initiallyVisible ? sequence : null;\n let closeRequested = false;\n const dismissingCycles = new Set<number>();\n\n return {\n open() {\n if (activeCycle !== null) return activeCycle;\n sequence += 1;\n activeCycle = sequence;\n closeRequested = false;\n return activeCycle;\n },\n beginDismiss() {\n if (activeCycle === null) return null;\n const cycle = activeCycle;\n activeCycle = null;\n closeRequested = false;\n dismissingCycles.add(cycle);\n return cycle;\n },\n requestClose(reason, busy, policy = sheetBehaviorDefaults) {\n if (activeCycle === null || closeRequested) return false;\n if (!canDismissSheet(reason, busy, policy)) return false;\n closeRequested = true;\n return true;\n },\n completeDismiss(cycle) {\n return dismissingCycles.delete(cycle);\n },\n };\n}\n\n/**\n * 사용자가 시트 높이를 바꾸는 축이다. `sheetRecipe.sizes`는 제품이 여는 높이를 정하고,\n * 이것은 열린 뒤 **사용자가** 단계를 옮기는 문제다 — 지도 위 목록처럼 \"조금 보기 ↔ 크게\n * 보기\"가 필요한 화면이 그 자리다.\n *\n * `auto`는 단계에 들어가지 않는다. 내용이 정하는 높이라 \"다음 단계\"가 정의되지 않는다.\n *\n * **드래그 물리는 여기 없다.** 이 계약은 단계 목록과 \"다음/이전 단계가 무엇인가\"만 갖고,\n * 손가락 속도·관성·고무줄은 넣지 않았다 — 실제 제품 화면 없이 그 값을 정하면 기기에서\n * 다시 다 고치게 된다. 대신 **핸들이 접근 가능한 컨트롤**이라 키보드·보조기기에서도\n * 단계를 옮길 수 있다. 제스처는 제품이 얹고, 결과를 같은 `onDetentChange`로 보낸다.\n */\nexport type SheetDetent = \"medium\" | \"large\" | \"full\";\n\nexport const sheetDetentOrder = [\"medium\", \"large\", \"full\"] as const satisfies readonly SheetDetent[];\n\nexport function validateSheetDetents(detents: readonly SheetDetent[]): void {\n if (detents.length === 0) {\n throw new RangeError(\"Sheet detents must not be empty\");\n }\n const seen = new Set<SheetDetent>();\n for (const detent of detents) {\n if (!sheetDetentOrder.includes(detent)) {\n throw new TypeError(`Unsupported Sheet detent: ${String(detent)}`);\n }\n if (seen.has(detent)) throw new TypeError(`Duplicate Sheet detent: ${detent}`);\n seen.add(detent);\n }\n const ordered = [...detents].sort(\n (left, right) => sheetDetentOrder.indexOf(left) - sheetDetentOrder.indexOf(right),\n );\n if (ordered.some((detent, index) => detent !== detents[index])) {\n /*\n 정렬을 대신 해 주지 않는 이유: 순서가 곧 \"다음 단계\"의 의미라서, 제품이 적은 순서와\n 실제 이동 순서가 다르면 디버깅할 수 없는 화면이 된다.\n */\n throw new TypeError(\"Sheet detents must be listed from smallest to largest\");\n }\n}\n\nexport function resolveNextSheetDetent(\n detents: readonly SheetDetent[],\n current: SheetDetent,\n direction: \"expand\" | \"collapse\",\n): SheetDetent | null {\n validateSheetDetents(detents);\n const index = detents.indexOf(current);\n if (index === -1) {\n throw new RangeError(`Sheet current detent is not in the list: ${current}`);\n }\n const next = direction === \"expand\" ? index + 1 : index - 1;\n /** 끝에서는 `null`이다 — renderer가 \"더 갈 수 없다\"를 컨트롤 상태로 표현한다. */\n return next < 0 || next >= detents.length ? null : detents[next]!;\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../src/sheet.ts"],"names":[],"mappings":"AAsCA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE,IAAI;IACpB,mBAAmB,EAAE,IAAI;IACzB,wFAAwF;IACxF,YAAY,EAAE,IAAI;CACmB,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,SAAiB,EAAE,WAAwC,EAAE;IACrG,OAAO,EAAE,GAAG,qBAAqB,EAAE,GAAG,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC;AACjH,CAAC;AACD,MAAM,UAAU,uBAAuB,CAAC,SAAiB,EAAE,SAAmB;IAC5E,OAAO,SAAS,IAAI,SAAS,KAAK,QAAQ,CAAC;AAC7C,CAAC;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,kBAAkB,EAAE,CAAC;IACrB,oBAAoB,EAAE,IAAI;IAC1B,8EAA8E;IAC9E,eAAe,EAAE,GAAG;CACZ,CAAC;AAEX;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,MAA0B,EAC1B,IAAa,EACb,SAA6B,qBAAqB;IAElD,IAAI,MAAM,KAAK,cAAc;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,CAAC,MAAM,CAAC,WAAW;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,gBAA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KAAK,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC/D;;;UAGE;QACF,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,OAA+B,EAC/B,OAAoB,EACpB,SAAgC;IAEhC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,UAAU,CAAC,4CAA4C,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IACD,MAAM,IAAI,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;IAC5D,0DAA0D;IAC1D,OAAO,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAE,CAAC;AACpE,CAAC","sourcesContent":["/** Why an open Sheet is being asked to close. */\nexport type SheetDismissReason =\n | \"close-action\"\n | \"escape\"\n | \"back\"\n | \"outside\"\n | \"swipe\"\n | \"programmatic\";\n\n/**\n * `trigger` only opens a Sheet. Every close reports the concrete dismiss reason\n * so renderers and product analytics do not have to infer it from platform events.\n */\nexport type SheetOpenChangeDetails = Readonly<{\n reason: \"trigger\" | SheetDismissReason;\n}>;\n\n/** User-dismiss policy. A controlled owner may always close programmatically. */\nexport type SheetDismissPolicy = Readonly<{\n dismissible: boolean;\n dismissWhileBusy: boolean;\n outsideDismiss: boolean;\n escapeOrBackDismiss: boolean;\n swipeDismiss: boolean;\n}>;\n\nexport type SheetOpenState =\n | Readonly<{\n open: boolean;\n defaultOpen?: never;\n onOpenChange(open: boolean, detail: SheetOpenChangeDetails): void;\n }>\n | Readonly<{\n open?: never;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, detail: SheetOpenChangeDetails) => void;\n }>;\n\nexport const sheetBehaviorDefaults = {\n dismissible: true,\n dismissWhileBusy: false,\n outsideDismiss: true,\n escapeOrBackDismiss: true,\n // 2026-10-16 user decision: dragging a bottom sheet down is a required way to close it.\n swipeDismiss: true,\n} as const satisfies SheetDismissPolicy;\n\n/**\n * Bottom sheets close by dragging only (2026-10-16 user decision): no backdrop tap and no visible ×\n * by default. Escape/system back and the handle's close action stay so keyboard, switch and\n * screen-reader users can still dismiss without a drag gesture. Other placements keep the old defaults.\n */\nexport function resolveSheetDismissPolicy(placement: string, override: Partial<SheetDismissPolicy> = {}): SheetDismissPolicy {\n return { ...sheetBehaviorDefaults, ...(placement === \"bottom\" ? { outsideDismiss: false } : {}), ...override };\n}\nexport function resolveSheetCloseButton(placement: string, showClose?: boolean): boolean {\n return showClose ?? placement !== \"bottom\";\n}\n\n/** Release thresholds for the drag-to-dismiss gesture shared by both renderers. */\nexport const sheetDragRecipe = {\n activationDistance: 6,\n dismissDistanceRatio: 0.25,\n /** px per millisecond: a quick flick closes before the distance threshold. */\n dismissVelocity: 0.5,\n} as const;\n\n/**\n * Resolves an attempted close without platform knowledge. Programmatic close is\n * intentionally an owner override: a controlled `open={false}` cannot be vetoed\n * by a renderer, even while the Sheet is busy or not user-dismissible.\n */\nexport function canDismissSheet(\n reason: SheetDismissReason,\n busy: boolean,\n policy: SheetDismissPolicy = sheetBehaviorDefaults,\n): boolean {\n if (reason === \"programmatic\") return true;\n if (!policy.dismissible) return false;\n if (busy && !policy.dismissWhileBusy) return false;\n if (reason === \"outside\") return policy.outsideDismiss;\n if (reason === \"escape\" || reason === \"back\") {\n return policy.escapeOrBackDismiss;\n }\n if (reason === \"swipe\") return policy.swipeDismiss;\n return true;\n}\n\nexport type SheetLifecycle = Readonly<{\n open(): number;\n beginDismiss(): number | null;\n requestClose(\n reason: SheetDismissReason,\n busy: boolean,\n policy?: SheetDismissPolicy,\n ): boolean;\n completeDismiss(cycle: number): boolean;\n}>;\n\n/**\n * Makes persistent native Modal renderers settle each visible cycle once.\n * Platform adapters still decide when native dismissal has actually completed.\n */\nexport function createSheetLifecycle(\n initiallyVisible = false,\n): SheetLifecycle {\n let sequence = initiallyVisible ? 1 : 0;\n let activeCycle: number | null = initiallyVisible ? sequence : null;\n let closeRequested = false;\n const dismissingCycles = new Set<number>();\n\n return {\n open() {\n if (activeCycle !== null) return activeCycle;\n sequence += 1;\n activeCycle = sequence;\n closeRequested = false;\n return activeCycle;\n },\n beginDismiss() {\n if (activeCycle === null) return null;\n const cycle = activeCycle;\n activeCycle = null;\n closeRequested = false;\n dismissingCycles.add(cycle);\n return cycle;\n },\n requestClose(reason, busy, policy = sheetBehaviorDefaults) {\n if (activeCycle === null || closeRequested) return false;\n if (!canDismissSheet(reason, busy, policy)) return false;\n closeRequested = true;\n return true;\n },\n completeDismiss(cycle) {\n return dismissingCycles.delete(cycle);\n },\n };\n}\n\n/**\n * 사용자가 시트 높이를 바꾸는 축이다. `sheetRecipe.sizes`는 제품이 여는 높이를 정하고,\n * 이것은 열린 뒤 **사용자가** 단계를 옮기는 문제다 — 지도 위 목록처럼 \"조금 보기 ↔ 크게\n * 보기\"가 필요한 화면이 그 자리다.\n *\n * `auto`는 단계에 들어가지 않는다. 내용이 정하는 높이라 \"다음 단계\"가 정의되지 않는다.\n *\n * **드래그 물리는 여기 없다.** 이 계약은 단계 목록과 \"다음/이전 단계가 무엇인가\"만 갖고,\n * 손가락 속도·관성·고무줄은 넣지 않았다 — 실제 제품 화면 없이 그 값을 정하면 기기에서\n * 다시 다 고치게 된다. 대신 **핸들이 접근 가능한 컨트롤**이라 키보드·보조기기에서도\n * 단계를 옮길 수 있다. 제스처는 제품이 얹고, 결과를 같은 `onDetentChange`로 보낸다.\n */\nexport type SheetDetent = \"medium\" | \"large\" | \"full\";\n\nexport const sheetDetentOrder = [\"medium\", \"large\", \"full\"] as const satisfies readonly SheetDetent[];\n\nexport function validateSheetDetents(detents: readonly SheetDetent[]): void {\n if (detents.length === 0) {\n throw new RangeError(\"Sheet detents must not be empty\");\n }\n const seen = new Set<SheetDetent>();\n for (const detent of detents) {\n if (!sheetDetentOrder.includes(detent)) {\n throw new TypeError(`Unsupported Sheet detent: ${String(detent)}`);\n }\n if (seen.has(detent)) throw new TypeError(`Duplicate Sheet detent: ${detent}`);\n seen.add(detent);\n }\n const ordered = [...detents].sort(\n (left, right) => sheetDetentOrder.indexOf(left) - sheetDetentOrder.indexOf(right),\n );\n if (ordered.some((detent, index) => detent !== detents[index])) {\n /*\n 정렬을 대신 해 주지 않는 이유: 순서가 곧 \"다음 단계\"의 의미라서, 제품이 적은 순서와\n 실제 이동 순서가 다르면 디버깅할 수 없는 화면이 된다.\n */\n throw new TypeError(\"Sheet detents must be listed from smallest to largest\");\n }\n}\n\nexport function resolveNextSheetDetent(\n detents: readonly SheetDetent[],\n current: SheetDetent,\n direction: \"expand\" | \"collapse\",\n): SheetDetent | null {\n validateSheetDetents(detents);\n const index = detents.indexOf(current);\n if (index === -1) {\n throw new RangeError(`Sheet current detent is not in the list: ${current}`);\n }\n const next = direction === \"expand\" ? index + 1 : index - 1;\n /** 끝에서는 `null`이다 — renderer가 \"더 갈 수 없다\"를 컨트롤 상태로 표현한다. */\n return next < 0 || next >= detents.length ? null : detents[next]!;\n}\n\n"]}
|
package/dist/showcase.d.ts
CHANGED
|
@@ -20,35 +20,35 @@ export type ShowcaseEnvironment = Readonly<{
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const showcaseEnvironmentMatrix: readonly [{
|
|
22
22
|
readonly id: "default";
|
|
23
|
-
readonly label: "
|
|
23
|
+
readonly label: "밝게 · 왼쪽→오른쪽 · 100%";
|
|
24
24
|
readonly theme: "light";
|
|
25
25
|
readonly direction: "ltr";
|
|
26
26
|
readonly textScale: 1;
|
|
27
27
|
readonly motion: "full";
|
|
28
28
|
}, {
|
|
29
29
|
readonly id: "dark";
|
|
30
|
-
readonly label: "
|
|
30
|
+
readonly label: "어둡게 · 왼쪽→오른쪽 · 100%";
|
|
31
31
|
readonly theme: "dark";
|
|
32
32
|
readonly direction: "ltr";
|
|
33
33
|
readonly textScale: 1;
|
|
34
34
|
readonly motion: "full";
|
|
35
35
|
}, {
|
|
36
36
|
readonly id: "large-text";
|
|
37
|
-
readonly label: "
|
|
37
|
+
readonly label: "밝게 · 왼쪽→오른쪽 · 200%";
|
|
38
38
|
readonly theme: "light";
|
|
39
39
|
readonly direction: "ltr";
|
|
40
40
|
readonly textScale: 2;
|
|
41
41
|
readonly motion: "full";
|
|
42
42
|
}, {
|
|
43
43
|
readonly id: "rtl";
|
|
44
|
-
readonly label: "
|
|
44
|
+
readonly label: "밝게 · 오른쪽→왼쪽 · 100%";
|
|
45
45
|
readonly theme: "light";
|
|
46
46
|
readonly direction: "rtl";
|
|
47
47
|
readonly textScale: 1;
|
|
48
48
|
readonly motion: "full";
|
|
49
49
|
}, {
|
|
50
50
|
readonly id: "reduced-motion";
|
|
51
|
-
readonly label: "
|
|
51
|
+
readonly label: "밝게 · 왼쪽→오른쪽 · 동작 줄이기";
|
|
52
52
|
readonly theme: "light";
|
|
53
53
|
readonly direction: "ltr";
|
|
54
54
|
readonly textScale: 1;
|
|
@@ -65,48 +65,48 @@ export type ShowcaseScenario = Readonly<{
|
|
|
65
65
|
}>;
|
|
66
66
|
export declare const showcaseScenarios: readonly [{
|
|
67
67
|
readonly id: "contract";
|
|
68
|
-
readonly label: "
|
|
69
|
-
readonly description: "
|
|
68
|
+
readonly label: "계약";
|
|
69
|
+
readonly description: "구조·기본값·지원 축·플랫폼과 성숙도가 보인다.";
|
|
70
70
|
}, {
|
|
71
71
|
readonly id: "default";
|
|
72
|
-
readonly label: "
|
|
73
|
-
readonly description: "
|
|
72
|
+
readonly label: "기본";
|
|
73
|
+
readonly description: "제품 설정을 덮어쓰지 않고 recipe 기본값으로 보통 상태를 그린다.";
|
|
74
74
|
}, {
|
|
75
75
|
readonly id: "dark";
|
|
76
|
-
readonly label: "
|
|
77
|
-
readonly description: "
|
|
76
|
+
readonly label: "어두운 테마";
|
|
77
|
+
readonly description: "어두운 테마에서도 의미 색이 읽힌다.";
|
|
78
78
|
}, {
|
|
79
79
|
readonly id: "long-copy";
|
|
80
|
-
readonly label: "
|
|
81
|
-
readonly description: "
|
|
80
|
+
readonly label: "긴 문구";
|
|
81
|
+
readonly description: "긴 한국어·영어 문구가 잘리거나 의미를 숨기지 않고 줄바꿈된다.";
|
|
82
82
|
}, {
|
|
83
83
|
readonly id: "large-text";
|
|
84
|
-
readonly label: "200%
|
|
85
|
-
readonly description: "
|
|
84
|
+
readonly label: "200% 글자";
|
|
85
|
+
readonly description: "글자를 200%까지 키워도 필요한 정보가 잘리지 않는다.";
|
|
86
86
|
}, {
|
|
87
87
|
readonly id: "rtl";
|
|
88
|
-
readonly label: "
|
|
89
|
-
readonly description: "
|
|
88
|
+
readonly label: "오른쪽→왼쪽";
|
|
89
|
+
readonly description: "논리적 시작·끝 배치와 방향 아이콘이 올바르게 뒤집힌다.";
|
|
90
90
|
}, {
|
|
91
91
|
readonly id: "reduced-motion";
|
|
92
|
-
readonly label: "
|
|
93
|
-
readonly description: "
|
|
92
|
+
readonly label: "동작 줄이기";
|
|
93
|
+
readonly description: "움직임이 recipe의 동작 줄이기 대체 표현을 따른다.";
|
|
94
94
|
}, {
|
|
95
95
|
readonly id: "accessibility";
|
|
96
|
-
readonly label: "
|
|
97
|
-
readonly description: "
|
|
96
|
+
readonly label: "접근성";
|
|
97
|
+
readonly description: "이름·상태·관계·대비·터치 영역을 확인할 수 있다.";
|
|
98
98
|
}, {
|
|
99
99
|
readonly id: "keyboard";
|
|
100
|
-
readonly label: "
|
|
101
|
-
readonly description: "
|
|
100
|
+
readonly label: "키보드";
|
|
101
|
+
readonly description: "포커스 순서와 문서화한 키보드 동작을 상호작용 테스트로 실행한다.";
|
|
102
102
|
}, {
|
|
103
103
|
readonly id: "native-actions";
|
|
104
|
-
readonly label: "
|
|
105
|
-
readonly description: "
|
|
104
|
+
readonly label: "앱 동작";
|
|
105
|
+
readonly description: "접근성 동작과 그 상태 변화를 Native renderer에서 실행한다.";
|
|
106
106
|
}, {
|
|
107
107
|
readonly id: "platform-parity";
|
|
108
|
-
readonly label: "
|
|
109
|
-
readonly description: "
|
|
108
|
+
readonly label: "웹·앱 동등성";
|
|
109
|
+
readonly description: "각 renderer가 플랫폼 고유 동작을 쓰면서 같은 의도를 유지한다.";
|
|
110
110
|
}];
|
|
111
111
|
export type ShowcaseComponentEntry = Readonly<{
|
|
112
112
|
storyId: string;
|