@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
package/dist/components/ColombiaCedulaDeCiudadaniaInput/ColombiaCedulaDeCiudadaniaInput.svelte
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// ColombiaCedulaDeCiudadaniaInput component
|
|
3
|
+
//
|
|
4
|
+
// A headless input for entering Colombia's Cedula de Ciudadania Number.
|
|
5
|
+
// Format: Six to ten digits, usually written with dots as thousands separators (1.020.304.050). Newer cards carry the ten-digit Número Único de Identificación Personal (NUIP). 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
|
+
// <ColombiaCedulaDeCiudadaniaInput label="Cedula de Ciudadania Number" 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/Colombian_identity_card
|
|
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
|
+
<!-- ColombiaCedulaDeCiudadaniaInput.svelte -->
|
|
46
|
+
<input
|
|
47
|
+
class={`colombia-cedula-de-ciudadania-input ${className}`}
|
|
48
|
+
type="text"
|
|
49
|
+
aria-label={label}
|
|
50
|
+
autocomplete="off"
|
|
51
|
+
bind:value
|
|
52
|
+
{required}
|
|
53
|
+
{disabled}
|
|
54
|
+
{...restProps}
|
|
55
|
+
/>
|
package/dist/components/ColombiaCedulaDeCiudadaniaInput/ColombiaCedulaDeCiudadaniaInput.svelte.d.ts
ADDED
|
@@ -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 ColombiaCedulaDeCiudadaniaInput: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
9
|
+
type ColombiaCedulaDeCiudadaniaInput = ReturnType<typeof ColombiaCedulaDeCiudadaniaInput>;
|
|
10
|
+
export default ColombiaCedulaDeCiudadaniaInput;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// ColombiaCedulaDeCiudadaniaView component
|
|
3
|
+
//
|
|
4
|
+
// A headless display component for showing Colombia's
|
|
5
|
+
// Cedula de Ciudadania Number in a read-only format.
|
|
6
|
+
// Format: Six to ten digits, usually written with dots as thousands separators (1.020.304.050). Newer cards carry the ten-digit Número Único de Identificación Personal (NUIP). 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
|
+
// <ColombiaCedulaDeCiudadaniaView label="Cedula de Ciudadania Number" 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/Colombian_identity_card
|
|
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
|
+
<!-- ColombiaCedulaDeCiudadaniaView.svelte -->
|
|
36
|
+
<span
|
|
37
|
+
class={`colombia-cedula-de-ciudadania-view ${className}`}
|
|
38
|
+
aria-label={label}
|
|
39
|
+
{...restProps}>{value}</span
|
|
40
|
+
>
|
package/dist/components/ColombiaCedulaDeCiudadaniaView/ColombiaCedulaDeCiudadaniaView.svelte.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
label: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
declare const ColombiaCedulaDeCiudadaniaView: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ColombiaCedulaDeCiudadaniaView = ReturnType<typeof ColombiaCedulaDeCiudadaniaView>;
|
|
8
|
+
export default ColombiaCedulaDeCiudadaniaView;
|
|
@@ -52,7 +52,11 @@
|
|
|
52
52
|
class={`column-chart ${className}`}
|
|
53
53
|
{...restProps}
|
|
54
54
|
>
|
|
55
|
-
<div
|
|
55
|
+
<div
|
|
56
|
+
class="column-chart-graphic"
|
|
57
|
+
role="img"
|
|
58
|
+
aria-label={label}
|
|
59
|
+
>
|
|
56
60
|
{@render children?.()}
|
|
57
61
|
</div>
|
|
58
62
|
{#if dataTable}
|
|
@@ -57,6 +57,8 @@
|
|
|
57
57
|
const uid = $props.id();
|
|
58
58
|
const listboxId = `combobox-listbox-${uid}`;
|
|
59
59
|
|
|
60
|
+
import { popoverState } from "../Popover/popover.js";
|
|
61
|
+
|
|
60
62
|
let {
|
|
61
63
|
class: className = "",
|
|
62
64
|
label,
|
|
@@ -99,13 +101,13 @@
|
|
|
99
101
|
bind:value
|
|
100
102
|
{onkeydown}
|
|
101
103
|
/>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
104
|
+
<div
|
|
105
|
+
role="listbox"
|
|
106
|
+
popover="manual"
|
|
107
|
+
use:popoverState={open}
|
|
108
|
+
id={listboxId}
|
|
109
|
+
aria-label={label}
|
|
110
|
+
>
|
|
111
|
+
{@render children?.()}
|
|
112
|
+
</div>
|
|
111
113
|
</div>
|
|
@@ -52,7 +52,11 @@
|
|
|
52
52
|
class={`composed-chart ${className}`}
|
|
53
53
|
{...restProps}
|
|
54
54
|
>
|
|
55
|
-
<div
|
|
55
|
+
<div
|
|
56
|
+
class="composed-chart-graphic"
|
|
57
|
+
role="img"
|
|
58
|
+
aria-label={label}
|
|
59
|
+
>
|
|
56
60
|
{@render children?.()}
|
|
57
61
|
</div>
|
|
58
62
|
{#if dataTable}
|
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
<script
|
|
2
|
+
lang="ts"
|
|
3
|
+
module
|
|
4
|
+
>
|
|
5
|
+
/**
|
|
6
|
+
* Which section is current: the last whose top has passed the activation line
|
|
7
|
+
* (`tops` are each section's top relative to the scroller; `offset` is the line).
|
|
8
|
+
* At the bottom of the scroll range the last section wins (a short last section
|
|
9
|
+
* never reaches the line); before the first section, the first.
|
|
10
|
+
*/
|
|
11
|
+
export function activeSectionIndex(tops: number[], offset: number, atBottom: boolean): number {
|
|
12
|
+
if (tops.length === 0) return -1;
|
|
13
|
+
if (atBottom) return tops.length - 1;
|
|
14
|
+
let index = 0;
|
|
15
|
+
for (let i = 0; i < tops.length; i++) {
|
|
16
|
+
if (tops[i] <= offset + 1) index = i;
|
|
17
|
+
}
|
|
18
|
+
return index;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The in-page `<a href="#id">` links inside `nav`. */
|
|
22
|
+
export function contentsLinks(nav: Element): HTMLAnchorElement[] {
|
|
23
|
+
return Array.from(nav.querySelectorAll<HTMLAnchorElement>('a[href^="#"]')).filter(
|
|
24
|
+
(a) => a.getAttribute("href")!.length > 1,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function contentsLinkId(link: Element): string {
|
|
29
|
+
return decodeURIComponent((link.getAttribute("href") ?? "").slice(1));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function contentsTarget(link: Element, doc: Document): HTMLElement | null {
|
|
33
|
+
return doc.getElementById(contentsLinkId(link));
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
1
37
|
<script lang="ts">
|
|
2
38
|
// ContentsNav component
|
|
3
39
|
//
|
|
@@ -131,7 +167,9 @@
|
|
|
131
167
|
if (locked) return;
|
|
132
168
|
if (hashPending) {
|
|
133
169
|
const id = decodeURIComponent(window.location.hash.slice(1));
|
|
134
|
-
const hashed = id
|
|
170
|
+
const hashed = id
|
|
171
|
+
? contentsLinks(nav!).find((a) => contentsLinkId(a) === id)
|
|
172
|
+
: undefined;
|
|
135
173
|
if (hashed) {
|
|
136
174
|
mark(hashed);
|
|
137
175
|
return;
|
|
@@ -174,7 +212,12 @@
|
|
|
174
212
|
|
|
175
213
|
function onClick(event: Event): void {
|
|
176
214
|
const link = (event.target as Element | null)?.closest?.("a");
|
|
177
|
-
if (
|
|
215
|
+
if (
|
|
216
|
+
!link ||
|
|
217
|
+
!nav!.contains(link) ||
|
|
218
|
+
!contentsTarget(link as HTMLAnchorElement, nav!.ownerDocument)
|
|
219
|
+
)
|
|
220
|
+
return;
|
|
178
221
|
// The link is current at once; observer-style updates wait until the scroll settles.
|
|
179
222
|
mark(link as HTMLAnchorElement);
|
|
180
223
|
locked = true;
|
|
@@ -194,13 +237,21 @@
|
|
|
194
237
|
window.addEventListener("hashchange", onHashChange);
|
|
195
238
|
nav.addEventListener("click", onClick);
|
|
196
239
|
// Links rendered or re-pointed after mount (a list built from data) are picked up too.
|
|
197
|
-
const mutations =
|
|
198
|
-
|
|
240
|
+
const mutations =
|
|
241
|
+
typeof MutationObserver === "undefined" ? null : new MutationObserver(schedule);
|
|
242
|
+
mutations?.observe(nav, {
|
|
243
|
+
childList: true,
|
|
244
|
+
subtree: true,
|
|
245
|
+
attributes: true,
|
|
246
|
+
attributeFilter: ["href"],
|
|
247
|
+
});
|
|
199
248
|
|
|
200
249
|
// The URL hash wins on load; otherwise the position decides.
|
|
201
250
|
const initial = decodeURIComponent(window.location.hash.slice(1));
|
|
202
251
|
hashPending = initial !== "";
|
|
203
|
-
const hashLink = initial
|
|
252
|
+
const hashLink = initial
|
|
253
|
+
? contentsLinks(nav).find((a) => contentsLinkId(a) === initial)
|
|
254
|
+
: undefined;
|
|
204
255
|
if (hashLink) mark(hashLink);
|
|
205
256
|
else update();
|
|
206
257
|
|
|
@@ -217,37 +268,6 @@
|
|
|
217
268
|
});
|
|
218
269
|
</script>
|
|
219
270
|
|
|
220
|
-
<script lang="ts" module>
|
|
221
|
-
/**
|
|
222
|
-
* Which section is current: the last whose top has passed the activation line
|
|
223
|
-
* (`tops` are each section's top relative to the scroller; `offset` is the line).
|
|
224
|
-
* At the bottom of the scroll range the last section wins (a short last section
|
|
225
|
-
* never reaches the line); before the first section, the first.
|
|
226
|
-
*/
|
|
227
|
-
export function activeSectionIndex(tops: number[], offset: number, atBottom: boolean): number {
|
|
228
|
-
if (tops.length === 0) return -1;
|
|
229
|
-
if (atBottom) return tops.length - 1;
|
|
230
|
-
let index = 0;
|
|
231
|
-
for (let i = 0; i < tops.length; i++) {
|
|
232
|
-
if (tops[i] <= offset + 1) index = i;
|
|
233
|
-
}
|
|
234
|
-
return index;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/** The in-page `<a href="#id">` links inside `nav`. */
|
|
238
|
-
export function contentsLinks(nav: Element): HTMLAnchorElement[] {
|
|
239
|
-
return Array.from(nav.querySelectorAll<HTMLAnchorElement>('a[href^="#"]')).filter((a) => a.getAttribute("href")!.length > 1);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export function contentsLinkId(link: Element): string {
|
|
243
|
-
return decodeURIComponent((link.getAttribute("href") ?? "").slice(1));
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
export function contentsTarget(link: Element, doc: Document): HTMLElement | null {
|
|
247
|
-
return doc.getElementById(contentsLinkId(link));
|
|
248
|
-
}
|
|
249
|
-
</script>
|
|
250
|
-
|
|
251
271
|
<!-- ContentsNav.svelte -->
|
|
252
272
|
<nav
|
|
253
273
|
bind:this={navEl}
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
// - WAI-ARIA Menu Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/menu/
|
|
53
53
|
|
|
54
54
|
import type { Snippet } from "svelte";
|
|
55
|
+
import { popoverState, toggleOpened } from "../Popover/popover.js";
|
|
55
56
|
|
|
56
57
|
let {
|
|
57
58
|
class: className = "",
|
|
@@ -75,8 +76,7 @@
|
|
|
75
76
|
// When the menu opens, focus the first menuitem.
|
|
76
77
|
$effect(() => {
|
|
77
78
|
if (open && menuRef) {
|
|
78
|
-
const firstItem =
|
|
79
|
-
menuRef.querySelector<HTMLElement>("[role='menuitem']");
|
|
79
|
+
const firstItem = menuRef.querySelector<HTMLElement>("[role='menuitem']");
|
|
80
80
|
firstItem?.focus();
|
|
81
81
|
}
|
|
82
82
|
});
|
|
@@ -84,9 +84,7 @@
|
|
|
84
84
|
// Keyboard navigation within the menu.
|
|
85
85
|
function onkeydown(event: KeyboardEvent) {
|
|
86
86
|
if (!menuRef) return;
|
|
87
|
-
const items = Array.from(
|
|
88
|
-
menuRef.querySelectorAll<HTMLElement>("[role='menuitem']"),
|
|
89
|
-
);
|
|
87
|
+
const items = Array.from(menuRef.querySelectorAll<HTMLElement>("[role='menuitem']"));
|
|
90
88
|
const current = document.activeElement as HTMLElement;
|
|
91
89
|
const index = items.indexOf(current);
|
|
92
90
|
|
|
@@ -122,15 +120,19 @@
|
|
|
122
120
|
}
|
|
123
121
|
</script>
|
|
124
122
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
{
|
|
123
|
+
<!-- popover="auto": there is no declarative trigger (a right-click or long-press opens it), so popoverState shows it
|
|
124
|
+
with showPopover() when `open` turns true, in the top layer; light dismiss and Escape come from the browser and the
|
|
125
|
+
toggle event writes `open` back. Positioning at the pointer stays the consumer's CSS. -->
|
|
126
|
+
<div
|
|
127
|
+
class={`context-menu ${className}`}
|
|
128
|
+
role="menu"
|
|
129
|
+
aria-label={label}
|
|
130
|
+
popover="auto"
|
|
131
|
+
bind:this={menuRef}
|
|
132
|
+
use:popoverState={open}
|
|
133
|
+
ontoggle={(event) => (open = toggleOpened(event))}
|
|
134
|
+
{onkeydown}
|
|
135
|
+
{...restProps}
|
|
136
|
+
>
|
|
137
|
+
{@render children?.()}
|
|
138
|
+
</div>
|
|
@@ -3,49 +3,56 @@
|
|
|
3
3
|
//
|
|
4
4
|
// A help button that opens a popover with explanatory content. Renders a
|
|
5
5
|
// wrapper `<div>` containing a `<button>` trigger (aria-haspopup="dialog",
|
|
6
|
-
// aria-expanded, aria-controls) and a `<div role="dialog">`
|
|
7
|
-
//
|
|
8
|
-
//
|
|
6
|
+
// aria-expanded, aria-controls) and a `<div role="dialog" popover="auto">`
|
|
7
|
+
// panel. The trigger opens and closes the panel through the native Popover
|
|
8
|
+
// API with command="toggle-popover" commandfor={panelId} (and popovertarget
|
|
9
|
+
// for engines before command/commandfor), so open, Escape and light dismiss
|
|
10
|
+
// need no script; the panel's `toggle` event keeps `expanded` in step. Where
|
|
11
|
+
// the Popover API is missing (jsdom, old engines) the trigger's click toggles
|
|
12
|
+
// `expanded` and the panel's `hidden` attribute instead.
|
|
9
13
|
//
|
|
10
14
|
// Props:
|
|
11
15
|
// class — string, optional. CSS class appended to the base class.
|
|
12
|
-
// label — string, REQUIRED. aria-label for the trigger button.
|
|
13
|
-
//
|
|
14
|
-
//
|
|
16
|
+
// label — string, REQUIRED. aria-label for the trigger button (its accessible name).
|
|
17
|
+
// triggerLabel — string, REQUIRED. Visible text of the trigger, such as "?" or "؟".
|
|
18
|
+
// No default: the glyph is the consumer's, per script and locale. Pass "" when
|
|
19
|
+
// the consumer's CSS draws an icon instead.
|
|
20
|
+
// expanded — boolean, default false, bindable. Whether the popover is open;
|
|
21
|
+
// set by the browser's toggle (trigger, Escape, light dismiss).
|
|
22
|
+
// onclick — (event: MouseEvent) => void, optional. Trigger click handler;
|
|
23
|
+
// call event.preventDefault() to stop the trigger toggling the panel.
|
|
15
24
|
// children — Snippet, optional. Popover content.
|
|
16
25
|
//
|
|
17
26
|
// Syntax:
|
|
18
|
-
// <ContextualHelp label="Help"
|
|
27
|
+
// <ContextualHelp label="Help" triggerLabel="?" bind:expanded>
|
|
19
28
|
// <p>Help content</p>
|
|
20
29
|
// </ContextualHelp>
|
|
21
30
|
//
|
|
31
|
+
// Keyboard:
|
|
32
|
+
// - Enter / Space on the trigger toggles the panel
|
|
33
|
+
// - Escape closes the panel (browser, Popover API)
|
|
34
|
+
//
|
|
22
35
|
// Accessibility:
|
|
23
36
|
// - Trigger: aria-haspopup="dialog", aria-expanded, aria-controls
|
|
24
|
-
// - Panel: role="dialog", id matched by aria-controls
|
|
37
|
+
// - Panel: role="dialog", id matched by aria-controls and commandfor
|
|
25
38
|
//
|
|
26
39
|
// Internationalization:
|
|
27
|
-
// - All user-facing strings via props
|
|
40
|
+
// - All user-facing strings via props: label (accessible name) and
|
|
41
|
+
// triggerLabel (visible glyph or text)
|
|
28
42
|
//
|
|
29
43
|
// References:
|
|
30
44
|
// - Adobe Spectrum ContextualHelp: https://spectrum.adobe.com/page/contextual-help/
|
|
31
45
|
// - WAI-ARIA Dialog Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
46
|
+
// - HTML command and commandfor: https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-command
|
|
32
47
|
|
|
33
48
|
import type { Snippet } from "svelte";
|
|
34
|
-
|
|
35
|
-
function makeId(prefix: string): string {
|
|
36
|
-
if (
|
|
37
|
-
typeof crypto !== "undefined" &&
|
|
38
|
-
typeof crypto.randomUUID === "function"
|
|
39
|
-
) {
|
|
40
|
-
return `${prefix}-${crypto.randomUUID()}`;
|
|
41
|
-
}
|
|
42
|
-
return `${prefix}-${Math.random().toString(36).slice(2, 11)}`;
|
|
43
|
-
}
|
|
49
|
+
import { popoverState, popoverSupported, toggleOpened } from "../Popover/popover.js";
|
|
44
50
|
|
|
45
51
|
let {
|
|
46
52
|
class: className = "",
|
|
47
53
|
label,
|
|
48
|
-
|
|
54
|
+
triggerLabel,
|
|
55
|
+
expanded = $bindable(false),
|
|
49
56
|
onclick = undefined,
|
|
50
57
|
children = undefined,
|
|
51
58
|
...restProps
|
|
@@ -53,7 +60,9 @@
|
|
|
53
60
|
class?: string;
|
|
54
61
|
/** Accessible label for the trigger (REQUIRED) */
|
|
55
62
|
label: string;
|
|
56
|
-
/**
|
|
63
|
+
/** Visible text of the trigger, such as "?" (REQUIRED; no default) */
|
|
64
|
+
triggerLabel: string;
|
|
65
|
+
/** Whether the popover is open. Bindable. */
|
|
57
66
|
expanded?: boolean;
|
|
58
67
|
/** Trigger click handler */
|
|
59
68
|
onclick?: (event: MouseEvent) => void;
|
|
@@ -62,11 +71,25 @@
|
|
|
62
71
|
[key: string]: unknown;
|
|
63
72
|
} = $props();
|
|
64
73
|
|
|
65
|
-
|
|
74
|
+
// Hydration-stable: the server and the client agree on it, so commandfor still names the panel.
|
|
75
|
+
const uid = $props.id();
|
|
76
|
+
const panelId = `contextual-help-panel-${uid}`;
|
|
77
|
+
let panel: HTMLDivElement | undefined = $state();
|
|
78
|
+
|
|
79
|
+
function toggle(event: MouseEvent) {
|
|
80
|
+
onclick?.(event);
|
|
81
|
+
if (event.defaultPrevented) return;
|
|
82
|
+
// With the Popover API the browser toggles the panel (command / popovertarget) and the toggle event
|
|
83
|
+
// updates `expanded`; without it, toggle here.
|
|
84
|
+
if (panel && !popoverSupported(panel)) expanded = !expanded;
|
|
85
|
+
}
|
|
66
86
|
</script>
|
|
67
87
|
|
|
68
88
|
<!-- ContextualHelp.svelte -->
|
|
69
|
-
<div
|
|
89
|
+
<div
|
|
90
|
+
class={`contextual-help ${className}`}
|
|
91
|
+
{...restProps}
|
|
92
|
+
>
|
|
70
93
|
<button
|
|
71
94
|
class="contextual-help-trigger"
|
|
72
95
|
type="button"
|
|
@@ -74,13 +97,19 @@
|
|
|
74
97
|
aria-haspopup="dialog"
|
|
75
98
|
aria-expanded={expanded}
|
|
76
99
|
aria-controls={panelId}
|
|
77
|
-
|
|
78
|
-
|
|
100
|
+
command="toggle-popover"
|
|
101
|
+
commandfor={panelId}
|
|
102
|
+
popovertarget={panelId}
|
|
103
|
+
onclick={toggle}>{triggerLabel}</button
|
|
104
|
+
>
|
|
79
105
|
<div
|
|
106
|
+
bind:this={panel}
|
|
80
107
|
class="contextual-help-panel"
|
|
81
108
|
id={panelId}
|
|
82
109
|
role="dialog"
|
|
83
|
-
|
|
110
|
+
popover="auto"
|
|
111
|
+
use:popoverState={expanded}
|
|
112
|
+
ontoggle={(event) => (expanded = toggleOpened(event))}
|
|
84
113
|
>
|
|
85
114
|
{#if children}
|
|
86
115
|
{@render children?.()}
|
|
@@ -3,7 +3,9 @@ type $$ComponentProps = {
|
|
|
3
3
|
class?: string;
|
|
4
4
|
/** Accessible label for the trigger (REQUIRED) */
|
|
5
5
|
label: string;
|
|
6
|
-
/**
|
|
6
|
+
/** Visible text of the trigger, such as "?" (REQUIRED; no default) */
|
|
7
|
+
triggerLabel: string;
|
|
8
|
+
/** Whether the popover is open. Bindable. */
|
|
7
9
|
expanded?: boolean;
|
|
8
10
|
/** Trigger click handler */
|
|
9
11
|
onclick?: (event: MouseEvent) => void;
|
|
@@ -11,6 +13,6 @@ type $$ComponentProps = {
|
|
|
11
13
|
children?: Snippet;
|
|
12
14
|
[key: string]: unknown;
|
|
13
15
|
};
|
|
14
|
-
declare const ContextualHelp: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
16
|
+
declare const ContextualHelp: import("svelte").Component<$$ComponentProps, {}, "expanded">;
|
|
15
17
|
type ContextualHelp = ReturnType<typeof ContextualHelp>;
|
|
16
18
|
export default ContextualHelp;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// ConvertDiv component
|
|
3
|
+
//
|
|
4
|
+
// A headless part of ConvertDiv: a group that converts a value from one unit into another, such as dollars into euros or miles into kilometres. Contract: a plain <div> with the base class and children; role="group" named by `label`.
|
|
5
|
+
// Converts nothing and carries no strings of its own; the consumer supplies the controls.
|
|
6
|
+
import type { Snippet } from "svelte";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
class: className = "",
|
|
10
|
+
label,
|
|
11
|
+
children,
|
|
12
|
+
...restProps
|
|
13
|
+
}: {
|
|
14
|
+
/** Accessible name of the group (required). */
|
|
15
|
+
label: string;
|
|
16
|
+
|
|
17
|
+
/** The content. */
|
|
18
|
+
children?: Snippet;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
} = $props();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<!-- ConvertDiv.svelte -->
|
|
24
|
+
<div
|
|
25
|
+
class={`convert-div ${className}`}
|
|
26
|
+
role="group"
|
|
27
|
+
aria-label={label}
|
|
28
|
+
{...restProps}
|
|
29
|
+
>
|
|
30
|
+
{@render children?.()}
|
|
31
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
/** Accessible name of the group (required). */
|
|
4
|
+
label: string;
|
|
5
|
+
/** The content. */
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
declare const ConvertDiv: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type ConvertDiv = ReturnType<typeof ConvertDiv>;
|
|
11
|
+
export default ConvertDiv;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// ConvertFromDiv component
|
|
3
|
+
//
|
|
4
|
+
// A headless part of ConvertDiv: the source side of a conversion, holding the value and unit to convert from. Contract: a plain <div> with the base class and children.
|
|
5
|
+
// Converts nothing and carries no strings of its own; the consumer supplies the controls.
|
|
6
|
+
import type { Snippet } from "svelte";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
class: className = "",
|
|
10
|
+
children,
|
|
11
|
+
...restProps
|
|
12
|
+
}: {
|
|
13
|
+
/** The content. */
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
} = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<!-- ConvertFromDiv.svelte -->
|
|
20
|
+
<div
|
|
21
|
+
class={`convert-from-div ${className}`}
|
|
22
|
+
{...restProps}
|
|
23
|
+
>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
/** The content. */
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
declare const ConvertFromDiv: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type ConvertFromDiv = ReturnType<typeof ConvertFromDiv>;
|
|
9
|
+
export default ConvertFromDiv;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// ConvertFromUnitDiv component
|
|
3
|
+
//
|
|
4
|
+
// A headless part of ConvertDiv: the unit to convert from, such as a select box of currencies or lengths. Contract: a plain <div> with the base class and children.
|
|
5
|
+
// Converts nothing and carries no strings of its own; the consumer supplies the controls.
|
|
6
|
+
import type { Snippet } from "svelte";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
class: className = "",
|
|
10
|
+
children,
|
|
11
|
+
...restProps
|
|
12
|
+
}: {
|
|
13
|
+
/** The content. */
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
} = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<!-- ConvertFromUnitDiv.svelte -->
|
|
20
|
+
<div
|
|
21
|
+
class={`convert-from-unit-div ${className}`}
|
|
22
|
+
{...restProps}
|
|
23
|
+
>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
</div>
|