@astryxdesign/core 0.7.5-canary.10ca8ea → 0.7.5-canary.116f54b
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/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +13 -23
- package/dist/CodeBlock/CodeBlock.d.ts +9 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +27 -19
- package/dist/Dialog/Dialog.d.ts +4 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +12 -5
- package/dist/EmptyState/EmptyState.d.ts +4 -2
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +6 -4
- package/dist/Layer/layerAnimations.stylex.d.ts +9 -5
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +23 -10
- package/dist/Layer/layerSlideRules.d.ts +62 -2
- package/dist/Layer/layerSlideRules.d.ts.map +1 -1
- package/dist/Layer/layerSlideRules.js +124 -3
- package/dist/Layer/layerStack.d.ts +12 -9
- package/dist/Layer/layerStack.d.ts.map +1 -1
- package/dist/Layer/layerStack.js +116 -53
- package/dist/Layer/preserveAnimations.d.ts +11 -0
- package/dist/Layer/preserveAnimations.d.ts.map +1 -0
- package/dist/Layer/preserveAnimations.js +245 -0
- package/dist/Layer/useLayer.d.ts +19 -2
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +408 -10
- package/dist/Layer/useLayerDismissal.d.ts +10 -7
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -1
- package/dist/Layer/useLayerDismissal.js +8 -8
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +4 -1
- package/dist/Lightbox/LightboxKeyboard.a11y.browser.spec.js +1 -0
- package/dist/Markdown/Markdown.fr23.bench.js +3 -1
- package/dist/Markdown/Markdown.fr23.sampling.d.ts +16 -0
- package/dist/Markdown/Markdown.fr23.sampling.d.ts.map +1 -1
- package/dist/Markdown/Markdown.fr23.sampling.js +13 -4
- package/dist/Markdown/MarkdownTable.a11y.chromium.spec.js +1 -0
- package/dist/MobileNav/MobileNav.d.ts +2 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +9 -5
- package/dist/MobileNav/MobileNavPinchZoom.a11y.chromium.spec.js +1 -0
- package/dist/MultiSelector/CreateRow.a11y.chromium.spec.js +1 -0
- package/dist/MultiSelector/MultiSelector.disabledFocus.a11y.chromium.spec.js +1 -0
- package/dist/MultiSelector/OptionActions.a11y.chromium.spec.js +1 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +3 -1
- package/dist/ScrollableArea/ScrollableArea.d.ts.map +1 -1
- package/dist/ScrollableArea/ScrollableArea.js +1 -1
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +13 -14
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +9 -3
- package/dist/astryx.css +11 -2
- package/dist/hooks/AnnounceRenderedText.d.ts +17 -0
- package/dist/hooks/AnnounceRenderedText.d.ts.map +1 -0
- package/dist/hooks/AnnounceRenderedText.js +32 -0
- package/dist/hooks/useAnnounceRenderedText.d.ts +19 -2
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +52 -11
- package/dist/hooks/useFocusTrap.d.ts +1 -1
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +44 -20
- package/dist/hooks/useMenuPress.d.ts +2 -1
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +46 -30
- package/dist/hooks/useScrollableArea.d.ts.map +1 -1
- package/dist/hooks/useScrollableArea.js +37 -5
- package/dist/reset.a11y.chromium.spec.js +1 -0
- package/dist/reset.until-found.a11y.browser.spec.js +1 -0
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/themeAdaptations.d.ts +25 -1
- package/dist/theme/themeAdaptations.d.ts.map +1 -1
- package/dist/theme/themeAdaptations.js +30 -1
- package/dist/utils/edgeAutoscroll.d.ts +53 -0
- package/dist/utils/edgeAutoscroll.d.ts.map +1 -0
- package/dist/utils/edgeAutoscroll.js +81 -0
- package/package.json +4 -4
- package/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts +1 -0
- package/src/AppShell/AppShell.spec.md +329 -0
- package/src/AspectRatio/__tests__/AspectRatioFitLayers.a11y.browser.spec.ts +1 -0
- package/src/BottomSheet/BottomSheet.spec.md +4 -3
- package/src/BottomSheet/BottomSheetSwitcher.spec.md +24 -20
- package/src/BottomSheet/__tests__/BottomSheetDrag.a11y.chromium.spec.ts +1 -0
- package/src/BottomSheet/__tests__/BottomSheetFocusReturn.a11y.browser.spec.ts +1 -0
- package/src/BottomSheet/__tests__/BottomSheetKeyboard.a11y.browser.spec.ts +1 -0
- package/src/BottomSheet/__tests__/BottomSheetNativeModal.a11y.browser.spec.ts +1 -0
- package/src/BottomSheet/__tests__/BottomSheetPinchZoom.a11y.chromium.spec.ts +1 -0
- package/src/BottomSheet/__tests__/BottomSheetToastOutlet.a11y.chromium.spec.ts +1 -0
- package/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts +1 -0
- package/src/Button/Button.spec.md +320 -0
- package/src/Button/__tests__/Button.a11y.chromium.spec.ts +1 -0
- package/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts +1 -0
- package/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts +1 -0
- package/src/Chat/ChatComposer.test.tsx +22 -0
- package/src/Chat/ChatComposer.tsx +17 -23
- package/src/Chat/__tests__/ChatLayoutScrollButton.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatLayoutScrollButtonSurface.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatMessageList.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatMessageMetadata.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatSendButton.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatSystemMessage.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatTokenizedText.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/useChatStreamScroll.a11y.chromium.spec.ts +1 -0
- package/src/CheckboxInput/__tests__/Checkbox.a11y.chromium.spec.ts +1 -0
- package/src/CheckboxList/__tests__/CheckboxList.a11y.chromium.spec.ts +1 -0
- package/src/CodeBlock/CodeBlock.doc.mjs +17 -1
- package/src/CodeBlock/CodeBlock.spec.md +35 -23
- package/src/CodeBlock/CodeBlock.test.tsx +97 -1
- package/src/CodeBlock/CodeBlock.tsx +54 -22
- package/src/CodeBlock/__tests__/CodeBlockCopyClearance.a11y.chromium.spec.ts +76 -0
- package/src/CodeBlock/__tests__/CodeBlockOverflowStop.a11y.chromium.spec.ts +1 -0
- package/src/CodeBlock/__tests__/DiffRowPaint.a11y.chromium.spec.ts +1 -0
- package/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts +1 -0
- package/src/Collapsible/__tests__/CollapsibleGroup.a11y.chromium.spec.ts +1 -0
- package/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts +1 -0
- package/src/CommandPalette/__tests__/CommandPalette.a11y.chromium.spec.ts +1 -0
- package/src/CommandPalette/__tests__/CommandPaletteFooter.a11y.chromium.spec.ts +1 -0
- package/src/CommandPalette/__tests__/CommandPaletteInputAudit.a11y.chromium.spec.ts +1 -0
- package/src/CommandPalette/__tests__/CommandPaletteItemAudit.a11y.chromium.spec.ts +1 -0
- package/src/ComplexSelector/__tests__/ComplexSelector.a11y.chromium.spec.ts +1 -0
- package/src/ContextMenu/__tests__/ContextMenuAudit.a11y.chromium.spec.ts +1 -0
- package/src/ContextMenu/__tests__/ContextMenuCursorAnchor.a11y.browser.spec.ts +1 -0
- package/src/DateInput/__tests__/DateInputAudit.a11y.chromium.spec.ts +1 -0
- package/src/DateInput/__tests__/WheelPinchZoom.a11y.chromium.spec.ts +18 -5
- package/src/Dialog/Dialog.doc.mjs +201 -47
- package/src/Dialog/Dialog.tsx +31 -7
- package/src/Dialog/__tests__/Dialog.a11y.browser.spec.ts +1 -0
- package/src/Dialog/__tests__/Dialog.a11y.chromium.spec.ts +1 -0
- package/src/Dialog/__tests__/Dialog.reduced-motion.a11y.browser.spec.ts +191 -0
- package/src/Drawer/__tests__/DrawerAudit.a11y.chromium.spec.ts +1 -0
- package/src/Drawer/__tests__/DrawerHeaderAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuDividerAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuDrillIn.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuFocusReturn.a11y.browser.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuGroupAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuItemAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuRadioGroupAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuRadioItemAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuSubMenuAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/MenuButton.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/MenuHeaderFooter.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/MenuHoverFocus.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/MenuPinchZoom.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/MenuPress.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/SubMenuHeaderFooter.a11y.chromium.spec.ts +1 -0
- package/src/EmptyState/EmptyState.announce.test.tsx +227 -0
- package/src/EmptyState/EmptyState.doc.mjs +1 -1
- package/src/EmptyState/EmptyState.spec.md +22 -14
- package/src/EmptyState/EmptyState.test.tsx +8 -8
- package/src/EmptyState/EmptyState.tsx +7 -5
- package/src/Field/__tests__/FieldLabelAudit.a11y.chromium.spec.ts +1 -0
- package/src/FieldStatus/__tests__/StatusMessage.a11y.chromium.spec.ts +1 -0
- package/src/IconButton/IconButton.spec.md +197 -0
- package/src/Item/__tests__/ItemSwipeActions.a11y.chromium.spec.ts +1 -0
- package/src/Item/__tests__/ItemSwipePinchZoom.a11y.chromium.spec.ts +1 -0
- package/src/Layer/__tests__/LayerReducedMotion.a11y.chromium.spec.ts +176 -0
- package/src/Layer/__tests__/TouchTrigger.a11y.chromium.spec.ts +1 -0
- package/src/Layer/layerAnimations.stylex.ts +22 -2
- package/src/Layer/layerSlideRules.ts +141 -8
- package/src/Layer/layerStack.ts +129 -62
- package/src/Layer/preserveAnimations.ts +304 -0
- package/src/Layer/useLayer.test.tsx +635 -0
- package/src/Layer/useLayer.tsx +485 -15
- package/src/Layer/useLayerDismissal.test.tsx +85 -2
- package/src/Layer/useLayerDismissal.ts +12 -9
- package/src/Layout/__tests__/Layout.a11y.chromium.spec.ts +1 -0
- package/src/Lightbox/Lightbox.tsx +3 -0
- package/src/Lightbox/LightboxKeyboard.a11y.browser.spec.ts +1 -0
- package/src/Link/__tests__/Link.a11y.chromium.spec.ts +1 -0
- package/src/Link/__tests__/Link.navigation.a11y.chromium.spec.ts +1 -0
- package/src/Markdown/Markdown.fr23.bench.ts +3 -1
- package/src/Markdown/Markdown.fr23.perf.test.ts +45 -3
- package/src/Markdown/Markdown.fr23.sampling.ts +13 -4
- package/src/Markdown/MarkdownTable.a11y.chromium.spec.ts +1 -0
- package/src/Markdown/__tests__/MarkdownNesting.a11y.chromium.spec.ts +1 -0
- package/src/MobileNav/MobileNav.test.tsx +27 -10
- package/src/MobileNav/MobileNav.tsx +10 -3
- package/src/MobileNav/MobileNavPinchZoom.a11y.chromium.spec.ts +1 -0
- package/src/MobileNav/__tests__/MobileNavWidth.a11y.chromium.spec.ts +103 -0
- package/src/MultiSelector/CreateRow.a11y.chromium.spec.ts +1 -0
- package/src/MultiSelector/MultiSelector.disabledFocus.a11y.chromium.spec.ts +1 -0
- package/src/MultiSelector/OptionActions.a11y.chromium.spec.ts +1 -0
- package/src/MultiSelector/__tests__/MultiSelector.a11y.chromium.spec.ts +1 -0
- package/src/NumberInput/__tests__/NumberInput.a11y.chromium.spec.ts +1 -0
- package/src/Popover/Popover.test.tsx +197 -2
- package/src/Popover/__tests__/PopoverSecondDocument.a11y.chromium.spec.ts +205 -0
- package/src/Popover/usePopover.tsx +3 -1
- package/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts +1 -0
- package/src/RadioList/__tests__/RadioGroup.a11y.chromium.spec.ts +1 -0
- package/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts +1 -0
- package/src/ScrollableArea/ScrollableArea.spec.md +6 -5
- package/src/ScrollableArea/ScrollableArea.test.tsx +5 -0
- package/src/ScrollableArea/ScrollableArea.tsx +4 -0
- package/src/Selector/__tests__/EmptyStateAnnouncement.a11y.chromium.spec.ts +1 -0
- package/src/Selector/__tests__/Listbox.a11y.chromium.spec.ts +1 -0
- package/src/Selector/__tests__/Selector.a11y.chromium.spec.ts +1 -0
- package/src/Selector/__tests__/Selector.combobox.a11y.chromium.spec.ts +1 -0
- package/src/Skeleton/Skeleton.spec.md +99 -42
- package/src/Slider/__tests__/Slider.a11y.chromium.spec.ts +1 -0
- package/src/Spinner/Spinner.spec.md +231 -0
- package/src/StatusDot/StatusDot.spec.md +143 -51
- package/src/Switch/__tests__/Switch.a11y.chromium.spec.ts +1 -0
- package/src/TabList/__tests__/Tabs.a11y.chromium.spec.ts +1 -0
- package/src/Table/__tests__/Table.a11y.chromium.spec.ts +1 -0
- package/src/Table/__tests__/TableMinWidth.a11y.chromium.spec.ts +1 -0
- package/src/Table/__tests__/TableScroll.a11y.chromium.spec.ts +1 -0
- package/src/TextInput/__tests__/TextInput.a11y.chromium.spec.ts +1 -0
- package/src/ToggleButton/__tests__/ToggleButton.a11y.chromium.spec.ts +1 -0
- package/src/Token/Token.spec.md +271 -0
- package/src/Token/__tests__/TokenRemoveTarget.a11y.chromium.spec.ts +1 -0
- package/src/Tokenizer/Tokenizer.test.tsx +44 -8
- package/src/Tokenizer/Tokenizer.tsx +14 -17
- package/src/Tokenizer/__tests__/TokenizerEndLane.a11y.chromium.spec.ts +1 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +1 -0
- package/src/Tooltip/Tooltip.test.tsx +23 -0
- package/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts +1 -0
- package/src/Tooltip/__tests__/TooltipFocusReturn.a11y.chromium.spec.ts +1 -0
- package/src/Tooltip/__tests__/TooltipHoverBridge.a11y.chromium.spec.ts +1 -0
- package/src/Tooltip/__tests__/TooltipTallContent.a11y.browser.spec.ts +646 -0
- package/src/Tooltip/__tests__/TooltipTallContentTracking.a11y.browser.spec.ts +1162 -0
- package/src/Tooltip/useTooltip.tsx +7 -2
- package/src/TopNav/__tests__/TopNavMobileLongHeading.a11y.chromium.spec.ts +1 -0
- package/src/TreeList/__tests__/TreeList.a11y.chromium.spec.ts +1 -0
- package/src/TreeList/__tests__/TreeListRowNames.a11y.chromium.spec.ts +1 -0
- package/src/__tests__/CardPress.a11y.chromium.spec.ts +1 -0
- package/src/__tests__/DisabledTriggerFocus.a11y.chromium.spec.ts +1 -0
- package/src/__tests__/PressedState.a11y.chromium.spec.ts +1 -0
- package/src/hooks/AnnounceRenderedText.tsx +27 -0
- package/src/hooks/__tests__/MenuPressShadowRoot.a11y.chromium.spec.ts +1 -0
- package/src/hooks/useAnnounceRenderedText.adopters.test.tsx +204 -0
- package/src/hooks/useAnnounceRenderedText.ts +81 -11
- package/src/hooks/useFocusTrap.test.tsx +71 -2
- package/src/hooks/useFocusTrap.ts +46 -21
- package/src/hooks/useMenuPress.ts +60 -34
- package/src/hooks/useScrollableArea.test.tsx +159 -0
- package/src/hooks/useScrollableArea.ts +39 -5
- package/src/reset.a11y.chromium.spec.ts +1 -0
- package/src/reset.until-found.a11y.browser.spec.ts +1 -0
- package/src/serverSafeComponents.test.ts +10 -0
- package/src/theme/__tests__/SpacingRootFontSize.a11y.chromium.spec.ts +1 -0
- package/src/theme/index.ts +3 -0
- package/src/theme/themeAdaptations.test.ts +37 -0
- package/src/theme/themeAdaptations.ts +43 -1
- package/src/utils/edgeAutoscroll.test.ts +192 -0
- package/src/utils/edgeAutoscroll.ts +111 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposer.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ChatComposer.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgC5C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEtE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAC7C,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,GAAG,UAAU,CACxB;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,+CAA+C;IAC/C,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,kFAAkF;IAClF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB;IACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAI3B,6GAA6G;IAC7G,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,yHAAyH;IACzH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,yGAAyG;IACzG,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gHAAgH;IAChH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,gHAAgH;IAChH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,gDAAgD;IAChD,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,iEAAiE;IACjE,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,oDAAoD;IACpD,cAAc,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;CACnC;AAkND;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAmOpD;yBAnOe,YAAY"}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* - /apps/storybook/stories/ChatComposer.stories.tsx
|
|
23
23
|
* - /packages/cli/assets/templates/blocks/components/ChatComposer/ (block examples)
|
|
24
24
|
*/
|
|
25
|
-
import React, { useState, useCallback,
|
|
25
|
+
import React, { useState, useCallback, useRef, useMemo } from 'react';
|
|
26
26
|
import * as stylex from '@stylexjs/stylex';
|
|
27
27
|
import "../theme/tokens.stylex.js";
|
|
28
28
|
import { colorVars, spacingVars, radiusVars, shadowVars, durationVars, easeVars, borderVars, typeScaleVars, typographyVars } from "../theme/tokens.stylex.js";
|
|
@@ -33,7 +33,7 @@ import { ChatComposerContext } from "./ChatContext.js";
|
|
|
33
33
|
import { ChatSendButton } from "./ChatSendButton.js";
|
|
34
34
|
import { themeProps } from "../utils/themeProps.js";
|
|
35
35
|
import { useTranslator } from "../i18n/index.js";
|
|
36
|
-
import {
|
|
36
|
+
import { useAnnounceRenderedText } from "../hooks/useAnnounceRenderedText.js";
|
|
37
37
|
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
38
38
|
import { getInteractionModality, useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
39
39
|
|
|
@@ -194,28 +194,18 @@ export function ChatComposer(props) {
|
|
|
194
194
|
}, []);
|
|
195
195
|
|
|
196
196
|
// The status bar mounts together with its message, and a live region born
|
|
197
|
-
// holding its text is not reliably announced, so the
|
|
198
|
-
// the
|
|
199
|
-
//
|
|
200
|
-
//
|
|
201
|
-
//
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (!statusMessage) {
|
|
208
|
-
announcedStatusRef.current = null;
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
const occasion = `${statusType}\u0000${statusMessage}`;
|
|
212
|
-
if (announcedStatusRef.current === occasion) {
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
announcedStatusRef.current = occasion;
|
|
216
|
-
announce(statusMessage, statusType === 'error' ? 'assertive' : 'polite');
|
|
217
|
-
}, [announce, statusType, statusMessage]);
|
|
197
|
+
// holding its text is not reliably announced, so the shared own-content
|
|
198
|
+
// module announces what the bar renders: errors assertively, warnings
|
|
199
|
+
// politely, once per occasion, silent for a status already shown when the
|
|
200
|
+
// page loads (spec:AST-086 FR2, FR5, FR6, FR11; react-component-runtime
|
|
201
|
+
// INV10). Changing the status type is a new occasion; clearing it re-arms.
|
|
202
|
+
const statusRef = useRef(null);
|
|
203
|
+
useAnnounceRenderedText(statusRef, Boolean(status?.message), status?.type ?? '', {
|
|
204
|
+
skipFirstRender: true,
|
|
205
|
+
politeness: status?.type === 'error' ? 'assertive' : 'polite'
|
|
206
|
+
});
|
|
218
207
|
const statusEl = status ? /*#__PURE__*/_jsxs("div", {
|
|
208
|
+
ref: statusRef,
|
|
219
209
|
...{
|
|
220
210
|
0: {
|
|
221
211
|
className: "x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x1htvmrp xvpcij2 xckg3cf xkvxy4d x6k0y1c"
|
|
@@ -20,6 +20,14 @@ export interface CodeBlockProps extends BaseProps<HTMLPreElement> {
|
|
|
20
20
|
isDiff?: boolean;
|
|
21
21
|
hasCopyButton?: boolean;
|
|
22
22
|
onCopy?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Your own controls, shown just before Copy: in the header when the block
|
|
25
|
+
* has one, otherwise beside the code in the top inline-end corner, never
|
|
26
|
+
* over it. It never creates a header, and activating it never collapses the
|
|
27
|
+
* block. You own each control's label, state, and action; ghost `sm`
|
|
28
|
+
* IconButtons match Copy.
|
|
29
|
+
*/
|
|
30
|
+
endContent?: React.ReactNode;
|
|
23
31
|
isWrapped?: boolean;
|
|
24
32
|
maxHeight?: number | string;
|
|
25
33
|
isCollapsible?: boolean;
|
|
@@ -67,7 +75,7 @@ export interface CodeBlockProps extends BaseProps<HTMLPreElement> {
|
|
|
67
75
|
* <CodeBlock code="const x = 42;" language="javascript" />
|
|
68
76
|
* ```
|
|
69
77
|
*/
|
|
70
|
-
export declare function CodeBlock({ code, language, title, hasLanguageLabel, hasLineNumbers, highlightLines, isDiff, hasCopyButton, onCopy, isWrapped, maxHeight, isCollapsible, collapsibleThreshold, size, width: widthProp, container, tokenizer: customTokenizer, highlightMode, syntaxTheme, xstyle, className, style, ref, ...props }: CodeBlockProps): React.JSX.Element;
|
|
78
|
+
export declare function CodeBlock({ code, language, title, hasLanguageLabel, hasLineNumbers, highlightLines, isDiff, hasCopyButton, onCopy, endContent, isWrapped, maxHeight, isCollapsible, collapsibleThreshold, size, width: widthProp, container, tokenizer: customTokenizer, highlightMode, syntaxTheme, xstyle, className, style, ref, ...props }: CodeBlockProps): React.JSX.Element;
|
|
71
79
|
export declare namespace CodeBlock {
|
|
72
80
|
var displayName: string;
|
|
73
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgC5C,OAAO,EAAc,KAAK,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAuexE,MAAM,WAAW,cAAe,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,CACV,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAClD,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC5C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AA0SD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAsB,EACtB,KAAK,EACL,gBAAuB,EACvB,cAAsB,EACtB,cAAc,EACd,MAAc,EACd,aAAoB,EACpB,MAAM,EACN,UAAU,EACV,SAAiB,EACjB,SAAS,EACT,aAAqB,EACrB,oBAAyB,EACzB,IAAW,EACX,KAAK,EAAE,SAAyB,EAChC,SAAkB,EAClB,SAAS,EAAE,eAAe,EAC1B,aAAsB,EACtB,WAAW,EACX,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,cAAc,qBAsShB;yBAhUe,SAAS"}
|
|
@@ -12,8 +12,8 @@ import { useInsertionEffect, useEffect, useId, useRef, useState, useCallback, us
|
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import * as stylex from '@stylexjs/stylex';
|
|
14
14
|
import "../theme/tokens.stylex.js";
|
|
15
|
-
import { colorVars, spacingVars, radiusVars, typographyVars, fontWeightVars, typeScaleVars, borderVars, durationVars, easeVars
|
|
16
|
-
import { mergeProps } from "../utils/index.js";
|
|
15
|
+
import { colorVars, spacingVars, radiusVars, typographyVars, fontWeightVars, typeScaleVars, borderVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
16
|
+
import { isRenderable, mergeProps } from "../utils/index.js";
|
|
17
17
|
import { useClipboard } from "../hooks/useClipboard.js";
|
|
18
18
|
import { useScrollableArea } from "../hooks/useScrollableArea.js";
|
|
19
19
|
import { Icon } from "../Icon/index.js";
|
|
@@ -219,19 +219,6 @@ const styles = {
|
|
|
219
219
|
copyButton: {
|
|
220
220
|
kMwMTN: "x1mjzq1q",
|
|
221
221
|
$$css: true
|
|
222
|
-
},
|
|
223
|
-
copyButtonCorner: {
|
|
224
|
-
kSGwAc: "x1y8v6su",
|
|
225
|
-
kUOVxO: "x16j26i2",
|
|
226
|
-
$$css: true
|
|
227
|
-
},
|
|
228
|
-
copyButtonCornerMd: {
|
|
229
|
-
keoZOQ: "x11xk4k4",
|
|
230
|
-
$$css: true
|
|
231
|
-
},
|
|
232
|
-
copyButtonCornerSm: {
|
|
233
|
-
keoZOQ: "x1t6j4wq",
|
|
234
|
-
$$css: true
|
|
235
222
|
}
|
|
236
223
|
};
|
|
237
224
|
|
|
@@ -556,6 +543,7 @@ export function CodeBlock({
|
|
|
556
543
|
isDiff = false,
|
|
557
544
|
hasCopyButton = true,
|
|
558
545
|
onCopy,
|
|
546
|
+
endContent,
|
|
559
547
|
isWrapped = false,
|
|
560
548
|
maxHeight,
|
|
561
549
|
isCollapsible = false,
|
|
@@ -646,6 +634,11 @@ export function CodeBlock({
|
|
|
646
634
|
const scrollStyle = maxHeight != null ? {
|
|
647
635
|
maxHeight: typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight
|
|
648
636
|
} : undefined;
|
|
637
|
+
|
|
638
|
+
// Caller controls render before Copy; together they are the block's controls,
|
|
639
|
+
// in the header when there is one and in the corner cluster otherwise.
|
|
640
|
+
const hasEndContent = isRenderable(endContent);
|
|
641
|
+
const hasControls = hasCopyButton || hasEndContent;
|
|
649
642
|
const copyButtonEl = hasCopyButton ? /*#__PURE__*/_jsx(IconButton, {
|
|
650
643
|
variant: "ghost",
|
|
651
644
|
size: "sm",
|
|
@@ -666,7 +659,7 @@ export function CodeBlock({
|
|
|
666
659
|
e.stopPropagation();
|
|
667
660
|
void handleCopy();
|
|
668
661
|
},
|
|
669
|
-
xstyle:
|
|
662
|
+
xstyle: styles.copyButton,
|
|
670
663
|
...themeProps('code-block-copy-button')
|
|
671
664
|
}) : null;
|
|
672
665
|
const headerEl = showHeader ? /*#__PURE__*/_jsxs("div", {
|
|
@@ -715,7 +708,12 @@ export function CodeBlock({
|
|
|
715
708
|
})
|
|
716
709
|
}), title, title && languageLabel ? ' — ' : '', languageLabel]
|
|
717
710
|
})
|
|
718
|
-
}),
|
|
711
|
+
}), hasControls ? /*#__PURE__*/_jsxs("div", {
|
|
712
|
+
...{
|
|
713
|
+
className: "x78zum5 x6s0dn4 xzye2dw x2lah0s"
|
|
714
|
+
},
|
|
715
|
+
children: [hasEndContent ? endContent : null, copyButtonEl]
|
|
716
|
+
}) : null]
|
|
719
717
|
}) : null;
|
|
720
718
|
const codeBody = /*#__PURE__*/_jsx("div", {
|
|
721
719
|
...getViewportProps({
|
|
@@ -761,7 +759,7 @@ export function CodeBlock({
|
|
|
761
759
|
size,
|
|
762
760
|
language,
|
|
763
761
|
container
|
|
764
|
-
}), stylex.props(styles.root,
|
|
762
|
+
}), stylex.props(styles.root, hasControls && !showHeader && styles.rootCorner, dynamicStyles.width(widthProp), containerStyles[container], xstyle), className, style),
|
|
765
763
|
...props,
|
|
766
764
|
children: [headerEl, canCollapse ? /*#__PURE__*/_jsx("div", {
|
|
767
765
|
id: regionId
|
|
@@ -786,7 +784,17 @@ export function CodeBlock({
|
|
|
786
784
|
},
|
|
787
785
|
children: codeBody
|
|
788
786
|
})
|
|
789
|
-
}) : codeBody, !showHeader
|
|
787
|
+
}) : codeBody, hasControls && !showHeader ? /*#__PURE__*/_jsxs("div", {
|
|
788
|
+
...{
|
|
789
|
+
0: {
|
|
790
|
+
className: "x78zum5 x6s0dn4 xzye2dw x1y8v6su x16j26i2 xlgwz2i"
|
|
791
|
+
},
|
|
792
|
+
1: {
|
|
793
|
+
className: "x78zum5 x6s0dn4 xzye2dw x1y8v6su x16j26i2 x166xdbf"
|
|
794
|
+
}
|
|
795
|
+
}[!!(size === 'sm') << 0],
|
|
796
|
+
children: [hasEndContent ? endContent : null, copyButtonEl]
|
|
797
|
+
}) : null]
|
|
790
798
|
});
|
|
791
799
|
return syntaxTheme ? /*#__PURE__*/_jsx(SyntaxTheme, {
|
|
792
800
|
theme: syntaxTheme,
|
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
* while preserving explicit prop/theme padding overrides, and fade in without
|
|
13
13
|
* the centered-dialog translate/scale motion.
|
|
14
14
|
*
|
|
15
|
+
* Under reduced motion the entrance never travels or scales
|
|
16
|
+
* (docs/design/reduced-motion.md): on a touch screen the dialog fades in
|
|
17
|
+
* where it lands, in 200 ms or less; with a mouse it appears at once.
|
|
18
|
+
*
|
|
15
19
|
* Initial focus and the focus returned on close follow the last input
|
|
16
20
|
* (docs/architecture/interaction-modality.md INV1): the shared focus indicator
|
|
17
21
|
* is hidden after a pointer press and shown after a key press.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA2B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAMhD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAyB9C;;;;;;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;AAuBD,2FAA2F;AAC3F,eAAO,MAAM,uCAAuC;;;;;;;;;;;CAW1C,CAAC;AAqKX;;;;;;;;;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,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,sCA+Vb;yBA/We,MAAM"}
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
* while preserving explicit prop/theme padding overrides, and fade in without
|
|
17
17
|
* the centered-dialog translate/scale motion.
|
|
18
18
|
*
|
|
19
|
+
* Under reduced motion the entrance never travels or scales
|
|
20
|
+
* (docs/design/reduced-motion.md): on a touch screen the dialog fades in
|
|
21
|
+
* where it lands, in 200 ms or less; with a mouse it appears at once.
|
|
22
|
+
*
|
|
19
23
|
* Initial focus and the focus returned on close follow the last input
|
|
20
24
|
* (docs/architecture/interaction-modality.md INV1): the shared focus indicator
|
|
21
25
|
* is hidden after a pointer press and shown after a key press.
|
|
@@ -133,15 +137,15 @@ const styles = {
|
|
|
133
137
|
kZKoxP: "xg7h5cd",
|
|
134
138
|
kZeWKH: "xish69e",
|
|
135
139
|
kSiTet: "xg01cxk",
|
|
136
|
-
k44tkh: "xqgcaz",
|
|
137
|
-
kyAemX: "x128ha8g",
|
|
140
|
+
k44tkh: "xqgcaz x1jq6yc9",
|
|
141
|
+
kyAemX: "x128ha8g xr5m3f0",
|
|
138
142
|
kWV6AL: "xskzprw",
|
|
139
143
|
$$css: true
|
|
140
144
|
},
|
|
141
145
|
open: {
|
|
142
146
|
k1xSpc: "x78zum5",
|
|
143
147
|
kSiTet: "x1hc1fzr",
|
|
144
|
-
kKVMdj: "x1ewfqum
|
|
148
|
+
kKVMdj: "x1ewfqum x6mpr79 xtuz6mp",
|
|
145
149
|
$$css: true
|
|
146
150
|
},
|
|
147
151
|
backdrop: {
|
|
@@ -160,7 +164,7 @@ const styles = {
|
|
|
160
164
|
$$css: true
|
|
161
165
|
},
|
|
162
166
|
fullscreenOpen: {
|
|
163
|
-
kKVMdj: "xqcmdr3
|
|
167
|
+
kKVMdj: "xqcmdr3 x6mpr79 xtuz6mp",
|
|
164
168
|
$$css: true
|
|
165
169
|
},
|
|
166
170
|
fullscreenSafeArea: {
|
|
@@ -441,7 +445,10 @@ export function Dialog({
|
|
|
441
445
|
escapeBehavior: allowEscape ? 'close' : 'block',
|
|
442
446
|
onDismiss: () => {
|
|
443
447
|
onOpenChange(false);
|
|
444
|
-
}
|
|
448
|
+
},
|
|
449
|
+
// The dialog's document is this layer's: rendered into an iframe or a
|
|
450
|
+
// Picture-in-Picture window, it ranks with the layers opened inside it.
|
|
451
|
+
getContainer: () => dialogRef.current
|
|
445
452
|
});
|
|
446
453
|
|
|
447
454
|
// Dev-time guardrail: an open modal should always have an accessible name.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file EmptyState.tsx
|
|
3
|
-
* @input Uses React, HTMLAttributes
|
|
3
|
+
* @input Uses React, HTMLAttributes, AnnounceRenderedText
|
|
4
4
|
* @output Exports EmptyState component, EmptyStateProps type
|
|
5
5
|
* @position Core implementation; consumed by index.ts
|
|
6
6
|
*
|
|
@@ -53,7 +53,9 @@ export interface EmptyStateProps extends BaseProps<HTMLDivElement> {
|
|
|
53
53
|
* An empty state placeholder for content areas with no data.
|
|
54
54
|
* Displays an icon or illustration, title, optional description, and action buttons.
|
|
55
55
|
*
|
|
56
|
-
*
|
|
56
|
+
* Not a live region. Its title and description are announced once when they
|
|
57
|
+
* appear or change after the page loaded, never when the page first renders
|
|
58
|
+
* with them (`spec:AST-086` FR2).
|
|
57
59
|
* Styles use Astryx theme tokens via StyleX. Wrap your app in <Theme> to apply a theme.
|
|
58
60
|
*
|
|
59
61
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAgB,MAAM,OAAO,CAAC;AAQpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAgB,MAAM,OAAO,CAAC;AAQpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA6D5C,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,YAAgB,EAChB,SAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+BAmDjB;yBA/De,UAAU"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file EmptyState.tsx
|
|
5
|
-
* @input Uses React, HTMLAttributes
|
|
5
|
+
* @input Uses React, HTMLAttributes, AnnounceRenderedText
|
|
6
6
|
* @output Exports EmptyState component, EmptyStateProps type
|
|
7
7
|
* @position Core implementation; consumed by index.ts
|
|
8
8
|
*
|
|
@@ -18,6 +18,7 @@ import { createElement } from 'react';
|
|
|
18
18
|
import * as stylex from '@stylexjs/stylex';
|
|
19
19
|
import "../theme/tokens.stylex.js";
|
|
20
20
|
import { colorVars, spacingVars, fontWeightVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
21
|
+
import { AnnounceRenderedText } from "../hooks/AnnounceRenderedText.js";
|
|
21
22
|
import { isRenderable, mergeProps } from "../utils/index.js";
|
|
22
23
|
import { themeProps } from "../utils/themeProps.js";
|
|
23
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -44,7 +45,9 @@ const styles = {
|
|
|
44
45
|
* An empty state placeholder for content areas with no data.
|
|
45
46
|
* Displays an icon or illustration, title, optional description, and action buttons.
|
|
46
47
|
*
|
|
47
|
-
*
|
|
48
|
+
* Not a live region. Its title and description are announced once when they
|
|
49
|
+
* appear or change after the page loaded, never when the page first renders
|
|
50
|
+
* with them (`spec:AST-086` FR2).
|
|
48
51
|
* Styles use Astryx theme tokens via StyleX. Wrap your app in <Theme> to apply a theme.
|
|
49
52
|
*
|
|
50
53
|
* @example
|
|
@@ -78,14 +81,13 @@ export function EmptyState({
|
|
|
78
81
|
return /*#__PURE__*/_jsxs("div", {
|
|
79
82
|
ref: ref,
|
|
80
83
|
...props,
|
|
81
|
-
role: "status",
|
|
82
84
|
...mergeProps(themeProps('empty-state', {
|
|
83
85
|
variant: isCompact ? 'compact' : null
|
|
84
86
|
}), stylex.props(styles.container, isCompact && styles.containerCompact, xstyle), className, style),
|
|
85
87
|
children: [isRenderable(icon) && /*#__PURE__*/_jsx("div", {
|
|
86
88
|
"aria-hidden": "true",
|
|
87
89
|
children: icon
|
|
88
|
-
}), /*#__PURE__*/_jsxs(
|
|
90
|
+
}), /*#__PURE__*/_jsxs(AnnounceRenderedText, {
|
|
89
91
|
...{
|
|
90
92
|
className: "x78zum5 xdt5ytf x6s0dn4 xxc7z9f"
|
|
91
93
|
},
|
|
@@ -32,29 +32,33 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
32
32
|
*
|
|
33
33
|
* Each entry disables its keyframe animation under
|
|
34
34
|
* `prefers-reduced-motion: reduce` so the layer appears instantly instead of
|
|
35
|
-
* translating/scaling in (infra-6).
|
|
35
|
+
* translating/scaling in (infra-6). Under a finger (the primary pointer is
|
|
36
|
+
* coarse) it fades in instead, opacity only and in 200 ms or less: on a touch
|
|
37
|
+
* screen Reduce Motion replaces motion with a cross-fade rather than a jump
|
|
38
|
+
* (design:reduced-motion DR2, DR3), as iOS does for its menus, popovers and
|
|
39
|
+
* tips.
|
|
36
40
|
*/
|
|
37
41
|
export declare const layerAnimations: Readonly<{
|
|
38
42
|
readonly below: Readonly<{
|
|
39
|
-
readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration",
|
|
43
|
+
readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration", string>;
|
|
40
44
|
readonly animationTimingFunction: stylex.StyleXClassNameFor<"animationTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
41
45
|
readonly animationFillMode: stylex.StyleXClassNameFor<"animationFillMode", "backwards">;
|
|
42
46
|
readonly animationName: stylex.StyleXClassNameFor<"animationName", string>;
|
|
43
47
|
}>;
|
|
44
48
|
readonly above: Readonly<{
|
|
45
|
-
readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration",
|
|
49
|
+
readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration", string>;
|
|
46
50
|
readonly animationTimingFunction: stylex.StyleXClassNameFor<"animationTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
47
51
|
readonly animationFillMode: stylex.StyleXClassNameFor<"animationFillMode", "backwards">;
|
|
48
52
|
readonly animationName: stylex.StyleXClassNameFor<"animationName", string>;
|
|
49
53
|
}>;
|
|
50
54
|
readonly end: Readonly<{
|
|
51
|
-
readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration",
|
|
55
|
+
readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration", string>;
|
|
52
56
|
readonly animationTimingFunction: stylex.StyleXClassNameFor<"animationTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
53
57
|
readonly animationFillMode: stylex.StyleXClassNameFor<"animationFillMode", "backwards">;
|
|
54
58
|
readonly animationName: stylex.StyleXClassNameFor<"animationName", string>;
|
|
55
59
|
}>;
|
|
56
60
|
readonly start: Readonly<{
|
|
57
|
-
readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration",
|
|
61
|
+
readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration", string>;
|
|
58
62
|
readonly animationTimingFunction: stylex.StyleXClassNameFor<"animationTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
59
63
|
readonly animationFillMode: stylex.StyleXClassNameFor<"animationFillMode", "backwards">;
|
|
60
64
|
readonly animationName: stylex.StyleXClassNameFor<"animationName", string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerAnimations.stylex.d.ts","sourceRoot":"","sources":["../../src/Layer/layerAnimations.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"layerAnimations.stylex.d.ts","sourceRoot":"","sources":["../../src/Layer/layerAnimations.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AA0E3C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;EAmC1B,CAAC"}
|
|
@@ -41,8 +41,17 @@ const enterStart = "xu7jd1z-B";
|
|
|
41
41
|
// (translateY) entrances are direction-neutral and are left as-is.
|
|
42
42
|
const enterEndRtl = "xu7jd1z-B";
|
|
43
43
|
const enterStartRtl = "xwmkjkf-B";
|
|
44
|
+
|
|
45
|
+
// Reduce Motion under a finger: the same entrance without its travel. A touch
|
|
46
|
+
// presentation substitutes a cross-fade for motion, never a jump.
|
|
47
|
+
const fadeIn = "x18re5ia-B";
|
|
44
48
|
const animationBase = {
|
|
45
|
-
animationDuration:
|
|
49
|
+
animationDuration: {
|
|
50
|
+
default: durationVars['--duration-fast-max'],
|
|
51
|
+
// The cross-fade is 200 ms or less, whatever the theme's duration
|
|
52
|
+
// (design:reduced-motion DR2).
|
|
53
|
+
'@media (prefers-reduced-motion: reduce) and (pointer: coarse)': `min(${durationVars['--duration-fast-max']}, 200ms)`
|
|
54
|
+
},
|
|
46
55
|
animationTimingFunction: easeVars['--ease-standard'],
|
|
47
56
|
animationFillMode: 'backwards'
|
|
48
57
|
};
|
|
@@ -55,33 +64,37 @@ const animationBase = {
|
|
|
55
64
|
*
|
|
56
65
|
* Each entry disables its keyframe animation under
|
|
57
66
|
* `prefers-reduced-motion: reduce` so the layer appears instantly instead of
|
|
58
|
-
* translating/scaling in (infra-6).
|
|
67
|
+
* translating/scaling in (infra-6). Under a finger (the primary pointer is
|
|
68
|
+
* coarse) it fades in instead, opacity only and in 200 ms or less: on a touch
|
|
69
|
+
* screen Reduce Motion replaces motion with a cross-fade rather than a jump
|
|
70
|
+
* (design:reduced-motion DR2, DR3), as iOS does for its menus, popovers and
|
|
71
|
+
* tips.
|
|
59
72
|
*/
|
|
60
73
|
export const layerAnimations = {
|
|
61
74
|
below: {
|
|
62
|
-
kKVMdj: "xl1vlw0
|
|
63
|
-
k44tkh: "x9uej1z",
|
|
75
|
+
kKVMdj: "xl1vlw0 xa4pr1u xajy0lc",
|
|
76
|
+
k44tkh: "x9uej1z x13pi3j7",
|
|
64
77
|
kyAemX: "x128ha8g",
|
|
65
78
|
kWV6AL: "xskzprw",
|
|
66
79
|
$$css: true
|
|
67
80
|
},
|
|
68
81
|
above: {
|
|
69
|
-
kKVMdj: "x3psbcj
|
|
70
|
-
k44tkh: "x9uej1z",
|
|
82
|
+
kKVMdj: "x3psbcj xa4pr1u xajy0lc",
|
|
83
|
+
k44tkh: "x9uej1z x13pi3j7",
|
|
71
84
|
kyAemX: "x128ha8g",
|
|
72
85
|
kWV6AL: "xskzprw",
|
|
73
86
|
$$css: true
|
|
74
87
|
},
|
|
75
88
|
end: {
|
|
76
|
-
kKVMdj: "x1i331go x1vxsm5i
|
|
77
|
-
k44tkh: "x9uej1z",
|
|
89
|
+
kKVMdj: "x1i331go x1vxsm5i xa4pr1u xajy0lc",
|
|
90
|
+
k44tkh: "x9uej1z x13pi3j7",
|
|
78
91
|
kyAemX: "x128ha8g",
|
|
79
92
|
kWV6AL: "xskzprw",
|
|
80
93
|
$$css: true
|
|
81
94
|
},
|
|
82
95
|
start: {
|
|
83
|
-
kKVMdj: "xck01x9 x18lne9g
|
|
84
|
-
k44tkh: "x9uej1z",
|
|
96
|
+
kKVMdj: "xck01x9 x18lne9g xa4pr1u xajy0lc",
|
|
97
|
+
k44tkh: "x9uej1z x13pi3j7",
|
|
85
98
|
kyAemX: "x128ha8g",
|
|
86
99
|
kWV6AL: "xskzprw",
|
|
87
100
|
$$css: true
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file layerSlideRules.ts
|
|
3
3
|
* @input A layer's placement and alignment
|
|
4
|
-
* @output The `@position-try` rules for its slide options and their names
|
|
4
|
+
* @output The `@position-try` rules for its slide options and their names, and
|
|
5
|
+
* the beside and fit options of a layer that must never settle over its
|
|
6
|
+
* anchor
|
|
5
7
|
* @position Layer runtime geometry; the slide of spec:AST-059 FR4
|
|
6
8
|
*
|
|
7
9
|
* The slide is a position option whose area spans the whole alignment axis,
|
|
@@ -14,6 +16,23 @@
|
|
|
14
16
|
* gutter on both alignment-axis edges, and the clearance facing the anchor
|
|
15
17
|
* with the gutter on the far edge of the side it lands on.
|
|
16
18
|
*
|
|
19
|
+
* A layer that must never settle over its anchor (spec:AST-059 FR4, Tooltip)
|
|
20
|
+
* has a second fallback list, for when its settled box covers its anchor:
|
|
21
|
+
* content taller than the room above and below its trigger. `beside` lands on a
|
|
22
|
+
* side across the alignment axis, spanning the whole block axis, at the
|
|
23
|
+
* content's own inline size, so it fits only where the layer fits without
|
|
24
|
+
* squeezing. `fit` lands above or below sized to the room on that side, so
|
|
25
|
+
* overflow scrolls inside the layer, and is never smaller than half of the room
|
|
26
|
+
* the trigger leaves on the block axis, so it fits only on the side with more
|
|
27
|
+
* room; the list tries both only after the layer's own position, `beside` and
|
|
28
|
+
* the opposite side at the layer's own size, so only content taller than the
|
|
29
|
+
* room on both sides is sized to a room. No option is sized to whatever room
|
|
30
|
+
* is left: a browser keeps a layer on the option it last used for as long as
|
|
31
|
+
* that option still fits, so such an option would hold an open layer on a side
|
|
32
|
+
* shrunk to a sliver after its anchor moved. Chromium applies a position
|
|
33
|
+
* option's width and height properties but not their min/max forms, so the
|
|
34
|
+
* sizes are `inline-size` and `block-size`.
|
|
35
|
+
*
|
|
17
36
|
* The rules are static — the anchor clearance travels through a custom
|
|
18
37
|
* property — so one style sheet per document carries all of them. It is
|
|
19
38
|
* installed from a layout effect, before the layer's first paint, rather than
|
|
@@ -27,7 +46,48 @@ import type { LayerAlignment, LayerPlacement } from './useLayer.js';
|
|
|
27
46
|
export declare const LAYER_CLEARANCE_PROPERTY = "--_astryx-layer-clearance";
|
|
28
47
|
type Side = 'same' | 'opposite';
|
|
29
48
|
export declare function slideRuleName(placement: LayerPlacement, alignment: LayerAlignment, side: Side): string;
|
|
30
|
-
/**
|
|
49
|
+
/** The name of the `beside` option that lands on `side`, across the block axis. */
|
|
50
|
+
export declare function besideRuleName(side: 'start' | 'end'): string;
|
|
51
|
+
/**
|
|
52
|
+
* The name of the `fit` option that lands on `side` sized to the room there,
|
|
53
|
+
* which fits only while that side holds at least half of the room the trigger
|
|
54
|
+
* leaves on the block axis.
|
|
55
|
+
*/
|
|
56
|
+
export declare function fitRuleName(side: 'above' | 'below'): string;
|
|
57
|
+
/**
|
|
58
|
+
* The fallback list of a layer that must never settle over its anchor, once
|
|
59
|
+
* the standard list has failed it (FR4). After the layer's own position (the
|
|
60
|
+
* preferred block side, at its own size): beside the trigger on the inline
|
|
61
|
+
* end, then the inline start, then the opposite block side at its own size,
|
|
62
|
+
* and only then the preferred block side and the opposite one sized to the
|
|
63
|
+
* room there, each only while it is the roomier side. Every option before the
|
|
64
|
+
* last two keeps the layer at its own size, so a layer whose content fits
|
|
65
|
+
* somewhere is never stretched to a room; the last two are for content taller
|
|
66
|
+
* than the room on both sides. Chromium tries no more than five options, so
|
|
67
|
+
* this replaces the standard list rather than extending it. Side placements
|
|
68
|
+
* already slide along the block axis at full height, so they have none.
|
|
69
|
+
*/
|
|
70
|
+
export declare function getAnchorClearFallbacks(placement: LayerPlacement): string;
|
|
71
|
+
/** The custom property a layer writes its anchor-clear fallback list to. */
|
|
72
|
+
export declare const LAYER_CLEAR_FALLBACKS_PROPERTY = "--_astryx-layer-clear-fallbacks";
|
|
73
|
+
/** The custom property its `position-try-fallbacks` reads first. */
|
|
74
|
+
export declare const LAYER_TRY_FALLBACKS_PROPERTY = "--_astryx-layer-try-fallbacks";
|
|
75
|
+
/**
|
|
76
|
+
* The attribute the runtime sets on a layer whose settled box covered its
|
|
77
|
+
* anchor; it switches the layer to its anchor-clear list.
|
|
78
|
+
*/
|
|
79
|
+
export declare const LAYER_CLEARS_ANCHOR_ATTRIBUTE = "data-astryx-clears-anchor";
|
|
80
|
+
/**
|
|
81
|
+
* The attribute the runtime sets on a layer that keeps its anchor clear while
|
|
82
|
+
* its content overflows the box it was given; only then does it scroll, so a
|
|
83
|
+
* layer that fits stays a plain box and a wheel over it still scrolls the
|
|
84
|
+
* page.
|
|
85
|
+
*/
|
|
86
|
+
export declare const LAYER_SCROLLS_ATTRIBUTE = "data-astryx-layer-scrolls";
|
|
87
|
+
/**
|
|
88
|
+
* Every slide rule, for every placement and alignment, and the beside and fit
|
|
89
|
+
* rules.
|
|
90
|
+
*/
|
|
31
91
|
export declare function slideRulesCss(): string;
|
|
32
92
|
export declare const SLIDE_RULES_ID = "astryx-layer-slide-rules";
|
|
33
93
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerSlideRules.d.ts","sourceRoot":"","sources":["../../src/Layer/layerSlideRules.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"layerSlideRules.d.ts","sourceRoot":"","sources":["../../src/Layer/layerSlideRules.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AAG/D,kEAAkE;AAClE,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AAEpE,KAAK,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC;AAEhC,wBAAgB,aAAa,CAC3B,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,IAAI,GACT,MAAM,CAER;AAmFD,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAE3D;AA2CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,cAAc,GAAG,MAAM,CAMzE;AAED,4EAA4E;AAC5E,eAAO,MAAM,8BAA8B,oCAAoC,CAAC;AAEhF,oEAAoE;AACpE,eAAO,MAAM,4BAA4B,kCAAkC,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,6BAA6B,8BAA8B,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAUnE;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CActC;AAED,eAAO,MAAM,cAAc,6BAA6B,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAQpD"}
|