@rbxts/uiblox 0.2.0-alpha.16 → 0.2.0-alpha.17

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.
@@ -1,10 +1,12 @@
1
1
  import React from "@rbxts/react";
2
2
  import { CustomizedProps } from "../../../../theme/index";
3
+ import { BadgeColor } from "./Badge.styles";
3
4
  export interface BadgeProps {
4
5
  count?: number;
5
6
  max?: number;
6
7
  invisible?: boolean;
7
8
  variant?: "standard" | "dot";
9
+ color?: BadgeColor;
8
10
  children?: React.ReactNode;
9
11
  }
10
12
  declare function Badge(props: CustomizedProps<Frame, BadgeProps>): JSX.Element;
@@ -21,6 +21,10 @@ local function Badge(props)
21
21
  if variant == nil then
22
22
  variant = "standard"
23
23
  end
24
+ local color = _binding.color
25
+ if color == nil then
26
+ color = "error"
27
+ end
24
28
  local children = _binding.children
25
29
  local className = _binding.className
26
30
  local sx = _binding.sx
@@ -28,6 +32,7 @@ local function Badge(props)
28
32
  local ref = _binding.ref
29
33
  local styles = useBadgeStyles({
30
34
  variant = variant,
35
+ color = color,
31
36
  })
32
37
  local isDot = variant == "dot"
33
38
  local shown = not invisible and (isDot or count > 0)
@@ -1,4 +1,6 @@
1
+ export type BadgeColor = "error" | "primary" | "success";
1
2
  declare const useBadgeStyles: (props: {
2
3
  variant?: "standard" | "dot";
4
+ color?: BadgeColor;
3
5
  }) => import("../../../../theme/index").ClassNameMap<string>;
4
6
  export default useBadgeStyles;
@@ -8,7 +8,12 @@ local useBadgeStyles = componentStyles("Badge", function(theme, _param)
8
8
  if variant == nil then
9
9
  variant = "standard"
10
10
  end
11
+ local color = _param.color
12
+ if color == nil then
13
+ color = "error"
14
+ end
11
15
  local diameter = if variant == "dot" then theme.spacing.calc(1) else theme.spacing.calc(2) + theme.padding.calc(1)
16
+ local tone = if color == "primary" then theme.palette.primary elseif color == "success" then theme.palette.status.success else theme.palette.status.error
12
17
  return createStyles({
13
18
  root = {
14
19
  AutomaticSize = Enum.AutomaticSize.XY,
@@ -21,11 +26,11 @@ local useBadgeStyles = componentStyles("Badge", function(theme, _param)
21
26
  Position = UDim2.fromScale(1, 0),
22
27
  AutomaticSize = if variant == "dot" then Enum.AutomaticSize.None else Enum.AutomaticSize.X,
23
28
  Size = UDim2.fromOffset(diameter, diameter),
24
- BackgroundColor3 = theme.palette.status.error.main,
29
+ BackgroundColor3 = tone.main,
25
30
  BorderSizePixel = 0,
26
31
  Font = theme.typography.fontFamilies.default,
27
32
  TextSize = theme.typography.fontSizes.caption,
28
- TextColor3 = theme.palette.text.inverse,
33
+ TextColor3 = if color == "error" then theme.palette.text.inverse else tone.on,
29
34
  TextXAlignment = Enum.TextXAlignment.Center,
30
35
  TextYAlignment = Enum.TextYAlignment.Center,
31
36
  ZIndex = 2,
@@ -6,6 +6,8 @@ export interface SnackbarProps {
6
6
  duration?: number;
7
7
  variant?: ToastVariants;
8
8
  open?: boolean;
9
+ action?: string;
10
+ onAction?: () => void;
9
11
  }
10
12
  declare function Snackbar(props: CustomizedProps<Frame, SnackbarProps>): JSX.Element | undefined;
11
13
  export default Snackbar;
@@ -2,6 +2,7 @@
2
2
  local TS = _G[script]
3
3
  local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
4
  local Toast = TS.import(script, script.Parent.Parent.Parent, "toast").Toast
5
+ local snackbarActionLabel = TS.import(script, script.Parent, "snackbarAction").snackbarActionLabel
5
6
  local function Snackbar(props)
6
7
  local _binding = props
7
8
  local message = _binding.message
@@ -12,6 +13,8 @@ local function Snackbar(props)
12
13
  if open == nil then
13
14
  open = true
14
15
  end
16
+ local action = _binding.action
17
+ local onAction = _binding.onAction
15
18
  local className = _binding.className
16
19
  local sx = _binding.sx
17
20
  local id = _binding.id
@@ -24,6 +27,8 @@ local function Snackbar(props)
24
27
  onDismiss = onDismiss,
25
28
  duration = duration,
26
29
  variant = variant,
30
+ action = snackbarActionLabel(action),
31
+ onAction = onAction,
27
32
  className = className,
28
33
  sx = sx,
29
34
  }
@@ -0,0 +1 @@
1
+ export declare function snackbarActionLabel(action?: string): string | undefined;
@@ -0,0 +1,10 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local function snackbarActionLabel(action)
3
+ if action == nil or #action == 0 then
4
+ return nil
5
+ end
6
+ return action
7
+ end
8
+ return {
9
+ snackbarActionLabel = snackbarActionLabel,
10
+ }
@@ -1342,317 +1342,330 @@ local function chromeRows()
1342
1342
  local _Length_1 = #_array_2
1343
1343
  table.move(_array_2, 1, _Length_1, _length + 1, _array)
1344
1344
  _length += _Length_1
1345
- local _array_3 = pair("Avatar", "initials", {
1346
- text = "BL",
1345
+ local _array_3 = pair("Badge", "primary", {
1346
+ variant = "primary",
1347
1347
  })
1348
1348
  local _Length_2 = #_array_3
1349
1349
  table.move(_array_3, 1, _Length_2, _length + 1, _array)
1350
1350
  _length += _Length_2
1351
- local _array_4 = pair("Avatar", "image", {
1352
- variant = "image",
1351
+ local _array_4 = pair("Avatar", "initials", {
1352
+ text = "BL",
1353
1353
  })
1354
1354
  local _Length_3 = #_array_4
1355
1355
  table.move(_array_4, 1, _Length_3, _length + 1, _array)
1356
1356
  _length += _Length_3
1357
- local _array_5 = pair("Avatar", "small", {
1358
- size = "small",
1357
+ local _array_5 = pair("Avatar", "image", {
1358
+ variant = "image",
1359
1359
  })
1360
1360
  local _Length_4 = #_array_5
1361
1361
  table.move(_array_5, 1, _Length_4, _length + 1, _array)
1362
1362
  _length += _Length_4
1363
- local _array_6 = pair("Avatar", "rounded", {
1364
- variant = "rounded",
1363
+ local _array_6 = pair("Avatar", "small", {
1364
+ size = "small",
1365
1365
  })
1366
1366
  local _Length_5 = #_array_6
1367
1367
  table.move(_array_6, 1, _Length_5, _length + 1, _array)
1368
1368
  _length += _Length_5
1369
- local _array_7 = pair("Drawer", "closed", {
1370
- open = false,
1369
+ local _array_7 = pair("Avatar", "rounded", {
1370
+ variant = "rounded",
1371
1371
  })
1372
1372
  local _Length_6 = #_array_7
1373
1373
  table.move(_array_7, 1, _Length_6, _length + 1, _array)
1374
1374
  _length += _Length_6
1375
- local _array_8 = pair("Drawer", "left", {
1376
- open = true,
1377
- variant = "left",
1375
+ local _array_8 = pair("Drawer", "closed", {
1376
+ open = false,
1378
1377
  })
1379
1378
  local _Length_7 = #_array_8
1380
1379
  table.move(_array_8, 1, _Length_7, _length + 1, _array)
1381
1380
  _length += _Length_7
1382
- local _array_9 = pair("Drawer", "right", {
1381
+ local _array_9 = pair("Drawer", "left", {
1383
1382
  open = true,
1384
- variant = "right",
1383
+ variant = "left",
1385
1384
  })
1386
1385
  local _Length_8 = #_array_9
1387
1386
  table.move(_array_9, 1, _Length_8, _length + 1, _array)
1388
1387
  _length += _Length_8
1389
- local _array_10 = pair("Drawer", "wide", {
1388
+ local _array_10 = pair("Drawer", "right", {
1390
1389
  open = true,
1391
- variant = "wide",
1390
+ variant = "right",
1392
1391
  })
1393
1392
  local _Length_9 = #_array_10
1394
1393
  table.move(_array_10, 1, _Length_9, _length + 1, _array)
1395
1394
  _length += _Length_9
1396
- local _array_11 = pair("Breadcrumbs", "single", {
1397
- text = "Home",
1395
+ local _array_11 = pair("Drawer", "wide", {
1396
+ open = true,
1397
+ variant = "wide",
1398
1398
  })
1399
1399
  local _Length_10 = #_array_11
1400
1400
  table.move(_array_11, 1, _Length_10, _length + 1, _array)
1401
1401
  _length += _Length_10
1402
- local _array_12 = pair("Breadcrumbs", "trail", {
1403
- text = "Home / Library / Item",
1402
+ local _array_12 = pair("Breadcrumbs", "single", {
1403
+ text = "Home",
1404
1404
  })
1405
1405
  local _Length_11 = #_array_12
1406
1406
  table.move(_array_12, 1, _Length_11, _length + 1, _array)
1407
1407
  _length += _Length_11
1408
- local _array_13 = pair("Breadcrumbs", "collapsed", {
1409
- text = "Home / … / Item",
1410
- size = "small",
1408
+ local _array_13 = pair("Breadcrumbs", "trail", {
1409
+ text = "Home / Library / Item",
1411
1410
  })
1412
1411
  local _Length_12 = #_array_13
1413
1412
  table.move(_array_13, 1, _Length_12, _length + 1, _array)
1414
1413
  _length += _Length_12
1415
- local _array_14 = pair("Breadcrumbs", "custom-separator", {
1416
- text = "Home > Item",
1414
+ local _array_14 = pair("Breadcrumbs", "collapsed", {
1415
+ text = "Home / … / Item",
1416
+ size = "small",
1417
1417
  })
1418
1418
  local _Length_13 = #_array_14
1419
1419
  table.move(_array_14, 1, _Length_13, _length + 1, _array)
1420
1420
  _length += _Length_13
1421
- local _array_15 = pair("Pagination", "first", {
1422
- value = 1,
1421
+ local _array_15 = pair("Breadcrumbs", "custom-separator", {
1422
+ text = "Home > Item",
1423
1423
  })
1424
1424
  local _Length_14 = #_array_15
1425
1425
  table.move(_array_15, 1, _Length_14, _length + 1, _array)
1426
1426
  _length += _Length_14
1427
- local _array_16 = pair("Pagination", "middle", {
1428
- value = 3,
1427
+ local _array_16 = pair("Pagination", "first", {
1428
+ value = 1,
1429
1429
  })
1430
1430
  local _Length_15 = #_array_16
1431
1431
  table.move(_array_16, 1, _Length_15, _length + 1, _array)
1432
1432
  _length += _Length_15
1433
- local _array_17 = pair("Pagination", "collapsed", {
1434
- value = 10,
1435
- size = "large",
1433
+ local _array_17 = pair("Pagination", "middle", {
1434
+ value = 3,
1436
1435
  })
1437
1436
  local _Length_16 = #_array_17
1438
1437
  table.move(_array_17, 1, _Length_16, _length + 1, _array)
1439
1438
  _length += _Length_16
1440
- local _array_18 = pair("Pagination", "disabled", {
1441
- value = 2,
1442
- disabled = true,
1439
+ local _array_18 = pair("Pagination", "collapsed", {
1440
+ value = 10,
1441
+ size = "large",
1443
1442
  })
1444
1443
  local _Length_17 = #_array_18
1445
1444
  table.move(_array_18, 1, _Length_17, _length + 1, _array)
1446
1445
  _length += _Length_17
1447
- local _array_19 = pair("Pagination", "size-small", {
1446
+ local _array_19 = pair("Pagination", "disabled", {
1448
1447
  value = 2,
1449
- size = "small",
1448
+ disabled = true,
1450
1449
  })
1451
1450
  local _Length_18 = #_array_19
1452
1451
  table.move(_array_19, 1, _Length_18, _length + 1, _array)
1453
1452
  _length += _Length_18
1454
- local _array_20 = pair("Stepper", "first", {
1455
- value = 0,
1453
+ local _array_20 = pair("Pagination", "size-small", {
1454
+ value = 2,
1455
+ size = "small",
1456
1456
  })
1457
1457
  local _Length_19 = #_array_20
1458
1458
  table.move(_array_20, 1, _Length_19, _length + 1, _array)
1459
1459
  _length += _Length_19
1460
- local _array_21 = pair("Stepper", "middle", {
1461
- value = 1,
1460
+ local _array_21 = pair("Stepper", "first", {
1461
+ value = 0,
1462
1462
  })
1463
1463
  local _Length_20 = #_array_21
1464
1464
  table.move(_array_21, 1, _Length_20, _length + 1, _array)
1465
1465
  _length += _Length_20
1466
- local _array_22 = pair("Stepper", "last", {
1467
- value = 2,
1466
+ local _array_22 = pair("Stepper", "middle", {
1467
+ value = 1,
1468
1468
  })
1469
1469
  local _Length_21 = #_array_22
1470
1470
  table.move(_array_22, 1, _Length_21, _length + 1, _array)
1471
1471
  _length += _Length_21
1472
- local _array_23 = pair("Stepper", "vertical", {
1473
- value = 1,
1474
- variant = "vertical",
1472
+ local _array_23 = pair("Stepper", "last", {
1473
+ value = 2,
1475
1474
  })
1476
1475
  local _Length_22 = #_array_23
1477
1476
  table.move(_array_23, 1, _Length_22, _length + 1, _array)
1478
1477
  _length += _Length_22
1479
- local _array_24 = pair("Accordion", "closed", {
1480
- open = false,
1478
+ local _array_24 = pair("Stepper", "vertical", {
1479
+ value = 1,
1480
+ variant = "vertical",
1481
1481
  })
1482
1482
  local _Length_23 = #_array_24
1483
1483
  table.move(_array_24, 1, _Length_23, _length + 1, _array)
1484
1484
  _length += _Length_23
1485
- local _array_25 = pair("Accordion", "open", {
1486
- open = true,
1485
+ local _array_25 = pair("Accordion", "closed", {
1486
+ open = false,
1487
1487
  })
1488
1488
  local _Length_24 = #_array_25
1489
1489
  table.move(_array_25, 1, _Length_24, _length + 1, _array)
1490
1490
  _length += _Length_24
1491
- local _array_26 = pair("Accordion", "disabled", {
1492
- open = false,
1493
- disabled = true,
1491
+ local _array_26 = pair("Accordion", "open", {
1492
+ open = true,
1494
1493
  })
1495
1494
  local _Length_25 = #_array_26
1496
1495
  table.move(_array_26, 1, _Length_25, _length + 1, _array)
1497
1496
  _length += _Length_25
1498
- local _array_27 = pair("Accordion", "indicator", {
1499
- open = true,
1497
+ local _array_27 = pair("Accordion", "disabled", {
1498
+ open = false,
1499
+ disabled = true,
1500
1500
  })
1501
1501
  local _Length_26 = #_array_27
1502
1502
  table.move(_array_27, 1, _Length_26, _length + 1, _array)
1503
1503
  _length += _Length_26
1504
- local _array_28 = pair("Snackbar", "open", {
1504
+ local _array_28 = pair("Accordion", "indicator", {
1505
1505
  open = true,
1506
- text = "Saved",
1507
1506
  })
1508
1507
  local _Length_27 = #_array_28
1509
1508
  table.move(_array_28, 1, _Length_27, _length + 1, _array)
1510
1509
  _length += _Length_27
1511
- local _array_29 = pair("Snackbar", "closed", {
1512
- open = false,
1510
+ local _array_29 = pair("Snackbar", "open", {
1511
+ open = true,
1513
1512
  text = "Saved",
1514
1513
  })
1515
1514
  local _Length_28 = #_array_29
1516
1515
  table.move(_array_29, 1, _Length_28, _length + 1, _array)
1517
1516
  _length += _Length_28
1518
- local _array_30 = pair("Table", "empty", {
1519
- text = "",
1517
+ local _array_30 = pair("Snackbar", "closed", {
1518
+ open = false,
1519
+ text = "Saved",
1520
1520
  })
1521
1521
  local _Length_29 = #_array_30
1522
1522
  table.move(_array_30, 1, _Length_29, _length + 1, _array)
1523
1523
  _length += _Length_29
1524
- local _array_31 = pair("Table", "default", {
1525
- text = "Name / Role",
1524
+ local _array_31 = pair("Snackbar", "action", {
1525
+ open = true,
1526
+ text = "Undo",
1526
1527
  })
1527
1528
  local _Length_30 = #_array_31
1528
1529
  table.move(_array_31, 1, _Length_30, _length + 1, _array)
1529
1530
  _length += _Length_30
1530
- local _array_32 = pair("Table", "selected", {
1531
- text = "Name / Role",
1532
- value = 0,
1531
+ local _array_32 = pair("Table", "empty", {
1532
+ text = "",
1533
1533
  })
1534
1534
  local _Length_31 = #_array_32
1535
1535
  table.move(_array_32, 1, _Length_31, _length + 1, _array)
1536
1536
  _length += _Length_31
1537
- local _array_33 = pair("Table", "dense", {
1537
+ local _array_33 = pair("Table", "default", {
1538
1538
  text = "Name / Role",
1539
- variant = "dense",
1540
1539
  })
1541
1540
  local _Length_32 = #_array_33
1542
1541
  table.move(_array_33, 1, _Length_32, _length + 1, _array)
1543
1542
  _length += _Length_32
1544
- local _array_34 = pair("Autocomplete", "default", {
1545
- value = "Continue",
1546
- options = { "Continue", "Other" },
1543
+ local _array_34 = pair("Table", "selected", {
1544
+ text = "Name / Role",
1545
+ value = 0,
1547
1546
  })
1548
1547
  local _Length_33 = #_array_34
1549
1548
  table.move(_array_34, 1, _Length_33, _length + 1, _array)
1550
1549
  _length += _Length_33
1551
- local _array_35 = pair("Autocomplete", "open", {
1552
- value = "Continue",
1553
- options = { "Continue", "Other" },
1554
- open = true,
1550
+ local _array_35 = pair("Table", "dense", {
1551
+ text = "Name / Role",
1552
+ variant = "dense",
1555
1553
  })
1556
1554
  local _Length_34 = #_array_35
1557
1555
  table.move(_array_35, 1, _Length_34, _length + 1, _array)
1558
1556
  _length += _Length_34
1559
- local _array_36 = pair("Autocomplete", "disabled", {
1557
+ local _array_36 = pair("Autocomplete", "default", {
1560
1558
  value = "Continue",
1561
1559
  options = { "Continue", "Other" },
1562
- disabled = true,
1563
1560
  })
1564
1561
  local _Length_35 = #_array_36
1565
1562
  table.move(_array_36, 1, _Length_35, _length + 1, _array)
1566
1563
  _length += _Length_35
1567
- local _array_37 = pair("Autocomplete", "empty", {
1568
- value = "",
1569
- options = {},
1564
+ local _array_37 = pair("Autocomplete", "open", {
1565
+ value = "Continue",
1566
+ options = { "Continue", "Other" },
1570
1567
  open = true,
1571
1568
  })
1572
1569
  local _Length_36 = #_array_37
1573
1570
  table.move(_array_37, 1, _Length_36, _length + 1, _array)
1574
1571
  _length += _Length_36
1575
- local _array_38 = pair("Autocomplete", "no-results", {
1572
+ local _array_38 = pair("Autocomplete", "disabled", {
1576
1573
  value = "Continue",
1577
1574
  options = { "Continue", "Other" },
1578
- open = true,
1579
- filter = "zzz",
1575
+ disabled = true,
1580
1576
  })
1581
1577
  local _Length_37 = #_array_38
1582
1578
  table.move(_array_38, 1, _Length_37, _length + 1, _array)
1583
1579
  _length += _Length_37
1584
- local _array_39 = pair("Fab", "default")
1580
+ local _array_39 = pair("Autocomplete", "empty", {
1581
+ value = "",
1582
+ options = {},
1583
+ open = true,
1584
+ })
1585
1585
  local _Length_38 = #_array_39
1586
1586
  table.move(_array_39, 1, _Length_38, _length + 1, _array)
1587
1587
  _length += _Length_38
1588
- local _array_40 = pair("Fab", "extended", {
1589
- text = "Compose",
1588
+ local _array_40 = pair("Autocomplete", "no-results", {
1589
+ value = "Continue",
1590
+ options = { "Continue", "Other" },
1591
+ open = true,
1592
+ filter = "zzz",
1590
1593
  })
1591
1594
  local _Length_39 = #_array_40
1592
1595
  table.move(_array_40, 1, _Length_39, _length + 1, _array)
1593
1596
  _length += _Length_39
1594
- local _array_41 = pair("Fab", "small", {
1595
- size = "small",
1596
- })
1597
+ local _array_41 = pair("Fab", "default")
1597
1598
  local _Length_40 = #_array_41
1598
1599
  table.move(_array_41, 1, _Length_40, _length + 1, _array)
1599
1600
  _length += _Length_40
1600
- local _array_42 = pair("Fab", "large", {
1601
- size = "large",
1601
+ local _array_42 = pair("Fab", "extended", {
1602
+ text = "Compose",
1602
1603
  })
1603
1604
  local _Length_41 = #_array_42
1604
1605
  table.move(_array_42, 1, _Length_41, _length + 1, _array)
1605
1606
  _length += _Length_41
1606
- local _array_43 = pair("Fab", "disabled", {
1607
- disabled = true,
1607
+ local _array_43 = pair("Fab", "small", {
1608
+ size = "small",
1608
1609
  })
1609
1610
  local _Length_42 = #_array_43
1610
1611
  table.move(_array_43, 1, _Length_42, _length + 1, _array)
1611
1612
  _length += _Length_42
1612
- local _array_44 = pair("Fab", "loading", {
1613
- loading = true,
1613
+ local _array_44 = pair("Fab", "large", {
1614
+ size = "large",
1614
1615
  })
1615
1616
  local _Length_43 = #_array_44
1616
1617
  table.move(_array_44, 1, _Length_43, _length + 1, _array)
1617
1618
  _length += _Length_43
1618
- local _array_45 = pair("Fab", "accent", {
1619
- variant = "accent",
1619
+ local _array_45 = pair("Fab", "disabled", {
1620
+ disabled = true,
1620
1621
  })
1621
1622
  local _Length_44 = #_array_45
1622
1623
  table.move(_array_45, 1, _Length_44, _length + 1, _array)
1623
1624
  _length += _Length_44
1624
- local _array_46 = pair("AppBar", "default", {
1625
- text = "Storyblox",
1625
+ local _array_46 = pair("Fab", "loading", {
1626
+ loading = true,
1626
1627
  })
1627
1628
  local _Length_45 = #_array_46
1628
1629
  table.move(_array_46, 1, _Length_45, _length + 1, _array)
1629
1630
  _length += _Length_45
1630
- local _array_47 = pair("AppBar", "flat", {
1631
- text = "Storyblox",
1632
- variant = "flat",
1631
+ local _array_47 = pair("Fab", "accent", {
1632
+ variant = "accent",
1633
1633
  })
1634
1634
  local _Length_46 = #_array_47
1635
1635
  table.move(_array_47, 1, _Length_46, _length + 1, _array)
1636
1636
  _length += _Length_46
1637
- local _array_48 = pair("AppBar", "raised", {
1637
+ local _array_48 = pair("AppBar", "default", {
1638
1638
  text = "Storyblox",
1639
- variant = "raised",
1640
1639
  })
1641
1640
  local _Length_47 = #_array_48
1642
1641
  table.move(_array_48, 1, _Length_47, _length + 1, _array)
1643
1642
  _length += _Length_47
1644
- local _array_49 = pair("AppBar", "primary", {
1643
+ local _array_49 = pair("AppBar", "flat", {
1645
1644
  text = "Storyblox",
1646
- variant = "primary",
1645
+ variant = "flat",
1647
1646
  })
1648
1647
  local _Length_48 = #_array_49
1649
1648
  table.move(_array_49, 1, _Length_48, _length + 1, _array)
1650
1649
  _length += _Length_48
1651
- local _array_50 = pair("BottomNavigation", "default", {
1650
+ local _array_50 = pair("AppBar", "raised", {
1651
+ text = "Storyblox",
1652
+ variant = "raised",
1653
+ })
1654
+ local _Length_49 = #_array_50
1655
+ table.move(_array_50, 1, _Length_49, _length + 1, _array)
1656
+ _length += _Length_49
1657
+ local _array_51 = pair("AppBar", "primary", {
1658
+ text = "Storyblox",
1659
+ variant = "primary",
1660
+ })
1661
+ local _Length_50 = #_array_51
1662
+ table.move(_array_51, 1, _Length_50, _length + 1, _array)
1663
+ _length += _Length_50
1664
+ local _array_52 = pair("BottomNavigation", "default", {
1652
1665
  value = "Home",
1653
1666
  options = { "Home", "Search", "Profile" },
1654
1667
  })
1655
- table.move(_array_50, 1, #_array_50, _length + 1, _array)
1668
+ table.move(_array_52, 1, #_array_52, _length + 1, _array)
1656
1669
  return _array
1657
1670
  end
1658
1671
  local function miscRows()
@@ -6,6 +6,8 @@ export interface ToastProps {
6
6
  duration?: number;
7
7
  variant?: ToastVariants;
8
8
  toggledAt?: number;
9
+ action?: string;
10
+ onAction?: () => void;
9
11
  }
10
12
  declare function Toast(props: CustomizedProps<Frame, ToastProps>): JSX.Element;
11
13
  export default Toast;
@@ -18,6 +18,8 @@ local function Toast(props)
18
18
  if duration == nil then
19
19
  duration = 4
20
20
  end
21
+ local action = _binding.action
22
+ local onAction = _binding.onAction
21
23
  local className = _binding.className
22
24
  local sx = _binding.sx
23
25
  local id = _binding.id
@@ -26,6 +28,7 @@ local function Toast(props)
26
28
  local container = _binding_1.container
27
29
  local label = _binding_1.label
28
30
  local close = _binding_1.close
31
+ local actionStyle = _binding_1.action
29
32
  local activePosition = _binding_1.activePosition
30
33
  local inActivePosition = _binding_1.inActivePosition
31
34
  local frameRef = useRef()
@@ -90,6 +93,28 @@ local function Toast(props)
90
93
  end
91
94
  _attributes_1.Text = text
92
95
  local _exp_2 = React.createElement("textlabel", _attributes_1)
96
+ local _condition_1 = action ~= nil and #action > 0
97
+ if _condition_1 then
98
+ local _attributes_2 = {
99
+ key = "Action",
100
+ }
101
+ for _k, _v in actionStyle do
102
+ _attributes_2[_k] = _v
103
+ end
104
+ _attributes_2.Text = action
105
+ _attributes_2.Event = {
106
+ Activated = function()
107
+ if onAction then
108
+ onAction()
109
+ end
110
+ tween(Directions.Out)
111
+ if onDismiss then
112
+ onDismiss()
113
+ end
114
+ end,
115
+ }
116
+ _condition_1 = (React.createElement("textbutton", _attributes_2))
117
+ end
93
118
  local _attributes_2 = {
94
119
  key = "Close",
95
120
  }
@@ -104,7 +129,7 @@ local function Toast(props)
104
129
  end
105
130
  end,
106
131
  }
107
- return React.createElement("frame", _attributes, _exp, _exp_1, _exp_2, React.createElement("imagebutton", _attributes_2))
132
+ return React.createElement("frame", _attributes, _exp, _exp_1, _exp_2, _condition_1, React.createElement("imagebutton", _attributes_2))
108
133
  end
109
134
  local default = Toast
110
135
  return {
@@ -11,6 +11,7 @@ local useToastStyles = componentStyles("Toast", function(theme, _param)
11
11
  if variant == nil then
12
12
  variant = ToastVariants.default
13
13
  end
14
+ local action = _param.action
14
15
  local getToastColors = function()
15
16
  repeat
16
17
  if variant == (ToastVariants.success) then
@@ -38,6 +39,8 @@ local useToastStyles = componentStyles("Toast", function(theme, _param)
38
39
  until true
39
40
  end
40
41
  local toastColors = getToastColors()
42
+ local hasAction = action ~= nil and #action > 0
43
+ local actionSlot = if hasAction then theme.spacing.calc(8) else 0
41
44
  local ACTIVE_POSITION = UDim2.new(0.5, 0, 1, -DEFAULT_THEME.padding.calc(2))
42
45
  local INACTIVE_POSITION = UDim2.new(0.5, 0, 1, DEFAULT_THEME.spacing.calc(20) + DEFAULT_THEME.padding.calc(2))
43
46
  return createStyles({
@@ -50,17 +53,32 @@ local useToastStyles = componentStyles("Toast", function(theme, _param)
50
53
  ZIndex = 50000,
51
54
  },
52
55
  label = {
53
- Size = UDim2.new(1, -theme.padding.calc(4), 1, -theme.padding.calc(4)),
54
- Position = UDim2.new(0.5, 0, 0.5, 0),
55
- AnchorPoint = Vector2.new(0.5, 0.5),
56
+ Size = UDim2.new(1, -(theme.padding.calc(4) + actionSlot), 1, -theme.padding.calc(4)),
57
+ Position = if hasAction then UDim2.new(0, theme.padding.calc(2), 0.5, 0) else UDim2.new(0.5, 0, 0.5, 0),
58
+ AnchorPoint = if hasAction then Vector2.new(0, 0.5) else Vector2.new(0.5, 0.5),
56
59
  BackgroundTransparency = 1,
57
60
  BorderSizePixel = 0,
58
61
  TextSize = theme.typography.fontSizes.body,
59
62
  TextColor3 = toastColors.content,
60
63
  Font = theme.typography.fontFamilies.default,
64
+ TextXAlignment = if hasAction then Enum.TextXAlignment.Left else Enum.TextXAlignment.Center,
65
+ TextTruncate = Enum.TextTruncate.AtEnd,
61
66
  TextScaled = false,
62
67
  ZIndex = 50001,
63
68
  },
69
+ action = {
70
+ AutomaticSize = Enum.AutomaticSize.X,
71
+ Size = UDim2.new(0, 0, 0, theme.spacing.calc(3)),
72
+ Position = UDim2.new(1, -(theme.padding.calc(2) + theme.options.constants.iconSizes.small + theme.padding.calc(1)), 0.5, 0),
73
+ AnchorPoint = Vector2.new(1, 0.5),
74
+ BackgroundTransparency = 1,
75
+ BorderSizePixel = 0,
76
+ Font = theme.typography.fontFamilies.default,
77
+ TextSize = theme.typography.fontSizes.body,
78
+ TextColor3 = toastColors.content,
79
+ AutoButtonColor = false,
80
+ ZIndex = 50001,
81
+ },
64
82
  close = {
65
83
  Size = UDim2.new(0, theme.options.constants.iconSizes.small, 0, theme.options.constants.iconSizes.small),
66
84
  Position = UDim2.new(1, -theme.padding.calc(2), 0, theme.padding.calc(2)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/uiblox",
3
- "version": "0.2.0-alpha.16",
3
+ "version": "0.2.0-alpha.17",
4
4
  "description": "UI Library and theming for roblox-ts projects",
5
5
  "main": "out/init.luau",
6
6
  "packageManager": "pnpm@11.3.0",