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