@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
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
// - WAI-ARIA menuitem role: https://www.w3.org/TR/wai-aria-1.2/#menuitem
|
|
64
64
|
|
|
65
65
|
import type { Snippet } from "svelte";
|
|
66
|
+
import { popoverState, popoverSupported, toggleOpened } from "../Popover/popover.js";
|
|
66
67
|
|
|
67
68
|
let {
|
|
68
69
|
class: className = "",
|
|
@@ -80,26 +81,27 @@
|
|
|
80
81
|
[key: string]: unknown;
|
|
81
82
|
} = $props();
|
|
82
83
|
|
|
84
|
+
const uid = $props.id();
|
|
85
|
+
const menuId = `dropdown-menu-${uid}`;
|
|
83
86
|
let menuRef: HTMLElement | undefined = $state(undefined);
|
|
84
87
|
|
|
85
88
|
// Focus the first menuitem when the menu opens.
|
|
86
89
|
$effect(() => {
|
|
87
90
|
if (open && menuRef) {
|
|
88
|
-
const first =
|
|
89
|
-
menuRef.querySelector<HTMLElement>("[role='menuitem']");
|
|
91
|
+
const first = menuRef.querySelector<HTMLElement>("[role='menuitem']");
|
|
90
92
|
first?.focus();
|
|
91
93
|
}
|
|
92
94
|
});
|
|
93
95
|
|
|
96
|
+
// With the Popover API the trigger's command="toggle-popover" opens and closes the menu and the toggle event
|
|
97
|
+
// writes `open` back; without it, the click toggles `open` and popoverState sets `hidden`.
|
|
94
98
|
function toggleMenu() {
|
|
95
|
-
open = !open;
|
|
99
|
+
if (menuRef && !popoverSupported(menuRef)) open = !open;
|
|
96
100
|
}
|
|
97
101
|
|
|
98
102
|
function onMenuKeydown(event: KeyboardEvent) {
|
|
99
103
|
if (!menuRef) return;
|
|
100
|
-
const items = Array.from(
|
|
101
|
-
menuRef.querySelectorAll<HTMLElement>("[role='menuitem']"),
|
|
102
|
-
);
|
|
104
|
+
const items = Array.from(menuRef.querySelectorAll<HTMLElement>("[role='menuitem']"));
|
|
103
105
|
const current = document.activeElement as HTMLElement;
|
|
104
106
|
const index = items.indexOf(current);
|
|
105
107
|
|
|
@@ -145,18 +147,27 @@
|
|
|
145
147
|
aria-haspopup="true"
|
|
146
148
|
aria-expanded={open}
|
|
147
149
|
aria-label={label}
|
|
150
|
+
aria-controls={menuId}
|
|
151
|
+
command="toggle-popover"
|
|
152
|
+
commandfor={menuId}
|
|
153
|
+
popovertarget={menuId}
|
|
148
154
|
onclick={toggleMenu}
|
|
149
155
|
>
|
|
150
156
|
{label}
|
|
151
157
|
</button>
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
<!-- popover="auto": top layer, light dismiss and Escape from the browser; the arrow-key focus movement over the
|
|
159
|
+
menu items has no native equivalent and stays here. -->
|
|
160
|
+
<!-- svelte-ignore a11y_interactive_supports_focus (the menu container is not a tab stop: items carry tabindex=-1 and onMenuKeydown moves focus to them) -->
|
|
161
|
+
<div
|
|
162
|
+
id={menuId}
|
|
163
|
+
role="menu"
|
|
164
|
+
aria-label={label}
|
|
165
|
+
popover="auto"
|
|
166
|
+
bind:this={menuRef}
|
|
167
|
+
use:popoverState={open}
|
|
168
|
+
ontoggle={(event) => (open = toggleOpened(event))}
|
|
169
|
+
onkeydown={onMenuKeydown}
|
|
170
|
+
>
|
|
171
|
+
{@render children?.()}
|
|
172
|
+
</div>
|
|
162
173
|
</div>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// EcuadorCedulaDeIdentidadInput component
|
|
3
|
+
//
|
|
4
|
+
// A headless input for entering Ecuador's Cedula de Identidad Number.
|
|
5
|
+
// Format: Ten digits: a two-digit province code (01 to 24, or 30 for those born abroad), a third digit below 6 for a natural person, six more digits, and a check digit. The first nine digits are multiplied alternately by 2 and 1 (starting with 2), subtracting 9 from any product above 9, and the check digit brings the sum to the next multiple of 10.
|
|
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
|
+
// <EcuadorCedulaDeIdentidadInput label="Cedula de Identidad 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/C%C3%A9dula_de_identidad
|
|
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
|
+
<!-- EcuadorCedulaDeIdentidadInput.svelte -->
|
|
46
|
+
<input
|
|
47
|
+
class={`ecuador-cedula-de-identidad-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/EcuadorCedulaDeIdentidadInput/EcuadorCedulaDeIdentidadInput.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 EcuadorCedulaDeIdentidadInput: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
9
|
+
type EcuadorCedulaDeIdentidadInput = ReturnType<typeof EcuadorCedulaDeIdentidadInput>;
|
|
10
|
+
export default EcuadorCedulaDeIdentidadInput;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// EcuadorCedulaDeIdentidadView component
|
|
3
|
+
//
|
|
4
|
+
// A headless display component for showing Ecuador's
|
|
5
|
+
// Cedula de Identidad Number in a read-only format.
|
|
6
|
+
// Format: Ten digits: a two-digit province code (01 to 24, or 30 for those born abroad), a third digit below 6 for a natural person, six more digits, and a check digit. The first nine digits are multiplied alternately by 2 and 1 (starting with 2), subtracting 9 from any product above 9, and the check digit brings the sum to the next multiple of 10.
|
|
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
|
+
// <EcuadorCedulaDeIdentidadView label="Cedula de Identidad 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/C%C3%A9dula_de_identidad
|
|
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
|
+
<!-- EcuadorCedulaDeIdentidadView.svelte -->
|
|
36
|
+
<span
|
|
37
|
+
class={`ecuador-cedula-de-identidad-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 EcuadorCedulaDeIdentidadView: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type EcuadorCedulaDeIdentidadView = ReturnType<typeof EcuadorCedulaDeIdentidadView>;
|
|
8
|
+
export default EcuadorCedulaDeIdentidadView;
|
|
@@ -71,7 +71,11 @@
|
|
|
71
71
|
{...restProps}
|
|
72
72
|
>
|
|
73
73
|
{#if imageUrl}
|
|
74
|
-
<img
|
|
74
|
+
<img
|
|
75
|
+
class="feature-card-image"
|
|
76
|
+
src={imageUrl}
|
|
77
|
+
alt={imageAlt ?? ""}
|
|
78
|
+
/>
|
|
75
79
|
{/if}
|
|
76
80
|
<header class="feature-card-header">
|
|
77
81
|
<h3 class="feature-card-heading">{heading}</h3>
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
// - WAI-ARIA Dialog Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
48
48
|
// - MDN dialog element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
|
|
49
49
|
import type { Snippet } from "svelte";
|
|
50
|
+
import { modalDialog } from "../Dialog/modal.js";
|
|
50
51
|
let {
|
|
51
52
|
class: className = "",
|
|
52
53
|
label,
|
|
@@ -71,7 +72,12 @@
|
|
|
71
72
|
{#if open}
|
|
72
73
|
<dialog
|
|
73
74
|
class={`file-dialog ${className}`}
|
|
74
|
-
|
|
75
|
+
use:modalDialog={true}
|
|
76
|
+
oncancel={(event) => {
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
open = false;
|
|
79
|
+
}}
|
|
80
|
+
onclose={() => (open = false)}
|
|
75
81
|
tabindex="-1"
|
|
76
82
|
aria-label={label}
|
|
77
83
|
{onkeydown}
|
|
@@ -48,7 +48,9 @@
|
|
|
48
48
|
let bufferTimer: ReturnType<typeof setTimeout> | undefined;
|
|
49
49
|
|
|
50
50
|
function allItems(): HTMLElement[] {
|
|
51
|
-
return treeRef
|
|
51
|
+
return treeRef
|
|
52
|
+
? Array.from(treeRef.querySelectorAll<HTMLElement>("[role='treeitem']"))
|
|
53
|
+
: [];
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
function parentItem(item: HTMLElement): HTMLElement | null {
|
|
@@ -72,7 +74,11 @@
|
|
|
72
74
|
function ownText(item: HTMLElement): string {
|
|
73
75
|
let text = "";
|
|
74
76
|
item.childNodes.forEach((n) => {
|
|
75
|
-
if (
|
|
77
|
+
if (
|
|
78
|
+
n.nodeType === Node.ELEMENT_NODE &&
|
|
79
|
+
(n as HTMLElement).getAttribute("role") === "group"
|
|
80
|
+
)
|
|
81
|
+
return;
|
|
76
82
|
text += n.textContent ?? "";
|
|
77
83
|
});
|
|
78
84
|
return text.trim().toLowerCase();
|
|
@@ -154,7 +160,10 @@
|
|
|
154
160
|
if (expanded === "false") {
|
|
155
161
|
item.setAttribute("aria-expanded", "true");
|
|
156
162
|
} else if (expanded === "true") {
|
|
157
|
-
focusItem(
|
|
163
|
+
focusItem(
|
|
164
|
+
item.querySelector<HTMLElement>("[role='group'] [role='treeitem']") ??
|
|
165
|
+
undefined,
|
|
166
|
+
);
|
|
158
167
|
}
|
|
159
168
|
return;
|
|
160
169
|
case "ArrowLeft":
|
|
@@ -175,7 +184,10 @@
|
|
|
175
184
|
case "*":
|
|
176
185
|
event.preventDefault();
|
|
177
186
|
for (const sibling of Array.from(item.parentElement?.children ?? [])) {
|
|
178
|
-
if (
|
|
187
|
+
if (
|
|
188
|
+
sibling.getAttribute("role") === "treeitem" &&
|
|
189
|
+
sibling.getAttribute("aria-expanded") === "false"
|
|
190
|
+
) {
|
|
179
191
|
sibling.setAttribute("aria-expanded", "true");
|
|
180
192
|
}
|
|
181
193
|
}
|
|
@@ -190,7 +202,10 @@
|
|
|
190
202
|
bufferTimer = setTimeout(() => (buffer = ""), 500);
|
|
191
203
|
const cycle = buffer.length === 1 || [...buffer].every((c) => c === buffer[0]);
|
|
192
204
|
const needle = cycle ? buffer[0] : buffer;
|
|
193
|
-
const ordered = [
|
|
205
|
+
const ordered = [
|
|
206
|
+
...visible.slice(index + (cycle ? 1 : 0)),
|
|
207
|
+
...visible.slice(0, index + (cycle ? 1 : 0)),
|
|
208
|
+
];
|
|
194
209
|
focusItem(ordered.find((i) => ownText(i).startsWith(needle)));
|
|
195
210
|
}
|
|
196
211
|
}
|
|
@@ -89,7 +89,9 @@
|
|
|
89
89
|
timer = setTimeout(() => {
|
|
90
90
|
if (event.defaultPrevented || !root) return;
|
|
91
91
|
value = initialValue;
|
|
92
|
-
for (const input of root.querySelectorAll<HTMLInputElement>(
|
|
92
|
+
for (const input of root.querySelectorAll<HTMLInputElement>(
|
|
93
|
+
'input[type="radio"]',
|
|
94
|
+
)) {
|
|
93
95
|
input.checked = input.value === String(initialValue);
|
|
94
96
|
}
|
|
95
97
|
}, 0);
|
|
@@ -88,7 +88,9 @@
|
|
|
88
88
|
timer = setTimeout(() => {
|
|
89
89
|
if (event.defaultPrevented || !root) return;
|
|
90
90
|
value = initialValue;
|
|
91
|
-
for (const input of root.querySelectorAll<HTMLInputElement>(
|
|
91
|
+
for (const input of root.querySelectorAll<HTMLInputElement>(
|
|
92
|
+
'input[type="radio"]',
|
|
93
|
+
)) {
|
|
92
94
|
input.checked = input.value === String(initialValue);
|
|
93
95
|
}
|
|
94
96
|
}, 0);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// FloatingPanel component
|
|
3
3
|
//
|
|
4
4
|
// A floating panel container that overlays page content, typically used for tooltips,
|
|
5
|
-
// popovers, dropdown menus, or contextual UI. It
|
|
6
|
-
// open prop,
|
|
5
|
+
// popovers, dropdown menus, or contextual UI. It is always rendered as a popover="manual", shown according to an
|
|
6
|
+
// open prop, display: none when closed. Consumers are responsible
|
|
7
7
|
// for positioning the panel relative to a trigger element using their own CSS.
|
|
8
8
|
//
|
|
9
9
|
// Props:
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
//
|
|
40
40
|
// Claude rules:
|
|
41
41
|
// - Headless: no CSS, no styles — consumer provides all styling and positioning
|
|
42
|
-
// -
|
|
42
|
+
// - Native first: popover="manual" (top layer) opened and closed by the `open` state through ./Popover/popover.ts; where the Popover API is missing (jsdom, older browsers) it falls back to the `hidden` attribute. Placement is the theme's CSS (anchor positioning); light dismiss and Escape stay the consumer's.
|
|
43
43
|
// - Consumer manages show/hide logic externally
|
|
44
44
|
//
|
|
45
45
|
// References:
|
|
@@ -47,6 +47,8 @@
|
|
|
47
47
|
|
|
48
48
|
import type { Snippet } from "svelte";
|
|
49
49
|
|
|
50
|
+
import { popoverState } from "../Popover/popover.js";
|
|
51
|
+
|
|
50
52
|
let {
|
|
51
53
|
class: className = "",
|
|
52
54
|
open = false,
|
|
@@ -65,13 +67,13 @@
|
|
|
65
67
|
</script>
|
|
66
68
|
|
|
67
69
|
<!-- FloatingPanel.svelte -->
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
<div
|
|
71
|
+
class={`floating-panel ${className}`}
|
|
72
|
+
role="region"
|
|
73
|
+
popover="manual"
|
|
74
|
+
use:popoverState={open}
|
|
75
|
+
aria-label={label}
|
|
76
|
+
{...restProps}
|
|
77
|
+
>
|
|
78
|
+
{@render children?.()}
|
|
79
|
+
</div>
|
|
@@ -52,7 +52,11 @@
|
|
|
52
52
|
class={`funnel-chart ${className}`}
|
|
53
53
|
{...restProps}
|
|
54
54
|
>
|
|
55
|
-
<div
|
|
55
|
+
<div
|
|
56
|
+
class="funnel-chart-graphic"
|
|
57
|
+
role="img"
|
|
58
|
+
aria-label={label}
|
|
59
|
+
>
|
|
56
60
|
{@render children?.()}
|
|
57
61
|
</div>
|
|
58
62
|
{#if dataTable}
|
|
@@ -52,7 +52,11 @@
|
|
|
52
52
|
class={`gauge-chart ${className}`}
|
|
53
53
|
{...restProps}
|
|
54
54
|
>
|
|
55
|
-
<div
|
|
55
|
+
<div
|
|
56
|
+
class="gauge-chart-graphic"
|
|
57
|
+
role="img"
|
|
58
|
+
aria-label={label}
|
|
59
|
+
>
|
|
56
60
|
{@render children?.()}
|
|
57
61
|
</div>
|
|
58
62
|
{#if dataTable}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// GoToNextSection component
|
|
3
3
|
// A link that takes users to the next section of the current page.
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
let {
|
|
7
6
|
class: className = "",
|
|
8
7
|
label,
|
|
@@ -20,5 +19,5 @@
|
|
|
20
19
|
class={`go-to-next-section ${className}`}
|
|
21
20
|
{href}
|
|
22
21
|
aria-label={label}
|
|
23
|
-
{...restProps}
|
|
24
|
-
>
|
|
22
|
+
{...restProps}>{label}</a
|
|
23
|
+
>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// GoToPreviousSection component
|
|
3
3
|
// A link that takes users to the previous section of the current page.
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
let {
|
|
7
6
|
class: className = "",
|
|
8
7
|
label,
|
|
@@ -20,5 +19,5 @@
|
|
|
20
19
|
class={`go-to-previous-section ${className}`}
|
|
21
20
|
{href}
|
|
22
21
|
aria-label={label}
|
|
23
|
-
{...restProps}
|
|
24
|
-
>
|
|
22
|
+
{...restProps}>{label}</a
|
|
23
|
+
>
|
|
@@ -32,6 +32,9 @@
|
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<!-- GrailLayoutBottomFooter.svelte -->
|
|
35
|
-
<footer
|
|
35
|
+
<footer
|
|
36
|
+
class={`grail-layout-bottom-footer ${className}`}
|
|
37
|
+
{...restProps}
|
|
38
|
+
>
|
|
36
39
|
{@render children?.()}
|
|
37
40
|
</footer>
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
// Props:
|
|
9
9
|
// class — string, optional. CSS class appended to the base class.
|
|
10
10
|
// columns — number | string, default 12. Number of equal columns OR custom grid-template-columns.
|
|
11
|
+
// minColumnWidth — string, optional. A CSS length (e.g. "12rem"). When set, as many columns fit as the
|
|
12
|
+
// container allows, each at least this wide: repeat(auto-fit, minmax(min(<W>, 100%), 1fr)). Wins over `columns`.
|
|
11
13
|
// gap — string, default "1rem". Gap CSS value.
|
|
12
14
|
// children — Snippet, required. Grid items.
|
|
13
15
|
// ...restProps — additional HTML attributes spread onto the <div>.
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
// - Headless: only inline styles are grid behavior (display, template, gap)
|
|
34
36
|
// - When columns is a number, uses repeat(N, minmax(0, 1fr))
|
|
35
37
|
// - When columns is a string, uses it as-is
|
|
38
|
+
// - When minColumnWidth is set it wins over columns (columns has a default, so "unset" cannot be detected)
|
|
36
39
|
//
|
|
37
40
|
// References:
|
|
38
41
|
// - MDN CSS Grid: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout
|
|
@@ -42,12 +45,15 @@
|
|
|
42
45
|
let {
|
|
43
46
|
class: className = "",
|
|
44
47
|
columns = 12,
|
|
48
|
+
minColumnWidth,
|
|
45
49
|
gap = "1rem",
|
|
46
50
|
children,
|
|
47
51
|
...restProps
|
|
48
52
|
}: {
|
|
49
53
|
/** Number of equal columns OR custom grid-template-columns string */
|
|
50
54
|
columns?: number | string;
|
|
55
|
+
/** CSS length: fit as many columns as the container allows, each at least this wide. Wins over `columns`. */
|
|
56
|
+
minColumnWidth?: string;
|
|
51
57
|
/** Gap CSS value */
|
|
52
58
|
gap?: string;
|
|
53
59
|
/** Grid items */
|
|
@@ -56,9 +62,11 @@
|
|
|
56
62
|
} = $props();
|
|
57
63
|
|
|
58
64
|
const templateColumns = $derived(
|
|
59
|
-
|
|
60
|
-
? `repeat(${
|
|
61
|
-
: columns
|
|
65
|
+
minColumnWidth
|
|
66
|
+
? `repeat(auto-fit, minmax(min(${minColumnWidth}, 100%), 1fr))`
|
|
67
|
+
: typeof columns === "number"
|
|
68
|
+
? `repeat(${columns}, minmax(0, 1fr))`
|
|
69
|
+
: columns,
|
|
62
70
|
);
|
|
63
71
|
</script>
|
|
64
72
|
|
|
@@ -66,6 +74,7 @@
|
|
|
66
74
|
<div
|
|
67
75
|
class={`grid ${className}`}
|
|
68
76
|
data-columns={String(columns)}
|
|
77
|
+
data-min-column-width={minColumnWidth || undefined}
|
|
69
78
|
style={`display: grid; grid-template-columns: ${templateColumns}; gap: ${gap};`}
|
|
70
79
|
{...restProps}
|
|
71
80
|
>
|
|
@@ -2,6 +2,8 @@ import type { Snippet } from "svelte";
|
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
/** Number of equal columns OR custom grid-template-columns string */
|
|
4
4
|
columns?: number | string;
|
|
5
|
+
/** CSS length: fit as many columns as the container allows, each at least this wide. Wins over `columns`. */
|
|
6
|
+
minColumnWidth?: string;
|
|
5
7
|
/** Gap CSS value */
|
|
6
8
|
gap?: string;
|
|
7
9
|
/** Grid items */
|