@ifloppy/maxcraftmc-ui-svelte 0.1.0
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 +13 -0
- package/LICENSE +201 -0
- package/NOTICE +11 -0
- package/README.md +122 -0
- package/css/_popover.scss +325 -0
- package/css/all.css +1 -0
- package/css/all.scss +81 -0
- package/css/g10.css +1 -0
- package/css/g10.scss +34 -0
- package/css/g100.css +1 -0
- package/css/g100.scss +33 -0
- package/css/g80.css +1 -0
- package/css/g80.scss +34 -0
- package/css/g90.css +1 -0
- package/css/g90.scss +33 -0
- package/css/maxcraft.css +3239 -0
- package/css/white.css +1 -0
- package/css/white.scss +33 -0
- package/docs/compatibility.md +53 -0
- package/docs/component-catalog.md +99 -0
- package/docs/consumer-checklist.md +42 -0
- package/docs/contributing.md +80 -0
- package/docs/hugo-integration.md +94 -0
- package/docs/installation.md +89 -0
- package/docs/publishing.md +74 -0
- package/docs/svelte-migration.md +123 -0
- package/docs/theme-tokens.md +60 -0
- package/examples/component-gallery/index.html +12 -0
- package/examples/component-gallery/src/App.svelte +474 -0
- package/examples/component-gallery/src/main.js +6 -0
- package/examples/component-gallery/vite.config.js +6 -0
- package/examples/hugo-head.html +25 -0
- package/examples/hugo-module-mounts.toml +34 -0
- package/examples/svelte-basic/+layout.svelte +11 -0
- package/examples/svelte-basic/+page.svelte +150 -0
- package/package.json +80 -0
- package/src/Accordion/Accordion.svelte +60 -0
- package/src/Accordion/AccordionItem.svelte +79 -0
- package/src/Accordion/AccordionSkeleton.svelte +63 -0
- package/src/Accordion/index.js +3 -0
- package/src/AspectRatio/AspectRatio.svelte +25 -0
- package/src/AspectRatio/index.js +1 -0
- package/src/Breadcrumb/Breadcrumb.svelte +40 -0
- package/src/Breadcrumb/BreadcrumbItem.svelte +46 -0
- package/src/Breadcrumb/BreadcrumbSkeleton.svelte +26 -0
- package/src/Breadcrumb/index.js +3 -0
- package/src/Breakpoint/Breakpoint.svelte +47 -0
- package/src/Breakpoint/breakpointObserver.d.ts +28 -0
- package/src/Breakpoint/breakpointObserver.js +82 -0
- package/src/Breakpoint/breakpoints.d.ts +11 -0
- package/src/Breakpoint/breakpoints.js +13 -0
- package/src/Breakpoint/index.d.ts +4 -0
- package/src/Breakpoint/index.js +3 -0
- package/src/Button/Button.svelte +212 -0
- package/src/Button/ButtonSet.svelte +12 -0
- package/src/Button/ButtonSkeleton.svelte +54 -0
- package/src/Button/index.js +3 -0
- package/src/Checkbox/Checkbox.svelte +130 -0
- package/src/Checkbox/CheckboxSkeleton.svelte +14 -0
- package/src/Checkbox/InlineCheckbox.svelte +41 -0
- package/src/Checkbox/index.js +3 -0
- package/src/CodeSnippet/CodeSnippet.svelte +280 -0
- package/src/CodeSnippet/CodeSnippetSkeleton.svelte +27 -0
- package/src/CodeSnippet/index.js +2 -0
- package/src/ComboBox/ComboBox.svelte +432 -0
- package/src/ComboBox/index.js +1 -0
- package/src/ComposedModal/ComposedModal.svelte +172 -0
- package/src/ComposedModal/ModalBody.svelte +22 -0
- package/src/ComposedModal/ModalFooter.svelte +90 -0
- package/src/ComposedModal/ModalHeader.svelte +65 -0
- package/src/ComposedModal/index.js +4 -0
- package/src/ContentSwitcher/ContentSwitcher.svelte +74 -0
- package/src/ContentSwitcher/Switch.svelte +72 -0
- package/src/ContentSwitcher/index.js +2 -0
- package/src/ContextMenu/ContextMenu.svelte +196 -0
- package/src/ContextMenu/ContextMenuDivider.svelte +1 -0
- package/src/ContextMenu/ContextMenuGroup.svelte +36 -0
- package/src/ContextMenu/ContextMenuOption.svelte +286 -0
- package/src/ContextMenu/ContextMenuRadioGroup.svelte +34 -0
- package/src/ContextMenu/index.js +5 -0
- package/src/CopyButton/CopyButton.svelte +82 -0
- package/src/CopyButton/index.js +1 -0
- package/src/DataTable/DataTable.svelte +609 -0
- package/src/DataTable/DataTableSkeleton.svelte +102 -0
- package/src/DataTable/DataTableTypes.d.ts +18 -0
- package/src/DataTable/Table.svelte +60 -0
- package/src/DataTable/TableBody.svelte +3 -0
- package/src/DataTable/TableCell.svelte +4 -0
- package/src/DataTable/TableContainer.svelte +28 -0
- package/src/DataTable/TableHead.svelte +5 -0
- package/src/DataTable/TableHeader.svelte +76 -0
- package/src/DataTable/TableRow.svelte +4 -0
- package/src/DataTable/Toolbar.svelte +34 -0
- package/src/DataTable/ToolbarBatchActions.svelte +99 -0
- package/src/DataTable/ToolbarContent.svelte +3 -0
- package/src/DataTable/ToolbarMenu.svelte +23 -0
- package/src/DataTable/ToolbarMenuItem.svelte +9 -0
- package/src/DataTable/ToolbarSearch.svelte +122 -0
- package/src/DataTable/index.js +15 -0
- package/src/DatePicker/DatePicker.svelte +271 -0
- package/src/DatePicker/DatePickerInput.svelte +173 -0
- package/src/DatePicker/DatePickerSkeleton.svelte +36 -0
- package/src/DatePicker/createCalendar.js +100 -0
- package/src/DatePicker/index.js +3 -0
- package/src/Dropdown/Dropdown.svelte +336 -0
- package/src/Dropdown/DropdownSkeleton.svelte +23 -0
- package/src/Dropdown/index.js +2 -0
- package/src/FileUploader/FileUploader.svelte +177 -0
- package/src/FileUploader/FileUploaderButton.svelte +125 -0
- package/src/FileUploader/FileUploaderDropContainer.svelte +129 -0
- package/src/FileUploader/FileUploaderItem.svelte +79 -0
- package/src/FileUploader/FileUploaderSkeleton.svelte +19 -0
- package/src/FileUploader/Filename.svelte +57 -0
- package/src/FileUploader/index.js +6 -0
- package/src/FluidForm/FluidForm.svelte +23 -0
- package/src/FluidForm/index.js +1 -0
- package/src/Form/Form.svelte +20 -0
- package/src/Form/index.js +1 -0
- package/src/FormGroup/FormGroup.svelte +44 -0
- package/src/FormGroup/index.js +1 -0
- package/src/FormItem/FormItem.svelte +12 -0
- package/src/FormItem/index.js +1 -0
- package/src/FormLabel/FormLabel.svelte +18 -0
- package/src/FormLabel/index.js +1 -0
- package/src/Grid/Column.svelte +119 -0
- package/src/Grid/Grid.svelte +58 -0
- package/src/Grid/Row.svelte +54 -0
- package/src/Grid/index.js +3 -0
- package/src/ImageLoader/ImageLoader.svelte +117 -0
- package/src/ImageLoader/index.js +1 -0
- package/src/InlineLoading/InlineLoading.svelte +82 -0
- package/src/InlineLoading/index.js +1 -0
- package/src/Link/Link.svelte +89 -0
- package/src/Link/OutboundLink.svelte +18 -0
- package/src/Link/index.js +2 -0
- package/src/ListBox/ListBox.svelte +64 -0
- package/src/ListBox/ListBoxField.svelte +67 -0
- package/src/ListBox/ListBoxMenu.svelte +18 -0
- package/src/ListBox/ListBoxMenuIcon.svelte +38 -0
- package/src/ListBox/ListBoxMenuItem.svelte +38 -0
- package/src/ListBox/ListBoxSelection.svelte +114 -0
- package/src/ListBox/index.js +6 -0
- package/src/ListItem/ListItem.svelte +12 -0
- package/src/ListItem/index.js +1 -0
- package/src/Loading/Loading.svelte +76 -0
- package/src/Loading/index.js +1 -0
- package/src/LocalStorage/LocalStorage.svelte +71 -0
- package/src/LocalStorage/index.js +1 -0
- package/src/Modal/Modal.svelte +304 -0
- package/src/Modal/index.js +1 -0
- package/src/Modal/modalStore.js +36 -0
- package/src/MultiSelect/MultiSelect.svelte +557 -0
- package/src/MultiSelect/index.js +1 -0
- package/src/Notification/InlineNotification.svelte +114 -0
- package/src/Notification/NotificationActionButton.svelte +18 -0
- package/src/Notification/NotificationButton.svelte +47 -0
- package/src/Notification/NotificationIcon.svelte +41 -0
- package/src/Notification/ToastNotification.svelte +131 -0
- package/src/Notification/index.js +5 -0
- package/src/NumberInput/NumberInput.svelte +279 -0
- package/src/NumberInput/NumberInputSkeleton.svelte +20 -0
- package/src/NumberInput/index.js +2 -0
- package/src/OrderedList/OrderedList.svelte +26 -0
- package/src/OrderedList/index.js +1 -0
- package/src/OverflowMenu/OverflowMenu.svelte +259 -0
- package/src/OverflowMenu/OverflowMenuItem.svelte +117 -0
- package/src/OverflowMenu/index.js +2 -0
- package/src/Pagination/Pagination.svelte +216 -0
- package/src/Pagination/PaginationSkeleton.svelte +24 -0
- package/src/Pagination/index.js +2 -0
- package/src/PaginationNav/PaginationItem.svelte +23 -0
- package/src/PaginationNav/PaginationNav.svelte +190 -0
- package/src/PaginationNav/PaginationOverflow.svelte +56 -0
- package/src/PaginationNav/index.js +1 -0
- package/src/Popover/Popover.svelte +73 -0
- package/src/Popover/index.js +1 -0
- package/src/ProgressBar/ProgressBar.svelte +110 -0
- package/src/ProgressBar/index.js +1 -0
- package/src/ProgressIndicator/ProgressIndicator.svelte +79 -0
- package/src/ProgressIndicator/ProgressIndicatorSkeleton.svelte +38 -0
- package/src/ProgressIndicator/ProgressStep.svelte +107 -0
- package/src/ProgressIndicator/index.js +3 -0
- package/src/RadioButton/RadioButton.svelte +93 -0
- package/src/RadioButton/RadioButtonSkeleton.svelte +13 -0
- package/src/RadioButton/index.js +2 -0
- package/src/RadioButtonGroup/RadioButtonGroup.svelte +120 -0
- package/src/RadioButtonGroup/index.js +1 -0
- package/src/RecursiveList/RecursiveList.svelte +38 -0
- package/src/RecursiveList/RecursiveListItem.svelte +19 -0
- package/src/RecursiveList/index.js +1 -0
- package/src/Search/Search.svelte +173 -0
- package/src/Search/SearchSkeleton.svelte +24 -0
- package/src/Search/index.js +2 -0
- package/src/Select/Select.svelte +248 -0
- package/src/Select/SelectItem.svelte +63 -0
- package/src/Select/SelectItemGroup.svelte +11 -0
- package/src/Select/SelectSkeleton.svelte +22 -0
- package/src/Select/index.js +4 -0
- package/src/SkeletonPlaceholder/SkeletonPlaceholder.svelte +10 -0
- package/src/SkeletonPlaceholder/index.js +1 -0
- package/src/SkeletonText/SkeletonText.svelte +50 -0
- package/src/SkeletonText/index.js +1 -0
- package/src/Slider/Slider.svelte +232 -0
- package/src/Slider/SliderSkeleton.svelte +28 -0
- package/src/Slider/index.js +2 -0
- package/src/StructuredList/StructuredList.svelte +53 -0
- package/src/StructuredList/StructuredListBody.svelte +13 -0
- package/src/StructuredList/StructuredListCell.svelte +22 -0
- package/src/StructuredList/StructuredListHead.svelte +13 -0
- package/src/StructuredList/StructuredListInput.svelte +45 -0
- package/src/StructuredList/StructuredListRow.svelte +44 -0
- package/src/StructuredList/StructuredListSkeleton.svelte +36 -0
- package/src/StructuredList/index.js +7 -0
- package/src/Tabs/Tab.svelte +74 -0
- package/src/Tabs/TabContent.svelte +26 -0
- package/src/Tabs/Tabs.svelte +168 -0
- package/src/Tabs/TabsSkeleton.svelte +34 -0
- package/src/Tabs/index.js +4 -0
- package/src/Tag/Tag.svelte +172 -0
- package/src/Tag/TagSkeleton.svelte +17 -0
- package/src/Tag/index.js +2 -0
- package/src/TextArea/TextArea.svelte +134 -0
- package/src/TextArea/TextAreaSkeleton.svelte +20 -0
- package/src/TextArea/index.js +2 -0
- package/src/TextInput/PasswordInput.svelte +265 -0
- package/src/TextInput/TextInput.svelte +249 -0
- package/src/TextInput/TextInputSkeleton.svelte +20 -0
- package/src/TextInput/index.js +3 -0
- package/src/Theme/Theme.svelte +120 -0
- package/src/Theme/index.js +1 -0
- package/src/Tile/ClickableTile.svelte +43 -0
- package/src/Tile/ExpandableTile.svelte +104 -0
- package/src/Tile/RadioTile.svelte +95 -0
- package/src/Tile/SelectableTile.svelte +95 -0
- package/src/Tile/Tile.svelte +18 -0
- package/src/Tile/TileGroup.svelte +66 -0
- package/src/Tile/index.js +6 -0
- package/src/TimePicker/TimePicker.svelte +115 -0
- package/src/TimePicker/TimePickerSelect.svelte +78 -0
- package/src/TimePicker/index.js +2 -0
- package/src/Toggle/Toggle.svelte +107 -0
- package/src/Toggle/ToggleSkeleton.svelte +51 -0
- package/src/Toggle/index.js +2 -0
- package/src/Tooltip/Tooltip.svelte +269 -0
- package/src/Tooltip/TooltipFooter.svelte +29 -0
- package/src/Tooltip/index.js +2 -0
- package/src/TooltipDefinition/TooltipDefinition.svelte +85 -0
- package/src/TooltipDefinition/index.js +1 -0
- package/src/TooltipIcon/TooltipIcon.svelte +83 -0
- package/src/TooltipIcon/index.js +1 -0
- package/src/TreeView/TreeView.svelte +266 -0
- package/src/TreeView/TreeViewNode.svelte +133 -0
- package/src/TreeView/TreeViewNodeList.svelte +179 -0
- package/src/TreeView/index.d.ts +1 -0
- package/src/TreeView/index.js +1 -0
- package/src/Truncate/Truncate.svelte +12 -0
- package/src/Truncate/index.js +2 -0
- package/src/Truncate/truncate.d.ts +12 -0
- package/src/Truncate/truncate.js +29 -0
- package/src/UIShell/Content.svelte +24 -0
- package/src/UIShell/HamburgerMenu.svelte +45 -0
- package/src/UIShell/Header.svelte +103 -0
- package/src/UIShell/HeaderAction.svelte +160 -0
- package/src/UIShell/HeaderActionLink.svelte +43 -0
- package/src/UIShell/HeaderGlobalAction.svelte +33 -0
- package/src/UIShell/HeaderNav.svelte +13 -0
- package/src/UIShell/HeaderNavItem.svelte +66 -0
- package/src/UIShell/HeaderNavMenu.svelte +106 -0
- package/src/UIShell/HeaderPanelDivider.svelte +22 -0
- package/src/UIShell/HeaderPanelLink.svelte +23 -0
- package/src/UIShell/HeaderPanelLinks.svelte +3 -0
- package/src/UIShell/HeaderSearch.svelte +338 -0
- package/src/UIShell/HeaderUtilities.svelte +3 -0
- package/src/UIShell/SideNav.svelte +84 -0
- package/src/UIShell/SideNavDivider.svelte +1 -0
- package/src/UIShell/SideNavItems.svelte +3 -0
- package/src/UIShell/SideNavLink.svelte +54 -0
- package/src/UIShell/SideNavMenu.svelte +59 -0
- package/src/UIShell/SideNavMenuItem.svelte +32 -0
- package/src/UIShell/SkipToContent.svelte +11 -0
- package/src/UIShell/index.js +20 -0
- package/src/UIShell/navStore.js +7 -0
- package/src/UnorderedList/UnorderedList.svelte +22 -0
- package/src/UnorderedList/index.js +1 -0
- package/src/icons/Add.svelte +28 -0
- package/src/icons/ArrowUp.svelte +28 -0
- package/src/icons/ArrowsVertical.svelte +28 -0
- package/src/icons/Calendar.svelte +28 -0
- package/src/icons/CaretDown.svelte +26 -0
- package/src/icons/CaretLeft.svelte +26 -0
- package/src/icons/CaretRight.svelte +26 -0
- package/src/icons/Checkmark.svelte +26 -0
- package/src/icons/CheckmarkFilled.svelte +32 -0
- package/src/icons/CheckmarkOutline.svelte +30 -0
- package/src/icons/ChevronDown.svelte +26 -0
- package/src/icons/ChevronRight.svelte +26 -0
- package/src/icons/CircleDash.svelte +28 -0
- package/src/icons/Close.svelte +28 -0
- package/src/icons/Copy.svelte +28 -0
- package/src/icons/EditOff.svelte +28 -0
- package/src/icons/ErrorFilled.svelte +33 -0
- package/src/icons/IconSearch.svelte +28 -0
- package/src/icons/Incomplete.svelte +28 -0
- package/src/icons/Information.svelte +30 -0
- package/src/icons/InformationFilled.svelte +32 -0
- package/src/icons/InformationSquareFilled.svelte +32 -0
- package/src/icons/Launch.svelte +30 -0
- package/src/icons/Menu.svelte +26 -0
- package/src/icons/OverflowMenuHorizontal.svelte +27 -0
- package/src/icons/OverflowMenuVertical.svelte +27 -0
- package/src/icons/Settings.svelte +30 -0
- package/src/icons/Subtract.svelte +26 -0
- package/src/icons/Switcher.svelte +28 -0
- package/src/icons/View.svelte +30 -0
- package/src/icons/ViewOff.svelte +30 -0
- package/src/icons/Warning.svelte +29 -0
- package/src/icons/WarningAltFilled.svelte +34 -0
- package/src/icons/WarningFilled.svelte +33 -0
- package/src/index.js +155 -0
- package/src/utils/toHierarchy.d.ts +21 -0
- package/src/utils/toHierarchy.js +49 -0
- package/tokens/maxcraft.css +84 -0
- package/types/Accordion/Accordion.svelte.d.ts +39 -0
- package/types/Accordion/AccordionItem.svelte.d.ts +48 -0
- package/types/Accordion/AccordionSkeleton.svelte.d.ts +45 -0
- package/types/AspectRatio/AspectRatio.svelte.d.ts +31 -0
- package/types/Breadcrumb/Breadcrumb.svelte.d.ts +27 -0
- package/types/Breadcrumb/BreadcrumbItem.svelte.d.ts +33 -0
- package/types/Breadcrumb/BreadcrumbSkeleton.svelte.d.ts +33 -0
- package/types/Breakpoint/Breakpoint.svelte.d.ts +30 -0
- package/types/Breakpoint/breakpointObserver.d.ts +28 -0
- package/types/Breakpoint/breakpoints.d.ts +11 -0
- package/types/Breakpoint/index.d.ts +4 -0
- package/types/Button/Button.svelte.d.ts +140 -0
- package/types/Button/ButtonSet.svelte.d.ts +22 -0
- package/types/Button/ButtonSkeleton.svelte.d.ts +35 -0
- package/types/Checkbox/Checkbox.svelte.d.ts +109 -0
- package/types/Checkbox/CheckboxSkeleton.svelte.d.ts +21 -0
- package/types/CodeSnippet/CodeSnippet.svelte.d.ts +140 -0
- package/types/CodeSnippet/CodeSnippetSkeleton.svelte.d.ts +27 -0
- package/types/ComboBox/ComboBox.svelte.d.ts +189 -0
- package/types/ComposedModal/ComposedModal.svelte.d.ts +69 -0
- package/types/ComposedModal/ModalBody.svelte.d.ts +28 -0
- package/types/ComposedModal/ModalFooter.svelte.d.ts +65 -0
- package/types/ComposedModal/ModalHeader.svelte.d.ts +58 -0
- package/types/ContentSwitcher/ContentSwitcher.svelte.d.ts +34 -0
- package/types/ContentSwitcher/Switch.svelte.d.ts +53 -0
- package/types/ContextMenu/ContextMenu.svelte.d.ts +53 -0
- package/types/ContextMenu/ContextMenuDivider.svelte.d.ts +9 -0
- package/types/ContextMenu/ContextMenuGroup.svelte.d.ts +20 -0
- package/types/ContextMenu/ContextMenuOption.svelte.d.ts +86 -0
- package/types/ContextMenu/ContextMenuRadioGroup.svelte.d.ts +21 -0
- package/types/CopyButton/CopyButton.svelte.d.ts +50 -0
- package/types/DataTable/DataTable.svelte.d.ts +238 -0
- package/types/DataTable/DataTableSkeleton.svelte.d.ts +67 -0
- package/types/DataTable/DataTableTypes.d.ts +18 -0
- package/types/DataTable/Table.svelte.d.ts +52 -0
- package/types/DataTable/TableBody.svelte.d.ts +16 -0
- package/types/DataTable/TableCell.svelte.d.ts +21 -0
- package/types/DataTable/TableContainer.svelte.d.ts +40 -0
- package/types/DataTable/TableHead.svelte.d.ts +21 -0
- package/types/DataTable/TableHeader.svelte.d.ts +57 -0
- package/types/DataTable/TableRow.svelte.d.ts +21 -0
- package/types/DataTable/Toolbar.svelte.d.ts +22 -0
- package/types/DataTable/ToolbarBatchActions.svelte.d.ts +28 -0
- package/types/DataTable/ToolbarContent.svelte.d.ts +9 -0
- package/types/DataTable/ToolbarMenu.svelte.d.ts +10 -0
- package/types/DataTable/ToolbarMenuItem.svelte.d.ts +10 -0
- package/types/DataTable/ToolbarSearch.svelte.d.ts +84 -0
- package/types/DatePicker/DatePicker.svelte.d.ts +105 -0
- package/types/DatePicker/DatePickerInput.svelte.d.ts +118 -0
- package/types/DatePicker/DatePickerSkeleton.svelte.d.ts +33 -0
- package/types/Dropdown/Dropdown.svelte.d.ts +160 -0
- package/types/Dropdown/DropdownSkeleton.svelte.d.ts +27 -0
- package/types/FileUploader/FileUploader.svelte.d.ts +104 -0
- package/types/FileUploader/FileUploaderButton.svelte.d.ts +98 -0
- package/types/FileUploader/FileUploaderDropContainer.svelte.d.ts +92 -0
- package/types/FileUploader/FileUploaderItem.svelte.d.ts +69 -0
- package/types/FileUploader/FileUploaderSkeleton.svelte.d.ts +21 -0
- package/types/FileUploader/Filename.svelte.d.ts +36 -0
- package/types/FluidForm/FluidForm.svelte.d.ts +23 -0
- package/types/Form/Form.svelte.d.ts +29 -0
- package/types/FormGroup/FormGroup.svelte.d.ts +57 -0
- package/types/FormItem/FormItem.svelte.d.ts +21 -0
- package/types/FormLabel/FormLabel.svelte.d.ts +27 -0
- package/types/Grid/Column.svelte.d.ts +92 -0
- package/types/Grid/Grid.svelte.d.ts +65 -0
- package/types/Grid/Row.svelte.d.ts +59 -0
- package/types/ImageLoader/ImageLoader.svelte.d.ts +64 -0
- package/types/InlineLoading/InlineLoading.svelte.d.ts +47 -0
- package/types/Link/Link.svelte.d.ts +64 -0
- package/types/Link/OutboundLink.svelte.d.ts +15 -0
- package/types/ListBox/ListBox.svelte.d.ts +70 -0
- package/types/ListBox/ListBoxField.svelte.d.ts +67 -0
- package/types/ListBox/ListBoxMenu.svelte.d.ts +28 -0
- package/types/ListBox/ListBoxMenuIcon.svelte.d.ts +35 -0
- package/types/ListBox/ListBoxMenuItem.svelte.d.ts +38 -0
- package/types/ListBox/ListBoxSelection.svelte.d.ts +47 -0
- package/types/ListItem/ListItem.svelte.d.ts +21 -0
- package/types/Loading/Loading.svelte.d.ts +40 -0
- package/types/LocalStorage/LocalStorage.svelte.d.ts +34 -0
- package/types/Modal/Modal.svelte.d.ts +156 -0
- package/types/MultiSelect/MultiSelect.svelte.d.ts +264 -0
- package/types/Notification/InlineNotification.svelte.d.ts +82 -0
- package/types/Notification/NotificationActionButton.svelte.d.ts +15 -0
- package/types/Notification/NotificationButton.svelte.d.ts +45 -0
- package/types/Notification/NotificationIcon.svelte.d.ts +33 -0
- package/types/Notification/ToastNotification.svelte.d.ts +95 -0
- package/types/NumberInput/NumberInput.svelte.d.ts +168 -0
- package/types/NumberInput/NumberInputSkeleton.svelte.d.ts +27 -0
- package/types/OrderedList/OrderedList.svelte.d.ts +39 -0
- package/types/OverflowMenu/OverflowMenu.svelte.d.ts +96 -0
- package/types/OverflowMenu/OverflowMenuItem.svelte.d.ts +71 -0
- package/types/Pagination/Pagination.svelte.d.ts +129 -0
- package/types/Pagination/PaginationSkeleton.svelte.d.ts +21 -0
- package/types/PaginationNav/PaginationNav.svelte.d.ts +63 -0
- package/types/Popover/Popover.svelte.d.ts +70 -0
- package/types/ProgressBar/ProgressBar.svelte.d.ts +70 -0
- package/types/ProgressIndicator/ProgressIndicator.svelte.d.ts +46 -0
- package/types/ProgressIndicator/ProgressIndicatorSkeleton.svelte.d.ts +34 -0
- package/types/ProgressIndicator/ProgressStep.svelte.d.ts +70 -0
- package/types/RadioButton/RadioButton.svelte.d.ts +80 -0
- package/types/RadioButton/RadioButtonSkeleton.svelte.d.ts +21 -0
- package/types/RadioButtonGroup/RadioButtonGroup.svelte.d.ts +76 -0
- package/types/RecursiveList/RecursiveList.svelte.d.ts +34 -0
- package/types/Search/Search.svelte.d.ts +128 -0
- package/types/Search/SearchSkeleton.svelte.d.ts +27 -0
- package/types/Select/Select.svelte.d.ts +124 -0
- package/types/Select/SelectItem.svelte.d.ts +46 -0
- package/types/Select/SelectItemGroup.svelte.d.ts +28 -0
- package/types/Select/SelectSkeleton.svelte.d.ts +27 -0
- package/types/SkeletonPlaceholder/SkeletonPlaceholder.svelte.d.ts +21 -0
- package/types/SkeletonText/SkeletonText.svelte.d.ts +45 -0
- package/types/Slider/Slider.svelte.d.ts +139 -0
- package/types/Slider/SliderSkeleton.svelte.d.ts +27 -0
- package/types/StructuredList/StructuredList.svelte.d.ts +46 -0
- package/types/StructuredList/StructuredListBody.svelte.d.ts +21 -0
- package/types/StructuredList/StructuredListCell.svelte.d.ts +33 -0
- package/types/StructuredList/StructuredListHead.svelte.d.ts +21 -0
- package/types/StructuredList/StructuredListInput.svelte.d.ts +52 -0
- package/types/StructuredList/StructuredListRow.svelte.d.ts +40 -0
- package/types/StructuredList/StructuredListSkeleton.svelte.d.ts +28 -0
- package/types/Tabs/Tab.svelte.d.ts +58 -0
- package/types/Tabs/TabContent.svelte.d.ts +22 -0
- package/types/Tabs/Tabs.svelte.d.ts +50 -0
- package/types/Tabs/TabsSkeleton.svelte.d.ts +33 -0
- package/types/Tag/Tag.svelte.d.ts +87 -0
- package/types/Tag/TagSkeleton.svelte.d.ts +26 -0
- package/types/TextArea/TextArea.svelte.d.ts +124 -0
- package/types/TextArea/TextAreaSkeleton.svelte.d.ts +27 -0
- package/types/TextInput/PasswordInput.svelte.d.ts +154 -0
- package/types/TextInput/TextInput.svelte.d.ts +139 -0
- package/types/TextInput/TextInputSkeleton.svelte.d.ts +27 -0
- package/types/Theme/Theme.svelte.d.ts +58 -0
- package/types/Tile/ClickableTile.svelte.d.ts +46 -0
- package/types/Tile/ExpandableTile.svelte.d.ts +88 -0
- package/types/Tile/RadioTile.svelte.d.ts +77 -0
- package/types/Tile/SelectableTile.svelte.d.ts +84 -0
- package/types/Tile/Tile.svelte.d.ts +27 -0
- package/types/Tile/TileGroup.svelte.d.ts +46 -0
- package/types/TimePicker/TimePicker.svelte.d.ts +112 -0
- package/types/TimePicker/TimePickerSelect.svelte.d.ts +63 -0
- package/types/Toggle/Toggle.svelte.d.ts +80 -0
- package/types/Toggle/ToggleSkeleton.svelte.d.ts +39 -0
- package/types/Tooltip/Tooltip.svelte.d.ts +106 -0
- package/types/Tooltip/TooltipFooter.svelte.d.ts +15 -0
- package/types/TooltipDefinition/TooltipDefinition.svelte.d.ts +60 -0
- package/types/TooltipIcon/TooltipIcon.svelte.d.ts +65 -0
- package/types/TreeView/TreeView.svelte.d.ts +114 -0
- package/types/TreeView/index.d.ts +1 -0
- package/types/Truncate/Truncate.svelte.d.ts +21 -0
- package/types/Truncate/truncate.d.ts +12 -0
- package/types/UIShell/Content.svelte.d.ts +22 -0
- package/types/UIShell/Header.svelte.d.ts +93 -0
- package/types/UIShell/HeaderAction.svelte.d.ts +80 -0
- package/types/UIShell/HeaderActionLink.svelte.d.ts +40 -0
- package/types/UIShell/HeaderGlobalAction.svelte.d.ts +28 -0
- package/types/UIShell/HeaderNav.svelte.d.ts +16 -0
- package/types/UIShell/HeaderNavItem.svelte.d.ts +49 -0
- package/types/UIShell/HeaderNavMenu.svelte.d.ts +49 -0
- package/types/UIShell/HeaderPanelDivider.svelte.d.ts +9 -0
- package/types/UIShell/HeaderPanelLink.svelte.d.ts +28 -0
- package/types/UIShell/HeaderPanelLinks.svelte.d.ts +9 -0
- package/types/UIShell/HeaderSearch.svelte.d.ts +67 -0
- package/types/UIShell/HeaderUtilities.svelte.d.ts +9 -0
- package/types/UIShell/SideNav.svelte.d.ts +56 -0
- package/types/UIShell/SideNavDivider.svelte.d.ts +16 -0
- package/types/UIShell/SideNavItems.svelte.d.ts +9 -0
- package/types/UIShell/SideNavLink.svelte.d.ts +46 -0
- package/types/UIShell/SideNavMenu.svelte.d.ts +40 -0
- package/types/UIShell/SideNavMenuItem.svelte.d.ts +40 -0
- package/types/UIShell/SkipToContent.svelte.d.ts +28 -0
- package/types/UnorderedList/UnorderedList.svelte.d.ts +33 -0
- package/types/index.d.ts +169 -0
- package/types/utils/toHierarchy.d.ts +21 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* Set the type of notification
|
|
4
|
+
* @type {"toast" | "inline"}
|
|
5
|
+
*/
|
|
6
|
+
export let notificationType = "toast";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Specify the icon to render
|
|
10
|
+
* @type {any}
|
|
11
|
+
*/
|
|
12
|
+
export let icon = Close;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Specify the title of the icon
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
export let title = undefined;
|
|
19
|
+
|
|
20
|
+
/** Specify the ARIA label for the icon */
|
|
21
|
+
export let iconDescription = "Close icon";
|
|
22
|
+
|
|
23
|
+
import Close from "../icons/Close.svelte";
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
27
|
+
<button
|
|
28
|
+
type="button"
|
|
29
|
+
aria-label={iconDescription}
|
|
30
|
+
title={iconDescription}
|
|
31
|
+
class:bx--toast-notification__close-button={notificationType === "toast"}
|
|
32
|
+
class:bx--inline-notification__close-button={notificationType === "inline"}
|
|
33
|
+
{...$$restProps}
|
|
34
|
+
on:click
|
|
35
|
+
on:mouseover
|
|
36
|
+
on:mouseenter
|
|
37
|
+
on:mouseleave
|
|
38
|
+
>
|
|
39
|
+
<svelte:component
|
|
40
|
+
this={icon}
|
|
41
|
+
size={20}
|
|
42
|
+
{title}
|
|
43
|
+
class="{notificationType === 'toast' &&
|
|
44
|
+
'bx--toast-notification__close-icon'} {notificationType === 'inline' &&
|
|
45
|
+
'bx--inline-notification__close-icon'}"
|
|
46
|
+
/>
|
|
47
|
+
</button>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* Specify the kind of notification icon
|
|
4
|
+
* @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"}
|
|
5
|
+
*/
|
|
6
|
+
export let kind = "error";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Set the type of notification
|
|
10
|
+
* @type {"toast" | "inline"}
|
|
11
|
+
*/
|
|
12
|
+
export let notificationType = "toast";
|
|
13
|
+
|
|
14
|
+
/** Specify the ARIA label for the icon */
|
|
15
|
+
export let iconDescription;
|
|
16
|
+
|
|
17
|
+
import CheckmarkFilled from "../icons/CheckmarkFilled.svelte";
|
|
18
|
+
import ErrorFilled from "../icons/ErrorFilled.svelte";
|
|
19
|
+
import InformationFilled from "../icons/InformationFilled.svelte";
|
|
20
|
+
import InformationSquareFilled from "../icons/InformationSquareFilled.svelte";
|
|
21
|
+
import WarningFilled from "../icons/WarningFilled.svelte";
|
|
22
|
+
import WarningAltFilled from "../icons/WarningAltFilled.svelte";
|
|
23
|
+
|
|
24
|
+
const icons = {
|
|
25
|
+
error: ErrorFilled,
|
|
26
|
+
"info-square": InformationSquareFilled,
|
|
27
|
+
info: InformationFilled,
|
|
28
|
+
success: CheckmarkFilled,
|
|
29
|
+
warning: WarningFilled,
|
|
30
|
+
"warning-alt": WarningAltFilled,
|
|
31
|
+
};
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<svelte:component
|
|
35
|
+
this={icons[kind]}
|
|
36
|
+
size={20}
|
|
37
|
+
title={iconDescription}
|
|
38
|
+
class="{notificationType === 'toast' &&
|
|
39
|
+
'bx--toast-notification__icon'} {notificationType === 'inline' &&
|
|
40
|
+
'bx--inline-notification__icon'}"
|
|
41
|
+
/>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @event {{ timeout: boolean }} close
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Specify the kind of notification
|
|
8
|
+
* @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"}
|
|
9
|
+
*/
|
|
10
|
+
export let kind = "error";
|
|
11
|
+
|
|
12
|
+
/** Set to `true` to use the low contrast variant */
|
|
13
|
+
export let lowContrast = false;
|
|
14
|
+
|
|
15
|
+
/** Set the timeout duration (ms) to hide the notification after opening it */
|
|
16
|
+
export let timeout = 0;
|
|
17
|
+
|
|
18
|
+
/** Set the `role` attribute */
|
|
19
|
+
export let role = "alert";
|
|
20
|
+
|
|
21
|
+
/** Specify the title text */
|
|
22
|
+
export let title = "";
|
|
23
|
+
|
|
24
|
+
/** Specify the subtitle text */
|
|
25
|
+
export let subtitle = "";
|
|
26
|
+
|
|
27
|
+
/** Specify the caption text */
|
|
28
|
+
export let caption = "";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Specify the ARIA label for the status icon
|
|
32
|
+
* @type {string}
|
|
33
|
+
* */
|
|
34
|
+
export let statusIconDescription = kind + " icon";
|
|
35
|
+
|
|
36
|
+
/** Specify the ARIA label for the close button */
|
|
37
|
+
export let closeButtonDescription = "Close notification";
|
|
38
|
+
|
|
39
|
+
/** Set to `true` to hide the close button */
|
|
40
|
+
export let hideCloseButton = false;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Set to `true` for the notification to span
|
|
44
|
+
* the full width of its containing element.
|
|
45
|
+
*/
|
|
46
|
+
export let fullWidth = false;
|
|
47
|
+
|
|
48
|
+
import { createEventDispatcher, onMount } from "svelte";
|
|
49
|
+
import NotificationButton from "./NotificationButton.svelte";
|
|
50
|
+
import NotificationIcon from "./NotificationIcon.svelte";
|
|
51
|
+
|
|
52
|
+
const dispatch = createEventDispatcher();
|
|
53
|
+
|
|
54
|
+
let open = true;
|
|
55
|
+
let timeoutId = undefined;
|
|
56
|
+
|
|
57
|
+
function close(closeFromTimeout) {
|
|
58
|
+
// Clear the timer if the close button was clicked.
|
|
59
|
+
clearTimeout(timeoutId);
|
|
60
|
+
|
|
61
|
+
const shouldContinue = dispatch(
|
|
62
|
+
"close",
|
|
63
|
+
{ timeout: closeFromTimeout === true },
|
|
64
|
+
{ cancelable: true },
|
|
65
|
+
);
|
|
66
|
+
if (shouldContinue) {
|
|
67
|
+
open = false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
onMount(() => {
|
|
72
|
+
return () => {
|
|
73
|
+
clearTimeout(timeoutId);
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
$: if (typeof window !== "undefined") {
|
|
78
|
+
/**
|
|
79
|
+
* Clear the timer if {@link timeout} changes.
|
|
80
|
+
* If set to `0`, no new timeout is started.
|
|
81
|
+
* Else, a new timeout is started if {@link open} is not set to `false`.
|
|
82
|
+
*/
|
|
83
|
+
clearTimeout(timeoutId);
|
|
84
|
+
|
|
85
|
+
/** Only start the timer of {@link open} has not been set to `false`. */
|
|
86
|
+
if (open && timeout) {
|
|
87
|
+
timeoutId = setTimeout(() => close(true), timeout);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
93
|
+
{#if open}
|
|
94
|
+
<div
|
|
95
|
+
{role}
|
|
96
|
+
class:bx--toast-notification={true}
|
|
97
|
+
class:bx--toast-notification--low-contrast={lowContrast}
|
|
98
|
+
class:bx--toast-notification--error={kind === "error"}
|
|
99
|
+
class:bx--toast-notification--info={kind === "info"}
|
|
100
|
+
class:bx--toast-notification--info-square={kind === "info-square"}
|
|
101
|
+
class:bx--toast-notification--success={kind === "success"}
|
|
102
|
+
class:bx--toast-notification--warning={kind === "warning"}
|
|
103
|
+
class:bx--toast-notification--warning-alt={kind === "warning-alt"}
|
|
104
|
+
style:width={fullWidth ? "100%" : undefined}
|
|
105
|
+
{...$$restProps}
|
|
106
|
+
on:click
|
|
107
|
+
on:mouseover
|
|
108
|
+
on:mouseenter
|
|
109
|
+
on:mouseleave
|
|
110
|
+
>
|
|
111
|
+
<NotificationIcon {kind} iconDescription={statusIconDescription} />
|
|
112
|
+
<div class:bx--toast-notification__details={true}>
|
|
113
|
+
<h3 class:bx--toast-notification__title={true}>
|
|
114
|
+
<slot name="title">{title}</slot>
|
|
115
|
+
</h3>
|
|
116
|
+
<div class:bx--toast-notification__subtitle={true}>
|
|
117
|
+
<slot name="subtitle">{subtitle}</slot>
|
|
118
|
+
</div>
|
|
119
|
+
<div class:bx--toast-notification__caption={true}>
|
|
120
|
+
<slot name="caption">{caption}</slot>
|
|
121
|
+
</div>
|
|
122
|
+
<slot />
|
|
123
|
+
</div>
|
|
124
|
+
{#if !hideCloseButton}
|
|
125
|
+
<NotificationButton
|
|
126
|
+
iconDescription={closeButtonDescription}
|
|
127
|
+
on:click={close}
|
|
128
|
+
/>
|
|
129
|
+
{/if}
|
|
130
|
+
</div>
|
|
131
|
+
{/if}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as ToastNotification } from "./ToastNotification.svelte";
|
|
2
|
+
export { default as InlineNotification } from "./InlineNotification.svelte";
|
|
3
|
+
export { default as NotificationActionButton } from "./NotificationActionButton.svelte";
|
|
4
|
+
export { default as NotificationButton } from "./NotificationButton.svelte";
|
|
5
|
+
export { default as NotificationIcon } from "./NotificationIcon.svelte";
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {"increment" | "decrement"} NumberInputTranslationId
|
|
4
|
+
* @event {null | number} change
|
|
5
|
+
* @event {null | number} input
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Set the size of the input
|
|
10
|
+
* @type {"sm" | "xl"}
|
|
11
|
+
*/
|
|
12
|
+
export let size = undefined;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Specify the input value.
|
|
16
|
+
* Use `null` to denote "no value"
|
|
17
|
+
* @type {null | number}
|
|
18
|
+
*/
|
|
19
|
+
export let value = null;
|
|
20
|
+
|
|
21
|
+
/** Specify the step increment */
|
|
22
|
+
export let step = 1;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Specify the maximum value
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
export let max = undefined;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Specify the minimum value
|
|
32
|
+
* @type {number}
|
|
33
|
+
*/
|
|
34
|
+
export let min = undefined;
|
|
35
|
+
|
|
36
|
+
/** Set to `true` to enable the light variant */
|
|
37
|
+
export let light = false;
|
|
38
|
+
|
|
39
|
+
/** Set to `true` for the input to be read-only */
|
|
40
|
+
export let readonly = false;
|
|
41
|
+
|
|
42
|
+
/** Set to `true` to allow for an empty value */
|
|
43
|
+
export let allowEmpty = false;
|
|
44
|
+
|
|
45
|
+
/** Set to `true` to disable the input */
|
|
46
|
+
export let disabled = false;
|
|
47
|
+
|
|
48
|
+
/** Set to `true` to hide the input stepper buttons */
|
|
49
|
+
export let hideSteppers = false;
|
|
50
|
+
|
|
51
|
+
/** Specify the ARIA label for the increment icons */
|
|
52
|
+
export let iconDescription = "";
|
|
53
|
+
|
|
54
|
+
/** Set to `true` to indicate an invalid state */
|
|
55
|
+
export let invalid = false;
|
|
56
|
+
|
|
57
|
+
/** Specify the invalid state text */
|
|
58
|
+
export let invalidText = "";
|
|
59
|
+
|
|
60
|
+
/** Set to `true` to indicate an warning state */
|
|
61
|
+
export let warn = false;
|
|
62
|
+
|
|
63
|
+
/** Specify the warning state text */
|
|
64
|
+
export let warnText = "";
|
|
65
|
+
|
|
66
|
+
/** Specify the helper text */
|
|
67
|
+
export let helperText = "";
|
|
68
|
+
|
|
69
|
+
/** Specify the label text */
|
|
70
|
+
export let label = "";
|
|
71
|
+
|
|
72
|
+
/** Set to `true` to visually hide the label text */
|
|
73
|
+
export let hideLabel = false;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Override the default translation ids
|
|
77
|
+
* @type {(id: NumberInputTranslationId) => string}
|
|
78
|
+
*/
|
|
79
|
+
export let translateWithId = (id) => defaultTranslations[id];
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Default translation ids
|
|
83
|
+
* @type {{ increment: "increment"; decrement: "decrement" }}
|
|
84
|
+
*/
|
|
85
|
+
export const translationIds = {
|
|
86
|
+
increment: "increment",
|
|
87
|
+
decrement: "decrement",
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/** Set an id for the input element */
|
|
91
|
+
export let id = "ccs-" + Math.random().toString(36);
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Specify a name attribute for the input
|
|
95
|
+
* @type {string}
|
|
96
|
+
*/
|
|
97
|
+
export let name = undefined;
|
|
98
|
+
|
|
99
|
+
/** Obtain a reference to the input HTML element */
|
|
100
|
+
export let ref = null;
|
|
101
|
+
|
|
102
|
+
import { createEventDispatcher } from "svelte";
|
|
103
|
+
import Add from "../icons/Add.svelte";
|
|
104
|
+
import Subtract from "../icons/Subtract.svelte";
|
|
105
|
+
import WarningFilled from "../icons/WarningFilled.svelte";
|
|
106
|
+
import WarningAltFilled from "../icons/WarningAltFilled.svelte";
|
|
107
|
+
import EditOff from "../icons/EditOff.svelte";
|
|
108
|
+
|
|
109
|
+
const defaultTranslations = {
|
|
110
|
+
[translationIds.increment]: "Increment number",
|
|
111
|
+
[translationIds.decrement]: "Decrement number",
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const dispatch = createEventDispatcher();
|
|
115
|
+
|
|
116
|
+
function updateValue(isIncrementing) {
|
|
117
|
+
if (isIncrementing) {
|
|
118
|
+
ref.stepUp();
|
|
119
|
+
} else {
|
|
120
|
+
ref.stepDown();
|
|
121
|
+
}
|
|
122
|
+
value = +ref.value;
|
|
123
|
+
|
|
124
|
+
dispatch("input", value);
|
|
125
|
+
dispatch("change", value);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
$: incrementLabel = translateWithId("increment");
|
|
129
|
+
$: decrementLabel = translateWithId("decrement");
|
|
130
|
+
$: error =
|
|
131
|
+
(invalid && !readonly) ||
|
|
132
|
+
(!allowEmpty && value == null) ||
|
|
133
|
+
value > max ||
|
|
134
|
+
(typeof value === "number" && value < min);
|
|
135
|
+
$: errorId = `error-${id}`;
|
|
136
|
+
$: ariaLabel =
|
|
137
|
+
$$props["aria-label"] ||
|
|
138
|
+
"Numeric input field with increment and decrement buttons";
|
|
139
|
+
|
|
140
|
+
function parse(raw) {
|
|
141
|
+
return raw != "" ? Number(raw) : null;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function onInput({ target }) {
|
|
145
|
+
value = parse(target.value);
|
|
146
|
+
|
|
147
|
+
dispatch("input", value);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function onChange({ target }) {
|
|
151
|
+
dispatch("change", parse(target.value));
|
|
152
|
+
}
|
|
153
|
+
</script>
|
|
154
|
+
|
|
155
|
+
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
156
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
157
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
158
|
+
<div
|
|
159
|
+
class:bx--form-item={true}
|
|
160
|
+
on:click
|
|
161
|
+
on:mouseover
|
|
162
|
+
on:mouseenter
|
|
163
|
+
on:mouseleave
|
|
164
|
+
>
|
|
165
|
+
<div
|
|
166
|
+
data-invalid={error || undefined}
|
|
167
|
+
class:bx--number={true}
|
|
168
|
+
class:bx--number--helpertext={true}
|
|
169
|
+
class:bx--number--readonly={readonly}
|
|
170
|
+
class:bx--number--light={light}
|
|
171
|
+
class:bx--number--nolabel={hideLabel}
|
|
172
|
+
class:bx--number--nosteppers={hideSteppers}
|
|
173
|
+
class:bx--number--sm={size === "sm"}
|
|
174
|
+
class:bx--number--xl={size === "xl"}
|
|
175
|
+
>
|
|
176
|
+
{#if $$slots.label || label}
|
|
177
|
+
<label
|
|
178
|
+
for={id}
|
|
179
|
+
class:bx--label={true}
|
|
180
|
+
class:bx--label--disabled={disabled}
|
|
181
|
+
class:bx--visually-hidden={hideLabel}
|
|
182
|
+
>
|
|
183
|
+
<slot name="label">{label}</slot>
|
|
184
|
+
</label>
|
|
185
|
+
{/if}
|
|
186
|
+
<div
|
|
187
|
+
class:bx--number__input-wrapper={true}
|
|
188
|
+
class:bx--number__input-wrapper--warning={!invalid && warn}
|
|
189
|
+
>
|
|
190
|
+
<input
|
|
191
|
+
bind:this={ref}
|
|
192
|
+
type="number"
|
|
193
|
+
pattern="[0-9]*"
|
|
194
|
+
aria-describedby={errorId}
|
|
195
|
+
data-invalid={error || undefined}
|
|
196
|
+
aria-invalid={error || undefined}
|
|
197
|
+
aria-label={label ? undefined : ariaLabel}
|
|
198
|
+
{disabled}
|
|
199
|
+
{id}
|
|
200
|
+
{name}
|
|
201
|
+
{max}
|
|
202
|
+
{min}
|
|
203
|
+
{step}
|
|
204
|
+
value={value ?? ""}
|
|
205
|
+
{readonly}
|
|
206
|
+
{...$$restProps}
|
|
207
|
+
on:change={onChange}
|
|
208
|
+
on:input={onInput}
|
|
209
|
+
on:keydown
|
|
210
|
+
on:keyup
|
|
211
|
+
on:focus
|
|
212
|
+
on:blur
|
|
213
|
+
on:paste
|
|
214
|
+
/>
|
|
215
|
+
{#if readonly}
|
|
216
|
+
<EditOff class="bx--text-input__readonly-icon" />
|
|
217
|
+
{:else}
|
|
218
|
+
{#if invalid}
|
|
219
|
+
<WarningFilled class="bx--number__invalid" />
|
|
220
|
+
{/if}
|
|
221
|
+
{#if !invalid && warn}
|
|
222
|
+
<WarningAltFilled
|
|
223
|
+
class="bx--number__invalid bx--number__invalid--warning"
|
|
224
|
+
/>
|
|
225
|
+
{/if}
|
|
226
|
+
{/if}
|
|
227
|
+
{#if !hideSteppers}
|
|
228
|
+
<div class:bx--number__controls={true}>
|
|
229
|
+
<button
|
|
230
|
+
type="button"
|
|
231
|
+
tabindex="-1"
|
|
232
|
+
title={decrementLabel || iconDescription}
|
|
233
|
+
aria-label={decrementLabel || iconDescription}
|
|
234
|
+
class:bx--number__control-btn={true}
|
|
235
|
+
class:down-icon={true}
|
|
236
|
+
on:click={() => {
|
|
237
|
+
updateValue(false);
|
|
238
|
+
}}
|
|
239
|
+
{disabled}
|
|
240
|
+
>
|
|
241
|
+
<Subtract class="down-icon" />
|
|
242
|
+
</button>
|
|
243
|
+
<div class:bx--number__rule-divider={true}></div>
|
|
244
|
+
<button
|
|
245
|
+
type="button"
|
|
246
|
+
tabindex="-1"
|
|
247
|
+
title={incrementLabel || iconDescription}
|
|
248
|
+
aria-label={incrementLabel || iconDescription}
|
|
249
|
+
class:bx--number__control-btn={true}
|
|
250
|
+
class:up-icon={true}
|
|
251
|
+
on:click={() => {
|
|
252
|
+
updateValue(true);
|
|
253
|
+
}}
|
|
254
|
+
{disabled}
|
|
255
|
+
>
|
|
256
|
+
<Add class="up-icon" />
|
|
257
|
+
</button>
|
|
258
|
+
<div class:bx--number__rule-divider={true}></div>
|
|
259
|
+
</div>
|
|
260
|
+
{/if}
|
|
261
|
+
</div>
|
|
262
|
+
{#if !error && !warn && helperText}
|
|
263
|
+
<div
|
|
264
|
+
class:bx--form__helper-text={true}
|
|
265
|
+
class:bx--form__helper-text--disabled={disabled}
|
|
266
|
+
>
|
|
267
|
+
{helperText}
|
|
268
|
+
</div>
|
|
269
|
+
{/if}
|
|
270
|
+
{#if error}
|
|
271
|
+
<div id={errorId} class:bx--form-requirement={true}>
|
|
272
|
+
{invalidText}
|
|
273
|
+
</div>
|
|
274
|
+
{/if}
|
|
275
|
+
{#if !error && warn}
|
|
276
|
+
<div id={errorId} class:bx--form-requirement={true}>{warnText}</div>
|
|
277
|
+
{/if}
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/** Set to `true` to hide the label text */
|
|
3
|
+
export let hideLabel = false;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
7
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
8
|
+
<div
|
|
9
|
+
class:bx--form-item={true}
|
|
10
|
+
{...$$restProps}
|
|
11
|
+
on:click
|
|
12
|
+
on:mouseover
|
|
13
|
+
on:mouseenter
|
|
14
|
+
on:mouseleave
|
|
15
|
+
>
|
|
16
|
+
{#if !hideLabel}
|
|
17
|
+
<span class:bx--label={true} class:bx--skeleton={true}></span>
|
|
18
|
+
{/if}
|
|
19
|
+
<div class:bx--number={true} class:bx--skeleton={true}></div>
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/** Set to `true` to use the nested variant */
|
|
3
|
+
export let nested = false;
|
|
4
|
+
|
|
5
|
+
/** Set to `true` to use native list styles */
|
|
6
|
+
export let native = false;
|
|
7
|
+
|
|
8
|
+
/** Set to `true` to use Carbon's expressive typesetting */
|
|
9
|
+
export let expressive = false;
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
13
|
+
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
14
|
+
<ol
|
|
15
|
+
class:bx--list--ordered={!native}
|
|
16
|
+
class:bx--list--ordered--native={native}
|
|
17
|
+
class:bx--list--nested={nested}
|
|
18
|
+
class:bx--list--expressive={expressive}
|
|
19
|
+
{...$$restProps}
|
|
20
|
+
on:click
|
|
21
|
+
on:mouseover
|
|
22
|
+
on:mouseenter
|
|
23
|
+
on:mouseleave
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</ol>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OrderedList } from "./OrderedList.svelte";
|