test: use carbon-components-svelte for type imports

This commit is contained in:
Eric Liu 2024-11-09 09:37:18 -08:00
commit f69b2f15b5
93 changed files with 102 additions and 103 deletions

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Accordion, AccordionItem } from "../types";
import { Accordion, AccordionItem } from "carbon-components-svelte";
</script>
<Accordion>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { AspectRatio, Tile } from "../types";
import { AspectRatio, Tile } from "carbon-components-svelte";
</script>
<AspectRatio ratio="16x9">

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Grid, Row, Column } from "../types";
import { Grid, Row, Column } from "carbon-components-svelte";
</script>
<Grid>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Breadcrumb, BreadcrumbItem } from "../types";
import { Breadcrumb, BreadcrumbItem } from "carbon-components-svelte";
</script>
<Breadcrumb>

View file

@ -7,7 +7,7 @@
{ href: "/reports/2019", text: "2019" },
];
import { Row, Column, Breadcrumb, BreadcrumbItem } from "../types";
import { Row, Column, Breadcrumb, BreadcrumbItem } from "carbon-components-svelte";
</script>
<Row>

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { Breakpoint, breakpointObserver, breakpoints } from "../types";
import type { BreakpointProps } from "../types/Breakpoint/Breakpoint.svelte";
import { Breakpoint, breakpointObserver, breakpoints } from "carbon-components-svelte";
import type { BreakpointProps } from "carbon-components-svelte/Breakpoint/Breakpoint.svelte";
let size: BreakpointProps["size"];

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Button } from "../types";
import { Button } from "carbon-components-svelte";
import Add from "carbon-icons-svelte/lib/Add.svelte";
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Button, ButtonSet } from "../types";
import { Button, ButtonSet } from "carbon-components-svelte";
import Login from "carbon-icons-svelte/lib/Login.svelte";
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Checkbox } from "../types";
import { Checkbox } from "carbon-components-svelte";
</script>
<Checkbox labelText="Label text" style="margin: 1rem" />

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { ClickableTile } from "../types";
import { ClickableTile } from "carbon-components-svelte";
</script>
<ClickableTile href="https://www.carbondesignsystem.com/">

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { CodeSnippet } from "../types";
import { CodeSnippet } from "carbon-components-svelte";
</script>
<CodeSnippet

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { ComboBox } from "../types";
import type { ComboBoxItem } from "../types/ComboBox/ComboBox.svelte";
import { ComboBox } from "carbon-components-svelte";
import type { ComboBoxItem } from "carbon-components-svelte/ComboBox/ComboBox.svelte";
const items: ComboBoxItem[] = [
{ id: 0, text: "Slack" },

View file

@ -5,7 +5,7 @@
ModalBody,
ModalFooter,
Checkbox,
} from "../types";
} from "carbon-components-svelte";
let checked = false;
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Grid, Row, Column } from "../types";
import { Grid, Row, Column } from "carbon-components-svelte";
</script>
<Grid condensed>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { ContentSwitcher, Switch } from "../types";
import { ContentSwitcher, Switch } from "carbon-components-svelte";
import Analytics from "carbon-icons-svelte/lib/Analytics.svelte";
</script>

View file

@ -5,7 +5,7 @@
ContextMenuOption,
ContextMenuRadioGroup,
ContextMenuGroup,
} from "../types";
} from "carbon-components-svelte";
import CopyFile from "carbon-icons-svelte/lib/CopyFile.svelte";
import Cut from "carbon-icons-svelte/lib/Cut.svelte";

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { CopyButton } from "../types";
import { CopyButton } from "carbon-components-svelte";
</script>
<CopyButton

View file

@ -2,7 +2,7 @@
export let copy = (text: string) => text;
export let code = "npm i carbon-component-svelte";
import { CodeSnippet } from "../types";
import { CodeSnippet } from "carbon-components-svelte";
</script>
<CodeSnippet on:click="{() => copy(code)}">{code}</CodeSnippet>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Button, Modal } from "../types";
import { Button, Modal } from "carbon-components-svelte";
let open = false;
</script>

View file

@ -9,8 +9,8 @@
ToolbarMenuItem,
Button,
Link,
} from "../types";
import type { DataTableHeader } from "../types/DataTable/DataTable.svelte";
} from "carbon-components-svelte";
import type { DataTableHeader } from "carbon-components-svelte/DataTable/DataTable.svelte";
import Launch from "carbon-icons-svelte/lib/Launch.svelte";
const headers: DataTableHeader[] = [

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { DataTable, OverflowMenu, OverflowMenuItem } from "../types";
import { DataTable, OverflowMenu, OverflowMenuItem } from "carbon-components-svelte";
const headers = [
{ key: "name", value: "Name" },

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { DataTable } from "../types";
import { DataTable } from "carbon-components-svelte";
const headers = [
{ key: "name", value: "Name" },

View file

@ -8,7 +8,7 @@
ToolbarMenuItem,
ToolbarBatchActions,
Button,
} from "../types";
} from "carbon-components-svelte";
import Save from "carbon-icons-svelte/lib/Save.svelte";
const headers = [

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { DatePicker, DatePickerSkeleton, DatePickerInput } from "../types";
import { DatePicker, DatePickerSkeleton, DatePickerInput } from "carbon-components-svelte";
import { Russian } from "flatpickr/dist/l10n/ru.js";
</script>

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { Dropdown, DropdownSkeleton } from "../types";
import type { DropdownProps } from "../types/Dropdown/Dropdown.svelte";
import { Dropdown, DropdownSkeleton } from "carbon-components-svelte";
import type { DropdownProps } from "carbon-components-svelte/Dropdown/Dropdown.svelte";
let items: DropdownProps["items"] = [
{ id: 0, text: "Slack" },

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { CodeSnippet } from "../types";
import { CodeSnippet } from "carbon-components-svelte";
let toggled = false;

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { ExpandableTile } from "../types";
import { ExpandableTile } from "carbon-components-svelte";
</script>
<ExpandableTile>

View file

@ -5,8 +5,8 @@
FileUploaderDropContainer,
FileUploaderItem,
FileUploaderSkeleton,
} from "../types";
import type { FileUploaderProps } from "../types/FileUploader/FileUploader.svelte";
} from "carbon-components-svelte";
import type { FileUploaderProps } from "carbon-components-svelte/FileUploader/FileUploader.svelte";
let fileUploader: FileUploader;
let files: FileUploaderProps["files"] = [];

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { ComboBox } from "../types";
import { ComboBox } from "carbon-components-svelte";
function shouldFilterItem(item: { text: string }, value?: any) {
if (!value) return true;

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { FluidForm, TextInput, PasswordInput } from "../types";
import { FluidForm, TextInput, PasswordInput } from "carbon-components-svelte";
</script>
<FluidForm action="" method="get">

View file

@ -8,7 +8,7 @@
Select,
SelectItem,
Button,
} from "../types";
} from "carbon-components-svelte";
let ref: HTMLFormElement;
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Grid, Row, Column } from "../types";
import { Grid, Row, Column } from "carbon-components-svelte";
</script>
<Grid fullWidth>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Grid, Row, Column } from "../types";
import { Grid, Row, Column } from "carbon-components-svelte";
</script>
<Grid>

View file

@ -14,7 +14,7 @@
Grid,
Row,
Column,
} from "../types";
} from "carbon-components-svelte";
let isSideNavOpen = false;
</script>

View file

@ -17,7 +17,7 @@
Grid,
Row,
Column,
} from "../types";
} from "carbon-components-svelte";
let isSideNavOpen = false;
let isOpen = false;

View file

@ -16,7 +16,7 @@
Grid,
Row,
Column,
} from "../types";
} from "carbon-components-svelte";
let isSideNavOpen = false;
let isOpen = false;

View file

@ -17,7 +17,7 @@
Grid,
Row,
Column,
} from "../types";
} from "carbon-components-svelte";
import SettingsAdjust from "carbon-icons-svelte/lib/SettingsAdjust.svelte";
import { quintOut } from "svelte/easing";

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { CodeSnippet } from "../types";
import { CodeSnippet } from "carbon-components-svelte";
let toggled = false;

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { ImageLoader } from "../types";
import { ImageLoader } from "carbon-components-svelte";
let loading = false;
let loaded = false;

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { InlineLoading } from "../types";
import { InlineLoading } from "carbon-components-svelte";
</script>
<InlineLoading />

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Button, ButtonSet, InlineLoading } from "../types";
import { Button, ButtonSet, InlineLoading } from "carbon-components-svelte";
import { onDestroy } from "svelte";
type State = "dormant" | "active" | "finished" | "inactive";

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { InlineNotification, NotificationActionButton } from "../types";
import { InlineNotification, NotificationActionButton } from "carbon-components-svelte";
</script>
<InlineNotification on:close />

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Link, OutboundLink } from "../types";
import { Link, OutboundLink } from "carbon-components-svelte";
</script>
<Link size="sm" inline disabled download visited href="/" target="_blank">

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Loading } from "../types";
import { Loading } from "carbon-components-svelte";
</script>
<Loading withOverlay="{false}" />

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { LocalStorage } from "../types";
import { LocalStorage } from "carbon-components-svelte";
let storage: LocalStorage;
let toggled = false;

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Button, Modal } from "../types";
import { Button, Modal } from "carbon-components-svelte";
let open = false;
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Modal } from "../types";
import { Modal } from "carbon-components-svelte";
</script>
<Modal

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Modal } from "../types";
import { Modal } from "carbon-components-svelte";
</script>
<Modal

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Modal } from "../types";
import { Modal } from "carbon-components-svelte";
</script>
<Modal

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Modal } from "../types";
import { Modal } from "carbon-components-svelte";
</script>
<Modal

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { MultiSelect } from "../types";
import type { MultiSelectProps } from "../types/MultiSelect/MultiSelect.svelte";
import { MultiSelect } from "carbon-components-svelte";
import type { MultiSelectProps } from "carbon-components-svelte/MultiSelect/MultiSelect.svelte";
let selectedIds: MultiSelectProps["selectedIds"] = [0];

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Grid, Row, Column } from "../types";
import { Grid, Row, Column } from "carbon-components-svelte";
</script>
<Grid narrow>

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { NumberInput, NumberInputSkeleton } from "../types";
import type { NumberInputProps } from "../types/NumberInput/NumberInput.svelte";
import { NumberInput, NumberInputSkeleton } from "carbon-components-svelte";
import type { NumberInputProps } from "carbon-components-svelte/NumberInput/NumberInput.svelte";
let value: NumberInputProps["value"] = null;
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Grid, Row, Column } from "../types";
import { Grid, Row, Column } from "carbon-components-svelte";
</script>
<Grid>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { OrderedList, ListItem, Link } from "../types";
import { OrderedList, ListItem, Link } from "carbon-components-svelte";
</script>
<OrderedList>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { OverflowMenu, OverflowMenuItem } from "../types";
import { OverflowMenu, OverflowMenuItem } from "carbon-components-svelte";
import Add from "carbon-icons-svelte/lib/Add.svelte";
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Grid, Row, Column } from "../types";
import { Grid, Row, Column } from "carbon-components-svelte";
</script>
<Grid padding>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Pagination, PaginationSkeleton } from "../types";
import { Pagination, PaginationSkeleton } from "carbon-components-svelte";
</script>
<Pagination

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { PaginationNav } from "../types";
import { PaginationNav } from "carbon-components-svelte";
</script>
<PaginationNav />

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Button, Modal } from "../types";
import { Button, Modal } from "carbon-components-svelte";
let open = false;
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { PasswordInput } from "../types";
import { PasswordInput } from "carbon-components-svelte";
</script>
<PasswordInput labelText="Password" placeholder="Enter password..." />

View file

@ -14,7 +14,7 @@
Grid,
Row,
Column,
} from "../types";
} from "carbon-components-svelte";
let isSideNavOpen = false;
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Popover } from "../types";
import { Popover } from "carbon-components-svelte";
let open = false;
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { ProgressBar } from "../types";
import { ProgressBar } from "carbon-components-svelte";
</script>
<ProgressBar helperText="Loading..." />

View file

@ -3,7 +3,7 @@
ProgressIndicator,
ProgressStep,
ProgressIndicatorSkeleton,
} from "../types";
} from "carbon-components-svelte";
</script>
<ProgressIndicator currentIndex="{2}">

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { RadioButton, RadioButtonSkeleton, RadioButtonGroup } from "../types";
import { RadioButton, RadioButtonSkeleton, RadioButtonGroup } from "carbon-components-svelte";
</script>
<RadioButtonGroup

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { DataTable } from "../types";
import { DataTable } from "carbon-components-svelte";
const headers = [
{ key: "name", value: "Name" },

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { TileGroup, RadioTile } from "../types";
import { TileGroup, RadioTile } from "carbon-components-svelte";
</script>
<TileGroup

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { RecursiveList } from "../types";
import { RecursiveList } from "carbon-components-svelte";
const children = [
{

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Grid, Row, Column } from "../types";
import { Grid, Row, Column } from "carbon-components-svelte";
</script>
<Grid>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Search } from "../types";
import { Search } from "carbon-components-svelte";
</script>
<Search on:paste />

View file

@ -4,7 +4,7 @@
SelectItem,
SelectItemGroup,
SelectSkeleton,
} from "../types";
} from "carbon-components-svelte";
</script>
<Select labelText="Carbon theme" selected="g10">

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { DataTable } from "../types";
import { DataTable } from "carbon-components-svelte";
const headers = [
{ key: "name", value: "Name" },

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { SelectableTile } from "../types";
import { SelectableTile } from "carbon-components-svelte";
</script>
<SelectableTile selected>Multi-select Tile</SelectableTile>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { SkeletonPlaceholder } from "../types";
import { SkeletonPlaceholder } from "carbon-components-svelte";
</script>
<SkeletonPlaceholder />

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { SkeletonText } from "../types";
import { SkeletonText } from "carbon-components-svelte";
</script>
<SkeletonText />

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Slider, SliderSkeleton } from "../types";
import { Slider, SliderSkeleton } from "carbon-components-svelte";
</script>
<Slider />

View file

@ -7,7 +7,7 @@
StructuredListCell,
StructuredListRow,
StructuredListInput,
} from "../types";
} from "carbon-components-svelte";
import CheckmarkFilled from "carbon-icons-svelte/lib/CheckmarkFilled.svelte";
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Tabs, Tab, TabContent, TabsSkeleton } from "../types";
import { Tabs, Tab, TabContent, TabsSkeleton } from "carbon-components-svelte";
</script>
<Tabs

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Tag } from "../types";
import { Tag } from "carbon-components-svelte";
import Add from "carbon-icons-svelte/lib/Add.svelte";
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { TextArea, TextAreaSkeleton } from "../types";
import { TextArea, TextAreaSkeleton } from "carbon-components-svelte";
</script>
<TextArea

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { TextInput, TextInputSkeleton } from "../types";
import { TextInput, TextInputSkeleton } from "carbon-components-svelte";
let value = null;
</script>

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { Theme } from "../types";
import type { CarbonTheme } from "../types/Theme/Theme.svelte";
import { Theme } from "carbon-components-svelte";
import type { CarbonTheme } from "carbon-components-svelte/Theme/Theme.svelte";
let theme: CarbonTheme = "g10";
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Tile } from "../types";
import { Tile } from "carbon-components-svelte";
</script>
<Tile>Content</Tile>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { TimePicker, TimePickerSelect, SelectItem } from "../types";
import { TimePicker, TimePickerSelect, SelectItem } from "carbon-components-svelte";
</script>
<TimePicker

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { ToastNotification } from "../types";
import { ToastNotification } from "carbon-components-svelte";
</script>
<ToastNotification fullWidth />

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Toggle, ToggleSkeleton } from "../types";
import { Toggle, ToggleSkeleton } from "carbon-components-svelte";
</script>
<Toggle labelText="Push notifications" hideLabel />

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Tooltip, Link, Button } from "../types";
import { Tooltip, Link, Button } from "carbon-components-svelte";
import Catalog from "carbon-icons-svelte/lib/Catalog.svelte";
let open = true;

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { TooltipDefinition } from "../types";
import { TooltipDefinition } from "carbon-components-svelte";
let open = false;
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { TooltipIcon } from "../types";
import { TooltipIcon } from "carbon-components-svelte";
import Carbon from "carbon-icons-svelte/lib/Carbon.svelte";
import Filter from "carbon-icons-svelte/lib/Filter.svelte";
import FilterReset from "carbon-icons-svelte/lib/FilterReset.svelte";

View file

@ -1,7 +1,7 @@
<script lang="ts">
import type { ComponentProps } from "svelte";
import { TreeView } from "../types";
import type { TreeNodeId } from "../types/TreeView/TreeView.svelte";
import { TreeView } from "carbon-components-svelte";
import type { TreeNodeId } from "carbon-components-svelte/TreeView/TreeView.svelte";
import Analytics from "carbon-icons-svelte/lib/Analytics.svelte";
let treeview: TreeView;

View file

@ -1,6 +1,5 @@
<script lang="ts">
import { Truncate } from "../types";
import { truncate } from "../types";
import { Truncate, truncate } from "carbon-components-svelte";
</script>
<Truncate>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { UnorderedList, ListItem, Link } from "../types";
import { UnorderedList, ListItem, Link } from "carbon-components-svelte";
</script>
<UnorderedList>