@svgrid/ui 0.3.3 → 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 -74
- 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
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvSlider - single or dual-thumb range slider. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvSlider } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
let price = $state<[number, number]>([20, 80])
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<SvSlider
|
|
9
|
-
label="Price range"
|
|
10
|
-
range
|
|
11
|
-
value={price}
|
|
12
|
-
min={0}
|
|
13
|
-
max={200}
|
|
14
|
-
step={5}
|
|
15
|
-
ticks={5}
|
|
16
|
-
labels="endpoints"
|
|
17
|
-
formatValue={(v) => `$${v}`}
|
|
18
|
-
onChange={(v) => (price = v)}
|
|
19
|
-
/>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvSlider - single or dual-thumb range slider. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-slider
|
|
3
|
+
import { SvSlider } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let price = $state<[number, number]>([20, 80])
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SvSlider
|
|
9
|
+
label="Price range"
|
|
10
|
+
range
|
|
11
|
+
value={price}
|
|
12
|
+
min={0}
|
|
13
|
+
max={200}
|
|
14
|
+
step={5}
|
|
15
|
+
ticks={5}
|
|
16
|
+
labels="endpoints"
|
|
17
|
+
formatValue={(v) => `$${v}`}
|
|
18
|
+
onChange={(v) => (price = v)}
|
|
19
|
+
/>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvSparkline - tiny inline line/area/bar/winloss chart. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvSparkline } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
let data = $state([3, 7, 4, 9, 6, 11, 8])
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<SvSparkline {data} type="area" />
|
|
9
|
-
<SvSparkline data={[5, -2, 4, -1, 3, 6, -3]} type="winloss" />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvSparkline - tiny inline line/area/bar/winloss chart. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-sparkline
|
|
3
|
+
import { SvSparkline } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let data = $state([3, 7, 4, 9, 6, 11, 8])
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SvSparkline {data} type="area" />
|
|
9
|
+
<SvSparkline data={[5, -2, 4, -1, 3, 6, -3]} type="winloss" />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvStat - KPI metric card with delta trend. Your copy, edit freely. Docs: https://
|
|
3
|
-
import { SvStat } from '@svgrid/grid'
|
|
4
|
-
|
|
5
|
-
let value = $state('$48.2k')
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<SvStat label="Revenue" {value} delta={12.4} hint="vs last month" />
|
|
9
|
-
<SvStat label="Error rate" value="0.8%" delta={-1.2} invert hint="vs last week" />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvStat - KPI metric card with delta trend. Your copy, edit freely. Docs: https://svgrid.com/docs/help/ui-components/sv-stat
|
|
3
|
+
import { SvStat } from '@svgrid/grid'
|
|
4
|
+
|
|
5
|
+
let value = $state('$48.2k')
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SvStat label="Revenue" {value} delta={12.4} hint="vs last month" />
|
|
9
|
+
<SvStat label="Error rate" value="0.8%" delta={-1.2} invert hint="vs last week" />
|
package/recipes/registry.json
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"switch-button",
|
|
21
21
|
"check-box",
|
|
22
22
|
"radio-group",
|
|
23
|
-
"rating"
|
|
23
|
+
"rating",
|
|
24
|
+
"segmented"
|
|
24
25
|
]
|
|
25
26
|
},
|
|
26
27
|
"inputs": {
|
|
@@ -71,7 +72,10 @@
|
|
|
71
72
|
"drawer",
|
|
72
73
|
"toaster",
|
|
73
74
|
"context-menu",
|
|
74
|
-
"menu"
|
|
75
|
+
"menu",
|
|
76
|
+
"hover-card",
|
|
77
|
+
"popconfirm",
|
|
78
|
+
"menubar"
|
|
75
79
|
]
|
|
76
80
|
},
|
|
77
81
|
"layout": {
|
|
@@ -88,7 +92,11 @@
|
|
|
88
92
|
"grid-chart",
|
|
89
93
|
"form",
|
|
90
94
|
"field",
|
|
91
|
-
"file-upload"
|
|
95
|
+
"file-upload",
|
|
96
|
+
"collapsible",
|
|
97
|
+
"layout",
|
|
98
|
+
"typography",
|
|
99
|
+
"display"
|
|
92
100
|
]
|
|
93
101
|
},
|
|
94
102
|
"feedback": {
|
|
@@ -102,7 +110,10 @@
|
|
|
102
110
|
"timeline",
|
|
103
111
|
"avatar",
|
|
104
112
|
"avatar-group",
|
|
105
|
-
"carousel"
|
|
113
|
+
"carousel",
|
|
114
|
+
"spinner",
|
|
115
|
+
"loading-overlay",
|
|
116
|
+
"result"
|
|
106
117
|
]
|
|
107
118
|
},
|
|
108
119
|
"navigation": {
|
|
@@ -927,6 +938,60 @@
|
|
|
927
938
|
],
|
|
928
939
|
"group": "overlays"
|
|
929
940
|
},
|
|
941
|
+
{
|
|
942
|
+
"id": "hover-card",
|
|
943
|
+
"title": "Hover card",
|
|
944
|
+
"description": "A rich preview card that opens on hover, positioned by the shared engine.",
|
|
945
|
+
"aliases": [
|
|
946
|
+
"svhovercard"
|
|
947
|
+
],
|
|
948
|
+
"deps": [
|
|
949
|
+
"@svgrid/grid"
|
|
950
|
+
],
|
|
951
|
+
"files": [
|
|
952
|
+
{
|
|
953
|
+
"write": "hover-card.svelte",
|
|
954
|
+
"from": "overlays/hover-card.svelte"
|
|
955
|
+
}
|
|
956
|
+
],
|
|
957
|
+
"group": "overlays"
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
"id": "popconfirm",
|
|
961
|
+
"title": "Popconfirm",
|
|
962
|
+
"description": "A quick confirm step in a popover for low-stakes destructive actions.",
|
|
963
|
+
"aliases": [
|
|
964
|
+
"svpopconfirm"
|
|
965
|
+
],
|
|
966
|
+
"deps": [
|
|
967
|
+
"@svgrid/grid"
|
|
968
|
+
],
|
|
969
|
+
"files": [
|
|
970
|
+
{
|
|
971
|
+
"write": "popconfirm.svelte",
|
|
972
|
+
"from": "overlays/popconfirm.svelte"
|
|
973
|
+
}
|
|
974
|
+
],
|
|
975
|
+
"group": "overlays"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"id": "menubar",
|
|
979
|
+
"title": "Menubar",
|
|
980
|
+
"description": "An app-style row of dropdown menus with roving focus and full keyboard support.",
|
|
981
|
+
"aliases": [
|
|
982
|
+
"svmenubar"
|
|
983
|
+
],
|
|
984
|
+
"deps": [
|
|
985
|
+
"@svgrid/grid"
|
|
986
|
+
],
|
|
987
|
+
"files": [
|
|
988
|
+
{
|
|
989
|
+
"write": "menubar.svelte",
|
|
990
|
+
"from": "overlays/menubar.svelte"
|
|
991
|
+
}
|
|
992
|
+
],
|
|
993
|
+
"group": "overlays"
|
|
994
|
+
},
|
|
930
995
|
{
|
|
931
996
|
"id": "tabs",
|
|
932
997
|
"title": "Tabs",
|
|
@@ -1148,6 +1213,99 @@
|
|
|
1148
1213
|
],
|
|
1149
1214
|
"group": "layout"
|
|
1150
1215
|
},
|
|
1216
|
+
{
|
|
1217
|
+
"id": "collapsible",
|
|
1218
|
+
"title": "Collapsible",
|
|
1219
|
+
"description": "Single animated show/hide section with accessible trigger and inert closed region.",
|
|
1220
|
+
"aliases": [
|
|
1221
|
+
"svcollapsible",
|
|
1222
|
+
"disclosure"
|
|
1223
|
+
],
|
|
1224
|
+
"deps": [
|
|
1225
|
+
"@svgrid/grid"
|
|
1226
|
+
],
|
|
1227
|
+
"files": [
|
|
1228
|
+
{
|
|
1229
|
+
"write": "collapsible.svelte",
|
|
1230
|
+
"from": "layout/collapsible.svelte"
|
|
1231
|
+
}
|
|
1232
|
+
],
|
|
1233
|
+
"group": "layout"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"id": "layout",
|
|
1237
|
+
"title": "Layout primitives",
|
|
1238
|
+
"description": "SvStack (column), SvGroup (row), and SvSimpleGrid (responsive grid) - gap-based flex/grid wrappers.",
|
|
1239
|
+
"aliases": [
|
|
1240
|
+
"svstack",
|
|
1241
|
+
"svgroup",
|
|
1242
|
+
"svsimplegrid",
|
|
1243
|
+
"stack",
|
|
1244
|
+
"group",
|
|
1245
|
+
"simple-grid"
|
|
1246
|
+
],
|
|
1247
|
+
"deps": [
|
|
1248
|
+
"@svgrid/grid"
|
|
1249
|
+
],
|
|
1250
|
+
"files": [
|
|
1251
|
+
{
|
|
1252
|
+
"write": "layout.svelte",
|
|
1253
|
+
"from": "layout/layout.svelte"
|
|
1254
|
+
}
|
|
1255
|
+
],
|
|
1256
|
+
"group": "layout"
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
"id": "typography",
|
|
1260
|
+
"title": "Typography",
|
|
1261
|
+
"description": "Prose primitives - SvTitle, SvText, SvAnchor, SvBlockquote, SvMark, SvList - on one type scale.",
|
|
1262
|
+
"aliases": [
|
|
1263
|
+
"svtitle",
|
|
1264
|
+
"svtext",
|
|
1265
|
+
"svanchor",
|
|
1266
|
+
"svblockquote",
|
|
1267
|
+
"svmark",
|
|
1268
|
+
"svlist",
|
|
1269
|
+
"title",
|
|
1270
|
+
"text",
|
|
1271
|
+
"prose"
|
|
1272
|
+
],
|
|
1273
|
+
"deps": [
|
|
1274
|
+
"@svgrid/grid"
|
|
1275
|
+
],
|
|
1276
|
+
"files": [
|
|
1277
|
+
{
|
|
1278
|
+
"write": "typography.svelte",
|
|
1279
|
+
"from": "layout/typography.svelte"
|
|
1280
|
+
}
|
|
1281
|
+
],
|
|
1282
|
+
"group": "layout"
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
"id": "display",
|
|
1286
|
+
"title": "Display primitives",
|
|
1287
|
+
"description": "Small display helpers - SvKbd, SvCode, SvAspectRatio, SvVisuallyHidden.",
|
|
1288
|
+
"aliases": [
|
|
1289
|
+
"svkbd",
|
|
1290
|
+
"svcode",
|
|
1291
|
+
"svaspectratio",
|
|
1292
|
+
"svvisuallyhidden",
|
|
1293
|
+
"kbd",
|
|
1294
|
+
"code",
|
|
1295
|
+
"aspect-ratio",
|
|
1296
|
+
"visually-hidden"
|
|
1297
|
+
],
|
|
1298
|
+
"deps": [
|
|
1299
|
+
"@svgrid/grid"
|
|
1300
|
+
],
|
|
1301
|
+
"files": [
|
|
1302
|
+
{
|
|
1303
|
+
"write": "display.svelte",
|
|
1304
|
+
"from": "layout/display.svelte"
|
|
1305
|
+
}
|
|
1306
|
+
],
|
|
1307
|
+
"group": "layout"
|
|
1308
|
+
},
|
|
1151
1309
|
{
|
|
1152
1310
|
"id": "badge",
|
|
1153
1311
|
"title": "Badge",
|
|
@@ -1166,6 +1324,81 @@
|
|
|
1166
1324
|
],
|
|
1167
1325
|
"group": "feedback"
|
|
1168
1326
|
},
|
|
1327
|
+
{
|
|
1328
|
+
"id": "segmented",
|
|
1329
|
+
"title": "Segmented",
|
|
1330
|
+
"description": "Compact single-select track for view switchers and small enum settings, on the radio-group core.",
|
|
1331
|
+
"aliases": [
|
|
1332
|
+
"svsegmented",
|
|
1333
|
+
"segmented-control"
|
|
1334
|
+
],
|
|
1335
|
+
"deps": [
|
|
1336
|
+
"@svgrid/grid"
|
|
1337
|
+
],
|
|
1338
|
+
"files": [
|
|
1339
|
+
{
|
|
1340
|
+
"write": "segmented.svelte",
|
|
1341
|
+
"from": "buttons/segmented.svelte"
|
|
1342
|
+
}
|
|
1343
|
+
],
|
|
1344
|
+
"group": "buttons"
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
"id": "spinner",
|
|
1348
|
+
"title": "Spinner",
|
|
1349
|
+
"description": "Indeterminate loading ring that inherits text colour and respects reduced-motion.",
|
|
1350
|
+
"aliases": [
|
|
1351
|
+
"svspinner",
|
|
1352
|
+
"loader"
|
|
1353
|
+
],
|
|
1354
|
+
"deps": [
|
|
1355
|
+
"@svgrid/grid"
|
|
1356
|
+
],
|
|
1357
|
+
"files": [
|
|
1358
|
+
{
|
|
1359
|
+
"write": "spinner.svelte",
|
|
1360
|
+
"from": "feedback/spinner.svelte"
|
|
1361
|
+
}
|
|
1362
|
+
],
|
|
1363
|
+
"group": "feedback"
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
"id": "loading-overlay",
|
|
1367
|
+
"title": "Loading overlay",
|
|
1368
|
+
"description": "Cover-a-container scrim with a centred spinner while content loads or saves.",
|
|
1369
|
+
"aliases": [
|
|
1370
|
+
"svloadingoverlay",
|
|
1371
|
+
"loadingoverlay"
|
|
1372
|
+
],
|
|
1373
|
+
"deps": [
|
|
1374
|
+
"@svgrid/grid"
|
|
1375
|
+
],
|
|
1376
|
+
"files": [
|
|
1377
|
+
{
|
|
1378
|
+
"write": "loading-overlay.svelte",
|
|
1379
|
+
"from": "feedback/loading-overlay.svelte"
|
|
1380
|
+
}
|
|
1381
|
+
],
|
|
1382
|
+
"group": "feedback"
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
"id": "result",
|
|
1386
|
+
"title": "Result",
|
|
1387
|
+
"description": "Full result page (success / error / warning / info / not-found) with icon, title, and actions.",
|
|
1388
|
+
"aliases": [
|
|
1389
|
+
"svresult"
|
|
1390
|
+
],
|
|
1391
|
+
"deps": [
|
|
1392
|
+
"@svgrid/grid"
|
|
1393
|
+
],
|
|
1394
|
+
"files": [
|
|
1395
|
+
{
|
|
1396
|
+
"write": "result.svelte",
|
|
1397
|
+
"from": "feedback/result.svelte"
|
|
1398
|
+
}
|
|
1399
|
+
],
|
|
1400
|
+
"group": "feedback"
|
|
1401
|
+
},
|
|
1169
1402
|
{
|
|
1170
1403
|
"id": "skeleton",
|
|
1171
1404
|
"title": "Skeleton",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvAutoComplete - free-text input with a live suggestion list. Your copy, edit freely. Docs: https://
|
|
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" />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvAutoComplete - free-text input with a live suggestion list. Your copy, edit freely. Docs: https://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" />
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvComboBox - searchable single-select combobox. Your copy, edit freely. Docs: https://
|
|
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 />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvComboBox - searchable single-select combobox. Your copy, edit freely. Docs: https://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 />
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvCountryInput - searchable country picker emitting an ISO code. Your copy, edit freely. Docs: https://
|
|
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 />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvCountryInput - searchable country picker emitting an ISO code. Your copy, edit freely. Docs: https://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 />
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvDropDownList - single-select dropdown with no typing. Your copy, edit freely. Docs: https://
|
|
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)} />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvDropDownList - single-select dropdown with no typing. Your copy, edit freely. Docs: https://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)} />
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvGridSelect - grid-in-a-dropdown multi-column single-select. Your copy, edit freely. Docs: https://
|
|
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 />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvGridSelect - grid-in-a-dropdown multi-column single-select. Your copy, edit freely. Docs: https://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 />
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvListBox - inline single/multi-select list picker. Your copy, edit freely. Docs: https://
|
|
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)} />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvListBox - inline single/multi-select list picker. Your copy, edit freely. Docs: https://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)} />
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvMultiSelect - multi-select dropdown with a chip trigger. Your copy, edit freely. Docs: https://
|
|
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} />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvMultiSelect - multi-select dropdown with a chip trigger. Your copy, edit freely. Docs: https://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} />
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// SvTreeSelect - single-select dropdown over a collapsible tree. Your copy, edit freely. Docs: https://
|
|
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 />
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// SvTreeSelect - single-select dropdown over a collapsible tree. Your copy, edit freely. Docs: https://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 />
|