@xyo-network/react-xns 7.5.5 → 7.5.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"EstimateNameTextField.d.ts","sourceRoot":"","sources":["../../../../src/components/EstimateName/EstimateNameTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0B,cAAc,EAAE,MAAM,eAAe,CAAA;AAI3E,OAAO,KAEN,MAAM,OAAO,CAAA;AAEd,MAAM,WAAW,6BAA6B;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,GAAG,cAAc,CAsD7F,CAAA"}
1
+ {"version":3,"file":"EstimateNameTextField.d.ts","sourceRoot":"","sources":["../../../../src/components/EstimateName/EstimateNameTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0B,cAAc,EAAE,MAAM,eAAe,CAAA;AAI3E,OAAO,KAGN,MAAM,OAAO,CAAA;AAEd,MAAM,WAAW,6BAA6B;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,GAAG,cAAc,CAwD7F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../../../src/components/XnsNameCapture/Errors.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IAC3B,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CACxB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA0CpE,CAAA"}
1
+ {"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../../../src/components/XnsNameCapture/Errors.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IAC3B,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CACxB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA2CpE,CAAA"}
@@ -19,15 +19,12 @@ export declare const useXnsNameCaptureRouting: (props: XnsNameCaptureProps) => {
19
19
  background?: boolean;
20
20
  paper?: boolean;
21
21
  children?: import("react").ReactNode;
22
- ref?: import("react").Ref<unknown>;
22
+ ref?: import("react").Ref<unknown> | undefined;
23
23
  sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
24
24
  color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.Color | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.Color | undefined>);
25
25
  margin?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Margin<string | number> | readonly NonNullable<import("csstype").Property.Margin<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Margin<string | number> | readonly NonNullable<import("csstype").Property.Margin<string | number> | undefined>[] | undefined>);
26
26
  p?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Padding<string | number> | readonly NonNullable<import("csstype").Property.Padding<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Padding<string | number> | readonly NonNullable<import("csstype").Property.Padding<string | number> | undefined>[] | undefined>);
27
- border?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<number | "hidden" | "medium" | (string & {}) | "none" | "inherit" | "grey" | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "gray" | "green" | "greenyellow" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "rebeccapurple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "white" | "whitesmoke" | "yellow" | "yellowgreen" | "transparent" | "AccentColor" | "AccentColorText" | "ActiveText" | "ButtonBorder" | "ButtonFace" | "ButtonText" | "Canvas" | "CanvasText" | "Field" | "FieldText" | "GrayText" | "Highlight" | "HighlightText" | "LinkText" | "Mark" | "MarkText" | "SelectedItem" | "SelectedItemText" | "VisitedText" | "ActiveBorder" | "ActiveCaption" | "AppWorkspace" | "Background" | "ButtonHighlight" | "ButtonShadow" | "CaptionText" | "InactiveBorder" | "InactiveCaption" | "InactiveCaptionText" | "InfoBackground" | "InfoText" | "Menu" | "MenuText" | "Scrollbar" | "ThreeDDarkShadow" | "ThreeDFace" | "ThreeDHighlight" | "ThreeDLightShadow" | "ThreeDShadow" | "Window" | "WindowFrame" | "WindowText" | "currentColor" | "inset" | "thick" | "thin" | "dashed" | "dotted" | "double" | "groove" | "outset" | "ridge" | "solid" | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<number | "hidden" | "medium" | (string & {}) | "none" | "inherit" | "grey" | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "gray" | "green" | "greenyellow" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "rebeccapurple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "white" | "whitesmoke" | "yellow" | "yellowgreen" | "transparent" | "AccentColor" | "AccentColorText" | "ActiveText" | "ButtonBorder" | "ButtonFace" | "ButtonText" | "Canvas" | "CanvasText" | "Field" | "FieldText" | "GrayText" | "Highlight" | "HighlightText" | "LinkText" | "Mark" | "MarkText" | "SelectedItem" | "SelectedItemText" | "VisitedText" | "ActiveBorder" | "ActiveCaption" | "AppWorkspace" | "Background" | "ButtonHighlight" | "ButtonShadow" | "CaptionText" | "InactiveBorder" | "InactiveCaption" | "InactiveCaptionText" | "InfoBackground" | "InfoText" | "Menu" | "MenuText" | "Scrollbar" | "ThreeDDarkShadow" | "ThreeDFace" | "ThreeDHighlight" | "ThreeDLightShadow" | "ThreeDShadow" | "Window" | "WindowFrame" | "WindowText" | "currentColor" | "inset" | "thick" | "thin" | "dashed" | "dotted" | "double" | "groove" | "outset" | "ridge" | "solid" | undefined>);
28
- height?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Height<string | number> | readonly NonNullable<import("csstype").Property.Height<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Height<string | number> | readonly NonNullable<import("csstype").Property.Height<string | number> | undefined>[] | undefined>);
29
- width?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Width<string | number> | readonly NonNullable<import("csstype").Property.Width<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Width<string | number> | readonly NonNullable<import("csstype").Property.Width<string | number> | undefined>[] | undefined>);
30
- position?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Position | readonly NonNullable<import("csstype").Property.Position | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Position | readonly NonNullable<import("csstype").Property.Position | undefined>[] | undefined>);
27
+ border?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<number | "hidden" | "medium" | (string & {}) | "inset" | "none" | "inherit" | "grey" | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "gray" | "green" | "greenyellow" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "rebeccapurple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "white" | "whitesmoke" | "yellow" | "yellowgreen" | "transparent" | "AccentColor" | "AccentColorText" | "ActiveText" | "ButtonBorder" | "ButtonFace" | "ButtonText" | "Canvas" | "CanvasText" | "Field" | "FieldText" | "GrayText" | "Highlight" | "HighlightText" | "LinkText" | "Mark" | "MarkText" | "SelectedItem" | "SelectedItemText" | "VisitedText" | "ActiveBorder" | "ActiveCaption" | "AppWorkspace" | "Background" | "ButtonHighlight" | "ButtonShadow" | "CaptionText" | "InactiveBorder" | "InactiveCaption" | "InactiveCaptionText" | "InfoBackground" | "InfoText" | "Menu" | "MenuText" | "Scrollbar" | "ThreeDDarkShadow" | "ThreeDFace" | "ThreeDHighlight" | "ThreeDLightShadow" | "ThreeDShadow" | "Window" | "WindowFrame" | "WindowText" | "currentColor" | "thick" | "thin" | "dashed" | "dotted" | "double" | "groove" | "outset" | "ridge" | "solid" | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<number | "hidden" | "medium" | (string & {}) | "inset" | "none" | "inherit" | "grey" | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "gray" | "green" | "greenyellow" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "rebeccapurple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "white" | "whitesmoke" | "yellow" | "yellowgreen" | "transparent" | "AccentColor" | "AccentColorText" | "ActiveText" | "ButtonBorder" | "ButtonFace" | "ButtonText" | "Canvas" | "CanvasText" | "Field" | "FieldText" | "GrayText" | "Highlight" | "HighlightText" | "LinkText" | "Mark" | "MarkText" | "SelectedItem" | "SelectedItemText" | "VisitedText" | "ActiveBorder" | "ActiveCaption" | "AppWorkspace" | "Background" | "ButtonHighlight" | "ButtonShadow" | "CaptionText" | "InactiveBorder" | "InactiveCaption" | "InactiveCaptionText" | "InfoBackground" | "InfoText" | "Menu" | "MenuText" | "Scrollbar" | "ThreeDDarkShadow" | "ThreeDFace" | "ThreeDHighlight" | "ThreeDLightShadow" | "ThreeDShadow" | "Window" | "WindowFrame" | "WindowText" | "currentColor" | "thick" | "thin" | "dashed" | "dotted" | "double" | "groove" | "outset" | "ridge" | "solid" | undefined>);
31
28
  boxShadow?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<number | import("csstype").Property.BoxShadow | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<number | import("csstype").Property.BoxShadow | undefined>);
32
29
  fontWeight?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string | (string & {}) | (number & {}) | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string | (string & {}) | (number & {}) | undefined>);
33
30
  zIndex?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string | (string & {}) | (number & {}) | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string | (string & {}) | (number & {}) | undefined>);
@@ -52,6 +49,7 @@ export declare const useXnsNameCaptureRouting: (props: XnsNameCaptureProps) => {
52
49
  gridTemplateAreas?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.GridTemplateAreas | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.GridTemplateAreas | undefined>);
53
50
  gridTemplateColumns?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.GridTemplateColumns<string | number> | readonly NonNullable<import("csstype").Property.GridTemplateColumns<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.GridTemplateColumns<string | number> | readonly NonNullable<import("csstype").Property.GridTemplateColumns<string | number> | undefined>[] | undefined>);
54
51
  gridTemplateRows?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.GridTemplateRows<string | number> | readonly NonNullable<import("csstype").Property.GridTemplateRows<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.GridTemplateRows<string | number> | readonly NonNullable<import("csstype").Property.GridTemplateRows<string | number> | undefined>[] | undefined>);
52
+ height?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Height<string | number> | readonly NonNullable<import("csstype").Property.Height<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Height<string | number> | readonly NonNullable<import("csstype").Property.Height<string | number> | undefined>[] | undefined>);
55
53
  justifyContent?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.JustifyContent | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.JustifyContent | undefined>);
56
54
  justifyItems?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.JustifyItems | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.JustifyItems | undefined>);
57
55
  justifySelf?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.JustifySelf | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.JustifySelf | undefined>);
@@ -79,6 +77,7 @@ export declare const useXnsNameCaptureRouting: (props: XnsNameCaptureProps) => {
79
77
  paddingLeft?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.PaddingLeft<string | number> | readonly NonNullable<import("csstype").Property.PaddingLeft<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.PaddingLeft<string | number> | readonly NonNullable<import("csstype").Property.PaddingLeft<string | number> | undefined>[] | undefined>);
80
78
  paddingRight?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.PaddingRight<string | number> | readonly NonNullable<import("csstype").Property.PaddingRight<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.PaddingRight<string | number> | readonly NonNullable<import("csstype").Property.PaddingRight<string | number> | undefined>[] | undefined>);
81
79
  paddingTop?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.PaddingTop<string | number> | readonly NonNullable<import("csstype").Property.PaddingTop<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.PaddingTop<string | number> | readonly NonNullable<import("csstype").Property.PaddingTop<string | number> | undefined>[] | undefined>);
80
+ position?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Position | readonly NonNullable<import("csstype").Property.Position | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Position | readonly NonNullable<import("csstype").Property.Position | undefined>[] | undefined>);
82
81
  right?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Right<string | number> | readonly NonNullable<import("csstype").Property.Right<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Right<string | number> | readonly NonNullable<import("csstype").Property.Right<string | number> | undefined>[] | undefined>);
83
82
  rowGap?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.RowGap<string | number> | readonly NonNullable<import("csstype").Property.RowGap<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.RowGap<string | number> | readonly NonNullable<import("csstype").Property.RowGap<string | number> | undefined>[] | undefined>);
84
83
  textAlign?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.TextAlign | readonly NonNullable<import("csstype").Property.TextAlign | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.TextAlign | readonly NonNullable<import("csstype").Property.TextAlign | undefined>[] | undefined>);
@@ -87,6 +86,7 @@ export declare const useXnsNameCaptureRouting: (props: XnsNameCaptureProps) => {
87
86
  top?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Top<string | number> | readonly NonNullable<import("csstype").Property.Top<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Top<string | number> | readonly NonNullable<import("csstype").Property.Top<string | number> | undefined>[] | undefined>);
88
87
  visibility?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Visibility | readonly NonNullable<import("csstype").Property.Visibility | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Visibility | readonly NonNullable<import("csstype").Property.Visibility | undefined>[] | undefined>);
89
88
  whiteSpace?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.WhiteSpace | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.WhiteSpace | undefined>);
89
+ width?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Width<string | number> | readonly NonNullable<import("csstype").Property.Width<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Width<string | number> | readonly NonNullable<import("csstype").Property.Width<string | number> | undefined>[] | undefined>);
90
90
  borderBottom?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.BorderBottom<string | number> | readonly NonNullable<import("csstype").Property.BorderBottom<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.BorderBottom<string | number> | readonly NonNullable<import("csstype").Property.BorderBottom<string | number> | undefined>[] | undefined>);
91
91
  borderColor?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.BorderColor | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.BorderColor | undefined>);
92
92
  borderLeft?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.BorderLeft<string | number> | readonly NonNullable<import("csstype").Property.BorderLeft<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.BorderLeft<string | number> | readonly NonNullable<import("csstype").Property.BorderLeft<string | number> | undefined>[] | undefined>);
@@ -124,8 +124,8 @@ export declare const useXnsNameCaptureRouting: (props: XnsNameCaptureProps) => {
124
124
  paddingY?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.PaddingTop<string | number> | readonly NonNullable<import("csstype").Property.PaddingTop<string | number> | undefined>[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.PaddingTop<string | number> | readonly NonNullable<import("csstype").Property.PaddingTop<string | number> | undefined>[] | undefined>);
125
125
  typography?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string | undefined>);
126
126
  displayPrint?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.Display | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.Display | undefined>);
127
- className?: string;
128
- style?: import("react").CSSProperties;
127
+ className?: string | undefined;
128
+ style?: import("react").CSSProperties | undefined;
129
129
  classes?: Partial<import("@mui/material").ClassNameMap<never>> | undefined;
130
130
  slot?: string | undefined | undefined;
131
131
  title?: string | undefined | undefined;
@@ -403,7 +403,7 @@ export declare const useXnsNameCaptureRouting: (props: XnsNameCaptureProps) => {
403
403
  onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
404
404
  onTransitionStart?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
405
405
  onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
406
- component?: React.ElementType;
406
+ component?: React.ElementType | undefined;
407
407
  busy?: boolean;
408
408
  busyCircularProps?: import("@xylabs/react-shared").BusyCircularProgressProps;
409
409
  busyColor?: import("@xylabs/react-shared").MaterialUIThemeColor;
@@ -5,17 +5,17 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
5
5
  import { TextField, useTheme } from "@mui/material";
6
6
  import { alphaCss } from "@xylabs/react-theme";
7
7
  import { MIN_DOMAIN_LENGTH, XnsNameHelper } from "@xyo-network/xns-record-payloadset-plugins";
8
- import React, { useLayoutEffect, useMemo, useRef, useState } from "react";
8
+ import React, { useLayoutEffect, useRef, useState } from "react";
9
9
  var XnsEstimateNameTextField = /* @__PURE__ */ __name(({ maskOutput = true, onChange: onChangeProp, onBlur: onBlurProp, value, ...props }) => {
10
10
  const theme = useTheme();
11
11
  const [validLength, setValidLength] = useState(false);
12
12
  const inputRef = useRef(null);
13
- useMemo(() => {
13
+ const [previousValue, setPreviousValue] = useState(value);
14
+ if (value !== previousValue) {
15
+ setPreviousValue(value);
14
16
  const validValueLength = !!(value && typeof value === "string" && value.length >= MIN_DOMAIN_LENGTH);
15
17
  setValidLength(validValueLength);
16
- }, [
17
- value
18
- ]);
18
+ }
19
19
  useLayoutEffect(() => {
20
20
  if (inputRef.current && typeof value === "string") {
21
21
  inputRef.current.value = value;
@@ -94,7 +94,7 @@ var XnsNameCaptureErrors = /* @__PURE__ */ __name(({ error, errorUi, resetError
94
94
  }, "XnsNameCaptureErrors");
95
95
 
96
96
  // src/components/XnsNameCapture/hooks/routing/useXnsNameCaptureRouting.ts
97
- import { useMemo as useMemo2 } from "react";
97
+ import { useMemo } from "react";
98
98
  import { useNavigate, useSearchParams } from "react-router-dom";
99
99
 
100
100
  // src/components/XnsNameCapture/hooks/routing/useXnsNameFromLocation.ts
@@ -137,7 +137,7 @@ var useXnsNameCaptureRouting = /* @__PURE__ */ __name((props) => {
137
137
  const [params] = useSearchParams();
138
138
  const navigate = useNavigate();
139
139
  const [name, error] = useXnsNameFromLocation();
140
- return useMemo2(() => ({
140
+ return useMemo(() => ({
141
141
  ...props,
142
142
  defaultXnsName: name,
143
143
  routingError: error,
@@ -145,9 +145,10 @@ var useXnsNameCaptureRouting = /* @__PURE__ */ __name((props) => {
145
145
  paramsString: props.paramsString ? `${props.paramsString}${params.toString()}` : params.toString()
146
146
  }), [
147
147
  props,
148
- params,
149
148
  name,
150
- error
149
+ error,
150
+ params,
151
+ navigate
151
152
  ]);
152
153
  }, "useXnsNameCaptureRouting");
153
154
 
@@ -244,11 +245,12 @@ var XnsNameCapture = /* @__PURE__ */ __name(({ autoFocus = false, buttonText = "
244
245
  setError(new Error(errors.join(", ")));
245
246
  }
246
247
  }, [
247
- paramsString,
248
- to,
248
+ captureDisabled,
249
249
  xnsName,
250
250
  onCaptureNameProp,
251
- navigate
251
+ paramsString,
252
+ navigate,
253
+ to
252
254
  ]);
253
255
  const onKeyDown = useCallback(async (event) => {
254
256
  if (event.key === "Enter" && !captureDisabled) {
@@ -305,10 +307,10 @@ var XnsNameCapture = /* @__PURE__ */ __name(({ autoFocus = false, buttonText = "
305
307
  }, "XnsNameCapture");
306
308
 
307
309
  // src/components/XnsNameCapture/XnsNameCaptureWithContext.tsx
308
- import React5, { useMemo as useMemo3 } from "react";
310
+ import React5, { useMemo as useMemo2 } from "react";
309
311
  var XnsNameCaptureWithContext = /* @__PURE__ */ __name((props) => {
310
312
  const routingProps = useXnsNameCaptureRouting(props);
311
- const updatedProps = useMemo3(() => ({
313
+ const updatedProps = useMemo2(() => ({
312
314
  ...props,
313
315
  ...routingProps
314
316
  }), [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/EstimateName/EstimateNameTextField.tsx","../../src/components/XnsNameCapture/Errors.tsx","../../src/components/XnsNameCapture/hooks/routing/useXnsNameCaptureRouting.ts","../../src/components/XnsNameCapture/hooks/routing/useXnsNameFromLocation.ts","../../src/components/XnsNameCapture/SecondaryLink.tsx","../../src/components/XnsNameCapture/XnsNameCapture.tsx","../../src/components/XnsNameCapture/lib/navigateWithUsername.ts","../../src/components/XnsNameCapture/XnsNameCaptureWithContext.tsx"],"sourcesContent":["import type { StandardTextFieldProps, TextFieldProps } from '@mui/material'\nimport { TextField, useTheme } from '@mui/material'\nimport { alphaCss } from '@xylabs/react-theme'\nimport { MIN_DOMAIN_LENGTH, XnsNameHelper } from '@xyo-network/xns-record-payloadset-plugins'\nimport React, {\n useLayoutEffect, useMemo, useRef, useState,\n} from 'react'\n\nexport interface XnsEstimateNameTextFieldProps {\n maskOutput?: boolean\n}\n\nexport const XnsEstimateNameTextField: React.FC<XnsEstimateNameTextFieldProps & TextFieldProps> = ({\n maskOutput = true, onChange: onChangeProp, onBlur: onBlurProp, value, ...props\n}) => {\n const theme = useTheme()\n const [validLength, setValidLength] = useState(false)\n\n const inputRef = useRef<HTMLInputElement>(null)\n\n // watch for external changes to the value and update the validLength state\n useMemo(() => {\n const validValueLength = !!(value && typeof value === 'string' && value.length >= MIN_DOMAIN_LENGTH)\n setValidLength(validValueLength)\n }, [value])\n\n // Update the input value when the value prop changes\n // NOTE: the intent of this component is to remain uncontrolled to avoid the need to manage the value state\n // Therefore, we use useLayoutEffect to update the input value directly.\n useLayoutEffect(() => {\n if (inputRef.current && typeof value === 'string') {\n inputRef.current.value = value\n }\n }, [value])\n\n // override onChange to mask the input and update the event value\n const handleChange: StandardTextFieldProps['onChange'] = (event) => {\n if (maskOutput) {\n const value = event.target.value\n event.target.value = XnsNameHelper.mask(value)\n }\n onChangeProp?.(event)\n\n if (inputRef.current) {\n setValidLength(inputRef.current.value.length >= MIN_DOMAIN_LENGTH)\n }\n }\n\n // override onBlur to do a final mask of the input and update the event value\n const handleBlur: StandardTextFieldProps['onBlur'] = (event) => {\n if (maskOutput) {\n const value = event.target.value\n event.target.value = XnsNameHelper.mask(value, { maskStartEndHyphens: true })\n }\n onBlurProp?.(event)\n }\n\n return (\n <TextField\n inputRef={inputRef}\n onBlur={handleBlur}\n onChange={handleChange}\n {...props}\n slotProps={{ htmlInput: { style: { color: validLength ? theme.vars.palette.text.primary : alphaCss(theme.vars.palette.text.primary, 0.5) } } }}\n />\n )\n}\n","/* eslint-disable react-x/jsx-no-iife */\nimport {\n Alert, Snackbar, useMediaQuery, useTheme,\n} from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface XnsNameCaptureErrorsProps {\n error?: Error\n errorUi?: 'alert' | 'toast'\n resetError?: () => void\n}\n\nexport const XnsNameCaptureErrors: React.FC<XnsNameCaptureErrorsProps> = ({\n error, errorUi, resetError,\n}) => {\n const theme = useTheme()\n const isMobile = useMediaQuery(theme.breakpoints.down('md'))\n\n return (\n <>\n {(errorUi === 'toast')\n ? (\n <Snackbar\n open={!!error}\n message={error?.toString()}\n autoHideDuration={3000}\n onClose={() => resetError?.()}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}\n >\n <Alert\n severity=\"error\"\n sx={{\n width: '100%', display: (isMobile && !error) ? 'none' : undefined, visibility: error ? 'visible' : 'hidden',\n }}\n >\n {error?.message}\n </Alert>\n </Snackbar>\n )\n : (() => {\n // setTimeout(() => setError(undefined), 1500)\n return (\n <FlexRow alignSelf=\"stretch\">\n <Alert\n severity=\"error\"\n sx={{ display: (isMobile && !error) ? 'none' : undefined, visibility: error ? 'visible' : 'hidden' }}\n >\n {error?.message}\n </Alert>\n </FlexRow>\n )\n })()}\n </>\n )\n}\n","import { useMemo } from 'react'\nimport { useNavigate, useSearchParams } from 'react-router-dom'\n\nimport type { XnsNameCaptureProps } from '../../Props.ts'\nimport { useXnsNameFromLocation } from './useXnsNameFromLocation.ts'\n\nexport const useXnsNameCaptureRouting = (props: XnsNameCaptureProps) => {\n const [params] = useSearchParams()\n\n const navigate = useNavigate()\n\n const [name, error] = useXnsNameFromLocation()\n\n return useMemo(() => ({\n ...props,\n defaultXnsName: name,\n routingError: error,\n navigate: props.navigate ?? ((to: string) => navigate(to)),\n paramsString: props.paramsString ? `${props.paramsString}${params.toString()}` : params.toString(),\n }), [props, params, name, error])\n}\n","import { useLocation } from 'react-router-dom'\n\n/**\n * Assumes the user was redirected with a link that contains a username query parameter.\n * @returns The xNS name from the URI username query parameter.\n */\nexport const useXnsNameFromLocation = (): [name: string | undefined, error: Error | undefined] => {\n const location = useLocation()\n const search = new URLSearchParams(location.search)\n const rawName = (search.get('xnsname') ?? search.get('name') ?? search.get('username') ?? '').toLowerCase()\n switch (rawName?.split('.').length) {\n case 1: {\n return [rawName, undefined]\n }\n case 2: {\n const rawNameParts = rawName.split('.')\n if (rawNameParts[1] !== 'xyo') {\n return [, new Error('Invalid xNS name [Bad root]')]\n }\n return [rawNameParts[0], undefined]\n }\n default: {\n return [, new Error('Invalid xNS name [Too many parts]')]\n }\n }\n}\n","import { ArrowForwardRounded } from '@mui/icons-material'\nimport { Stack } from '@mui/material'\nimport type { LinkExProps } from '@xylabs/react-link'\nimport { LinkEx } from '@xylabs/react-link'\nimport { useUserEvents } from '@xylabs/react-pixel'\nimport { XnsNameHelper } from '@xyo-network/xns-record-payloadset-plugins'\nimport type { Dispatch } from 'react'\nimport React from 'react'\n\nimport type {\n XnsNameCaptureBuyCallbacks, XnsNameCaptureRoutingProps, XnsNameCaptureTrackingProps,\n} from './Props.ts'\n\nexport type XnsCaptureSecondaryLinkProps = XnsNameCaptureTrackingProps & XnsNameCaptureRoutingProps & XnsNameCaptureBuyCallbacks & LinkExProps & {\n setError?: Dispatch<Error | undefined>\n text?: string\n xnsName: string\n}\n\nexport const XnsCaptureSecondaryLink: React.FC<XnsCaptureSecondaryLinkProps> = ({\n funnel = 'xns',\n navigate,\n onCaptureName,\n paramsString = '',\n intent,\n placement = '',\n setError,\n text = 'Or make a free reservation',\n to = '/xns/reservation',\n xnsName,\n ...props\n}) => {\n const userEvents = useUserEvents('warn')\n return (\n <LinkEx\n paddingX={0}\n color=\"inherit\"\n style={{ textDecoration: 'underline', textUnderlineOffset: '5px' }}\n onClick={async () => {\n const formattedXnsName = `${xnsName}.xyo`\n const helper = XnsNameHelper.fromString(formattedXnsName)\n const [valid, errors] = await helper.validate()\n if (valid) {\n await userEvents?.userClick({\n funnel, placement, intent,\n })\n navigate?.(`${to}?username=${xnsName}${paramsString}`)\n await onCaptureName?.(xnsName)\n } else {\n setError?.(new Error(errors.join(', ')))\n }\n }}\n {...props}\n >\n <Stack flexDirection=\"row\" gap={0.5} alignItems=\"center\" sx={{ cursor: 'pointer' }}>\n {text}\n <ArrowForwardRounded />\n </Stack>\n </LinkEx>\n )\n}\n","import { KeyboardArrowRightRounded } from '@mui/icons-material'\nimport type { StandardTextFieldProps } from '@mui/material'\nimport { useMediaQuery, useTheme } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport { MIN_DOMAIN_LENGTH, XnsNameHelper } from '@xyo-network/xns-record-payloadset-plugins'\nimport type { KeyboardEventHandler } from 'react'\nimport React, { useCallback, useState } from 'react'\n\nimport { XnsEstimateNameTextField } from '../EstimateName/index.ts'\nimport { XnsNameCaptureErrors } from './Errors.tsx'\nimport { navigateWithUsername } from './lib/index.ts'\nimport type { XnsNameCaptureProps } from './Props.ts'\nimport { XnsCaptureSecondaryLink } from './SecondaryLink.js'\n\nexport const XnsNameCapture: React.FC<XnsNameCaptureProps> = ({\n autoFocus = false,\n buttonText = 'Buy My Name',\n children,\n defaultXnsName,\n disabled,\n errorUi = 'alert',\n funnel = 'xns',\n intent = 'unset',\n mobileButtonText = 'Buy',\n navigate,\n onCaptureName: onCaptureNameProp,\n onNameChange,\n paramsString = '',\n placement = '',\n routingError,\n showSecondary = false,\n to = '/xns/estimation',\n ...props\n}) => {\n const [xnsName, setXnsName] = useState<string>(() => defaultXnsName ?? '')\n const [error, setError] = useState<Error | undefined>(routingError)\n\n const theme = useTheme()\n const isMobile = useMediaQuery(theme.breakpoints.down('md'))\n\n const captureDisabled = !xnsName || xnsName.length < MIN_DOMAIN_LENGTH\n\n const handleChange: StandardTextFieldProps['onChange'] = (event) => {\n const NsName = XnsNameHelper.mask(event.target.value)\n onNameChange?.(NsName)\n setXnsName(NsName)\n setError(undefined)\n }\n\n const onCaptureName = useCallback(async () => {\n if (captureDisabled) return\n const formattedXnsName = `${xnsName}.xyo`\n const helper = XnsNameHelper.fromString(formattedXnsName)\n const [valid, errors] = await helper.validate()\n if (valid) {\n await onCaptureNameProp?.(xnsName)\n\n navigateWithUsername(xnsName, paramsString, navigate, to)\n } else {\n setError(new Error(errors.join(', ')))\n }\n }, [paramsString, to, xnsName, onCaptureNameProp, navigate])\n\n const onKeyDown: KeyboardEventHandler<HTMLDivElement> = useCallback(async (event) => {\n if (event.key === 'Enter' && !captureDisabled) {\n await onCaptureName?.()\n }\n }, [captureDisabled, onCaptureName])\n\n return (\n <FlexCol gap={showSecondary ? 1.5 : 0} alignItems=\"center\" {...props}>\n <FlexRow gap={1}>\n <XnsEstimateNameTextField\n autoFocus={autoFocus}\n disabled={disabled}\n label=\"xNS Name\"\n variant=\"outlined\"\n size=\"small\"\n value={xnsName ?? ''}\n onKeyDown={onKeyDown}\n onChange={handleChange}\n onBlur={handleChange}\n />\n <ButtonEx\n disabled={captureDisabled}\n funnel={funnel}\n intent={intent}\n placement={placement}\n variant=\"contained\"\n color=\"success\"\n endIcon={<KeyboardArrowRightRounded />}\n onClick={onCaptureName}\n >\n {isMobile ? mobileButtonText : buttonText}\n </ButtonEx>\n </FlexRow>\n {(showSecondary === true)\n ? (\n <XnsCaptureSecondaryLink\n xnsName={xnsName}\n placement={placement}\n funnel={funnel}\n setError={setError}\n />\n )\n : null}\n {\n // eslint-disable-next-line unicorn/prefer-logical-operator-over-ternary\n showSecondary ? showSecondary : null\n }\n {children}\n <XnsNameCaptureErrors error={error} errorUi={errorUi} resetError={() => setError(undefined)} />\n </FlexCol>\n )\n}\n","import type { To } from 'react-router-dom'\n\nexport const navigateWithUsername = (xnsName: string, paramsString: string, navigate?: ((to: string) => void), to?: To) => {\n // avoid duplicating the username param\n const params = new URLSearchParams(paramsString)\n const usernameParam = params.get('username')\n if (usernameParam) {\n // if username param is the same as the xnsName, navigate\n if (usernameParam === xnsName) {\n navigate?.(`${to}?${paramsString}`)\n }\n if (usernameParam !== xnsName) {\n // if username param is different, replace it\n params.set('username', xnsName)\n navigate?.(`${to}?${params.toString()}`)\n }\n } else {\n // if no username param, include it\n navigate?.(`${to}?username=${xnsName}&${paramsString}`)\n }\n}\n","import React, { useMemo } from 'react'\n\nimport { useXnsNameCaptureRouting } from './hooks/index.ts'\nimport type { XnsNameCaptureProps } from './Props.ts'\nimport { XnsNameCapture } from './XnsNameCapture.tsx'\n\nexport const XnsNameCaptureWithContext: React.FC<XnsNameCaptureProps> = (props) => {\n const routingProps = useXnsNameCaptureRouting(props)\n\n const updatedProps = useMemo<XnsNameCaptureProps>(() => ({\n ...props,\n ...routingProps,\n }), [routingProps, props])\n\n return (\n <XnsNameCapture {...updatedProps} />\n )\n}\n"],"mappings":";;;;AACA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,gBAAgB;AACzB,SAASC,mBAAmBC,qBAAqB;AACjD,OAAOC,SACLC,iBAAiBC,SAASC,QAAQC,gBAC7B;AAMA,IAAMC,2BAAqF,wBAAC,EACjGC,aAAa,MAAMC,UAAUC,cAAcC,QAAQC,YAAYC,OAAO,GAAGC,MAAAA,MAC1E;AACC,QAAMC,QAAQC,SAAAA;AACd,QAAM,CAACC,aAAaC,cAAAA,IAAkBC,SAAS,KAAA;AAE/C,QAAMC,WAAWC,OAAyB,IAAA;AAG1CC,UAAQ,MAAA;AACN,UAAMC,mBAAmB,CAAC,EAAEV,SAAS,OAAOA,UAAU,YAAYA,MAAMW,UAAUC;AAClFP,mBAAeK,gBAAAA;EACjB,GAAG;IAACV;GAAM;AAKVa,kBAAgB,MAAA;AACd,QAAI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B,QAAQ9B;QAEV,gBAAAoB,OAAA,cAACW,UAAAA;MACC5D,UAAU0B;MACVxB;MACAC;MACAO;MACA8C,SAAQ;MACRK,OAAM;MACNC,SAAS,gBAAAb,OAAA,cAACc,2BAAAA,IAAAA;MACVC,SAAS1D;OAERgB,WAAWlB,mBAAmBP,UAAAA,CAAAA;IAGjCe,kBAAkB,OAEd,gBAAAqC,OAAA,cAACgB,yBAAAA;MACClD;MACAL;MACAR;MACAiB;SAGJ;;IAGFP,gBAAgBA,gBAAgB;IAEjCd;IACD,gBAAAmD,OAAA,cAACiB,sBAAAA;MAAqBhD;MAAcjB;MAAkBkE,YAAY,6BAAMhD,SAASiB,MAAAA,GAAf;;;AAGxE,GApG6D;;;AEf7D,OAAOgC,UAASC,WAAAA,gBAAe;AAMxB,IAAMC,4BAA2D,wBAACC,UAAAA;AACvE,QAAMC,eAAeC,yBAAyBF,KAAAA;AAE9C,QAAMG,eAAeC,SAA6B,OAAO;IACvD,GAAGJ;IACH,GAAGC;EACL,IAAI;IAACA;IAAcD;GAAM;AAEzB,SACE,gBAAAK,OAAA,cAACC,gBAAmBH,YAAAA;AAExB,GAXwE;","names":["TextField","useTheme","alphaCss","MIN_DOMAIN_LENGTH","XnsNameHelper","React","useLayoutEffect","useMemo","useRef","useState","XnsEstimateNameTextField","maskOutput","onChange","onChangeProp","onBlur","onBlurProp","value","props","theme","useTheme","validLength","setValidLength","useState","inputRef","useRef","useMemo","validValueLength","length","MIN_DOMAIN_LENGTH","useLayoutEffect","current","handleChange","event","target","XnsNameHelper","mask","handleBlur","maskStartEndHyphens","TextField","slotProps","htmlInput","style","color","vars","palette","text","primary","alphaCss","Alert","Snackbar","useMediaQuery","useTheme","FlexRow","React","XnsNameCaptureErrors","error","errorUi","resetError","theme","useTheme","isMobile","useMediaQuery","breakpoints","down","React","Snackbar","open","message","toString","autoHideDuration","onClose","anchorOrigin","vertical","horizontal","Alert","severity","sx","width","display","undefined","visibility","FlexRow","alignSelf","useMemo","useNavigate","useSearchParams","useLocation","useXnsNameFromLocation","location","useLocation","search","URLSearchParams","rawName","get","toLowerCase","split","length","undefined","rawNameParts","Error","useXnsNameCaptureRouting","props","params","useSearchParams","navigate","useNavigate","name","error","useXnsNameFromLocation","useMemo","defaultXnsName","routingError","to","paramsString","toString","ArrowForwardRounded","Stack","LinkEx","useUserEvents","XnsNameHelper","React","XnsCaptureSecondaryLink","funnel","navigate","onCaptureName","paramsString","intent","placement","setError","text","to","xnsName","props","userEvents","useUserEvents","React","LinkEx","paddingX","color","style","textDecoration","textUnderlineOffset","onClick","formattedXnsName","helper","XnsNameHelper","fromString","valid","errors","validate","userClick","Error","join","Stack","flexDirection","gap","alignItems","sx","cursor","ArrowForwardRounded","KeyboardArrowRightRounded","useMediaQuery","useTheme","ButtonEx","FlexCol","FlexRow","MIN_DOMAIN_LENGTH","XnsNameHelper","React","useCallback","useState","navigateWithUsername","xnsName","paramsString","navigate","to","params","URLSearchParams","usernameParam","get","set","toString","XnsNameCapture","autoFocus","buttonText","children","defaultXnsName","disabled","errorUi","funnel","intent","mobileButtonText","navigate","onCaptureName","onCaptureNameProp","onNameChange","paramsString","placement","routingError","showSecondary","to","props","xnsName","setXnsName","useState","error","setError","theme","useTheme","isMobile","useMediaQuery","breakpoints","down","captureDisabled","length","MIN_DOMAIN_LENGTH","handleChange","event","NsName","XnsNameHelper","mask","target","value","undefined","useCallback","formattedXnsName","helper","fromString","valid","errors","validate","navigateWithUsername","Error","join","onKeyDown","key","React","FlexCol","gap","alignItems","FlexRow","XnsEstimateNameTextField","label","variant","size","onChange","onBlur","ButtonEx","color","endIcon","KeyboardArrowRightRounded","onClick","XnsCaptureSecondaryLink","XnsNameCaptureErrors","resetError","React","useMemo","XnsNameCaptureWithContext","props","routingProps","useXnsNameCaptureRouting","updatedProps","useMemo","React","XnsNameCapture"]}
1
+ {"version":3,"sources":["../../src/components/EstimateName/EstimateNameTextField.tsx","../../src/components/XnsNameCapture/Errors.tsx","../../src/components/XnsNameCapture/hooks/routing/useXnsNameCaptureRouting.ts","../../src/components/XnsNameCapture/hooks/routing/useXnsNameFromLocation.ts","../../src/components/XnsNameCapture/SecondaryLink.tsx","../../src/components/XnsNameCapture/XnsNameCapture.tsx","../../src/components/XnsNameCapture/lib/navigateWithUsername.ts","../../src/components/XnsNameCapture/XnsNameCaptureWithContext.tsx"],"sourcesContent":["import type { StandardTextFieldProps, TextFieldProps } from '@mui/material'\nimport { TextField, useTheme } from '@mui/material'\nimport { alphaCss } from '@xylabs/react-theme'\nimport { MIN_DOMAIN_LENGTH, XnsNameHelper } from '@xyo-network/xns-record-payloadset-plugins'\nimport React, {\n useLayoutEffect,\n useRef, useState,\n} from 'react'\n\nexport interface XnsEstimateNameTextFieldProps {\n maskOutput?: boolean\n}\n\nexport const XnsEstimateNameTextField: React.FC<XnsEstimateNameTextFieldProps & TextFieldProps> = ({\n maskOutput = true, onChange: onChangeProp, onBlur: onBlurProp, value, ...props\n}) => {\n const theme = useTheme()\n const [validLength, setValidLength] = useState(false)\n\n const inputRef = useRef<HTMLInputElement>(null)\n\n // watch for external changes to the value and update the validLength state\n const [previousValue, setPreviousValue] = useState<unknown>(value)\n if (value !== previousValue) {\n setPreviousValue(value)\n const validValueLength = !!(value && typeof value === 'string' && value.length >= MIN_DOMAIN_LENGTH)\n setValidLength(validValueLength)\n }\n\n // Update the input value when the value prop changes\n // The intent of this component is to remain uncontrolled to avoid the need to manage the value state\n // Therefore, we use useLayoutEffect to update the input value directly.\n useLayoutEffect(() => {\n if (inputRef.current && typeof value === 'string') {\n inputRef.current.value = value\n }\n }, [value])\n\n // override onChange to mask the input and update the event value\n const handleChange: StandardTextFieldProps['onChange'] = (event) => {\n if (maskOutput) {\n const value = event.target.value\n event.target.value = XnsNameHelper.mask(value)\n }\n onChangeProp?.(event)\n\n if (inputRef.current) {\n setValidLength(inputRef.current.value.length >= MIN_DOMAIN_LENGTH)\n }\n }\n\n // override onBlur to do a final mask of the input and update the event value\n const handleBlur: StandardTextFieldProps['onBlur'] = (event) => {\n if (maskOutput) {\n const value = event.target.value\n event.target.value = XnsNameHelper.mask(value, { maskStartEndHyphens: true })\n }\n onBlurProp?.(event)\n }\n\n return (\n <TextField\n inputRef={inputRef}\n onBlur={handleBlur}\n onChange={handleChange}\n {...props}\n slotProps={{ htmlInput: { style: { color: validLength ? theme.vars.palette.text.primary : alphaCss(theme.vars.palette.text.primary, 0.5) } } }}\n />\n )\n}\n","import {\n Alert, Snackbar, useMediaQuery, useTheme,\n} from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface XnsNameCaptureErrorsProps {\n error?: Error\n errorUi?: 'alert' | 'toast'\n resetError?: () => void\n}\n\nexport const XnsNameCaptureErrors: React.FC<XnsNameCaptureErrorsProps> = ({\n error, errorUi, resetError,\n}) => {\n const theme = useTheme()\n const isMobile = useMediaQuery(theme.breakpoints.down('md'))\n\n return (\n <>\n {(errorUi === 'toast')\n ? (\n <Snackbar\n open={!!error}\n message={error?.toString()}\n autoHideDuration={3000}\n onClose={() => resetError?.()}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}\n >\n <Alert\n severity=\"error\"\n sx={{\n width: '100%', display: (isMobile && !error) ? 'none' : undefined, visibility: error ? 'visible' : 'hidden',\n }}\n >\n {error?.message}\n </Alert>\n </Snackbar>\n )\n // eslint-disable-next-line react-x/unsupported-syntax\n : (() => {\n // setTimeout(() => setError(undefined), 1500)\n return (\n <FlexRow alignSelf=\"stretch\">\n <Alert\n severity=\"error\"\n sx={{ display: (isMobile && !error) ? 'none' : undefined, visibility: error ? 'visible' : 'hidden' }}\n >\n {error?.message}\n </Alert>\n </FlexRow>\n )\n })()}\n </>\n )\n}\n","import { useMemo } from 'react'\nimport { useNavigate, useSearchParams } from 'react-router-dom'\n\nimport type { XnsNameCaptureProps } from '../../Props.ts'\nimport { useXnsNameFromLocation } from './useXnsNameFromLocation.ts'\n\nexport const useXnsNameCaptureRouting = (props: XnsNameCaptureProps) => {\n const [params] = useSearchParams()\n\n const navigate = useNavigate()\n\n const [name, error] = useXnsNameFromLocation()\n\n return useMemo(() => ({\n ...props,\n defaultXnsName: name,\n routingError: error,\n navigate: props.navigate ?? ((to: string) => navigate(to)),\n paramsString: props.paramsString ? `${props.paramsString}${params.toString()}` : params.toString(),\n }), [props, name, error, params, navigate])\n}\n","import { useLocation } from 'react-router-dom'\n\n/**\n * Assumes the user was redirected with a link that contains a username query parameter.\n * @returns The xNS name from the URI username query parameter.\n */\nexport const useXnsNameFromLocation = (): [name: string | undefined, error: Error | undefined] => {\n const location = useLocation()\n const search = new URLSearchParams(location.search)\n const rawName = (search.get('xnsname') ?? search.get('name') ?? search.get('username') ?? '').toLowerCase()\n switch (rawName?.split('.').length) {\n case 1: {\n return [rawName, undefined]\n }\n case 2: {\n const rawNameParts = rawName.split('.')\n if (rawNameParts[1] !== 'xyo') {\n return [, new Error('Invalid xNS name [Bad root]')]\n }\n return [rawNameParts[0], undefined]\n }\n default: {\n return [, new Error('Invalid xNS name [Too many parts]')]\n }\n }\n}\n","import { ArrowForwardRounded } from '@mui/icons-material'\nimport { Stack } from '@mui/material'\nimport type { LinkExProps } from '@xylabs/react-link'\nimport { LinkEx } from '@xylabs/react-link'\nimport { useUserEvents } from '@xylabs/react-pixel'\nimport { XnsNameHelper } from '@xyo-network/xns-record-payloadset-plugins'\nimport type { Dispatch } from 'react'\nimport React from 'react'\n\nimport type {\n XnsNameCaptureBuyCallbacks, XnsNameCaptureRoutingProps, XnsNameCaptureTrackingProps,\n} from './Props.ts'\n\nexport type XnsCaptureSecondaryLinkProps = XnsNameCaptureTrackingProps & XnsNameCaptureRoutingProps & XnsNameCaptureBuyCallbacks & LinkExProps & {\n setError?: Dispatch<Error | undefined>\n text?: string\n xnsName: string\n}\n\nexport const XnsCaptureSecondaryLink: React.FC<XnsCaptureSecondaryLinkProps> = ({\n funnel = 'xns',\n navigate,\n onCaptureName,\n paramsString = '',\n intent,\n placement = '',\n setError,\n text = 'Or make a free reservation',\n to = '/xns/reservation',\n xnsName,\n ...props\n}) => {\n const userEvents = useUserEvents('warn')\n return (\n <LinkEx\n paddingX={0}\n color=\"inherit\"\n style={{ textDecoration: 'underline', textUnderlineOffset: '5px' }}\n onClick={async () => {\n const formattedXnsName = `${xnsName}.xyo`\n const helper = XnsNameHelper.fromString(formattedXnsName)\n const [valid, errors] = await helper.validate()\n if (valid) {\n await userEvents?.userClick({\n funnel, placement, intent,\n })\n navigate?.(`${to}?username=${xnsName}${paramsString}`)\n await onCaptureName?.(xnsName)\n } else {\n setError?.(new Error(errors.join(', ')))\n }\n }}\n {...props}\n >\n <Stack flexDirection=\"row\" gap={0.5} alignItems=\"center\" sx={{ cursor: 'pointer' }}>\n {text}\n <ArrowForwardRounded />\n </Stack>\n </LinkEx>\n )\n}\n","import { KeyboardArrowRightRounded } from '@mui/icons-material'\nimport type { StandardTextFieldProps } from '@mui/material'\nimport { useMediaQuery, useTheme } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport { MIN_DOMAIN_LENGTH, XnsNameHelper } from '@xyo-network/xns-record-payloadset-plugins'\nimport type { KeyboardEventHandler } from 'react'\nimport React, { useCallback, useState } from 'react'\n\nimport { XnsEstimateNameTextField } from '../EstimateName/index.ts'\nimport { XnsNameCaptureErrors } from './Errors.tsx'\nimport { navigateWithUsername } from './lib/index.ts'\nimport type { XnsNameCaptureProps } from './Props.ts'\nimport { XnsCaptureSecondaryLink } from './SecondaryLink.js'\n\nexport const XnsNameCapture: React.FC<XnsNameCaptureProps> = ({\n autoFocus = false,\n buttonText = 'Buy My Name',\n children,\n defaultXnsName,\n disabled,\n errorUi = 'alert',\n funnel = 'xns',\n intent = 'unset',\n mobileButtonText = 'Buy',\n navigate,\n onCaptureName: onCaptureNameProp,\n onNameChange,\n paramsString = '',\n placement = '',\n routingError,\n showSecondary = false,\n to = '/xns/estimation',\n ...props\n}) => {\n const [xnsName, setXnsName] = useState<string>(() => defaultXnsName ?? '')\n const [error, setError] = useState<Error | undefined>(routingError)\n\n const theme = useTheme()\n const isMobile = useMediaQuery(theme.breakpoints.down('md'))\n\n const captureDisabled = !xnsName || xnsName.length < MIN_DOMAIN_LENGTH\n\n const handleChange: StandardTextFieldProps['onChange'] = (event) => {\n const NsName = XnsNameHelper.mask(event.target.value)\n onNameChange?.(NsName)\n setXnsName(NsName)\n setError(undefined)\n }\n\n const onCaptureName = useCallback(async () => {\n if (captureDisabled) return\n const formattedXnsName = `${xnsName}.xyo`\n const helper = XnsNameHelper.fromString(formattedXnsName)\n const [valid, errors] = await helper.validate()\n if (valid) {\n await onCaptureNameProp?.(xnsName)\n\n navigateWithUsername(xnsName, paramsString, navigate, to)\n } else {\n setError(new Error(errors.join(', ')))\n }\n }, [captureDisabled, xnsName, onCaptureNameProp, paramsString, navigate, to])\n\n const onKeyDown: KeyboardEventHandler<HTMLDivElement> = useCallback(async (event) => {\n if (event.key === 'Enter' && !captureDisabled) {\n await onCaptureName?.()\n }\n }, [captureDisabled, onCaptureName])\n\n return (\n <FlexCol gap={showSecondary ? 1.5 : 0} alignItems=\"center\" {...props}>\n <FlexRow gap={1}>\n <XnsEstimateNameTextField\n autoFocus={autoFocus}\n disabled={disabled}\n label=\"xNS Name\"\n variant=\"outlined\"\n size=\"small\"\n value={xnsName ?? ''}\n onKeyDown={onKeyDown}\n onChange={handleChange}\n onBlur={handleChange}\n />\n <ButtonEx\n disabled={captureDisabled}\n funnel={funnel}\n intent={intent}\n placement={placement}\n variant=\"contained\"\n color=\"success\"\n endIcon={<KeyboardArrowRightRounded />}\n onClick={onCaptureName}\n >\n {isMobile ? mobileButtonText : buttonText}\n </ButtonEx>\n </FlexRow>\n {(showSecondary === true)\n ? (\n <XnsCaptureSecondaryLink\n xnsName={xnsName}\n placement={placement}\n funnel={funnel}\n setError={setError}\n />\n )\n : null}\n {\n // eslint-disable-next-line unicorn/prefer-logical-operator-over-ternary\n showSecondary ? showSecondary : null\n }\n {children}\n <XnsNameCaptureErrors error={error} errorUi={errorUi} resetError={() => setError(undefined)} />\n </FlexCol>\n )\n}\n","import type { To } from 'react-router-dom'\n\nexport const navigateWithUsername = (xnsName: string, paramsString: string, navigate?: ((to: string) => void), to?: To) => {\n // avoid duplicating the username param\n const params = new URLSearchParams(paramsString)\n const usernameParam = params.get('username')\n if (usernameParam) {\n // if username param is the same as the xnsName, navigate\n if (usernameParam === xnsName) {\n navigate?.(`${to}?${paramsString}`)\n }\n if (usernameParam !== xnsName) {\n // if username param is different, replace it\n params.set('username', xnsName)\n navigate?.(`${to}?${params.toString()}`)\n }\n } else {\n // if no username param, include it\n navigate?.(`${to}?username=${xnsName}&${paramsString}`)\n }\n}\n","import React, { useMemo } from 'react'\n\nimport { useXnsNameCaptureRouting } from './hooks/index.ts'\nimport type { XnsNameCaptureProps } from './Props.ts'\nimport { XnsNameCapture } from './XnsNameCapture.tsx'\n\nexport const XnsNameCaptureWithContext: React.FC<XnsNameCaptureProps> = (props) => {\n const routingProps = useXnsNameCaptureRouting(props)\n\n const updatedProps = useMemo<XnsNameCaptureProps>(() => ({\n ...props,\n ...routingProps,\n }), [routingProps, props])\n\n return (\n <XnsNameCapture {...updatedProps} />\n )\n}\n"],"mappings":";;;;AACA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,gBAAgB;AACzB,SAASC,mBAAmBC,qBAAqB;AACjD,OAAOC,SACLC,iBACAC,QAAQC,gBACH;AAMA,IAAMC,2BAAqF,wBAAC,EACjGC,aAAa,MAAMC,UAAUC,cAAcC,QAAQC,YAAYC,OAAO,GAAGC,MAAAA,MAC1E;AACC,QAAMC,QAAQC,SAAAA;AACd,QAAM,CAACC,aAAaC,cAAAA,IAAkBC,SAAS,KAAA;AAE/C,QAAMC,WAAWC,OAAyB,IAAA;AAG1C,QAAM,CAACC,eAAeC,gBAAAA,IAAoBJ,SAAkBN,KAAAA;AAC5D,MAAIA,UAAUS,eAAe;AAC3BC,qBAAiBV,KAAAA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;MAAQF,KAAK;OACZ,gBAAAF,OAAA,cAACK,0BAAAA;MACC1D;MACAI;MACAuD,OAAM;MACNC,SAAQ;MACRC,MAAK;MACLtB,OAAOpB,WAAW;MAClBgC;MACAW,UAAU7B;MACV8B,QAAQ9B;QAEV,gBAAAoB,OAAA,cAACW,UAAAA;MACC5D,UAAU0B;MACVxB;MACAC;MACAO;MACA8C,SAAQ;MACRK,OAAM;MACNC,SAAS,gBAAAb,OAAA,cAACc,2BAAAA,IAAAA;MACVC,SAAS1D;OAERgB,WAAWlB,mBAAmBP,UAAAA,CAAAA;IAGjCe,kBAAkB,OAEd,gBAAAqC,OAAA,cAACgB,yBAAAA;MACClD;MACAL;MACAR;MACAiB;SAGJ;;IAGFP,gBAAgBA,gBAAgB;IAEjCd;IACD,gBAAAmD,OAAA,cAACiB,sBAAAA;MAAqBhD;MAAcjB;MAAkBkE,YAAY,6BAAMhD,SAASiB,MAAAA,GAAf;;;AAGxE,GApG6D;;;AEf7D,OAAOgC,UAASC,WAAAA,gBAAe;AAMxB,IAAMC,4BAA2D,wBAACC,UAAAA;AACvE,QAAMC,eAAeC,yBAAyBF,KAAAA;AAE9C,QAAMG,eAAeC,SAA6B,OAAO;IACvD,GAAGJ;IACH,GAAGC;EACL,IAAI;IAACA;IAAcD;GAAM;AAEzB,SACE,gBAAAK,OAAA,cAACC,gBAAmBH,YAAAA;AAExB,GAXwE;","names":["TextField","useTheme","alphaCss","MIN_DOMAIN_LENGTH","XnsNameHelper","React","useLayoutEffect","useRef","useState","XnsEstimateNameTextField","maskOutput","onChange","onChangeProp","onBlur","onBlurProp","value","props","theme","useTheme","validLength","setValidLength","useState","inputRef","useRef","previousValue","setPreviousValue","validValueLength","length","MIN_DOMAIN_LENGTH","useLayoutEffect","current","handleChange","event","target","XnsNameHelper","mask","handleBlur","maskStartEndHyphens","TextField","slotProps","htmlInput","style","color","vars","palette","text","primary","alphaCss","Alert","Snackbar","useMediaQuery","useTheme","FlexRow","React","XnsNameCaptureErrors","error","errorUi","resetError","theme","useTheme","isMobile","useMediaQuery","breakpoints","down","React","Snackbar","open","message","toString","autoHideDuration","onClose","anchorOrigin","vertical","horizontal","Alert","severity","sx","width","display","undefined","visibility","FlexRow","alignSelf","useMemo","useNavigate","useSearchParams","useLocation","useXnsNameFromLocation","location","useLocation","search","URLSearchParams","rawName","get","toLowerCase","split","length","undefined","rawNameParts","Error","useXnsNameCaptureRouting","props","params","useSearchParams","navigate","useNavigate","name","error","useXnsNameFromLocation","useMemo","defaultXnsName","routingError","to","paramsString","toString","ArrowForwardRounded","Stack","LinkEx","useUserEvents","XnsNameHelper","React","XnsCaptureSecondaryLink","funnel","navigate","onCaptureName","paramsString","intent","placement","setError","text","to","xnsName","props","userEvents","useUserEvents","React","LinkEx","paddingX","color","style","textDecoration","textUnderlineOffset","onClick","formattedXnsName","helper","XnsNameHelper","fromString","valid","errors","validate","userClick","Error","join","Stack","flexDirection","gap","alignItems","sx","cursor","ArrowForwardRounded","KeyboardArrowRightRounded","useMediaQuery","useTheme","ButtonEx","FlexCol","FlexRow","MIN_DOMAIN_LENGTH","XnsNameHelper","React","useCallback","useState","navigateWithUsername","xnsName","paramsString","navigate","to","params","URLSearchParams","usernameParam","get","set","toString","XnsNameCapture","autoFocus","buttonText","children","defaultXnsName","disabled","errorUi","funnel","intent","mobileButtonText","navigate","onCaptureName","onCaptureNameProp","onNameChange","paramsString","placement","routingError","showSecondary","to","props","xnsName","setXnsName","useState","error","setError","theme","useTheme","isMobile","useMediaQuery","breakpoints","down","captureDisabled","length","MIN_DOMAIN_LENGTH","handleChange","event","NsName","XnsNameHelper","mask","target","value","undefined","useCallback","formattedXnsName","helper","fromString","valid","errors","validate","navigateWithUsername","Error","join","onKeyDown","key","React","FlexCol","gap","alignItems","FlexRow","XnsEstimateNameTextField","label","variant","size","onChange","onBlur","ButtonEx","color","endIcon","KeyboardArrowRightRounded","onClick","XnsCaptureSecondaryLink","XnsNameCaptureErrors","resetError","React","useMemo","XnsNameCaptureWithContext","props","routingProps","useXnsNameCaptureRouting","updatedProps","useMemo","React","XnsNameCapture"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-xns",
3
- "version": "7.5.5",
3
+ "version": "7.5.7",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -43,28 +43,29 @@
43
43
  "src"
44
44
  ],
45
45
  "dependencies": {
46
- "@xylabs/react-button": "~7.1.15",
47
- "@xylabs/react-flexbox": "~7.1.15",
48
- "@xylabs/react-link": "~7.1.15",
49
- "@xylabs/react-pixel": "~7.1.15",
50
- "@xylabs/react-theme": "~7.1.15",
46
+ "@xylabs/react-button": "~7.1.17",
47
+ "@xylabs/react-flexbox": "~7.1.17",
48
+ "@xylabs/react-link": "~7.1.17",
49
+ "@xylabs/react-pixel": "~7.1.17",
50
+ "@xylabs/react-theme": "~7.1.17",
51
51
  "@xyo-network/xns-record-payloadset-plugins": "~5.3.1"
52
52
  },
53
53
  "devDependencies": {
54
- "@mui/icons-material": "~7.3.8",
55
- "@mui/material": "~7.3.8",
56
- "@storybook/react-vite": "~10.2.9",
54
+ "@mui/icons-material": "~7.3.9",
55
+ "@mui/material": "~7.3.9",
56
+ "@storybook/react-vite": "~10.3.3",
57
57
  "@types/react": "^19.2.14",
58
- "@xylabs/ts-scripts-yarn3": "~7.3.2",
59
- "@xylabs/tsconfig": "~7.3.2",
60
- "@xylabs/tsconfig-dom": "~7.3.2",
61
- "@xylabs/tsconfig-react": "~7.3.2",
58
+ "@xylabs/ts-scripts-common": "~7.5.6",
59
+ "@xylabs/ts-scripts-yarn3": "~7.5.6",
60
+ "@xylabs/tsconfig": "~7.5.6",
61
+ "@xylabs/tsconfig-dom": "~7.5.6",
62
+ "@xylabs/tsconfig-react": "~7.5.6",
62
63
  "react": "^19.2.4",
63
64
  "react-dom": "^19.2.4",
64
- "react-router-dom": "^7.13.0",
65
- "storybook": "~10.2.9",
65
+ "react-router-dom": "^7.13.2",
66
+ "storybook": "~10.3.3",
66
67
  "typescript": "^5.9.3",
67
- "vite": "~7.3.1",
68
+ "vite": "~8.0.3",
68
69
  "zod": "^4.3.6"
69
70
  },
70
71
  "peerDependencies": {
@@ -3,7 +3,8 @@ import { TextField, useTheme } from '@mui/material'
3
3
  import { alphaCss } from '@xylabs/react-theme'
4
4
  import { MIN_DOMAIN_LENGTH, XnsNameHelper } from '@xyo-network/xns-record-payloadset-plugins'
5
5
  import React, {
6
- useLayoutEffect, useMemo, useRef, useState,
6
+ useLayoutEffect,
7
+ useRef, useState,
7
8
  } from 'react'
8
9
 
9
10
  export interface XnsEstimateNameTextFieldProps {
@@ -19,13 +20,15 @@ export const XnsEstimateNameTextField: React.FC<XnsEstimateNameTextFieldProps &
19
20
  const inputRef = useRef<HTMLInputElement>(null)
20
21
 
21
22
  // watch for external changes to the value and update the validLength state
22
- useMemo(() => {
23
+ const [previousValue, setPreviousValue] = useState<unknown>(value)
24
+ if (value !== previousValue) {
25
+ setPreviousValue(value)
23
26
  const validValueLength = !!(value && typeof value === 'string' && value.length >= MIN_DOMAIN_LENGTH)
24
27
  setValidLength(validValueLength)
25
- }, [value])
28
+ }
26
29
 
27
30
  // Update the input value when the value prop changes
28
- // NOTE: the intent of this component is to remain uncontrolled to avoid the need to manage the value state
31
+ // The intent of this component is to remain uncontrolled to avoid the need to manage the value state
29
32
  // Therefore, we use useLayoutEffect to update the input value directly.
30
33
  useLayoutEffect(() => {
31
34
  if (inputRef.current && typeof value === 'string') {
@@ -1,4 +1,3 @@
1
- /* eslint-disable react-x/jsx-no-iife */
2
1
  import {
3
2
  Alert, Snackbar, useMediaQuery, useTheme,
4
3
  } from '@mui/material'
@@ -38,6 +37,7 @@ export const XnsNameCaptureErrors: React.FC<XnsNameCaptureErrorsProps> = ({
38
37
  </Alert>
39
38
  </Snackbar>
40
39
  )
40
+ // eslint-disable-next-line react-x/unsupported-syntax
41
41
  : (() => {
42
42
  // setTimeout(() => setError(undefined), 1500)
43
43
  return (
@@ -60,7 +60,7 @@ export const XnsNameCapture: React.FC<XnsNameCaptureProps> = ({
60
60
  } else {
61
61
  setError(new Error(errors.join(', ')))
62
62
  }
63
- }, [paramsString, to, xnsName, onCaptureNameProp, navigate])
63
+ }, [captureDisabled, xnsName, onCaptureNameProp, paramsString, navigate, to])
64
64
 
65
65
  const onKeyDown: KeyboardEventHandler<HTMLDivElement> = useCallback(async (event) => {
66
66
  if (event.key === 'Enter' && !captureDisabled) {
@@ -17,5 +17,5 @@ export const useXnsNameCaptureRouting = (props: XnsNameCaptureProps) => {
17
17
  routingError: error,
18
18
  navigate: props.navigate ?? ((to: string) => navigate(to)),
19
19
  paramsString: props.paramsString ? `${props.paramsString}${params.toString()}` : params.toString(),
20
- }), [props, params, name, error])
20
+ }), [props, name, error, params, navigate])
21
21
  }
@@ -1,7 +0,0 @@
1
- import type { Meta } from '@storybook/react-vite';
2
- declare const _default: Meta;
3
- export default _default;
4
- declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./EstimateNameTextField.tsx").XnsEstimateNameTextFieldProps & import("@mui/material").TextFieldProps>;
5
- declare const WithExternalValue: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./EstimateNameTextField.tsx").XnsEstimateNameTextFieldProps & import("@mui/material").TextFieldProps>;
6
- export { Default, WithExternalValue };
7
- //# sourceMappingURL=EstimateNameTextField.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EstimateNameTextField.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/EstimateName/EstimateNameTextField.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;wBAKU,IAAI;AAAxE,wBAAwE;AAWxE,QAAA,MAAM,OAAO,2MAAoB,CAAA;AAGjC,QAAA,MAAM,iBAAiB,2MAAqC,CAAA;AAG5D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -1,7 +0,0 @@
1
- import type { Meta } from '@storybook/react-vite';
2
- declare const _default: Meta;
3
- export default _default;
4
- declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./SecondaryLink.tsx").XnsCaptureSecondaryLinkProps>;
5
- declare const WithOnBuyName: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./SecondaryLink.tsx").XnsCaptureSecondaryLinkProps>;
6
- export { Default, WithOnBuyName };
7
- //# sourceMappingURL=SecondaryLink.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SecondaryLink.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/XnsNameCapture/SecondaryLink.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;wBAKS,IAAI;AAAvE,wBAAuE;AAMvE,QAAA,MAAM,OAAO,yJAAoB,CAAA;AAGjC,QAAA,MAAM,aAAa,yJAAoB,CAAA;AAGvC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -1,7 +0,0 @@
1
- import type { Meta } from '@storybook/react-vite';
2
- declare const _default: Meta;
3
- export default _default;
4
- declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./Props.ts").XnsNameCaptureProps>;
5
- declare const WithOnBuyName: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./Props.ts").XnsNameCaptureProps>;
6
- export { Default, WithOnBuyName };
7
- //# sourceMappingURL=XnsNameCapture.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"XnsNameCapture.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/XnsNameCapture/XnsNameCapture.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;wBAMA,IAAI;AAA9D,wBAA8D;AAM9D,QAAA,MAAM,OAAO,uIAAoB,CAAA;AAGjC,QAAA,MAAM,aAAa,uIAAoB,CAAA;AAGvC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -1,9 +0,0 @@
1
- import type { Meta } from '@storybook/react-vite';
2
- declare const _default: Meta;
3
- export default _default;
4
- declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./Props.ts").XnsNameCaptureProps>;
5
- declare const WithOnCaptureName: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./Props.ts").XnsNameCaptureProps>;
6
- declare const WithBadXnsNameInRoute: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./Props.ts").XnsNameCaptureProps>;
7
- declare const WithUserName: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./Props.ts").XnsNameCaptureProps>;
8
- export { Default, WithBadXnsNameInRoute, WithOnCaptureName, WithUserName, };
9
- //# sourceMappingURL=XnsNameCaptureWithContext.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"XnsNameCaptureWithContext.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/XnsNameCapture/XnsNameCaptureWithContext.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACC,IAAI,EAChB,MAAM,uBAAuB,CAAA;wBAOuC,IAAI;AAAzE,wBAAyE;AA8BzE,QAAA,MAAM,OAAO,uIAAoB,CAAA;AAIjC,QAAA,MAAM,iBAAiB,uIAAoB,CAAA;AAI3C,QAAA,MAAM,qBAAqB,uIAAoB,CAAA;AAO/C,QAAA,MAAM,YAAY,uIAAoB,CAAA;AAItC,OAAO,EACL,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,YAAY,GAChE,CAAA"}