@astryx-vue/core 0.3.0 → 0.4.1
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/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-RAVA_cT1.js → AlertDialog-C2inDZWG.js} +5 -5
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-0wTvOo3H.js → AppShell-awAKicsc.js} +3 -3
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-pPZ4dI_s.js → Avatar-DXBjJ88C.js} +47 -34
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-B--NQSB3.js → AvatarGroup-kpAeKLNq.js} +57 -13
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-GbGxrqQO.js → Banner-BdvuyzAe.js} +71 -35
- package/dist/Blockquote/index.js +1 -1
- package/dist/Blockquote-DRoKdcxZ.js +27 -0
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-pt7m4CvC.js → BottomSheet-B4sc3F1S.js} +286 -140
- package/dist/{BottomSheet-JYMB_Ofl.js → BottomSheet-m54uCMJN.js} +20 -4
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/Breadcrumbs-D4ZzHEB0.js +223 -0
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-B6Hj_O_s.js → Button-ONOoHdkg.js} +25 -15
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/ButtonGroup-DnkSZ9a5.js +87 -0
- package/dist/{ButtonTooltip-nWWrth8j.js → ButtonTooltip-CNKOQHYR.js} +7 -4
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-B7vIowKq.js → Calendar-CjK-JUDM.js} +5 -5
- package/dist/Card/index.d.ts +2 -2
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-CA8zpD9v.js → Carousel-D262qigj.js} +8 -8
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-Bmna9EOA.js → Chat-DD_mlIP3.js} +165 -101
- package/dist/CheckboxIndicator/index.js +1 -1
- package/dist/{CheckboxIndicator-D37cm2Rh.js → CheckboxIndicator-fH4d-JE1.js} +9 -3
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-BS9J6edf.js → CheckboxInput-D8vTmAMZ.js} +20 -12
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-CX1i_jVP.js → CheckboxList-DCvHewHB.js} +155 -38
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-Djgwa0ko.js → Citation-C69BgxW3.js} +8 -3
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-DUsC-j03.js → ClickableCard-ChAfiw9T.js} +9 -6
- package/dist/Code/index.d.ts +1 -1
- package/dist/Code/index.js +3 -3
- package/dist/{Code-XnPuGxey.js → Code-Bg7GBdxy.js} +2 -1
- package/dist/{CodeBlock-D0BFubut.js → CodeBlock-DsbwTBiT.js} +8 -8
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-Cov3Pyq5.js → Collapsible-Bdj0WYpb.js} +13 -11
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-YHsUNg3V.js → CommandPalette-CZ7CZglZ.js} +147 -67
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-DWLdKPGI.js → ComplexSelector-CIz6DDmY.js} +114 -28
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-Bq9b3Ti5.js → ContextMenu-CxoiRh_h.js} +297 -179
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-DT518j5E.js → DateInput-C67HCOU-.js} +563 -72
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-Bqi5tlIA.js → DateRangeInput-Dsf5Tyf-.js} +91 -26
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/DateTimeInput-tfM1y5nZ.js +562 -0
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Dialog/index.js +2 -2
- package/dist/{Dialog-BiOSKQso.js → Dialog-DT1GzCrB.js} +28 -11
- package/dist/{Dialog-FGHfDu5M.js → Dialog-fhyxB00e.js} +32 -5
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Divider/index.js +1 -1
- package/dist/{Divider-BtwnL18I.js → Divider-mOZ6vIQw.js} +5 -1
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-CoOQVlRp.js → DropdownMenu-C6wBC18g.js} +84 -56
- package/dist/{DropdownMenu-DEb2dSSP.js → DropdownMenu-G-pWSiBk.js} +479 -264
- package/dist/{DropdownMenuRadioItem.vue-CXEURBcq.d.ts → DropdownMenuRadioItem.vue-Qd-8Rg4Q.d.ts} +236 -230
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-C_GH7IV5.js → EmptyState-CmOQf2SH.js} +2 -2
- package/dist/Field/index.d.ts +4 -3
- package/dist/Field/index.js +4 -3
- package/dist/{Field-D5gUEGw4.js → Field-JIxT3xCh.js} +5 -4
- package/dist/FieldIcon-BFSHZEs_.js +40 -0
- package/dist/{FieldInfoTip-Ds-sW_jY.js → FieldInfoTip-BbgLt4ug.js} +4 -4
- package/dist/{FieldLabel-BNeXRuGH.js → FieldLabel-CHqp1y3z.js} +13 -8
- package/dist/FieldStatus/index.d.ts +1 -1
- package/dist/FieldStatus/index.js +1 -1
- package/dist/{FieldStatus-MjY19ERl.js → FieldStatus-DaAB3TIt.js} +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-BpdiO1V8.js → FileInput-Bi1uty-F.js} +108 -31
- package/dist/FormLayout/index.d.ts +1 -1
- package/dist/FormLayout/index.js +1 -1
- package/dist/{FormLayout-D47FjiOq.js → FormLayout-B9dUB6Ps.js} +1 -1
- package/dist/Heading/index.d.ts +1 -1
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-BnwWEWkp.js → Heading-BzBunfN7.js} +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-ycY50pRN.js → HoverCard-BpJhT0sn.js} +35 -22
- package/dist/Icon/index.d.ts +4 -4
- package/dist/Icon/index.js +1 -1
- package/dist/{Icon-bteSId7T.js → Icon-KDnUyY7f.js} +12 -20
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-DDNgNl7B.js → IconButton-DI-XBbtV.js} +1 -1
- package/dist/Indicator/index.d.ts +2 -2
- package/dist/Indicator/index.js +2 -1
- package/dist/InputClearButton-CfSIqc-V.js +40 -0
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/InputGroup/index.js +2 -2
- package/dist/{InputGroup-CA03Smrs.js → InputGroup-D3F-QnET.js} +2 -2
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-DJay_w3B.js → InternationalizationProvider-CVV5QDgp.js} +5 -9
- package/dist/{Item-KhFKX9St.js → Item-DWMIjN8n.js} +34 -9
- package/dist/Kbd/index.js +1 -1
- package/dist/{Kbd-BB-Dw6zE.js → Kbd-CV3LO2Ge.js} +18 -2
- package/dist/LayerContentBoundary-CvsKxwwm.js +27 -0
- package/dist/LayerProvider/index.js +1 -1
- package/dist/{LayerProvider-D9NsQFzL.js → LayerProvider-B6zpMBWC.js} +15 -3
- package/dist/Layout/index.d.ts +1 -1
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-C6RHllr-.js → Layout-JJRCG7Mf.js} +1 -1
- package/dist/{LayoutPanel-DXOsaeQb.js → LayoutPanel-zM5vjrKS.js} +12 -8
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-DTF9EdTG.js → Lightbox-CjXhbDPc.js} +14 -12
- package/dist/Link/index.js +1 -1
- package/dist/{Link-BqHCtiyt.js → Link-ClNkTN1Q.js} +29 -12
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-8RWT8XAG.js → ListItem-BQXMu1Tb.js} +1 -1
- package/dist/Markdown/index.d.ts +5 -2
- package/dist/Markdown/index.js +4 -2
- package/dist/Markdown/parser/index.d.ts +4 -0
- package/dist/Markdown/parser/index.js +2 -0
- package/dist/Markdown/plugin-protocol/index.d.ts +35 -0
- package/dist/Markdown/plugin-protocol/index.js +107 -0
- package/dist/Markdown/plugin-renderer/index.d.ts +31 -0
- package/dist/Markdown/plugin-renderer/index.js +42 -0
- package/dist/{Markdown-CvtN7HnF.js → Markdown-EIBrwQrb.js} +195 -524
- package/dist/MediaTheme-DlLqYhDy.js +433 -0
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-B-OelQlt.js → MetadataList-DLlSLX1n.js} +15 -7
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-DxGz0xKA.js → MobileNavToggle-DgJYyzT6.js} +52 -17
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-Dlb7MLlW.js → MoreMenu-C8BEt6-O.js} +74 -61
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/MultiSelector-C7NCAtwW.js +1456 -0
- package/dist/{NavDisclosure-C_fugrQ3.js → NavDisclosure-Bq9DTZLO.js} +29 -7
- package/dist/{NavHeadingSurface-B3yJspSN.js → NavHeadingSurface-DQXisuaX.js} +29 -26
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +2 -2
- package/dist/{NavItem-BBIGSvDj.js → NavItem-BPb3yfgz.js} +17 -4
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NavMenu/index.js +3 -3
- package/dist/{NavMenu-ThXguZAz.js → NavMenu-BYIDzjix.js} +42 -15
- package/dist/{NavMenuItem-BvJNsDFC.js → NavMenuItem-D3FO90GR.js} +14 -12
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/NumberInput-3u3NZWnv.js +727 -0
- package/dist/Outline/index.d.ts +2 -2
- package/dist/Outline/index.js +2 -2
- package/dist/{Outline-755h-lMP.js → Outline-8szj9eXu.js} +91 -6
- package/dist/OverflowList/index.d.ts +2 -2
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-NmrSMbxb.js → OverflowList-BizpEwH8.js} +23 -6
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-DqwNQFRp.js → Pagination-Cihr1CjD.js} +2 -2
- package/dist/PickerWheel-CSwUYfes.js +69 -0
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-DJf8POzL.js → Popover-78dFjTb9.js} +20 -15
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-DvjiPqMZ.js → PowerSearch-BHx91ypY.js} +778 -590
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-CVLzdoBK.js → ProgressBar-VP4JS7vm.js} +10 -7
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-Bfu6JSNV.js → RadioGroup-DeSIRrgt.js} +94 -26
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-xY1cwLdZ.js → RadioList-Co2lmetC.js} +57 -8
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-q4nD_586.js → ResizeHandle-DjLZ2pcq.js} +103 -50
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/ScrollableArea/index.js +1 -1
- package/dist/{ScrollableArea-D4dCJv9I.js → ScrollableArea-0u6RWtGG.js} +1 -1
- package/dist/SegmentedControl/index.d.ts +1 -1
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-ChHmFrrC.js → SegmentedControl-D1wWGBZo.js} +11 -5
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-Cku4dRzc.js → SelectableCard-BEqnhPaX.js} +16 -11
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-swa3RNQI.js +1049 -0
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-BF8mYDxl.js → SideNav-BH6XKsW2.js} +56 -42
- package/dist/Slider/index.d.ts +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-DWobsPgm.js → Slider-DG2YXll8.js} +172 -46
- package/dist/Spinner/index.js +1 -1
- package/dist/Spinner-BY8iQz--.js +200 -0
- package/dist/Stack/index.js +2 -2
- package/dist/{Stack-CTsTFfar.js → Stack-Bb_h60t3.js} +1 -1
- package/dist/{Stack-kQlYbbL4.js → Stack-Bp-XN9J4.js} +12 -7
- package/dist/StatusDot/index.d.ts +1 -1
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-BPUhMOff.js → StatusDot-BS_ohXhd.js} +8 -4
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-CE8dHysu.js → Stepper-FtkTq5qR.js} +127 -113
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-DaVPRxvN.js → Switch-0JKvJluV.js} +38 -22
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-DIkK9sgK.js → TabList-cpjvnbhx.js} +205 -63
- package/dist/Table/index.d.ts +3 -3
- package/dist/Table/index.js +1 -1
- package/dist/{Table-fecqnm7P.js → Table-fWs_ZQBF.js} +735 -461
- package/dist/Text/index.d.ts +1 -1
- package/dist/Text/index.js +1 -1
- package/dist/{Text-CV3LmscH.js → Text-CmTOgYXf.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-Ab5Sw60T.js → TextArea-CwSfEjT1.js} +110 -50
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-zFT1_qgI.js → TextInput-CavITage.js} +71 -38
- package/dist/Theme/index.d.ts +3 -3
- package/dist/Theme/index.js +3 -2
- package/dist/Theme-BbDT8B_C.js +2125 -0
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-C3NnJUFG.js → Thumbnail-DpJnaNbg.js} +17 -14
- package/dist/{TimeField-CoHDGmsP.js → TimeField-DefNjDIT.js} +297 -40
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-D2k3Ux3p.js → TimeInput-j5vzN8MG.js} +78 -9
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-avMQk5DN.js → Timer-CH7GsEVu.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-xpQKCk0d.js → Timestamp-dtT4yADD.js} +9 -9
- package/dist/Toast/index.d.ts +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/Toast-igtJYSw0.js +685 -0
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-B-C-Q7XP.js → ToggleButton-cLjh9W-x.js} +5 -4
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-DsntTYhQ.js → Token-DhsAtAH6.js} +32 -17
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-B5C_qY7t.js → Tokenizer-BGdj78UK.js} +107 -23
- package/dist/Toolbar/index.d.ts +2 -2
- package/dist/Toolbar/index.js +1 -1
- package/dist/{Toolbar-BrgvvTCk.js → Toolbar-C0pMWL4S.js} +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{Tooltip-C4Vaqd3G.js → Tooltip-sAM8i1eO.js} +23 -19
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-Ciq0l1w7.js → TopNav-Dw0m387B.js} +23 -22
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-BUz-KZJd.js → TreeList-Bunn7u3T.js} +129 -46
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-JP9RT87x.js → Typeahead-DRyf2HEh.js} +123 -26
- package/dist/{TypeaheadMenu-DBW6rHeO.js → TypeaheadMenu-BY5__sPC.js} +141 -51
- package/dist/{announce-Cnio10Wk.js → announce-B210eJVf.js} +17 -2
- package/dist/characters-rcDbGt71.d.ts +29 -0
- package/dist/characters-wTnzjkkR.js +58 -0
- package/dist/{colorMode-CBgdgDSn.js → colorMode-BxqfDP4P.js} +1 -4
- package/dist/composables/index.d.ts +5 -4
- package/dist/composables/index.js +23 -18
- package/dist/{composables-CbKx9C1Y.js → composables-CnsDaMuU.js} +167 -197
- package/dist/context-B6UElI5X.js +5 -0
- package/dist/context-CM-cjGg_.js +1425 -0
- package/dist/{context-Cfjh8te1.js → context-Cfml4jaK.js} +5 -3
- package/dist/context-IvbU9c3T.js +8 -0
- package/dist/context-pjBxaMSh.js +28 -0
- package/dist/fieldParts--SyRZVQG.js +44 -0
- package/dist/fieldParts-LXpQMKE8.d.ts +27 -0
- package/dist/{focus-CpficIgf.js → focus-l8jVTcqd.js} +1 -1
- package/dist/hoverIntent-DMHGb85c.js +115 -0
- package/dist/{index-ClNU2Th8.d.ts → index-3t5RAfNP.d.ts} +6 -2
- package/dist/{index-B9e52paP.d.ts → index-5LVG3QyV.d.ts} +1 -1
- package/dist/{index-CsNi1I8j.d.ts → index-B08-Uxhv.d.ts} +4 -2
- package/dist/{index-TXcNH86P.d.ts → index-B1eCxBCY.d.ts} +1 -1
- package/dist/{index-Cn-sSds-.d.ts → index-B1t1oQWH.d.ts} +24 -1
- package/dist/{index-BkjSF265.d.ts → index-BEZ4ezJk.d.ts} +3 -3
- package/dist/{index-yT1yiiww.d.ts → index-BI6jikpA.d.ts} +23 -11
- package/dist/{index-DeQwYJbg.d.ts → index-BNaRK-s5.d.ts} +10 -1
- package/dist/{index-D97pQbua.d.ts → index-BV2D2x_u.d.ts} +1 -1
- package/dist/{index-Crp3NFLW.d.ts → index-BZKgbyN9.d.ts} +1 -1
- package/dist/{index-Bu8NA2SD.d.ts → index-BaxM-pFP.d.ts} +12 -3
- package/dist/{index-BVKivP59.d.ts → index-Bgk1Rj2A.d.ts} +32 -3
- package/dist/index-BkUkm6Al.d.ts +11 -0
- package/dist/index-Bo-ofFyg.d.ts +166 -0
- package/dist/{index-B1WJxt-n.d.ts → index-C-tFz2Yx.d.ts} +17 -7
- package/dist/{index-DWh2WC8W.d.ts → index-C4Cjz6OK.d.ts} +2 -2
- package/dist/{index-CqE4Bf3Q.d.ts → index-C732aNMY.d.ts} +18 -4
- package/dist/{index-B7yhzGUT.d.ts → index-C7sam-SB.d.ts} +2 -2
- package/dist/{index-BrJzFA5X.d.ts → index-C90l2rH1.d.ts} +1 -1
- package/dist/{index-vP0EtrJJ.d.ts → index-C9gAlDt_.d.ts} +6 -3
- package/dist/index-CKUfpmFL.d.ts +375 -0
- package/dist/{index-CL1T2j4y.d.ts → index-CL8JvxHW.d.ts} +3 -3
- package/dist/{index-IBAInumL.d.ts → index-CMme-xmL.d.ts} +19 -6
- package/dist/{index-gW0HW02U.d.ts → index-COxy6LEW.d.ts} +1 -1
- package/dist/{index-12QYAbiz.d.ts → index-CRrSHbok.d.ts} +3 -2
- package/dist/{index-B42oE_F-.d.ts → index-CT5OEUxd.d.ts} +17 -4
- package/dist/{index-DG52Bg0W.d.ts → index-CTf3SK0b.d.ts} +6 -0
- package/dist/{index-Cde5JvtX.d.ts → index-CUVmtB5-.d.ts} +13 -6
- package/dist/{index-DXpSFlPG.d.ts → index-CWaSYtk9.d.ts} +4 -4
- package/dist/{index-CVn0GBdB.d.ts → index-Ca8VIE4l.d.ts} +1 -1
- package/dist/{index-Cyb9Du5Z.d.ts → index-CfR2Z0uG.d.ts} +1 -1
- package/dist/{index-Byar3h1e.d.ts → index-D05JGsT3.d.ts} +6 -3
- package/dist/{index-hCpxKePE.d.ts → index-D5N9ikrS.d.ts} +1 -1
- package/dist/{index-CkKPMIeX.d.ts → index-D7XRtUTY.d.ts} +9 -0
- package/dist/{index-i0tNFWfz.d.ts → index-D8lv2BiD.d.ts} +3 -1
- package/dist/{index-TntQsADQ.d.ts → index-DEm3kRBO.d.ts} +4 -3
- package/dist/{index-0QGtSf3r.d.ts → index-DFLPv9io.d.ts} +4 -3
- package/dist/{index-C2nbK2AA.d.ts → index-DLAG3m9W.d.ts} +13 -3
- package/dist/{index-D41_xqjs.d.ts → index-DTuhnqHb.d.ts} +16 -9
- package/dist/{index-B3Fomy15.d.ts → index-DbiZvj1P.d.ts} +4 -4
- package/dist/{index-C5e-7Obr.d.ts → index-Dj1_1t3j.d.ts} +19 -6
- package/dist/{index-DIXAzTKL.d.ts → index-DxxudRgB.d.ts} +1 -1
- package/dist/{index-BhpAUzUr.d.ts → index-Dy746dfn.d.ts} +1 -1
- package/dist/{index-GI9xIV9l.d.ts → index-JL4auphT.d.ts} +2 -2
- package/dist/{index-DVmgNb78.d.ts → index-TA1zVibb.d.ts} +4 -4
- package/dist/{index-DUaLJO7l.d.ts → index-UA93Im7H.d.ts} +155 -109
- package/dist/{index-COgrQZIL.d.ts → index-YKCx03zD.d.ts} +2 -2
- package/dist/{index-XuAAcYiP.d.ts → index-f3d9cVtj.d.ts} +1 -1
- package/dist/{index-T2FOcOuI.d.ts → index-jOwU3YoR.d.ts} +400 -90
- package/dist/{index-CICeEoZV.d.ts → index-pNtfr-RW.d.ts} +1 -1
- package/dist/{index-B4OOtNP8.d.ts → index-pYh4gqgl.d.ts} +1 -1
- package/dist/index.d.ts +81 -75
- package/dist/index.js +150 -136
- package/dist/inlineSize-BNe8wggI.js +66 -0
- package/dist/inputPresentation-BOyHkCDr.js +62 -0
- package/dist/interactionModality-ACpTMhak.js +44 -0
- package/dist/isApplePlatform-B1ju6F5B.js +27 -0
- package/dist/isRenderable-BnKHIqfd.js +21 -0
- package/dist/layerDepth-CNDh-IHb.js +181 -0
- package/dist/link-DuuA2eCL.js +30 -0
- package/dist/loadCatalog-CsZFr9dg.js +424 -0
- package/dist/loadCatalog-opk5hs94.d.ts +803 -0
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +4 -3
- package/dist/locale-D1Z3K290.js +343 -0
- package/dist/modalOutlet-CUOcrhIu.js +56 -0
- package/dist/optionAction-Cg7xQLUA.d.ts +6 -0
- package/dist/{power-search-DrDfcoL1.d.ts → power-search-gHLIYXs5.d.ts} +2 -0
- package/dist/protocol-DHxY0NI8.js +113 -0
- package/dist/protocol-DwUmpC5G.d.ts +240 -0
- package/dist/publicParser-B6XMcsB2.d.ts +141 -0
- package/dist/publicParser-DWUMCx7j.js +1437 -0
- package/dist/resizableChannel-3vivrEcT.js +20 -0
- package/dist/safeUrl-CsvfcZ9m.js +54 -0
- package/dist/scopedProvide-C-Df7c15.js +30 -0
- package/dist/scrollKeyboardDelegation-D7cumnOl.js +238 -0
- package/dist/scrollLock-C3aT4-0z.js +102 -0
- package/dist/{searchResultMessage-hXXNOFJP.js → searchResultMessage-DtyScdZs.js} +5 -14
- package/dist/{semantic-CKH9XVqa.d.ts → semantic-BF_AjLvk.d.ts} +6 -3
- package/dist/slug-DAK6hdbr.js +17 -0
- package/dist/syntaxContext-DmIfNNtb.js +4 -0
- package/dist/triggerVariant-BsL8jMHs.js +16 -0
- package/dist/{types-0Q_SJv_F.d.ts → types-Bb7OGivY.d.ts} +6 -1
- package/dist/{types-CwyibrRB.d.ts → types-C5GQ2KCK.d.ts} +23 -3
- package/dist/{types-gKsEkk2g.d.ts → types-CsqwQkf1.d.ts} +143 -10
- package/dist/upstreamMap-ocuIRfI2.js +893 -0
- package/dist/{useAnchoredListbox-DwztMNjP.js → useAnchoredListbox-DGxxKHZb.js} +2 -2
- package/dist/{useAsyncSource-xpQovjV_.d.ts → useAsyncSource-aGzrvRkI.d.ts} +3 -0
- package/dist/{useClickableContainer-DyNpnSEa.js → useClickableContainer-CdGp_Cev.js} +1 -1
- package/dist/{useClipboard-BDfbEsWd.js → useClipboard-Dk8cS810.js} +1 -1
- package/dist/useHoverLayerDismiss-kYJ_NqL4.js +27 -0
- package/dist/{useIndicator-i1NORM7W.js → useIndicator-D9Y0dJsm.js} +5 -23
- package/dist/{useInputContainer-CpgDe2-4.js → useInputContainer-CLcYrby4.js} +1 -1
- package/dist/{useInputStatusIcon-DBOwxV4x.js → useInputStatusIcon-CWkCeMyX.js} +2 -2
- package/dist/useLayerMountTarget-BmZyeKWE.js +156 -0
- package/dist/{useListFocus-D0iOJl39.js → useListFocus-ChxLg0b4.js} +3 -2
- package/dist/{useMenuDrillIn-DzKGkTho.js → useMenuDrillIn-DhUnPvKs.js} +6 -5
- package/dist/useMenuHover-Djreu23i.js +170 -0
- package/dist/useMenuPress-8foxY8z4.js +764 -0
- package/dist/{useMergedRefs-CfHHlCsn.js → useMergedRefs-Cb6_w93m.js} +24 -4
- package/dist/{useNumberField-4-dIGVed.js → useNumberField-Dk1BE3-K.js} +3 -3
- package/dist/useOptionActionGrid-CkJcuvaU.js +97 -0
- package/dist/{usePositionedLayer-Cru9_00b.js → usePositionedLayer-B7cvG-_v.js} +43 -49
- package/dist/usePressFeedback-BJCpjEpv.js +319 -0
- package/dist/{useResizable-DDwPpPe6.d.ts → useResizable-1MHPNaRD.d.ts} +19 -1
- package/dist/{useResizable-B3ahKLoZ.js → useResizable-I3BCiLSL.js} +72 -40
- package/dist/useResolvedLabelHidden-B2rlWiaI.js +30 -0
- package/dist/{useRestoreFocus-Djw9RUIf.js → useRestoreFocus-XEKs5-gp.js} +49 -7
- package/dist/useScrollOverflow-DuMoGXmm.js +67 -0
- package/dist/useScrollableArea-BE8b3qm7.js +222 -0
- package/dist/{useTimeValue-6ufHM15W.js → useTimeValue-BJd0xBhG.js} +4 -22
- package/dist/useTranslator-PEXMxDpv.js +35 -0
- package/dist/{useTypeahead-PAK8lMYz.js → useTypeahead-BvtflkRk.js} +4 -5
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +5 -0
- package/dist/{utils-D33VQDnk.js → utils-ClVseK2w.js} +29 -2
- package/dist/utils-z3Q6BGIJ.js +819 -0
- package/locales/SOURCE.json +1 -1
- package/package.json +18 -2
- package/reset.css +364 -1
- package/styles/avatar-group.css +9 -1
- package/styles/badge.css +8 -5
- package/styles/banner.css +125 -26
- package/styles/blockquote.css +1 -0
- package/styles/bordered-control.css +1 -1
- package/styles/bottom-sheet.css +74 -6
- package/styles/breadcrumbs.css +16 -2
- package/styles/button-group.css +3 -1
- package/styles/button.css +53 -11
- package/styles/card.css +1 -1
- package/styles/chat.css +16 -6
- package/styles/checkbox-input.css +10 -0
- package/styles/clickable-card.css +10 -3
- package/styles/collapsible.css +12 -5
- package/styles/command-palette.css +29 -14
- package/styles/complex-selector.css +24 -5
- package/styles/context-menu.css +3 -3
- package/styles/date-input.css +111 -1
- package/styles/dialog-header.css +4 -1
- package/styles/dialog.css +7 -0
- package/styles/dropdown-menu.css +12 -3
- package/styles/field.css +5 -0
- package/styles/form-layout.css +1 -0
- package/styles/heading.css +18 -8
- package/styles/icon.css +9 -9
- package/styles/kbd.css +1 -1
- package/styles/layer.css +72 -0
- package/styles/list.css +9 -2
- package/styles/metadata-list.css +1 -0
- package/styles/mobile-nav.css +4 -1
- package/styles/multi-selector.css +48 -1
- package/styles/nav-item.css +9 -2
- package/styles/nav-menu.css +12 -2
- package/styles/number-input.css +9 -1
- package/styles/overflow-list.css +1 -1
- package/styles/popover.css +2 -1
- package/styles/power-search.css +5 -3
- package/styles/pressable.css +63 -22
- package/styles/progress-bar.css +15 -3
- package/styles/radio.css +16 -0
- package/styles/resize-handle.css +42 -0
- package/styles/segmented-control.css +12 -4
- package/styles/selector.css +53 -1
- package/styles/side-nav.css +19 -0
- package/styles/slider.css +4 -3
- package/styles/spinner.css +48 -42
- package/styles/stepper.css +58 -4
- package/styles/switch.css +26 -0
- package/styles/tab-list.css +132 -3
- package/styles/table.css +88 -11
- package/styles/text-area.css +7 -1
- package/styles/text-input.css +1 -1
- package/styles/text.css +6 -6
- package/styles/thumbnail.css +11 -3
- package/styles/time-input.css +8 -0
- package/styles/toast.css +37 -3
- package/styles/token.css +2 -2
- package/styles/tokenizer.css +1 -1
- package/styles/toolbar.css +4 -1
- package/styles/tree-list.css +1 -1
- package/styles/typeahead.css +34 -1
- package/styles.css +1 -0
- package/dist/Blockquote-DFqBv_oJ.js +0 -18
- package/dist/Breadcrumbs-DIm4figq.js +0 -141
- package/dist/ButtonGroup-ySQWanDP.js +0 -125
- package/dist/DateTimeInput-A7m2O3bg.js +0 -268
- package/dist/FieldIcon--NTgW5IU.js +0 -44
- package/dist/MultiSelector-BtAUfQ3t.js +0 -990
- package/dist/NumberInput-AZ9x3oja.js +0 -473
- package/dist/Selector-DJ2BhUTV.js +0 -677
- package/dist/Spinner-9cYUCnDy.js +0 -84
- package/dist/Theme-CtaUWo4g.js +0 -1246
- package/dist/Toast-BuqIZV5z.js +0 -322
- package/dist/context-4PuqD1Ic.js +0 -4
- package/dist/context-D5-MwxnN.js +0 -4
- package/dist/context-iABt_ueM.js +0 -976
- package/dist/index-BH9PzQ1F.d.ts +0 -87
- package/dist/link-C4_WogdF.js +0 -18
- package/dist/loadCatalog-BGHKG_9N.d.ts +0 -457
- package/dist/loadCatalog-CXKqEB9s.js +0 -877
- package/dist/locale-DgkZEMTn.js +0 -105
- package/dist/platform-B_9W_aHW.js +0 -33
- package/dist/scrollLock-BzIvIimL.js +0 -42
- package/dist/useMenuPress-D-FRNrBW.js +0 -573
- package/dist/useScrollableArea-DDk_CluT.js +0 -172
- /package/dist/{index-lgvUFSCO.d.ts → index-CryFtTT6.d.ts} +0 -0
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { t as useMediaQuery } from "./useMediaQuery-GMmgp28-.js";
|
|
2
|
+
import { n as themeContextKey, t as mediaThemeKey } from "./context-Cws_tXTr.js";
|
|
3
|
+
import { n as resolveLightDark, t as readColorMode } from "./colorMode-BxqfDP4P.js";
|
|
4
|
+
import { computed, createElementBlock, defineComponent, inject, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, ref, renderSlot, unref, useAttrs, useTemplateRef, watch } from "vue";
|
|
5
|
+
import "../styles/media-theme.css";
|
|
6
|
+
//#region src/Theme/dataTokens.ts
|
|
7
|
+
/**
|
|
8
|
+
* Data-visualization color defaults, by upstream name.
|
|
9
|
+
*
|
|
10
|
+
* The CSS lives in `@astryx-vue/themes/data.css`, which every theme entry
|
|
11
|
+
* imports; this is the same group for code that paints outside CSS, such as
|
|
12
|
+
* a canvas chart, and for checking a theme's `--color-data-*` overrides.
|
|
13
|
+
* `data.test.ts` keeps the two in sync.
|
|
14
|
+
*/
|
|
15
|
+
const DATA_TOKEN_DEFAULTS = {
|
|
16
|
+
"--color-data-categorical-blue": "light-dark(#0171E3, #0171E3)",
|
|
17
|
+
"--color-data-categorical-orange": "light-dark(#EB6E00, #EB6E00)",
|
|
18
|
+
"--color-data-categorical-purple": "light-dark(#6B1EFD, #6B1EFD)",
|
|
19
|
+
"--color-data-categorical-green": "light-dark(#0B991F, #0B991F)",
|
|
20
|
+
"--color-data-categorical-pink": "light-dark(#F351C0, #F351C0)",
|
|
21
|
+
"--color-data-categorical-cyan": "light-dark(#0171A4, #0171A4)",
|
|
22
|
+
"--color-data-categorical-red": "light-dark(#F5394F, #F5394F)",
|
|
23
|
+
"--color-data-categorical-teal": "light-dark(#08A3A3, #08A3A3)",
|
|
24
|
+
"--color-data-categorical-brown": "light-dark(#965E03, #965E03)",
|
|
25
|
+
"--color-data-categorical-indigo": "light-dark(#6F8AFF, #6F8AFF)",
|
|
26
|
+
"--color-data-neutral": "light-dark(#8494A3, #8C939B)",
|
|
27
|
+
"--color-data-blue-5": "light-dark(#02165E, #02165E)",
|
|
28
|
+
"--color-data-blue-4": "light-dark(#004CBC, #004CBC)",
|
|
29
|
+
"--color-data-blue-3": "light-dark(#2694FE, #2694FE)",
|
|
30
|
+
"--color-data-blue-2": "light-dark(#78BEFF, #78BEFF)",
|
|
31
|
+
"--color-data-blue-1": "light-dark(#DBECFF, #DBECFF)",
|
|
32
|
+
"--color-data-shamrock-5": "light-dark(#0B603D, #0B603D)",
|
|
33
|
+
"--color-data-shamrock-4": "light-dark(#138546, #138546)",
|
|
34
|
+
"--color-data-shamrock-3": "light-dark(#24BB5E, #24BB5E)",
|
|
35
|
+
"--color-data-shamrock-2": "light-dark(#8EF7AA, #8EF7AA)",
|
|
36
|
+
"--color-data-shamrock-1": "light-dark(#D6FEE4, #D6FEE4)",
|
|
37
|
+
"--color-data-orange-5": "light-dark(#A13F04, #A13F04)",
|
|
38
|
+
"--color-data-orange-4": "light-dark(#D66100, #D66100)",
|
|
39
|
+
"--color-data-orange-3": "light-dark(#FD9537, #FD9537)",
|
|
40
|
+
"--color-data-orange-2": "light-dark(#FDB876, #FDB876)",
|
|
41
|
+
"--color-data-orange-1": "light-dark(#FFE6CF, #FFE6CF)",
|
|
42
|
+
"--color-data-pink-5": "light-dark(#8E1073, #8E1073)",
|
|
43
|
+
"--color-data-pink-4": "light-dark(#D123A1, #D123A1)",
|
|
44
|
+
"--color-data-pink-3": "light-dark(#F989D3, #F989D3)",
|
|
45
|
+
"--color-data-pink-2": "light-dark(#FEADE3, #FEADE3)",
|
|
46
|
+
"--color-data-pink-1": "light-dark(#FCE3F4, #FCE3F4)",
|
|
47
|
+
"--color-data-purple-5": "light-dark(#3E0697, #3E0697)",
|
|
48
|
+
"--color-data-purple-4": "light-dark(#6B1EFD, #6B1EFD)",
|
|
49
|
+
"--color-data-purple-3": "light-dark(#9081FF, #9081FF)",
|
|
50
|
+
"--color-data-purple-2": "light-dark(#B3B0FE, #B3B0FE)",
|
|
51
|
+
"--color-data-purple-1": "light-dark(#E8E8FB, #E8E8FB)",
|
|
52
|
+
"--color-data-red-5": "light-dark(#9D0519, #9D0519)",
|
|
53
|
+
"--color-data-red-4": "light-dark(#D31130, #D31130)",
|
|
54
|
+
"--color-data-red-3": "light-dark(#FB7D87, #FB7D87)",
|
|
55
|
+
"--color-data-red-2": "light-dark(#FFB2B8, #FFB2B8)",
|
|
56
|
+
"--color-data-red-1": "light-dark(#FEE4E6, #FEE4E6)",
|
|
57
|
+
"--color-data-teal-5": "light-dark(#08767D, #08767D)",
|
|
58
|
+
"--color-data-teal-4": "light-dark(#0C9293, #0C9293)",
|
|
59
|
+
"--color-data-teal-3": "light-dark(#0DB7AF, #0DB7AF)",
|
|
60
|
+
"--color-data-teal-2": "light-dark(#6CE6D8, #6CE6D8)",
|
|
61
|
+
"--color-data-teal-1": "light-dark(#D7FCF8, #D7FCF8)",
|
|
62
|
+
"--color-data-yellow-5": "light-dark(#8A5001, #8A5001)",
|
|
63
|
+
"--color-data-yellow-4": "light-dark(#D69804, #D69804)",
|
|
64
|
+
"--color-data-yellow-3": "light-dark(#FBCE03, #FBCE03)",
|
|
65
|
+
"--color-data-yellow-2": "light-dark(#FCEC85, #FCEC85)",
|
|
66
|
+
"--color-data-yellow-1": "light-dark(#FDF6BA, #FDF6BA)",
|
|
67
|
+
"--color-data-gray-5": "light-dark(#25363F, #333338)",
|
|
68
|
+
"--color-data-gray-4": "light-dark(#5D6C7B, #666A72)",
|
|
69
|
+
"--color-data-gray-3": "light-dark(#AFB9C4, #B2B8BE)",
|
|
70
|
+
"--color-data-gray-2": "light-dark(#CCD3DB, #D0D3D6)",
|
|
71
|
+
"--color-data-gray-1": "light-dark(#F1F4F7, #F2F4F6)"
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/Theme/contrast.ts
|
|
75
|
+
const HEX = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
76
|
+
const RGB = /^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+)(%)?)?\s*\)$/i;
|
|
77
|
+
function parseColor(input) {
|
|
78
|
+
const value = input.trim().toLowerCase();
|
|
79
|
+
if (value === "transparent") return {
|
|
80
|
+
r: 0,
|
|
81
|
+
g: 0,
|
|
82
|
+
b: 0,
|
|
83
|
+
a: 0
|
|
84
|
+
};
|
|
85
|
+
const hex = HEX.exec(value);
|
|
86
|
+
if (hex?.[1]) {
|
|
87
|
+
const raw = hex[1];
|
|
88
|
+
const expanded = raw.length === 3 ? raw.split("").map((part) => part + part).join("") : raw;
|
|
89
|
+
const channels = expanded.length === 6 ? `${expanded}ff` : expanded;
|
|
90
|
+
return {
|
|
91
|
+
r: Number.parseInt(channels.slice(0, 2), 16),
|
|
92
|
+
g: Number.parseInt(channels.slice(2, 4), 16),
|
|
93
|
+
b: Number.parseInt(channels.slice(4, 6), 16),
|
|
94
|
+
a: Number.parseInt(channels.slice(6, 8), 16) / 255
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const rgb = RGB.exec(value);
|
|
98
|
+
if (!rgb) return null;
|
|
99
|
+
const alpha = rgb[4] == null ? 1 : rgb[5] === "%" ? Number.parseFloat(rgb[4]) / 100 : Number.parseFloat(rgb[4]);
|
|
100
|
+
return {
|
|
101
|
+
r: Number.parseFloat(rgb[1] ?? "0"),
|
|
102
|
+
g: Number.parseFloat(rgb[2] ?? "0"),
|
|
103
|
+
b: Number.parseFloat(rgb[3] ?? "0"),
|
|
104
|
+
a: alpha
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function channel(value) {
|
|
108
|
+
const scaled = value / 255;
|
|
109
|
+
return scaled <= .04045 ? scaled / 12.92 : ((scaled + .055) / 1.055) ** 2.4;
|
|
110
|
+
}
|
|
111
|
+
function relativeLuminance(color) {
|
|
112
|
+
return .2126 * channel(color.r) + .7152 * channel(color.g) + .0722 * channel(color.b);
|
|
113
|
+
}
|
|
114
|
+
/** WCAG contrast ratio. 1 is no contrast. */
|
|
115
|
+
function contrastRatio(foreground, background) {
|
|
116
|
+
const first = relativeLuminance(foreground);
|
|
117
|
+
const second = relativeLuminance(background);
|
|
118
|
+
const lighter = Math.max(first, second);
|
|
119
|
+
const darker = Math.min(first, second);
|
|
120
|
+
return (lighter + .05) / (darker + .05);
|
|
121
|
+
}
|
|
122
|
+
/** Paint `foreground` over an opaque `backdrop`. The result is opaque. */
|
|
123
|
+
function compositeOver(foreground, backdrop) {
|
|
124
|
+
const a = foreground.a;
|
|
125
|
+
return {
|
|
126
|
+
r: foreground.r * a + backdrop.r * (1 - a),
|
|
127
|
+
g: foreground.g * a + backdrop.g * (1 - a),
|
|
128
|
+
b: foreground.b * a + backdrop.b * (1 - a),
|
|
129
|
+
a: 1
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/** Ambient text counts as reading well on a surface at this contrast or more. */
|
|
133
|
+
const AMBIENT_READS_AT = 3;
|
|
134
|
+
/**
|
|
135
|
+
* Choose a media surface from the painted background.
|
|
136
|
+
*
|
|
137
|
+
* `off` means the ambient text already reads on that background at 3:1, so
|
|
138
|
+
* no inverted context is needed. Otherwise the side whose text color, the
|
|
139
|
+
* theme's `on-dark` or `on-light`, contrasts more wins. `null` means a color
|
|
140
|
+
* could not be read.
|
|
141
|
+
*/
|
|
142
|
+
function pickMediaMode(background, ambient, onDark, onLight) {
|
|
143
|
+
if (onDark === null || onLight === null) return null;
|
|
144
|
+
if (ambient !== null && contrastRatio(ambient, background) >= AMBIENT_READS_AT) return "off";
|
|
145
|
+
return contrastRatio(onDark, background) >= contrastRatio(onLight, background) ? "dark" : "light";
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/Theme/tokenName.ts
|
|
149
|
+
/** Unprefixed theme vocabulary: `--color-accent`, `--spacing-4`, `--font-size-base`. */
|
|
150
|
+
const THEME_TOKEN_PREFIX = /^--(?:color|font|text|radius|duration|ease|spacing|size|shadow|border|focus|heading)-/;
|
|
151
|
+
/** Accept `--color-accent`, `--astryx-color-accent`, or `color-accent`. */
|
|
152
|
+
function normalizeTokenName(name) {
|
|
153
|
+
const trimmed = name.trim();
|
|
154
|
+
if (trimmed.startsWith("--astryx-")) return trimmed;
|
|
155
|
+
if (trimmed.startsWith("--")) return `--astryx-${trimmed.slice(2)}`;
|
|
156
|
+
return `--astryx-${trimmed}`;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Whether a custom-property name belongs to the shared theme vocabulary,
|
|
160
|
+
* written either way: `--color-accent` or `--astryx-color-accent`.
|
|
161
|
+
*
|
|
162
|
+
* A theme-local token may not use one of these names, because the shared
|
|
163
|
+
* name already has a meaning every component reads.
|
|
164
|
+
*/
|
|
165
|
+
function isPortableTokenName(name) {
|
|
166
|
+
const trimmed = name.trim();
|
|
167
|
+
const bare = trimmed.startsWith("--astryx-") ? `--${trimmed.slice(9)}` : trimmed;
|
|
168
|
+
return THEME_TOKEN_PREFIX.test(bare);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Rewrite `var(--color-accent)` to `var(--astryx-color-accent)`.
|
|
172
|
+
*
|
|
173
|
+
* Custom properties outside the theme vocabulary are left alone, so a
|
|
174
|
+
* theme-local `var(--brand-ink)` keeps its exact name.
|
|
175
|
+
*/
|
|
176
|
+
function prefixTokenReferences(value) {
|
|
177
|
+
return value.replace(/var\(\s*(--(?!astryx-)[\w-]+)/g, (match, name) => {
|
|
178
|
+
if (!THEME_TOKEN_PREFIX.test(name)) return match;
|
|
179
|
+
return `var(${normalizeTokenName(name)}`;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/Theme/themeStyle.ts
|
|
184
|
+
/**
|
|
185
|
+
* Aliases declared on `:root` are substituted there. A later override of the
|
|
186
|
+
* semantic token does not flow through that already-substituted value, so the
|
|
187
|
+
* alias has to be written again on the element that sets the semantic token.
|
|
188
|
+
*
|
|
189
|
+
* Card background and border are not aliases: Neutral paints them with its own
|
|
190
|
+
* stops, and they follow the semantic token only when a theme sets one.
|
|
191
|
+
*/
|
|
192
|
+
const COMPONENT_BRIDGES = {
|
|
193
|
+
"--astryx-color-text-primary": [
|
|
194
|
+
"--astryx-text-foreground",
|
|
195
|
+
"--astryx-heading-foreground",
|
|
196
|
+
"--astryx-button-secondary-foreground",
|
|
197
|
+
"--astryx-button-ghost-foreground"
|
|
198
|
+
],
|
|
199
|
+
"--astryx-color-text-secondary": ["--astryx-text-supporting-foreground"],
|
|
200
|
+
"--astryx-color-accent": ["--astryx-button-primary-background", "--astryx-button-focus"],
|
|
201
|
+
"--astryx-color-on-accent": ["--astryx-button-primary-foreground"],
|
|
202
|
+
"--astryx-color-neutral": ["--astryx-button-secondary-background"],
|
|
203
|
+
"--astryx-color-icon-primary": ["--astryx-icon-primary-foreground"],
|
|
204
|
+
"--astryx-color-background-card": ["--astryx-card-background"],
|
|
205
|
+
"--astryx-color-background-muted": ["--astryx-card-muted-background"],
|
|
206
|
+
"--astryx-color-border": ["--astryx-card-border"]
|
|
207
|
+
};
|
|
208
|
+
/** Surfaces keep their own button treatment. Text aliases still follow onDark and onLight. */
|
|
209
|
+
const SURFACE_BRIDGES = {
|
|
210
|
+
"--astryx-color-text-primary": ["--astryx-text-foreground", "--astryx-heading-foreground"],
|
|
211
|
+
"--astryx-color-text-secondary": ["--astryx-text-supporting-foreground"],
|
|
212
|
+
"--astryx-color-background-card": ["--astryx-card-background"],
|
|
213
|
+
"--astryx-color-background-muted": ["--astryx-card-muted-background"],
|
|
214
|
+
"--astryx-color-border": ["--astryx-card-border"]
|
|
215
|
+
};
|
|
216
|
+
function bridgeComponentTokens(tokens, bridges = COMPONENT_BRIDGES) {
|
|
217
|
+
const style = { ...tokens };
|
|
218
|
+
for (const [source, targets] of Object.entries(bridges)) {
|
|
219
|
+
const value = tokens[source];
|
|
220
|
+
if (!value) continue;
|
|
221
|
+
for (const target of targets) style[target] = value;
|
|
222
|
+
}
|
|
223
|
+
return style;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Inline custom properties for an inverted media surface: the surface's
|
|
227
|
+
* semantic tokens with their component aliases.
|
|
228
|
+
*/
|
|
229
|
+
function bridgeSurfaceTokens(tokens) {
|
|
230
|
+
return bridgeComponentTokens(tokens, SURFACE_BRIDGES);
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/Theme/useTheme.ts
|
|
234
|
+
/** Prefixed data-color defaults, for reads outside a stylesheet. */
|
|
235
|
+
const DATA_DEFAULTS = Object.fromEntries(Object.entries(DATA_TOKEN_DEFAULTS).map(([name, value]) => [normalizeTokenName(name), value]));
|
|
236
|
+
function readDocumentToken(name, mode) {
|
|
237
|
+
if (typeof document === "undefined") return "";
|
|
238
|
+
const raw = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
|
|
239
|
+
return raw ? resolveLightDark(raw, mode) : "";
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Read the nearest theme. Outside a `Theme`, the name is `neutral` and tokens
|
|
243
|
+
* are read from the document's custom properties.
|
|
244
|
+
*
|
|
245
|
+
* Values are the theme's root values. An adaptation rule that changes a token
|
|
246
|
+
* on narrow or touch screens applies through CSS only, so `token()` and
|
|
247
|
+
* `tokens` stay the same across environments.
|
|
248
|
+
*
|
|
249
|
+
* The returned object and `token` are created once per component. `name`,
|
|
250
|
+
* `mode`, and `tokens` update only when the theme or the effective mode
|
|
251
|
+
* changes, so watching them does not trigger on unrelated renders.
|
|
252
|
+
*/
|
|
253
|
+
function useTheme() {
|
|
254
|
+
const context = inject(themeContextKey, null);
|
|
255
|
+
const prefersDark = useMediaQuery("(prefers-color-scheme: dark)");
|
|
256
|
+
const mode = computed(() => {
|
|
257
|
+
const requested = context?.value.mode;
|
|
258
|
+
if (requested === "light" || requested === "dark") return requested;
|
|
259
|
+
return readColorMode(prefersDark.value);
|
|
260
|
+
});
|
|
261
|
+
const theme = computed(() => context?.value.theme);
|
|
262
|
+
const name = computed(() => theme.value?.name ?? "neutral");
|
|
263
|
+
const tokens = computed(() => {
|
|
264
|
+
const resolved = {};
|
|
265
|
+
const source = theme.value;
|
|
266
|
+
for (const [key, value] of Object.entries({
|
|
267
|
+
...source?.tokens,
|
|
268
|
+
...source?.localTokens
|
|
269
|
+
})) resolved[key] = resolveLightDark(value, mode.value);
|
|
270
|
+
return resolved;
|
|
271
|
+
});
|
|
272
|
+
function token(tokenName) {
|
|
273
|
+
const trimmed = tokenName.trim();
|
|
274
|
+
const local = tokens.value[trimmed];
|
|
275
|
+
if (local !== void 0) return local;
|
|
276
|
+
const key = normalizeTokenName(trimmed);
|
|
277
|
+
const fallback = DATA_DEFAULTS[key];
|
|
278
|
+
return tokens.value[key] || readDocumentToken(key, mode.value) || (fallback ? resolveLightDark(fallback, mode.value) : "");
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
name,
|
|
282
|
+
mode,
|
|
283
|
+
token,
|
|
284
|
+
tokens
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/Theme/useAutoMediaMode.ts
|
|
289
|
+
/**
|
|
290
|
+
* The opaque color behind `start`: every translucent layer up the tree,
|
|
291
|
+
* composited over the first opaque one. `null` when a background image is in
|
|
292
|
+
* the way, since its pixels are not readable from CSS, or when nothing
|
|
293
|
+
* opaque is found.
|
|
294
|
+
*/
|
|
295
|
+
function resolveBackdrop(start) {
|
|
296
|
+
const layers = [];
|
|
297
|
+
for (let node = start; node; node = node.parentElement) {
|
|
298
|
+
const style = getComputedStyle(node);
|
|
299
|
+
const image = style.backgroundImage;
|
|
300
|
+
if (image !== "none" && image !== "initial" && image !== "") return null;
|
|
301
|
+
const color = parseColor(style.backgroundColor);
|
|
302
|
+
if (color && color.a > 0) {
|
|
303
|
+
layers.push(color);
|
|
304
|
+
if (color.a >= 1) break;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const base = layers.pop();
|
|
308
|
+
if (!base || base.a < 1) return null;
|
|
309
|
+
return layers.reduceRight((backdrop, layer) => compositeOver(layer, backdrop), base);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Read what each token paints by assigning it to a hidden probe's `color`.
|
|
313
|
+
* A custom property read directly returns its written text, such as
|
|
314
|
+
* `light-dark(a, b)`; the probe returns the color the browser resolved.
|
|
315
|
+
*/
|
|
316
|
+
function paintedColors(host, tokens) {
|
|
317
|
+
const probe = document.createElement("span");
|
|
318
|
+
probe.style.display = "none";
|
|
319
|
+
host.appendChild(probe);
|
|
320
|
+
try {
|
|
321
|
+
return tokens.map((token) => {
|
|
322
|
+
probe.style.color = `var(${token})`;
|
|
323
|
+
return parseColor(getComputedStyle(probe).color);
|
|
324
|
+
});
|
|
325
|
+
} finally {
|
|
326
|
+
probe.remove();
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Measure the element that actually paints behind a `display: contents`
|
|
331
|
+
* media theme, its parent, and pick a surface for it.
|
|
332
|
+
*
|
|
333
|
+
* Measures after mount, after every update of the owning component, whenever
|
|
334
|
+
* the parent's `style` or `class` changes, and whenever the theme's color mode
|
|
335
|
+
* or tokens change, so a surface recolored by its own prop and a surface
|
|
336
|
+
* repainted by a theme switch are both picked up without the media theme
|
|
337
|
+
* re-rendering. The probe is only appended when the painted backdrop or the
|
|
338
|
+
* theme moved. `null` until the surface can be read.
|
|
339
|
+
*/
|
|
340
|
+
function useAutoMediaMode(element, enabled) {
|
|
341
|
+
const detected = ref(null);
|
|
342
|
+
const { mode, tokens } = useTheme();
|
|
343
|
+
let lastKey = null;
|
|
344
|
+
function measure() {
|
|
345
|
+
if (!enabled.value || typeof getComputedStyle !== "function") return;
|
|
346
|
+
const surface = element.value?.parentElement;
|
|
347
|
+
if (!surface) return;
|
|
348
|
+
const backdrop = resolveBackdrop(surface);
|
|
349
|
+
if (!backdrop) return;
|
|
350
|
+
const key = {
|
|
351
|
+
backdrop: `${backdrop.r},${backdrop.g},${backdrop.b}`,
|
|
352
|
+
mode: mode.value,
|
|
353
|
+
tokens: tokens.value
|
|
354
|
+
};
|
|
355
|
+
if (lastKey !== null && key.backdrop === lastKey.backdrop && key.mode === lastKey.mode && key.tokens === lastKey.tokens && detected.value !== null) return;
|
|
356
|
+
lastKey = key;
|
|
357
|
+
const [ambient, onDark, onLight] = paintedColors(surface, [
|
|
358
|
+
"--astryx-color-text-primary",
|
|
359
|
+
"--astryx-color-on-dark",
|
|
360
|
+
"--astryx-color-on-light"
|
|
361
|
+
]);
|
|
362
|
+
const next = pickMediaMode(backdrop, ambient ?? null, onDark ?? null, onLight ?? null);
|
|
363
|
+
if (next !== null) detected.value = next;
|
|
364
|
+
}
|
|
365
|
+
let observer = null;
|
|
366
|
+
function observe() {
|
|
367
|
+
observer?.disconnect();
|
|
368
|
+
observer = null;
|
|
369
|
+
const surface = element.value?.parentElement;
|
|
370
|
+
if (!enabled.value || !surface || typeof MutationObserver === "undefined") return;
|
|
371
|
+
observer = new MutationObserver(measure);
|
|
372
|
+
observer.observe(surface, {
|
|
373
|
+
attributes: true,
|
|
374
|
+
attributeFilter: ["style", "class"]
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
onMounted(() => {
|
|
378
|
+
measure();
|
|
379
|
+
observe();
|
|
380
|
+
});
|
|
381
|
+
onUpdated(measure);
|
|
382
|
+
onBeforeUnmount(() => observer?.disconnect());
|
|
383
|
+
watch(enabled, (isOn) => {
|
|
384
|
+
lastKey = null;
|
|
385
|
+
observe();
|
|
386
|
+
if (isOn) measure();
|
|
387
|
+
else detected.value = null;
|
|
388
|
+
});
|
|
389
|
+
watch([mode, tokens], measure, { flush: "post" });
|
|
390
|
+
return detected;
|
|
391
|
+
}
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region src/Theme/MediaTheme.vue
|
|
394
|
+
const _hoisted_1 = ["data-astryx-media"];
|
|
395
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
396
|
+
name: "AstryxMediaTheme",
|
|
397
|
+
inheritAttrs: false,
|
|
398
|
+
__name: "MediaTheme",
|
|
399
|
+
props: {
|
|
400
|
+
mode: {},
|
|
401
|
+
fallback: { default: "dark" }
|
|
402
|
+
},
|
|
403
|
+
setup(__props, { expose: __expose }) {
|
|
404
|
+
const props = __props;
|
|
405
|
+
const attrs = useAttrs();
|
|
406
|
+
const root = useTemplateRef("root");
|
|
407
|
+
const theme = inject(themeContextKey, null);
|
|
408
|
+
const detected = useAutoMediaMode(root, computed(() => props.mode === "auto"));
|
|
409
|
+
const resolved = computed(() => {
|
|
410
|
+
if (props.mode === "off") return "off";
|
|
411
|
+
if (props.mode === "auto") return detected.value ?? props.fallback;
|
|
412
|
+
return props.mode;
|
|
413
|
+
});
|
|
414
|
+
provide(mediaThemeKey, resolved);
|
|
415
|
+
const rootStyle = computed(() => {
|
|
416
|
+
const surface = resolved.value === "dark" ? theme?.value.theme.onDark : resolved.value === "light" ? theme?.value.theme.onLight : void 0;
|
|
417
|
+
if (!surface) return {};
|
|
418
|
+
return bridgeSurfaceTokens(surface);
|
|
419
|
+
});
|
|
420
|
+
__expose({ element: root });
|
|
421
|
+
return (_ctx, _cache) => {
|
|
422
|
+
return openBlock(), createElementBlock("div", {
|
|
423
|
+
ref_key: "root",
|
|
424
|
+
ref: root,
|
|
425
|
+
class: normalizeClass(["astryx-media-theme", unref(attrs).class]),
|
|
426
|
+
"data-astryx-media": resolved.value === "off" ? void 0 : resolved.value,
|
|
427
|
+
style: normalizeStyle([rootStyle.value, unref(attrs).style])
|
|
428
|
+
}, [renderSlot(_ctx.$slots, "default")], 14, _hoisted_1);
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
//#endregion
|
|
433
|
+
export { normalizeTokenName as a, parseColor as c, isPortableTokenName as i, DATA_TOKEN_DEFAULTS as l, useTheme as n, prefixTokenReferences as o, bridgeComponentTokens as r, contrastRatio as s, _sfc_main as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _sfc_main, t as _sfc_main$1 } from "../MetadataList-
|
|
1
|
+
import { n as _sfc_main, t as _sfc_main$1 } from "../MetadataList-DLlSLX1n.js";
|
|
2
2
|
export { _sfc_main as MetadataList, _sfc_main$1 as MetadataListItem };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as readLayerScoped, t as defineLayerScopedKey } from "./scopedProvide-C-Df7c15.js";
|
|
2
|
+
import { s as useAstryxMessages } from "./context-CM-cjGg_.js";
|
|
3
|
+
import { Comment, Fragment, computed, defineComponent, h, provide, ref, useId, useSlots } from "vue";
|
|
3
4
|
import "../styles/metadata-list.css";
|
|
4
5
|
//#region src/MetadataList/context.ts
|
|
5
|
-
const metadataListKey =
|
|
6
|
+
const metadataListKey = defineLayerScopedKey("astryx-metadata-list", null);
|
|
6
7
|
function useMetadataListContext() {
|
|
7
|
-
return
|
|
8
|
+
return readLayerScoped(metadataListKey);
|
|
8
9
|
}
|
|
9
10
|
//#endregion
|
|
10
11
|
//#region src/MetadataList/MetadataList.vue
|
|
@@ -103,11 +104,12 @@ const _sfc_main$1 = defineComponent({
|
|
|
103
104
|
//#region src/MetadataList/MetadataListItem.vue
|
|
104
105
|
const _sfc_main = defineComponent({
|
|
105
106
|
name: "AstryxMetadataListItem",
|
|
107
|
+
inheritAttrs: false,
|
|
106
108
|
props: { label: {
|
|
107
109
|
type: String,
|
|
108
110
|
required: true
|
|
109
111
|
} },
|
|
110
|
-
setup(props) {
|
|
112
|
+
setup(props, { attrs }) {
|
|
111
113
|
const context = useMetadataListContext();
|
|
112
114
|
const slots = useSlots();
|
|
113
115
|
const stacked = computed(() => {
|
|
@@ -115,8 +117,14 @@ const _sfc_main = defineComponent({
|
|
|
115
117
|
});
|
|
116
118
|
return () => {
|
|
117
119
|
const icon = slots.icon ? h("span", { class: "astryx-metadata-list__icon" }, slots.icon()) : null;
|
|
118
|
-
if (stacked.value) return h("div", {
|
|
119
|
-
|
|
120
|
+
if (stacked.value) return h("div", {
|
|
121
|
+
...attrs,
|
|
122
|
+
class: ["astryx-metadata-list__item", attrs.class]
|
|
123
|
+
}, [h("dt", { class: "astryx-metadata-list__item-label" }, [icon, props.label]), h("dd", { class: "astryx-metadata-list__item-value" }, slots.default?.())]);
|
|
124
|
+
return [h("dt", {
|
|
125
|
+
...attrs,
|
|
126
|
+
class: ["astryx-metadata-list__label", attrs.class]
|
|
127
|
+
}, [icon, props.label]), h("dd", { class: "astryx-metadata-list__value" }, slots.default?.())];
|
|
120
128
|
};
|
|
121
129
|
}
|
|
122
130
|
});
|
package/dist/MobileNav/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _sfc_main, r as mobileNavKey, t as _sfc_main$1 } from "../MobileNavToggle-
|
|
1
|
+
import { n as _sfc_main, r as mobileNavKey, t as _sfc_main$1 } from "../MobileNavToggle-DgJYyzT6.js";
|
|
2
2
|
export { _sfc_main as MobileNav, _sfc_main$1 as MobileNavToggle, mobileNavKey };
|
|
@@ -1,12 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { r as resetLayerScopedContext } from "./scopedProvide-C-Df7c15.js";
|
|
2
|
+
import { i as pushLayer, n as useLayerDepth, r as isTopLayer, t as provideLayerDepth } from "./layerDepth-CNDh-IHb.js";
|
|
3
|
+
import { n as useFocusTrap, t as useRestoreFocus } from "./useRestoreFocus-XEKs5-gp.js";
|
|
4
|
+
import { s as useAstryxMessages } from "./context-CM-cjGg_.js";
|
|
5
|
+
import { t as useScrollLock } from "./scrollLock-C3aT4-0z.js";
|
|
3
6
|
import { t as useScrollbars } from "./useScrollbars-C2NJ6Qwq.js";
|
|
4
|
-
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeModels, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, provide, ref, renderSlot, toDisplayString, unref, useId, useModel, useTemplateRef, watch } from "vue";
|
|
7
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeModels, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, openBlock, provide, ref, renderSlot, toDisplayString, unref, useId, useModel, useTemplateRef, watch } from "vue";
|
|
5
8
|
import "../styles/mobile-nav.css";
|
|
6
9
|
//#region src/MobileNav/context.ts
|
|
7
10
|
/** 内容渲染在移动导航抽屉里时为 true。菜单在这里改成内联折叠,不再弹出。 */
|
|
8
11
|
const mobileNavKey = Symbol("astryx-mobile-nav");
|
|
9
12
|
//#endregion
|
|
13
|
+
//#region src/MobileNav/useMobileNavLayer.ts
|
|
14
|
+
/**
|
|
15
|
+
* 抽屉打开时登记进全页关闭栈。
|
|
16
|
+
* 点遮罩由对话框自己认,不在这里当「点外面」。
|
|
17
|
+
* Escape 只关最上面一层。浏览器另外发出的 cancel,也要先确认自己还在最上面。
|
|
18
|
+
*/
|
|
19
|
+
function useMobileNavLayer(options) {
|
|
20
|
+
const depth = useLayerDepth();
|
|
21
|
+
const token = {};
|
|
22
|
+
let stop = null;
|
|
23
|
+
function sync(open) {
|
|
24
|
+
stop?.();
|
|
25
|
+
stop = null;
|
|
26
|
+
if (!open) return;
|
|
27
|
+
stop = pushLayer({
|
|
28
|
+
token,
|
|
29
|
+
depth,
|
|
30
|
+
getContainer: options.getContainer,
|
|
31
|
+
dismissOnPointerOutside: false,
|
|
32
|
+
dismissOnEscape: "close",
|
|
33
|
+
onDismiss: options.onDismiss
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
watch(options.isOpen, sync, { immediate: true });
|
|
37
|
+
onScopeDispose(() => {
|
|
38
|
+
stop?.();
|
|
39
|
+
stop = null;
|
|
40
|
+
});
|
|
41
|
+
return { shouldCloseOnCancel: () => options.isOpen.value && isTopLayer(token) };
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
10
44
|
//#region src/MobileNav/MobileNav.vue
|
|
11
45
|
const _hoisted_1$1 = [
|
|
12
46
|
"id",
|
|
@@ -41,6 +75,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
41
75
|
const props = __props;
|
|
42
76
|
const emit = __emit;
|
|
43
77
|
const messages = useAstryxMessages();
|
|
78
|
+
resetLayerScopedContext();
|
|
79
|
+
provideLayerDepth();
|
|
44
80
|
const isOpen = useModel(__props, "isOpen");
|
|
45
81
|
const dialogRef = ref(null);
|
|
46
82
|
const bodyEl = useTemplateRef("body");
|
|
@@ -49,12 +85,12 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
49
85
|
const generatedId = `astryx-mobile-nav-${useId()}`;
|
|
50
86
|
const dialogId = computed(() => props.id || generatedId);
|
|
51
87
|
const labelId = computed(() => `${dialogId.value}-label`);
|
|
52
|
-
let previousOverflow = "";
|
|
53
88
|
const accessibleName = computed(() => props.label || props.header || messages.value.nav.mobileNav);
|
|
54
89
|
const trapEnabled = computed(() => isOpen.value);
|
|
55
90
|
const sideIsStart = computed(() => resolvedSide.value === "start");
|
|
91
|
+
useScrollLock(isOpen);
|
|
56
92
|
useRestoreFocus({
|
|
57
|
-
isEnabled:
|
|
93
|
+
isEnabled: computed(() => true),
|
|
58
94
|
shouldRestore: trapEnabled
|
|
59
95
|
});
|
|
60
96
|
useFocusTrap({
|
|
@@ -62,6 +98,11 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
62
98
|
isEnabled: trapEnabled
|
|
63
99
|
});
|
|
64
100
|
provide(mobileNavKey, true);
|
|
101
|
+
const layer = useMobileNavLayer({
|
|
102
|
+
getContainer: () => dialogRef.value,
|
|
103
|
+
isOpen,
|
|
104
|
+
onDismiss: () => setOpen(false)
|
|
105
|
+
});
|
|
65
106
|
function resolveSide(side) {
|
|
66
107
|
if (side === "start" || side === "end") return side;
|
|
67
108
|
const active = document.activeElement;
|
|
@@ -71,26 +112,15 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
71
112
|
}
|
|
72
113
|
return "start";
|
|
73
114
|
}
|
|
74
|
-
function lockScroll(lock) {
|
|
75
|
-
if (typeof document === "undefined") return;
|
|
76
|
-
if (lock) {
|
|
77
|
-
previousOverflow = document.documentElement.style.overflow;
|
|
78
|
-
document.documentElement.style.overflow = "clip";
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
document.documentElement.style.overflow = previousOverflow;
|
|
82
|
-
}
|
|
83
115
|
function syncDialog(open) {
|
|
84
116
|
const dialog = dialogRef.value;
|
|
85
117
|
if (!dialog) return;
|
|
86
118
|
if (open) {
|
|
87
119
|
resolvedSide.value = resolveSide(props.side);
|
|
88
|
-
lockScroll(true);
|
|
89
120
|
if (typeof dialog.showModal === "function" && !dialog.open) dialog.showModal();
|
|
90
121
|
else dialog.setAttribute("open", "");
|
|
91
122
|
return;
|
|
92
123
|
}
|
|
93
|
-
lockScroll(false);
|
|
94
124
|
if (typeof dialog.close === "function" && dialog.open) dialog.close();
|
|
95
125
|
else dialog.removeAttribute("open");
|
|
96
126
|
}
|
|
@@ -101,6 +131,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
101
131
|
}
|
|
102
132
|
function onCancel(event) {
|
|
103
133
|
event.preventDefault();
|
|
134
|
+
if (!layer.shouldCloseOnCancel()) return;
|
|
104
135
|
setOpen(false);
|
|
105
136
|
}
|
|
106
137
|
function onDialogClick(event) {
|
|
@@ -112,12 +143,16 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
112
143
|
onMounted(() => {
|
|
113
144
|
if (isOpen.value) syncDialog(true);
|
|
114
145
|
});
|
|
146
|
+
onBeforeUnmount(() => {
|
|
147
|
+
const dialog = dialogRef.value;
|
|
148
|
+
if (dialog?.open && typeof dialog.close === "function") dialog.close();
|
|
149
|
+
});
|
|
115
150
|
return (_ctx, _cache) => {
|
|
116
151
|
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events, vue-a11y/no-static-element-interactions -- 点在 dialog 自身上等于点遮罩;键盘用户走原生 cancel。 "), createElementVNode("dialog", {
|
|
117
152
|
id: dialogId.value,
|
|
118
153
|
ref_key: "dialogRef",
|
|
119
154
|
ref: dialogRef,
|
|
120
|
-
class: normalizeClass(["astryx-mobile-nav", sideIsStart.value ? "astryx-mobile-nav--start" : "astryx-mobile-nav--end"]),
|
|
155
|
+
class: normalizeClass(["astryx-mobile-nav astryx-layer", sideIsStart.value ? "astryx-mobile-nav--start" : "astryx-mobile-nav--end"]),
|
|
121
156
|
style: normalizeStyle({ "--astryx-mobile-nav-width": `${__props.width}px` }),
|
|
122
157
|
"aria-modal": "true",
|
|
123
158
|
"aria-labelledby": _ctx.$slots.header || __props.header ? labelId.value : void 0,
|
package/dist/MoreMenu/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $r as
|
|
1
|
+
import { $r as MoreMenuDivider, Qr as _default, ai as MoreMenuOption, ci as MoreMenuResolvedPresentation, ei as MoreMenuEmits, ii as MoreMenuItemVariant, li as MoreMenuSection, ni as MoreMenuInitialFocus, oi as MoreMenuPresentation, ri as MoreMenuItem, si as MoreMenuProps, ti as MoreMenuIcon, ui as MoreMenuSlots } from "../index-UA93Im7H.js";
|
|
2
2
|
export { _default as MoreMenu, type MoreMenuDivider, type MoreMenuEmits, type MoreMenuIcon, type MoreMenuInitialFocus, type MoreMenuItem, type MoreMenuItemVariant, type MoreMenuOption, type MoreMenuPresentation, type MoreMenuProps, type MoreMenuResolvedPresentation, type MoreMenuSection, type MoreMenuSlots };
|
package/dist/MoreMenu/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _sfc_main } from "../MoreMenu-
|
|
1
|
+
import { t as _sfc_main } from "../MoreMenu-C8BEt6-O.js";
|
|
2
2
|
export { _sfc_main as MoreMenu };
|