@procore/globalization-toolkit 3.1.0 → 3.3.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.
Files changed (95) hide show
  1. package/.depcheckrc +2 -1
  2. package/CHANGELOG.md +13 -0
  3. package/README.md +116 -33
  4. package/dist/getOverrideLocale/GetOverrideLocale.d.ts +3 -0
  5. package/dist/getOverrideLocale/GetOverrideLocale.js +54 -0
  6. package/dist/getOverrideLocale/GetOverrideLocale.js.map +1 -0
  7. package/dist/getOverrideLocale/GetOverrideLocale.types.d.ts +1 -0
  8. package/dist/getOverrideLocale/GetOverrideLocale.types.js +3 -0
  9. package/dist/getOverrideLocale/GetOverrideLocale.types.js.map +1 -0
  10. package/dist/getTranslationsFromLocale/GetTranslationsFromLocale.d.ts +6 -0
  11. package/dist/getTranslationsFromLocale/GetTranslationsFromLocale.js +27 -0
  12. package/dist/getTranslationsFromLocale/GetTranslationsFromLocale.js.map +1 -0
  13. package/dist/index.d.ts +2 -0
  14. package/dist/index.js +6 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/tsconfig.build.tsbuildinfo +1 -1
  17. package/docs/assets/icons.js +18 -0
  18. package/docs/assets/icons.svg +1 -0
  19. package/docs/assets/main.js +5 -4
  20. package/docs/assets/navigation.js +1 -1
  21. package/docs/assets/search.js +1 -1
  22. package/docs/assets/style.css +110 -45
  23. package/docs/classes/CurrencyFormatter.html +20 -20
  24. package/docs/classes/DateTimeFormatter.html +17 -13
  25. package/docs/classes/NumberFormatter.html +17 -17
  26. package/docs/functions/formatCurrency.html +4 -4
  27. package/docs/functions/formatCurrencyToParts.html +4 -4
  28. package/docs/functions/formatDateTime.html +4 -4
  29. package/docs/functions/formatDateTimeToLocalISOString.html +5 -0
  30. package/docs/functions/formatDateTimeToParts.html +4 -4
  31. package/docs/functions/formatNumber.html +4 -4
  32. package/docs/functions/formatNumberToParts.html +4 -4
  33. package/docs/functions/getCurrencySeparators.html +3 -3
  34. package/docs/functions/getDatePartsWithPlaceholders.html +4 -4
  35. package/docs/functions/getDatePlaceholder.html +4 -4
  36. package/docs/functions/getFallbackLocaleList.html +4 -0
  37. package/docs/functions/getNumberSeparators.html +3 -3
  38. package/docs/functions/getOverrideLocale.html +6 -0
  39. package/docs/functions/getStartDayOfTheWeek.html +3 -3
  40. package/docs/functions/getSupportedCurrencies.html +3 -3
  41. package/docs/functions/parseCurrency.html +4 -4
  42. package/docs/functions/parseNumber.html +4 -4
  43. package/docs/index.html +203 -128
  44. package/docs/interfaces/CurrencyOptions.html +8 -8
  45. package/docs/interfaces/DateTimeOptionsBasic.html +4 -4
  46. package/docs/interfaces/DateTimeOptionsComponentsAll.html +14 -14
  47. package/docs/interfaces/DateTimeOptionsComponentsHourMinute.html +14 -14
  48. package/docs/interfaces/DateTimeOptionsComponentsHourMinuteSecond.html +14 -14
  49. package/docs/interfaces/DateTimeOptionsComponentsMonthDay.html +14 -14
  50. package/docs/interfaces/DateTimeOptionsComponentsWeekdayYearMonthDay.html +14 -14
  51. package/docs/interfaces/DateTimeOptionsComponentsYearMonth.html +14 -14
  52. package/docs/interfaces/DateTimeOptionsComponentsYearMonthDay.html +14 -14
  53. package/docs/interfaces/DateTimeOptionsStyle.html +14 -14
  54. package/docs/interfaces/NumberOptions.html +6 -6
  55. package/docs/modules.html +69 -66
  56. package/docs/types/CurrencyDisplay.html +1 -1
  57. package/docs/types/CurrencySign.html +1 -1
  58. package/docs/types/DateLabelOptions.html +1 -1
  59. package/docs/types/DateStyle.html +1 -1
  60. package/docs/types/DateTimeFormatPart.html +1 -1
  61. package/docs/types/DateTimeOptions.html +1 -1
  62. package/docs/types/DateTimeStyle.html +1 -1
  63. package/docs/types/Day.html +1 -1
  64. package/docs/types/FormatterOptions.html +1 -1
  65. package/docs/types/Hour.html +1 -1
  66. package/docs/types/Locale.html +1 -1
  67. package/docs/types/Minute.html +1 -1
  68. package/docs/types/Month.html +1 -1
  69. package/docs/types/NumberFormatPart.html +1 -1
  70. package/docs/types/NumericTwoDigit.html +1 -1
  71. package/docs/types/Percent.html +1 -1
  72. package/docs/types/Second.html +1 -1
  73. package/docs/types/Separators.html +1 -1
  74. package/docs/types/TimeStyle.html +1 -1
  75. package/docs/types/TimeZoneName.html +1 -1
  76. package/docs/types/Weekday.html +1 -1
  77. package/docs/types/Year.html +1 -1
  78. package/docs/variables/CurrencyDisplay-1.html +1 -1
  79. package/docs/variables/CurrencySign-1.html +1 -1
  80. package/docs/variables/DateStyle-1.html +1 -1
  81. package/docs/variables/DateTimeStyle-1.html +1 -1
  82. package/docs/variables/Day-1.html +1 -1
  83. package/docs/variables/Hour-1.html +1 -1
  84. package/docs/variables/Minute-1.html +1 -1
  85. package/docs/variables/Month-1.html +1 -1
  86. package/docs/variables/NumericTwoDigit-1.html +1 -1
  87. package/docs/variables/Percent-1.html +1 -1
  88. package/docs/variables/Second-1.html +1 -1
  89. package/docs/variables/TimeStyle-1.html +1 -1
  90. package/docs/variables/TimeZoneName-1.html +1 -1
  91. package/docs/variables/Weekday-1.html +1 -1
  92. package/docs/variables/Year-1.html +1 -1
  93. package/package.json +12 -8
  94. package/sonar-project.properties +1 -1
  95. package/tsconfig.build.json +2 -1
@@ -10,7 +10,9 @@
10
10
  --light-color-text: #222;
11
11
  --light-color-text-aside: #6e6e6e;
12
12
  --light-color-link: #1f70c2;
13
+ --light-color-focus-outline: #3584e4;
13
14
 
15
+ --light-color-ts-keyword: #056bd6;
14
16
  --light-color-ts-project: #b111c9;
15
17
  --light-color-ts-module: var(--light-color-ts-project);
16
18
  --light-color-ts-namespace: var(--light-color-ts-project);
@@ -28,12 +30,13 @@
28
30
  --light-color-ts-constructor-signature: var(--light-color-ts-constructor);
29
31
  --light-color-ts-parameter: var(--light-color-ts-variable);
30
32
  /* type literal not included as links will never be generated to it */
31
- --light-color-ts-type-parameter: var(--light-color-ts-type-alias);
33
+ --light-color-ts-type-parameter: #a55c0e;
32
34
  --light-color-ts-accessor: var(--light-color-ts-property);
33
35
  --light-color-ts-get-signature: var(--light-color-ts-accessor);
34
36
  --light-color-ts-set-signature: var(--light-color-ts-accessor);
35
37
  --light-color-ts-type-alias: #d51270;
36
38
  /* reference not included as links will be colored with the kind that it points to */
39
+ --light-color-document: #000000;
37
40
 
38
41
  --light-external-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='10' height='10'><path fill-opacity='0' stroke='%23000' stroke-width='10' d='m43,35H5v60h60V57M45,5v10l10,10-30,30 20,20 30-30 10,10h10V5z'/></svg>");
39
42
  --light-color-scheme: light;
@@ -49,7 +52,9 @@
49
52
  --dark-color-text: #f5f5f5;
50
53
  --dark-color-text-aside: #dddddd;
51
54
  --dark-color-link: #00aff4;
55
+ --dark-color-focus-outline: #4c97f2;
52
56
 
57
+ --dark-color-ts-keyword: #3399ff;
53
58
  --dark-color-ts-project: #e358ff;
54
59
  --dark-color-ts-module: var(--dark-color-ts-project);
55
60
  --dark-color-ts-namespace: var(--dark-color-ts-project);
@@ -67,12 +72,13 @@
67
72
  --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor);
68
73
  --dark-color-ts-parameter: var(--dark-color-ts-variable);
69
74
  /* type literal not included as links will never be generated to it */
70
- --dark-color-ts-type-parameter: var(--dark-color-ts-type-alias);
75
+ --dark-color-ts-type-parameter: #e07d13;
71
76
  --dark-color-ts-accessor: var(--dark-color-ts-property);
72
77
  --dark-color-ts-get-signature: var(--dark-color-ts-accessor);
73
78
  --dark-color-ts-set-signature: var(--dark-color-ts-accessor);
74
79
  --dark-color-ts-type-alias: #ff6492;
75
80
  /* reference not included as links will be colored with the kind that it points to */
81
+ --dark-color-document: #ffffff;
76
82
 
77
83
  --dark-external-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='10' height='10'><path fill-opacity='0' stroke='%23fff' stroke-width='10' d='m43,35H5v60h60V57M45,5v10l10,10-30,30 20,20 30-30 10,10h10V5z'/></svg>");
78
84
  --dark-color-scheme: dark;
@@ -90,7 +96,9 @@
90
96
  --color-text: var(--light-color-text);
91
97
  --color-text-aside: var(--light-color-text-aside);
92
98
  --color-link: var(--light-color-link);
99
+ --color-focus-outline: var(--light-color-focus-outline);
93
100
 
101
+ --color-ts-keyword: var(--light-color-ts-keyword);
94
102
  --color-ts-module: var(--light-color-ts-module);
95
103
  --color-ts-namespace: var(--light-color-ts-namespace);
96
104
  --color-ts-enum: var(--light-color-ts-enum);
@@ -113,6 +121,7 @@
113
121
  --color-ts-get-signature: var(--light-color-ts-get-signature);
114
122
  --color-ts-set-signature: var(--light-color-ts-set-signature);
115
123
  --color-ts-type-alias: var(--light-color-ts-type-alias);
124
+ --color-document: var(--light-color-document);
116
125
 
117
126
  --external-icon: var(--light-external-icon);
118
127
  --color-scheme: var(--light-color-scheme);
@@ -131,7 +140,9 @@
131
140
  --color-text: var(--dark-color-text);
132
141
  --color-text-aside: var(--dark-color-text-aside);
133
142
  --color-link: var(--dark-color-link);
143
+ --color-focus-outline: var(--dark-color-focus-outline);
134
144
 
145
+ --color-ts-keyword: var(--dark-color-ts-keyword);
135
146
  --color-ts-module: var(--dark-color-ts-module);
136
147
  --color-ts-namespace: var(--dark-color-ts-namespace);
137
148
  --color-ts-enum: var(--dark-color-ts-enum);
@@ -154,6 +165,7 @@
154
165
  --color-ts-get-signature: var(--dark-color-ts-get-signature);
155
166
  --color-ts-set-signature: var(--dark-color-ts-set-signature);
156
167
  --color-ts-type-alias: var(--dark-color-ts-type-alias);
168
+ --color-document: var(--dark-color-document);
157
169
 
158
170
  --external-icon: var(--dark-external-icon);
159
171
  --color-scheme: var(--dark-color-scheme);
@@ -179,7 +191,9 @@ body {
179
191
  --color-text: var(--light-color-text);
180
192
  --color-text-aside: var(--light-color-text-aside);
181
193
  --color-link: var(--light-color-link);
194
+ --color-focus-outline: var(--light-color-focus-outline);
182
195
 
196
+ --color-ts-keyword: var(--light-color-ts-keyword);
183
197
  --color-ts-module: var(--light-color-ts-module);
184
198
  --color-ts-namespace: var(--light-color-ts-namespace);
185
199
  --color-ts-enum: var(--light-color-ts-enum);
@@ -202,6 +216,7 @@ body {
202
216
  --color-ts-get-signature: var(--light-color-ts-get-signature);
203
217
  --color-ts-set-signature: var(--light-color-ts-set-signature);
204
218
  --color-ts-type-alias: var(--light-color-ts-type-alias);
219
+ --color-document: var(--light-color-document);
205
220
 
206
221
  --external-icon: var(--light-external-icon);
207
222
  --color-scheme: var(--light-color-scheme);
@@ -218,7 +233,9 @@ body {
218
233
  --color-text: var(--dark-color-text);
219
234
  --color-text-aside: var(--dark-color-text-aside);
220
235
  --color-link: var(--dark-color-link);
236
+ --color-focus-outline: var(--dark-color-focus-outline);
221
237
 
238
+ --color-ts-keyword: var(--dark-color-ts-keyword);
222
239
  --color-ts-module: var(--dark-color-ts-module);
223
240
  --color-ts-namespace: var(--dark-color-ts-namespace);
224
241
  --color-ts-enum: var(--dark-color-ts-enum);
@@ -241,11 +258,17 @@ body {
241
258
  --color-ts-get-signature: var(--dark-color-ts-get-signature);
242
259
  --color-ts-set-signature: var(--dark-color-ts-set-signature);
243
260
  --color-ts-type-alias: var(--dark-color-ts-type-alias);
261
+ --color-document: var(--dark-color-document);
244
262
 
245
263
  --external-icon: var(--dark-external-icon);
246
264
  --color-scheme: var(--dark-color-scheme);
247
265
  }
248
266
 
267
+ *:focus-visible,
268
+ .tsd-accordion-summary:focus-visible svg {
269
+ outline: 2px solid var(--color-focus-outline);
270
+ }
271
+
249
272
  .always-visible,
250
273
  .always-visible .tsd-signatures {
251
274
  display: inherit !important;
@@ -260,16 +283,6 @@ h6 {
260
283
  line-height: 1.2;
261
284
  }
262
285
 
263
- h1 > a,
264
- h2 > a,
265
- h3 > a,
266
- h4 > a,
267
- h5 > a,
268
- h6 > a {
269
- text-decoration: none;
270
- color: var(--color-text);
271
- }
272
-
273
286
  h1 {
274
287
  font-size: 1.875rem;
275
288
  margin: 0.67rem 0;
@@ -300,10 +313,6 @@ h6 {
300
313
  margin: 2.33rem 0;
301
314
  }
302
315
 
303
- .uppercase {
304
- text-transform: uppercase;
305
- }
306
-
307
316
  dl,
308
317
  menu,
309
318
  ol,
@@ -321,17 +330,14 @@ dd {
321
330
  }
322
331
 
323
332
  /* Footer */
324
- .tsd-generator {
333
+ footer {
325
334
  border-top: 1px solid var(--color-accent);
326
335
  padding-top: 1rem;
327
336
  padding-bottom: 1rem;
328
337
  max-height: 3.5rem;
329
338
  }
330
-
331
- .tsd-generator > p {
332
- margin-top: 0;
333
- margin-bottom: 0;
334
- padding: 0 1rem;
339
+ footer > p {
340
+ margin: 0 1em;
335
341
  }
336
342
 
337
343
  .container-main {
@@ -399,7 +405,8 @@ dd {
399
405
  }
400
406
  body {
401
407
  background: var(--color-background);
402
- font-family: "Segoe UI", sans-serif;
408
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
409
+ Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
403
410
  font-size: 16px;
404
411
  color: var(--color-text);
405
412
  }
@@ -417,6 +424,9 @@ a.external[target="_blank"] {
417
424
  background-repeat: no-repeat;
418
425
  padding-right: 13px;
419
426
  }
427
+ a.tsd-anchor-link {
428
+ color: var(--color-text);
429
+ }
420
430
 
421
431
  code,
422
432
  pre {
@@ -576,13 +586,13 @@ dl.tsd-comment-tag-group p {
576
586
  }
577
587
  .tsd-filter-input {
578
588
  display: flex;
579
- width: fit-content;
580
589
  width: -moz-fit-content;
590
+ width: fit-content;
581
591
  align-items: center;
582
- user-select: none;
583
592
  -webkit-user-select: none;
584
593
  -moz-user-select: none;
585
594
  -ms-user-select: none;
595
+ user-select: none;
586
596
  cursor: pointer;
587
597
  }
588
598
  .tsd-filter-input input[type="checkbox"] {
@@ -605,11 +615,8 @@ dl.tsd-comment-tag-group p {
605
615
  Don't remove unless you know what you're doing. */
606
616
  opacity: 0.99;
607
617
  }
608
- .tsd-filter-input input[type="checkbox"]:focus + svg {
609
- transform: scale(0.95);
610
- }
611
- .tsd-filter-input input[type="checkbox"]:focus:not(:focus-visible) + svg {
612
- transform: scale(1);
618
+ .tsd-filter-input input[type="checkbox"]:focus-visible + svg {
619
+ outline: 2px solid var(--color-focus-outline);
613
620
  }
614
621
  .tsd-checkbox-background {
615
622
  fill: var(--color-accent);
@@ -626,13 +633,18 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark {
626
633
  stroke: var(--color-accent);
627
634
  }
628
635
 
629
- .tsd-theme-toggle {
630
- padding-top: 0.75rem;
636
+ .settings-label {
637
+ font-weight: bold;
638
+ text-transform: uppercase;
639
+ display: inline-block;
631
640
  }
632
- .tsd-theme-toggle > h4 {
633
- display: inline;
634
- vertical-align: middle;
635
- margin-right: 0.75rem;
641
+
642
+ .tsd-filter-visibility .settings-label {
643
+ margin: 0.75rem 0 0.5rem 0;
644
+ }
645
+
646
+ .tsd-theme-toggle .settings-label {
647
+ margin: 0.75rem 0.75rem 0 0;
636
648
  }
637
649
 
638
650
  .tsd-hierarchy {
@@ -643,6 +655,28 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark {
643
655
  font-weight: bold;
644
656
  }
645
657
 
658
+ .tsd-full-hierarchy:not(:last-child) {
659
+ margin-bottom: 1em;
660
+ padding-bottom: 1em;
661
+ border-bottom: 1px solid var(--color-accent);
662
+ }
663
+ .tsd-full-hierarchy,
664
+ .tsd-full-hierarchy ul {
665
+ list-style: none;
666
+ margin: 0;
667
+ padding: 0;
668
+ }
669
+ .tsd-full-hierarchy ul {
670
+ padding-left: 1.5rem;
671
+ }
672
+ .tsd-full-hierarchy a {
673
+ padding: 0.25rem 0 !important;
674
+ font-size: 1rem;
675
+ display: inline-flex;
676
+ align-items: center;
677
+ color: var(--color-text);
678
+ }
679
+
646
680
  .tsd-panel-group.tsd-index-group {
647
681
  margin-bottom: 0;
648
682
  }
@@ -708,12 +742,15 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark {
708
742
  }
709
743
  .tsd-navigation > a,
710
744
  .tsd-navigation .tsd-accordion-summary {
711
- width: calc(100% - 0.5rem);
745
+ width: calc(100% - 0.25rem);
746
+ display: flex;
747
+ align-items: center;
712
748
  }
713
749
  .tsd-navigation a,
714
750
  .tsd-navigation summary > span,
715
751
  .tsd-page-navigation a {
716
- display: inline-flex;
752
+ display: flex;
753
+ width: calc(100% - 0.25rem);
717
754
  align-items: center;
718
755
  padding: 0.25rem;
719
756
  color: var(--color-text);
@@ -740,6 +777,9 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark {
740
777
  padding: 0;
741
778
  max-width: 100%;
742
779
  }
780
+ .tsd-navigation .tsd-nav-link {
781
+ display: none;
782
+ }
743
783
  .tsd-nested-navigation {
744
784
  margin-left: 3rem;
745
785
  }
@@ -753,11 +793,15 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark {
753
793
  margin-left: -1.5rem;
754
794
  }
755
795
 
756
- .tsd-nested-navigation > li > a,
757
- .tsd-nested-navigation > li > span {
758
- width: calc(100% - 1.75rem - 0.5rem);
796
+ .tsd-page-navigation-section {
797
+ margin-left: 10px;
798
+ }
799
+ .tsd-page-navigation-section > summary {
800
+ padding: 0.25rem;
801
+ }
802
+ .tsd-page-navigation-section > div {
803
+ margin-left: 20px;
759
804
  }
760
-
761
805
  .tsd-page-navigation ul {
762
806
  padding-left: 1.75rem;
763
807
  }
@@ -788,10 +832,10 @@ a.tsd-index-link {
788
832
  }
789
833
  .tsd-accordion-summary,
790
834
  .tsd-accordion-summary a {
791
- user-select: none;
792
835
  -moz-user-select: none;
793
836
  -webkit-user-select: none;
794
837
  -ms-user-select: none;
838
+ user-select: none;
795
839
 
796
840
  cursor: pointer;
797
841
  }
@@ -804,8 +848,9 @@ a.tsd-index-link {
804
848
  padding-top: 0;
805
849
  padding-bottom: 0;
806
850
  }
807
- .tsd-index-accordion .tsd-accordion-summary > svg {
851
+ .tsd-accordion .tsd-accordion-summary > svg {
808
852
  margin-left: 0.25rem;
853
+ vertical-align: text-top;
809
854
  }
810
855
  .tsd-index-content > :not(:first-child) {
811
856
  margin-top: 0.75rem;
@@ -853,7 +898,7 @@ a.tsd-index-link {
853
898
  }
854
899
 
855
900
  .tsd-panel-group {
856
- margin: 4rem 0;
901
+ margin: 2rem 0;
857
902
  }
858
903
  .tsd-panel-group.tsd-index-group {
859
904
  margin: 2rem 0;
@@ -861,6 +906,9 @@ a.tsd-index-link {
861
906
  .tsd-panel-group.tsd-index-group details {
862
907
  margin: 2rem 0;
863
908
  }
909
+ .tsd-panel-group > .tsd-accordion-summary {
910
+ margin-bottom: 1rem;
911
+ }
864
912
 
865
913
  #tsd-search {
866
914
  transition: background-color 0.2s;
@@ -984,6 +1032,11 @@ a.tsd-index-link {
984
1032
  overflow-x: auto;
985
1033
  }
986
1034
 
1035
+ .tsd-signature-keyword {
1036
+ color: var(--color-ts-keyword);
1037
+ font-weight: normal;
1038
+ }
1039
+
987
1040
  .tsd-signature-symbol {
988
1041
  color: var(--color-text-aside);
989
1042
  font-weight: normal;
@@ -1005,6 +1058,12 @@ a.tsd-index-link {
1005
1058
  border-width: 1px 0;
1006
1059
  transition: background-color 0.1s;
1007
1060
  }
1061
+ .tsd-signatures .tsd-index-signature:not(:last-child) {
1062
+ margin-bottom: 1em;
1063
+ }
1064
+ .tsd-signatures .tsd-index-signature .tsd-signature {
1065
+ border-width: 1px;
1066
+ }
1008
1067
  .tsd-description .tsd-signatures .tsd-signature {
1009
1068
  border-width: 1px;
1010
1069
  }
@@ -1318,6 +1377,12 @@ img {
1318
1377
  .has-menu .tsd-navigation {
1319
1378
  max-height: 100%;
1320
1379
  }
1380
+ #tsd-toolbar-links {
1381
+ display: none;
1382
+ }
1383
+ .tsd-navigation .tsd-nav-link {
1384
+ display: flex;
1385
+ }
1321
1386
  }
1322
1387
 
1323
1388
  /* one sidebar */