@svgrid/ui 0.2.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/LICENSE +46 -0
- package/README.md +53 -0
- package/index.mjs +303 -0
- package/package.json +49 -0
- package/recipes/buttons/button-group.svelte +18 -0
- package/recipes/buttons/button.svelte +17 -0
- package/recipes/buttons/check-box.svelte +10 -0
- package/recipes/buttons/radio-group.svelte +18 -0
- package/recipes/buttons/rating.svelte +8 -0
- package/recipes/buttons/repeat-button.svelte +10 -0
- package/recipes/buttons/switch-button.svelte +12 -0
- package/recipes/buttons/toggle-button.svelte +8 -0
- package/recipes/date-time/calendar.svelte +15 -0
- package/recipes/date-time/date-range-input.svelte +15 -0
- package/recipes/date-time/date-time-picker.svelte +16 -0
- package/recipes/date-time/time-picker.svelte +15 -0
- package/recipes/feedback/alert.svelte +11 -0
- package/recipes/feedback/avatar-group.svelte +11 -0
- package/recipes/feedback/avatar.svelte +8 -0
- package/recipes/feedback/badge.svelte +8 -0
- package/recipes/feedback/carousel.svelte +10 -0
- package/recipes/feedback/chip.svelte +10 -0
- package/recipes/feedback/empty-state.svelte +8 -0
- package/recipes/feedback/skeleton.svelte +8 -0
- package/recipes/feedback/timeline.svelte +10 -0
- package/recipes/inputs/color-input.svelte +8 -0
- package/recipes/inputs/duration-input.svelte +9 -0
- package/recipes/inputs/masked-input.svelte +14 -0
- package/recipes/inputs/number-input.svelte +17 -0
- package/recipes/inputs/otp-input.svelte +13 -0
- package/recipes/inputs/password-input.svelte +14 -0
- package/recipes/inputs/phone-input.svelte +8 -0
- package/recipes/inputs/tags-input.svelte +8 -0
- package/recipes/inputs/text-area.svelte +15 -0
- package/recipes/inputs/text-input.svelte +14 -0
- package/recipes/layout/accordion.svelte +17 -0
- package/recipes/layout/card.svelte +9 -0
- package/recipes/layout/divider.svelte +9 -0
- package/recipes/layout/dock-layout.svelte +22 -0
- package/recipes/layout/dock-manager.svelte +24 -0
- package/recipes/layout/field.svelte +15 -0
- package/recipes/layout/file-upload.svelte +16 -0
- package/recipes/layout/form.svelte +14 -0
- package/recipes/layout/grid-chart.svelte +16 -0
- package/recipes/layout/scroll-area.svelte +10 -0
- package/recipes/layout/splitter.svelte +13 -0
- package/recipes/layout/tabs.svelte +17 -0
- package/recipes/navigation/breadcrumb.svelte +12 -0
- package/recipes/navigation/command.svelte +12 -0
- package/recipes/navigation/nav-pane.svelte +14 -0
- package/recipes/navigation/pagination.svelte +13 -0
- package/recipes/navigation/rich-text.svelte +8 -0
- package/recipes/navigation/stepper.svelte +13 -0
- package/recipes/navigation/tour.svelte +14 -0
- package/recipes/navigation/tree.svelte +14 -0
- package/recipes/overlays/context-menu.svelte +15 -0
- package/recipes/overlays/drawer.svelte +13 -0
- package/recipes/overlays/menu.svelte +15 -0
- package/recipes/overlays/modal.svelte +13 -0
- package/recipes/overlays/popover.svelte +9 -0
- package/recipes/overlays/toaster.svelte +9 -0
- package/recipes/overlays/tooltip.svelte +8 -0
- package/recipes/range/circular-progress.svelte +9 -0
- package/recipes/range/gauge.svelte +16 -0
- package/recipes/range/progress.svelte +10 -0
- package/recipes/range/slider.svelte +19 -0
- package/recipes/range/sparkline.svelte +9 -0
- package/recipes/range/stat.svelte +9 -0
- package/recipes/registry.json +1462 -0
- package/recipes/selection/auto-complete.svelte +10 -0
- package/recipes/selection/combo-box.svelte +13 -0
- package/recipes/selection/country-input.svelte +8 -0
- package/recipes/selection/drop-down-list.svelte +13 -0
- package/recipes/selection/grid-select.svelte +17 -0
- package/recipes/selection/list-box.svelte +13 -0
- package/recipes/selection/multi-select.svelte +13 -0
- package/recipes/selection/tree-select.svelte +15 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvAutoComplete - free-text input with a live suggestion list. Your copy, edit freely. Docs: https://www.svgrid.com/docs/help/ui-components/sv-auto-complete
|
|
3
|
+
import { SvAutoComplete } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
const cities = ['Amsterdam', 'Berlin', 'Copenhagen', 'Dublin']
|
|
6
|
+
let value = $state('')
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<SvAutoComplete label="City" suggestions={cities}
|
|
10
|
+
{value} onChange={(v) => (value = v)} placeholder="Search a city" />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvComboBox - searchable single-select combobox. Your copy, edit freely. Docs: https://www.svgrid.com/docs/help/ui-components/sv-combo-box
|
|
3
|
+
import { SvComboBox, type ListOption } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
const options: ListOption[] = [
|
|
6
|
+
{ value: 'us', label: 'United States' },
|
|
7
|
+
{ value: 'gb', label: 'United Kingdom' },
|
|
8
|
+
{ value: 'de', label: 'Germany' },
|
|
9
|
+
]
|
|
10
|
+
let value = $state<string | number | null>(null)
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SvComboBox label="Country" {options} {value} onChange={(v) => (value = v)} required />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvCountryInput - searchable country picker emitting an ISO code. Your copy, edit freely. Docs: https://www.svgrid.com/docs/help/ui-components/sv-country-input
|
|
3
|
+
import { SvCountryInput } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let value = $state<string | null>(null)
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SvCountryInput label="Country" {value} onChange={(code) => (value = code)} required />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvDropDownList - single-select dropdown with no typing. Your copy, edit freely. Docs: https://www.svgrid.com/docs/help/ui-components/sv-drop-down-list
|
|
3
|
+
import { SvDropDownList, type ListOption } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
const options: ListOption[] = [
|
|
6
|
+
{ value: 'open', label: 'Open' },
|
|
7
|
+
{ value: 'wip', label: 'In progress' },
|
|
8
|
+
{ value: 'done', label: 'Done' },
|
|
9
|
+
]
|
|
10
|
+
let value = $state<string | number | null>(null)
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SvDropDownList label="Status" {options} {value} onChange={(v) => (value = v)} />
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvGridSelect - grid-in-a-dropdown multi-column single-select. Your copy, edit freely. Docs: https://www.svgrid.com/docs/help/ui-components/sv-grid-select
|
|
3
|
+
import { SvGridSelect, type GridSelectColumn } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
const columns: GridSelectColumn[] = [
|
|
6
|
+
{ field: 'name', header: 'Name', width: '1.5fr' },
|
|
7
|
+
{ field: 'email', header: 'Email' },
|
|
8
|
+
{ field: 'role', header: 'Role', width: '80px' },
|
|
9
|
+
]
|
|
10
|
+
const options = [
|
|
11
|
+
{ id: 1, name: 'Ada Lovelace', email: 'ada@ex.com', role: 'Admin' },
|
|
12
|
+
{ id: 2, name: 'Alan Turing', email: 'alan@ex.com', role: 'User' },
|
|
13
|
+
]
|
|
14
|
+
let value = $state<string | number | null>(null)
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<SvGridSelect label="Owner" {columns} {options} idField="id" bind:value />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvListBox - inline single/multi-select list picker. Your copy, edit freely. Docs: https://www.svgrid.com/docs/help/ui-components/sv-list-box
|
|
3
|
+
import { SvListBox, type ListOption } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
const options: ListOption[] = [
|
|
6
|
+
{ value: 'eng', label: 'Engineering', group: 'Product' },
|
|
7
|
+
{ value: 'des', label: 'Design', group: 'Product' },
|
|
8
|
+
{ value: 'sal', label: 'Sales', group: 'Go-to-market' },
|
|
9
|
+
]
|
|
10
|
+
let value = $state<string | null>(null)
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SvListBox label="Team" {options} {value} onChange={(v) => (value = v)} />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvMultiSelect - multi-select dropdown with a chip trigger. Your copy, edit freely. Docs: https://www.svgrid.com/docs/help/ui-components/sv-multi-select
|
|
3
|
+
import { SvMultiSelect, type MultiSelectOption } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
const options: MultiSelectOption[] = [
|
|
6
|
+
{ value: 'ts', label: 'TypeScript' },
|
|
7
|
+
{ value: 'svelte', label: 'Svelte' },
|
|
8
|
+
{ value: 'rust', label: 'Rust' },
|
|
9
|
+
]
|
|
10
|
+
let value = $state<Array<string | number>>([])
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SvMultiSelect label="Skills" {options} bind:value maxTagCount={2} />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvTreeSelect - single-select dropdown over a collapsible tree. Your copy, edit freely. Docs: https://www.svgrid.com/docs/help/ui-components/sv-tree-select
|
|
3
|
+
import { SvTreeSelect, type TreeSelectNode } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
const nodes: TreeSelectNode[] = [
|
|
6
|
+
{ value: 'eng', label: 'Engineering', children: [
|
|
7
|
+
{ value: 'fe', label: 'Frontend' },
|
|
8
|
+
{ value: 'be', label: 'Backend' },
|
|
9
|
+
] },
|
|
10
|
+
{ value: 'design', label: 'Design' },
|
|
11
|
+
]
|
|
12
|
+
let value = $state<string | number | null>(null)
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<SvTreeSelect label="Team" {nodes} bind:value showPath />
|