@ory/elements-react 1.0.0-next.3 → 1.0.0-next.4

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.
@@ -599,9 +599,11 @@ function parseDateTimeSkeleton(skeleton) {
599
599
  skeleton.replace(DATE_TIME_REGEX, function(match) {
600
600
  var len = match.length;
601
601
  switch (match[0]) {
602
+ // Era
602
603
  case "G":
603
604
  result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
604
605
  break;
606
+ // Year
605
607
  case "y":
606
608
  result.year = len === 2 ? "2-digit" : "numeric";
607
609
  break;
@@ -610,13 +612,16 @@ function parseDateTimeSkeleton(skeleton) {
610
612
  case "U":
611
613
  case "r":
612
614
  throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
615
+ // Quarter
613
616
  case "q":
614
617
  case "Q":
615
618
  throw new RangeError("`q/Q` (quarter) patterns are not supported");
619
+ // Month
616
620
  case "M":
617
621
  case "L":
618
622
  result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1];
619
623
  break;
624
+ // Week
620
625
  case "w":
621
626
  case "W":
622
627
  throw new RangeError("`w/W` (week) patterns are not supported");
@@ -627,6 +632,7 @@ function parseDateTimeSkeleton(skeleton) {
627
632
  case "F":
628
633
  case "g":
629
634
  throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
635
+ // Weekday
630
636
  case "E":
631
637
  result.weekday = len === 4 ? "short" : len === 5 ? "narrow" : "short";
632
638
  break;
@@ -642,12 +648,15 @@ function parseDateTimeSkeleton(skeleton) {
642
648
  }
643
649
  result.weekday = ["short", "long", "narrow", "short"][len - 4];
644
650
  break;
651
+ // Period
645
652
  case "a":
646
653
  result.hour12 = true;
647
654
  break;
648
655
  case "b":
656
+ // am, pm, noon, midnight
649
657
  case "B":
650
658
  throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
659
+ // Hour
651
660
  case "h":
652
661
  result.hourCycle = "h12";
653
662
  result.hour = ["numeric", "2-digit"][len - 1];
@@ -668,23 +677,31 @@ function parseDateTimeSkeleton(skeleton) {
668
677
  case "J":
669
678
  case "C":
670
679
  throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
680
+ // Minute
671
681
  case "m":
672
682
  result.minute = ["numeric", "2-digit"][len - 1];
673
683
  break;
684
+ // Second
674
685
  case "s":
675
686
  result.second = ["numeric", "2-digit"][len - 1];
676
687
  break;
677
688
  case "S":
678
689
  case "A":
679
690
  throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
691
+ // Zone
680
692
  case "z":
681
693
  result.timeZoneName = len < 4 ? "short" : "long";
682
694
  break;
683
695
  case "Z":
696
+ // 1..3, 4, 5: The ISO8601 varios formats
684
697
  case "O":
698
+ // 1, 4: miliseconds in day short, long
685
699
  case "v":
700
+ // 1, 4: generic non-location format
686
701
  case "V":
702
+ // 1, 2, 3, 4: time zone ID or city
687
703
  case "X":
704
+ // 1, 2, 3, 4: The ISO8601 varios formats
688
705
  case "x":
689
706
  throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
690
707
  }
@@ -882,6 +899,7 @@ function parseNumberSkeleton(tokens) {
882
899
  case "notation-simple":
883
900
  result.notation = "standard";
884
901
  continue;
902
+ // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
885
903
  case "unit-width-narrow":
886
904
  result.currencyDisplay = "narrowSymbol";
887
905
  result.unitDisplay = "narrow";
@@ -900,6 +918,7 @@ function parseNumberSkeleton(tokens) {
900
918
  case "scale":
901
919
  result.scale = parseFloat(token.options[0]);
902
920
  continue;
921
+ // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
903
922
  case "integer-width":
904
923
  if (token.options.length > 1) {
905
924
  throw new RangeError("integer-width stems only accept a single optional option");
@@ -2662,6 +2681,7 @@ var Parser = (
2662
2681
  this.bump();
2663
2682
  this.bump();
2664
2683
  return "'";
2684
+ // '{', '<', '>', '}'
2665
2685
  case 123:
2666
2686
  case 60:
2667
2687
  case 62:
@@ -2727,6 +2747,7 @@ var Parser = (
2727
2747
  return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
2728
2748
  }
2729
2749
  switch (this.char()) {
2750
+ // Simple argument: `{name}`
2730
2751
  case 125: {
2731
2752
  this.bump();
2732
2753
  return {
@@ -2739,6 +2760,7 @@ var Parser = (
2739
2760
  err: null
2740
2761
  };
2741
2762
  }
2763
+ // Argument with options: `{name, format, ...}`
2742
2764
  case 44: {
2743
2765
  this.bump();
2744
2766
  this.bumpSpace();
@@ -4012,9 +4034,11 @@ function parseDateTimeSkeleton2(skeleton) {
4012
4034
  skeleton.replace(DATE_TIME_REGEX2, function(match) {
4013
4035
  var len = match.length;
4014
4036
  switch (match[0]) {
4037
+ // Era
4015
4038
  case "G":
4016
4039
  result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
4017
4040
  break;
4041
+ // Year
4018
4042
  case "y":
4019
4043
  result.year = len === 2 ? "2-digit" : "numeric";
4020
4044
  break;
@@ -4023,13 +4047,16 @@ function parseDateTimeSkeleton2(skeleton) {
4023
4047
  case "U":
4024
4048
  case "r":
4025
4049
  throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
4050
+ // Quarter
4026
4051
  case "q":
4027
4052
  case "Q":
4028
4053
  throw new RangeError("`q/Q` (quarter) patterns are not supported");
4054
+ // Month
4029
4055
  case "M":
4030
4056
  case "L":
4031
4057
  result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1];
4032
4058
  break;
4059
+ // Week
4033
4060
  case "w":
4034
4061
  case "W":
4035
4062
  throw new RangeError("`w/W` (week) patterns are not supported");
@@ -4040,6 +4067,7 @@ function parseDateTimeSkeleton2(skeleton) {
4040
4067
  case "F":
4041
4068
  case "g":
4042
4069
  throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
4070
+ // Weekday
4043
4071
  case "E":
4044
4072
  result.weekday = len === 4 ? "short" : len === 5 ? "narrow" : "short";
4045
4073
  break;
@@ -4055,12 +4083,15 @@ function parseDateTimeSkeleton2(skeleton) {
4055
4083
  }
4056
4084
  result.weekday = ["short", "long", "narrow", "short"][len - 4];
4057
4085
  break;
4086
+ // Period
4058
4087
  case "a":
4059
4088
  result.hour12 = true;
4060
4089
  break;
4061
4090
  case "b":
4091
+ // am, pm, noon, midnight
4062
4092
  case "B":
4063
4093
  throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
4094
+ // Hour
4064
4095
  case "h":
4065
4096
  result.hourCycle = "h12";
4066
4097
  result.hour = ["numeric", "2-digit"][len - 1];
@@ -4081,23 +4112,31 @@ function parseDateTimeSkeleton2(skeleton) {
4081
4112
  case "J":
4082
4113
  case "C":
4083
4114
  throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
4115
+ // Minute
4084
4116
  case "m":
4085
4117
  result.minute = ["numeric", "2-digit"][len - 1];
4086
4118
  break;
4119
+ // Second
4087
4120
  case "s":
4088
4121
  result.second = ["numeric", "2-digit"][len - 1];
4089
4122
  break;
4090
4123
  case "S":
4091
4124
  case "A":
4092
4125
  throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
4126
+ // Zone
4093
4127
  case "z":
4094
4128
  result.timeZoneName = len < 4 ? "short" : "long";
4095
4129
  break;
4096
4130
  case "Z":
4131
+ // 1..3, 4, 5: The ISO8601 varios formats
4097
4132
  case "O":
4133
+ // 1, 4: miliseconds in day short, long
4098
4134
  case "v":
4135
+ // 1, 4: generic non-location format
4099
4136
  case "V":
4137
+ // 1, 2, 3, 4: time zone ID or city
4100
4138
  case "X":
4139
+ // 1, 2, 3, 4: The ISO8601 varios formats
4101
4140
  case "x":
4102
4141
  throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
4103
4142
  }
@@ -4295,6 +4334,7 @@ function parseNumberSkeleton2(tokens) {
4295
4334
  case "notation-simple":
4296
4335
  result.notation = "standard";
4297
4336
  continue;
4337
+ // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
4298
4338
  case "unit-width-narrow":
4299
4339
  result.currencyDisplay = "narrowSymbol";
4300
4340
  result.unitDisplay = "narrow";
@@ -4313,6 +4353,7 @@ function parseNumberSkeleton2(tokens) {
4313
4353
  case "scale":
4314
4354
  result.scale = parseFloat(token.options[0]);
4315
4355
  continue;
4356
+ // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
4316
4357
  case "integer-width":
4317
4358
  if (token.options.length > 1) {
4318
4359
  throw new RangeError("integer-width stems only accept a single optional option");
@@ -6075,6 +6116,7 @@ var Parser2 = (
6075
6116
  this.bump();
6076
6117
  this.bump();
6077
6118
  return "'";
6119
+ // '{', '<', '>', '}'
6078
6120
  case 123:
6079
6121
  case 60:
6080
6122
  case 62:
@@ -6140,6 +6182,7 @@ var Parser2 = (
6140
6182
  return this.error(ErrorKind2.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation2(openingBracePosition, this.clonePosition()));
6141
6183
  }
6142
6184
  switch (this.char()) {
6185
+ // Simple argument: `{name}`
6143
6186
  case 125: {
6144
6187
  this.bump();
6145
6188
  return {
@@ -6152,6 +6195,7 @@ var Parser2 = (
6152
6195
  err: null
6153
6196
  };
6154
6197
  }
6198
+ // Argument with options: `{name, format, ...}`
6155
6199
  case 44: {
6156
6200
  this.bump();
6157
6201
  this.bumpSpace();
@@ -10053,8 +10097,7 @@ function DefaultCurrentIdentifierButton({
10053
10097
  }) {
10054
10098
  return /* @__PURE__ */ jsxs26("div", { children: [
10055
10099
  /* @__PURE__ */ jsx44("span", { className: "py-1 px-3 rounded-full border border-button-identifier-border-default bg-button-identifier-bg-default", children: /* @__PURE__ */ jsx44("span", { className: "text-sm font-medium leading-none", children: attributes.value }) }),
10056
- /* @__PURE__ */ jsx44(DefaultInput, { attributes, node, onClick: () => {
10057
- } })
10100
+ /* @__PURE__ */ jsx44(DefaultInput, { attributes, node })
10058
10101
  ] });
10059
10102
  }
10060
10103