@ory/elements-react 1.0.0-next.2 → 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.
- package/README.md +159 -7
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +41 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -13
- package/dist/index.mjs.map +1 -1
- package/dist/theme/default/index.d.mts +1 -1
- package/dist/theme/default/index.d.ts +1 -1
- package/dist/theme/default/index.js +69 -15
- package/dist/theme/default/index.js.map +1 -1
- package/dist/theme/default/index.mjs +79 -25
- package/dist/theme/default/index.mjs.map +1 -1
- package/package.json +11 -1
|
@@ -63,7 +63,7 @@ type HeadlessFormProps = ComponentPropsWithoutRef<"form"> & {
|
|
|
63
63
|
type HeadlessInputProps = {
|
|
64
64
|
attributes: UiNodeInputAttributes;
|
|
65
65
|
node: UiNode;
|
|
66
|
-
onClick
|
|
66
|
+
onClick?: MouseEventHandler;
|
|
67
67
|
};
|
|
68
68
|
type OryFlowComponents = OryFormComponents & OryCardComponents;
|
|
69
69
|
|
|
@@ -63,7 +63,7 @@ type HeadlessFormProps = ComponentPropsWithoutRef<"form"> & {
|
|
|
63
63
|
type HeadlessInputProps = {
|
|
64
64
|
attributes: UiNodeInputAttributes;
|
|
65
65
|
node: UiNode;
|
|
66
|
-
onClick
|
|
66
|
+
onClick?: MouseEventHandler;
|
|
67
67
|
};
|
|
68
68
|
type OryFlowComponents = OryFormComponents & OryCardComponents;
|
|
69
69
|
|
|
@@ -213,7 +213,7 @@ var require_react_is_development = __commonJS({
|
|
|
213
213
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
214
214
|
var Element = REACT_ELEMENT_TYPE;
|
|
215
215
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
216
|
-
var
|
|
216
|
+
var Fragment7 = REACT_FRAGMENT_TYPE;
|
|
217
217
|
var Lazy = REACT_LAZY_TYPE;
|
|
218
218
|
var Memo = REACT_MEMO_TYPE;
|
|
219
219
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -272,7 +272,7 @@ var require_react_is_development = __commonJS({
|
|
|
272
272
|
exports2.ContextProvider = ContextProvider;
|
|
273
273
|
exports2.Element = Element;
|
|
274
274
|
exports2.ForwardRef = ForwardRef;
|
|
275
|
-
exports2.Fragment =
|
|
275
|
+
exports2.Fragment = Fragment7;
|
|
276
276
|
exports2.Lazy = Lazy;
|
|
277
277
|
exports2.Memo = Memo;
|
|
278
278
|
exports2.Portal = Portal;
|
|
@@ -622,9 +622,11 @@ function parseDateTimeSkeleton(skeleton) {
|
|
|
622
622
|
skeleton.replace(DATE_TIME_REGEX, function(match) {
|
|
623
623
|
var len = match.length;
|
|
624
624
|
switch (match[0]) {
|
|
625
|
+
// Era
|
|
625
626
|
case "G":
|
|
626
627
|
result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
|
|
627
628
|
break;
|
|
629
|
+
// Year
|
|
628
630
|
case "y":
|
|
629
631
|
result.year = len === 2 ? "2-digit" : "numeric";
|
|
630
632
|
break;
|
|
@@ -633,13 +635,16 @@ function parseDateTimeSkeleton(skeleton) {
|
|
|
633
635
|
case "U":
|
|
634
636
|
case "r":
|
|
635
637
|
throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
|
638
|
+
// Quarter
|
|
636
639
|
case "q":
|
|
637
640
|
case "Q":
|
|
638
641
|
throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
642
|
+
// Month
|
|
639
643
|
case "M":
|
|
640
644
|
case "L":
|
|
641
645
|
result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1];
|
|
642
646
|
break;
|
|
647
|
+
// Week
|
|
643
648
|
case "w":
|
|
644
649
|
case "W":
|
|
645
650
|
throw new RangeError("`w/W` (week) patterns are not supported");
|
|
@@ -650,6 +655,7 @@ function parseDateTimeSkeleton(skeleton) {
|
|
|
650
655
|
case "F":
|
|
651
656
|
case "g":
|
|
652
657
|
throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
658
|
+
// Weekday
|
|
653
659
|
case "E":
|
|
654
660
|
result.weekday = len === 4 ? "short" : len === 5 ? "narrow" : "short";
|
|
655
661
|
break;
|
|
@@ -665,12 +671,15 @@ function parseDateTimeSkeleton(skeleton) {
|
|
|
665
671
|
}
|
|
666
672
|
result.weekday = ["short", "long", "narrow", "short"][len - 4];
|
|
667
673
|
break;
|
|
674
|
+
// Period
|
|
668
675
|
case "a":
|
|
669
676
|
result.hour12 = true;
|
|
670
677
|
break;
|
|
671
678
|
case "b":
|
|
679
|
+
// am, pm, noon, midnight
|
|
672
680
|
case "B":
|
|
673
681
|
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
682
|
+
// Hour
|
|
674
683
|
case "h":
|
|
675
684
|
result.hourCycle = "h12";
|
|
676
685
|
result.hour = ["numeric", "2-digit"][len - 1];
|
|
@@ -691,23 +700,31 @@ function parseDateTimeSkeleton(skeleton) {
|
|
|
691
700
|
case "J":
|
|
692
701
|
case "C":
|
|
693
702
|
throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
703
|
+
// Minute
|
|
694
704
|
case "m":
|
|
695
705
|
result.minute = ["numeric", "2-digit"][len - 1];
|
|
696
706
|
break;
|
|
707
|
+
// Second
|
|
697
708
|
case "s":
|
|
698
709
|
result.second = ["numeric", "2-digit"][len - 1];
|
|
699
710
|
break;
|
|
700
711
|
case "S":
|
|
701
712
|
case "A":
|
|
702
713
|
throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
714
|
+
// Zone
|
|
703
715
|
case "z":
|
|
704
716
|
result.timeZoneName = len < 4 ? "short" : "long";
|
|
705
717
|
break;
|
|
706
718
|
case "Z":
|
|
719
|
+
// 1..3, 4, 5: The ISO8601 varios formats
|
|
707
720
|
case "O":
|
|
721
|
+
// 1, 4: miliseconds in day short, long
|
|
708
722
|
case "v":
|
|
723
|
+
// 1, 4: generic non-location format
|
|
709
724
|
case "V":
|
|
725
|
+
// 1, 2, 3, 4: time zone ID or city
|
|
710
726
|
case "X":
|
|
727
|
+
// 1, 2, 3, 4: The ISO8601 varios formats
|
|
711
728
|
case "x":
|
|
712
729
|
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
|
|
713
730
|
}
|
|
@@ -905,6 +922,7 @@ function parseNumberSkeleton(tokens) {
|
|
|
905
922
|
case "notation-simple":
|
|
906
923
|
result.notation = "standard";
|
|
907
924
|
continue;
|
|
925
|
+
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
|
|
908
926
|
case "unit-width-narrow":
|
|
909
927
|
result.currencyDisplay = "narrowSymbol";
|
|
910
928
|
result.unitDisplay = "narrow";
|
|
@@ -923,6 +941,7 @@ function parseNumberSkeleton(tokens) {
|
|
|
923
941
|
case "scale":
|
|
924
942
|
result.scale = parseFloat(token.options[0]);
|
|
925
943
|
continue;
|
|
944
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
926
945
|
case "integer-width":
|
|
927
946
|
if (token.options.length > 1) {
|
|
928
947
|
throw new RangeError("integer-width stems only accept a single optional option");
|
|
@@ -2685,6 +2704,7 @@ var Parser = (
|
|
|
2685
2704
|
this.bump();
|
|
2686
2705
|
this.bump();
|
|
2687
2706
|
return "'";
|
|
2707
|
+
// '{', '<', '>', '}'
|
|
2688
2708
|
case 123:
|
|
2689
2709
|
case 60:
|
|
2690
2710
|
case 62:
|
|
@@ -2750,6 +2770,7 @@ var Parser = (
|
|
|
2750
2770
|
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2751
2771
|
}
|
|
2752
2772
|
switch (this.char()) {
|
|
2773
|
+
// Simple argument: `{name}`
|
|
2753
2774
|
case 125: {
|
|
2754
2775
|
this.bump();
|
|
2755
2776
|
return {
|
|
@@ -2762,6 +2783,7 @@ var Parser = (
|
|
|
2762
2783
|
err: null
|
|
2763
2784
|
};
|
|
2764
2785
|
}
|
|
2786
|
+
// Argument with options: `{name, format, ...}`
|
|
2765
2787
|
case 44: {
|
|
2766
2788
|
this.bump();
|
|
2767
2789
|
this.bumpSpace();
|
|
@@ -4035,9 +4057,11 @@ function parseDateTimeSkeleton2(skeleton) {
|
|
|
4035
4057
|
skeleton.replace(DATE_TIME_REGEX2, function(match) {
|
|
4036
4058
|
var len = match.length;
|
|
4037
4059
|
switch (match[0]) {
|
|
4060
|
+
// Era
|
|
4038
4061
|
case "G":
|
|
4039
4062
|
result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
|
|
4040
4063
|
break;
|
|
4064
|
+
// Year
|
|
4041
4065
|
case "y":
|
|
4042
4066
|
result.year = len === 2 ? "2-digit" : "numeric";
|
|
4043
4067
|
break;
|
|
@@ -4046,13 +4070,16 @@ function parseDateTimeSkeleton2(skeleton) {
|
|
|
4046
4070
|
case "U":
|
|
4047
4071
|
case "r":
|
|
4048
4072
|
throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
|
4073
|
+
// Quarter
|
|
4049
4074
|
case "q":
|
|
4050
4075
|
case "Q":
|
|
4051
4076
|
throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
4077
|
+
// Month
|
|
4052
4078
|
case "M":
|
|
4053
4079
|
case "L":
|
|
4054
4080
|
result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1];
|
|
4055
4081
|
break;
|
|
4082
|
+
// Week
|
|
4056
4083
|
case "w":
|
|
4057
4084
|
case "W":
|
|
4058
4085
|
throw new RangeError("`w/W` (week) patterns are not supported");
|
|
@@ -4063,6 +4090,7 @@ function parseDateTimeSkeleton2(skeleton) {
|
|
|
4063
4090
|
case "F":
|
|
4064
4091
|
case "g":
|
|
4065
4092
|
throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
4093
|
+
// Weekday
|
|
4066
4094
|
case "E":
|
|
4067
4095
|
result.weekday = len === 4 ? "short" : len === 5 ? "narrow" : "short";
|
|
4068
4096
|
break;
|
|
@@ -4078,12 +4106,15 @@ function parseDateTimeSkeleton2(skeleton) {
|
|
|
4078
4106
|
}
|
|
4079
4107
|
result.weekday = ["short", "long", "narrow", "short"][len - 4];
|
|
4080
4108
|
break;
|
|
4109
|
+
// Period
|
|
4081
4110
|
case "a":
|
|
4082
4111
|
result.hour12 = true;
|
|
4083
4112
|
break;
|
|
4084
4113
|
case "b":
|
|
4114
|
+
// am, pm, noon, midnight
|
|
4085
4115
|
case "B":
|
|
4086
4116
|
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
4117
|
+
// Hour
|
|
4087
4118
|
case "h":
|
|
4088
4119
|
result.hourCycle = "h12";
|
|
4089
4120
|
result.hour = ["numeric", "2-digit"][len - 1];
|
|
@@ -4104,23 +4135,31 @@ function parseDateTimeSkeleton2(skeleton) {
|
|
|
4104
4135
|
case "J":
|
|
4105
4136
|
case "C":
|
|
4106
4137
|
throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
4138
|
+
// Minute
|
|
4107
4139
|
case "m":
|
|
4108
4140
|
result.minute = ["numeric", "2-digit"][len - 1];
|
|
4109
4141
|
break;
|
|
4142
|
+
// Second
|
|
4110
4143
|
case "s":
|
|
4111
4144
|
result.second = ["numeric", "2-digit"][len - 1];
|
|
4112
4145
|
break;
|
|
4113
4146
|
case "S":
|
|
4114
4147
|
case "A":
|
|
4115
4148
|
throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
4149
|
+
// Zone
|
|
4116
4150
|
case "z":
|
|
4117
4151
|
result.timeZoneName = len < 4 ? "short" : "long";
|
|
4118
4152
|
break;
|
|
4119
4153
|
case "Z":
|
|
4154
|
+
// 1..3, 4, 5: The ISO8601 varios formats
|
|
4120
4155
|
case "O":
|
|
4156
|
+
// 1, 4: miliseconds in day short, long
|
|
4121
4157
|
case "v":
|
|
4158
|
+
// 1, 4: generic non-location format
|
|
4122
4159
|
case "V":
|
|
4160
|
+
// 1, 2, 3, 4: time zone ID or city
|
|
4123
4161
|
case "X":
|
|
4162
|
+
// 1, 2, 3, 4: The ISO8601 varios formats
|
|
4124
4163
|
case "x":
|
|
4125
4164
|
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
|
|
4126
4165
|
}
|
|
@@ -4318,6 +4357,7 @@ function parseNumberSkeleton2(tokens) {
|
|
|
4318
4357
|
case "notation-simple":
|
|
4319
4358
|
result.notation = "standard";
|
|
4320
4359
|
continue;
|
|
4360
|
+
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
|
|
4321
4361
|
case "unit-width-narrow":
|
|
4322
4362
|
result.currencyDisplay = "narrowSymbol";
|
|
4323
4363
|
result.unitDisplay = "narrow";
|
|
@@ -4336,6 +4376,7 @@ function parseNumberSkeleton2(tokens) {
|
|
|
4336
4376
|
case "scale":
|
|
4337
4377
|
result.scale = parseFloat(token.options[0]);
|
|
4338
4378
|
continue;
|
|
4379
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
4339
4380
|
case "integer-width":
|
|
4340
4381
|
if (token.options.length > 1) {
|
|
4341
4382
|
throw new RangeError("integer-width stems only accept a single optional option");
|
|
@@ -6098,6 +6139,7 @@ var Parser2 = (
|
|
|
6098
6139
|
this.bump();
|
|
6099
6140
|
this.bump();
|
|
6100
6141
|
return "'";
|
|
6142
|
+
// '{', '<', '>', '}'
|
|
6101
6143
|
case 123:
|
|
6102
6144
|
case 60:
|
|
6103
6145
|
case 62:
|
|
@@ -6163,6 +6205,7 @@ var Parser2 = (
|
|
|
6163
6205
|
return this.error(ErrorKind2.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation2(openingBracePosition, this.clonePosition()));
|
|
6164
6206
|
}
|
|
6165
6207
|
switch (this.char()) {
|
|
6208
|
+
// Simple argument: `{name}`
|
|
6166
6209
|
case 125: {
|
|
6167
6210
|
this.bump();
|
|
6168
6211
|
return {
|
|
@@ -6175,6 +6218,7 @@ var Parser2 = (
|
|
|
6175
6218
|
err: null
|
|
6176
6219
|
};
|
|
6177
6220
|
}
|
|
6221
|
+
// Argument with options: `{name, format, ...}`
|
|
6178
6222
|
case 44: {
|
|
6179
6223
|
this.bump();
|
|
6180
6224
|
this.bumpSpace();
|
|
@@ -10039,9 +10083,13 @@ function DefaultText({ node, attributes }) {
|
|
|
10039
10083
|
// src/theme/default/components/card/current-identifier-button.tsx
|
|
10040
10084
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
10041
10085
|
function DefaultCurrentIdentifierButton({
|
|
10042
|
-
attributes
|
|
10086
|
+
attributes,
|
|
10087
|
+
node
|
|
10043
10088
|
}) {
|
|
10044
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.
|
|
10089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { children: [
|
|
10090
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "py-1 px-3 rounded-full border border-button-identifier-border-default bg-button-identifier-bg-default", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-sm font-medium leading-none", children: attributes.value }) }),
|
|
10091
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DefaultInput, { attributes, node })
|
|
10092
|
+
] });
|
|
10045
10093
|
}
|
|
10046
10094
|
|
|
10047
10095
|
// src/theme/default/components/default-components.tsx
|
|
@@ -10200,17 +10248,23 @@ var NodeInput = ({
|
|
|
10200
10248
|
}
|
|
10201
10249
|
);
|
|
10202
10250
|
case import_client_fetch13.UiNodeInputAttributesTypeEnum.Hidden:
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
10252
|
+
isCurrentIdentifier && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10253
|
+
Components.CurrentIdentifierButton,
|
|
10254
|
+
{
|
|
10255
|
+
attributes: attrs,
|
|
10256
|
+
node
|
|
10257
|
+
}
|
|
10258
|
+
),
|
|
10259
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10260
|
+
Components.Input,
|
|
10261
|
+
{
|
|
10262
|
+
attributes: attrs,
|
|
10263
|
+
node,
|
|
10264
|
+
onClick: handleClick
|
|
10265
|
+
}
|
|
10266
|
+
)
|
|
10267
|
+
] });
|
|
10214
10268
|
default:
|
|
10215
10269
|
if (isPinCodeInput) {
|
|
10216
10270
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Components.Label, { attributes: attrs, node, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|