@lilydesignsystem/svelte-headless 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/LICENSE.md +8 -8
- package/README.md +4 -4
- package/dist/components/AccordionLink/AccordionLink.svelte +12 -2
- package/dist/components/AccordionLink/AccordionLink.svelte.d.ts +4 -0
- package/dist/components/ActionBar/ActionBar.svelte +2 -2
- package/dist/components/ActionGroup/ActionGroup.svelte +31 -7
- package/dist/components/ActionGroup/ActionGroup.svelte.d.ts +4 -4
- package/dist/components/AddressographBox/AddressographBox.svelte +5 -1
- package/dist/components/AiLabel/AiLabel.svelte +2 -2
- package/dist/components/Alert/Alert.svelte +1 -3
- package/dist/components/AlertDialog/AlertDialog.svelte +9 -4
- package/dist/components/Answer/Answer.svelte +5 -1
- package/dist/components/AreaChart/AreaChart.svelte +5 -1
- package/dist/components/AsSaudiyahRaqmAlHuwiyahAlWataniyahInput/AsSaudiyahRaqmAlHuwiyahAlWataniyahInput.svelte +55 -0
- package/dist/components/AsSaudiyahRaqmAlHuwiyahAlWataniyahInput/AsSaudiyahRaqmAlHuwiyahAlWataniyahInput.svelte.d.ts +10 -0
- package/dist/components/AsSaudiyahRaqmAlHuwiyahAlWataniyahView/AsSaudiyahRaqmAlHuwiyahAlWataniyahView.svelte +40 -0
- package/dist/components/AsSaudiyahRaqmAlHuwiyahAlWataniyahView/AsSaudiyahRaqmAlHuwiyahAlWataniyahView.svelte.d.ts +8 -0
- package/dist/components/AustraliaTaxFileNumberInput/AustraliaTaxFileNumberInput.svelte +55 -0
- package/dist/components/AustraliaTaxFileNumberInput/AustraliaTaxFileNumberInput.svelte.d.ts +10 -0
- package/dist/components/AustraliaTaxFileNumberView/AustraliaTaxFileNumberView.svelte +40 -0
- package/dist/components/AustraliaTaxFileNumberView/AustraliaTaxFileNumberView.svelte.d.ts +8 -0
- package/dist/components/Autosuggest/Autosuggest.svelte +175 -8
- package/dist/components/Autosuggest/Autosuggest.svelte.d.ts +18 -4
- package/dist/components/AvatarGroup/AvatarGroup.svelte +5 -1
- package/dist/components/BarChart/BarChart.svelte +5 -1
- package/dist/components/BarcodeImage/BarcodeImage.svelte +7 -1
- package/dist/components/BreadcrumbLink/BreadcrumbLink.svelte +12 -2
- package/dist/components/BreadcrumbLink/BreadcrumbLink.svelte.d.ts +4 -0
- package/dist/components/BreadcrumbListItem/BreadcrumbListItem.svelte +3 -3
- package/dist/components/Byline/Byline.svelte +4 -1
- package/dist/components/CandlestickChart/CandlestickChart.svelte +5 -1
- package/dist/components/Caption/Caption.svelte +1 -0
- package/dist/components/CareCard/CareCard.svelte +1 -0
- package/dist/components/Cascader/Cascader.svelte +7 -1
- package/dist/components/ChatComposer/ChatComposer.svelte +6 -3
- package/dist/components/ChatList/ChatList.svelte +6 -2
- package/dist/components/ChatListItem/ChatListItem.svelte +10 -2
- package/dist/components/ChatListItem/ChatListItem.svelte.d.ts +2 -0
- package/dist/components/ChatMessage/ChatMessage.svelte +6 -2
- package/dist/components/ChatNav/ChatNav.svelte +6 -2
- package/dist/components/CheckListItem/CheckListItem.svelte +4 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.svelte +1 -0
- package/dist/components/ChoroplethChart/ChoroplethChart.svelte +5 -1
- package/dist/components/Citation/Citation.svelte +6 -2
- package/dist/components/Coachmark/Coachmark.svelte +20 -10
- package/dist/components/Code/Code.svelte +6 -2
- package/dist/components/CodeBlock/CodeBlock.svelte +6 -2
- package/dist/components/CollectionListItem/CollectionListItem.svelte +1 -1
- package/dist/components/ColombiaCedulaDeCiudadaniaInput/ColombiaCedulaDeCiudadaniaInput.svelte +55 -0
- package/dist/components/ColombiaCedulaDeCiudadaniaInput/ColombiaCedulaDeCiudadaniaInput.svelte.d.ts +10 -0
- package/dist/components/ColombiaCedulaDeCiudadaniaView/ColombiaCedulaDeCiudadaniaView.svelte +40 -0
- package/dist/components/ColombiaCedulaDeCiudadaniaView/ColombiaCedulaDeCiudadaniaView.svelte.d.ts +8 -0
- package/dist/components/ColumnChart/ColumnChart.svelte +5 -1
- package/dist/components/Combobox/Combobox.svelte +11 -9
- package/dist/components/Comment/Comment.svelte +5 -1
- package/dist/components/ComposedChart/ComposedChart.svelte +5 -1
- package/dist/components/ContentsListItem/ContentsListItem.svelte +4 -1
- package/dist/components/ContentsNav/ContentsNav.svelte +56 -36
- package/dist/components/ContextMenu/ContextMenu.svelte +19 -17
- package/dist/components/ContextualHelp/ContextualHelp.svelte +55 -26
- package/dist/components/ContextualHelp/ContextualHelp.svelte.d.ts +4 -2
- package/dist/components/ConvertDiv/ConvertDiv.svelte +31 -0
- package/dist/components/ConvertDiv/ConvertDiv.svelte.d.ts +11 -0
- package/dist/components/ConvertFromDiv/ConvertFromDiv.svelte +25 -0
- package/dist/components/ConvertFromDiv/ConvertFromDiv.svelte.d.ts +9 -0
- package/dist/components/ConvertFromUnitDiv/ConvertFromUnitDiv.svelte +25 -0
- package/dist/components/ConvertFromUnitDiv/ConvertFromUnitDiv.svelte.d.ts +9 -0
- package/dist/components/ConvertFromValueDiv/ConvertFromValueDiv.svelte +25 -0
- package/dist/components/ConvertFromValueDiv/ConvertFromValueDiv.svelte.d.ts +9 -0
- package/dist/components/ConvertIntoDiv/ConvertIntoDiv.svelte +25 -0
- package/dist/components/ConvertIntoDiv/ConvertIntoDiv.svelte.d.ts +9 -0
- package/dist/components/ConvertIntoUnitDiv/ConvertIntoUnitDiv.svelte +25 -0
- package/dist/components/ConvertIntoUnitDiv/ConvertIntoUnitDiv.svelte.d.ts +9 -0
- package/dist/components/ConvertIntoValueDiv/ConvertIntoValueDiv.svelte +25 -0
- package/dist/components/ConvertIntoValueDiv/ConvertIntoValueDiv.svelte.d.ts +9 -0
- package/dist/components/CurrencyInput/CurrencyInput.svelte +61 -8
- package/dist/components/CurrencyInput/CurrencyInput.svelte.d.ts +9 -4
- package/dist/components/DateTimeNowInput/DateTimeNowInput.svelte +18 -16
- package/dist/components/DateTimeNowInput/DateTimeNowInput.svelte.d.ts +3 -3
- package/dist/components/DescriptionList/DescriptionList.svelte +0 -2
- package/dist/components/DescriptionListItem/DescriptionListItem.svelte +0 -2
- package/dist/components/DialGroup/DialGroup.svelte +5 -1
- package/dist/components/Dialog/Dialog.svelte +14 -1
- package/dist/components/Dialog/modal.d.ts +4 -0
- package/dist/components/Dialog/modal.js +47 -0
- package/dist/components/Diff/Diff.svelte +5 -1
- package/dist/components/DigitalObjectIdentifierLink/DigitalObjectIdentifierLink.svelte +16 -7
- package/dist/components/DigitalObjectIdentifierLink/DigitalObjectIdentifierLink.svelte.d.ts +4 -2
- package/dist/components/DocumentList/DocumentList.svelte +0 -1
- package/dist/components/DocumentListItem/DocumentListItem.svelte +0 -2
- package/dist/components/Drawer/Drawer.svelte +35 -12
- package/dist/components/DropdownMenu/DropdownMenu.svelte +27 -16
- package/dist/components/EcuadorCedulaDeIdentidadInput/EcuadorCedulaDeIdentidadInput.svelte +55 -0
- package/dist/components/EcuadorCedulaDeIdentidadInput/EcuadorCedulaDeIdentidadInput.svelte.d.ts +10 -0
- package/dist/components/EcuadorCedulaDeIdentidadView/EcuadorCedulaDeIdentidadView.svelte +40 -0
- package/dist/components/EcuadorCedulaDeIdentidadView/EcuadorCedulaDeIdentidadView.svelte.d.ts +8 -0
- package/dist/components/EireIndividualHealthIdentifierView/EireIndividualHealthIdentifierView.svelte +2 -1
- package/dist/components/EspanaTarjetaSanitariaIndividualView/EspanaTarjetaSanitariaIndividualView.svelte +2 -1
- package/dist/components/Event/Event.svelte +6 -2
- package/dist/components/FeatureCard/FeatureCard.svelte +5 -1
- package/dist/components/FeaturePhoto/FeaturePhoto.svelte +4 -1
- package/dist/components/FileDialog/FileDialog.svelte +7 -1
- package/dist/components/FileTree/FileTree.svelte +20 -5
- package/dist/components/FiveFaceRatingPicker/FiveFaceRatingPicker.svelte +3 -1
- package/dist/components/FiveFaceRatingPickerButton/FiveFaceRatingPickerButton.svelte +2 -2
- package/dist/components/FiveStarRatingPicker/FiveStarRatingPicker.svelte +3 -1
- package/dist/components/FiveStarRatingPickerButton/FiveStarRatingPickerButton.svelte +2 -2
- package/dist/components/FlexStack/FlexStack.svelte +3 -1
- package/dist/components/FloatingPanel/FloatingPanel.svelte +15 -13
- package/dist/components/FunnelChart/FunnelChart.svelte +5 -1
- package/dist/components/GaugeChart/GaugeChart.svelte +5 -1
- package/dist/components/GoToNextSection/GoToNextSection.svelte +2 -3
- package/dist/components/GoToPreviousSection/GoToPreviousSection.svelte +2 -3
- package/dist/components/GoToTop/GoToTop.svelte +0 -2
- package/dist/components/GrailLayoutBottomFooter/GrailLayoutBottomFooter.svelte +4 -1
- package/dist/components/GrailLayoutCenterMain/GrailLayoutCenterMain.svelte +4 -1
- package/dist/components/GrailLayoutLeftAside/GrailLayoutLeftAside.svelte +4 -1
- package/dist/components/GrailLayoutRightAside/GrailLayoutRightAside.svelte +4 -1
- package/dist/components/GrailLayoutTopHeader/GrailLayoutTopHeader.svelte +4 -1
- package/dist/components/GraphicBlock/GraphicBlock.svelte +1 -1
- package/dist/components/Grid/Grid.svelte +12 -3
- package/dist/components/Grid/Grid.svelte.d.ts +2 -0
- package/dist/components/Headline/Headline.svelte +4 -1
- package/dist/components/HeatmapChart/HeatmapChart.svelte +5 -1
- package/dist/components/HeatmapChartWithYearOfDays/HeatmapChartWithYearOfDays.svelte +5 -1
- package/dist/components/Hero/Hero.svelte +6 -2
- package/dist/components/HongKongIdentityCardInput/HongKongIdentityCardInput.svelte +55 -0
- package/dist/components/HongKongIdentityCardInput/HongKongIdentityCardInput.svelte.d.ts +10 -0
- package/dist/components/HongKongIdentityCardView/HongKongIdentityCardView.svelte +40 -0
- package/dist/components/HongKongIdentityCardView/HongKongIdentityCardView.svelte.d.ts +8 -0
- package/dist/components/HorizontalScroller/HorizontalScroller.svelte +1 -0
- package/dist/components/HoverCard/HoverCard.svelte +14 -13
- package/dist/components/IconListItem/IconListItem.svelte +4 -1
- package/dist/components/InputWithMask/InputWithMask.svelte +4 -1
- package/dist/components/IranKodEMelliInput/IranKodEMelliInput.svelte +55 -0
- package/dist/components/IranKodEMelliInput/IranKodEMelliInput.svelte.d.ts +10 -0
- package/dist/components/IranKodEMelliView/IranKodEMelliView.svelte +40 -0
- package/dist/components/IranKodEMelliView/IranKodEMelliView.svelte.d.ts +8 -0
- package/dist/components/Kbd/Kbd.svelte +5 -1
- package/dist/components/KbdShortcut/KbdShortcut.svelte +9 -2
- package/dist/components/LineChart/LineChart.svelte +5 -1
- package/dist/components/Listbox/Listbox.svelte +22 -117
- package/dist/components/Listbox/listbox-machine.d.ts +81 -0
- package/dist/components/Listbox/listbox-machine.js +116 -0
- package/dist/components/Listbox/search-text.d.ts +22 -0
- package/dist/components/Listbox/search-text.js +56 -0
- package/dist/components/Listbox/typeahead.d.ts +19 -0
- package/dist/components/Listbox/typeahead.js +39 -0
- package/dist/components/Loading/Loading.svelte +5 -1
- package/dist/components/MalaysiaKadPengenalanInput/MalaysiaKadPengenalanInput.svelte +55 -0
- package/dist/components/MalaysiaKadPengenalanInput/MalaysiaKadPengenalanInput.svelte.d.ts +10 -0
- package/dist/components/MalaysiaKadPengenalanView/MalaysiaKadPengenalanView.svelte +40 -0
- package/dist/components/MalaysiaKadPengenalanView/MalaysiaKadPengenalanView.svelte.d.ts +8 -0
- package/dist/components/Mark/Mark.svelte +0 -2
- package/dist/components/MentionsInput/MentionsInput.svelte +14 -2
- package/dist/components/Menu/Menu.svelte +1 -3
- package/dist/components/MenuBar/MenuBar.svelte +1 -3
- package/dist/components/MenuGroup/MenuGroup.svelte +6 -1
- package/dist/components/MiddleTruncation/MiddleTruncation.svelte +13 -3
- package/dist/components/MockupBrowser/MockupBrowser.svelte +5 -1
- package/dist/components/MockupLaptop/MockupLaptop.svelte +5 -1
- package/dist/components/MockupPhonePortrait/MockupPhonePortrait.svelte +5 -1
- package/dist/components/MockupShell/MockupShell.svelte +5 -1
- package/dist/components/MockupTabletLandscape/MockupTabletLandscape.svelte +5 -1
- package/dist/components/MockupTabletPortrait/MockupTabletPortrait.svelte +5 -1
- package/dist/components/MockupWatch/MockupWatch.svelte +5 -1
- package/dist/components/MockupWindow/MockupWindow.svelte +5 -1
- package/dist/components/MutuallyExclusive/MutuallyExclusive.svelte +0 -1
- package/dist/components/NavigationMenu/NavigationMenu.svelte +51 -3
- package/dist/components/NavigationMenu/NavigationMenu.svelte.d.ts +4 -0
- package/dist/components/NavigationMenu/overflow-navigation.d.ts +35 -0
- package/dist/components/NavigationMenu/overflow-navigation.js +133 -0
- package/dist/components/NetPromoterScorePicker/NetPromoterScorePicker.svelte +3 -1
- package/dist/components/NetPromoterScorePickerButton/NetPromoterScorePickerButton.svelte +2 -2
- package/dist/components/NigeriaNationalIdentificationNumberInput/NigeriaNationalIdentificationNumberInput.svelte +55 -0
- package/dist/components/NigeriaNationalIdentificationNumberInput/NigeriaNationalIdentificationNumberInput.svelte.d.ts +10 -0
- package/dist/components/NigeriaNationalIdentificationNumberView/NigeriaNationalIdentificationNumberView.svelte +40 -0
- package/dist/components/NigeriaNationalIdentificationNumberView/NigeriaNationalIdentificationNumberView.svelte.d.ts +8 -0
- package/dist/components/Organization/Organization.svelte +6 -2
- package/dist/components/PaginationLink/PaginationLink.svelte +12 -2
- package/dist/components/PaginationLink/PaginationLink.svelte.d.ts +4 -0
- package/dist/components/PakistanComputerizedNationalIdentityCardInput/PakistanComputerizedNationalIdentityCardInput.svelte +55 -0
- package/dist/components/PakistanComputerizedNationalIdentityCardInput/PakistanComputerizedNationalIdentityCardInput.svelte.d.ts +10 -0
- package/dist/components/PakistanComputerizedNationalIdentityCardView/PakistanComputerizedNationalIdentityCardView.svelte +40 -0
- package/dist/components/PakistanComputerizedNationalIdentityCardView/PakistanComputerizedNationalIdentityCardView.svelte.d.ts +8 -0
- package/dist/components/Person/Person.svelte +6 -2
- package/dist/components/PhaseBanner/PhaseBanner.svelte +0 -1
- package/dist/components/Pictogram/Pictogram.svelte +4 -1
- package/dist/components/Picture/Picture.svelte +27 -0
- package/dist/components/Picture/Picture.svelte.d.ts +9 -0
- package/dist/components/PieChart/PieChart.svelte +5 -1
- package/dist/components/Place/Place.svelte +6 -2
- package/dist/components/PopconfirmDialog/PopconfirmDialog.svelte +16 -3
- package/dist/components/Popover/Popover.svelte +39 -24
- package/dist/components/Popover/popover.d.ts +9 -0
- package/dist/components/Popover/popover.js +50 -0
- package/dist/components/Popup/Popup.svelte +40 -25
- package/dist/components/ProductCard/ProductCard.svelte +5 -1
- package/dist/components/ProgressBar/ProgressBar.svelte +0 -1
- package/dist/components/Question/Question.svelte +5 -1
- package/dist/components/RadarChart/RadarChart.svelte +5 -1
- package/dist/components/RedAmberGreenPickerButton/RedAmberGreenPickerButton.svelte +2 -2
- package/dist/components/RedOrangeYellowGreenBluePickerButton/RedOrangeYellowGreenBluePickerButton.svelte +2 -2
- package/dist/components/RelatedContent/RelatedContent.svelte +0 -1
- package/dist/components/Resizable/Resizable.svelte +1 -0
- package/dist/components/RingChart/RingChart.svelte +5 -1
- package/dist/components/SankeyChart/SankeyChart.svelte +5 -1
- package/dist/components/ScatterChart/ScatterChart.svelte +5 -1
- package/dist/components/ScreenReaderSpan/ScreenReaderSpan.svelte +6 -2
- package/dist/components/ScrollArea/ScrollArea.svelte +1 -0
- package/dist/components/ScrollBar/ScrollBar.svelte +78 -16
- package/dist/components/ScrollBar/ScrollBar.svelte.d.ts +13 -1
- package/dist/components/Scroller/Scroller.svelte +4 -1
- package/dist/components/ScrollerBase/ScrollerBase.svelte +1 -1
- package/dist/components/SectionLink/SectionLink.svelte +0 -2
- package/dist/components/SectionList/SectionList.svelte +0 -2
- package/dist/components/SectionListItem/SectionListItem.svelte +1 -3
- package/dist/components/SectionNav/SectionNav.svelte +0 -1
- package/dist/components/Separator/Separator.svelte +1 -0
- package/dist/components/Sheet/Sheet.svelte +32 -11
- package/dist/components/ShowMore/ShowMore.svelte +9 -2
- package/dist/components/SlideOutDrawer/SlideOutDrawer.svelte +33 -10
- package/dist/components/SliderButton/SliderButton.svelte +64 -6
- package/dist/components/SliderButton/SliderButton.svelte.d.ts +8 -2
- package/dist/components/SplitButton/SplitButton.svelte +29 -5
- package/dist/components/SplitButton/SplitButton.svelte.d.ts +3 -3
- package/dist/components/SplitView/SplitView.svelte +1 -0
- package/dist/components/Splitter/Splitter.svelte +1 -0
- package/dist/components/StatusLight/StatusLight.svelte +5 -8
- package/dist/components/StepListItem/StepListItem.svelte +3 -3
- package/dist/components/StickyPromoBanner/StickyPromoBanner.svelte +1 -0
- package/dist/components/SunburstChart/SunburstChart.svelte +5 -1
- package/dist/components/SuperBanner/SuperBanner.svelte +5 -1
- package/dist/components/TabBar/TabBar.svelte +1 -3
- package/dist/components/Tag/Tag.svelte +10 -2
- package/dist/components/TaiwanGuominShenfenzhengTongyiBianhaoInput/TaiwanGuominShenfenzhengTongyiBianhaoInput.svelte +55 -0
- package/dist/components/TaiwanGuominShenfenzhengTongyiBianhaoInput/TaiwanGuominShenfenzhengTongyiBianhaoInput.svelte.d.ts +10 -0
- package/dist/components/TaiwanGuominShenfenzhengTongyiBianhaoView/TaiwanGuominShenfenzhengTongyiBianhaoView.svelte +40 -0
- package/dist/components/TaiwanGuominShenfenzhengTongyiBianhaoView/TaiwanGuominShenfenzhengTongyiBianhaoView.svelte.d.ts +8 -0
- package/dist/components/TaskBar/TaskBar.svelte +1 -3
- package/dist/components/TextAreaInput/TextAreaInput.svelte +1 -2
- package/dist/components/TextAreaInputWithCharacterCounter/TextAreaInputWithCharacterCounter.svelte +4 -3
- package/dist/components/ThemeProvider/ThemeProvider.svelte +3 -3
- package/dist/components/Tile/Tile.svelte +5 -1
- package/dist/components/TimeoutDialog/TimeoutDialog.svelte +14 -1
- package/dist/components/TimerButton/TimerButton.svelte +55 -7
- package/dist/components/TimerButton/TimerButton.svelte.d.ts +9 -3
- package/dist/components/ToolBar/ToolBar.svelte +1 -3
- package/dist/components/ToolCallError/ToolCallError.svelte +0 -1
- package/dist/components/ToolCallName/ToolCallName.svelte +0 -2
- package/dist/components/Tooltip/Tooltip.svelte +14 -12
- package/dist/components/Tour/Tour.svelte +5 -4
- package/dist/components/TourList/TourList.svelte +10 -9
- package/dist/components/TourList/TourList.svelte.d.ts +2 -0
- package/dist/components/TourListItem/TourListItem.svelte +2 -2
- package/dist/components/TransferList/TransferList.svelte +8 -2
- package/dist/components/TreeLink/TreeLink.svelte +12 -2
- package/dist/components/TreeLink/TreeLink.svelte.d.ts +4 -0
- package/dist/components/TreeList/TreeList.svelte +3 -3
- package/dist/components/TreeListItem/TreeListItem.svelte +9 -1
- package/dist/components/TreeMenu/TreeMenu.svelte +40 -1
- package/dist/components/TreeSelect/TreeSelect.svelte +10 -3
- package/dist/components/TuaisceartEireannHealthAndCareNumberView/TuaisceartEireannHealthAndCareNumberView.svelte +2 -1
- package/dist/components/UruguayCedulaDeIdentidadInput/UruguayCedulaDeIdentidadInput.svelte +55 -0
- package/dist/components/UruguayCedulaDeIdentidadInput/UruguayCedulaDeIdentidadInput.svelte.d.ts +10 -0
- package/dist/components/UruguayCedulaDeIdentidadView/UruguayCedulaDeIdentidadView.svelte +40 -0
- package/dist/components/UruguayCedulaDeIdentidadView/UruguayCedulaDeIdentidadView.svelte.d.ts +8 -0
- package/dist/components/VideoPlayer/VideoPlayer.svelte +6 -2
- package/dist/components/VietNamCanCuocCongDanInput/VietNamCanCuocCongDanInput.svelte +55 -0
- package/dist/components/VietNamCanCuocCongDanInput/VietNamCanCuocCongDanInput.svelte.d.ts +10 -0
- package/dist/components/VietNamCanCuocCongDanView/VietNamCanCuocCongDanView.svelte +40 -0
- package/dist/components/VietNamCanCuocCongDanView/VietNamCanCuocCongDanView.svelte.d.ts +8 -0
- package/dist/components/Visible/Visible.svelte +1 -1
- package/dist/components/WarningText/WarningText.svelte +48 -0
- package/dist/components/WarningText/WarningText.svelte.d.ts +13 -0
- package/dist/components/WheelPicker/WheelPicker.svelte +18 -4
- package/dist/components/WheelPicker/wheel-picker.js +18 -3
- package/dist/index.d.ts +33 -0
- package/dist/index.js +33 -0
- package/index.md +4 -4
- package/package.json +5 -5
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The listbox behaviour core: one framework-free transition function that every library's Listbox binds with a thin
|
|
3
|
+
* adapter (spec/competitive-position item 3). Pure, so the whole WAI-ARIA APG listbox keyboard contract is unit-tested
|
|
4
|
+
* without a browser.
|
|
5
|
+
*
|
|
6
|
+
* The adapter owns the DOM: it reads the options' labels and which option has focus, calls `listboxKeydown`, then
|
|
7
|
+
* applies the returned transition (prevent the default, move focus, set the active index, call the consumer's
|
|
8
|
+
* callbacks). The machine owns every decision.
|
|
9
|
+
*
|
|
10
|
+
* Two navigation models, as the Listbox components document them:
|
|
11
|
+
*
|
|
12
|
+
* "roving-focus" (default): real focus moves between the options. ArrowDown/ArrowUp wrap; Home/End jump. No
|
|
13
|
+
* typeahead, paging or activation.
|
|
14
|
+
*
|
|
15
|
+
* "active-descendant": the root keeps focus and a virtual cursor (`activeIndex`) moves. ArrowDown/ArrowUp wrap, or
|
|
16
|
+
* clamp when `clamp` is set; Home/End jump; PageUp/PageDown move by `pageSize`, wrapping or clamping like the
|
|
17
|
+
* arrows; printable characters run typeahead when `typeahead` is set; Enter/Space activate the active option;
|
|
18
|
+
* Escape and Tab are reported so the consumer decides what they do (Tab is never prevented).
|
|
19
|
+
*
|
|
20
|
+
* Selection is the consumer's: the machine reports activation and the consumer sets `aria-selected`. Disabled options
|
|
21
|
+
* are not skipped, matching the components this machine was extracted from.
|
|
22
|
+
*/
|
|
23
|
+
import { findTypeaheadMatch, isTypeaheadKey, nextTypeaheadState, } from "./typeahead";
|
|
24
|
+
/** Typeahead prefix lifetime: a pause this long starts a new prefix. The Listbox components have always used 500 ms. */
|
|
25
|
+
export const LISTBOX_TYPEAHEAD_RESET_MS = 500;
|
|
26
|
+
/** A fresh state with the cursor at `activeIndex`. */
|
|
27
|
+
export function initialListboxState(activeIndex = -1) {
|
|
28
|
+
return { activeIndex, typeahead: { prefix: "", at: 0 } };
|
|
29
|
+
}
|
|
30
|
+
/** `index` moved by `delta` among `count` options, clamped to the ends or wrapped. `count` must be positive. */
|
|
31
|
+
export function stepListboxIndex(index, delta, count, clamp) {
|
|
32
|
+
const next = index + delta;
|
|
33
|
+
return clamp ? Math.min(Math.max(next, 0), count - 1) : ((next % count) + count) % count;
|
|
34
|
+
}
|
|
35
|
+
function rovingKeydown(state, key, count, focused) {
|
|
36
|
+
let focus;
|
|
37
|
+
switch (key) {
|
|
38
|
+
case "ArrowDown":
|
|
39
|
+
focus = focused < count - 1 ? focused + 1 : 0;
|
|
40
|
+
break;
|
|
41
|
+
case "ArrowUp":
|
|
42
|
+
focus = focused > 0 ? focused - 1 : count - 1;
|
|
43
|
+
break;
|
|
44
|
+
case "Home":
|
|
45
|
+
focus = 0;
|
|
46
|
+
break;
|
|
47
|
+
case "End":
|
|
48
|
+
focus = count - 1;
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
return { state, preventDefault: false };
|
|
52
|
+
}
|
|
53
|
+
return count > 0 ? { state, preventDefault: true, focus } : { state, preventDefault: true };
|
|
54
|
+
}
|
|
55
|
+
function activeDescendantKeydown(state, event, context, config) {
|
|
56
|
+
const { labels } = context;
|
|
57
|
+
const count = labels.length;
|
|
58
|
+
const clamp = config.clamp ?? false;
|
|
59
|
+
const move = (delta) => {
|
|
60
|
+
if (count === 0)
|
|
61
|
+
return { state, preventDefault: true };
|
|
62
|
+
const activeIndex = stepListboxIndex(state.activeIndex, delta, count, clamp);
|
|
63
|
+
return {
|
|
64
|
+
state: { ...state, activeIndex },
|
|
65
|
+
preventDefault: true,
|
|
66
|
+
setActiveIndex: activeIndex,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
const jump = (activeIndex) => ({
|
|
70
|
+
state: { ...state, activeIndex },
|
|
71
|
+
preventDefault: true,
|
|
72
|
+
setActiveIndex: activeIndex,
|
|
73
|
+
});
|
|
74
|
+
const pageSize = config.pageSize ?? 10;
|
|
75
|
+
switch (event.key) {
|
|
76
|
+
case "ArrowDown":
|
|
77
|
+
return move(1);
|
|
78
|
+
case "ArrowUp":
|
|
79
|
+
return move(-1);
|
|
80
|
+
case "Home":
|
|
81
|
+
return jump(count ? 0 : -1);
|
|
82
|
+
case "End":
|
|
83
|
+
return jump(count - 1);
|
|
84
|
+
case "PageDown":
|
|
85
|
+
return move(pageSize);
|
|
86
|
+
case "PageUp":
|
|
87
|
+
return move(-pageSize);
|
|
88
|
+
case "Enter":
|
|
89
|
+
case " ":
|
|
90
|
+
return state.activeIndex >= 0
|
|
91
|
+
? { state, preventDefault: true, activate: state.activeIndex }
|
|
92
|
+
: { state, preventDefault: true };
|
|
93
|
+
case "Escape":
|
|
94
|
+
return { state, preventDefault: true, escape: true };
|
|
95
|
+
case "Tab":
|
|
96
|
+
return { state, preventDefault: false, tabOut: true };
|
|
97
|
+
}
|
|
98
|
+
if (!config.typeahead || !isTypeaheadKey(event) || count === 0)
|
|
99
|
+
return { state, preventDefault: false };
|
|
100
|
+
const typeahead = nextTypeaheadState(state.typeahead, event.key, context.now ?? 0, config.typeaheadResetMs ?? LISTBOX_TYPEAHEAD_RESET_MS);
|
|
101
|
+
const match = findTypeaheadMatch(labels, state.activeIndex < 0 ? 0 : state.activeIndex, typeahead.prefix);
|
|
102
|
+
if (match < 0)
|
|
103
|
+
return { state: { ...state, typeahead }, preventDefault: false };
|
|
104
|
+
return {
|
|
105
|
+
state: { activeIndex: match, typeahead },
|
|
106
|
+
preventDefault: false,
|
|
107
|
+
setActiveIndex: match,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/** The transition for one key press. Never mutates `state`. */
|
|
111
|
+
export function listboxKeydown(state, event, context, config = {}) {
|
|
112
|
+
if ((config.navigation ?? "roving-focus") === "active-descendant") {
|
|
113
|
+
return activeDescendantKeydown(state, event, context, config);
|
|
114
|
+
}
|
|
115
|
+
return rovingKeydown(state, event.key, context.labels.length, context.focusedIndex ?? -1);
|
|
116
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search matching shared by the data grid, kanban board, Gantt chart and calendar: pure, so it is unit-tested without a browser.
|
|
3
|
+
*
|
|
4
|
+
* A query is split on whitespace into terms; every term must appear (AND), in any order, ignoring case and diacritics
|
|
5
|
+
* ("cafe" finds "Café"). An empty query matches everything.
|
|
6
|
+
*/
|
|
7
|
+
/** Lower-case and strip combining marks, so matching ignores case and diacritics. */
|
|
8
|
+
export declare function foldText(text: string): string;
|
|
9
|
+
/** The terms of a query, folded; empty when the query is blank. */
|
|
10
|
+
export declare function searchTerms(query: string): string[];
|
|
11
|
+
/** True when every term of `query` appears in `text`. */
|
|
12
|
+
export declare function matchesSearch(text: string, query: string): boolean;
|
|
13
|
+
export type SearchSegment = {
|
|
14
|
+
text: string;
|
|
15
|
+
match: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* `text` cut into runs, marking the parts any term matches (for `<mark>`). Folding can change a string's length (a precomposed "é"
|
|
19
|
+
* is one character, its folded form too, but a ligature may not be), so matching works on a per-character fold and falls back to
|
|
20
|
+
* one unmarked segment if the two ever disagree.
|
|
21
|
+
*/
|
|
22
|
+
export declare function highlightSegments(text: string, query: string): SearchSegment[];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search matching shared by the data grid, kanban board, Gantt chart and calendar: pure, so it is unit-tested without a browser.
|
|
3
|
+
*
|
|
4
|
+
* A query is split on whitespace into terms; every term must appear (AND), in any order, ignoring case and diacritics
|
|
5
|
+
* ("cafe" finds "Café"). An empty query matches everything.
|
|
6
|
+
*/
|
|
7
|
+
/** Lower-case and strip combining marks, so matching ignores case and diacritics. */
|
|
8
|
+
export function foldText(text) {
|
|
9
|
+
return text
|
|
10
|
+
.normalize("NFD")
|
|
11
|
+
.replace(/\p{M}+/gu, "")
|
|
12
|
+
.toLowerCase();
|
|
13
|
+
}
|
|
14
|
+
/** The terms of a query, folded; empty when the query is blank. */
|
|
15
|
+
export function searchTerms(query) {
|
|
16
|
+
return foldText(query).split(/\s+/).filter(Boolean);
|
|
17
|
+
}
|
|
18
|
+
/** True when every term of `query` appears in `text`. */
|
|
19
|
+
export function matchesSearch(text, query) {
|
|
20
|
+
const terms = searchTerms(query);
|
|
21
|
+
if (terms.length === 0)
|
|
22
|
+
return true;
|
|
23
|
+
const folded = foldText(text);
|
|
24
|
+
return terms.every((term) => folded.includes(term));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* `text` cut into runs, marking the parts any term matches (for `<mark>`). Folding can change a string's length (a precomposed "é"
|
|
28
|
+
* is one character, its folded form too, but a ligature may not be), so matching works on a per-character fold and falls back to
|
|
29
|
+
* one unmarked segment if the two ever disagree.
|
|
30
|
+
*/
|
|
31
|
+
export function highlightSegments(text, query) {
|
|
32
|
+
const terms = searchTerms(query);
|
|
33
|
+
if (terms.length === 0 || text === "")
|
|
34
|
+
return [{ text, match: false }];
|
|
35
|
+
const chars = Array.from(text);
|
|
36
|
+
const folded = chars.map((c) => foldText(c));
|
|
37
|
+
if (folded.some((f) => f.length !== 1))
|
|
38
|
+
return [{ text, match: false }];
|
|
39
|
+
const flat = folded.join("");
|
|
40
|
+
const marked = new Array(chars.length).fill(false);
|
|
41
|
+
for (const term of terms) {
|
|
42
|
+
for (let at = flat.indexOf(term); at !== -1; at = flat.indexOf(term, at + 1)) {
|
|
43
|
+
for (let i = at; i < at + term.length; i++)
|
|
44
|
+
marked[i] = true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const out = [];
|
|
48
|
+
chars.forEach((c, i) => {
|
|
49
|
+
const last = out[out.length - 1];
|
|
50
|
+
if (last && last.match === marked[i])
|
|
51
|
+
last.text += c;
|
|
52
|
+
else
|
|
53
|
+
out.push({ text: c, match: marked[i] });
|
|
54
|
+
});
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const TYPEAHEAD_RESET_MS = 700;
|
|
2
|
+
export type TypeaheadState = {
|
|
3
|
+
prefix: string;
|
|
4
|
+
at: number;
|
|
5
|
+
};
|
|
6
|
+
/** Whether a key press is a type-ahead character: one printable character, no Ctrl, Alt or Meta. */
|
|
7
|
+
export declare function isTypeaheadKey(event: {
|
|
8
|
+
key: string;
|
|
9
|
+
ctrlKey?: boolean;
|
|
10
|
+
altKey?: boolean;
|
|
11
|
+
metaKey?: boolean;
|
|
12
|
+
}): boolean;
|
|
13
|
+
/** The prefix after `key` is pressed at time `now`: it grows while presses are within `resetMs` of each other, else starts over. */
|
|
14
|
+
export declare function nextTypeaheadState(previous: TypeaheadState, key: string, now: number, resetMs?: number): TypeaheadState;
|
|
15
|
+
/**
|
|
16
|
+
* The index of the row to move to, or -1. Searches from the row after `from` and wraps. A prefix of one repeated letter ("ss") is
|
|
17
|
+
* treated as that single letter, so pressing it again steps through the rows starting with it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function findTypeaheadMatch(labels: readonly string[], from: number, prefix: string): number;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-ahead for grids: typing letters moves to the next row whose label starts with them. Pure, so it is unit-tested without a browser.
|
|
3
|
+
* The WAI-ARIA APG listbox / tree model: the letters typed in quick succession form one prefix; the prefix resets after a pause; the same
|
|
4
|
+
* letter pressed again cycles through the rows that start with it.
|
|
5
|
+
*/
|
|
6
|
+
import { foldText } from "./search-text";
|
|
7
|
+
export const TYPEAHEAD_RESET_MS = 700;
|
|
8
|
+
/** Whether a key press is a type-ahead character: one printable character, no Ctrl, Alt or Meta. */
|
|
9
|
+
export function isTypeaheadKey(event) {
|
|
10
|
+
return (event.key.length === 1 &&
|
|
11
|
+
event.key !== " " &&
|
|
12
|
+
!event.ctrlKey &&
|
|
13
|
+
!event.altKey &&
|
|
14
|
+
!event.metaKey);
|
|
15
|
+
}
|
|
16
|
+
/** The prefix after `key` is pressed at time `now`: it grows while presses are within `resetMs` of each other, else starts over. */
|
|
17
|
+
export function nextTypeaheadState(previous, key, now, resetMs = TYPEAHEAD_RESET_MS) {
|
|
18
|
+
const continuing = previous.prefix !== "" && now - previous.at <= resetMs;
|
|
19
|
+
return { prefix: (continuing ? previous.prefix : "") + key, at: now };
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The index of the row to move to, or -1. Searches from the row after `from` and wraps. A prefix of one repeated letter ("ss") is
|
|
23
|
+
* treated as that single letter, so pressing it again steps through the rows starting with it.
|
|
24
|
+
*/
|
|
25
|
+
export function findTypeaheadMatch(labels, from, prefix) {
|
|
26
|
+
const folded = foldText(prefix);
|
|
27
|
+
if (folded === "" || labels.length === 0)
|
|
28
|
+
return -1;
|
|
29
|
+
const repeated = folded.length > 1 && [...folded].every((c) => c === folded[0]);
|
|
30
|
+
const needle = repeated ? folded[0] : folded;
|
|
31
|
+
// A growing prefix ("de") may keep the current row; a single letter, or a repeated one, must move on.
|
|
32
|
+
const startOffset = needle.length > 1 ? 0 : 1;
|
|
33
|
+
for (let step = 0; step < labels.length; step++) {
|
|
34
|
+
const index = (from + startOffset + step + labels.length) % labels.length;
|
|
35
|
+
if (foldText(labels[index]).startsWith(needle))
|
|
36
|
+
return index;
|
|
37
|
+
}
|
|
38
|
+
return -1;
|
|
39
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// MalaysiaKadPengenalanInput component
|
|
3
|
+
//
|
|
4
|
+
// A headless input for entering Malaysia's MyKad Number (NRIC).
|
|
5
|
+
// Format: Twelve digits, usually written YYMMDD-PB-NNNG: the date of birth (year, month, day), a two-digit code for the place of birth (a state or a country), and a four-digit serial whose last digit is odd for a male and even for a female. There is no check digit.
|
|
6
|
+
//
|
|
7
|
+
// Props:
|
|
8
|
+
// className — string, optional. CSS class name.
|
|
9
|
+
// label — string, required. Accessible label for screen readers via aria-label.
|
|
10
|
+
// value — string, default "". Bindable input value; supports bind:value.
|
|
11
|
+
// required — boolean, default false. Whether the input is required for form submission.
|
|
12
|
+
// disabled — boolean, default false. Whether the input is disabled.
|
|
13
|
+
// ...restProps — additional HTML attributes spread onto the <input>.
|
|
14
|
+
//
|
|
15
|
+
// Syntax:
|
|
16
|
+
// <MalaysiaKadPengenalanInput label="MyKad Number (NRIC)" bind:value />
|
|
17
|
+
//
|
|
18
|
+
// Accessibility:
|
|
19
|
+
// - aria-label provides the accessible name for screen readers
|
|
20
|
+
// - autocomplete="off" protects sensitive identifiers
|
|
21
|
+
// - required and disabled states are conveyed to assistive technology
|
|
22
|
+
//
|
|
23
|
+
// Internationalization:
|
|
24
|
+
// - The label prop externalizes user-facing text for translation
|
|
25
|
+
//
|
|
26
|
+
// References:
|
|
27
|
+
// - https://en.wikipedia.org/wiki/MyKad
|
|
28
|
+
|
|
29
|
+
let {
|
|
30
|
+
class: className = "",
|
|
31
|
+
label,
|
|
32
|
+
value = $bindable(""),
|
|
33
|
+
required = false,
|
|
34
|
+
disabled = false,
|
|
35
|
+
...restProps
|
|
36
|
+
}: {
|
|
37
|
+
label: string;
|
|
38
|
+
value?: string;
|
|
39
|
+
required?: boolean;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
} = $props();
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<!-- MalaysiaKadPengenalanInput.svelte -->
|
|
46
|
+
<input
|
|
47
|
+
class={`malaysia-kad-pengenalan-input ${className}`}
|
|
48
|
+
type="text"
|
|
49
|
+
aria-label={label}
|
|
50
|
+
autocomplete="off"
|
|
51
|
+
bind:value
|
|
52
|
+
{required}
|
|
53
|
+
{disabled}
|
|
54
|
+
{...restProps}
|
|
55
|
+
/>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
label: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
declare const MalaysiaKadPengenalanInput: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
9
|
+
type MalaysiaKadPengenalanInput = ReturnType<typeof MalaysiaKadPengenalanInput>;
|
|
10
|
+
export default MalaysiaKadPengenalanInput;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// MalaysiaKadPengenalanView component
|
|
3
|
+
//
|
|
4
|
+
// A headless display component for showing Malaysia's
|
|
5
|
+
// MyKad Number (NRIC) in a read-only format.
|
|
6
|
+
// Format: Twelve digits, usually written YYMMDD-PB-NNNG: the date of birth (year, month, day), a two-digit code for the place of birth (a state or a country), and a four-digit serial whose last digit is odd for a male and even for a female. There is no check digit.
|
|
7
|
+
//
|
|
8
|
+
// Props:
|
|
9
|
+
// className — string, optional. CSS class name.
|
|
10
|
+
// label — string, required. Accessible label for screen readers via aria-label.
|
|
11
|
+
// value — string, default "". The identifier string to display.
|
|
12
|
+
// ...restProps — additional HTML attributes spread onto the <span>.
|
|
13
|
+
//
|
|
14
|
+
// Syntax:
|
|
15
|
+
// <MalaysiaKadPengenalanView label="MyKad Number (NRIC)" value={value} />
|
|
16
|
+
//
|
|
17
|
+
// Accessibility:
|
|
18
|
+
// - aria-label provides the accessible name so screen readers announce the purpose
|
|
19
|
+
//
|
|
20
|
+
// References:
|
|
21
|
+
// - https://en.wikipedia.org/wiki/MyKad
|
|
22
|
+
|
|
23
|
+
let {
|
|
24
|
+
class: className = "",
|
|
25
|
+
label,
|
|
26
|
+
value = "",
|
|
27
|
+
...restProps
|
|
28
|
+
}: {
|
|
29
|
+
label: string;
|
|
30
|
+
value?: string;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
} = $props();
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<!-- MalaysiaKadPengenalanView.svelte -->
|
|
36
|
+
<span
|
|
37
|
+
class={`malaysia-kad-pengenalan-view ${className}`}
|
|
38
|
+
aria-label={label}
|
|
39
|
+
{...restProps}>{value}</span
|
|
40
|
+
>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
label: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
declare const MalaysiaKadPengenalanView: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type MalaysiaKadPengenalanView = ReturnType<typeof MalaysiaKadPengenalanView>;
|
|
8
|
+
export default MalaysiaKadPengenalanView;
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
children,
|
|
11
11
|
...restProps
|
|
12
12
|
}: {
|
|
13
|
-
|
|
14
13
|
/** The content. */
|
|
15
14
|
children?: Snippet;
|
|
16
15
|
[key: string]: unknown;
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
<!-- Mark.svelte -->
|
|
21
20
|
<mark
|
|
22
21
|
class={`mark ${className}`}
|
|
23
|
-
|
|
24
22
|
{...restProps}
|
|
25
23
|
>
|
|
26
24
|
{@render children?.()}
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
//
|
|
25
25
|
// Accessibility:
|
|
26
26
|
// - <input role="combobox"> with aria-haspopup="listbox", aria-expanded,
|
|
27
|
-
// aria-autocomplete="list", aria-label
|
|
27
|
+
// aria-autocomplete="list", aria-label, and aria-controls pointing at the
|
|
28
|
+
// suggestions panel's generated id.
|
|
28
29
|
//
|
|
29
30
|
// Internationalization:
|
|
30
31
|
// - label, placeholder, triggerChar all come through props.
|
|
@@ -39,6 +40,8 @@
|
|
|
39
40
|
|
|
40
41
|
import type { Snippet } from "svelte";
|
|
41
42
|
|
|
43
|
+
import { popoverState } from "../Popover/popover.js";
|
|
44
|
+
|
|
42
45
|
let {
|
|
43
46
|
class: className = "",
|
|
44
47
|
label,
|
|
@@ -71,6 +74,9 @@
|
|
|
71
74
|
children?: Snippet;
|
|
72
75
|
[key: string]: unknown;
|
|
73
76
|
} = $props();
|
|
77
|
+
|
|
78
|
+
const uid = $props.id();
|
|
79
|
+
const suggestionsId = `${uid}-suggestions`;
|
|
74
80
|
</script>
|
|
75
81
|
|
|
76
82
|
<!-- MentionsInput.svelte -->
|
|
@@ -85,6 +91,7 @@
|
|
|
85
91
|
role="combobox"
|
|
86
92
|
aria-label={label}
|
|
87
93
|
aria-haspopup="listbox"
|
|
94
|
+
aria-controls={suggestionsId}
|
|
88
95
|
aria-expanded={expanded}
|
|
89
96
|
aria-autocomplete="list"
|
|
90
97
|
{value}
|
|
@@ -92,7 +99,12 @@
|
|
|
92
99
|
{disabled}
|
|
93
100
|
{oninput}
|
|
94
101
|
/>
|
|
95
|
-
<div
|
|
102
|
+
<div
|
|
103
|
+
class="mentions-input-suggestions"
|
|
104
|
+
id={suggestionsId}
|
|
105
|
+
popover="manual"
|
|
106
|
+
use:popoverState={expanded}
|
|
107
|
+
>
|
|
96
108
|
{#if children}{@render children?.()}{/if}
|
|
97
109
|
</div>
|
|
98
110
|
</div>
|
|
@@ -78,9 +78,7 @@
|
|
|
78
78
|
|
|
79
79
|
function onkeydown(event: KeyboardEvent) {
|
|
80
80
|
if (!menuRef) return;
|
|
81
|
-
const items = Array.from(
|
|
82
|
-
menuRef.querySelectorAll<HTMLElement>("[role='menuitem']"),
|
|
83
|
-
);
|
|
81
|
+
const items = Array.from(menuRef.querySelectorAll<HTMLElement>("[role='menuitem']"));
|
|
84
82
|
const current = document.activeElement as HTMLElement;
|
|
85
83
|
const index = items.indexOf(current);
|
|
86
84
|
switch (event.key) {
|
|
@@ -70,9 +70,7 @@
|
|
|
70
70
|
|
|
71
71
|
function onkeydown(event: KeyboardEvent) {
|
|
72
72
|
if (!barRef) return;
|
|
73
|
-
const items = Array.from(
|
|
74
|
-
barRef.querySelectorAll<HTMLElement>("[role='menuitem']"),
|
|
75
|
-
);
|
|
73
|
+
const items = Array.from(barRef.querySelectorAll<HTMLElement>("[role='menuitem']"));
|
|
76
74
|
const current = document.activeElement as HTMLElement;
|
|
77
75
|
const index = items.indexOf(current);
|
|
78
76
|
switch (event.key) {
|
|
@@ -52,7 +52,12 @@
|
|
|
52
52
|
aria-label={label}
|
|
53
53
|
{...restProps}
|
|
54
54
|
>
|
|
55
|
-
<div
|
|
55
|
+
<div
|
|
56
|
+
class="menu-group-heading"
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
>
|
|
59
|
+
{label}
|
|
60
|
+
</div>
|
|
56
61
|
{#if children}
|
|
57
62
|
{@render children?.()}
|
|
58
63
|
{/if}
|
|
@@ -72,13 +72,19 @@
|
|
|
72
72
|
const style = getComputedStyle(root);
|
|
73
73
|
context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize} ${style.fontFamily}`;
|
|
74
74
|
const ctx = context;
|
|
75
|
-
const result = truncateMiddle(text, {
|
|
75
|
+
const result = truncateMiddle(text, {
|
|
76
|
+
ellipsis,
|
|
77
|
+
strategy,
|
|
78
|
+
end,
|
|
79
|
+
maxWidth: width,
|
|
80
|
+
measure: (s) => ctx.measureText(s).width,
|
|
81
|
+
});
|
|
76
82
|
shown = result === text ? null : result;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
// Re-measure whenever the text or the options change.
|
|
80
86
|
$effect(() => {
|
|
81
|
-
text
|
|
87
|
+
void [text, ellipsis, strategy, end]; // read so the effect tracks them
|
|
82
88
|
recalculate();
|
|
83
89
|
});
|
|
84
90
|
|
|
@@ -105,4 +111,8 @@
|
|
|
105
111
|
data-strategy={strategy}
|
|
106
112
|
data-truncated={shown === null ? undefined : ""}
|
|
107
113
|
{...restProps}
|
|
108
|
-
><span
|
|
114
|
+
><span
|
|
115
|
+
class="middle-truncation-visual"
|
|
116
|
+
aria-hidden="true">{displayed}</span
|
|
117
|
+
><span class="middle-truncation-full">{text}</span></span
|
|
118
|
+
>
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<!-- MockupBrowser.svelte -->
|
|
16
|
-
<div
|
|
16
|
+
<div
|
|
17
|
+
class={`mockup-browser ${className}`}
|
|
18
|
+
aria-label={label}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
17
21
|
{@render children?.()}
|
|
18
22
|
</div>
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<!-- MockupLaptop.svelte -->
|
|
16
|
-
<div
|
|
16
|
+
<div
|
|
17
|
+
class={`mockup-laptop ${className}`}
|
|
18
|
+
aria-label={label}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
17
21
|
{@render children?.()}
|
|
18
22
|
</div>
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<!-- MockupPhonePortrait.svelte -->
|
|
16
|
-
<div
|
|
16
|
+
<div
|
|
17
|
+
class={`mockup-phone-portrait ${className}`}
|
|
18
|
+
aria-label={label}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
17
21
|
{@render children?.()}
|
|
18
22
|
</div>
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<!-- MockupTabletLandscape.svelte -->
|
|
16
|
-
<div
|
|
16
|
+
<div
|
|
17
|
+
class={`mockup-tablet-landscape ${className}`}
|
|
18
|
+
aria-label={label}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
17
21
|
{@render children?.()}
|
|
18
22
|
</div>
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<!-- MockupTabletPortrait.svelte -->
|
|
16
|
-
<div
|
|
16
|
+
<div
|
|
17
|
+
class={`mockup-tablet-portrait ${className}`}
|
|
18
|
+
aria-label={label}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
17
21
|
{@render children?.()}
|
|
18
22
|
</div>
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<!-- MockupWindow.svelte -->
|
|
16
|
-
<div
|
|
16
|
+
<div
|
|
17
|
+
class={`mockup-window ${className}`}
|
|
18
|
+
aria-label={label}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
17
21
|
{@render children?.()}
|
|
18
22
|
</div>
|