@astryxdesign/core 0.4.2 → 0.4.3-canary.00bed29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +79 -45
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +3 -19
- package/dist/Banner/Banner.d.ts +9 -2
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +84 -33
- package/dist/Banner/index.d.ts +14 -12
- package/dist/Banner/index.d.ts.map +1 -1
- package/dist/Banner/index.js +10 -8
- package/dist/BottomSheet/BottomSheet.d.ts +66 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/dist/BottomSheet/BottomSheet.js +392 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts +60 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -0
- package/dist/BottomSheet/BottomSheetPanel.js +398 -0
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts +61 -0
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -0
- package/dist/BottomSheet/BottomSheetSwitcher.js +410 -0
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts +21 -0
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -0
- package/dist/BottomSheet/BottomSheetSwitcherContext.js +13 -0
- package/dist/BottomSheet/index.d.ts +11 -0
- package/dist/BottomSheet/index.d.ts.map +1 -0
- package/dist/BottomSheet/index.js +12 -0
- package/dist/BottomSheet/snapOffsets.d.ts +72 -0
- package/dist/BottomSheet/snapOffsets.d.ts.map +1 -0
- package/dist/BottomSheet/snapOffsets.js +130 -0
- package/dist/BottomSheet/useMobileKeyboard.d.ts +35 -0
- package/dist/BottomSheet/useMobileKeyboard.d.ts.map +1 -0
- package/dist/BottomSheet/useMobileKeyboard.js +373 -0
- package/dist/BottomSheet/useSheetGestures.d.ts +180 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -0
- package/dist/BottomSheet/useSheetGestures.js +942 -0
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +3 -4
- package/dist/Chat/ChatTokenizedText.js +1 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts +38 -4
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +98 -31
- package/dist/ComplexSelector/index.d.ts +2 -2
- package/dist/ComplexSelector/index.d.ts.map +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +4 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +9 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +31 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +2 -1
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +9 -3
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +55 -12
- package/dist/MobileNav/MobileNav.d.ts +12 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +102 -30
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +21 -7
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +9 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +4 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +1 -1
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +2 -4
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +14 -3
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +5 -1
- package/dist/Table/columnUtils.d.ts.map +1 -1
- package/dist/Table/columnUtils.js +4 -1
- package/dist/TextArea/TextArea.d.ts +6 -3
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +17 -6
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +8 -1
- package/dist/Tokenizer/Tokenizer.js +11 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +4 -1
- package/dist/TreeList/TreeList.js +2 -1
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +5 -3
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +10 -1
- package/dist/astryx.css +25 -2
- package/dist/hooks/index.d.ts +8 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +8 -1
- package/dist/hooks/useFocusTrap.d.ts +0 -11
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +1 -11
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/theme/defineTheme.d.ts +30 -7
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +36 -47
- package/dist/theme/expandColorScale.d.ts +17 -2
- package/dist/theme/expandColorScale.d.ts.map +1 -1
- package/dist/theme/expandColorScale.js +63 -33
- package/dist/theme/mergeComponents.d.ts +20 -0
- package/dist/theme/mergeComponents.d.ts.map +1 -0
- package/dist/theme/mergeComponents.js +56 -0
- package/dist/theme/onMediaTokens.d.ts +6 -1
- package/dist/theme/onMediaTokens.d.ts.map +1 -1
- package/dist/theme/onMediaTokens.js +11 -3
- package/dist/utils/characters.d.ts +27 -0
- package/dist/utils/characters.d.ts.map +1 -0
- package/dist/utils/characters.js +83 -0
- package/dist/utils/ime.d.ts +5 -0
- package/dist/utils/ime.d.ts.map +1 -0
- package/dist/utils/ime.js +63 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -1
- package/locales/en.json +48 -0
- package/locales/pseudo.json +36 -0
- package/package.json +9 -8
- package/src/Avatar/Avatar.test.tsx +6 -1
- package/src/Avatar/Avatar.tsx +3 -21
- package/src/Banner/Banner.doc.mjs +12 -10
- package/src/Banner/Banner.test.tsx +108 -0
- package/src/Banner/Banner.tsx +124 -38
- package/src/Banner/index.ts +15 -13
- package/src/BottomSheet/BottomSheet.doc.mjs +266 -0
- package/src/BottomSheet/BottomSheet.test.tsx +2114 -0
- package/src/BottomSheet/BottomSheet.tsx +545 -0
- package/src/BottomSheet/BottomSheetPanel.test.tsx +240 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +547 -0
- package/src/BottomSheet/BottomSheetSwitcher.doc.mjs +219 -0
- package/src/BottomSheet/BottomSheetSwitcher.test.tsx +850 -0
- package/src/BottomSheet/BottomSheetSwitcher.tsx +628 -0
- package/src/BottomSheet/BottomSheetSwitcherContext.ts +51 -0
- package/src/BottomSheet/index.ts +15 -0
- package/src/BottomSheet/snapOffsets.test.ts +187 -0
- package/src/BottomSheet/snapOffsets.ts +159 -0
- package/src/BottomSheet/useMobileKeyboard.ts +499 -0
- package/src/BottomSheet/useSheetGestures.test.ts +1014 -0
- package/src/BottomSheet/useSheetGestures.ts +1407 -0
- package/src/Chat/ChatComposerInput.tsx +3 -4
- package/src/Chat/ChatTokenizedText.tsx +1 -1
- package/src/ComplexSelector/ComplexSelector.doc.mjs +55 -6
- package/src/ComplexSelector/ComplexSelector.test.tsx +197 -6
- package/src/ComplexSelector/ComplexSelector.tsx +156 -28
- package/src/ComplexSelector/index.ts +3 -1
- package/src/ContextMenu/ContextMenu.tsx +4 -2
- package/src/DateInput/DateInput.test.tsx +21 -0
- package/src/DateInput/DateInput.tsx +9 -1
- package/src/DateTimeInput/DateTimeInput.doc.mjs +4 -0
- package/src/DateTimeInput/DateTimeInput.test.tsx +137 -0
- package/src/DateTimeInput/DateTimeInput.tsx +39 -2
- package/src/Dialog/Dialog.tsx +2 -1
- package/src/FileInput/FileInput.test.tsx +53 -9
- package/src/Lightbox/Lightbox.test.tsx +49 -28
- package/src/Lightbox/Lightbox.tsx +7 -3
- package/src/Markdown/parser.test.ts +53 -0
- package/src/Markdown/parser.ts +53 -12
- package/src/MobileNav/MobileNav.tsx +128 -37
- package/src/MobileNav/MobileNavCloseEdgeCases.test.tsx +426 -0
- package/src/MobileNav/MobileNavCloseTiming.test.ts +58 -0
- package/src/MobileNav/MobileNavCloseVisibility.test.tsx +172 -0
- package/src/MultiSelector/MultiSelector.test.tsx +195 -51
- package/src/MultiSelector/MultiSelector.tsx +22 -8
- package/src/NumberInput/NumberInput.test.tsx +18 -0
- package/src/NumberInput/NumberInput.tsx +9 -1
- package/src/PowerSearch/PowerSearch.test.tsx +48 -3
- package/src/PowerSearch/PowerSearch.tsx +4 -1
- package/src/PowerSearch/PowerSearchEditPopover.tsx +1 -1
- package/src/PowerSearch/formatFilterValue.test.ts +22 -0
- package/src/PowerSearch/formatFilterValue.ts +2 -4
- package/src/Selector/Selector.test.tsx +85 -26
- package/src/Selector/Selector.tsx +13 -4
- package/src/Switch/Switch.test.tsx +16 -0
- package/src/Switch/Switch.tsx +7 -0
- package/src/Table/Table.test.tsx +6 -0
- package/src/Table/columnUtils.ts +3 -1
- package/src/TextArea/TextArea.doc.mjs +1 -1
- package/src/TextArea/TextArea.test.tsx +72 -0
- package/src/TextArea/TextArea.tsx +26 -8
- package/src/TimeInput/TimeInput.test.tsx +23 -0
- package/src/TimeInput/TimeInput.tsx +8 -0
- package/src/Tokenizer/Tokenizer.test.tsx +50 -32
- package/src/Tokenizer/Tokenizer.tsx +5 -5
- package/src/Tooltip/useTooltip.tsx +4 -1
- package/src/TreeList/TreeList.doc.mjs +2 -2
- package/src/TreeList/TreeList.tsx +1 -1
- package/src/Typeahead/BaseTypeahead.tsx +10 -3
- package/src/Typeahead/Typeahead.test.tsx +116 -7
- package/src/Typeahead/Typeahead.tsx +10 -1
- package/src/__tests__/stubMatchMedia.test.ts +79 -0
- package/src/__tests__/stubMatchMedia.ts +95 -0
- package/src/hooks/index.ts +9 -5
- package/src/hooks/useFocusTrap.ts +1 -14
- package/src/hooks/useInputStatusIcon.test.tsx +19 -0
- package/src/hooks/useInputStatusIcon.tsx +7 -0
- package/src/index.ts +1 -0
- package/src/theme/defineTheme.test.ts +127 -0
- package/src/theme/defineTheme.ts +70 -55
- package/src/theme/expandColorScale.test.ts +138 -0
- package/src/theme/expandColorScale.ts +89 -44
- package/src/theme/extensibleAxes.test.ts +365 -0
- package/src/theme/mergeComponents.ts +59 -0
- package/src/theme/onMediaTokens.ts +9 -2
- package/src/utils/characters.test.ts +141 -0
- package/src/utils/characters.ts +88 -0
- package/src/utils/ime.test.ts +32 -0
- package/src/utils/ime.ts +69 -0
- package/src/utils/index.ts +4 -0
- package/dist/astryx.umd.js +0 -147
- package/dist/astryx.umd.js.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposerInput.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposerInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAML,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,cAAc,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAarE,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAQ,KAAK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
|
27
27
|
import * as stylex from '@stylexjs/stylex';
|
|
28
28
|
import "../theme/tokens.stylex.js";
|
|
29
29
|
import { colorVars, spacingVars, typeScaleVars, typographyVars } from "../theme/tokens.stylex.js";
|
|
30
|
-
import { mergeProps } from "../utils/index.js";
|
|
30
|
+
import { mergeProps, isImeKeyEvent } from "../utils/index.js";
|
|
31
31
|
import { useTriggerMenu } from "./useTriggerMenu.js";
|
|
32
32
|
import { useChatComposerTokens, isCustomToken } from "./useChatComposerTokens.js";
|
|
33
33
|
import { ensureCaretInside, insertTextAtCursor } from "./chatComposerSelection.js";
|
|
@@ -349,9 +349,8 @@ export function ChatComposerInput(props) {
|
|
|
349
349
|
}
|
|
350
350
|
if (e.key === 'Enter' && !e.shiftKey) {
|
|
351
351
|
// Never submit mid-composition — an IME uses Enter to commit a
|
|
352
|
-
// candidate
|
|
353
|
-
|
|
354
|
-
if (e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229) {
|
|
352
|
+
// candidate. See utils/ime.ts for the full rationale.
|
|
353
|
+
if (isImeKeyEvent(e.nativeEvent)) {
|
|
355
354
|
return;
|
|
356
355
|
}
|
|
357
356
|
e.preventDefault();
|
|
@@ -45,7 +45,7 @@ function isCustomToken(token) {
|
|
|
45
45
|
return 'render' in token && typeof token.render === 'function';
|
|
46
46
|
}
|
|
47
47
|
function escapeRegExp(str) {
|
|
48
|
-
return str.replace(/[.*+?^${}()|[
|
|
48
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// =============================================================================
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file ComplexSelector.tsx
|
|
3
|
-
* @input Uses React, StyleX, Field, usePopover
|
|
4
|
-
* @output Exports
|
|
3
|
+
* @input Uses React, StyleX, Field, Icon slots, Layer positioning, and usePopover
|
|
4
|
+
* @output Exports a rich-selector shell with exact token-sized input and ghost triggers, plus an imperative open/close handle
|
|
5
5
|
* @position Core implementation; consumed by index.ts
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update:
|
|
@@ -9,12 +9,16 @@
|
|
|
9
9
|
* - /packages/core/src/ComplexSelector/ComplexSelector.test.tsx
|
|
10
10
|
* - /packages/core/src/ComplexSelector/index.ts
|
|
11
11
|
* - /apps/storybook/stories/ComplexSelector.stories.tsx
|
|
12
|
+
* - /packages/cli/assets/templates/blocks/components/ComplexSelector/ (showcase blocks)
|
|
12
13
|
*/
|
|
13
14
|
import React, { type ReactNode } from 'react';
|
|
14
15
|
import type { StyleXStyles } from '@stylexjs/stylex';
|
|
15
16
|
import type { BaseProps } from '../BaseProps';
|
|
16
17
|
import { type FieldStatusVariant } from '../Field';
|
|
18
|
+
import { type IconType } from '../Icon';
|
|
19
|
+
import type { LayerAlignment, LayerPlacement } from '../Layer/useLayer';
|
|
17
20
|
import type { SizeValue } from '../utils/types';
|
|
21
|
+
export type ComplexSelectorVariant = 'input' | 'ghost';
|
|
18
22
|
export type ComplexSelectorSize = 'sm' | 'md' | 'lg';
|
|
19
23
|
export interface ComplexSelectorRenderState {
|
|
20
24
|
/** Whether the selector surface is open. */
|
|
@@ -26,6 +30,24 @@ export interface ComplexSelectorRenderState {
|
|
|
26
30
|
/** ID of the popup content container. */
|
|
27
31
|
contentId: string;
|
|
28
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Imperative control surface for ComplexSelector, accessed via the `handleRef`
|
|
35
|
+
* prop. Methods drive the same popover machinery as the built-in trigger, so
|
|
36
|
+
* they respect focus restoration, light dismiss, and Escape. Prefer these
|
|
37
|
+
* callbacks over mirroring open state in the parent — the selector owns its
|
|
38
|
+
* visibility, and imperative calls avoid the focus-management pitfalls of
|
|
39
|
+
* syncing an external `isOpen` prop.
|
|
40
|
+
*/
|
|
41
|
+
export interface ComplexSelectorHandle {
|
|
42
|
+
/** Open the selector surface. No-op when disabled or already open. */
|
|
43
|
+
open(): void;
|
|
44
|
+
/** Close the selector surface. Restores focus to the trigger. */
|
|
45
|
+
close(): void;
|
|
46
|
+
/** Toggle the selector surface open or closed. */
|
|
47
|
+
toggle(): void;
|
|
48
|
+
/** Whether the selector surface is currently open. Reads live state. */
|
|
49
|
+
isOpen(): boolean;
|
|
50
|
+
}
|
|
29
51
|
export interface ComplexSelectorStatus {
|
|
30
52
|
type: 'warning' | 'error' | 'success';
|
|
31
53
|
message?: string;
|
|
@@ -65,10 +87,22 @@ export interface ComplexSelectorProps<Value> extends Omit<BaseProps<HTMLDivEleme
|
|
|
65
87
|
labelTooltip?: string;
|
|
66
88
|
/** Trigger and field size. */
|
|
67
89
|
size?: ComplexSelectorSize;
|
|
90
|
+
/** Visual trigger style. Ghost matches toolbar buttons. */
|
|
91
|
+
variant?: ComplexSelectorVariant;
|
|
92
|
+
/** Icon displayed at the start of the trigger. */
|
|
93
|
+
startIcon?: ReactNode | IconType;
|
|
68
94
|
/** Width of the field. */
|
|
69
95
|
width?: SizeValue;
|
|
70
96
|
/** Popup placement. */
|
|
71
|
-
placement?:
|
|
97
|
+
placement?: LayerPlacement;
|
|
98
|
+
/** Popup alignment along the placement axis. */
|
|
99
|
+
alignment?: LayerAlignment;
|
|
100
|
+
/**
|
|
101
|
+
* Imperative handle for programmatic open/close control. Exposes open,
|
|
102
|
+
* close, toggle, and the isOpen query. Use this instead of mirroring open
|
|
103
|
+
* state in the parent — the selector owns its visibility.
|
|
104
|
+
*/
|
|
105
|
+
handleRef?: React.Ref<ComplexSelectorHandle>;
|
|
72
106
|
/** StyleX styles for the popup content container. */
|
|
73
107
|
contentXstyle?: StyleXStyles;
|
|
74
108
|
/** Test ID for the trigger container. */
|
|
@@ -101,7 +135,7 @@ export interface ComplexSelectorProps<Value> extends Omit<BaseProps<HTMLDivEleme
|
|
|
101
135
|
* </ComplexSelector>
|
|
102
136
|
* ```
|
|
103
137
|
*/
|
|
104
|
-
export declare function ComplexSelector<Value>({ label, value, onChange, changeAction, children, triggerLabel, placeholder: placeholderFromProps, isLabelHidden, description, isOptional, isRequired, isDisabled, isLoading, status, statusVariant, labelTooltip, size, width, placement, contentXstyle, xstyle, className, style, 'data-testid': testId, onClick: onClickProp, ...props }: ComplexSelectorProps<Value>): React.JSX.Element;
|
|
138
|
+
export declare function ComplexSelector<Value>({ label, value, onChange, changeAction, children, triggerLabel, placeholder: placeholderFromProps, isLabelHidden, description, isOptional, isRequired, isDisabled, isLoading, status, statusVariant, labelTooltip, size, variant, startIcon, width, placement, alignment, handleRef, contentXstyle, xstyle, className, style, 'data-testid': testId, onClick: onClickProp, ...props }: ComplexSelectorProps<Value>): React.JSX.Element;
|
|
105
139
|
export declare namespace ComplexSelector {
|
|
106
140
|
var displayName: string;
|
|
107
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComplexSelector.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/ComplexSelector.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"ComplexSelector.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/ComplexSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAA4B,KAAK,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAI5D,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAgBtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAmI9C,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI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UAAkB,EAClB,SAAiB,EACjB,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,IAAW,EACX,OAAiB,EACjB,SAAS,EACT,KAAK,EACL,SAAmB,EACnB,SAAmB,EACnB,SAAS,EACT,aAAa,EACb,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,WAAW,EACpB,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,KAAK,CAAC,qBA+N7B;yBA9Pe,eAAe"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file ComplexSelector.tsx
|
|
7
|
-
* @input Uses React, StyleX, Field, usePopover
|
|
8
|
-
* @output Exports
|
|
7
|
+
* @input Uses React, StyleX, Field, Icon slots, Layer positioning, and usePopover
|
|
8
|
+
* @output Exports a rich-selector shell with exact token-sized input and ghost triggers, plus an imperative open/close handle
|
|
9
9
|
* @position Core implementation; consumed by index.ts
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update:
|
|
@@ -13,18 +13,19 @@
|
|
|
13
13
|
* - /packages/core/src/ComplexSelector/ComplexSelector.test.tsx
|
|
14
14
|
* - /packages/core/src/ComplexSelector/index.ts
|
|
15
15
|
* - /apps/storybook/stories/ComplexSelector.stories.tsx
|
|
16
|
+
* - /packages/cli/assets/templates/blocks/components/ComplexSelector/ (showcase blocks)
|
|
16
17
|
*/
|
|
17
|
-
import React, { useCallback, useId, useOptimistic, useTransition } from 'react';
|
|
18
|
+
import React, { useCallback, useId, useImperativeHandle, useOptimistic, useRef, useTransition } from 'react';
|
|
18
19
|
import * as stylex from '@stylexjs/stylex';
|
|
19
20
|
import { Field, inputWrapperStyles } from "../Field/index.js";
|
|
20
|
-
import { Icon } from "../Icon/index.js";
|
|
21
|
+
import { Icon, renderIconSlot } from "../Icon/index.js";
|
|
21
22
|
import { Spinner } from "../Spinner/index.js";
|
|
22
23
|
import { useTranslator } from "../i18n/index.js";
|
|
23
24
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
24
25
|
import { usePopover } from "../Popover/usePopover.js";
|
|
25
26
|
import "../theme/tokens.stylex.js";
|
|
26
|
-
import { colorVars, durationVars, easeVars, radiusVars, sizeVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
27
|
-
import { mergeProps } from "../utils/index.js";
|
|
27
|
+
import { colorVars, durationVars, easeVars, fontWeightVars, radiusVars, sizeVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
28
|
+
import { isRenderable, mergeProps } from "../utils/index.js";
|
|
28
29
|
import { composeEventHandlers } from "../utils/composeEventHandlers.js";
|
|
29
30
|
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
30
31
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -82,6 +83,22 @@ const styles = {
|
|
|
82
83
|
kMwMTN: "xv1l7n4",
|
|
83
84
|
$$css: true
|
|
84
85
|
},
|
|
86
|
+
triggerGhost: {
|
|
87
|
+
kzqmXN: "x14atkfc",
|
|
88
|
+
kMzoRj: "xc342km",
|
|
89
|
+
kWkggS: "xjbqb8w",
|
|
90
|
+
kKwaWg: "x1ilzqfv xq8i9tn",
|
|
91
|
+
kGVxlE: "x1gnnqk1 x1irk71m x15ysqaf",
|
|
92
|
+
k63SB2: "x1e4wzip",
|
|
93
|
+
k1ekBW: "xrafxwg",
|
|
94
|
+
k3aq6I: "x3oybdh xk4oym4",
|
|
95
|
+
$$css: true
|
|
96
|
+
},
|
|
97
|
+
triggerGhostDisabled: {
|
|
98
|
+
kKwaWg: "x18o3ruo",
|
|
99
|
+
k3aq6I: "x1c071of x1pdlv7q",
|
|
100
|
+
$$css: true
|
|
101
|
+
},
|
|
85
102
|
triggerIcon: {
|
|
86
103
|
kmuXW: "x2lah0s",
|
|
87
104
|
$$css: true
|
|
@@ -109,15 +126,15 @@ const styles = {
|
|
|
109
126
|
$$css: true
|
|
110
127
|
},
|
|
111
128
|
sm: {
|
|
112
|
-
|
|
129
|
+
kZKoxP: "x6k0iem",
|
|
113
130
|
$$css: true
|
|
114
131
|
},
|
|
115
132
|
md: {
|
|
116
|
-
|
|
133
|
+
kZKoxP: "x1ueg155",
|
|
117
134
|
$$css: true
|
|
118
135
|
},
|
|
119
136
|
lg: {
|
|
120
|
-
|
|
137
|
+
kZKoxP: "xssyfek",
|
|
121
138
|
$$css: true
|
|
122
139
|
},
|
|
123
140
|
disabled: {
|
|
@@ -125,6 +142,16 @@ const styles = {
|
|
|
125
142
|
$$css: true
|
|
126
143
|
}
|
|
127
144
|
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Imperative control surface for ComplexSelector, accessed via the `handleRef`
|
|
148
|
+
* prop. Methods drive the same popover machinery as the built-in trigger, so
|
|
149
|
+
* they respect focus restoration, light dismiss, and Escape. Prefer these
|
|
150
|
+
* callbacks over mirroring open state in the parent — the selector owns its
|
|
151
|
+
* visibility, and imperative calls avoid the focus-management pitfalls of
|
|
152
|
+
* syncing an external `isOpen` prop.
|
|
153
|
+
*/
|
|
154
|
+
|
|
128
155
|
/**
|
|
129
156
|
* A selector shell for rich, custom selection surfaces.
|
|
130
157
|
*
|
|
@@ -170,8 +197,12 @@ export function ComplexSelector({
|
|
|
170
197
|
statusVariant = 'attached',
|
|
171
198
|
labelTooltip,
|
|
172
199
|
size = 'md',
|
|
200
|
+
variant = 'input',
|
|
201
|
+
startIcon,
|
|
173
202
|
width,
|
|
174
203
|
placement = 'below',
|
|
204
|
+
alignment = 'start',
|
|
205
|
+
handleRef,
|
|
175
206
|
contentXstyle,
|
|
176
207
|
xstyle,
|
|
177
208
|
className,
|
|
@@ -182,28 +213,62 @@ export function ComplexSelector({
|
|
|
182
213
|
}) {
|
|
183
214
|
const t = useTranslator();
|
|
184
215
|
const placeholder = placeholderFromProps ?? t('@astryx.selector.placeholder');
|
|
216
|
+
const effectiveStatusVariant = variant === 'ghost' && statusVariant === 'attached' ? 'detached' : statusVariant;
|
|
185
217
|
const triggerId = useId();
|
|
186
218
|
const labelId = useId();
|
|
187
219
|
const contentId = useId();
|
|
188
220
|
const descriptionId = useId();
|
|
189
221
|
const statusMessageId = useId();
|
|
190
222
|
const ariaDescribedBy = [description ? descriptionId : null, status?.message ? statusMessageId : null].filter(id => id != null).join(' ') || undefined;
|
|
223
|
+
const triggerRef = useRef(null);
|
|
224
|
+
const lastHideTimeRef = useRef(0);
|
|
191
225
|
const [isPending, startTransition] = useTransition();
|
|
192
226
|
const [optimisticValue, setOptimisticValue] = useOptimistic(value);
|
|
193
227
|
const isBusy = isLoading || isPending;
|
|
228
|
+
const handlePopoverHide = useCallback(() => {
|
|
229
|
+
lastHideTimeRef.current = Date.now();
|
|
230
|
+
triggerRef.current?.focus();
|
|
231
|
+
}, []);
|
|
194
232
|
const popover = usePopover({
|
|
195
233
|
dialogLabel: label,
|
|
196
234
|
hasCloseButton: false,
|
|
197
235
|
hasAutoFocus: true,
|
|
198
|
-
// The popup's theme target belongs on the SURFACE — the element painting
|
|
199
|
-
// background, radius and elevation — which `usePopover` owns. Rendered on
|
|
200
|
-
// the content box below it, a theme's background or radius rule paints the
|
|
201
|
-
// wrong box.
|
|
202
236
|
surfaceTarget: 'complex-selector-popup',
|
|
203
|
-
onHide:
|
|
204
|
-
document.getElementById(triggerId)?.focus();
|
|
205
|
-
}
|
|
237
|
+
onHide: handlePopoverHide
|
|
206
238
|
});
|
|
239
|
+
const isOpen = popover.isOpen;
|
|
240
|
+
const handleTriggerClick = useCallback(() => {
|
|
241
|
+
if (isDisabled || Date.now() - lastHideTimeRef.current < 50) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (popover.isOpen) {
|
|
245
|
+
popover.hide();
|
|
246
|
+
} else {
|
|
247
|
+
popover.show();
|
|
248
|
+
}
|
|
249
|
+
}, [isDisabled, popover]);
|
|
250
|
+
const close = useCallback(() => {
|
|
251
|
+
popover.hide();
|
|
252
|
+
}, [popover]);
|
|
253
|
+
useImperativeHandle(handleRef, () => ({
|
|
254
|
+
open: () => {
|
|
255
|
+
if (!isDisabled) {
|
|
256
|
+
popover.show();
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
close: () => popover.hide(),
|
|
260
|
+
toggle: () => {
|
|
261
|
+
if (isDisabled) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (popover.isOpen) {
|
|
265
|
+
popover.hide();
|
|
266
|
+
} else {
|
|
267
|
+
popover.show();
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
isOpen: () => popover.isOpen
|
|
271
|
+
}), [isDisabled, popover]);
|
|
207
272
|
const commitValue = useCallback(nextValue => {
|
|
208
273
|
onChange?.(nextValue);
|
|
209
274
|
if (changeAction) {
|
|
@@ -214,11 +279,15 @@ export function ComplexSelector({
|
|
|
214
279
|
}
|
|
215
280
|
}, [changeAction, onChange, setOptimisticValue, startTransition]);
|
|
216
281
|
const triggerContent = triggerLabel ?? placeholder;
|
|
282
|
+
const startIconSlot = renderIconSlot(startIcon, {
|
|
283
|
+
size: 'sm',
|
|
284
|
+
color: 'secondary'
|
|
285
|
+
});
|
|
217
286
|
const content = /*#__PURE__*/_jsx("div", {
|
|
218
287
|
id: contentId,
|
|
219
288
|
...stylex.props(styles.content, contentXstyle),
|
|
220
|
-
children: children(optimisticValue, commitValue,
|
|
221
|
-
isOpen
|
|
289
|
+
children: children(optimisticValue, commitValue, close, {
|
|
290
|
+
isOpen,
|
|
222
291
|
isBusy,
|
|
223
292
|
triggerId,
|
|
224
293
|
contentId
|
|
@@ -229,12 +298,9 @@ export function ComplexSelector({
|
|
|
229
298
|
ref: popover.triggerRef,
|
|
230
299
|
"data-testid": testId,
|
|
231
300
|
...props,
|
|
232
|
-
onClick: composeEventHandlers(onClickProp,
|
|
233
|
-
if (!isDisabled) {
|
|
234
|
-
popover.toggle();
|
|
235
|
-
}
|
|
236
|
-
}),
|
|
301
|
+
onClick: composeEventHandlers(onClickProp, handleTriggerClick),
|
|
237
302
|
...mergeProps(themeProps('complex-selector', {
|
|
303
|
+
variant,
|
|
238
304
|
size,
|
|
239
305
|
status: status?.type ?? null
|
|
240
306
|
}), stylex.props(inputWrapperStyles.base, styles.triggerContainer, styles[size],
|
|
@@ -242,12 +308,13 @@ export function ComplexSelector({
|
|
|
242
308
|
// inside it), but it must still be a KEYBOARD ring: `:focus-within`
|
|
243
309
|
// matched a mouse click on the trigger and drew the outline for
|
|
244
310
|
// pointer users too. `focusWithin` here is `:has(:focus-visible)`.
|
|
245
|
-
focusOutlineStyles.focusWithin, isDisabled && inputWrapperStyles.disabled, isDisabled && styles.disabled, triggerLabel == null && styles.placeholder, xstyle), className, style),
|
|
246
|
-
children: [/*#__PURE__*/_jsx("button", {
|
|
311
|
+
focusOutlineStyles.focusWithin, variant === 'ghost' && styles.triggerGhost, isDisabled && inputWrapperStyles.disabled, variant === 'ghost' && isDisabled && styles.triggerGhostDisabled, isDisabled && styles.disabled, triggerLabel == null && styles.placeholder, xstyle), className, style),
|
|
312
|
+
children: [isRenderable(startIconSlot) && startIconSlot, /*#__PURE__*/_jsx("button", {
|
|
313
|
+
ref: triggerRef,
|
|
247
314
|
id: triggerId,
|
|
248
315
|
type: "button",
|
|
249
316
|
"aria-haspopup": "dialog",
|
|
250
|
-
"aria-expanded":
|
|
317
|
+
"aria-expanded": isOpen,
|
|
251
318
|
"aria-controls": contentId,
|
|
252
319
|
"aria-describedby": ariaDescribedBy,
|
|
253
320
|
"aria-labelledby": labelId,
|
|
@@ -256,7 +323,7 @@ export function ComplexSelector({
|
|
|
256
323
|
"aria-busy": isBusy || undefined,
|
|
257
324
|
disabled: isDisabled,
|
|
258
325
|
onKeyDown: event => {
|
|
259
|
-
if (event.key === 'ArrowDown' && !
|
|
326
|
+
if (event.key === 'ArrowDown' && !isOpen && !isDisabled) {
|
|
260
327
|
event.preventDefault();
|
|
261
328
|
popover.show();
|
|
262
329
|
}
|
|
@@ -281,14 +348,14 @@ export function ComplexSelector({
|
|
|
281
348
|
// IS the trigger's icon element — one node carrying the box, the
|
|
282
349
|
// color, the rotation, and the theme target.
|
|
283
350
|
,
|
|
284
|
-
xstyle: [styles.triggerIcon, styles.triggerIconRotation,
|
|
351
|
+
xstyle: [styles.triggerIcon, styles.triggerIconRotation, isOpen && styles.triggerIconOpen],
|
|
285
352
|
...themeProps('complex-selector-indicator-icon', {
|
|
286
|
-
state:
|
|
353
|
+
state: isOpen ? 'expanded' : 'collapsed'
|
|
287
354
|
})
|
|
288
355
|
})]
|
|
289
356
|
}), popover.render(content, {
|
|
290
357
|
placement,
|
|
291
|
-
alignment
|
|
358
|
+
alignment,
|
|
292
359
|
offset: spacingVars['--spacing-1'],
|
|
293
360
|
xstyle: [styles.popover, layerAnimations[placement]]
|
|
294
361
|
})]
|
|
@@ -308,7 +375,7 @@ export function ComplexSelector({
|
|
|
308
375
|
message: status.message,
|
|
309
376
|
messageID: status.message ? statusMessageId : undefined
|
|
310
377
|
} : undefined,
|
|
311
|
-
statusVariant:
|
|
378
|
+
statusVariant: effectiveStatusVariant,
|
|
312
379
|
labelTooltip: labelTooltip,
|
|
313
380
|
width: width,
|
|
314
381
|
children: selectorContent
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file index.ts
|
|
3
|
-
* @output Exports ComplexSelector and types
|
|
3
|
+
* @output Exports ComplexSelector and its trigger-size contract types
|
|
4
4
|
* @position Public API entry point
|
|
5
5
|
*/
|
|
6
|
-
export { ComplexSelector, type ComplexSelectorProps, type ComplexSelectorRenderState, type ComplexSelectorSize, type ComplexSelectorStatus, } from './ComplexSelector';
|
|
6
|
+
export { ComplexSelector, type ComplexSelectorHandle, type ComplexSelectorProps, type ComplexSelectorRenderState, type ComplexSelectorSize, type ComplexSelectorStatus, type ComplexSelectorVariant, } from './ComplexSelector';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AA0BrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAqDtC,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAErD,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAMnD,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,oDAAoD;IACpD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;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,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,+CAA+C;IAC/C,WAAW,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,wBAAwB,CAAC;AAM/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,IAAW,EACX,KAAK,EAAE,cAAc,EACrB,UAAkB,EAClB,YAAY,EACZ,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,aAAa,EACb,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,gBAAgB,qBA0SlB;yBAxTe,WAAW"}
|
|
@@ -41,7 +41,7 @@ import { useLongPress } from "../hooks/useLongPress.js";
|
|
|
41
41
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
42
42
|
import "../theme/tokens.stylex.js";
|
|
43
43
|
import { colorVars, spacingVars, radiusVars, durationVars, easeVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
44
|
-
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
44
|
+
import { mergeProps, mergeRefs, isImeKeyEvent } from "../utils/index.js";
|
|
45
45
|
import { themeProps } from "../utils/themeProps.js";
|
|
46
46
|
import { useTranslator } from "../i18n/index.js";
|
|
47
47
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -236,7 +236,9 @@ export function ContextMenu({
|
|
|
236
236
|
if (e.key !== 'Escape') {
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
|
-
if (e
|
|
239
|
+
if (isImeKeyEvent(e)) {
|
|
240
|
+
// Ignore Escape that is committing/cancelling an IME composition;
|
|
241
|
+
// see utils/ime.ts for why.
|
|
240
242
|
return;
|
|
241
243
|
}
|
|
242
244
|
e.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src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S,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC,CAAC;CAC/D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,QAAgB,EAChB,cAAkB,EAClB,YAAY,EACZ,MAAoB,EACpB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+BAqahB;yBAnce,SAAS"}
|
|
@@ -31,7 +31,7 @@ import { useCalendarConstraints } from "../Calendar/hooks/index.js";
|
|
|
31
31
|
import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
32
32
|
import { usePopover } from "../Popover/index.js";
|
|
33
33
|
import { useTooltip } from "../Tooltip/index.js";
|
|
34
|
-
import { getInputARIA, parseDateInput } from "../utils/index.js";
|
|
34
|
+
import { getInputARIA, isImeKeyEvent, parseDateInput } from "../utils/index.js";
|
|
35
35
|
import { plainDateFromISO, plainDateToISO, formatSharedDate } from "../utils/plainDate.js";
|
|
36
36
|
const styles = {
|
|
37
37
|
iconButton: {
|
|
@@ -335,6 +335,14 @@ export function DateInput({
|
|
|
335
335
|
|
|
336
336
|
// Handle keyboard events on input
|
|
337
337
|
const handleInputKeyDown = useCallback(e => {
|
|
338
|
+
// An in-progress IME composition uses Enter to commit the candidate and
|
|
339
|
+
// Escape to cancel it; that composing keydown fires before
|
|
340
|
+
// compositionend, so without this guard a Korean/Japanese/Chinese user
|
|
341
|
+
// committing a syllable with Enter would instead commit the pending date
|
|
342
|
+
// (or Escape would close the calendar mid-composition). See utils/ime.ts.
|
|
343
|
+
if (isImeKeyEvent(e.nativeEvent)) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
338
346
|
if (e.key === 'Escape' && popover.isOpen) {
|
|
339
347
|
e.preventDefault();
|
|
340
348
|
popover.hide();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/DateTimeInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/DateTimeInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AA2BrB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAO9C,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG;IACvC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,KAAK,CAAC;AAEpD,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G,EACH,GAAG,IAAI,EACR,EAAE,kBAAkB,+BAorBpB;yBArtBe,aAAa"}
|
|
@@ -29,7 +29,7 @@ import { usePopover } from "../Popover/index.js";
|
|
|
29
29
|
import { useTooltip } from "../Tooltip/index.js";
|
|
30
30
|
import { useInputContainer } from "../hooks/useInputContainer.js";
|
|
31
31
|
import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
32
|
-
import { parseDateInput, parseTimeInput, formatDisplayTime12h, formatDisplayTime24h, formatISOTime, isTimeInRange, adjustTime, mergeProps, mergeRefs, isFocusDetached } from "../utils/index.js";
|
|
32
|
+
import { parseDateInput, parseTimeInput, formatDisplayTime12h, formatDisplayTime24h, formatISOTime, isTimeInRange, adjustTime, isImeKeyEvent, mergeProps, mergeRefs, isFocusDetached } from "../utils/index.js";
|
|
33
33
|
import { plainDateFromISO, plainDateToISO, plainDateFormat, DATE_FORMAT_LONG } from "../utils/plainDate.js";
|
|
34
34
|
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
35
35
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
@@ -403,6 +403,13 @@ export function DateTimeInput({
|
|
|
403
403
|
commitDatePendingInput();
|
|
404
404
|
}, [commitDatePendingInput]);
|
|
405
405
|
const handleDateKeyDown = useCallback(e => {
|
|
406
|
+
// Guard the composing keydown (fires before compositionend): an IME uses
|
|
407
|
+
// Enter to commit the candidate and Escape to cancel it, so without this
|
|
408
|
+
// a CJK user committing a syllable with Enter would commit the pending
|
|
409
|
+
// date instead. See utils/ime.ts.
|
|
410
|
+
if (isImeKeyEvent(e.nativeEvent)) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
406
413
|
if (e.key === 'Escape' && popover.isOpen) {
|
|
407
414
|
e.preventDefault();
|
|
408
415
|
popover.hide();
|
|
@@ -471,6 +478,13 @@ export function DateTimeInput({
|
|
|
471
478
|
setTimePendingInput(null);
|
|
472
479
|
}, [timePendingInput, hasSeconds, timeMin, timeMax, valueParts, fireChange]);
|
|
473
480
|
const handleTimeKeyDown = useCallback(e => {
|
|
481
|
+
// ArrowUp/ArrowDown step the time and preventDefault; an IME candidate
|
|
482
|
+
// window uses those same arrows to navigate candidates, so guard the
|
|
483
|
+
// composing keydown (fires before compositionend) to avoid stealing them
|
|
484
|
+
// mid-composition. See utils/ime.ts.
|
|
485
|
+
if (isImeKeyEvent(e.nativeEvent)) {
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
474
488
|
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
475
489
|
e.preventDefault();
|
|
476
490
|
let currentTime = valueParts.time;
|
|
@@ -552,6 +566,16 @@ export function DateTimeInput({
|
|
|
552
566
|
icon: "calendar",
|
|
553
567
|
size: "sm",
|
|
554
568
|
color: "secondary"
|
|
569
|
+
// Stable theme target on the calendar toggle glyph, so a theme
|
|
570
|
+
// can restyle just this icon (color, size, hover) — and each
|
|
571
|
+
// open/closed state — via `defineTheme`, mirroring
|
|
572
|
+
// `date-input-toggle-icon`. Same-element rules in
|
|
573
|
+
// @layer astryx-theme win over the icon's own base color/size,
|
|
574
|
+
// which a segment-level target could not reach.
|
|
575
|
+
,
|
|
576
|
+
...themeProps('date-time-input-toggle-icon', {
|
|
577
|
+
state: popover.isOpen ? 'expanded' : 'collapsed'
|
|
578
|
+
})
|
|
555
579
|
})
|
|
556
580
|
}), /*#__PURE__*/_jsx("input", {
|
|
557
581
|
ref: mergeRefs(ref, dateInputRef),
|
|
@@ -624,6 +648,12 @@ export function DateTimeInput({
|
|
|
624
648
|
icon: "clock",
|
|
625
649
|
size: "sm",
|
|
626
650
|
color: "secondary"
|
|
651
|
+
// Stable theme target on the leading clock glyph, so a theme can
|
|
652
|
+
// restyle just this icon (color, size) via `defineTheme`. The
|
|
653
|
+
// time segment has no toggle button — the clock is a static
|
|
654
|
+
// leading affordance — so this carries no interactive state.
|
|
655
|
+
,
|
|
656
|
+
...themeProps('date-time-input-clock-icon')
|
|
627
657
|
})
|
|
628
658
|
}), /*#__PURE__*/_jsx("input", {
|
|
629
659
|
ref: timeInputRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqB5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAKhD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAsB9C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzD,4EAA4E;AAC5E,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAuHD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,cAAc;;;;;EAUpE;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE3C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,QAAgB,EAChB,YAAY,EACZ,KAAW,EACX,SAAkB,EAClB,QAAQ,EACR,OAAoB,EACpB,OAAgB,EAChB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,sCA2Sb;yBA3Te,MAAM"}
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
import { useCallback, useEffect, useId, useMemo, useRef } from 'react';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import { useScrollLock } from "../hooks/useScrollLock.js";
|
|
21
|
-
import { hasActiveFocusTrapEscape
|
|
21
|
+
import { hasActiveFocusTrapEscape } from "../hooks/useFocusTrap.js";
|
|
22
|
+
import { isImeKeyEvent } from "../utils/ime.js";
|
|
22
23
|
import "../theme/tokens.stylex.js";
|
|
23
24
|
import { colorVars, radiusVars, durationVars, easeVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
24
25
|
import { container } from "../Layout/container.stylex.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.d.ts","sourceRoot":"","sources":["../../src/Lightbox/Lightbox.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAK5C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACjE,+CAA+C;IAC/C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,KAAK,EAAE,aAAa,GAAG,aAAa,EAAE,CAAC;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;OAI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,aAAa,EAAE,CAAC;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAwJD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,YAAY,EACZ,KAAK,EACL,KAAK,EAAE,eAAe,EACtB,YAAgB,EAChB,aAAa,EACb,OAAe,EACf,WAAmB,EACnB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,GAAG,KAAK,EACT,EAAE,aAAa,sCA6Yf;yBA7Ze,QAAQ"}
|
|
@@ -269,9 +269,15 @@ export function Lightbox({
|
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
const item = mediaArray[Math.min(index, mediaArray.length - 1)];
|
|
272
|
-
const position =
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
const position = {
|
|
273
|
+
index: index + 1,
|
|
274
|
+
total: mediaArray.length
|
|
275
|
+
};
|
|
276
|
+
announce(item?.alt ? t('@astryx.lightbox.mediaPosition', {
|
|
277
|
+
alt: item.alt,
|
|
278
|
+
...position
|
|
279
|
+
}) : t('@astryx.lightbox.imagePosition', position));
|
|
280
|
+
}, [index, isOpen, announce, mediaArray, t]);
|
|
275
281
|
|
|
276
282
|
// Open/close dialog
|
|
277
283
|
useIsomorphicLayoutEffect(() => {
|