@times-design-system/components-wordpress 1.8.1-alpha.4 → 1.10.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/dist/blocks/ad-container/style.css +1 -30
- package/dist/blocks/ad-container/style.scss +70 -0
- package/dist/blocks/button/block.json +67 -1
- package/dist/blocks/button/init.js +45 -0
- package/dist/blocks/button/render.php +2 -0
- package/dist/blocks/button/style.css +1 -203
- package/dist/blocks/button/style.scss +204 -0
- package/dist/blocks/chip/ONCLICK_USAGE.md +263 -0
- package/dist/blocks/chip/block.json +22 -3
- package/dist/blocks/chip/init.js +60 -0
- package/dist/blocks/chip/render.php +7 -2
- package/dist/blocks/chip/style.css +1 -108
- package/dist/blocks/chip/style.scss +213 -0
- package/dist/blocks/dialog-box/style.css +1 -23
- package/dist/blocks/dialog-box/style.scss +113 -0
- package/dist/blocks/divider/style.css +1 -37
- package/dist/blocks/divider/style.scss +40 -0
- package/dist/blocks/icon/block.json +10 -1
- package/dist/blocks/icon/style.css +1 -23
- package/dist/blocks/icon/style.scss +10 -0
- package/dist/blocks/icon-button/block.json +41 -0
- package/dist/blocks/icon-button/init.js +56 -0
- package/dist/blocks/icon-button/render.php +5 -0
- package/dist/blocks/icon-button/style.css +1 -66
- package/dist/blocks/icon-button/style.scss +189 -0
- package/dist/blocks/input/style.css +1 -67
- package/dist/blocks/input/style.scss +72 -0
- package/dist/blocks/input-helper-message/style.css +1 -23
- package/dist/blocks/input-helper-message/style.scss +45 -0
- package/dist/blocks/link/block.json +86 -3
- package/dist/blocks/link/init.js +54 -0
- package/dist/blocks/link/render.php +22 -12
- package/dist/blocks/link/style.css +1 -221
- package/dist/blocks/link/style.scss +163 -0
- package/dist/blocks/tab/style.css +1 -152
- package/dist/blocks/tab/style.scss +159 -0
- package/dist/blocks/tab-group/style.css +1 -23
- package/dist/blocks/tab-group/style.scss +32 -0
- package/dist/blocks/{flag → tag}/block.json +46 -14
- package/dist/blocks/{flag → tag}/edit.js +9 -20
- package/dist/blocks/{flag → tag}/index.js +2 -2
- package/dist/blocks/{flag → tag}/render.php +24 -19
- package/dist/blocks/tag/save.js +23 -0
- package/dist/blocks/{chip → tag}/style-editor.css +2 -2
- package/dist/blocks/tag/style.css +1 -0
- package/dist/blocks/tag/style.scss +115 -0
- package/dist/blocks/text/style.css +1 -7
- package/dist/blocks/text/style.scss +11 -0
- package/dist/blocks/toast/style.css +1 -68
- package/dist/blocks/toast/style.scss +67 -0
- package/dist/blocks/utils/render-icon.php +72 -5
- package/dist/icon-data.json +1 -1
- package/dist/index.cjs +391 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +391 -54
- package/dist/index.js.map +1 -1
- package/dist/plugin.php +42 -0
- package/dist/utils/render-icon.php +11 -2
- package/package.json +7 -5
- package/plugin.php +42 -0
- package/dist/blocks/flag/save.js +0 -25
- package/dist/blocks/flag/style-editor.css +0 -5
- package/dist/blocks/flag/style.css +0 -72
package/dist/index.js
CHANGED
|
@@ -483,10 +483,96 @@ var attributes$e = {
|
|
|
483
483
|
"default": {
|
|
484
484
|
},
|
|
485
485
|
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
486
|
+
},
|
|
487
|
+
onClick: {
|
|
488
|
+
type: "string",
|
|
489
|
+
"default": "",
|
|
490
|
+
description: "Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and button element context."
|
|
486
491
|
}
|
|
487
492
|
};
|
|
488
493
|
var editorScript$e = "times-design-system";
|
|
489
494
|
var script$e = "times-design-system";
|
|
495
|
+
var preview$5 = {
|
|
496
|
+
combinations: [
|
|
497
|
+
{
|
|
498
|
+
label: "Primary",
|
|
499
|
+
intent: "primary",
|
|
500
|
+
size: "medium"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
label: "Primary Small",
|
|
504
|
+
intent: "primary",
|
|
505
|
+
size: "small"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
label: "Primary Small",
|
|
509
|
+
intent: "primary",
|
|
510
|
+
size: "small",
|
|
511
|
+
iconRight: "filled_arrow_right"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
label: "Primary Large",
|
|
515
|
+
intent: "primary",
|
|
516
|
+
size: "large"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
label: "Secondary",
|
|
520
|
+
intent: "secondary",
|
|
521
|
+
size: "medium"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
label: "Negative",
|
|
525
|
+
intent: "negative",
|
|
526
|
+
size: "medium"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
label: "Disabled",
|
|
530
|
+
disabled: true,
|
|
531
|
+
intent: "primary",
|
|
532
|
+
size: "medium"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
label: "Loading",
|
|
536
|
+
isLoading: true,
|
|
537
|
+
intent: "primary",
|
|
538
|
+
size: "medium"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
label: "Rounded",
|
|
542
|
+
isRounded: true,
|
|
543
|
+
intent: "primary",
|
|
544
|
+
size: "medium"
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
label: "Icon Left",
|
|
548
|
+
iconLeft: "filled_circle",
|
|
549
|
+
intent: "primary"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
label: "Icon Right",
|
|
553
|
+
iconRight: "filled_circle",
|
|
554
|
+
intent: "primary"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
label: "Full Width",
|
|
558
|
+
behaviour: "full",
|
|
559
|
+
intent: "primary",
|
|
560
|
+
size: "large"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
label: "Full Width",
|
|
564
|
+
behaviour: "full",
|
|
565
|
+
intent: "primary",
|
|
566
|
+
iconRight: "filled_search"
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
label: "With onClick",
|
|
570
|
+
intent: "primary",
|
|
571
|
+
size: "medium",
|
|
572
|
+
onClick: "handleButtonClick"
|
|
573
|
+
}
|
|
574
|
+
]
|
|
575
|
+
};
|
|
490
576
|
var metadata$9 = {
|
|
491
577
|
$schema: $schema$e,
|
|
492
578
|
apiVersion: apiVersion$e,
|
|
@@ -500,7 +586,8 @@ var metadata$9 = {
|
|
|
500
586
|
render: render$e,
|
|
501
587
|
attributes: attributes$e,
|
|
502
588
|
editorScript: editorScript$e,
|
|
503
|
-
script: script$e
|
|
589
|
+
script: script$e,
|
|
590
|
+
preview: preview$5
|
|
504
591
|
};
|
|
505
592
|
|
|
506
593
|
registerBlockType(metadata$9.name, _objectSpread2(_objectSpread2({}, metadata$9), {}, {
|
|
@@ -1112,6 +1199,16 @@ var attributes$a = {
|
|
|
1112
1199
|
type: "boolean",
|
|
1113
1200
|
"default": false
|
|
1114
1201
|
},
|
|
1202
|
+
intent: {
|
|
1203
|
+
type: "string",
|
|
1204
|
+
"enum": [
|
|
1205
|
+
"primary",
|
|
1206
|
+
"secondary",
|
|
1207
|
+
"negative"
|
|
1208
|
+
],
|
|
1209
|
+
"default": "primary",
|
|
1210
|
+
description: "Visual style variant matching button intents"
|
|
1211
|
+
},
|
|
1115
1212
|
isLoading: {
|
|
1116
1213
|
type: "boolean",
|
|
1117
1214
|
"default": false,
|
|
@@ -1149,8 +1246,59 @@ var attributes$a = {
|
|
|
1149
1246
|
"default": {
|
|
1150
1247
|
},
|
|
1151
1248
|
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
1249
|
+
},
|
|
1250
|
+
onClick: {
|
|
1251
|
+
type: "string",
|
|
1252
|
+
"default": "",
|
|
1253
|
+
description: "Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and icon button element context."
|
|
1152
1254
|
}
|
|
1153
1255
|
};
|
|
1256
|
+
var preview$4 = {
|
|
1257
|
+
combinations: [
|
|
1258
|
+
{
|
|
1259
|
+
iconName: "filled_add",
|
|
1260
|
+
iconSize: "medium",
|
|
1261
|
+
intent: "primary"
|
|
1262
|
+
},
|
|
1263
|
+
{
|
|
1264
|
+
iconName: "filled_add",
|
|
1265
|
+
iconSize: "medium",
|
|
1266
|
+
intent: "secondary"
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
iconName: "filled_add",
|
|
1270
|
+
iconSize: "medium",
|
|
1271
|
+
intent: "negative"
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
iconName: "filled_search",
|
|
1275
|
+
iconSize: "medium",
|
|
1276
|
+
intent: "primary"
|
|
1277
|
+
},
|
|
1278
|
+
{
|
|
1279
|
+
iconName: "filled_close",
|
|
1280
|
+
iconSize: "small",
|
|
1281
|
+
intent: "primary"
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
iconName: "filled_settings",
|
|
1285
|
+
iconSize: "large",
|
|
1286
|
+
intent: "primary"
|
|
1287
|
+
},
|
|
1288
|
+
{
|
|
1289
|
+
iconName: "filled_add",
|
|
1290
|
+
iconSize: "medium",
|
|
1291
|
+
intent: "primary",
|
|
1292
|
+
round: true
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
iconName: "filled_add",
|
|
1296
|
+
iconSize: "medium",
|
|
1297
|
+
intent: "primary",
|
|
1298
|
+
onClick: "handleIconButtonClick"
|
|
1299
|
+
}
|
|
1300
|
+
]
|
|
1301
|
+
};
|
|
1154
1302
|
var example$5 = {
|
|
1155
1303
|
};
|
|
1156
1304
|
var script$a = "times-design-system";
|
|
@@ -1166,6 +1314,7 @@ var metadata$5 = {
|
|
|
1166
1314
|
supports: supports$a,
|
|
1167
1315
|
render: render$a,
|
|
1168
1316
|
attributes: attributes$a,
|
|
1317
|
+
preview: preview$4,
|
|
1169
1318
|
example: example$5,
|
|
1170
1319
|
script: script$a,
|
|
1171
1320
|
editorScript: editorScript$a
|
|
@@ -1345,7 +1494,7 @@ var attributes$9 = {
|
|
|
1345
1494
|
},
|
|
1346
1495
|
intent: {
|
|
1347
1496
|
type: "string",
|
|
1348
|
-
"default": "
|
|
1497
|
+
"default": "primary",
|
|
1349
1498
|
"enum": [
|
|
1350
1499
|
"primary",
|
|
1351
1500
|
"secondary"
|
|
@@ -1353,7 +1502,7 @@ var attributes$9 = {
|
|
|
1353
1502
|
},
|
|
1354
1503
|
size: {
|
|
1355
1504
|
type: "string",
|
|
1356
|
-
"default": "
|
|
1505
|
+
"default": "small",
|
|
1357
1506
|
"enum": [
|
|
1358
1507
|
"small",
|
|
1359
1508
|
"large"
|
|
@@ -1381,6 +1530,11 @@ var attributes$9 = {
|
|
|
1381
1530
|
type: "string",
|
|
1382
1531
|
"default": ""
|
|
1383
1532
|
},
|
|
1533
|
+
onClick: {
|
|
1534
|
+
type: "string",
|
|
1535
|
+
"default": "",
|
|
1536
|
+
description: "Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and chip element context."
|
|
1537
|
+
},
|
|
1384
1538
|
classes: {
|
|
1385
1539
|
type: "string",
|
|
1386
1540
|
"default": "",
|
|
@@ -1397,6 +1551,36 @@ var example$4 = {
|
|
|
1397
1551
|
};
|
|
1398
1552
|
var script$9 = "times-design-system";
|
|
1399
1553
|
var editorScript$9 = "times-design-system";
|
|
1554
|
+
var preview$3 = {
|
|
1555
|
+
combinations: [
|
|
1556
|
+
{
|
|
1557
|
+
content: "Primary Small",
|
|
1558
|
+
intent: "primary",
|
|
1559
|
+
size: "small"
|
|
1560
|
+
},
|
|
1561
|
+
{
|
|
1562
|
+
content: "Primary Large",
|
|
1563
|
+
intent: "primary",
|
|
1564
|
+
size: "large"
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
content: "Secondary",
|
|
1568
|
+
intent: "secondary",
|
|
1569
|
+
size: "small"
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
content: "Channel",
|
|
1573
|
+
channel: true,
|
|
1574
|
+
size: "small"
|
|
1575
|
+
},
|
|
1576
|
+
{
|
|
1577
|
+
content: "Toggle",
|
|
1578
|
+
intent: "primary",
|
|
1579
|
+
toggle: true,
|
|
1580
|
+
size: "small"
|
|
1581
|
+
}
|
|
1582
|
+
]
|
|
1583
|
+
};
|
|
1400
1584
|
var metadata$4 = {
|
|
1401
1585
|
$schema: $schema$9,
|
|
1402
1586
|
apiVersion: apiVersion$9,
|
|
@@ -1410,7 +1594,8 @@ var metadata$4 = {
|
|
|
1410
1594
|
attributes: attributes$9,
|
|
1411
1595
|
example: example$4,
|
|
1412
1596
|
script: script$9,
|
|
1413
|
-
editorScript: editorScript$9
|
|
1597
|
+
editorScript: editorScript$9,
|
|
1598
|
+
preview: preview$3
|
|
1414
1599
|
};
|
|
1415
1600
|
|
|
1416
1601
|
var edit$9 = function edit(_ref) {
|
|
@@ -1586,11 +1771,11 @@ registerBlockType(metadata$4.name, _objectSpread2(_objectSpread2({}, metadata$4)
|
|
|
1586
1771
|
|
|
1587
1772
|
var $schema$8 = "https://schemas.wp.org/trunk/block.json";
|
|
1588
1773
|
var apiVersion$8 = 3;
|
|
1589
|
-
var name$8 = "tds/
|
|
1590
|
-
var title$8 = "
|
|
1774
|
+
var name$8 = "tds/tag";
|
|
1775
|
+
var title$8 = "Tag";
|
|
1591
1776
|
var category$8 = "common";
|
|
1592
1777
|
var description$8 = "Badge or status indicator component";
|
|
1593
|
-
var icon$8 = "
|
|
1778
|
+
var icon$8 = "tag";
|
|
1594
1779
|
var supports$8 = {
|
|
1595
1780
|
html: false,
|
|
1596
1781
|
spacing: {
|
|
@@ -1603,18 +1788,13 @@ var attributes$8 = {
|
|
|
1603
1788
|
type: "string",
|
|
1604
1789
|
"default": ""
|
|
1605
1790
|
},
|
|
1606
|
-
content: {
|
|
1607
|
-
type: "string",
|
|
1608
|
-
"default": ""
|
|
1609
|
-
},
|
|
1610
1791
|
intent: {
|
|
1611
1792
|
type: "string",
|
|
1612
1793
|
"default": "secondary",
|
|
1613
1794
|
"enum": [
|
|
1614
1795
|
"primary",
|
|
1615
1796
|
"secondary",
|
|
1616
|
-
"
|
|
1617
|
-
"positive"
|
|
1797
|
+
"tertiary"
|
|
1618
1798
|
]
|
|
1619
1799
|
},
|
|
1620
1800
|
size: {
|
|
@@ -1626,6 +1806,20 @@ var attributes$8 = {
|
|
|
1626
1806
|
"large"
|
|
1627
1807
|
]
|
|
1628
1808
|
},
|
|
1809
|
+
callout: {
|
|
1810
|
+
type: "boolean",
|
|
1811
|
+
"default": false,
|
|
1812
|
+
description: "Applies a callout style to the tag"
|
|
1813
|
+
},
|
|
1814
|
+
channel: {
|
|
1815
|
+
type: "boolean",
|
|
1816
|
+
"default": false
|
|
1817
|
+
},
|
|
1818
|
+
ariaLabel: {
|
|
1819
|
+
type: "string",
|
|
1820
|
+
"default": "",
|
|
1821
|
+
description: "ARIA label for accessibility"
|
|
1822
|
+
},
|
|
1629
1823
|
iconLeft: {
|
|
1630
1824
|
type: "string",
|
|
1631
1825
|
"default": "",
|
|
@@ -1636,14 +1830,10 @@ var attributes$8 = {
|
|
|
1636
1830
|
"default": "",
|
|
1637
1831
|
description: "Icon on the right with variant prefix (e.g., 'outlined_check')"
|
|
1638
1832
|
},
|
|
1639
|
-
ariaLabel: {
|
|
1640
|
-
type: "string",
|
|
1641
|
-
"default": ""
|
|
1642
|
-
},
|
|
1643
1833
|
classes: {
|
|
1644
1834
|
type: "string",
|
|
1645
1835
|
"default": "",
|
|
1646
|
-
description: "Additional CSS classes applied to the rendered
|
|
1836
|
+
description: "Additional CSS classes applied to the rendered tag element"
|
|
1647
1837
|
},
|
|
1648
1838
|
dataAttributes: {
|
|
1649
1839
|
type: "object",
|
|
@@ -1656,6 +1846,44 @@ var example$3 = {
|
|
|
1656
1846
|
};
|
|
1657
1847
|
var script$8 = "times-design-system";
|
|
1658
1848
|
var editorScript$8 = "times-design-system";
|
|
1849
|
+
var preview$2 = {
|
|
1850
|
+
combinations: [
|
|
1851
|
+
{
|
|
1852
|
+
label: "Primary",
|
|
1853
|
+
intent: "primary",
|
|
1854
|
+
size: "small"
|
|
1855
|
+
},
|
|
1856
|
+
{
|
|
1857
|
+
label: "Secondary",
|
|
1858
|
+
intent: "secondary",
|
|
1859
|
+
size: "medium"
|
|
1860
|
+
},
|
|
1861
|
+
{
|
|
1862
|
+
label: "Tertiary",
|
|
1863
|
+
intent: "tertiary",
|
|
1864
|
+
size: "large"
|
|
1865
|
+
},
|
|
1866
|
+
{
|
|
1867
|
+
label: "Callout",
|
|
1868
|
+
intent: "primary",
|
|
1869
|
+
callout: true,
|
|
1870
|
+
size: "medium",
|
|
1871
|
+
iconLeft: "filled_check"
|
|
1872
|
+
},
|
|
1873
|
+
{
|
|
1874
|
+
label: "Channel",
|
|
1875
|
+
intent: "primary",
|
|
1876
|
+
channel: true,
|
|
1877
|
+
size: "medium"
|
|
1878
|
+
},
|
|
1879
|
+
{
|
|
1880
|
+
label: "With Icon",
|
|
1881
|
+
intent: "primary",
|
|
1882
|
+
iconLeft: "filled_check",
|
|
1883
|
+
size: "large"
|
|
1884
|
+
}
|
|
1885
|
+
]
|
|
1886
|
+
};
|
|
1659
1887
|
var metadata$3 = {
|
|
1660
1888
|
$schema: $schema$8,
|
|
1661
1889
|
apiVersion: apiVersion$8,
|
|
@@ -1669,14 +1897,14 @@ var metadata$3 = {
|
|
|
1669
1897
|
attributes: attributes$8,
|
|
1670
1898
|
example: example$3,
|
|
1671
1899
|
script: script$8,
|
|
1672
|
-
editorScript: editorScript$8
|
|
1900
|
+
editorScript: editorScript$8,
|
|
1901
|
+
preview: preview$2
|
|
1673
1902
|
};
|
|
1674
1903
|
|
|
1675
1904
|
var edit$8 = function edit(_ref) {
|
|
1676
1905
|
var attributes = _ref.attributes,
|
|
1677
1906
|
setAttributes = _ref.setAttributes;
|
|
1678
1907
|
var label = attributes.label,
|
|
1679
|
-
content = attributes.content,
|
|
1680
1908
|
intent = attributes.intent,
|
|
1681
1909
|
size = attributes.size,
|
|
1682
1910
|
iconLeft = attributes.iconLeft,
|
|
@@ -1686,13 +1914,13 @@ var edit$8 = function edit(_ref) {
|
|
|
1686
1914
|
attributes.dataAttributes;
|
|
1687
1915
|
var blockProps = useBlockProps();
|
|
1688
1916
|
var buildClass = function buildClass() {
|
|
1689
|
-
var classes = ['tds-
|
|
1690
|
-
classes.push("tds-
|
|
1691
|
-
classes.push("tds-
|
|
1917
|
+
var classes = ['tds-tag'];
|
|
1918
|
+
classes.push("tds-tag--intent-".concat(intent));
|
|
1919
|
+
classes.push("tds-tag--size-".concat(size));
|
|
1692
1920
|
return classes.join(' ');
|
|
1693
1921
|
};
|
|
1694
1922
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
1695
|
-
title: "
|
|
1923
|
+
title: "Tag Settings"
|
|
1696
1924
|
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
1697
1925
|
label: "Label",
|
|
1698
1926
|
value: label,
|
|
@@ -1776,7 +2004,7 @@ var edit$8 = function edit(_ref) {
|
|
|
1776
2004
|
});
|
|
1777
2005
|
},
|
|
1778
2006
|
placeholder: "class-name-1 class-name-2",
|
|
1779
|
-
help: "Space-separated CSS classes added to the
|
|
2007
|
+
help: "Space-separated CSS classes added to the tag element"
|
|
1780
2008
|
}), /*#__PURE__*/React.createElement("p", {
|
|
1781
2009
|
style: {
|
|
1782
2010
|
fontSize: '12px',
|
|
@@ -1787,27 +2015,17 @@ var edit$8 = function edit(_ref) {
|
|
|
1787
2015
|
className: buildClass(),
|
|
1788
2016
|
"aria-label": ariaLabel
|
|
1789
2017
|
}), label && /*#__PURE__*/React.createElement("div", {
|
|
1790
|
-
className: "tds-
|
|
2018
|
+
className: "tds-tag__label"
|
|
1791
2019
|
}, label), iconLeft && /*#__PURE__*/React.createElement("span", {
|
|
1792
|
-
className: "tds-
|
|
1793
|
-
}, iconLeft), /*#__PURE__*/React.createElement(
|
|
1794
|
-
|
|
1795
|
-
onChange: function onChange(val) {
|
|
1796
|
-
return setAttributes({
|
|
1797
|
-
content: val
|
|
1798
|
-
});
|
|
1799
|
-
},
|
|
1800
|
-
placeholder: "Flag content",
|
|
1801
|
-
className: "tds-flag__content"
|
|
1802
|
-
}), iconRight && /*#__PURE__*/React.createElement("span", {
|
|
1803
|
-
className: "tds-flag__icon-right"
|
|
2020
|
+
className: "tds-tag__icon-left"
|
|
2021
|
+
}, iconLeft), iconRight && /*#__PURE__*/React.createElement("span", {
|
|
2022
|
+
className: "tds-tag__icon-right"
|
|
1804
2023
|
}, iconRight)));
|
|
1805
2024
|
};
|
|
1806
2025
|
|
|
1807
2026
|
var save$8 = function save(_ref) {
|
|
1808
2027
|
var attributes = _ref.attributes;
|
|
1809
2028
|
var label = attributes.label,
|
|
1810
|
-
content = attributes.content,
|
|
1811
2029
|
intent = attributes.intent,
|
|
1812
2030
|
size = attributes.size,
|
|
1813
2031
|
iconLeft = attributes.iconLeft,
|
|
@@ -1815,23 +2033,20 @@ var save$8 = function save(_ref) {
|
|
|
1815
2033
|
ariaLabel = attributes.ariaLabel;
|
|
1816
2034
|
var blockProps = useBlockProps.save();
|
|
1817
2035
|
var buildClass = function buildClass() {
|
|
1818
|
-
var classes = ['tds-
|
|
1819
|
-
classes.push("tds-
|
|
1820
|
-
classes.push("tds-
|
|
2036
|
+
var classes = ['tds-tag'];
|
|
2037
|
+
classes.push("tds-tag--intent-".concat(intent));
|
|
2038
|
+
classes.push("tds-tag--size-".concat(size));
|
|
1821
2039
|
return classes.join(' ');
|
|
1822
2040
|
};
|
|
1823
2041
|
return /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
1824
2042
|
className: buildClass(),
|
|
1825
2043
|
"aria-label": ariaLabel
|
|
1826
2044
|
}), label && /*#__PURE__*/React.createElement("div", {
|
|
1827
|
-
className: "tds-
|
|
2045
|
+
className: "tds-tag__label"
|
|
1828
2046
|
}, label), iconLeft && /*#__PURE__*/React.createElement("span", {
|
|
1829
|
-
className: "tds-
|
|
1830
|
-
}, iconLeft), /*#__PURE__*/React.createElement(
|
|
1831
|
-
|
|
1832
|
-
className: "tds-flag__content"
|
|
1833
|
-
}), iconRight && /*#__PURE__*/React.createElement("span", {
|
|
1834
|
-
className: "tds-flag__icon-right"
|
|
2047
|
+
className: "tds-tag__icon-left"
|
|
2048
|
+
}, iconLeft), iconRight && /*#__PURE__*/React.createElement("span", {
|
|
2049
|
+
className: "tds-tag__icon-right"
|
|
1835
2050
|
}, iconRight));
|
|
1836
2051
|
};
|
|
1837
2052
|
|
|
@@ -2087,8 +2302,9 @@ var attributes$6 = {
|
|
|
2087
2302
|
"enum": [
|
|
2088
2303
|
"primary",
|
|
2089
2304
|
"secondary",
|
|
2090
|
-
"
|
|
2091
|
-
]
|
|
2305
|
+
"danger"
|
|
2306
|
+
],
|
|
2307
|
+
description: "Link color and style variant"
|
|
2092
2308
|
},
|
|
2093
2309
|
sentiment: {
|
|
2094
2310
|
type: "string",
|
|
@@ -2102,10 +2318,12 @@ var attributes$6 = {
|
|
|
2102
2318
|
type: "string",
|
|
2103
2319
|
"default": "medium",
|
|
2104
2320
|
"enum": [
|
|
2321
|
+
"xsmall",
|
|
2105
2322
|
"small",
|
|
2106
2323
|
"medium",
|
|
2107
2324
|
"large"
|
|
2108
|
-
]
|
|
2325
|
+
],
|
|
2326
|
+
description: "Link size variant"
|
|
2109
2327
|
},
|
|
2110
2328
|
iconLeft: {
|
|
2111
2329
|
type: "string",
|
|
@@ -2149,12 +2367,105 @@ var attributes$6 = {
|
|
|
2149
2367
|
"default": {
|
|
2150
2368
|
},
|
|
2151
2369
|
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
2370
|
+
},
|
|
2371
|
+
isDisabled: {
|
|
2372
|
+
type: "boolean",
|
|
2373
|
+
"default": false,
|
|
2374
|
+
description: "Disables the link and prevents navigation"
|
|
2375
|
+
},
|
|
2376
|
+
onClick: {
|
|
2377
|
+
type: "string",
|
|
2378
|
+
"default": "",
|
|
2379
|
+
description: "Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and link element context."
|
|
2152
2380
|
}
|
|
2153
2381
|
};
|
|
2154
2382
|
var example$1 = {
|
|
2155
2383
|
};
|
|
2156
2384
|
var script$6 = "times-design-system";
|
|
2157
2385
|
var editorScript$6 = "times-design-system";
|
|
2386
|
+
var preview$1 = {
|
|
2387
|
+
combinations: [
|
|
2388
|
+
{
|
|
2389
|
+
content: "Primary",
|
|
2390
|
+
href: "#",
|
|
2391
|
+
intent: "primary",
|
|
2392
|
+
size: "medium"
|
|
2393
|
+
},
|
|
2394
|
+
{
|
|
2395
|
+
content: "Primary",
|
|
2396
|
+
href: "#",
|
|
2397
|
+
intent: "primary",
|
|
2398
|
+
size: "medium",
|
|
2399
|
+
iconLeft: "filled_arrow_left"
|
|
2400
|
+
},
|
|
2401
|
+
{
|
|
2402
|
+
content: "Primary",
|
|
2403
|
+
href: "#",
|
|
2404
|
+
intent: "primary",
|
|
2405
|
+
size: "medium",
|
|
2406
|
+
iconRight: "filled_arrow_right"
|
|
2407
|
+
},
|
|
2408
|
+
{
|
|
2409
|
+
content: "Secondary",
|
|
2410
|
+
href: "#",
|
|
2411
|
+
intent: "secondary",
|
|
2412
|
+
size: "medium"
|
|
2413
|
+
},
|
|
2414
|
+
{
|
|
2415
|
+
content: "Danger",
|
|
2416
|
+
href: "#",
|
|
2417
|
+
intent: "danger",
|
|
2418
|
+
size: "medium"
|
|
2419
|
+
},
|
|
2420
|
+
{
|
|
2421
|
+
content: "XSmall",
|
|
2422
|
+
href: "#",
|
|
2423
|
+
size: "xsmall"
|
|
2424
|
+
},
|
|
2425
|
+
{
|
|
2426
|
+
content: "Small",
|
|
2427
|
+
href: "#",
|
|
2428
|
+
size: "small"
|
|
2429
|
+
},
|
|
2430
|
+
{
|
|
2431
|
+
content: "Large",
|
|
2432
|
+
href: "#",
|
|
2433
|
+
size: "large"
|
|
2434
|
+
},
|
|
2435
|
+
{
|
|
2436
|
+
content: "Brand",
|
|
2437
|
+
href: "#",
|
|
2438
|
+
sentiment: "brand",
|
|
2439
|
+
size: "medium"
|
|
2440
|
+
},
|
|
2441
|
+
{
|
|
2442
|
+
content: "Utility",
|
|
2443
|
+
href: "#",
|
|
2444
|
+
sentiment: "utility",
|
|
2445
|
+
size: "medium"
|
|
2446
|
+
},
|
|
2447
|
+
{
|
|
2448
|
+
content: "External",
|
|
2449
|
+
href: "#",
|
|
2450
|
+
target: "_blank",
|
|
2451
|
+
size: "medium"
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
content: "With onClick",
|
|
2455
|
+
href: "#",
|
|
2456
|
+
intent: "primary",
|
|
2457
|
+
size: "medium",
|
|
2458
|
+
onClick: "handleLinkClick"
|
|
2459
|
+
},
|
|
2460
|
+
{
|
|
2461
|
+
content: "Disabled",
|
|
2462
|
+
href: "#",
|
|
2463
|
+
intent: "primary",
|
|
2464
|
+
size: "medium",
|
|
2465
|
+
isDisabled: true
|
|
2466
|
+
}
|
|
2467
|
+
]
|
|
2468
|
+
};
|
|
2158
2469
|
var metadata$1 = {
|
|
2159
2470
|
$schema: $schema$6,
|
|
2160
2471
|
apiVersion: apiVersion$6,
|
|
@@ -2168,7 +2479,8 @@ var metadata$1 = {
|
|
|
2168
2479
|
attributes: attributes$6,
|
|
2169
2480
|
example: example$1,
|
|
2170
2481
|
script: script$6,
|
|
2171
|
-
editorScript: editorScript$6
|
|
2482
|
+
editorScript: editorScript$6,
|
|
2483
|
+
preview: preview$1
|
|
2172
2484
|
};
|
|
2173
2485
|
|
|
2174
2486
|
var edit$6 = function edit(_ref) {
|
|
@@ -3191,6 +3503,30 @@ var attributes = {
|
|
|
3191
3503
|
var render = "file:./render.php";
|
|
3192
3504
|
var editorScript = "times-design-system";
|
|
3193
3505
|
var script = "times-design-system";
|
|
3506
|
+
var preview = {
|
|
3507
|
+
combinations: [
|
|
3508
|
+
{
|
|
3509
|
+
iconName: "filled_circle",
|
|
3510
|
+
size: "small"
|
|
3511
|
+
},
|
|
3512
|
+
{
|
|
3513
|
+
iconName: "filled_circle",
|
|
3514
|
+
size: "medium"
|
|
3515
|
+
},
|
|
3516
|
+
{
|
|
3517
|
+
iconName: "filled_circle",
|
|
3518
|
+
size: "large"
|
|
3519
|
+
},
|
|
3520
|
+
{
|
|
3521
|
+
iconName: "outlined_check",
|
|
3522
|
+
size: "medium"
|
|
3523
|
+
},
|
|
3524
|
+
{
|
|
3525
|
+
iconName: "filled_arrow_right",
|
|
3526
|
+
size: "medium"
|
|
3527
|
+
}
|
|
3528
|
+
]
|
|
3529
|
+
};
|
|
3194
3530
|
var blockConfig = {
|
|
3195
3531
|
$schema: $schema,
|
|
3196
3532
|
apiVersion: apiVersion,
|
|
@@ -3204,7 +3540,8 @@ var blockConfig = {
|
|
|
3204
3540
|
attributes: attributes,
|
|
3205
3541
|
render: render,
|
|
3206
3542
|
editorScript: editorScript,
|
|
3207
|
-
script: script
|
|
3543
|
+
script: script,
|
|
3544
|
+
preview: preview
|
|
3208
3545
|
};
|
|
3209
3546
|
|
|
3210
3547
|
registerBlockType(blockConfig.name, _objectSpread2(_objectSpread2({}, blockConfig), {}, {
|