@svgrid/ui 0.3.4 → 0.4.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 +0 -25
- package/README.md +238 -218
- package/index.mjs +591 -591
- package/package.json +4 -4
- package/recipes/buttons/button-group.svelte +18 -18
- package/recipes/buttons/button.svelte +17 -17
- package/recipes/buttons/check-box.svelte +10 -10
- package/recipes/buttons/radio-group.svelte +18 -18
- package/recipes/buttons/rating.svelte +8 -8
- package/recipes/buttons/repeat-button.svelte +10 -10
- package/recipes/buttons/segmented.svelte +14 -0
- package/recipes/buttons/switch-button.svelte +12 -12
- package/recipes/buttons/toggle-button.svelte +8 -8
- package/recipes/date-time/calendar.svelte +15 -15
- package/recipes/date-time/date-range-input.svelte +15 -15
- package/recipes/date-time/date-time-picker.svelte +16 -16
- package/recipes/date-time/time-picker.svelte +15 -15
- package/recipes/feedback/alert.svelte +11 -11
- package/recipes/feedback/avatar-group.svelte +11 -11
- package/recipes/feedback/avatar.svelte +8 -8
- package/recipes/feedback/badge.svelte +8 -8
- package/recipes/feedback/carousel.svelte +10 -10
- package/recipes/feedback/chip.svelte +10 -10
- package/recipes/feedback/empty-state.svelte +8 -8
- package/recipes/feedback/loading-overlay.svelte +14 -0
- package/recipes/feedback/result.svelte +15 -0
- package/recipes/feedback/skeleton.svelte +8 -8
- package/recipes/feedback/spinner.svelte +8 -0
- package/recipes/feedback/timeline.svelte +10 -10
- package/recipes/inputs/color-input.svelte +8 -8
- package/recipes/inputs/duration-input.svelte +9 -9
- package/recipes/inputs/masked-input.svelte +14 -14
- package/recipes/inputs/number-input.svelte +17 -17
- package/recipes/inputs/otp-input.svelte +13 -13
- package/recipes/inputs/password-input.svelte +14 -14
- package/recipes/inputs/phone-input.svelte +8 -8
- package/recipes/inputs/tags-input.svelte +8 -8
- package/recipes/inputs/text-area.svelte +15 -15
- package/recipes/inputs/text-input.svelte +14 -14
- package/recipes/layout/accordion.svelte +17 -17
- package/recipes/layout/card.svelte +9 -9
- package/recipes/layout/collapsible.svelte +13 -0
- package/recipes/layout/display.svelte +15 -0
- package/recipes/layout/divider.svelte +9 -9
- package/recipes/layout/dock-layout.svelte +22 -22
- package/recipes/layout/dock-manager.svelte +24 -24
- package/recipes/layout/field.svelte +15 -15
- package/recipes/layout/file-upload.svelte +16 -16
- package/recipes/layout/form.svelte +14 -14
- package/recipes/layout/grid-chart.svelte +16 -16
- package/recipes/layout/layout.svelte +18 -0
- package/recipes/layout/scroll-area.svelte +10 -10
- package/recipes/layout/splitter.svelte +13 -13
- package/recipes/layout/tabs.svelte +17 -17
- package/recipes/layout/typography.svelte +17 -0
- package/recipes/navigation/breadcrumb.svelte +12 -12
- package/recipes/navigation/command.svelte +12 -12
- package/recipes/navigation/nav-pane.svelte +14 -14
- package/recipes/navigation/pagination.svelte +13 -13
- package/recipes/navigation/rich-text.svelte +8 -8
- package/recipes/navigation/stepper.svelte +13 -13
- package/recipes/navigation/tour.svelte +14 -14
- package/recipes/navigation/tree.svelte +14 -14
- package/recipes/overlays/context-menu.svelte +15 -15
- package/recipes/overlays/drawer.svelte +13 -13
- package/recipes/overlays/hover-card.svelte +15 -0
- package/recipes/overlays/menu.svelte +15 -15
- package/recipes/overlays/menubar.svelte +27 -0
- package/recipes/overlays/modal.svelte +13 -13
- package/recipes/overlays/popconfirm.svelte +18 -0
- package/recipes/overlays/popover.svelte +9 -9
- package/recipes/overlays/toaster.svelte +9 -9
- package/recipes/overlays/tooltip.svelte +8 -8
- package/recipes/range/circular-progress.svelte +9 -9
- package/recipes/range/gauge.svelte +16 -16
- package/recipes/range/progress.svelte +10 -10
- package/recipes/range/slider.svelte +19 -19
- package/recipes/range/sparkline.svelte +9 -9
- package/recipes/range/stat.svelte +9 -9
- package/recipes/registry.json +237 -4
- package/recipes/selection/auto-complete.svelte +10 -10
- package/recipes/selection/combo-box.svelte +13 -13
- package/recipes/selection/country-input.svelte +8 -8
- package/recipes/selection/drop-down-list.svelte +13 -13
- package/recipes/selection/grid-select.svelte +17 -17
- package/recipes/selection/list-box.svelte +13 -13
- package/recipes/selection/multi-select.svelte +13 -13
- package/recipes/selection/tree-select.svelte +15 -15
package/package.json
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
"type": "commercial",
|
|
5
5
|
"url": "https://svgrid.com/pricing"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.4.0",
|
|
8
8
|
"description": "Add and preview SvGrid UI components in one command: npx @svgrid/ui try calendar",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"author": "jQWidgets Ltd",
|
|
12
|
-
"homepage": "https://
|
|
12
|
+
"homepage": "https://svgrid.com",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/sv-grid/sv-grid.git",
|
|
15
|
+
"url": "git+https://github.com/sv-grid/sv-grid.git",
|
|
16
16
|
"directory": "packages/svgrid-ui"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"svelte": "^5.55.5",
|
|
42
42
|
"svelte-check": "^4.4.6",
|
|
43
43
|
"typescript": "6.0.3",
|
|
44
|
-
"@svgrid/grid": "2.2.
|
|
44
|
+
"@svgrid/grid": "2.2.27"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"test:types": "svelte-check --tsconfig ./tsconfig.json"
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvButtonGroup - a segmented single/multi-select button bar. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvButtonGroup, type ButtonGroupItem } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
const views: ButtonGroupItem[] = [
|
|
6
|
-
{ value: 'day', label: 'Day' },
|
|
7
|
-
{ value: 'week', label: 'Week' },
|
|
8
|
-
{ value: 'month', label: 'Month' },
|
|
9
|
-
]
|
|
10
|
-
let view = $state<string | number>('week')
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<SvButtonGroup
|
|
14
|
-
items={views}
|
|
15
|
-
value={view}
|
|
16
|
-
mode="single"
|
|
17
|
-
onChange={(v) => (view = v as string)}
|
|
18
|
-
/>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvButtonGroup - a segmented single/multi-select button bar. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-button-group
|
|
3
|
+
import { SvButtonGroup, type ButtonGroupItem } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
const views: ButtonGroupItem[] = [
|
|
6
|
+
{ value: 'day', label: 'Day' },
|
|
7
|
+
{ value: 'week', label: 'Week' },
|
|
8
|
+
{ value: 'month', label: 'Month' },
|
|
9
|
+
]
|
|
10
|
+
let view = $state<string | number>('week')
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SvButtonGroup
|
|
14
|
+
items={views}
|
|
15
|
+
value={view}
|
|
16
|
+
mode="single"
|
|
17
|
+
onChange={(v) => (view = v as string)}
|
|
18
|
+
/>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvButton - the themeable press primitive with variants and loading. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvButton } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
let saving = $state(false)
|
|
6
|
-
async function save() {
|
|
7
|
-
saving = true
|
|
8
|
-
try {
|
|
9
|
-
await new Promise((r) => setTimeout(r, 800))
|
|
10
|
-
} finally {
|
|
11
|
-
saving = false
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<SvButton variant="primary" loading={saving} onclick={save}>Save</SvButton>
|
|
17
|
-
<SvButton variant="outline">Cancel</SvButton>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvButton - the themeable press primitive with variants and loading. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-button
|
|
3
|
+
import { SvButton } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let saving = $state(false)
|
|
6
|
+
async function save() {
|
|
7
|
+
saving = true
|
|
8
|
+
try {
|
|
9
|
+
await new Promise((r) => setTimeout(r, 800))
|
|
10
|
+
} finally {
|
|
11
|
+
saving = false
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<SvButton variant="primary" loading={saving} onclick={save}>Save</SvButton>
|
|
17
|
+
<SvButton variant="outline">Cancel</SvButton>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvCheckBox - a themed checkbox with a true indeterminate state. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvCheckBox } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
let agree = $state(false)
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<SvCheckBox checked={agree} onChange={(v) => (agree = v)}>
|
|
9
|
-
I accept the terms
|
|
10
|
-
</SvCheckBox>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvCheckBox - a themed checkbox with a true indeterminate state. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-check-box
|
|
3
|
+
import { SvCheckBox } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let agree = $state(false)
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SvCheckBox checked={agree} onChange={(v) => (agree = v)}>
|
|
9
|
+
I accept the terms
|
|
10
|
+
</SvCheckBox>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvRadioGroup - an accessible single-select radio group. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvRadioGroup, type RadioOption } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
const plans: RadioOption[] = [
|
|
6
|
-
{ value: 'free', label: 'Free' },
|
|
7
|
-
{ value: 'pro', label: 'Pro' },
|
|
8
|
-
{ value: 'team', label: 'Team' },
|
|
9
|
-
]
|
|
10
|
-
let plan = $state<string | number | null>('pro')
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<SvRadioGroup
|
|
14
|
-
label="Plan"
|
|
15
|
-
options={plans}
|
|
16
|
-
value={plan}
|
|
17
|
-
onChange={(v) => (plan = v)}
|
|
18
|
-
/>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvRadioGroup - an accessible single-select radio group. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-radio-group
|
|
3
|
+
import { SvRadioGroup, type RadioOption } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
const plans: RadioOption[] = [
|
|
6
|
+
{ value: 'free', label: 'Free' },
|
|
7
|
+
{ value: 'pro', label: 'Pro' },
|
|
8
|
+
{ value: 'team', label: 'Team' },
|
|
9
|
+
]
|
|
10
|
+
let plan = $state<string | number | null>('pro')
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SvRadioGroup
|
|
14
|
+
label="Plan"
|
|
15
|
+
options={plans}
|
|
16
|
+
value={plan}
|
|
17
|
+
onChange={(v) => (plan = v)}
|
|
18
|
+
/>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvRating - a star rating control on the ARIA slider pattern. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvRating } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
let score = $state(4)
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<SvRating label="Your rating" value={score} onChange={(v) => (score = v)} />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvRating - a star rating control on the ARIA slider pattern. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-rating
|
|
3
|
+
import { SvRating } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let score = $state(4)
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SvRating label="Your rating" value={score} onChange={(v) => (score = v)} />
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvRepeatButton - a button that keeps firing while held. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvRepeatButton } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
let qty = $state(1)
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<SvRepeatButton ariaLabel="Decrease" onclick={() => (qty = Math.max(0, qty - 1))}>-</SvRepeatButton>
|
|
9
|
-
<span>{qty}</span>
|
|
10
|
-
<SvRepeatButton ariaLabel="Increase" onclick={() => (qty += 1)}>+</SvRepeatButton>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvRepeatButton - a button that keeps firing while held. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-repeat-button
|
|
3
|
+
import { SvRepeatButton } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let qty = $state(1)
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SvRepeatButton ariaLabel="Decrease" onclick={() => (qty = Math.max(0, qty - 1))}>-</SvRepeatButton>
|
|
9
|
+
<span>{qty}</span>
|
|
10
|
+
<SvRepeatButton ariaLabel="Increase" onclick={() => (qty += 1)}>+</SvRepeatButton>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvSegmented - a compact single-select track. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-segmented
|
|
3
|
+
import { SvSegmented } from '@svgrid/grid'
|
|
4
|
+
let view = $state('board')
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<SvSegmented
|
|
8
|
+
bind:value={view}
|
|
9
|
+
options={[
|
|
10
|
+
{ value: 'board', label: 'Board' },
|
|
11
|
+
{ value: 'table', label: 'Table' },
|
|
12
|
+
{ value: 'calendar', label: 'Calendar' },
|
|
13
|
+
]}
|
|
14
|
+
/>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvSwitchButton - an on/off sliding switch for immediate settings. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvSwitchButton } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
let notify = $state(true)
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<SvSwitchButton
|
|
9
|
-
label="Email notifications"
|
|
10
|
-
checked={notify}
|
|
11
|
-
onChange={(v) => (notify = v)}
|
|
12
|
-
/>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvSwitchButton - an on/off sliding switch for immediate settings. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-switch-button
|
|
3
|
+
import { SvSwitchButton } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let notify = $state(true)
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SvSwitchButton
|
|
9
|
+
label="Email notifications"
|
|
10
|
+
checked={notify}
|
|
11
|
+
onChange={(v) => (notify = v)}
|
|
12
|
+
/>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvToggleButton - a button with a sticky pressed on/off state. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvToggleButton } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
let bold = $state(false)
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<SvToggleButton pressed={bold} onChange={(v) => (bold = v)}>Bold</SvToggleButton>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvToggleButton - a button with a sticky pressed on/off state. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-toggle-button
|
|
3
|
+
import { SvToggleButton } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let bold = $state(false)
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SvToggleButton pressed={bold} onChange={(v) => (bold = v)}>Bold</SvToggleButton>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvCalendar - a themeable month / year / decade calendar. This is your copy,
|
|
3
|
-
// edit it freely. Docs: https://
|
|
4
|
-
import { SvCalendar } from '@svgrid/grid'
|
|
5
|
-
|
|
6
|
-
let value = $state<Date[]>([new Date()])
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<SvCalendar
|
|
10
|
-
{value}
|
|
11
|
-
selectionMode="range"
|
|
12
|
-
firstDayOfWeek={1}
|
|
13
|
-
footer
|
|
14
|
-
onChange={(dates) => (value = dates)}
|
|
15
|
-
/>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvCalendar - a themeable month / year / decade calendar. This is your copy,
|
|
3
|
+
// edit it freely. Docs: https://svgrid.com/docs/help/ui-components/sv-calendar
|
|
4
|
+
import { SvCalendar } from '@svgrid/grid'
|
|
5
|
+
|
|
6
|
+
let value = $state<Date[]>([new Date()])
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<SvCalendar
|
|
10
|
+
{value}
|
|
11
|
+
selectionMode="range"
|
|
12
|
+
firstDayOfWeek={1}
|
|
13
|
+
footer
|
|
14
|
+
onChange={(dates) => (value = dates)}
|
|
15
|
+
/>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvDateRangeInput - a compact start/end field over a two-month range calendar.
|
|
3
|
-
// This is your copy, edit it freely.
|
|
4
|
-
// Docs: https://
|
|
5
|
-
import { SvDateRangeInput } from '@svgrid/grid'
|
|
6
|
-
|
|
7
|
-
let range = $state<[Date, Date] | null>(null)
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<SvDateRangeInput
|
|
11
|
-
value={range}
|
|
12
|
-
formatString="yyyy-MM-dd"
|
|
13
|
-
months={2}
|
|
14
|
-
onChange={(v) => (range = v)}
|
|
15
|
-
/>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvDateRangeInput - a compact start/end field over a two-month range calendar.
|
|
3
|
+
// This is your copy, edit it freely.
|
|
4
|
+
// Docs: https://svgrid.com/docs/help/ui-components/sv-date-range-input
|
|
5
|
+
import { SvDateRangeInput } from '@svgrid/grid'
|
|
6
|
+
|
|
7
|
+
let range = $state<[Date, Date] | null>(null)
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<SvDateRangeInput
|
|
11
|
+
value={range}
|
|
12
|
+
formatString="yyyy-MM-dd"
|
|
13
|
+
months={2}
|
|
14
|
+
onChange={(v) => (range = v)}
|
|
15
|
+
/>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvDateTimePicker - a masked text field with DATE / TIME dropdown tabs. This
|
|
3
|
-
// is your copy, edit it freely.
|
|
4
|
-
// Docs: https://
|
|
5
|
-
import { SvDateTimePicker } from '@svgrid/grid'
|
|
6
|
-
|
|
7
|
-
let value = $state<Date | null>(new Date())
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<SvDateTimePicker
|
|
11
|
-
{value}
|
|
12
|
-
formatString="yyyy-MM-dd HH:mm"
|
|
13
|
-
dropDownDisplayMode="both"
|
|
14
|
-
nullable
|
|
15
|
-
onChange={(d) => (value = d)}
|
|
16
|
-
/>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvDateTimePicker - a masked text field with DATE / TIME dropdown tabs. This
|
|
3
|
+
// is your copy, edit it freely.
|
|
4
|
+
// Docs: https://svgrid.com/docs/help/ui-components/sv-date-time-picker
|
|
5
|
+
import { SvDateTimePicker } from '@svgrid/grid'
|
|
6
|
+
|
|
7
|
+
let value = $state<Date | null>(new Date())
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<SvDateTimePicker
|
|
11
|
+
{value}
|
|
12
|
+
formatString="yyyy-MM-dd HH:mm"
|
|
13
|
+
dropDownDisplayMode="both"
|
|
14
|
+
nullable
|
|
15
|
+
onChange={(d) => (value = d)}
|
|
16
|
+
/>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvTimePicker - an analog clock-dial time picker. This is your copy, edit it
|
|
3
|
-
// freely. Docs: https://
|
|
4
|
-
import { SvTimePicker } from '@svgrid/grid'
|
|
5
|
-
|
|
6
|
-
let time = $state(new Date())
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<SvTimePicker
|
|
10
|
-
value={time}
|
|
11
|
-
format="12-hour"
|
|
12
|
-
minuteInterval={5}
|
|
13
|
-
footer
|
|
14
|
-
onChange={(d) => (time = d)}
|
|
15
|
-
/>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvTimePicker - an analog clock-dial time picker. This is your copy, edit it
|
|
3
|
+
// freely. Docs: https://svgrid.com/docs/help/ui-components/sv-time-picker
|
|
4
|
+
import { SvTimePicker } from '@svgrid/grid'
|
|
5
|
+
|
|
6
|
+
let time = $state(new Date())
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<SvTimePicker
|
|
10
|
+
value={time}
|
|
11
|
+
format="12-hour"
|
|
12
|
+
minuteInterval={5}
|
|
13
|
+
footer
|
|
14
|
+
onChange={(d) => (time = d)}
|
|
15
|
+
/>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvAlert - an inline contextual message with icon and actions. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvAlert, SvButton } from '@svgrid/grid'
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<SvAlert variant="success" title="Saved">Your changes are live.</SvAlert>
|
|
7
|
-
|
|
8
|
-
<SvAlert variant="danger" title="Payment failed" dismissible>
|
|
9
|
-
We could not charge your card.
|
|
10
|
-
{#snippet actions()}<SvButton size="sm" variant="danger">Retry</SvButton>{/snippet}
|
|
11
|
-
</SvAlert>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvAlert - an inline contextual message with icon and actions. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-alert
|
|
3
|
+
import { SvAlert, SvButton } from '@svgrid/grid'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<SvAlert variant="success" title="Saved">Your changes are live.</SvAlert>
|
|
7
|
+
|
|
8
|
+
<SvAlert variant="danger" title="Payment failed" dismissible>
|
|
9
|
+
We could not charge your card.
|
|
10
|
+
{#snippet actions()}<SvButton size="sm" variant="danger">Retry</SvButton>{/snippet}
|
|
11
|
+
</SvAlert>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvAvatarGroup - overlapping avatars with a "+N" overflow pill. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvAvatarGroup } from '@svgrid/grid'
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<SvAvatarGroup max={3} avatars={[
|
|
7
|
-
{ name: 'Ada Lovelace' },
|
|
8
|
-
{ name: 'Alan Turing' },
|
|
9
|
-
{ name: 'Grace Hopper' },
|
|
10
|
-
{ name: 'Ken Thompson' },
|
|
11
|
-
]} />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvAvatarGroup - overlapping avatars with a "+N" overflow pill. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-avatar-group
|
|
3
|
+
import { SvAvatarGroup } from '@svgrid/grid'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<SvAvatarGroup max={3} avatars={[
|
|
7
|
+
{ name: 'Ada Lovelace' },
|
|
8
|
+
{ name: 'Alan Turing' },
|
|
9
|
+
{ name: 'Grace Hopper' },
|
|
10
|
+
{ name: 'Ken Thompson' },
|
|
11
|
+
]} />
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvAvatar - a user avatar with initials-and-color fallback. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvAvatar } from '@svgrid/grid'
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<SvAvatar name="Ada Lovelace" src="/ada.jpg" status="online" />
|
|
7
|
-
<SvAvatar name="Grace Hopper" />
|
|
8
|
-
<SvAvatar name="Alan Turing" size="lg" shape="square" />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvAvatar - a user avatar with initials-and-color fallback. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-avatar
|
|
3
|
+
import { SvAvatar } from '@svgrid/grid'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<SvAvatar name="Ada Lovelace" src="/ada.jpg" status="online" />
|
|
7
|
+
<SvAvatar name="Grace Hopper" />
|
|
8
|
+
<SvAvatar name="Alan Turing" size="lg" shape="square" />
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvBadge - a small status pill or count label. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvBadge } from '@svgrid/grid'
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<SvBadge variant="success">Active</SvBadge>
|
|
7
|
-
<SvBadge variant="warning">Pending</SvBadge>
|
|
8
|
-
<SvBadge variant="danger" dot>Failed</SvBadge>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvBadge - a small status pill or count label. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-badge
|
|
3
|
+
import { SvBadge } from '@svgrid/grid'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<SvBadge variant="success">Active</SvBadge>
|
|
7
|
+
<SvBadge variant="warning">Pending</SvBadge>
|
|
8
|
+
<SvBadge variant="danger" dot>Failed</SvBadge>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvCarousel - a sliding slideshow with arrows, dots, and autoplay. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvCarousel } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
const imgs = ['/a.jpg', '/b.jpg', '/c.jpg']
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<SvCarousel count={imgs.length} autoplay={4000}>
|
|
9
|
-
{#snippet slide(i)}<img src={imgs[i]} alt="" />{/snippet}
|
|
10
|
-
</SvCarousel>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvCarousel - a sliding slideshow with arrows, dots, and autoplay. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-carousel
|
|
3
|
+
import { SvCarousel } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
const imgs = ['/a.jpg', '/b.jpg', '/c.jpg']
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SvCarousel count={imgs.length} autoplay={4000}>
|
|
9
|
+
{#snippet slide(i)}<img src={imgs[i]} alt="" />{/snippet}
|
|
10
|
+
</SvCarousel>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvChip - a compact interactive pill for tags and filter tokens. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvChip } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
let tags = $state(['design', 'urgent'])
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
{#each tags as tag (tag)}
|
|
9
|
-
<SvChip removable onRemove={() => (tags = tags.filter((t) => t !== tag))}>{tag}</SvChip>
|
|
10
|
-
{/each}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvChip - a compact interactive pill for tags and filter tokens. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-chip
|
|
3
|
+
import { SvChip } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let tags = $state(['design', 'urgent'])
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#each tags as tag (tag)}
|
|
9
|
+
<SvChip removable onRemove={() => (tags = tags.filter((t) => t !== tag))}>{tag}</SvChip>
|
|
10
|
+
{/each}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvEmptyState - a centered placeholder for empty or no-results screens. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvEmptyState, SvButton } from '@svgrid/grid'
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<SvEmptyState title="No orders yet" description="Create your first order to get going.">
|
|
7
|
-
<SvButton variant="primary">New order</SvButton>
|
|
8
|
-
</SvEmptyState>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvEmptyState - a centered placeholder for empty or no-results screens. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-empty-state
|
|
3
|
+
import { SvEmptyState, SvButton } from '@svgrid/grid'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<SvEmptyState title="No orders yet" description="Create your first order to get going.">
|
|
7
|
+
<SvButton variant="primary">New order</SvButton>
|
|
8
|
+
</SvEmptyState>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvLoadingOverlay - a cover-a-container loading scrim. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-loading-overlay
|
|
3
|
+
import { SvLoadingOverlay, SvButton } from '@svgrid/grid'
|
|
4
|
+
let loading = $state(false)
|
|
5
|
+
function run() {
|
|
6
|
+
loading = true
|
|
7
|
+
setTimeout(() => (loading = false), 1200)
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div style="position: relative; padding: 24px; border: 1px solid var(--sg-border, #e2e8f0); border-radius: 10px;">
|
|
12
|
+
<SvLoadingOverlay visible={loading} label="Saving…" />
|
|
13
|
+
<SvButton onclick={run} disabled={loading}>Run task</SvButton>
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvResult - a full result page (success / error / notfound). Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-result
|
|
3
|
+
import { SvResult, SvButton } from '@svgrid/grid'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<SvResult
|
|
7
|
+
status="success"
|
|
8
|
+
title="Payment complete"
|
|
9
|
+
description="Your receipt is on its way to ada@example.com."
|
|
10
|
+
>
|
|
11
|
+
{#snippet actions()}
|
|
12
|
+
<SvButton variant="primary">Back to dashboard</SvButton>
|
|
13
|
+
<SvButton variant="ghost">View receipt</SvButton>
|
|
14
|
+
{/snippet}
|
|
15
|
+
</SvResult>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvSkeleton - a shimmering loading placeholder. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvSkeleton } from '@svgrid/grid'
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<SvSkeleton variant="text" lines={3} />
|
|
7
|
-
<SvSkeleton variant="circle" width="40px" height="40px" />
|
|
8
|
-
<SvSkeleton variant="rect" height="160px" />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvSkeleton - a shimmering loading placeholder. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-skeleton
|
|
3
|
+
import { SvSkeleton } from '@svgrid/grid'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<SvSkeleton variant="text" lines={3} />
|
|
7
|
+
<SvSkeleton variant="circle" width="40px" height="40px" />
|
|
8
|
+
<SvSkeleton variant="rect" height="160px" />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvSpinner - an indeterminate loading ring. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-spinner
|
|
3
|
+
import { SvSpinner } from '@svgrid/grid'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<SvSpinner size="sm" />
|
|
7
|
+
<SvSpinner />
|
|
8
|
+
<SvSpinner size="lg" label="Loading results" />
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvTimeline - a vertical activity or history feed. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvTimeline } from '@svgrid/grid'
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<SvTimeline items={[
|
|
7
|
-
{ title: 'Order placed', time: '09:12', color: '#16a34a', icon: '✓' },
|
|
8
|
-
{ title: 'Shipped', time: '14:40', description: 'Left the warehouse' },
|
|
9
|
-
{ title: 'Out for delivery', time: '08:05' },
|
|
10
|
-
]} />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvTimeline - a vertical activity or history feed. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-timeline
|
|
3
|
+
import { SvTimeline } from '@svgrid/grid'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<SvTimeline items={[
|
|
7
|
+
{ title: 'Order placed', time: '09:12', color: '#16a34a', icon: '✓' },
|
|
8
|
+
{ title: 'Shipped', time: '14:40', description: 'Left the warehouse' },
|
|
9
|
+
{ title: 'Out for delivery', time: '08:05' },
|
|
10
|
+
]} />
|