@astryxdesign/core 0.1.9-canary.faa200a → 0.1.9-canary.fef7dca
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/Calendar/Calendar.js +5 -5
- package/dist/Calendar/dayCellUtils.d.ts +4 -4
- package/dist/Calendar/dayCellUtils.js +2 -2
- package/dist/Calendar/styles.d.ts +30 -31
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +30 -31
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +22 -12
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +3 -1
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +10 -3
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +9 -0
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +4 -1
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +4 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +4 -1
- package/dist/DropdownMenu/menuItemHover.d.ts +23 -0
- package/dist/DropdownMenu/menuItemHover.d.ts.map +1 -0
- package/dist/DropdownMenu/menuItemHover.js +33 -0
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +10 -4
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +15 -9
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +48 -39
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +41 -15
- package/dist/Switch/Switch.d.ts +8 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +160 -91
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +15 -11
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +36 -26
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +29 -23
- package/dist/astryx.css +12 -7
- package/dist/astryx.umd.js +50 -50
- package/dist/astryx.umd.js.map +4 -4
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/rtlStyles.d.ts +24 -0
- package/dist/utils/rtlStyles.d.ts.map +1 -0
- package/dist/utils/rtlStyles.js +27 -0
- package/locales/en.json +16 -0
- package/locales/pseudo.json +12 -0
- package/package.json +6 -1
- package/src/Avatar/Avatar.doc.mjs +2 -1
- package/src/Avatar/AvatarStatusDot.doc.mjs +3 -3
- package/src/Calendar/Calendar.test.tsx +17 -16
- package/src/Calendar/Calendar.tsx +13 -13
- package/src/Calendar/dayCellUtils.test.ts +18 -18
- package/src/Calendar/dayCellUtils.ts +2 -2
- package/src/Calendar/styles.ts +33 -39
- package/src/Carousel/Carousel.tsx +25 -6
- package/src/Chat/ChatComposer.doc.mjs +2 -2
- package/src/Chat/ChatComposerInput.doc.mjs +1 -1
- package/src/Chat/ChatDictationButton.tsx +7 -1
- package/src/Chat/ChatToolCalls.tsx +9 -2
- package/src/DropdownMenu/DropdownMenu.test.tsx +60 -0
- package/src/DropdownMenu/DropdownMenu.tsx +9 -0
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +8 -2
- package/src/DropdownMenu/DropdownMenuItem.tsx +8 -2
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +8 -2
- package/src/DropdownMenu/menuItemHover.ts +39 -0
- package/src/HoverCard/useHoverCard.tsx +15 -3
- package/src/Lightbox/Lightbox.tsx +11 -3
- package/src/MultiSelector/MultiSelector.test.tsx +66 -0
- package/src/MultiSelector/MultiSelector.tsx +62 -47
- package/src/Selector/Selector.test.tsx +119 -0
- package/src/Selector/Selector.tsx +45 -16
- package/src/Switch/Switch.doc.mjs +10 -4
- package/src/Switch/Switch.test.tsx +22 -0
- package/src/Switch/Switch.tsx +90 -33
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +9 -6
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +24 -17
- package/src/Table/plugins/tree/useTableTreeData.tsx +17 -13
- package/src/Table/useTableRowStatus.doc.mjs +1 -1
- package/src/Thumbnail/Thumbnail.doc.mjs +1 -1
- package/src/TopNav/TopNavMegaMenuFeaturedCard.doc.mjs +1 -1
- package/src/utils/index.ts +2 -0
- package/src/utils/rtlStyles.ts +27 -0
|
@@ -24,7 +24,7 @@ import { useAnnounce, useGridFocus } from "../hooks/index.js";
|
|
|
24
24
|
import { useCalendarDays, useCalendarConstraints } from "./hooks/index.js";
|
|
25
25
|
import { calendarStyles, monthGridStyles, dayCellStyles, dayCellTheme } from "./styles.js";
|
|
26
26
|
import { plainDateFromISO, plainDateToISO, plainDateToDate, plainDateToday, plainDateSetFirstOfMonth, plainDateAddMonths, plainDateAddDays, plainDateIsBefore, plainDateIsEqual, plainDateGetWeekNumber, plainDateFormat, DATE_FORMAT_WITH_WEEKDAY, DATE_FORMAT_MONTH_YEAR } from "../utils/plainDate.js";
|
|
27
|
-
import { mergeProps, composeEventHandlers } from "../utils/index.js";
|
|
27
|
+
import { mergeProps, composeEventHandlers, rtlStyles } from "../utils/index.js";
|
|
28
28
|
import { computeDayCellState, computeRangeRounding, computePreviewRounding, computeDayNeighborContinuity, isEndpoint } from "./dayCellUtils.js";
|
|
29
29
|
|
|
30
30
|
// =============================================================================
|
|
@@ -283,7 +283,7 @@ export function Calendar({
|
|
|
283
283
|
// caller classNames, so the RTL mirror must live on its own
|
|
284
284
|
// element.
|
|
285
285
|
_jsx("span", {
|
|
286
|
-
...stylex.props(calendarStyles.navIcon),
|
|
286
|
+
...stylex.props(calendarStyles.navIcon, rtlStyles.mirror),
|
|
287
287
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
288
288
|
icon: "chevronLeft",
|
|
289
289
|
size: "sm",
|
|
@@ -304,7 +304,7 @@ export function Calendar({
|
|
|
304
304
|
label: t('@astryx.calendar.nextMonth'),
|
|
305
305
|
variant: "ghost",
|
|
306
306
|
icon: /*#__PURE__*/_jsx("span", {
|
|
307
|
-
...stylex.props(calendarStyles.navIcon),
|
|
307
|
+
...stylex.props(calendarStyles.navIcon, rtlStyles.mirror),
|
|
308
308
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
309
309
|
icon: "chevronRight",
|
|
310
310
|
size: "sm",
|
|
@@ -692,9 +692,9 @@ function DayCell({
|
|
|
692
692
|
"aria-selected": state.isSelected || state.isInRange || undefined,
|
|
693
693
|
...stylex.props(dayCellStyles.cell),
|
|
694
694
|
children: [state.isInRange && /*#__PURE__*/_jsx("div", {
|
|
695
|
-
...stylex.props(dayCellStyles.rangeBg, dayCellTheme.rangeBg, rangeRounding.
|
|
695
|
+
...stylex.props(dayCellStyles.rangeBg, dayCellTheme.rangeBg, rangeRounding.roundStart && dayCellStyles.rangeBgRadiusStart, rangeRounding.roundEnd && dayCellStyles.rangeBgRadiusEnd, state.isRangeStart && dayCellStyles.rangeInsetStart, state.isRangeStart && rangeRounding.roundEnd && dayCellStyles.rangeInsetEnd, state.isRangeEnd && dayCellStyles.rangeInsetEnd, state.isRangeStart && rangeRounding.roundStart && dayCellStyles.rangeInsetStart)
|
|
696
696
|
}), state.isInPreview && /*#__PURE__*/_jsx("div", {
|
|
697
|
-
...stylex.props(dayCellStyles.previewBg, dayCellTheme.previewBg, previewRounding.
|
|
697
|
+
...stylex.props(dayCellStyles.previewBg, dayCellTheme.previewBg, previewRounding.roundStart && dayCellStyles.previewBgRadiusStart, previewRounding.roundEnd && dayCellStyles.previewBgRadiusEnd, state.isPreviewStart && dayCellStyles.previewStart, state.isPreviewEnd && dayCellStyles.previewEnd)
|
|
698
698
|
}), /*#__PURE__*/_jsx("button", {
|
|
699
699
|
type: "button",
|
|
700
700
|
"data-date": day.iso,
|
|
@@ -39,16 +39,16 @@ export declare function computeRangeRounding(state: DayCellState, neighbors?: {
|
|
|
39
39
|
prevInRange?: boolean;
|
|
40
40
|
nextInRange?: boolean;
|
|
41
41
|
}): {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
roundStart: boolean;
|
|
43
|
+
roundEnd: boolean;
|
|
44
44
|
};
|
|
45
45
|
/** Rounding for the hover-preview background. */
|
|
46
46
|
export declare function computePreviewRounding(state: DayCellState, neighbors?: {
|
|
47
47
|
prevInPreview?: boolean;
|
|
48
48
|
nextInPreview?: boolean;
|
|
49
49
|
}): {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
roundStart: boolean;
|
|
51
|
+
roundEnd: boolean;
|
|
52
52
|
};
|
|
53
53
|
/** Whether a day is a selection endpoint (selected, range start, or range end). */
|
|
54
54
|
export declare function isEndpoint(state: DayCellState): boolean;
|
|
@@ -49,8 +49,8 @@ function computeHighlightRounding(input) {
|
|
|
49
49
|
const prevBreaks = input.prevContinues !== undefined ? !input.prevContinues : false;
|
|
50
50
|
const nextBreaks = input.nextContinues !== undefined ? !input.nextContinues : false;
|
|
51
51
|
return {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
roundStart: input.isStart || input.isFirstColumn || prevBreaks,
|
|
53
|
+
roundEnd: input.isEnd || input.isLastColumn || nextBreaks
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -48,7 +48,6 @@ export declare const calendarStyles: Readonly<{
|
|
|
48
48
|
}>;
|
|
49
49
|
readonly navIcon: Readonly<{
|
|
50
50
|
readonly display: stylex.StyleXClassNameFor<"display", "inline-flex">;
|
|
51
|
-
readonly transform: stylex.StyleXClassNameFor<"transform", "scaleX(-1)" | null>;
|
|
52
51
|
}>;
|
|
53
52
|
}>;
|
|
54
53
|
export declare const monthGridStyles: Readonly<{
|
|
@@ -103,51 +102,51 @@ export declare const dayCellStyles: Readonly<{
|
|
|
103
102
|
readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
|
|
104
103
|
readonly top: stylex.StyleXClassNameFor<"top", "2px">;
|
|
105
104
|
readonly bottom: stylex.StyleXClassNameFor<"bottom", "2px">;
|
|
106
|
-
readonly
|
|
107
|
-
readonly
|
|
105
|
+
readonly insetInlineStart: stylex.StyleXClassNameFor<"insetInlineStart", 0>;
|
|
106
|
+
readonly insetInlineEnd: stylex.StyleXClassNameFor<"insetInlineEnd", 0>;
|
|
108
107
|
}>;
|
|
109
|
-
readonly
|
|
110
|
-
readonly
|
|
111
|
-
readonly
|
|
112
|
-
readonly
|
|
108
|
+
readonly rangeBgRadiusStart: Readonly<{
|
|
109
|
+
readonly insetInlineStart: stylex.StyleXClassNameFor<"insetInlineStart", "2px">;
|
|
110
|
+
readonly borderStartStartRadius: stylex.StyleXClassNameFor<"borderStartStartRadius", "9999px">;
|
|
111
|
+
readonly borderEndStartRadius: stylex.StyleXClassNameFor<"borderEndStartRadius", "9999px">;
|
|
113
112
|
}>;
|
|
114
|
-
readonly
|
|
115
|
-
readonly
|
|
116
|
-
readonly
|
|
117
|
-
readonly
|
|
113
|
+
readonly rangeBgRadiusEnd: Readonly<{
|
|
114
|
+
readonly insetInlineEnd: stylex.StyleXClassNameFor<"insetInlineEnd", "2px">;
|
|
115
|
+
readonly borderStartEndRadius: stylex.StyleXClassNameFor<"borderStartEndRadius", "9999px">;
|
|
116
|
+
readonly borderEndEndRadius: stylex.StyleXClassNameFor<"borderEndEndRadius", "9999px">;
|
|
118
117
|
}>;
|
|
119
|
-
readonly
|
|
120
|
-
readonly
|
|
118
|
+
readonly rangeInsetStart: Readonly<{
|
|
119
|
+
readonly insetInlineStart: stylex.StyleXClassNameFor<"insetInlineStart", "2px">;
|
|
121
120
|
}>;
|
|
122
|
-
readonly
|
|
123
|
-
readonly
|
|
121
|
+
readonly rangeInsetEnd: Readonly<{
|
|
122
|
+
readonly insetInlineEnd: stylex.StyleXClassNameFor<"insetInlineEnd", "2px">;
|
|
124
123
|
}>;
|
|
125
124
|
readonly previewBg: Readonly<{
|
|
126
125
|
readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
|
|
127
126
|
readonly top: stylex.StyleXClassNameFor<"top", "2px">;
|
|
128
127
|
readonly bottom: stylex.StyleXClassNameFor<"bottom", "2px">;
|
|
129
|
-
readonly
|
|
130
|
-
readonly
|
|
128
|
+
readonly insetInlineStart: stylex.StyleXClassNameFor<"insetInlineStart", 0>;
|
|
129
|
+
readonly insetInlineEnd: stylex.StyleXClassNameFor<"insetInlineEnd", 0>;
|
|
131
130
|
}>;
|
|
132
|
-
readonly
|
|
133
|
-
readonly
|
|
134
|
-
readonly
|
|
135
|
-
readonly
|
|
131
|
+
readonly previewBgRadiusStart: Readonly<{
|
|
132
|
+
readonly insetInlineStart: stylex.StyleXClassNameFor<"insetInlineStart", "2px">;
|
|
133
|
+
readonly borderStartStartRadius: stylex.StyleXClassNameFor<"borderStartStartRadius", "9999px">;
|
|
134
|
+
readonly borderEndStartRadius: stylex.StyleXClassNameFor<"borderEndStartRadius", "9999px">;
|
|
136
135
|
}>;
|
|
137
|
-
readonly
|
|
138
|
-
readonly
|
|
139
|
-
readonly
|
|
140
|
-
readonly
|
|
136
|
+
readonly previewBgRadiusEnd: Readonly<{
|
|
137
|
+
readonly insetInlineEnd: stylex.StyleXClassNameFor<"insetInlineEnd", "2px">;
|
|
138
|
+
readonly borderStartEndRadius: stylex.StyleXClassNameFor<"borderStartEndRadius", "9999px">;
|
|
139
|
+
readonly borderEndEndRadius: stylex.StyleXClassNameFor<"borderEndEndRadius", "9999px">;
|
|
141
140
|
}>;
|
|
142
141
|
readonly previewStart: Readonly<{
|
|
143
|
-
readonly
|
|
144
|
-
readonly
|
|
145
|
-
readonly
|
|
142
|
+
readonly insetInlineStart: stylex.StyleXClassNameFor<"insetInlineStart", "2px">;
|
|
143
|
+
readonly borderStartStartRadius: stylex.StyleXClassNameFor<"borderStartStartRadius", "9999px">;
|
|
144
|
+
readonly borderEndStartRadius: stylex.StyleXClassNameFor<"borderEndStartRadius", "9999px">;
|
|
146
145
|
}>;
|
|
147
146
|
readonly previewEnd: Readonly<{
|
|
148
|
-
readonly
|
|
149
|
-
readonly
|
|
150
|
-
readonly
|
|
147
|
+
readonly insetInlineEnd: stylex.StyleXClassNameFor<"insetInlineEnd", "2px">;
|
|
148
|
+
readonly borderStartEndRadius: stylex.StyleXClassNameFor<"borderStartEndRadius", "9999px">;
|
|
149
|
+
readonly borderEndEndRadius: stylex.StyleXClassNameFor<"borderEndEndRadius", "9999px">;
|
|
151
150
|
}>;
|
|
152
151
|
readonly day: Readonly<{
|
|
153
152
|
readonly width: stylex.StyleXClassNameFor<"width", "28px">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Calendar/styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAgB3C,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Calendar/styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAgB3C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CzB,CAAC;AAMH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuC1B,CAAC;AAMH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4GxB,CAAC;AAMH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoEvB,CAAC"}
|
package/dist/Calendar/styles.js
CHANGED
|
@@ -63,7 +63,6 @@ export const calendarStyles = {
|
|
|
63
63
|
},
|
|
64
64
|
navIcon: {
|
|
65
65
|
k1xSpc: "x3nfvp2",
|
|
66
|
-
k3aq6I: "xgtlewx",
|
|
67
66
|
$$css: true
|
|
68
67
|
}
|
|
69
68
|
};
|
|
@@ -137,60 +136,60 @@ export const dayCellStyles = {
|
|
|
137
136
|
kVAEAm: "x10l6tqk",
|
|
138
137
|
k87sOh: "xs7f9wi",
|
|
139
138
|
krVfgx: "x1c7jfne",
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
kLqNvP: "x1o0tod",
|
|
140
|
+
kt4wiu: "xtijo5x",
|
|
142
141
|
$$css: true
|
|
143
142
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
rangeBgRadiusStart: {
|
|
144
|
+
kLqNvP: "xaoy8p5",
|
|
145
|
+
krdFHd: "x19415el",
|
|
146
|
+
kVL7Gh: "x1wc3881",
|
|
148
147
|
$$css: true
|
|
149
148
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
rangeBgRadiusEnd: {
|
|
150
|
+
kt4wiu: "xz03a8w",
|
|
151
|
+
kfmiAY: "x8agd5o",
|
|
152
|
+
kT0f0o: "x1dgc8on",
|
|
154
153
|
$$css: true
|
|
155
154
|
},
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
rangeInsetStart: {
|
|
156
|
+
kLqNvP: "xaoy8p5",
|
|
158
157
|
$$css: true
|
|
159
158
|
},
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
rangeInsetEnd: {
|
|
160
|
+
kt4wiu: "xz03a8w",
|
|
162
161
|
$$css: true
|
|
163
162
|
},
|
|
164
163
|
previewBg: {
|
|
165
164
|
kVAEAm: "x10l6tqk",
|
|
166
165
|
k87sOh: "xs7f9wi",
|
|
167
166
|
krVfgx: "x1c7jfne",
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
kLqNvP: "x1o0tod",
|
|
168
|
+
kt4wiu: "xtijo5x",
|
|
170
169
|
$$css: true
|
|
171
170
|
},
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
previewBgRadiusStart: {
|
|
172
|
+
kLqNvP: "xaoy8p5",
|
|
173
|
+
krdFHd: "x19415el",
|
|
174
|
+
kVL7Gh: "x1wc3881",
|
|
176
175
|
$$css: true
|
|
177
176
|
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
177
|
+
previewBgRadiusEnd: {
|
|
178
|
+
kt4wiu: "xz03a8w",
|
|
179
|
+
kfmiAY: "x8agd5o",
|
|
180
|
+
kT0f0o: "x1dgc8on",
|
|
182
181
|
$$css: true
|
|
183
182
|
},
|
|
184
183
|
previewStart: {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
kLqNvP: "xaoy8p5",
|
|
185
|
+
krdFHd: "x19415el",
|
|
186
|
+
kVL7Gh: "x1wc3881",
|
|
188
187
|
$$css: true
|
|
189
188
|
},
|
|
190
189
|
previewEnd: {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
kt4wiu: "xz03a8w",
|
|
191
|
+
kfmiAY: "x8agd5o",
|
|
192
|
+
kT0f0o: "x1dgc8on",
|
|
194
193
|
$$css: true
|
|
195
194
|
},
|
|
196
195
|
day: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../src/Carousel/Carousel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../src/Carousel/Carousel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAef,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,MAAM,WAAW,aAAc,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC9D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,kEAAkE;IAClE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA+JD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,GAAG,EACH,QAAQ,EACR,GAAO,EACP,UAAiB,EACjB,WAAkB,EAClB,OAAe,EACf,OAAO,EACP,YAAY,EAAE,kBAAkB,EAChC,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,SAAS,EACb,EAAE,aAAa,+BA6Mf;yBA3Ne,QAAQ"}
|
|
@@ -27,7 +27,8 @@ import { Button } from "../Button/index.js";
|
|
|
27
27
|
import { Icon } from "../Icon/index.js";
|
|
28
28
|
import { useLayer } from "../Layer/index.js";
|
|
29
29
|
import { useScrollOverflow } from "../hooks/useScrollOverflow.js";
|
|
30
|
-
import {
|
|
30
|
+
import { isRtlElement } from "../hooks/isRtlElement.js";
|
|
31
|
+
import { mergeProps, mergeRefs, rtlStyles } from "../utils/index.js";
|
|
31
32
|
import { themeProps } from "../utils/themeProps.js";
|
|
32
33
|
import { useTranslator } from "../i18n/index.js";
|
|
33
34
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -284,7 +285,10 @@ export function Carousel({
|
|
|
284
285
|
// for users who opted out of motion.
|
|
285
286
|
const prefersReducedMotion = typeof window !== 'undefined' && typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
286
287
|
el.scrollBy({
|
|
287
|
-
|
|
288
|
+
// `direction` is the logical intent (-1 = toward content start, +1 =
|
|
289
|
+
// toward content end). Under RTL the scroll axis is inverted (start is
|
|
290
|
+
// scrollLeft 0, the end is negative), so flip the physical delta sign.
|
|
291
|
+
left: (isRtlElement(el) ? -1 : 1) * direction * Math.max(amount, itemWidth),
|
|
288
292
|
behavior: prefersReducedMotion ? 'auto' : 'smooth'
|
|
289
293
|
});
|
|
290
294
|
}, []);
|
|
@@ -332,16 +336,19 @@ export function Carousel({
|
|
|
332
336
|
children: [/*#__PURE__*/_jsx("div", {
|
|
333
337
|
...{
|
|
334
338
|
0: {
|
|
335
|
-
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x67bb7w x1hc1fzr x19991ni xuedmi6 xlr8y92 xuuh30"
|
|
339
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x67bb7w x1hc1fzr x19991ni xuedmi6 xlr8y92 xuuh30 x1nyx83j"
|
|
336
340
|
},
|
|
337
341
|
1: {
|
|
338
|
-
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x19991ni xuedmi6 xlr8y92 xuuh30 xg01cxk x47corl"
|
|
342
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x19991ni xuedmi6 xlr8y92 xuuh30 x1nyx83j xg01cxk x47corl"
|
|
339
343
|
}
|
|
340
344
|
}[!!!overflowStart << 0],
|
|
341
345
|
children: /*#__PURE__*/_jsx(Button, {
|
|
342
|
-
icon: /*#__PURE__*/_jsx(
|
|
343
|
-
|
|
344
|
-
|
|
346
|
+
icon: /*#__PURE__*/_jsx("span", {
|
|
347
|
+
...stylex.props(rtlStyles.mirror),
|
|
348
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
349
|
+
icon: "chevronLeft",
|
|
350
|
+
size: "xsm"
|
|
351
|
+
})
|
|
345
352
|
}),
|
|
346
353
|
label: t('@astryx.carousel.scrollLeft'),
|
|
347
354
|
variant: "ghost",
|
|
@@ -359,16 +366,19 @@ export function Carousel({
|
|
|
359
366
|
}), /*#__PURE__*/_jsx("div", {
|
|
360
367
|
...{
|
|
361
368
|
0: {
|
|
362
|
-
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x67bb7w x1hc1fzr x19991ni xuedmi6 xlr8y92 xitnhlw"
|
|
369
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x67bb7w x1hc1fzr x19991ni xuedmi6 xlr8y92 xitnhlw x36dvrd"
|
|
363
370
|
},
|
|
364
371
|
1: {
|
|
365
|
-
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x19991ni xuedmi6 xlr8y92 xitnhlw xg01cxk x47corl"
|
|
372
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x19991ni xuedmi6 xlr8y92 xitnhlw x36dvrd xg01cxk x47corl"
|
|
366
373
|
}
|
|
367
374
|
}[!!!overflowEnd << 0],
|
|
368
375
|
children: /*#__PURE__*/_jsx(Button, {
|
|
369
|
-
icon: /*#__PURE__*/_jsx(
|
|
370
|
-
|
|
371
|
-
|
|
376
|
+
icon: /*#__PURE__*/_jsx("span", {
|
|
377
|
+
...stylex.props(rtlStyles.mirror),
|
|
378
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
379
|
+
icon: "chevronRight",
|
|
380
|
+
size: "xsm"
|
|
381
|
+
})
|
|
372
382
|
}),
|
|
373
383
|
label: t('@astryx.carousel.scrollRight'),
|
|
374
384
|
variant: "ghost",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDictationButton.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatDictationButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,wBAAwB,CAAC;AAMvE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatDictationButton.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatDictationButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,wBAAwB,CAAC;AAMvE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAO5C,MAAM,WAAW,wBAAyB,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC1E,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC,sEAAsE;IACtE,SAAS,EAAE,0BAA0B,CAAC;IACtC,iCAAiC;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,6EAA6E;IAC7E,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiDD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,SAAS,EACT,IAAW,EACX,uBAA8B,EAC9B,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,wBAAwB,4BAoE1B;yBA9Ee,mBAAmB"}
|
|
@@ -24,6 +24,7 @@ import { colorVars, radiusVars } from "../theme/tokens.stylex.js";
|
|
|
24
24
|
import { Button } from "../Button/index.js";
|
|
25
25
|
import { Icon } from "../Icon/index.js";
|
|
26
26
|
import { mergeProps } from "../utils/index.js";
|
|
27
|
+
import { useTranslator } from "../i18n/index.js";
|
|
27
28
|
|
|
28
29
|
// =============================================================================
|
|
29
30
|
// Types
|
|
@@ -86,6 +87,7 @@ export function ChatDictationButton({
|
|
|
86
87
|
style,
|
|
87
88
|
...rest
|
|
88
89
|
}) {
|
|
90
|
+
const t = useTranslator();
|
|
89
91
|
if (isHiddenWhenUnsupported && !dictation.isSupported) {
|
|
90
92
|
return null;
|
|
91
93
|
}
|
|
@@ -94,7 +96,7 @@ export function ChatDictationButton({
|
|
|
94
96
|
bands,
|
|
95
97
|
volume: rawVolume
|
|
96
98
|
} = dictation;
|
|
97
|
-
const accessibleLabel = label ?? (isListening ? '
|
|
99
|
+
const accessibleLabel = label ?? (isListening ? t('@astryx.chatDictationButton.stopDictation') : t('@astryx.chatDictationButton.startDictation'));
|
|
98
100
|
|
|
99
101
|
// Boost each band for visibility — quiet speech (0-10%) maps to full visual range
|
|
100
102
|
const boostedBands = bands.map(b => Math.min(Math.pow(b / 0.2, 0.5), 1));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatToolCalls.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatToolCalls.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAA+B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC1E,OAAO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E,MAAM,CAAC;IACf,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAClD;AA0YD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,4BAsJtD;yBAtJe,aAAa"}
|
|
@@ -27,6 +27,7 @@ import { Icon } from "../Icon/index.js";
|
|
|
27
27
|
import { Spinner } from "../Spinner/index.js";
|
|
28
28
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
29
29
|
import { themeProps } from "../utils/themeProps.js";
|
|
30
|
+
import { useTranslator } from "../i18n/index.js";
|
|
30
31
|
|
|
31
32
|
// =============================================================================
|
|
32
33
|
// Types
|
|
@@ -104,6 +105,7 @@ function getToolCallKey(call) {
|
|
|
104
105
|
function CallRow({
|
|
105
106
|
call
|
|
106
107
|
}) {
|
|
108
|
+
const t = useTranslator();
|
|
107
109
|
const status = call.status ?? 'complete';
|
|
108
110
|
const hasDetail = call.resultDetail != null;
|
|
109
111
|
const [isDetailOpen, setIsDetailOpen] = useState(false);
|
|
@@ -160,7 +162,9 @@ function CallRow({
|
|
|
160
162
|
// users. Rendering it inside the row also folds it into the
|
|
161
163
|
// accessible name of expandable (role="button") rows.
|
|
162
164
|
_jsx(VisuallyHidden, {
|
|
163
|
-
children:
|
|
165
|
+
children: t('@astryx.chatToolCalls.error', {
|
|
166
|
+
message: call.errorMessage ?? ''
|
|
167
|
+
})
|
|
164
168
|
})]
|
|
165
169
|
}), /*#__PURE__*/_jsx("span", {
|
|
166
170
|
...{
|
|
@@ -252,6 +256,7 @@ function CallRow({
|
|
|
252
256
|
* ```
|
|
253
257
|
*/
|
|
254
258
|
export function ChatToolCalls(props) {
|
|
259
|
+
const t = useTranslator();
|
|
255
260
|
const {
|
|
256
261
|
calls,
|
|
257
262
|
label: _customLabel,
|
|
@@ -324,11 +329,13 @@ export function ChatToolCalls(props) {
|
|
|
324
329
|
size: "sm",
|
|
325
330
|
color: "inherit"
|
|
326
331
|
})
|
|
327
|
-
}), /*#__PURE__*/
|
|
332
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
328
333
|
...{
|
|
329
334
|
className: "x141an7d x1ltkj2j x9ynric x1e4wzip xv1l7n4"
|
|
330
335
|
},
|
|
331
|
-
children:
|
|
336
|
+
children: t('@astryx.chatToolCalls.groupLabel', {
|
|
337
|
+
count: calls.length
|
|
338
|
+
})
|
|
332
339
|
})]
|
|
333
340
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
334
341
|
children: [/*#__PURE__*/_jsx("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAS,KAAK,WAAW,EAAC,MAAM,WAAW,CAAC;AAEnD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAWtC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAQtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyC5C,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SA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AC,EAAE,cAAc,CAAC;IAE3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,qBAAsB,SAAQ,qBAAqB;IAC3D,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,UAAU,yBAA0B,SAAQ,qBAAqB;IAC/D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAC3B,qBAAqB,GAAG,yBAAyB,CAAC;AA+BpD,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,gBAAgB,EAC5B,YAAY,EACZ,SAAS,EACT,OAAO,EACP,UAAiB,EACjB,SAAmB,EACnB,SAAS,EACT,KAAK,EACL,MAAM,EACN,aAAa,EAAE,MAAM,EACrB,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAqRnB;yBAlSe,YAAY"}
|
|
@@ -134,6 +134,14 @@ export function DropdownMenu({
|
|
|
134
134
|
};
|
|
135
135
|
const items = ('items' in props ? props.items : undefined) ?? [];
|
|
136
136
|
const children = props.children;
|
|
137
|
+
|
|
138
|
+
// Extract BaseProps pass-throughs (aria-*, id, event handlers) from the
|
|
139
|
+
// discriminated-union rest bag so they can be forwarded to the menu element.
|
|
140
|
+
const {
|
|
141
|
+
items: _items,
|
|
142
|
+
children: _children,
|
|
143
|
+
...rest
|
|
144
|
+
} = props;
|
|
137
145
|
const menuId = useId();
|
|
138
146
|
const menuSize = button.size ?? 'md';
|
|
139
147
|
const buttonRef = useRef(null);
|
|
@@ -323,6 +331,7 @@ export function DropdownMenu({
|
|
|
323
331
|
"aria-controls": menuId,
|
|
324
332
|
"data-testid": testId
|
|
325
333
|
}), popover.render(/*#__PURE__*/_jsx("div", {
|
|
334
|
+
...rest,
|
|
326
335
|
ref: listRef,
|
|
327
336
|
id: menuId,
|
|
328
337
|
role: "menu"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAa5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4D5C,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,SAAS,EACT,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAClD;IACC;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,UAAkB,EAClB,gBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,6BAA6B,+BA8D/B;yBA3Ee,wBAAwB"}
|
|
@@ -27,6 +27,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
27
27
|
import { Icon, renderIconSlot } from "../Icon/index.js";
|
|
28
28
|
import { Item } from "../Item/index.js";
|
|
29
29
|
import { useDropdownMenuContext } from "./DropdownMenuContext.js";
|
|
30
|
+
import { focusMenuItemOnHover } from "./menuItemHover.js";
|
|
30
31
|
import "../theme/tokens.stylex.js";
|
|
31
32
|
import { colorVars, spacingVars, radiusVars, durationVars, easeVars, borderVars } from "../theme/tokens.stylex.js";
|
|
32
33
|
import { mergeProps, themeProps } from "../utils/index.js";
|
|
@@ -36,7 +37,7 @@ const styles = {
|
|
|
36
37
|
kzqmXN: "xh8yej3",
|
|
37
38
|
kaIpWk: "x1ws5lxm",
|
|
38
39
|
kMwMTN: "x1tgivj0",
|
|
39
|
-
kWkggS: "xjbqb8w x1c52tdz
|
|
40
|
+
kWkggS: "xjbqb8w x1c52tdz",
|
|
40
41
|
kkrTdU: "x1ypdohk",
|
|
41
42
|
kI3sdo: "x1a2a7pz",
|
|
42
43
|
$$css: true
|
|
@@ -130,11 +131,13 @@ export function DropdownMenuCheckboxItem({
|
|
|
130
131
|
ctx?.closeMenu();
|
|
131
132
|
}
|
|
132
133
|
}, [isDisabled, onChange, value, hasCloseOnSelect, ctx]);
|
|
134
|
+
const handlePointerMove = useCallback(e => focusMenuItemOnHover(e, isDisabled), [isDisabled]);
|
|
133
135
|
return /*#__PURE__*/_jsx(Item, {
|
|
134
136
|
...rest,
|
|
135
137
|
role: "menuitemcheckbox",
|
|
136
138
|
"aria-checked": value,
|
|
137
139
|
tabIndex: isDisabled ? undefined : -1,
|
|
140
|
+
onPointerMove: handlePointerMove,
|
|
138
141
|
marker: /*#__PURE__*/_jsx("span", {
|
|
139
142
|
"aria-hidden": "true",
|
|
140
143
|
...mergeProps(themeProps('dropdown-menu-checkbox', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"DropdownMenuItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAStD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyC5C,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC,wCAAwC;IACxC,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,0BAA0B;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gEAAgE;IAChE,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,OAAO,EACP,UAAkB,EAClB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,qBAAqB,+BA4CvB;yBAtDe,gBAAgB"}
|
|
@@ -30,6 +30,7 @@ import "../theme/tokens.stylex.js";
|
|
|
30
30
|
import { colorVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
31
31
|
import { mergeProps } from "../utils/index.js";
|
|
32
32
|
import { useDropdownMenuContext } from "./DropdownMenuContext.js";
|
|
33
|
+
import { focusMenuItemOnHover } from "./menuItemHover.js";
|
|
33
34
|
import { themeProps } from "../utils/themeProps.js";
|
|
34
35
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
35
36
|
const menuItemStyles = {
|
|
@@ -42,7 +43,7 @@ const menuItemStyles = {
|
|
|
42
43
|
kMv6JI: "x9ynric",
|
|
43
44
|
kGuDYH: "xcr08ib",
|
|
44
45
|
kMwMTN: "x1tgivj0",
|
|
45
|
-
kWkggS: "xjbqb8w x1c52tdz
|
|
46
|
+
kWkggS: "xjbqb8w x1c52tdz",
|
|
46
47
|
kkrTdU: "x1ypdohk",
|
|
47
48
|
k9WMMc: "x1yc453h",
|
|
48
49
|
kI3sdo: "x1a2a7pz",
|
|
@@ -102,9 +103,11 @@ export function DropdownMenuItem({
|
|
|
102
103
|
onClick();
|
|
103
104
|
ctx?.closeMenu();
|
|
104
105
|
}, [isDisabled, onClick, ctx]);
|
|
106
|
+
const handlePointerMove = useCallback(e => focusMenuItemOnHover(e, isDisabled), [isDisabled]);
|
|
105
107
|
return /*#__PURE__*/_jsx(Item, {
|
|
106
108
|
role: "menuitem",
|
|
107
109
|
tabIndex: isDisabled ? undefined : -1,
|
|
110
|
+
onPointerMove: handlePointerMove,
|
|
108
111
|
startContent: icon ? renderIconSlot(icon, {
|
|
109
112
|
size: 'sm',
|
|
110
113
|
color: 'secondary'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAYtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqE5C,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,SAAS,EACT,MAAM,GAAG,cAAc,GAAG,UAAU,CACrC;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,0BAA0B,+BAuE5B;yBAlFe,qBAAqB"}
|
|
@@ -25,6 +25,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
25
25
|
import { renderIconSlot } from "../Icon/index.js";
|
|
26
26
|
import { Item } from "../Item/index.js";
|
|
27
27
|
import { useDropdownMenuContext } from "./DropdownMenuContext.js";
|
|
28
|
+
import { focusMenuItemOnHover } from "./menuItemHover.js";
|
|
28
29
|
import "../theme/tokens.stylex.js";
|
|
29
30
|
import { colorVars, spacingVars, durationVars, easeVars, borderVars } from "../theme/tokens.stylex.js";
|
|
30
31
|
import { mergeProps, themeProps } from "../utils/index.js";
|
|
@@ -35,7 +36,7 @@ const styles = {
|
|
|
35
36
|
kzqmXN: "xh8yej3",
|
|
36
37
|
kaIpWk: "x1ws5lxm",
|
|
37
38
|
kMwMTN: "x1tgivj0",
|
|
38
|
-
kWkggS: "xjbqb8w x1c52tdz
|
|
39
|
+
kWkggS: "xjbqb8w x1c52tdz",
|
|
39
40
|
kkrTdU: "x1ypdohk",
|
|
40
41
|
kI3sdo: "x1a2a7pz",
|
|
41
42
|
$$css: true
|
|
@@ -141,11 +142,13 @@ export function DropdownMenuRadioItem({
|
|
|
141
142
|
menuCtx?.closeMenu();
|
|
142
143
|
}
|
|
143
144
|
}, [isDisabled, groupCtx, value, menuCtx]);
|
|
145
|
+
const handlePointerMove = useCallback(e => focusMenuItemOnHover(e, isDisabled), [isDisabled]);
|
|
144
146
|
return /*#__PURE__*/_jsx(Item, {
|
|
145
147
|
...rest,
|
|
146
148
|
role: "menuitemradio",
|
|
147
149
|
"aria-checked": isChecked,
|
|
148
150
|
tabIndex: isDisabled ? undefined : -1,
|
|
151
|
+
onPointerMove: handlePointerMove,
|
|
149
152
|
marker: /*#__PURE__*/_jsx("span", {
|
|
150
153
|
"aria-hidden": "true",
|
|
151
154
|
...mergeProps(themeProps('dropdown-menu-radio', {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file menuItemHover.ts
|
|
3
|
+
* @output Exports focusMenuItemOnHover
|
|
4
|
+
* @position Shared helper for DropdownMenu/ContextMenu item components
|
|
5
|
+
*
|
|
6
|
+
* Menus keep a single highlighted item by using DOM focus as the sole
|
|
7
|
+
* highlight source. Mouse hover moves focus onto the pointed-at item so the
|
|
8
|
+
* one focus highlight follows the pointer — instead of a separate `:hover`
|
|
9
|
+
* background leaving the keyboard-focused item highlighted at the same time.
|
|
10
|
+
*
|
|
11
|
+
* SYNC: When modified, update the item components that use it:
|
|
12
|
+
* - /packages/core/src/DropdownMenu/DropdownMenuItem.tsx
|
|
13
|
+
* - /packages/core/src/DropdownMenu/DropdownMenuCheckboxItem.tsx
|
|
14
|
+
* - /packages/core/src/DropdownMenu/DropdownMenuRadioItem.tsx
|
|
15
|
+
*/
|
|
16
|
+
import type { PointerEvent } from 'react';
|
|
17
|
+
/**
|
|
18
|
+
* Move focus to a menu item as the pointer moves over it, so hover and
|
|
19
|
+
* keyboard navigation share a single focus-driven highlight. Only reacts to a
|
|
20
|
+
* real mouse (not touch/pen, which have no hover), and skips disabled items.
|
|
21
|
+
*/
|
|
22
|
+
export declare function focusMenuItemOnHover(e: PointerEvent<HTMLElement>, isDisabled?: boolean): void;
|
|
23
|
+
//# sourceMappingURL=menuItemHover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuItemHover.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/menuItemHover.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,OAAO,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,EAC5B,UAAU,CAAC,EAAE,OAAO,GACnB,IAAI,CAQN"}
|