braid-design-system 31.17.0 → 31.17.2

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/codemod/dist/wrapper.js +148 -90
  3. package/css/globalHeadingStyle.docs.tsx +1 -1
  4. package/css/globalTextStyle.docs.tsx +1 -1
  5. package/css/index.ts +4 -1
  6. package/lib/components/Accordion/Accordion.docs.tsx +1 -1
  7. package/lib/components/Alert/Alert.docs.tsx +1 -1
  8. package/lib/components/Autosuggest/Autosuggest.tsx +3 -2
  9. package/lib/components/Box/ColoredBox.tsx +1 -1
  10. package/lib/components/BraidPortal/BraidPortal.tsx +1 -1
  11. package/lib/components/BraidProvider/VanillaThemeContainer.tsx +1 -1
  12. package/lib/components/Button/Button.tsx +1 -1
  13. package/lib/components/ButtonIcon/ButtonIcon.docs.tsx +1 -1
  14. package/lib/components/Checkbox/Checkbox.docs.tsx +1 -1
  15. package/lib/components/Dialog/Dialog.docs.tsx +1 -1
  16. package/lib/components/Disclosure/Disclosure.docs.tsx +1 -1
  17. package/lib/components/Drawer/Drawer.docs.tsx +1 -1
  18. package/lib/components/Heading/Heading.docs.tsx +1 -2
  19. package/lib/components/Heading/Heading.gallery.tsx +44 -33
  20. package/lib/components/Heading/Heading.screenshots.tsx +49 -73
  21. package/lib/components/Heading/Heading.tsx +15 -31
  22. package/lib/components/Loader/Loader.docs.tsx +1 -1
  23. package/lib/components/Loader/Loader.tsx +2 -2
  24. package/lib/components/MenuItem/MenuItem.docs.tsx +1 -1
  25. package/lib/components/MenuItem/useMenuItem.tsx +1 -1
  26. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.docs.tsx +1 -1
  27. package/lib/components/MenuItemDivider/MenuItemDivider.docs.tsx +1 -1
  28. package/lib/components/MenuRenderer/MenuRenderer.docs.tsx +1 -1
  29. package/lib/components/MenuRenderer/MenuRenderer.tsx +1 -1
  30. package/lib/components/Notice/Notice.docs.tsx +1 -2
  31. package/lib/components/OverflowMenu/OverflowMenu.docs.tsx +1 -1
  32. package/lib/components/Pagination/Pagination.docs.tsx +2 -2
  33. package/lib/components/RadioGroup/RadioGroup.docs.tsx +1 -1
  34. package/lib/components/Secondary/Secondary.screenshots.tsx +35 -2
  35. package/lib/components/Secondary/Secondary.tsx +2 -2
  36. package/lib/components/Stepper/Stepper.docs.tsx +3 -3
  37. package/lib/components/Strong/Strong.tsx +2 -2
  38. package/lib/components/Tabs/Tabs.docs.tsx +1 -1
  39. package/lib/components/Text/Text.screenshots.tsx +46 -37
  40. package/lib/components/Text/Text.tsx +15 -36
  41. package/lib/components/Text/TextContext.ts +2 -2
  42. package/lib/components/TextLink/TextLink.css.ts +0 -14
  43. package/lib/components/TextLink/TextLink.screenshots.tsx +173 -63
  44. package/lib/components/TextLink/TextLink.tsx +13 -2
  45. package/lib/components/TextLinkButton/TextLinkButton.docs.tsx +1 -1
  46. package/lib/components/TooltipRenderer/TooltipRenderer.docs.tsx +1 -1
  47. package/lib/components/icons/Icons.screenshots.tsx +2 -2
  48. package/lib/components/private/Field/Field.tsx +3 -2
  49. package/lib/components/private/Truncate/Truncate.css.ts +12 -4
  50. package/lib/components/private/Truncate/Truncate.tsx +1 -6
  51. package/lib/components/private/Typography/Typography.tsx +35 -0
  52. package/lib/components/private/defaultTextProps.tsx +4 -4
  53. package/lib/components/useToast/useToast.docs.tsx +1 -1
  54. package/lib/css/globalTypographyStyles.ts +51 -0
  55. package/lib/{hooks/typography → css}/typography.css.ts +55 -64
  56. package/lib/css/typography.ts +22 -0
  57. package/lib/hooks/useIcon/index.ts +11 -10
  58. package/package.json +6 -5
  59. package/lib/hooks/typography/index.ts +0 -109
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # braid-design-system
2
2
 
3
+ ## 31.17.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Update `@vanilla-extract/css` dependency ([#1158](https://github.com/seek-oss/braid-design-system/pull/1158))
8
+
9
+ This fixes a type error that was occurring with typescript versions >=4.5.0
10
+
11
+ - **Heading**: Nested icons inherit text colour ([#1153](https://github.com/seek-oss/braid-design-system/pull/1153))
12
+
13
+ When using icons inside of a `Heading`, the default `tone` was always `neutral`, rather than inheriting the colour of the nearest component.
14
+
15
+ For example, when an icon was used inside of a `TextLink` within a `Heading`:
16
+
17
+ ```jsx
18
+ <Heading level="1">
19
+ Title with{' '}
20
+ <TextLink>
21
+ link <IconArrow />
22
+ </TextLink>
23
+ </Heading>
24
+ // => Previously, IconArrow was the heading text colour
25
+ // `neutral`, now inherits the `link` colour.
26
+ ```
27
+
28
+ or equally, when an icon was used inside of a `Secondary` component within a `Heading`:
29
+
30
+ ```jsx
31
+ <Heading level="1">
32
+ Title with{' '}
33
+ <Secondary>
34
+ secondary <IconArrow />
35
+ </Secondary>
36
+ </Heading>
37
+ // => Previously, IconArrow was the heading text colour
38
+ // `neutral`, now inherits the `secondary` colour.
39
+ ```
40
+
41
+ ## 31.17.1
42
+
43
+ ### Patch Changes
44
+
45
+ - Fixes an issue with a missing dependency ([#1143](https://github.com/seek-oss/braid-design-system/pull/1143))
46
+
3
47
  ## 31.17.0
4
48
 
5
49
  ### Minor Changes
@@ -36319,9 +36319,9 @@ var require_set_array_umd = __commonJS({
36319
36319
  }
36320
36320
  });
36321
36321
 
36322
- // ../../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.13/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
36322
+ // ../../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.14/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
36323
36323
  var require_sourcemap_codec_umd = __commonJS({
36324
- "../../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.13/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(exports2, module2) {
36324
+ "../../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.14/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(exports2, module2) {
36325
36325
  (function(global2, factory) {
36326
36326
  typeof exports2 === "object" && typeof module2 !== "undefined" ? factory(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.sourcemapCodec = {}));
36327
36327
  })(exports2, function(exports3) {
@@ -36485,16 +36485,26 @@ var require_sourcemap_codec_umd = __commonJS({
36485
36485
  }
36486
36486
  });
36487
36487
 
36488
- // ../../../node_modules/.pnpm/@jridgewell+resolve-uri@3.0.7/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js
36488
+ // ../../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.0/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js
36489
36489
  var require_resolve_uri_umd = __commonJS({
36490
- "../../../node_modules/.pnpm/@jridgewell+resolve-uri@3.0.7/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"(exports2, module2) {
36490
+ "../../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.0/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"(exports2, module2) {
36491
36491
  (function(global2, factory) {
36492
36492
  typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.resolveURI = factory());
36493
36493
  })(exports2, function() {
36494
36494
  "use strict";
36495
36495
  const schemeRegex = /^[\w+.-]+:\/\//;
36496
- const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?/;
36497
- const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/]*)?)?(\/?.*)/i;
36496
+ const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
36497
+ const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
36498
+ var UrlType;
36499
+ (function(UrlType2) {
36500
+ UrlType2[UrlType2["Empty"] = 1] = "Empty";
36501
+ UrlType2[UrlType2["Hash"] = 2] = "Hash";
36502
+ UrlType2[UrlType2["Query"] = 3] = "Query";
36503
+ UrlType2[UrlType2["RelativePath"] = 4] = "RelativePath";
36504
+ UrlType2[UrlType2["AbsolutePath"] = 5] = "AbsolutePath";
36505
+ UrlType2[UrlType2["SchemeRelative"] = 6] = "SchemeRelative";
36506
+ UrlType2[UrlType2["Absolute"] = 7] = "Absolute";
36507
+ })(UrlType || (UrlType = {}));
36498
36508
  function isAbsoluteUrl(input) {
36499
36509
  return schemeRegex.test(input);
36500
36510
  }
@@ -36507,35 +36517,42 @@ var require_resolve_uri_umd = __commonJS({
36507
36517
  function isFileUrl(input) {
36508
36518
  return input.startsWith("file:");
36509
36519
  }
36520
+ function isRelative(input) {
36521
+ return /^[.?#]/.test(input);
36522
+ }
36510
36523
  function parseAbsoluteUrl(input) {
36511
36524
  const match = urlRegex.exec(input);
36512
- return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/");
36525
+ return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
36513
36526
  }
36514
36527
  function parseFileUrl(input) {
36515
36528
  const match = fileRegex.exec(input);
36516
36529
  const path = match[2];
36517
- return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path) ? path : "/" + path);
36530
+ return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path) ? path : "/" + path, match[3] || "", match[4] || "");
36518
36531
  }
36519
- function makeUrl(scheme, user, host, port, path) {
36532
+ function makeUrl(scheme, user, host, port, path, query, hash) {
36520
36533
  return {
36521
36534
  scheme,
36522
36535
  user,
36523
36536
  host,
36524
36537
  port,
36525
36538
  path,
36526
- relativePath: false
36539
+ query,
36540
+ hash,
36541
+ type: UrlType.Absolute
36527
36542
  };
36528
36543
  }
36529
36544
  function parseUrl(input) {
36530
36545
  if (isSchemeRelativeUrl(input)) {
36531
36546
  const url2 = parseAbsoluteUrl("http:" + input);
36532
36547
  url2.scheme = "";
36548
+ url2.type = UrlType.SchemeRelative;
36533
36549
  return url2;
36534
36550
  }
36535
36551
  if (isAbsolutePath(input)) {
36536
36552
  const url2 = parseAbsoluteUrl("http://foo.com" + input);
36537
36553
  url2.scheme = "";
36538
36554
  url2.host = "";
36555
+ url2.type = UrlType.AbsolutePath;
36539
36556
  return url2;
36540
36557
  }
36541
36558
  if (isFileUrl(input))
@@ -36545,7 +36562,7 @@ var require_resolve_uri_umd = __commonJS({
36545
36562
  const url = parseAbsoluteUrl("http://foo.com/" + input);
36546
36563
  url.scheme = "";
36547
36564
  url.host = "";
36548
- url.relativePath = true;
36565
+ url.type = input ? input.startsWith("?") ? UrlType.Query : input.startsWith("#") ? UrlType.Hash : UrlType.RelativePath : UrlType.Empty;
36549
36566
  return url;
36550
36567
  }
36551
36568
  function stripPathFilename(path) {
@@ -36555,18 +36572,15 @@ var require_resolve_uri_umd = __commonJS({
36555
36572
  return path.slice(0, index + 1);
36556
36573
  }
36557
36574
  function mergePaths(url, base) {
36558
- if (!url.relativePath)
36559
- return;
36560
- normalizePath(base);
36575
+ normalizePath(base, base.type);
36561
36576
  if (url.path === "/") {
36562
36577
  url.path = base.path;
36563
36578
  } else {
36564
36579
  url.path = stripPathFilename(base.path) + url.path;
36565
36580
  }
36566
- url.relativePath = base.relativePath;
36567
36581
  }
36568
- function normalizePath(url) {
36569
- const { relativePath } = url;
36582
+ function normalizePath(url, type2) {
36583
+ const rel = type2 <= UrlType.RelativePath;
36570
36584
  const pieces = url.path.split("/");
36571
36585
  let pointer = 1;
36572
36586
  let positive = 0;
@@ -36585,7 +36599,7 @@ var require_resolve_uri_umd = __commonJS({
36585
36599
  addTrailingSlash = true;
36586
36600
  positive--;
36587
36601
  pointer--;
36588
- } else if (relativePath) {
36602
+ } else if (rel) {
36589
36603
  pieces[pointer++] = piece;
36590
36604
  }
36591
36605
  continue;
@@ -36606,36 +36620,57 @@ var require_resolve_uri_umd = __commonJS({
36606
36620
  if (!input && !base)
36607
36621
  return "";
36608
36622
  const url = parseUrl(input);
36609
- if (base && !url.scheme) {
36623
+ let inputType = url.type;
36624
+ if (base && inputType !== UrlType.Absolute) {
36610
36625
  const baseUrl = parseUrl(base);
36611
- url.scheme = baseUrl.scheme;
36612
- if (!url.host) {
36613
- url.user = baseUrl.user;
36614
- url.host = baseUrl.host;
36615
- url.port = baseUrl.port;
36616
- }
36617
- mergePaths(url, baseUrl);
36618
- }
36619
- normalizePath(url);
36620
- if (url.relativePath) {
36621
- const path = url.path.slice(1);
36622
- if (!path)
36623
- return ".";
36624
- const keepRelative = (base || input).startsWith(".");
36625
- return !keepRelative || path.startsWith(".") ? path : "./" + path;
36626
- }
36627
- if (!url.scheme && !url.host)
36628
- return url.path;
36629
- return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`;
36626
+ const baseType = baseUrl.type;
36627
+ switch (inputType) {
36628
+ case UrlType.Empty:
36629
+ url.hash = baseUrl.hash;
36630
+ case UrlType.Hash:
36631
+ url.query = baseUrl.query;
36632
+ case UrlType.Query:
36633
+ case UrlType.RelativePath:
36634
+ mergePaths(url, baseUrl);
36635
+ case UrlType.AbsolutePath:
36636
+ url.user = baseUrl.user;
36637
+ url.host = baseUrl.host;
36638
+ url.port = baseUrl.port;
36639
+ case UrlType.SchemeRelative:
36640
+ url.scheme = baseUrl.scheme;
36641
+ }
36642
+ if (baseType > inputType)
36643
+ inputType = baseType;
36644
+ }
36645
+ normalizePath(url, inputType);
36646
+ const queryHash = url.query + url.hash;
36647
+ switch (inputType) {
36648
+ case UrlType.Hash:
36649
+ case UrlType.Query:
36650
+ return queryHash;
36651
+ case UrlType.RelativePath: {
36652
+ const path = url.path.slice(1);
36653
+ if (!path)
36654
+ return queryHash || ".";
36655
+ if (isRelative(base || input) && !isRelative(path)) {
36656
+ return "./" + path + queryHash;
36657
+ }
36658
+ return path + queryHash;
36659
+ }
36660
+ case UrlType.AbsolutePath:
36661
+ return url.path + queryHash;
36662
+ default:
36663
+ return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
36664
+ }
36630
36665
  }
36631
36666
  return resolve;
36632
36667
  });
36633
36668
  }
36634
36669
  });
36635
36670
 
36636
- // ../../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.13/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js
36671
+ // ../../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.16/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js
36637
36672
  var require_trace_mapping_umd = __commonJS({
36638
- "../../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.13/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(exports2, module2) {
36673
+ "../../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.16/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(exports2, module2) {
36639
36674
  (function(global2, factory) {
36640
36675
  typeof exports2 === "object" && typeof module2 !== "undefined" ? factory(exports2, require_sourcemap_codec_umd(), require_resolve_uri_umd()) : typeof define === "function" && define.amd ? define(["exports", "@jridgewell/sourcemap-codec", "@jridgewell/resolve-uri"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.traceMapping = {}, global2.sourcemapCodec, global2.resolveURI));
36641
36676
  })(exports2, function(exports3, sourcemapCodec, resolveUri) {
@@ -36871,11 +36906,13 @@ var require_trace_mapping_umd = __commonJS({
36871
36906
  const COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
36872
36907
  const LEAST_UPPER_BOUND = -1;
36873
36908
  const GREATEST_LOWER_BOUND = 1;
36909
+ const ALL_BOUND = 0;
36874
36910
  exports3.encodedMappings = void 0;
36875
36911
  exports3.decodedMappings = void 0;
36876
36912
  exports3.traceSegment = void 0;
36877
36913
  exports3.originalPositionFor = void 0;
36878
36914
  exports3.generatedPositionFor = void 0;
36915
+ exports3.allGeneratedPositionsFor = void 0;
36879
36916
  exports3.eachMapping = void 0;
36880
36917
  exports3.sourceContentFor = void 0;
36881
36918
  exports3.presortedDecodedMap = void 0;
@@ -36883,9 +36920,6 @@ var require_trace_mapping_umd = __commonJS({
36883
36920
  exports3.encodedMap = void 0;
36884
36921
  class TraceMap {
36885
36922
  constructor(map, mapUrl) {
36886
- this._decodedMemo = memoizedState();
36887
- this._bySources = void 0;
36888
- this._bySourceMemos = void 0;
36889
36923
  const isString = typeof map === "string";
36890
36924
  if (!isString && map._decodedMemo)
36891
36925
  return map;
@@ -36907,6 +36941,9 @@ var require_trace_mapping_umd = __commonJS({
36907
36941
  this._encoded = void 0;
36908
36942
  this._decoded = maybeSort(mappings, isString);
36909
36943
  }
36944
+ this._decodedMemo = memoizedState();
36945
+ this._bySources = void 0;
36946
+ this._bySourceMemos = void 0;
36910
36947
  }
36911
36948
  }
36912
36949
  (() => {
@@ -36921,7 +36958,9 @@ var require_trace_mapping_umd = __commonJS({
36921
36958
  const decoded = exports3.decodedMappings(map);
36922
36959
  if (line >= decoded.length)
36923
36960
  return null;
36924
- return traceSegmentInternal(decoded[line], map._decodedMemo, line, column, GREATEST_LOWER_BOUND);
36961
+ const segments = decoded[line];
36962
+ const index = traceSegmentInternal(segments, map._decodedMemo, line, column, GREATEST_LOWER_BOUND);
36963
+ return index === -1 ? null : segments[index];
36925
36964
  };
36926
36965
  exports3.originalPositionFor = (map, { line, column, bias }) => {
36927
36966
  line--;
@@ -36932,35 +36971,21 @@ var require_trace_mapping_umd = __commonJS({
36932
36971
  const decoded = exports3.decodedMappings(map);
36933
36972
  if (line >= decoded.length)
36934
36973
  return OMapping(null, null, null, null);
36935
- const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);
36936
- if (segment == null)
36974
+ const segments = decoded[line];
36975
+ const index = traceSegmentInternal(segments, map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);
36976
+ if (index === -1)
36937
36977
  return OMapping(null, null, null, null);
36938
- if (segment.length == 1)
36978
+ const segment = segments[index];
36979
+ if (segment.length === 1)
36939
36980
  return OMapping(null, null, null, null);
36940
36981
  const { names, resolvedSources } = map;
36941
36982
  return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
36942
36983
  };
36984
+ exports3.allGeneratedPositionsFor = (map, { source, line, column }) => {
36985
+ return generatedPosition(map, source, line, column, ALL_BOUND);
36986
+ };
36943
36987
  exports3.generatedPositionFor = (map, { source, line, column, bias }) => {
36944
- line--;
36945
- if (line < 0)
36946
- throw new Error(LINE_GTR_ZERO);
36947
- if (column < 0)
36948
- throw new Error(COL_GTR_EQ_ZERO);
36949
- const { sources, resolvedSources } = map;
36950
- let sourceIndex = sources.indexOf(source);
36951
- if (sourceIndex === -1)
36952
- sourceIndex = resolvedSources.indexOf(source);
36953
- if (sourceIndex === -1)
36954
- return GMapping(null, null);
36955
- const generated = map._bySources || (map._bySources = buildBySources(exports3.decodedMappings(map), map._bySourceMemos = sources.map(memoizedState)));
36956
- const memos = map._bySourceMemos;
36957
- const segments = generated[sourceIndex][line];
36958
- if (segments == null)
36959
- return GMapping(null, null);
36960
- const segment = traceSegmentInternal(segments, memos[sourceIndex], line, column, bias || GREATEST_LOWER_BOUND);
36961
- if (segment == null)
36962
- return GMapping(null, null);
36963
- return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);
36988
+ return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND);
36964
36989
  };
36965
36990
  exports3.eachMapping = (map, cb2) => {
36966
36991
  const decoded = exports3.decodedMappings(map);
@@ -37003,35 +37028,53 @@ var require_trace_mapping_umd = __commonJS({
37003
37028
  return index === -1 ? null : sourcesContent[index];
37004
37029
  };
37005
37030
  exports3.presortedDecodedMap = (map, mapUrl) => {
37006
- const clone = Object.assign({}, map);
37007
- clone.mappings = [];
37008
- const tracer = new TraceMap(clone, mapUrl);
37031
+ const tracer = new TraceMap(clone(map, []), mapUrl);
37009
37032
  tracer._decoded = map.mappings;
37010
37033
  return tracer;
37011
37034
  };
37012
37035
  exports3.decodedMap = (map) => {
37013
- return {
37014
- version: 3,
37015
- file: map.file,
37016
- names: map.names,
37017
- sourceRoot: map.sourceRoot,
37018
- sources: map.sources,
37019
- sourcesContent: map.sourcesContent,
37020
- mappings: exports3.decodedMappings(map)
37021
- };
37036
+ return clone(map, exports3.decodedMappings(map));
37022
37037
  };
37023
37038
  exports3.encodedMap = (map) => {
37024
- return {
37025
- version: 3,
37026
- file: map.file,
37027
- names: map.names,
37028
- sourceRoot: map.sourceRoot,
37029
- sources: map.sources,
37030
- sourcesContent: map.sourcesContent,
37031
- mappings: exports3.encodedMappings(map)
37032
- };
37039
+ return clone(map, exports3.encodedMappings(map));
37033
37040
  };
37041
+ function generatedPosition(map, source, line, column, bias) {
37042
+ line--;
37043
+ if (line < 0)
37044
+ throw new Error(LINE_GTR_ZERO);
37045
+ if (column < 0)
37046
+ throw new Error(COL_GTR_EQ_ZERO);
37047
+ const { sources, resolvedSources } = map;
37048
+ let sourceIndex = sources.indexOf(source);
37049
+ if (sourceIndex === -1)
37050
+ sourceIndex = resolvedSources.indexOf(source);
37051
+ if (sourceIndex === -1)
37052
+ return bias === ALL_BOUND ? [] : GMapping(null, null);
37053
+ const generated = map._bySources || (map._bySources = buildBySources(exports3.decodedMappings(map), map._bySourceMemos = sources.map(memoizedState)));
37054
+ const segments = generated[sourceIndex][line];
37055
+ if (segments == null)
37056
+ return bias === ALL_BOUND ? [] : GMapping(null, null);
37057
+ const memo = map._bySourceMemos[sourceIndex];
37058
+ if (bias === ALL_BOUND)
37059
+ return sliceGeneratedPositions(segments, memo, line, column);
37060
+ const index = traceSegmentInternal(segments, memo, line, column, bias);
37061
+ if (index === -1)
37062
+ return GMapping(null, null);
37063
+ const segment = segments[index];
37064
+ return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);
37065
+ }
37034
37066
  })();
37067
+ function clone(map, mappings) {
37068
+ return {
37069
+ version: map.version,
37070
+ file: map.file,
37071
+ names: map.names,
37072
+ sourceRoot: map.sourceRoot,
37073
+ sources: map.sources,
37074
+ sourcesContent: map.sourcesContent,
37075
+ mappings
37076
+ };
37077
+ }
37035
37078
  function OMapping(source, line, column, name) {
37036
37079
  return { source, line, column, name };
37037
37080
  }
@@ -37045,8 +37088,23 @@ var require_trace_mapping_umd = __commonJS({
37045
37088
  } else if (bias === LEAST_UPPER_BOUND)
37046
37089
  index++;
37047
37090
  if (index === -1 || index === segments.length)
37048
- return null;
37049
- return segments[index];
37091
+ return -1;
37092
+ return index;
37093
+ }
37094
+ function sliceGeneratedPositions(segments, memo, line, column) {
37095
+ let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);
37096
+ if (min === -1)
37097
+ return [];
37098
+ const matchedColumn = found ? column : segments[min][COLUMN];
37099
+ if (!found)
37100
+ min = lowerBound(segments, matchedColumn, min);
37101
+ const max = upperBound(segments, matchedColumn, min);
37102
+ const result = [];
37103
+ for (; min <= max; min++) {
37104
+ const segment = segments[min];
37105
+ result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));
37106
+ }
37107
+ return result;
37050
37108
  }
37051
37109
  exports3.AnyMap = AnyMap;
37052
37110
  exports3.GREATEST_LOWER_BOUND = GREATEST_LOWER_BOUND;
@@ -1,7 +1,7 @@
1
1
  import dedent from 'dedent';
2
2
  import React from 'react';
3
3
  import { Alert, Stack, Strong, Text, TextLink } from '../lib/components';
4
- import { globalHeadingStyle } from '../lib/hooks/typography';
4
+ import { globalHeadingStyle } from '../lib/css/globalTypographyStyles';
5
5
  import source from '../lib/utils/source.macro';
6
6
  import Code from '../../../site/src/App/Code/Code';
7
7
  import { CssDoc } from '../../../site/src/types';
@@ -1,7 +1,7 @@
1
1
  import dedent from 'dedent';
2
2
  import React from 'react';
3
3
  import { Alert, Stack, Strong, Text, TextLink } from '../lib/components';
4
- import { globalTextStyle } from '../lib/hooks/typography';
4
+ import { globalTextStyle } from '../lib/css/globalTypographyStyles';
5
5
  import source from '../lib/utils/source.macro';
6
6
  import Code from '../../../site/src/App/Code/Code';
7
7
  import { CssDoc } from '../../../site/src/types';
package/css/index.ts CHANGED
@@ -3,7 +3,10 @@ import { atoms as internalAtoms, Atoms } from '../lib/css/atoms/atoms';
3
3
  import { colorModeStyle } from '../lib/css/colorModeStyle';
4
4
  import { responsiveStyle } from '../lib/css/responsiveStyle';
5
5
  import { breakpoints } from '../lib/css/breakpoints';
6
- import { globalHeadingStyle, globalTextStyle } from '../lib/hooks/typography';
6
+ import {
7
+ globalHeadingStyle,
8
+ globalTextStyle,
9
+ } from '../lib/css/globalTypographyStyles';
7
10
  import type { Breakpoint } from '../lib/css/breakpoints';
8
11
 
9
12
  const {
@@ -35,7 +35,7 @@ const docs: ComponentDocs = {
35
35
  accessibility: (
36
36
  <Text>
37
37
  Follows the{' '}
38
- <TextLink href="https://www.w3.org/TR/wai-aria-practices/#disclosure">
38
+ <TextLink href="https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/">
39
39
  WAI-ARIA Disclosure Pattern.
40
40
  </TextLink>
41
41
  </Text>
@@ -33,7 +33,7 @@ const docs: ComponentDocs = {
33
33
  accessibility: (
34
34
  <Text>
35
35
  Follows the{' '}
36
- <TextLink href="https://www.w3.org/TR/wai-aria-practices/#alert">
36
+ <TextLink href="https://www.w3.org/WAI/ARIA/apg/patterns/alert/">
37
37
  WAI-ARIA Alert Pattern
38
38
  </TextLink>
39
39
  , announcing messages with a{' '}
@@ -26,7 +26,8 @@ import {
26
26
  } from '../private/Field/Field';
27
27
  import { ButtonIcon } from '../ButtonIcon/ButtonIcon';
28
28
  import { IconClear } from '../icons';
29
- import { touchableText, useText } from '../../hooks/typography';
29
+ import { textStyles } from '../../css/typography';
30
+ import { touchableText } from '../../css/typography.css';
30
31
  import { getNextIndex } from '../private/getNextIndex';
31
32
  import { normalizeKey } from '../private/normalizeKey';
32
33
  import { ClearField } from '../private/Field/ClearField';
@@ -202,7 +203,7 @@ function GroupHeading({ children }: GroupHeadingProps) {
202
203
  className={[
203
204
  styles.groupHeading,
204
205
  touchableText.xsmall,
205
- useText({
206
+ textStyles({
206
207
  size: 'xsmall',
207
208
  baseline: false,
208
209
  weight: 'strong',
@@ -8,7 +8,7 @@ import {
8
8
  } from './BackgroundContext';
9
9
  import { BoxBackgroundVariant, BoxProps } from './Box';
10
10
  import { Background, BoxShadow } from '../../css/atoms/atomicProperties';
11
- import * as typographyStyles from '../../hooks/typography/typography.css';
11
+ import * as typographyStyles from '../../css/typography.css';
12
12
 
13
13
  export interface ColoredBoxProps extends BoxProps {
14
14
  component: NonNullable<BoxProps['component']>;
@@ -13,7 +13,7 @@ export const BraidPortal = ({ children, container }: BraidPortalProps) => {
13
13
  const { vanillaTheme } = useBraidTheme();
14
14
 
15
15
  return createPortal(
16
- <TextContext.Provider value={false}>
16
+ <TextContext.Provider value={null}>
17
17
  <VanillaThemeContainer theme={vanillaTheme} setDefaultTextTones>
18
18
  {children}
19
19
  </VanillaThemeContainer>
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
 
3
- import * as typographyStyles from '../../hooks/typography/typography.css';
3
+ import * as typographyStyles from '../../css/typography.css';
4
4
 
5
5
  interface Props {
6
6
  children: ReactNode;
@@ -8,7 +8,7 @@ import React, {
8
8
  ReactElement,
9
9
  cloneElement,
10
10
  } from 'react';
11
- import { touchableText } from '../../hooks/typography';
11
+ import { touchableText } from '../../css/typography.css';
12
12
  import { Box, BoxBackgroundVariant, BoxProps } from '../Box/Box';
13
13
  import buildDataAttributes, {
14
14
  DataAttributeMap,
@@ -39,7 +39,7 @@ const docs: ComponentDocs = {
39
39
  <>
40
40
  <Text>
41
41
  Follows the{' '}
42
- <TextLink href="https://www.w3.org/TR/wai-aria-practices/#button">
42
+ <TextLink href="https://www.w3.org/WAI/ARIA/apg/patterns/button/">
43
43
  WAI-ARIA Button Pattern
44
44
  </TextLink>
45
45
  .
@@ -34,7 +34,7 @@ const docs: ComponentDocs = {
34
34
  accessibility: (
35
35
  <Text>
36
36
  Follows the{' '}
37
- <TextLink href="https://www.w3.org/TR/wai-aria-practices/#checkbox">
37
+ <TextLink href="https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/">
38
38
  WAI-ARIA Checkbox Pattern
39
39
  </TextLink>
40
40
  , supporting both dual-state and tri-state specifications.
@@ -41,7 +41,7 @@ const docs: ComponentDocs = {
41
41
  <>
42
42
  <Text>
43
43
  Follows the{' '}
44
- <TextLink href="https://www.w3.org/TR/wai-aria-practices-1.2/#dialog_modal">
44
+ <TextLink href="https://www.w3.org/WAI/ARIA/apg/patterns/dialogmodal/">
45
45
  WAI-ARIA Dialog (Modal) Pattern.
46
46
  </TextLink>
47
47
  </Text>
@@ -19,7 +19,7 @@ const docs: ComponentDocs = {
19
19
  accessibility: (
20
20
  <Text>
21
21
  Follows the{' '}
22
- <TextLink href="https://www.w3.org/TR/wai-aria-practices/#disclosure">
22
+ <TextLink href="https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/">
23
23
  WAI-ARIA Disclosure Pattern.
24
24
  </TextLink>
25
25
  </Text>
@@ -53,7 +53,7 @@ const docs: ComponentDocs = {
53
53
  <>
54
54
  <Text>
55
55
  Follows the{' '}
56
- <TextLink href="https://www.w3.org/TR/wai-aria-practices-1.2/#dialog_modal">
56
+ <TextLink href="https://www.w3.org/WAI/ARIA/apg/patterns/dialogmodal/">
57
57
  WAI-ARIA Dialog (Modal) Pattern.
58
58
  </TextLink>
59
59
  </Text>
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import source from '../../utils/source.macro';
3
3
  import { ComponentDocs } from '../../../../../site/src/types';
4
- import { Box, Heading, Stack, Text, Strong } from '../';
5
- import { TextLink } from '../TextLink/TextLink';
4
+ import { Box, Heading, Stack, Text, Strong, TextLink } from '../';
6
5
 
7
6
  const docs: ComponentDocs = {
8
7
  category: 'Content',