@astryxdesign/core 0.7.9-canary.b1e8e09 → 0.7.9-canary.b1f604c
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/BottomSheet/BottomSheet.js +2 -2
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +4 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +29 -16
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts +2 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.js +20 -0
- package/dist/CheckboxList/CheckboxListItem.d.ts +2 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +40 -14
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +2 -2
- package/dist/DropdownMenu/DropdownMenu.js +2 -4
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +5 -18
- package/dist/Item/Item.d.ts +18 -0
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +70 -25
- package/dist/Item/ItemListRowContext.d.ts +2 -0
- package/dist/Item/ItemListRowContext.d.ts.map +1 -0
- package/dist/Item/ItemListRowContext.js +16 -0
- package/dist/Layout/LayoutPanel.d.ts +10 -10
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.js +59 -7
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +1 -0
- package/dist/List/ListItem.d.ts +5 -4
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +45 -9
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +6 -9
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -10
- package/dist/Resizable/ResizeHandle.d.ts +5 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +44 -5
- package/dist/Resizable/resizablePane.d.ts +60 -0
- package/dist/Resizable/resizablePane.d.ts.map +1 -0
- package/dist/Resizable/resizablePane.js +142 -0
- package/dist/Resizable/useResizable.d.ts +7 -0
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +13 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +32 -8
- package/dist/SideNav/SideNav.d.ts +9 -3
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +47 -10
- package/dist/astryx.css +344 -334
- package/dist/hooks/computeOverflow.d.ts +2 -0
- package/dist/hooks/computeOverflow.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.js +1 -1
- package/dist/hooks/useClickableContainer.d.ts +10 -3
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +23 -10
- package/dist/hooks/useKeyboardHighlight.d.ts +17 -0
- package/dist/hooks/useKeyboardHighlight.d.ts.map +1 -0
- package/dist/hooks/useKeyboardHighlight.js +38 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +37 -12
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +190 -21
- package/dist/i18n/InternationalizationProvider.d.ts +9 -8
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/internal/calendar-system.d.ts +18 -0
- package/dist/internal/calendar-system.d.ts.map +1 -0
- package/dist/internal/calendar-system.js +19 -0
- package/dist/privateAttributes/press.stylex.d.ts +14 -11
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +15 -11
- package/dist/utils/calendarDateParser.d.ts +110 -0
- package/dist/utils/calendarDateParser.d.ts.map +1 -0
- package/dist/utils/calendarDateParser.js +1225 -0
- package/dist/utils/calendarSystem.d.ts +22 -6
- package/dist/utils/calendarSystem.d.ts.map +1 -1
- package/dist/utils/calendarSystem.js +68 -9
- package/dist/utils/coarsePointer.d.ts +5 -0
- package/dist/utils/coarsePointer.d.ts.map +1 -1
- package/dist/utils/coarsePointer.js +22 -13
- package/dist/utils/focusReturn.d.ts +10 -2
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +16 -3
- package/dist/utils/hitArea.d.ts +8 -1
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +17 -4
- package/dist/utils/plainDate.d.ts +15 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +35 -0
- package/dist/utils/touchHitArea.d.ts +30 -0
- package/dist/utils/touchHitArea.d.ts.map +1 -0
- package/dist/utils/touchHitArea.js +167 -0
- package/dist/utils/touchHitArea.stylex.d.ts +6 -3
- package/dist/utils/touchHitArea.stylex.d.ts.map +1 -1
- package/dist/utils/touchHitArea.stylex.js +19 -3
- package/package.json +9 -4
- package/src/BottomSheet/BottomSheet.tsx +2 -2
- package/src/BottomSheet/bottomSheetStack.ts +4 -3
- package/src/CheckboxInput/CheckboxInput.doc.mjs +2 -2
- package/src/CheckboxInput/CheckboxInput.tsx +46 -23
- package/src/CheckboxInput/CheckboxRowPressContext.ts +22 -0
- package/src/CheckboxList/CheckboxList.doc.mjs +9 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +3 -3
- package/src/CheckboxList/CheckboxListItem.tsx +35 -14
- package/src/Dialog/Dialog.tsx +2 -1
- package/src/DropdownMenu/DropdownMenu.tsx +2 -2
- package/src/InfoTip/InfoTip.tsx +5 -27
- package/src/Item/Item.tsx +92 -30
- package/src/Item/ItemListRowContext.tsx +18 -0
- package/src/Layout/LayoutPanel.doc.mjs +8 -8
- package/src/Layout/LayoutPanel.tsx +89 -13
- package/src/List/List.doc.mjs +10 -1
- package/src/List/List.tsx +5 -0
- package/src/List/ListItem.tsx +63 -8
- package/src/MultiSelector/MultiSelector.tsx +7 -17
- package/src/RadioList/RadioListItem.tsx +5 -13
- package/src/Resizable/Resizable.doc.mjs +40 -12
- package/src/Resizable/ResizeHandle.tsx +68 -6
- package/src/Resizable/resizablePane.ts +188 -0
- package/src/Resizable/useResizable.ts +15 -0
- package/src/Selector/Selector.tsx +49 -5
- package/src/SideNav/SideNav.doc.mjs +2 -2
- package/src/SideNav/SideNav.tsx +88 -12
- package/src/hooks/computeOverflow.ts +1 -1
- package/src/hooks/useClickableContainer.ts +22 -10
- package/src/hooks/useKeyboardHighlight.ts +71 -0
- package/src/hooks/useMediaQuery.ts +41 -12
- package/src/hooks/useOverflow.ts +297 -73
- package/src/i18n/InternationalizationProvider.doc.mjs +3 -3
- package/src/i18n/InternationalizationProvider.tsx +9 -8
- package/src/internal/calendar-system.ts +26 -0
- package/src/privateAttributes/press.stylex.ts +29 -11
- package/src/utils/calendarDateParser.ts +1385 -0
- package/src/utils/calendarSystem.ts +82 -7
- package/src/utils/coarsePointer.ts +27 -14
- package/src/utils/focusReturn.ts +17 -3
- package/src/utils/hitArea.ts +31 -4
- package/src/utils/plainDate.ts +46 -0
- package/src/utils/touchHitArea.stylex.ts +18 -3
- package/src/utils/touchHitArea.ts +177 -0
|
@@ -65,7 +65,7 @@ import { ModalAnnounceProvider } from "../hooks/ModalAnnounceProvider.js";
|
|
|
65
65
|
import { useModalOutlet } from "../Layer/modalOutlet.js";
|
|
66
66
|
import { useLayerDismissal } from "../Layer/useLayerDismissal.js";
|
|
67
67
|
import { useFocusRegionContainment } from "../hooks/useFocusTrap.js";
|
|
68
|
-
import {
|
|
68
|
+
import { returnFocusForLastInput } from "../utils/focusReturn.js";
|
|
69
69
|
import { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
70
70
|
import { BottomSheetPanel } from "./BottomSheetPanel.js";
|
|
71
71
|
import { BottomSheetEdgeTint } from "./BottomSheetEdgeTint.js";
|
|
@@ -533,7 +533,7 @@ function StandaloneBottomSheet({
|
|
|
533
533
|
if (revealed != null && (returnTarget == null || !revealed.element.contains(returnTarget))) {
|
|
534
534
|
revealed.focus();
|
|
535
535
|
} else if (returnTarget != null) {
|
|
536
|
-
|
|
536
|
+
returnFocusForLastInput(returnTarget);
|
|
537
537
|
}
|
|
538
538
|
triggerRef.current = null;
|
|
539
539
|
}, [finalFocusRef, hasScrim, isOpen]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottomSheetStack.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/bottomSheetStack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bottomSheetStack.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/bottomSheetStack.ts"],"names":[],"mappings":"AAuDA,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC1D,6EAA6E;IAC7E,QAAQ,CAAC,eAAe,EAAE,MAAM,CA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iCACjC,QAAQ;CACtC,CAAC"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file bottomSheetStack.ts
|
|
7
|
-
* @input The DOM (dialog elements, document order) and
|
|
7
|
+
* @input The DOM (dialog elements, document order) and the focus-return
|
|
8
|
+
* utilities
|
|
8
9
|
* @output The private bottom-sheet stack registry: host registration,
|
|
9
10
|
* open-order ranking, top-layer reconciliation, one view per host, the
|
|
10
11
|
* replace handoff, and the shared native show/hide and focus helpers
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
// two copies of this module on one page share one stack. A copy on another
|
|
50
51
|
// version keeps its own stack. Each document is its own stack.
|
|
51
52
|
import { notifyTopLayerEntry } from "../Layer/modalOutlet.js";
|
|
52
|
-
import { focusForLastInput } from "../utils/focusReturn.js";
|
|
53
|
+
import { focusForLastInput, returnFocusForLastInput } from "../utils/focusReturn.js";
|
|
53
54
|
|
|
54
55
|
/** The motions a host's panel reports to the registry during a replace. */
|
|
55
56
|
|
|
@@ -240,7 +241,7 @@ function completeClosingGroup(group) {
|
|
|
240
241
|
group.reported = true;
|
|
241
242
|
const target = group.returnTarget;
|
|
242
243
|
if (target != null && target.isConnected) {
|
|
243
|
-
|
|
244
|
+
returnFocusForLastInput(target);
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
247
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file CheckboxInput.tsx
|
|
3
|
-
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip
|
|
3
|
+
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip,
|
|
4
|
+
* CheckboxRowPressContext (a row around the checkbox that owns its press)
|
|
4
5
|
* @output Exports CheckboxInput component, CheckboxInputProps
|
|
5
6
|
* @position Core implementation; consumed by index.ts, tested by CheckboxInput.test.tsx
|
|
6
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxInput.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EAGf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AA4KhD,QAAA,MAAM,iBAAiB;;;;;;;;;EASrB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAE/D,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACrE,wDAAwD;IACxD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACxE;;OAEG;IACH,YAAY,CAAC,EAAE,CACb,OAAO,EAAE,OAAO,EAChB,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAC7B,IAAI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ACH,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,IAAI,EACR,EAAE,kBAAkB,+BAsRpB;yBAjTe,aAAa"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file CheckboxInput.tsx
|
|
7
|
-
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip
|
|
7
|
+
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip,
|
|
8
|
+
* CheckboxRowPressContext (a row around the checkbox that owns its press)
|
|
8
9
|
* @output Exports CheckboxInput component, CheckboxInputProps
|
|
9
10
|
* @position Core implementation; consumed by index.ts, tested by CheckboxInput.test.tsx
|
|
10
11
|
*
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
* - /apps/storybook/stories/CheckboxInput.stories.tsx (storybook stories)
|
|
16
17
|
* - /packages/cli/assets/templates/blocks/components/CheckboxInput/ (showcase blocks)
|
|
17
18
|
*/
|
|
18
|
-
import { useId, useCallback, useOptimistic, useRef, useTransition } from 'react';
|
|
19
|
+
import { use, useId, useCallback, useOptimistic, useRef, useTransition } from 'react';
|
|
19
20
|
import * as stylex from '@stylexjs/stylex';
|
|
20
21
|
import "../theme/tokens.stylex.js";
|
|
21
22
|
import { colorVars, spacingVars, radiusVars, typographyVars, typeScaleVars, fontWeightVars } from "../theme/tokens.stylex.js";
|
|
@@ -36,10 +37,11 @@ import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
|
36
37
|
import { useIndicator } from "../Indicator/useIndicator.js";
|
|
37
38
|
import { themeProps } from "../utils/themeProps.js";
|
|
38
39
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
39
|
-
import {
|
|
40
|
+
import { useTouchHitArea } from "../utils/touchHitArea.js";
|
|
40
41
|
import { touchHitAreaStyles } from "../utils/touchHitArea.stylex.js";
|
|
41
42
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
42
43
|
import english from "../i18n/generated-english/CheckboxInput/CheckboxInput.generated.js";
|
|
44
|
+
import { CheckboxRowPressContext } from "./CheckboxRowPressContext.js";
|
|
43
45
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
44
46
|
registerEnglishFallback(english);
|
|
45
47
|
|
|
@@ -72,6 +74,10 @@ const styles = {
|
|
|
72
74
|
"--_indicator-press-image": "x1dueop1 x189o2zt",
|
|
73
75
|
$$css: true
|
|
74
76
|
},
|
|
77
|
+
indicatorRowPressImage: {
|
|
78
|
+
"--_indicator-press-image": "x1y1g3jp",
|
|
79
|
+
$$css: true
|
|
80
|
+
},
|
|
75
81
|
checkboxWrapper: {
|
|
76
82
|
kVAEAm: "x1n2onr6",
|
|
77
83
|
k1xSpc: "x78zum5",
|
|
@@ -91,6 +97,10 @@ const styles = {
|
|
|
91
97
|
kNctxI: "x1ikgzpo xsozn46",
|
|
92
98
|
$$css: true
|
|
93
99
|
},
|
|
100
|
+
indicatorRowPressOverlay: {
|
|
101
|
+
kNctxI: "xlvbopx",
|
|
102
|
+
$$css: true
|
|
103
|
+
},
|
|
94
104
|
input: {
|
|
95
105
|
kVAEAm: "x10l6tqk",
|
|
96
106
|
k87sOh: "xwa60dl",
|
|
@@ -182,6 +192,13 @@ export function CheckboxInput({
|
|
|
182
192
|
// The row is the pressable: the overlay's pressed arm reads the row's
|
|
183
193
|
// scope marker, the way the indicator's hover tint does.
|
|
184
194
|
const pressable = usePressFeedback();
|
|
195
|
+
// A row around the checkbox that answers a press anywhere on it (a
|
|
196
|
+
// CheckboxListItem) owns the touch press instead. The checkbox then carries
|
|
197
|
+
// no press marker of its own. So the controller's innermost-wins rule finds
|
|
198
|
+
// the row for a finger on the label, the description or the box. The
|
|
199
|
+
// overlay below paints that row's press.
|
|
200
|
+
const isRowPressSurface = use(CheckboxRowPressContext);
|
|
201
|
+
const ownsPress = !isDisabled && !isRowPressSurface;
|
|
185
202
|
const generatedId = useId();
|
|
186
203
|
const id = idProp || generatedId;
|
|
187
204
|
const descriptionID = useId();
|
|
@@ -222,14 +239,9 @@ export function CheckboxInput({
|
|
|
222
239
|
// checkbox is a marker in another component's row, which keeps its target.
|
|
223
240
|
const hasHitArea = !isLabelHidden && !isDisabled && !isReadOnly;
|
|
224
241
|
const inputRef = useRef(null);
|
|
225
|
-
// The
|
|
226
|
-
//
|
|
227
|
-
const watchRowHitArea =
|
|
228
|
-
if (row == null || !hasHitArea) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
return watchHitArea(row, insets => writeHitInsets(row, insets));
|
|
232
|
-
}, [hasHitArea]);
|
|
242
|
+
// The band's insets stay live while the row takes taps, and clear when it
|
|
243
|
+
// stops.
|
|
244
|
+
const watchRowHitArea = useTouchHitArea(hasHitArea);
|
|
233
245
|
// The disabled-message tooltip listens for hover and focus on the whole
|
|
234
246
|
// row, a larger trigger. It anchors on the checkbox itself (below), so it
|
|
235
247
|
// shows next to the control. Its handlers check isEnabled, so the row
|
|
@@ -301,17 +313,18 @@ export function CheckboxInput({
|
|
|
301
313
|
ref: rowRef,
|
|
302
314
|
onPointerDown: hasHitArea ? handleRowPointerDown : undefined,
|
|
303
315
|
onClick: hasHitArea ? handleRowClick : undefined,
|
|
304
|
-
...(
|
|
316
|
+
...(ownsPress ? pressable : undefined),
|
|
305
317
|
...stylex.props(styles.container, isLabelHidden && styles.containerLabelHidden, hasHitArea && styles.hitAreaHost, hasHitArea && touchHitAreaStyles.layer,
|
|
306
318
|
// Hover and focus reach the checkbox visual through this ancestor
|
|
307
319
|
// marker rather than props, so the whole row drives it.
|
|
308
|
-
!isDisabled && indicatorScope, !isDisabled && styles.indicatorPressImage,
|
|
320
|
+
!isDisabled && indicatorScope, !isDisabled && (isRowPressSurface ? styles.indicatorRowPressImage : styles.indicatorPressImage),
|
|
309
321
|
// The touch press's strength and release live on the row the
|
|
310
322
|
// controller writes to; the layer over the checkbox box inherits
|
|
311
|
-
// and paints it.
|
|
312
|
-
|
|
323
|
+
// and paints it. Under a row that owns the press, the box inherits
|
|
324
|
+
// that row's strength instead.
|
|
325
|
+
ownsPress && interactionOverlayStyles.pressedAlpha),
|
|
313
326
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
314
|
-
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay),
|
|
327
|
+
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay, !isDisabled && isRowPressSurface && styles.indicatorRowPressOverlay),
|
|
315
328
|
...focusProps,
|
|
316
329
|
children: [/*#__PURE__*/_jsx("input", {
|
|
317
330
|
...rest,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxRowPressContext.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxRowPressContext.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,uBAAuB,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file CheckboxRowPressContext.ts
|
|
7
|
+
* @input Uses the private layer-scoped context factory
|
|
8
|
+
* @output CheckboxRowPressContext: whether the row is its checkbox's press surface
|
|
9
|
+
* @position Internal; CheckboxListItem provides it, CheckboxInput reads it
|
|
10
|
+
*
|
|
11
|
+
* Such a row carries the shared press marker (utils/pressFeedback.ts). Its
|
|
12
|
+
* checkbox carries none, so a finger anywhere on the row presses the row.
|
|
13
|
+
* It is layer-scoped and wraps only the row's own checkbox.
|
|
14
|
+
*
|
|
15
|
+
* SYNC: When modified, update CheckboxInput.tsx and
|
|
16
|
+
* ../CheckboxList/CheckboxListItem.tsx.
|
|
17
|
+
*/
|
|
18
|
+
import { createLayerScopedContext } from "../Layer/layerScopedContext.js";
|
|
19
|
+
export const CheckboxRowPressContext = createLayerScopedContext(false);
|
|
20
|
+
CheckboxRowPressContext.displayName = 'CheckboxRowPressContext';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file CheckboxListItem.tsx
|
|
3
|
-
* @input Uses React, CheckboxInput, ListItem, CheckboxListContext
|
|
3
|
+
* @input Uses React, CheckboxInput, ListItem, CheckboxListContext,
|
|
4
|
+
* CheckboxRowPressContext, the touch presentation and the row press paint
|
|
4
5
|
* @output Exports CheckboxListItem component, CheckboxListItemProps
|
|
5
6
|
* @position Core implementation; consumed by index.ts, tested by CheckboxList.test.tsx
|
|
6
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxListItem.d.ts","sourceRoot":"","sources":["../../src/CheckboxList/CheckboxListItem.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"CheckboxListItem.d.ts","sourceRoot":"","sources":["../../src/CheckboxList/CheckboxListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAkC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAItE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAc5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAuBvC,MAAM,WAAW,qBAAsB,SAAQ,SAAS,CAAC,aAAa,CAAC;IACrE;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;;;;OAaG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IACtC;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAChC;AAyCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,WAAW,EACX,UAAU,EACV,UAAU,EAAE,cAAsB,EAClC,SAAS,EAAE,aAAqB,EAChC,SAAS,EACT,OAAO,EACP,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EAAE,WAAW,EACpB,KAAK,EACL,GAAG,SAAS,EACb,EAAE,qBAAqB,+BAiLvB;yBAlMe,gBAAgB"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file CheckboxListItem.tsx
|
|
7
|
-
* @input Uses React, CheckboxInput, ListItem, CheckboxListContext
|
|
7
|
+
* @input Uses React, CheckboxInput, ListItem, CheckboxListContext,
|
|
8
|
+
* CheckboxRowPressContext, the touch presentation and the row press paint
|
|
8
9
|
* @output Exports CheckboxListItem component, CheckboxListItemProps
|
|
9
10
|
* @position Core implementation; consumed by index.ts, tested by CheckboxList.test.tsx
|
|
10
11
|
*
|
|
@@ -21,6 +22,10 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
21
22
|
import "../theme/tokens.stylex.js";
|
|
22
23
|
import { colorVars } from "../theme/tokens.stylex.js";
|
|
23
24
|
import { CheckboxInput } from "../CheckboxInput/CheckboxInput.js";
|
|
25
|
+
import { CheckboxRowPressContext } from "../CheckboxInput/CheckboxRowPressContext.js";
|
|
26
|
+
import { rowPressPaintStyles } from "../privateAttributes/press.stylex.js";
|
|
27
|
+
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
28
|
+
import { useTouchPresentation } from "../utils/touchPresentation.js";
|
|
24
29
|
import { ListItem } from "../List/ListItem.js";
|
|
25
30
|
import { ListContext } from "../List/ListContext.js";
|
|
26
31
|
import { CheckboxListContext } from "./CheckboxListContext.js";
|
|
@@ -184,6 +189,14 @@ export function CheckboxListItem({
|
|
|
184
189
|
}) : undefined, [requiredGroup, isBoxChecked, isBoxEnabled]);
|
|
185
190
|
const checkboxInputRef = useMergedRefs(checkboxRef, registerWithRequiredGroup);
|
|
186
191
|
|
|
192
|
+
// Under a finger, a delegating row is the option's only press surface. A
|
|
193
|
+
// touch anywhere on it presses the row. A fine pointer keeps the box's own
|
|
194
|
+
// press.
|
|
195
|
+
const {
|
|
196
|
+
isTouch
|
|
197
|
+
} = useTouchPresentation();
|
|
198
|
+
const rowOwnsPress = isTouch && hasRowInteraction && !effectiveDisabled;
|
|
199
|
+
|
|
187
200
|
// A read-only checkbox carries aria-readonly, which the row's clickable
|
|
188
201
|
// container treats as a non-interactive target, so a click on it would be
|
|
189
202
|
// delegated straight back to the checkbox without end. Stop that click at
|
|
@@ -230,21 +243,34 @@ export function CheckboxListItem({
|
|
|
230
243
|
,
|
|
231
244
|
interactiveRef: hasRowInteraction ? checkboxRef : undefined,
|
|
232
245
|
"aria-busy": isBusy || undefined,
|
|
233
|
-
xstyle: [
|
|
246
|
+
xstyle: [
|
|
247
|
+
// The row's own press paint, which the layer over its box reads.
|
|
248
|
+
rowOwnsPress && rowPressPaintStyles.checkboxRow,
|
|
249
|
+
// Item's row layer drops the strength's release, and the box paints
|
|
250
|
+
// at that strength. So the row brings the release back, and the box
|
|
251
|
+
// fades with the row.
|
|
252
|
+
rowOwnsPress && interactionOverlayStyles.pressedAlpha, resolvedChecked === true && !effectiveDisabled && !effectiveReadOnly && styles.selected, xstyle],
|
|
234
253
|
className: className,
|
|
235
254
|
style: style,
|
|
236
|
-
startContent:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
value:
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
255
|
+
startContent:
|
|
256
|
+
/*#__PURE__*/
|
|
257
|
+
// Only the row's own checkbox: a checkbox placed in the row's content
|
|
258
|
+
// keeps its own press.
|
|
259
|
+
_jsx(CheckboxRowPressContext, {
|
|
260
|
+
value: rowOwnsPress,
|
|
261
|
+
children: /*#__PURE__*/_jsx(DescribedCheckboxInput, {
|
|
262
|
+
ref: checkboxInputRef,
|
|
263
|
+
label: checkboxLabel,
|
|
264
|
+
"aria-labelledby": namesFromVisibleLabel ? labelID : undefined,
|
|
265
|
+
isLabelHidden: true,
|
|
266
|
+
value: resolvedChecked,
|
|
267
|
+
onChange: () => handleToggle(),
|
|
268
|
+
onClick: handleCheckboxClick,
|
|
269
|
+
isDisabled: effectiveDisabled,
|
|
270
|
+
isReadOnly: effectiveReadOnly,
|
|
271
|
+
isLoading: isBusy,
|
|
272
|
+
size: checkboxSize
|
|
273
|
+
})
|
|
248
274
|
})
|
|
249
275
|
});
|
|
250
276
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA+B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAMhD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],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;;;;;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,EAAE,UAAU,EAClB,QAAgB,EAChB,YAAY,EACZ,KAAW,EACX,SAAmB,EACnB,QAAQ,EACR,OAAoB,EACpB,OAAgB,EAChB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,sCAiab;yBAjbe,MAAM"}
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -58,7 +58,7 @@ import { DialogContext } from "./DialogContext.js";
|
|
|
58
58
|
import { themeProps } from "../utils/themeProps.js";
|
|
59
59
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
60
60
|
import { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
61
|
-
import { focusForLastInput, prepareFocusReturnOnRemoval } from "../utils/focusReturn.js";
|
|
61
|
+
import { focusForLastInput, prepareFocusReturnOnRemoval, returnFocusForLastInput } from "../utils/focusReturn.js";
|
|
62
62
|
import { ModalAnnounceProvider } from "../hooks/ModalAnnounceProvider.js";
|
|
63
63
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
64
64
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -466,7 +466,7 @@ export function Dialog({
|
|
|
466
466
|
// the last input in that element's own document calls for.
|
|
467
467
|
const trigger = triggerElementRef.current;
|
|
468
468
|
if (trigger) {
|
|
469
|
-
|
|
469
|
+
returnFocusForLastInput(trigger);
|
|
470
470
|
}
|
|
471
471
|
triggerElementRef.current = null;
|
|
472
472
|
}
|
|
@@ -50,7 +50,7 @@ import { useListFocus } from "../hooks/useListFocus.js";
|
|
|
50
50
|
import { useDropdownMenuPress } from "../hooks/useMenuPress.js";
|
|
51
51
|
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
52
52
|
import { useFocusReturnVisibility } from "../hooks/useFocusReturnVisibility.js";
|
|
53
|
-
import {
|
|
53
|
+
import { returnFocusForLastInput } from "../utils/focusReturn.js";
|
|
54
54
|
import { useMenuOverflow } from "./useMenuOverflow.js";
|
|
55
55
|
import { MenuRegionsContext } from "./menuRegionsContext.js";
|
|
56
56
|
import { moveRegionsTab } from "./menuRegionStops.js";
|
|
@@ -704,9 +704,7 @@ function DropdownMenuPopover({
|
|
|
704
704
|
// reaches only the design system's own Button; the browser's focus option
|
|
705
705
|
// also reaches a control the caller renders, which the browser would
|
|
706
706
|
// otherwise ring (Chromium after a mouse pick, WebKit after a touch).
|
|
707
|
-
|
|
708
|
-
preventScroll: true
|
|
709
|
-
});
|
|
707
|
+
returnFocusForLastInput(trigger);
|
|
710
708
|
}, [hideOpenFlyouts, isControlled, onOpenChange, prepareFocusReturn]);
|
|
711
709
|
|
|
712
710
|
// Defer item focus until the layer has committed open, so focus restore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoTip.d.ts","sourceRoot":"","sources":["../../src/InfoTip/InfoTip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAO,KAAK,QAAQ,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"InfoTip.d.ts","sourceRoot":"","sources":["../../src/InfoTip/InfoTip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAO,KAAK,QAAQ,EAAC,MAAM,cAAc,CAAC;AAsBjD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;AAEnC,MAAM,WAAW,YAAa,SAAQ,IAAI,CACxC,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC7B;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AA+BD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,KAAK,EACL,IAAW,EACX,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,YAAY,GAAG,SAAS,CAiF1B;yBAzFe,OAAO"}
|
package/dist/InfoTip/InfoTip.js
CHANGED
|
@@ -29,7 +29,8 @@ import "../theme/tokens.stylex.js";
|
|
|
29
29
|
import { colorVars, durationVars, easeVars, radiusVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
30
30
|
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
31
31
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
32
|
-
import {
|
|
32
|
+
import { useTouchHitArea } from "../utils/touchHitArea.js";
|
|
33
|
+
import { touchHitAreaStyles } from "../utils/touchHitArea.stylex.js";
|
|
33
34
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
35
|
registerEnglishFallback(english);
|
|
35
36
|
|
|
@@ -56,12 +57,6 @@ const styles = {
|
|
|
56
57
|
kIyJzY: "xuedmi6",
|
|
57
58
|
kAMwcw: "xlr8y92",
|
|
58
59
|
$$css: true
|
|
59
|
-
},
|
|
60
|
-
hitArea: {
|
|
61
|
-
k5JduY: "x1s928wv",
|
|
62
|
-
kwXMNM: "x1j6awrg",
|
|
63
|
-
kv0HGH: "xzdy5ak",
|
|
64
|
-
$$css: true
|
|
65
60
|
}
|
|
66
61
|
};
|
|
67
62
|
|
|
@@ -92,15 +87,7 @@ export function InfoTip({
|
|
|
92
87
|
style
|
|
93
88
|
}) {
|
|
94
89
|
const t = useComponentTranslator();
|
|
95
|
-
|
|
96
|
-
// lives as long as the button is attached: the ref's cleanup stops it, and a
|
|
97
|
-
// replaced button starts its own.
|
|
98
|
-
const watchButtonHitArea = useCallback(button => {
|
|
99
|
-
if (button == null) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
return watchHitArea(button, insets => writeHitInsets(button, insets));
|
|
103
|
-
}, []);
|
|
90
|
+
const hitAreaRef = useTouchHitArea(true);
|
|
104
91
|
// Whether a press pinned the help. A hover or focus preview is not pinned.
|
|
105
92
|
const [isPinned, setIsPinned] = useState(false);
|
|
106
93
|
// Whether the help shows, pinned or previewed: the button names it in
|
|
@@ -117,7 +104,7 @@ export function InfoTip({
|
|
|
117
104
|
onShow: handleShow,
|
|
118
105
|
onHide: handleHide
|
|
119
106
|
});
|
|
120
|
-
const mergedRef = useMergedRefs(ref,
|
|
107
|
+
const mergedRef = useMergedRefs(ref, hitAreaRef, tooltip.ref);
|
|
121
108
|
|
|
122
109
|
// A primary mouse or pen press on a preview calls show() first. The hook's
|
|
123
110
|
// press-to-close then leaves it open. The click pins it.
|
|
@@ -155,7 +142,7 @@ export function InfoTip({
|
|
|
155
142
|
"aria-controls": isShown ? tooltip.describedBy : undefined,
|
|
156
143
|
onPointerDownCapture: handlePointerDownCapture,
|
|
157
144
|
onClick: handleClick,
|
|
158
|
-
...mergeProps(stylex.props(focusOutlineStyles.focusVisible, styles.trigger,
|
|
145
|
+
...mergeProps(stylex.props(focusOutlineStyles.focusVisible, styles.trigger, touchHitAreaStyles.layer, xstyle), className, style),
|
|
159
146
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
160
147
|
icon: "info",
|
|
161
148
|
size: size
|
package/dist/Item/Item.d.ts
CHANGED
|
@@ -233,6 +233,24 @@ export interface ItemProps extends BaseProps<HTMLElement> {
|
|
|
233
233
|
*/
|
|
234
234
|
'data-testid'?: string;
|
|
235
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Whether a row serves swipe actions, and so is a stacking context at rest:
|
|
238
|
+
* its root translates (`styles.swipeRoot`). Swipe actions need a
|
|
239
|
+
* role that permits interactive descendants, since a swipe panel holds
|
|
240
|
+
* buttons. That is a `listitem`, or no role at all. A root that is itself a
|
|
241
|
+
* link is not served, nor is a role that forbids interactive descendants. A
|
|
242
|
+
* disabled row, a row with no entry on either side, and the enlarged target of
|
|
243
|
+
* a nested control are not served either. Internal: under a finger,
|
|
244
|
+
* List/ListItem.tsx raises such a row, so its touch band stays above the rows
|
|
245
|
+
* after it.
|
|
246
|
+
*/
|
|
247
|
+
export declare function servesSwipeActions({ swipeActions, isDisabled, isDelegate, isLinkRoot, role, }: {
|
|
248
|
+
readonly swipeActions: ItemSwipeActions | undefined;
|
|
249
|
+
readonly isDisabled: boolean;
|
|
250
|
+
readonly isDelegate: boolean;
|
|
251
|
+
readonly isLinkRoot: boolean;
|
|
252
|
+
readonly role: string | null | undefined;
|
|
253
|
+
}): boolean;
|
|
236
254
|
/**
|
|
237
255
|
* A universal item primitive that unifies the "start content + label +
|
|
238
256
|
* description + end content" layout pattern. Use as a building block for list items,
|
package/dist/Item/Item.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/Item/Item.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/Item/Item.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAoC5C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE1E,yFAAyF;AACzF,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,UAAU,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wBAAwB;IACxB,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,qFAAqF;IACrF,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAA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