@snhaman/pollymorph 1.5.0 → 1.6.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/tokens.js CHANGED
@@ -27,7 +27,7 @@ var require_pollymorph = __commonJS({
27
27
  $schema: "https://design-tokens.github.io/community-group/format/",
28
28
  meta: {
29
29
  name: "PollyMorph",
30
- version: "1.4.0",
30
+ version: "1.6.0",
31
31
  description: "Elucidata unified design system token file. Consolidates all core primitives and semantic component tokens.",
32
32
  generatedAt: "2026-03-18",
33
33
  lastAudit: "2026-03-18",
@@ -61,7 +61,8 @@ var require_pollymorph = __commonJS({
61
61
  -80
62
62
  ],
63
63
  note: "Full computed hex ramp tokenised in v1.3.0. Each colour has a 'base' key (pure colour) plus 22 tint/shade steps."
64
- }
64
+ },
65
+ componentRulesSource: "Figma PDS-2.0-Library nodes: 850-601,602,603,605,1026-2068,7763-5244/5245,1916-4113,4718-1770,6228-7796/7063,280-59,447-188,452-304,230-280,289-101,448-191"
65
66
  },
66
67
  core: {
67
68
  color: {
@@ -1327,16 +1328,562 @@ var require_pollymorph = __commonJS({
1327
1328
  search_bar_placement: "Search bars inside the global header are centered and fill available space between the nav title and action buttons. They never span the full content width."
1328
1329
  },
1329
1330
  components: {
1330
- buttons: {
1331
- primary: "One primary button per screen. Use for the main action only.",
1332
- secondary: "Secondary actions (e.g. 'Request a Dataset') use the Secondary/Outlined variant with a purple border. Never use a filled secondary color.",
1333
- icon_button: "Icon-only action buttons (filter, view toggle, etc.) use the icon button variant with no visible border in default state."
1331
+ $description: "Component-level rules derived from PDS-2.0-Library Figma specs. Each entry covers variants, states, token values, and composition constraints.",
1332
+ button: {
1333
+ variants: {
1334
+ filled: {
1335
+ description: "Primary action. One per view maximum.",
1336
+ background: "primary.purple.base",
1337
+ text: "white",
1338
+ border: "none",
1339
+ radius: "radius.md",
1340
+ elevation: "none",
1341
+ hover: {
1342
+ background: "primary.purple[-10]"
1343
+ },
1344
+ active: {
1345
+ background: "primary.purple[-20]"
1346
+ },
1347
+ disabled: {
1348
+ background: "primary.purple[80]",
1349
+ text: "white",
1350
+ cursor: "not-allowed"
1351
+ },
1352
+ loading: "Spinner replaces label. Width preserved. No interaction."
1353
+ },
1354
+ outlined: {
1355
+ description: "Secondary action. Can appear alongside ghost.",
1356
+ background: "transparent",
1357
+ border: "1px solid primary.purple.base",
1358
+ text: "primary.purple.base",
1359
+ radius: "radius.md",
1360
+ hover: {
1361
+ background: "primary.purple[95]"
1362
+ },
1363
+ active: {
1364
+ background: "primary.purple[90]"
1365
+ },
1366
+ disabled: {
1367
+ border: "primary.purple[80]",
1368
+ text: "primary.purple[80]",
1369
+ cursor: "not-allowed"
1370
+ }
1371
+ },
1372
+ ghost: {
1373
+ description: "Tertiary action. No border, no background.",
1374
+ background: "transparent",
1375
+ border: "none",
1376
+ text: "primary.purple.base",
1377
+ radius: "radius.md",
1378
+ hover: {
1379
+ background: "primary.purple[95]"
1380
+ },
1381
+ active: {
1382
+ background: "primary.purple[90]"
1383
+ },
1384
+ disabled: {
1385
+ text: "neutral.warm[60]",
1386
+ cursor: "not-allowed"
1387
+ }
1388
+ }
1389
+ },
1390
+ sizes: {
1391
+ large: {
1392
+ height: "40px",
1393
+ paddingX: "spacing.4",
1394
+ fontSize: "font.size.md",
1395
+ iconGap: "spacing.2"
1396
+ },
1397
+ medium: {
1398
+ height: "32px",
1399
+ paddingX: "spacing.3",
1400
+ fontSize: "font.size.sm",
1401
+ iconGap: "spacing.2"
1402
+ },
1403
+ small: {
1404
+ height: "24px",
1405
+ paddingX: "spacing.2",
1406
+ fontSize: "font.size.xs",
1407
+ iconGap: "spacing.1"
1408
+ },
1409
+ xsmall: {
1410
+ height: "20px",
1411
+ paddingX: "spacing.2",
1412
+ fontSize: "font.size.xxs",
1413
+ iconGap: "spacing.1"
1414
+ }
1415
+ },
1416
+ iconPlacement: "Leading icon left of label, trailing icon right of label. Icon-only: square aspect ratio, tooltip required.",
1417
+ font: "Inter SemiBold (600). No uppercase transform.",
1418
+ radius: "radius.md (6px). Never radius.full for buttons.",
1419
+ composition: "Never stack two Filled buttons side by side. Destructive action uses red Filled variant only in modal footers."
1420
+ },
1421
+ tag: {
1422
+ variants: {
1423
+ filled: "Background: color[90] tint. Text and icon: color.base.",
1424
+ outlined: "Background: transparent. Border: 1px solid color.base. Text: color.base."
1425
+ },
1426
+ colors: {
1427
+ brand: "primary.purple.base filled, white text. Only for Polly/Elucidata-attributed labels.",
1428
+ content: "cyan, pink, blue, green, orange for data category tags.",
1429
+ statusReserved: "red and yellow reserved for status only. Never use for data category tags."
1430
+ },
1431
+ sizes: {
1432
+ medium: {
1433
+ height: "24px",
1434
+ paddingX: "spacing.2",
1435
+ fontSize: "font.size.xs"
1436
+ },
1437
+ small: {
1438
+ height: "20px",
1439
+ paddingX: "spacing.1",
1440
+ fontSize: "font.size.xxs"
1441
+ }
1442
+ },
1443
+ font: "Inter Medium (500). Never bold inside a tag.",
1444
+ radius: "radius.full (pill shape).",
1445
+ closeable: "x icon on right, same color as label. Click removes tag.",
1446
+ truncation: "Tags never wrap. Truncate with ellipsis. Set max-width on parent.",
1447
+ icon: "Optional leading icon, same color as label."
1448
+ },
1449
+ textInput: {
1450
+ states: {
1451
+ default: {
1452
+ border: "1px solid neutral.warm[70]",
1453
+ background: "white",
1454
+ placeholder: "neutral.warm[50]"
1455
+ },
1456
+ focused: {
1457
+ border: "1px solid primary.purple.base",
1458
+ shadow: "none",
1459
+ outline: "none"
1460
+ },
1461
+ filled: {
1462
+ border: "1px solid neutral.warm[70]"
1463
+ },
1464
+ error: {
1465
+ border: "1px solid red.base",
1466
+ trailingIcon: "warning icon in red.base",
1467
+ helperText: "red.base, font.size.xs"
1468
+ },
1469
+ disabled: {
1470
+ background: "neutral.warm[95]",
1471
+ border: "neutral.warm[85]",
1472
+ text: "neutral.warm[60]",
1473
+ cursor: "not-allowed"
1474
+ }
1475
+ },
1476
+ radius: "radius.sm",
1477
+ label: "Always above the field. Inter Medium (500), font.size.sm. Never inside field as permanent placeholder.",
1478
+ helperText: "Below field, neutral.warm[50], font.size.xs. Replaced by error message in error state.",
1479
+ leadingIcon: "Optional. neutral.warm[50] default, primary.purple.base when focused.",
1480
+ trailingIcon: "Password toggle, clear (x), or error indicator.",
1481
+ textarea: "Same border/state rules. Min-height 3 rows. Vertical resize only.",
1482
+ search: "Always has leading search icon. Trailing clear (x) when filled. No floating label.",
1483
+ select: {
1484
+ trailingIcon: "Chevron, rotates 180 degrees when open",
1485
+ menu: {
1486
+ background: "white",
1487
+ radius: "radius.md",
1488
+ elevation: "elevation.md"
1489
+ }
1490
+ }
1491
+ },
1492
+ selectionControl: {
1493
+ radio: {
1494
+ size: "18px",
1495
+ states: {
1496
+ default: {
1497
+ border: "1.5px solid neutral.warm[70]"
1498
+ },
1499
+ hover: {
1500
+ border: "1.5px solid primary.purple.base"
1501
+ },
1502
+ checked: {
1503
+ outerRing: "primary.purple.base",
1504
+ innerDot: "primary.purple.base"
1505
+ },
1506
+ disabled: {
1507
+ border: "neutral.warm[80]",
1508
+ dot: "neutral.warm[70]",
1509
+ cursor: "not-allowed"
1510
+ }
1511
+ }
1512
+ },
1513
+ checkbox: {
1514
+ size: "18px",
1515
+ radius: "radius.xs",
1516
+ states: {
1517
+ default: {
1518
+ border: "1.5px solid neutral.warm[70]"
1519
+ },
1520
+ hover: {
1521
+ border: "1.5px solid primary.purple.base"
1522
+ },
1523
+ checked: {
1524
+ background: "primary.purple.base",
1525
+ icon: "white checkmark"
1526
+ },
1527
+ indeterminate: {
1528
+ background: "primary.purple.base",
1529
+ icon: "white dash"
1530
+ },
1531
+ disabled: {
1532
+ background: "neutral.warm[90]",
1533
+ border: "neutral.warm[80]",
1534
+ cursor: "not-allowed"
1535
+ },
1536
+ error: {
1537
+ border: "red.base"
1538
+ }
1539
+ }
1540
+ },
1541
+ label: "Right of control. Inter Regular (400), font.size.sm. Never above or below.",
1542
+ groupSpacing: {
1543
+ vertical: "spacing.2 between items",
1544
+ horizontal: "spacing.4 gap"
1545
+ }
1334
1546
  },
1335
- tabs: "Tabs use a bottom-border indicator in #8E42EE for the active state. Inactive tabs have no underline and use neutral text. Filled or pill-style tabs are not permitted in the main nav context.",
1336
- table_sort: "Sort controls in table headers show the sort icon alongside the label at all times \u2014 not only on hover.",
1337
- pagination: "Pagination uses the minimal numeric style with previous/next arrows. Always display the total dataset count alongside (e.g. 'Showing 1\u201325 of 345').",
1338
- sidebar_active_state: "Active sidebar nav item is indicated by a left-side purple pill/accent bar only. No background fill, icon color change, or text weight change. This is the only permitted active state pattern for sidebar nav.",
1339
- notification_badges: "Notification badges on sidebar icons use the red semantic color token. Small, circular, positioned top-right of the icon."
1547
+ table: {
1548
+ container: {
1549
+ background: "white",
1550
+ radius: "radius.xl",
1551
+ elevation: "elevation.md"
1552
+ },
1553
+ header: {
1554
+ background: "neutral.warm[97]",
1555
+ font: "Label/Small SemiBold (600)",
1556
+ color: "neutral.warm[50]",
1557
+ sortIcon: "Always visible. Active column: primary.purple.base"
1558
+ },
1559
+ rows: {
1560
+ default: {
1561
+ background: "white",
1562
+ border: "1px solid neutral.warm[90] bottom"
1563
+ },
1564
+ hover: {
1565
+ background: "primary.purple[98]"
1566
+ },
1567
+ selected: {
1568
+ background: "primary.purple[95]",
1569
+ leftAccent: "3px solid primary.purple.base"
1570
+ }
1571
+ },
1572
+ cellTypes: {
1573
+ text: "Left-aligned. Inter Regular (400), font.size.sm, neutral.warm[20].",
1574
+ number: "Right-aligned. JetBrains Mono.",
1575
+ status: "Centered. Tag component.",
1576
+ actions: "Right-aligned. Icon buttons, visible on row hover. Max 3 \u2014 overflow to meatball menu."
1577
+ },
1578
+ sort: "Click cycles: ascending to descending to unsorted.",
1579
+ emptyState: "Centered illustration + headline + optional CTA. Never headers-only without empty state component.",
1580
+ pagination: {
1581
+ rowsPerPage: [
1582
+ 10,
1583
+ 25,
1584
+ 50,
1585
+ 100
1586
+ ],
1587
+ display: "Showing {start}-{end} of {total}",
1588
+ controls: "Prev/next arrows + page numbers"
1589
+ }
1590
+ },
1591
+ tabs: {
1592
+ containerBorder: "1px solid neutral.warm[85] bottom",
1593
+ indicator: "2px solid primary.purple.base bottom, active tab only",
1594
+ states: {
1595
+ active: {
1596
+ label: "primary.purple.base",
1597
+ font: "Inter SemiBold (600)"
1598
+ },
1599
+ default: {
1600
+ label: "neutral.warm[40]",
1601
+ font: "Inter Medium (500)"
1602
+ },
1603
+ hover: {
1604
+ label: "neutral.warm[20]"
1605
+ },
1606
+ disabled: {
1607
+ label: "neutral.warm[70]",
1608
+ cursor: "not-allowed"
1609
+ }
1610
+ },
1611
+ badge: {
1612
+ default: {
1613
+ background: "neutral.warm[80]",
1614
+ text: "neutral.warm[30]"
1615
+ },
1616
+ active: {
1617
+ background: "primary.purple[90]",
1618
+ text: "primary.purple.base"
1619
+ }
1620
+ },
1621
+ maxVisible: "6 tabs before dropdown overflow. No horizontal scroll.",
1622
+ style: "Indicator line only. Never filled/pill background tabs in main nav context."
1623
+ },
1624
+ sidebarNav: {
1625
+ background: "platform.sidebar.surfaces (#211D33)",
1626
+ item: {
1627
+ default: {
1628
+ icon: "white",
1629
+ label: "neutral.warm[70]",
1630
+ padding: "spacing.3 vertical"
1631
+ },
1632
+ hover: {
1633
+ background: "rgba(255,255,255,0.06)",
1634
+ radius: "radius.sm"
1635
+ },
1636
+ active: {
1637
+ leftAccent: "3px solid primary.purple[60]",
1638
+ label: "white",
1639
+ icon: "primary.purple[60]"
1640
+ }
1641
+ },
1642
+ divider: "1px solid platform.sidebar.stroke (#433B60)",
1643
+ iconSize: "20px. Always use PDS-Icon-Font-20 or SVG. Never emoji or text characters.",
1644
+ notificationBadge: {
1645
+ background: "red.base",
1646
+ text: "white",
1647
+ position: "top-right of icon",
1648
+ maxDisplay: "99+"
1649
+ },
1650
+ collapseBehavior: "Never collapses to icon-only on desktop. Mobile: drawer/overlay."
1651
+ },
1652
+ breadcrumb: {
1653
+ separator: "/ or > in neutral.warm[60], spacing.2 each side",
1654
+ crumbs: {
1655
+ nonCurrent: {
1656
+ color: "primary.purple.base",
1657
+ hoverDecoration: "underline"
1658
+ },
1659
+ current: {
1660
+ color: "neutral.warm[30]",
1661
+ interactive: "false"
1662
+ }
1663
+ },
1664
+ font: "Inter Regular (400), font.size.sm",
1665
+ maxDepth: "4 levels. Collapse middle levels to ellipsis if deeper."
1666
+ },
1667
+ modal: {
1668
+ overlay: "rgba(0,0,0,0.4) full-screen",
1669
+ container: {
1670
+ background: "white",
1671
+ radius: "radius.xl",
1672
+ elevation: "elevation.lg",
1673
+ border: "1px solid neutral.warm[85]"
1674
+ },
1675
+ sizes: {
1676
+ popup: {
1677
+ maxWidth: "480px",
1678
+ scrollable: "false",
1679
+ use: "Confirmations, quick forms"
1680
+ },
1681
+ modal: {
1682
+ maxWidth: "720px",
1683
+ maxHeight: "80vh",
1684
+ bodyScrollable: "true",
1685
+ use: "Complex forms, data views"
1686
+ }
1687
+ },
1688
+ header: {
1689
+ background: "primary.purple[98]",
1690
+ padding: "spacing.4 spacing.5",
1691
+ title: "Inter SemiBold (600), font.size.md, neutral.warm[10]",
1692
+ closeButton: "Ghost icon button, top-right, always present"
1693
+ },
1694
+ body: {
1695
+ background: "white",
1696
+ padding: "spacing.5",
1697
+ scrollbar: "Thin, primary.purple[60] track, visible during scroll only"
1698
+ },
1699
+ footer: {
1700
+ padding: "spacing.4 spacing.5",
1701
+ border: "1px solid neutral.warm[90] top",
1702
+ alignment: "right",
1703
+ buttonPattern: "Tertiary (ghost) + Primary (filled). Destructive: red Filled.",
1704
+ note: "Never ghost for destructive actions."
1705
+ },
1706
+ animation: "200ms fade + subtle scale on open/close",
1707
+ closing: "x button, overlay click (configurable), Escape key",
1708
+ nesting: "Never nest modals. Use multi-step flow within same modal instead."
1709
+ },
1710
+ snackbar: {
1711
+ position: "Bottom-right. Stacks upward if multiple queued.",
1712
+ container: {
1713
+ background: "white",
1714
+ radius: "radius.md",
1715
+ elevation: "elevation.md",
1716
+ border: "1px solid neutral.warm[85]",
1717
+ width: "320px-480px"
1718
+ },
1719
+ variants: {
1720
+ default: {
1721
+ icon: "none or neutral info icon"
1722
+ },
1723
+ success: {
1724
+ icon: "green check-circle, green.base"
1725
+ },
1726
+ error: {
1727
+ icon: "red error-circle, red.base"
1728
+ },
1729
+ warning: {
1730
+ icon: "orange warning-triangle, orange.base"
1731
+ }
1732
+ },
1733
+ sizes: {
1734
+ compact: "Single line: icon + title + optional action + dismiss",
1735
+ expanded: "Icon + title + body text + optional action + dismiss"
1736
+ },
1737
+ content: {
1738
+ title: "Inter SemiBold (600), font.size.sm, neutral.warm[10]. Required.",
1739
+ body: "Inter Regular (400), font.size.sm, neutral.warm[30]. Optional.",
1740
+ action: "One maximum. Right-aligned text link, primary.purple.base. Style: Open / Undo / View.",
1741
+ dismiss: "x ghost icon button, top-right. Always present."
1742
+ },
1743
+ autoDismiss: "Default/Success: 4 seconds. Error/Warning: manual dismiss only.",
1744
+ background: "Always white. Never colored backgrounds \u2014 icon carries semantic meaning.",
1745
+ persistence: "Not for persistent messages. Use top-of-content-area banner for those."
1746
+ },
1747
+ tooltip: {
1748
+ variants: {
1749
+ dark: {
1750
+ background: "neutral.warm[-70]",
1751
+ border: "none",
1752
+ text: "white"
1753
+ },
1754
+ light: {
1755
+ background: "white",
1756
+ border: "1px solid neutral.warm[85]",
1757
+ text: "neutral.warm[10]"
1758
+ }
1759
+ },
1760
+ shared: {
1761
+ radius: "radius.sm",
1762
+ elevation: "elevation.sm",
1763
+ padding: "spacing.1 spacing.2",
1764
+ maxWidth: "200px",
1765
+ font: "Inter Regular (400), font.size.xs"
1766
+ },
1767
+ arrow: "6px triangle pointing toward trigger. Matches tooltip background. 4 directions + alignment variants.",
1768
+ trigger: "Hover or focus. 300ms appear delay. Immediate dismiss on mouse-out.",
1769
+ usage: {
1770
+ dark: "Default for icon-only triggers (sidebar icons, action buttons).",
1771
+ light: "Longer descriptive text.",
1772
+ restriction: "Supplementary labels only. Never for critical task information. Never interactive elements inside \u2014 use hover card instead."
1773
+ }
1774
+ },
1775
+ hoverCard: {
1776
+ trigger: "Hover over element (table cell, username, tag). 400ms delay.",
1777
+ container: {
1778
+ background: "white",
1779
+ radius: "radius.lg",
1780
+ elevation: "elevation.md",
1781
+ border: "1px solid neutral.warm[85]",
1782
+ width: "220px-320px"
1783
+ },
1784
+ header: "Title: Inter SemiBold (600), font.size.sm. Optional meatball menu icon button on right.",
1785
+ body: "Inter Regular (400), font.size.sm, neutral.warm[20]. Short text, key-value pairs, or small list.",
1786
+ footer: "None. Hover cards are read-only. Use popup for actions.",
1787
+ arrow: "Optional. Use when card needs visual connection to trigger in dense layouts.",
1788
+ dismiss: "On mouse-out (no delay) or when focus leaves."
1789
+ },
1790
+ commentThread: {
1791
+ input: {
1792
+ placeholder: "Enter your comment here.",
1793
+ sendButton: "Icon button, primary.purple.base bg, white arrow icon, trailing. Active only when input non-empty.",
1794
+ sendButtonDisabled: "Muted purple when empty."
1795
+ },
1796
+ postedComment: {
1797
+ avatar: "User initials, primary.purple.base background, white text.",
1798
+ header: "Display name (SemiBold) + timestamp (neutral.warm[50], font.size.xs) on one line.",
1799
+ body: "Inter Regular (400), font.size.sm."
1800
+ },
1801
+ actions: "Thumbs-up + count, reply link. neutral.warm[50] default, primary.purple.base on hover.",
1802
+ nesting: "Max 2 levels. Replies: left-indent with 2px solid neutral.warm[85] left border.",
1803
+ highlighted: {
1804
+ background: "primary.purple[95]",
1805
+ border: "1px dashed primary.purple.base",
1806
+ radius: "radius.md"
1807
+ }
1808
+ },
1809
+ chartColors: {
1810
+ sequence: [
1811
+ {
1812
+ index: 1,
1813
+ color: "secondary.purple (tint)",
1814
+ use: "First data series"
1815
+ },
1816
+ {
1817
+ index: 2,
1818
+ color: "orange.base",
1819
+ use: "Second data series"
1820
+ },
1821
+ {
1822
+ index: 3,
1823
+ color: "pink.base",
1824
+ use: "Third data series"
1825
+ },
1826
+ {
1827
+ index: 4,
1828
+ color: "cyan.base",
1829
+ use: "Fourth data series"
1830
+ },
1831
+ {
1832
+ index: 5,
1833
+ color: "blue.base",
1834
+ use: "Fifth data series"
1835
+ },
1836
+ {
1837
+ index: 6,
1838
+ color: "neutral.warm.base",
1839
+ use: "Sixth data series"
1840
+ },
1841
+ {
1842
+ index: 7,
1843
+ color: "green.base",
1844
+ use: "Seventh data series"
1845
+ },
1846
+ {
1847
+ index: 8,
1848
+ color: "neutral.orange",
1849
+ use: "Eighth data series"
1850
+ },
1851
+ {
1852
+ index: 9,
1853
+ color: "red.base",
1854
+ use: "Ninth data series"
1855
+ }
1856
+ ],
1857
+ rules: [
1858
+ "Apply colors in sequence. Do not skip or reorder.",
1859
+ "Each color has a chart tint (~20% lightened) and an offset variant for comparison charts.",
1860
+ "Chart colors for data visualisation only. Never repurpose for UI status.",
1861
+ "More than 9 series: wrap palette at 0.6x opacity. Never invent new colors.",
1862
+ "Minimum 3:1 contrast between adjacent chart segments."
1863
+ ]
1864
+ },
1865
+ cliColors: {
1866
+ sqlCLI: {
1867
+ keywords: "secondary.purple[-20]",
1868
+ comments: "orange[-20]",
1869
+ strings: "pink[-30]",
1870
+ numeralsDatetime: "cyan[-20]",
1871
+ atoms: "blue[-20]",
1872
+ generic: "neutral[-40]",
1873
+ identifiers: "green[-30]",
1874
+ brackets: "neutral.orange[-20]",
1875
+ errorText: "red[-40]"
1876
+ },
1877
+ logCLI: {
1878
+ background: "neutral[-70]",
1879
+ debug: "cyan[40]",
1880
+ warning: "orange[50]",
1881
+ error: "pink[90]",
1882
+ critical: "red[0]",
1883
+ info: "green[50]",
1884
+ regularText: "neutral[95]"
1885
+ }
1886
+ }
1340
1887
  },
1341
1888
  spacing: {
1342
1889
  card_padding: "Internal card padding uses spacing.4 (1rem) on all sides.",