@atlaskit/css 0.18.1 → 0.19.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atlaskit/css
2
2
 
3
+ ## 0.19.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f111803c4e253`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f111803c4e253) -
8
+ Updating typography fallbacks to refreshed typography values as the deprecated legacy typography
9
+ theme has been removed.
10
+ - Updated dependencies
11
+
12
+ ## 0.19.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [`55546332d4ef4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55546332d4ef4) -
17
+ Restricted `borderRadius` xcss and cssMap types to only accept tokens, 0, and "inherit".
18
+ Restricted `borderWidth` types to only accept tokens and 0. Previously any string was allowed,
19
+ this is no longer the case and will throw a type error.
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
3
25
  ## 0.18.1
4
26
 
5
27
  ### Patch Changes
@@ -2,6 +2,7 @@
2
2
  import { css, type SerializedStyles } from '@emotion/react';
3
3
 
4
4
  import { CURRENT_SURFACE_CSS_VAR, token } from '@atlaskit/tokens';
5
+ import type { CSSTokenMap } from '@atlaskit/tokens/token-names';
5
6
 
6
7
  /**
7
8
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
@@ -1372,7 +1373,7 @@ export type BorderRadius = keyof typeof borderRadiusMap;
1372
1373
 
1373
1374
  /**
1374
1375
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
1375
- * @codegen <<SignedSource::ab32bc819d015e7451c245e6a77eba28>>
1376
+ * @codegen <<SignedSource::f81d01fb664f365972ac87a2be86aba6>>
1376
1377
  * @codegenId typography
1377
1378
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
1378
1379
  * @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
@@ -1398,63 +1399,63 @@ export const fontMap: {
1398
1399
  } = {
1399
1400
  'font.body': token(
1400
1401
  'font.body',
1401
- 'normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1402
+ 'normal 400 14px/20px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1402
1403
  ),
1403
1404
  'font.body.UNSAFE_small': token(
1404
1405
  'font.body.UNSAFE_small',
1405
- 'normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1406
+ 'normal 400 12px/16px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1406
1407
  ),
1407
1408
  'font.body.large': token(
1408
1409
  'font.body.large',
1409
- 'normal 400 16px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1410
+ 'normal 400 16px/24px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1410
1411
  ),
1411
1412
  'font.body.small': token(
1412
1413
  'font.body.small',
1413
- 'normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1414
+ 'normal 400 12px/16px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1414
1415
  ),
1415
1416
  'font.code': token(
1416
1417
  'font.code',
1417
- 'normal 400 0.875em/1 ui-monospace, Menlo, "Segoe UI Mono", "Ubuntu Mono", monospace',
1418
+ 'normal 400 0.875em/1 "Atlassian Mono", ui-monospace, Menlo, "Segoe UI Mono", "Ubuntu Mono", monospace',
1418
1419
  ),
1419
1420
  'font.heading.large': token(
1420
1421
  'font.heading.large',
1421
- 'normal 500 24px/28px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1422
+ 'normal 653 24px/28px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1422
1423
  ),
1423
1424
  'font.heading.medium': token(
1424
1425
  'font.heading.medium',
1425
- 'normal 500 20px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1426
+ 'normal 653 20px/24px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1426
1427
  ),
1427
1428
  'font.heading.small': token(
1428
1429
  'font.heading.small',
1429
- 'normal 600 16px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1430
+ 'normal 653 16px/20px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1430
1431
  ),
1431
1432
  'font.heading.xlarge': token(
1432
1433
  'font.heading.xlarge',
1433
- 'normal 600 29px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1434
+ 'normal 653 28px/32px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1434
1435
  ),
1435
1436
  'font.heading.xsmall': token(
1436
1437
  'font.heading.xsmall',
1437
- 'normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1438
+ 'normal 653 14px/20px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1438
1439
  ),
1439
1440
  'font.heading.xxlarge': token(
1440
1441
  'font.heading.xxlarge',
1441
- 'normal 500 35px/40px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1442
+ 'normal 653 32px/36px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1442
1443
  ),
1443
1444
  'font.heading.xxsmall': token(
1444
1445
  'font.heading.xxsmall',
1445
- 'normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1446
+ 'normal 653 12px/16px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1446
1447
  ),
1447
1448
  'font.metric.large': token(
1448
1449
  'font.metric.large',
1449
- 'normal 653 28px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1450
+ 'normal 653 28px/32px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1450
1451
  ),
1451
1452
  'font.metric.medium': token(
1452
1453
  'font.metric.medium',
1453
- 'normal 653 24px/28px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1454
+ 'normal 653 24px/28px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1454
1455
  ),
1455
1456
  'font.metric.small': token(
1456
1457
  'font.metric.small',
1457
- 'normal 653 16px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1458
+ 'normal 653 16px/20px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1458
1459
  ),
1459
1460
  };
1460
1461
 
@@ -1466,7 +1467,7 @@ export const fontWeightMap: {
1466
1467
  'font.weight.regular': 'var(--ds-font-weight-regular)';
1467
1468
  'font.weight.semibold': 'var(--ds-font-weight-semibold)';
1468
1469
  } = {
1469
- 'font.weight.bold': token('font.weight.bold', '700'),
1470
+ 'font.weight.bold': token('font.weight.bold', '653'),
1470
1471
  'font.weight.medium': token('font.weight.medium', '500'),
1471
1472
  'font.weight.regular': token('font.weight.regular', '400'),
1472
1473
  'font.weight.semibold': token('font.weight.semibold', '600'),
@@ -1483,7 +1484,7 @@ export const fontFamilyMap: {
1483
1484
  } = {
1484
1485
  'font.family.body': token(
1485
1486
  'font.family.body',
1486
- 'ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1487
+ '"Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1487
1488
  ),
1488
1489
  'font.family.brand.body': token(
1489
1490
  'font.family.brand.body',
@@ -1495,11 +1496,11 @@ export const fontFamilyMap: {
1495
1496
  ),
1496
1497
  'font.family.code': token(
1497
1498
  'font.family.code',
1498
- 'ui-monospace, Menlo, "Segoe UI Mono", "Ubuntu Mono", monospace',
1499
+ '"Atlassian Mono", ui-monospace, Menlo, "Segoe UI Mono", "Ubuntu Mono", monospace',
1499
1500
  ),
1500
1501
  'font.family.heading': token(
1501
1502
  'font.family.heading',
1502
- 'ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1503
+ '"Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1503
1504
  ),
1504
1505
  };
1505
1506
 
@@ -1511,7 +1512,7 @@ export type FontFamily = keyof typeof fontFamilyMap;
1511
1512
 
1512
1513
  /**
1513
1514
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
1514
- * @codegen <<SignedSource::379f638b84496f34817234c7f3c58f74>>
1515
+ * @codegen <<SignedSource::aeebc24b95e2189021f1d98f1715a6a0>>
1515
1516
  * @codegenId text
1516
1517
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
1517
1518
  * @codegenDependency ../../../primitives/scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
@@ -1525,19 +1526,19 @@ export const textSizeMap: {
1525
1526
  } = {
1526
1527
  medium: token(
1527
1528
  'font.body',
1528
- 'normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1529
+ 'normal 400 14px/20px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1529
1530
  ),
1530
1531
  UNSAFE_small: token(
1531
1532
  'font.body.UNSAFE_small',
1532
- 'normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1533
+ 'normal 400 12px/16px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1533
1534
  ),
1534
1535
  large: token(
1535
1536
  'font.body.large',
1536
- 'normal 400 16px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1537
+ 'normal 400 16px/24px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1537
1538
  ),
1538
1539
  small: token(
1539
1540
  'font.body.small',
1540
- 'normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1541
+ 'normal 400 12px/16px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1541
1542
  ),
1542
1543
  };
1543
1544
 
@@ -1549,7 +1550,7 @@ export const textWeightMap: {
1549
1550
  regular: 'var(--ds-font-weight-regular)';
1550
1551
  semibold: 'var(--ds-font-weight-semibold)';
1551
1552
  } = {
1552
- bold: token('font.weight.bold', '700'),
1553
+ bold: token('font.weight.bold', '653'),
1553
1554
  medium: token('font.weight.medium', '500'),
1554
1555
  regular: token('font.weight.regular', '400'),
1555
1556
  semibold: token('font.weight.semibold', '600'),
@@ -1564,15 +1565,15 @@ export const metricTextSizeMap: {
1564
1565
  } = {
1565
1566
  large: token(
1566
1567
  'font.metric.large',
1567
- 'normal 653 28px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1568
+ 'normal 653 28px/32px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1568
1569
  ),
1569
1570
  medium: token(
1570
1571
  'font.metric.medium',
1571
- 'normal 653 24px/28px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1572
+ 'normal 653 24px/28px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1572
1573
  ),
1573
1574
  small: token(
1574
1575
  'font.metric.small',
1575
- 'normal 653 16px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1576
+ 'normal 653 16px/20px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
1576
1577
  ),
1577
1578
  };
1578
1579
 
@@ -1585,6 +1586,15 @@ export type MetricTextSize = keyof typeof metricTextSizeMap;
1585
1586
  // Margin needs some bespoke types: https://atlassian.slack.com/archives/CKRHB23K8/p1712623192772909
1586
1587
  type MarginSpace = AllSpace | 'auto' | '0';
1587
1588
  type PaddingSpace = Space | '0';
1589
+ type BorderWidthExtended = BorderWidth | 0 | '0';
1590
+ /**
1591
+ * Token functions are currently allowed for borderRadius in xcss to ease migration.
1592
+ * Because 'radius.small' defaults to 3px, we need a mechanism to allow for 4px values to be provided:
1593
+ * This is done by calling the token function - token('radius.small')
1594
+ *
1595
+ * TODO: Remove once shape them is rolled out and fg platform-dst-shape-theme-default removed
1596
+ */
1597
+ type BorderRadiusExtended = BorderRadius | 0 | '0' | 'inherit' | CSSTokenMap[BorderRadius];
1588
1598
  type GlobalValue = 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset';
1589
1599
  type AutoComplete<T extends string> = T | Omit<string, T>;
1590
1600
 
@@ -1593,35 +1603,35 @@ export type TokenisedProps = {
1593
1603
  blockSize?: Dimension | string;
1594
1604
  borderBlockColor?: AutoComplete<BorderColor>;
1595
1605
  borderBlockEndColor?: AutoComplete<BorderColor>;
1596
- borderBlockEndWidth?: BorderWidth | string;
1606
+ borderBlockEndWidth?: BorderWidthExtended;
1597
1607
  borderBlockStartColor?: AutoComplete<BorderColor>;
1598
- borderBlockStartWidth?: BorderWidth | string;
1599
- borderBlockWidth?: BorderWidth | string;
1608
+ borderBlockStartWidth?: BorderWidthExtended;
1609
+ borderBlockWidth?: BorderWidthExtended;
1600
1610
  borderBottomColor?: AutoComplete<BorderColor>;
1601
- borderBottomLeftRadius?: BorderRadius | string;
1602
- borderBottomRightRadius?: BorderRadius | string;
1603
- borderBottomWidth?: BorderWidth | string;
1611
+ borderBottomLeftRadius?: BorderRadiusExtended;
1612
+ borderBottomRightRadius?: BorderRadiusExtended;
1613
+ borderBottomWidth?: BorderWidthExtended;
1604
1614
  borderColor?: BorderColor;
1605
- borderEndEndRadius?: BorderRadius | string;
1606
- borderEndStartRadius?: BorderRadius | string;
1615
+ borderEndEndRadius?: BorderRadiusExtended;
1616
+ borderEndStartRadius?: BorderRadiusExtended;
1607
1617
  borderInlineColor?: AutoComplete<BorderColor>;
1608
1618
  borderInlineEndColor?: AutoComplete<BorderColor>;
1609
- borderInlineEndWidth?: BorderWidth | string;
1619
+ borderInlineEndWidth?: BorderWidthExtended;
1610
1620
  borderInlineStartColor?: AutoComplete<BorderColor>;
1611
- borderInlineStartWidth?: BorderWidth | string;
1612
- borderInlineWidth?: BorderWidth | string;
1621
+ borderInlineStartWidth?: BorderWidthExtended;
1622
+ borderInlineWidth?: BorderWidthExtended;
1613
1623
  borderLeftColor?: AutoComplete<BorderColor>;
1614
- borderLeftWidth?: BorderWidth | string;
1615
- borderRadius?: BorderRadius | string;
1624
+ borderLeftWidth?: BorderWidthExtended;
1625
+ borderRadius?: BorderRadiusExtended;
1616
1626
  borderRightColor?: AutoComplete<BorderColor>;
1617
- borderRightWidth?: BorderWidth | string;
1618
- borderStartEndRadius?: BorderRadius | string;
1619
- borderStartStartRadius?: BorderRadius | string;
1627
+ borderRightWidth?: BorderWidthExtended;
1628
+ borderStartEndRadius?: BorderRadiusExtended;
1629
+ borderStartStartRadius?: BorderRadiusExtended;
1620
1630
  borderTopColor?: AutoComplete<BorderColor>;
1621
- borderTopLeftRadius?: BorderRadius | string;
1622
- borderTopRightRadius?: BorderRadius | string;
1623
- borderTopWidth?: BorderWidth | string;
1624
- borderWidth?: BorderWidth | string;
1631
+ borderTopLeftRadius?: BorderRadiusExtended;
1632
+ borderTopRightRadius?: BorderRadiusExtended;
1633
+ borderTopWidth?: BorderWidthExtended;
1634
+ borderWidth?: BorderWidthExtended;
1625
1635
  bottom?: AutoComplete<AllSpace>;
1626
1636
  boxShadow?: Shadow;
1627
1637
  color?: TextColor;
@@ -1663,7 +1673,7 @@ export type TokenisedProps = {
1663
1673
  opacity?: AutoComplete<Opacity> | number;
1664
1674
  outlineColor?: BorderColor;
1665
1675
  outlineOffset?: AllSpace;
1666
- outlineWidth?: BorderWidth | string;
1676
+ outlineWidth?: BorderWidthExtended;
1667
1677
  padding?: PaddingSpace | GlobalValue;
1668
1678
  paddingBlock?: PaddingSpace | GlobalValue;
1669
1679
  paddingBlockEnd?: PaddingSpace | GlobalValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/css",
3
- "version": "0.18.1",
3
+ "version": "0.19.1",
4
4
  "description": "Style components backed by Atlassian Design System design tokens powered by Compiled CSS-in-JS.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -44,7 +44,7 @@
44
44
  ],
45
45
  "atlaskit:src": "src/index.tsx",
46
46
  "dependencies": {
47
- "@atlaskit/tokens": "^8.6.0",
47
+ "@atlaskit/tokens": "^10.0.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@compiled/react": "^0.18.6"
50
50
  },
@@ -53,11 +53,11 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@af/visual-regression": "workspace:^",
56
- "@atlaskit/button": "^23.8.0",
56
+ "@atlaskit/button": "^23.9.0",
57
57
  "@atlaskit/ds-lib": "^5.3.0",
58
- "@atlaskit/primitives": "^16.4.0",
58
+ "@atlaskit/primitives": "^17.1.0",
59
59
  "@emotion/react": "^11.7.1",
60
- "@testing-library/react": "^13.4.0",
60
+ "@testing-library/react": "^16.3.0",
61
61
  "@types/jscodeshift": "^0.11.0",
62
62
  "jscodeshift": "^17.0.0",
63
63
  "react-dom": "^18.2.0"