@medusajs/ui 2.2.3 → 2.2.4-next-20231213100322

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/cjs/components/avatar/avatar.d.ts +58 -4
  2. package/dist/cjs/components/avatar/avatar.js +5 -3
  3. package/dist/cjs/components/avatar/avatar.js.map +1 -1
  4. package/dist/cjs/components/badge/badge.d.ts +114 -6
  5. package/dist/cjs/components/badge/badge.js +4 -3
  6. package/dist/cjs/components/badge/badge.js.map +1 -1
  7. package/dist/cjs/components/button/button.d.ts +58 -4
  8. package/dist/cjs/components/button/button.js +3 -2
  9. package/dist/cjs/components/button/button.js.map +1 -1
  10. package/dist/cjs/components/currency-input/currency-input.d.ts +57 -3
  11. package/dist/cjs/components/currency-input/currency-input.js +3 -2
  12. package/dist/cjs/components/currency-input/currency-input.js.map +1 -1
  13. package/dist/cjs/components/date-picker/date-picker.js +3 -2
  14. package/dist/cjs/components/date-picker/date-picker.js.map +1 -1
  15. package/dist/cjs/components/heading/heading.d.ts +57 -3
  16. package/dist/cjs/components/heading/heading.js +3 -2
  17. package/dist/cjs/components/heading/heading.js.map +1 -1
  18. package/dist/cjs/components/hint/hint.d.ts +57 -3
  19. package/dist/cjs/components/hint/hint.js +3 -2
  20. package/dist/cjs/components/hint/hint.js.map +1 -1
  21. package/dist/cjs/components/icon-badge/icon-badge.d.ts +57 -3
  22. package/dist/cjs/components/icon-badge/icon-badge.js +3 -2
  23. package/dist/cjs/components/icon-badge/icon-badge.js.map +1 -1
  24. package/dist/cjs/components/icon-button/icon-button.d.ts +58 -4
  25. package/dist/cjs/components/icon-button/icon-button.js +3 -2
  26. package/dist/cjs/components/icon-button/icon-button.js.map +1 -1
  27. package/dist/cjs/components/input/input.d.ts +57 -3
  28. package/dist/cjs/components/input/input.js +3 -2
  29. package/dist/cjs/components/input/input.js.map +1 -1
  30. package/dist/cjs/components/label/label.d.ts +58 -4
  31. package/dist/cjs/components/label/label.js +3 -2
  32. package/dist/cjs/components/label/label.js.map +1 -1
  33. package/dist/cjs/components/select/select.js +3 -2
  34. package/dist/cjs/components/select/select.js.map +1 -1
  35. package/dist/cjs/components/switch/switch.d.ts +57 -3
  36. package/dist/cjs/components/switch/switch.js +5 -3
  37. package/dist/cjs/components/switch/switch.js.map +1 -1
  38. package/dist/cjs/components/text/text.d.ts +60 -6
  39. package/dist/cjs/components/text/text.js +2 -2
  40. package/dist/cjs/components/text/text.js.map +1 -1
  41. package/dist/cjs/hooks/use-prompt/{dialog.d.ts → render-prompt.d.ts} +2 -3
  42. package/dist/cjs/hooks/use-prompt/{dialog.js → render-prompt.js} +4 -3
  43. package/dist/cjs/hooks/use-prompt/render-prompt.js.map +1 -0
  44. package/dist/cjs/hooks/use-prompt/use-prompt.d.ts +3 -3
  45. package/dist/cjs/hooks/use-prompt/use-prompt.js +4 -4
  46. package/dist/cjs/hooks/use-prompt/use-prompt.js.map +1 -1
  47. package/dist/esm/components/avatar/avatar.d.ts +58 -4
  48. package/dist/esm/components/avatar/avatar.js +5 -3
  49. package/dist/esm/components/avatar/avatar.js.map +1 -1
  50. package/dist/esm/components/badge/badge.d.ts +114 -6
  51. package/dist/esm/components/badge/badge.js +4 -3
  52. package/dist/esm/components/badge/badge.js.map +1 -1
  53. package/dist/esm/components/button/button.d.ts +58 -4
  54. package/dist/esm/components/button/button.js +3 -2
  55. package/dist/esm/components/button/button.js.map +1 -1
  56. package/dist/esm/components/currency-input/currency-input.d.ts +57 -3
  57. package/dist/esm/components/currency-input/currency-input.js +3 -2
  58. package/dist/esm/components/currency-input/currency-input.js.map +1 -1
  59. package/dist/esm/components/date-picker/date-picker.js +3 -2
  60. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  61. package/dist/esm/components/heading/heading.d.ts +57 -3
  62. package/dist/esm/components/heading/heading.js +3 -2
  63. package/dist/esm/components/heading/heading.js.map +1 -1
  64. package/dist/esm/components/hint/hint.d.ts +57 -3
  65. package/dist/esm/components/hint/hint.js +3 -2
  66. package/dist/esm/components/hint/hint.js.map +1 -1
  67. package/dist/esm/components/icon-badge/icon-badge.d.ts +57 -3
  68. package/dist/esm/components/icon-badge/icon-badge.js +3 -2
  69. package/dist/esm/components/icon-badge/icon-badge.js.map +1 -1
  70. package/dist/esm/components/icon-button/icon-button.d.ts +58 -4
  71. package/dist/esm/components/icon-button/icon-button.js +3 -2
  72. package/dist/esm/components/icon-button/icon-button.js.map +1 -1
  73. package/dist/esm/components/input/input.d.ts +57 -3
  74. package/dist/esm/components/input/input.js +3 -2
  75. package/dist/esm/components/input/input.js.map +1 -1
  76. package/dist/esm/components/label/label.d.ts +58 -4
  77. package/dist/esm/components/label/label.js +3 -2
  78. package/dist/esm/components/label/label.js.map +1 -1
  79. package/dist/esm/components/select/select.js +3 -2
  80. package/dist/esm/components/select/select.js.map +1 -1
  81. package/dist/esm/components/switch/switch.d.ts +57 -3
  82. package/dist/esm/components/switch/switch.js +5 -3
  83. package/dist/esm/components/switch/switch.js.map +1 -1
  84. package/dist/esm/components/text/text.d.ts +60 -6
  85. package/dist/esm/components/text/text.js +2 -2
  86. package/dist/esm/components/text/text.js.map +1 -1
  87. package/dist/esm/hooks/use-prompt/{dialog.d.ts → render-prompt.d.ts} +2 -3
  88. package/dist/esm/hooks/use-prompt/{dialog.js → render-prompt.js} +2 -3
  89. package/dist/esm/hooks/use-prompt/render-prompt.js.map +1 -0
  90. package/dist/esm/hooks/use-prompt/use-prompt.d.ts +3 -3
  91. package/dist/esm/hooks/use-prompt/use-prompt.js +4 -4
  92. package/dist/esm/hooks/use-prompt/use-prompt.js.map +1 -1
  93. package/package.json +2 -2
  94. package/dist/cjs/hooks/use-prompt/dialog.js.map +0 -1
  95. package/dist/esm/hooks/use-prompt/dialog.js.map +0 -1
@@ -1,7 +1,61 @@
1
- import { VariantProps } from "class-variance-authority";
1
+ import { VariantProps } from "cva";
2
2
  import * as React from "react";
3
3
  declare const inputBaseStyles: string;
4
4
  declare const Input: React.ForwardRefExoticComponent<VariantProps<(props?: ({
5
- size?: "base" | "small" | null | undefined;
6
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
5
+ size?: "base" | "small" | undefined;
6
+ } & ({
7
+ class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
8
+ [x: string]: any;
9
+ } | null | undefined)[] | {
10
+ [x: string]: any;
11
+ } | null | undefined)[] | {
12
+ [x: string]: any;
13
+ } | null | undefined)[] | {
14
+ [x: string]: any;
15
+ } | null | undefined)[] | {
16
+ [x: string]: any;
17
+ } | null | undefined)[] | {
18
+ [x: string]: any;
19
+ } | null | undefined)[] | {
20
+ [x: string]: any;
21
+ } | null | undefined)[] | {
22
+ [x: string]: any;
23
+ } | null | undefined)[] | {
24
+ [x: string]: any;
25
+ } | null | undefined)[] | {
26
+ [x: string]: any;
27
+ } | null | undefined)[] | {
28
+ [x: string]: any;
29
+ } | null | undefined)[] | {
30
+ [x: string]: any;
31
+ } | null | undefined;
32
+ className?: undefined;
33
+ } | {
34
+ class?: undefined;
35
+ className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
36
+ [x: string]: any;
37
+ } | null | undefined)[] | {
38
+ [x: string]: any;
39
+ } | null | undefined)[] | {
40
+ [x: string]: any;
41
+ } | null | undefined)[] | {
42
+ [x: string]: any;
43
+ } | null | undefined)[] | {
44
+ [x: string]: any;
45
+ } | null | undefined)[] | {
46
+ [x: string]: any;
47
+ } | null | undefined)[] | {
48
+ [x: string]: any;
49
+ } | null | undefined)[] | {
50
+ [x: string]: any;
51
+ } | null | undefined)[] | {
52
+ [x: string]: any;
53
+ } | null | undefined)[] | {
54
+ [x: string]: any;
55
+ } | null | undefined)[] | {
56
+ [x: string]: any;
57
+ } | null | undefined)[] | {
58
+ [x: string]: any;
59
+ } | null | undefined;
60
+ })) | undefined) => string> & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
7
61
  export { Input, inputBaseStyles };
@@ -4,12 +4,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.inputBaseStyles = exports.Input = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const icons_1 = require("@medusajs/icons");
7
- const class_variance_authority_1 = require("class-variance-authority");
7
+ const cva_1 = require("cva");
8
8
  const React = tslib_1.__importStar(require("react"));
9
9
  const clx_1 = require("../../utils/clx");
10
10
  const inputBaseStyles = (0, clx_1.clx)("caret-ui-fg-base bg-ui-bg-field hover:bg-ui-bg-field-hover shadow-borders-base placeholder-ui-fg-muted text-ui-fg-base transition-fg relative w-full appearance-none rounded-md outline-none", "focus:shadow-borders-interactive-with-active", "disabled:text-ui-fg-disabled disabled:!bg-ui-bg-disabled disabled:placeholder-ui-fg-disabled disabled:cursor-not-allowed", "aria-[invalid=true]:!shadow-borders-error invalid:!shadow-borders-error");
11
11
  exports.inputBaseStyles = inputBaseStyles;
12
- const inputVariants = (0, class_variance_authority_1.cva)((0, clx_1.clx)(inputBaseStyles, "[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden"), {
12
+ const inputVariants = (0, cva_1.cva)({
13
+ base: (0, clx_1.clx)(inputBaseStyles, "[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden"),
13
14
  variants: {
14
15
  size: {
15
16
  base: "txt-compact-medium h-10 px-3 py-[9px]",
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../src/components/input/input.tsx"],"names":[],"mappings":";AAA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AAO;aACrC,EACD,SAAS,CACV,KACG,KAAK,GACT;QACD,QAAQ,IAAI,CACX,6BACE,SAAS,EAAE,IAAA,SAAG,EACZ,4EAA4E,EAC5E;gBACE,WAAW,EAAE,IAAI,KAAK,MAAM;gBAC5B,SAAS,EAAE,IAAI,KAAK,OAAO;aAC5B,CACF,EACD,IAAI,EAAC,KAAK;YAEV,oBAAC,2BAAmB,OAAG,CACnB,CACP;QACA,UAAU,IAAI,CACb,6BACE,SAAS,EAAE,IAAA,SAAG,EACZ,iEAAiE,EACjE;gBACE,WAAW,EAAE,IAAI,KAAK,MAAM;gBAC5B,SAAS,EAAE,IAAI,KAAK,OAAO;aAC5B,CACF;YAED,gCACE,SAAS,EAAC,iLAAiL,EAC3L,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;oBACZ,YAAY,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;gBAC9D,CAAC;gBAED,8BAAM,SAAS,EAAC,SAAS,IACtB,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CACxD;gBACN,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,oBAAC,WAAG,OAAG,CAAC,CAAC,CAAC,oBAAC,gBAAQ,OAAG,CAC3C,CACL,CACP,CACG,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAGO,sBAAK;AAFd,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA","sourcesContent":["\"use client\"\n\nimport { Eye, EyeSlash, MagnifyingGlassMini } from \"@medusajs/icons\"\nimport { VariantProps, cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst inputBaseStyles = clx(\n \"caret-ui-fg-base bg-ui-bg-field hover:bg-ui-bg-field-hover shadow-borders-base placeholder-ui-fg-muted text-ui-fg-base transition-fg relative w-full appearance-none rounded-md outline-none\",\n \"focus:shadow-borders-interactive-with-active\",\n \"disabled:text-ui-fg-disabled disabled:!bg-ui-bg-disabled disabled:placeholder-ui-fg-disabled disabled:cursor-not-allowed\",\n \"aria-[invalid=true]:!shadow-borders-error invalid:!shadow-borders-error\"\n)\n\nconst inputVariants = cva(\n clx(\n inputBaseStyles,\n \"[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden\"\n ),\n {\n variants: {\n size: {\n base: \"txt-compact-medium h-10 px-3 py-[9px]\",\n small: \"txt-compact-small h-8 px-2 py-[5px]\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n }\n)\n\nconst Input = React.forwardRef<\n HTMLInputElement,\n VariantProps<typeof inputVariants> &\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">\n>(({ className, type, size = \"base\", ...props }, ref) => {\n const [typeState, setTypeState] = React.useState(type)\n\n const isPassword = type === \"password\"\n const isSearch = type === \"search\"\n\n return (\n <div className=\"relative\">\n <input\n ref={ref}\n type={isPassword ? typeState : type}\n className={clx(\n inputVariants({ size: size }),\n {\n \"pr-11\": isPassword && size === \"base\",\n \"pl-11\": isSearch && size === \"base\",\n \"pr-9\": isPassword && size === \"small\",\n \"pl-9\": isSearch && size === \"small\",\n },\n className\n )}\n {...props}\n />\n {isSearch && (\n <div\n className={clx(\n \"text-ui-fg-muted absolute bottom-0 left-0 flex items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n role=\"img\"\n >\n <MagnifyingGlassMini />\n </div>\n )}\n {isPassword && (\n <div\n className={clx(\n \"absolute bottom-0 right-0 flex w-11 items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n >\n <button\n className=\"text-ui-fg-muted hover:text-ui-fg-base focus:text-ui-fg-base focus:shadow-borders-interactive-w-focus active:text-ui-fg-base h-fit w-fit rounded-sm outline-none transition-all\"\n type=\"button\"\n onClick={() => {\n setTypeState(typeState === \"password\" ? \"text\" : \"password\")\n }}\n >\n <span className=\"sr-only\">\n {typeState === \"password\" ? \"Show password\" : \"Hide password\"}\n </span>\n {typeState === \"password\" ? <Eye /> : <EyeSlash />}\n </button>\n </div>\n )}\n </div>\n )\n})\nInput.displayName = \"Input\"\n\nexport { Input, inputBaseStyles }\n"]}
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../src/components/input/input.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAoE;AACpE,6BAAuC;AACvC,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,eAAe,GAAG,IAAA,SAAG,EACzB,8LAA8L,EAC9L,8CAA8C,EAC9C,0HAA0H,EAC1H,0EAA0E,CAC3E,CAAA;AAwFe,0CAAe;AAtF/B,MAAM,aAAa,GAAG,IAAA,SAAG,EAAC;IACxB,IAAI,EAAE,IAAA,SAAG,EACP,eAAe,EACf,0HAA0H,CAC3H;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,uCAAuC;YAC7C,KAAK,EAAE,qCAAqC;SAC7C;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CAAA;AAEF,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAI5B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACtD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAEtD,MAAM,UAAU,GAAG,IAAI,KAAK,UAAU,CAAA;IACtC,MAAM,QAAQ,GAAG,IAAI,KAAK,QAAQ,CAAA;IAElC,OAAO,CACL,6BAAK,SAAS,EAAC,UAAU;QACvB,+BACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,UAAU,CAAC,CAAC,CAA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AAC,WAAW,GAAG,OAAO,CAAA","sourcesContent":["\"use client\"\n\nimport { Eye, EyeSlash, MagnifyingGlassMini } from \"@medusajs/icons\"\nimport { VariantProps, cva } from \"cva\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst inputBaseStyles = clx(\n \"caret-ui-fg-base bg-ui-bg-field hover:bg-ui-bg-field-hover shadow-borders-base placeholder-ui-fg-muted text-ui-fg-base transition-fg relative w-full appearance-none rounded-md outline-none\",\n \"focus:shadow-borders-interactive-with-active\",\n \"disabled:text-ui-fg-disabled disabled:!bg-ui-bg-disabled disabled:placeholder-ui-fg-disabled disabled:cursor-not-allowed\",\n \"aria-[invalid=true]:!shadow-borders-error invalid:!shadow-borders-error\"\n)\n\nconst inputVariants = cva({\n base: clx(\n inputBaseStyles,\n \"[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden\"\n ),\n variants: {\n size: {\n base: \"txt-compact-medium h-10 px-3 py-[9px]\",\n small: \"txt-compact-small h-8 px-2 py-[5px]\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n})\n\nconst Input = React.forwardRef<\n HTMLInputElement,\n VariantProps<typeof inputVariants> &\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">\n>(({ className, type, size = \"base\", ...props }, ref) => {\n const [typeState, setTypeState] = React.useState(type)\n\n const isPassword = type === \"password\"\n const isSearch = type === \"search\"\n\n return (\n <div className=\"relative\">\n <input\n ref={ref}\n type={isPassword ? typeState : type}\n className={clx(\n inputVariants({ size: size }),\n {\n \"pr-11\": isPassword && size === \"base\",\n \"pl-11\": isSearch && size === \"base\",\n \"pr-9\": isPassword && size === \"small\",\n \"pl-9\": isSearch && size === \"small\",\n },\n className\n )}\n {...props}\n />\n {isSearch && (\n <div\n className={clx(\n \"text-ui-fg-muted absolute bottom-0 left-0 flex items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n role=\"img\"\n >\n <MagnifyingGlassMini />\n </div>\n )}\n {isPassword && (\n <div\n className={clx(\n \"absolute bottom-0 right-0 flex w-11 items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n >\n <button\n className=\"text-ui-fg-muted hover:text-ui-fg-base focus:text-ui-fg-base focus:shadow-borders-interactive-w-focus active:text-ui-fg-base h-fit w-fit rounded-sm outline-none transition-all\"\n type=\"button\"\n onClick={() => {\n setTypeState(typeState === \"password\" ? \"text\" : \"password\")\n }}\n >\n <span className=\"sr-only\">\n {typeState === \"password\" ? \"Show password\" : \"Hide password\"}\n </span>\n {typeState === \"password\" ? <Eye /> : <EyeSlash />}\n </button>\n </div>\n )}\n </div>\n )\n})\nInput.displayName = \"Input\"\n\nexport { Input, inputBaseStyles }\n"]}
@@ -1,9 +1,63 @@
1
- import { type VariantProps } from "class-variance-authority";
1
+ import { type VariantProps } from "cva";
2
2
  import * as React from "react";
3
3
  declare const labelVariants: (props?: ({
4
- size?: "base" | "large" | "small" | "xsmall" | null | undefined;
5
- weight?: "regular" | "plus" | null | undefined;
6
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
4
+ size?: "base" | "large" | "small" | "xsmall" | undefined;
5
+ weight?: "regular" | "plus" | undefined;
6
+ } & ({
7
+ class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
8
+ [x: string]: any;
9
+ } | null | undefined)[] | {
10
+ [x: string]: any;
11
+ } | null | undefined)[] | {
12
+ [x: string]: any;
13
+ } | null | undefined)[] | {
14
+ [x: string]: any;
15
+ } | null | undefined)[] | {
16
+ [x: string]: any;
17
+ } | null | undefined)[] | {
18
+ [x: string]: any;
19
+ } | null | undefined)[] | {
20
+ [x: string]: any;
21
+ } | null | undefined)[] | {
22
+ [x: string]: any;
23
+ } | null | undefined)[] | {
24
+ [x: string]: any;
25
+ } | null | undefined)[] | {
26
+ [x: string]: any;
27
+ } | null | undefined)[] | {
28
+ [x: string]: any;
29
+ } | null | undefined)[] | {
30
+ [x: string]: any;
31
+ } | null | undefined;
32
+ className?: undefined;
33
+ } | {
34
+ class?: undefined;
35
+ className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
36
+ [x: string]: any;
37
+ } | null | undefined)[] | {
38
+ [x: string]: any;
39
+ } | null | undefined)[] | {
40
+ [x: string]: any;
41
+ } | null | undefined)[] | {
42
+ [x: string]: any;
43
+ } | null | undefined)[] | {
44
+ [x: string]: any;
45
+ } | null | undefined)[] | {
46
+ [x: string]: any;
47
+ } | null | undefined)[] | {
48
+ [x: string]: any;
49
+ } | null | undefined)[] | {
50
+ [x: string]: any;
51
+ } | null | undefined)[] | {
52
+ [x: string]: any;
53
+ } | null | undefined)[] | {
54
+ [x: string]: any;
55
+ } | null | undefined)[] | {
56
+ [x: string]: any;
57
+ } | null | undefined)[] | {
58
+ [x: string]: any;
59
+ } | null | undefined;
60
+ })) | undefined) => string;
7
61
  interface LabelProps extends React.ComponentPropsWithoutRef<"label">, VariantProps<typeof labelVariants> {
8
62
  }
9
63
  declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
@@ -4,10 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Label = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const Primitives = tslib_1.__importStar(require("@radix-ui/react-label"));
7
- const class_variance_authority_1 = require("class-variance-authority");
7
+ const cva_1 = require("cva");
8
8
  const React = tslib_1.__importStar(require("react"));
9
9
  const clx_1 = require("../../utils/clx");
10
- const labelVariants = (0, class_variance_authority_1.cva)("font-sans", {
10
+ const labelVariants = (0, cva_1.cva)({
11
+ base: "font-sans",
11
12
  variants: {
12
13
  size: {
13
14
  xsmall: "txt-compact-xsmall",
@@ -1 +1 @@
1
- {"version":3,"file":"label.js","sourceRoot":"","sources":["../../../../src/components/label/label.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,0EAAmD;AACnD,uEAAiE;AACjE,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,aAAa,GAAG,IAAA,8BAAG,EAAC,WAAW,EAAE;IACrC,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,MAAM,EAAE,oBAAoB;YAC5B,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,mBAAmB;SAC3B;QACD,MAAM,EAAE;YACN,OAAO,EAAE,aAAa;YACtB,IAAI,EAAE,aAAa;SACpB;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,SAAS;KAClB;CACF,CAAC,CAAA;AAMF,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAClE,OAAO,CACL,oBAAC,UAAU,CAAC,IAAI,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,CAAC,KACtD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CACF,CAAA;AAGQ,sBAAK;AAFd,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA","sourcesContent":["\"use client\"\n\nimport * as Primitives from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst labelVariants = cva(\"font-sans\", {\n variants: {\n size: {\n xsmall: \"txt-compact-xsmall\",\n small: \"txt-compact-small\",\n base: \"txt-compact-medium\",\n large: \"txt-compact-large\",\n },\n weight: {\n regular: \"font-normal\",\n plus: \"font-medium\",\n },\n },\n defaultVariants: {\n size: \"base\",\n weight: \"regular\",\n },\n})\n\ninterface LabelProps\n extends React.ComponentPropsWithoutRef<\"label\">,\n VariantProps<typeof labelVariants> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, size = \"base\", weight = \"regular\", ...props }, ref) => {\n return (\n <Primitives.Root\n ref={ref}\n className={clx(labelVariants({ size, weight }), className)}\n {...props}\n />\n )\n }\n)\nLabel.displayName = \"Label\"\n\nexport { Label }\n"]}
1
+ {"version":3,"file":"label.js","sourceRoot":"","sources":["../../../../src/components/label/label.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,0EAAmD;AACnD,6BAA4C;AAC5C,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,aAAa,GAAG,IAAA,SAAG,EAAC;IACxB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,MAAM,EAAE,oBAAoB;YAC5B,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,mBAAmB;SAC3B;QACD,MAAM,EAAE;YACN,OAAO,EAAE,aAAa;YACtB,IAAI,EAAE,aAAa;SACpB;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,SAAS;KAClB;CACF,CAAC,CAAA;AAMF,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAClE,OAAO,CACL,oBAAC,UAAU,CAAC,IAAI,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,CAAC,KACtD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CACF,CAAA;AAGQ,sBAAK;AAFd,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA","sourcesContent":["\"use client\"\n\nimport * as Primitives from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"cva\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst labelVariants = cva({\n base: \"font-sans\",\n variants: {\n size: {\n xsmall: \"txt-compact-xsmall\",\n small: \"txt-compact-small\",\n base: \"txt-compact-medium\",\n large: \"txt-compact-large\",\n },\n weight: {\n regular: \"font-normal\",\n plus: \"font-medium\",\n },\n },\n defaultVariants: {\n size: \"base\",\n weight: \"regular\",\n },\n})\n\ninterface LabelProps\n extends React.ComponentPropsWithoutRef<\"label\">,\n VariantProps<typeof labelVariants> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, size = \"base\", weight = \"regular\", ...props }, ref) => {\n return (\n <Primitives.Root\n ref={ref}\n className={clx(labelVariants({ size, weight }), className)}\n {...props}\n />\n )\n }\n)\nLabel.displayName = \"Label\"\n\nexport { Label }\n"]}
@@ -5,7 +5,7 @@ exports.Select = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const icons_1 = require("@medusajs/icons");
7
7
  const SelectPrimitive = tslib_1.__importStar(require("@radix-ui/react-select"));
8
- const class_variance_authority_1 = require("class-variance-authority");
8
+ const cva_1 = require("cva");
9
9
  const React = tslib_1.__importStar(require("react"));
10
10
  const clx_1 = require("../../utils/clx");
11
11
  const SelectContext = React.createContext(null);
@@ -22,7 +22,8 @@ const Root = ({ children, size = "base", ...props }) => {
22
22
  };
23
23
  const Group = SelectPrimitive.Group;
24
24
  const Value = SelectPrimitive.Value;
25
- const triggerVariants = (0, class_variance_authority_1.cva)((0, clx_1.clx)("bg-ui-bg-field txt-compact-medium shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md outline-none", "data-[placeholder]:text-ui-fg-muted text-ui-fg-base", "hover:bg-ui-bg-field-hover", "focus:shadow-borders-interactive-with-active data-[state=open]:!shadow-borders-interactive-with-active", "aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error", "invalid::border-ui-border-error invalid:shadow-borders-error", "disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled", "group/trigger"), {
25
+ const triggerVariants = (0, cva_1.cva)({
26
+ base: (0, clx_1.clx)("bg-ui-bg-field txt-compact-medium shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md outline-none", "data-[placeholder]:text-ui-fg-muted text-ui-fg-base", "hover:bg-ui-bg-field-hover", "focus:shadow-borders-interactive-with-active data-[state=open]:!shadow-borders-interactive-with-active", "aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error", "invalid::border-ui-border-error invalid:shadow-borders-error", "disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled", "group/trigger"),
26
27
  variants: {
27
28
  size: {
28
29
  base: "h-10 px-3 py-[9px]",
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAiE;AACjE,gFAAyD;AACzD,uEAA8C;AAC9C,qDAA8B;AAE9B,qCAAiC;AAWjC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAA4B,IAAI,CAAC,CAAA;AAE1E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;IAE/C,IAAI,OAAO,KAAK,IAAI,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;KACzE;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,IAAI,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,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imitive from \"@radix-ui/react-select\"\nimport { cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\ninterface SelectProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root> {\n size?: \"base\" | \"small\"\n}\n\ntype SelectContextValue = {\n size: \"base\" | \"small\"\n}\n\nconst SelectContext = React.createContext<SelectContextValue | null>(null)\n\nconst useSelectContext = () => {\n const context = React.useContext(SelectContext)\n\n if (context === null) {\n throw new Error(\"useSelectContext must be used within a SelectProvider\")\n }\n\n return context\n}\n\nconst Root = ({ children, size = \"base\", ...props }: SelectProps) => {\n return (\n <SelectContext.Provider value={React.useMemo(() => ({ size }), [size])}>\n <SelectPrimitive.Root {...props}>{children}</SelectPrimitive.Root>\n </SelectContext.Provider>\n )\n}\n\nconst Group = SelectPrimitive.Group\n\nconst Value = SelectPrimitive.Value\n\nconst triggerVariants = cva(\n clx(\n \"bg-ui-bg-field txt-compact-medium shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md outline-none\",\n \"data-[placeholder]:text-ui-fg-muted text-ui-fg-base\",\n \"hover:bg-ui-bg-field-hover\",\n \"focus:shadow-borders-interactive-with-active data-[state=open]:!shadow-borders-interactive-with-active\",\n \"aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error\",\n \"invalid::border-ui-border-error invalid:shadow-borders-error\",\n \"disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled\",\n \"group/trigger\"\n ),\n {\n variants: {\n size: {\n base: \"h-10 px-3 py-[9px]\",\n small: \"h-8 px-2 py-[5px]\",\n },\n },\n }\n)\n\nconst Trigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => {\n const { size } = useSelectContext()\n\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={clx(triggerVariants({ size }), className)}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronUpDown className=\"text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n sideOffset = 8,\n collisionPadding = 24,\n ...props\n },\n ref\n ) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout relative max-h-[200px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-lg\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n {\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\":\n position === \"popper\",\n },\n className\n )}\n position={position}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={clx(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n)\nContent.displayName = SelectPrimitive.Content.displayName\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={clx(\n \"txt-compact-xsmall-plus text-ui-fg-subtle px-3 py-2\",\n className\n )}\n {...props}\n />\n))\nLabel.displayName = SelectPrimitive.Label.displayName\n\nconst Item = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => {\n const { size } = useSelectContext()\n\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={clx(\n \"txt-compact-medium bg-ui-bg-base grid cursor-pointer grid-cols-[20px_1fr] gap-x-2 rounded-md px-3 py-2 outline-none transition-colors\",\n \"hover:bg-ui-bg-base-hover focus:bg-ui-bg-base-hover\",\n {\n \"txt-compact-medium data-[state=checked]:txt-compact-medium-plus\":\n size === \"base\",\n \"txt-compact-small data-[state=checked]:txt-compact-medium-plus\":\n size === \"small\",\n },\n className\n )}\n {...props}\n >\n <span className=\"flex h-5 w-5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <EllipseMiniSolid />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText className=\"flex-1 truncate\">\n {children}\n </SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n})\nItem.displayName = SelectPrimitive.Item.displayName\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={clx(\"bg-ui-border-base -mx-1 my-1 h-px\", className)}\n {...props}\n />\n))\nSeparator.displayName = SelectPrimitive.Separator.displayName\n\nconst Select = Object.assign(Root, {\n Group,\n Value,\n Trigger,\n Content,\n Label,\n Item,\n Separator,\n})\n\nexport { Select }\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAiE;AACjE,gFAAyD;AACzD,6BAAyB;AACzB,qD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AS,EAAE,IAAA,SAAG,EAAC,mCAAmC,EAAE,SAAS,CAAC,KAC1D,KAAK,GACT,CACH,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,WAAW,CAAA;AAE7D,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACjC,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,KAAK;IACL,IAAI;IACJ,SAAS;CACV,CAAC,CAAA;AAEO,wBAAM","sourcesContent":["\"use client\"\n\nimport { ChevronUpDown, EllipseMiniSolid } from \"@medusajs/icons\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { cva } from \"cva\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\ninterface SelectProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root> {\n size?: \"base\" | \"small\"\n}\n\ntype SelectContextValue = {\n size: \"base\" | \"small\"\n}\n\nconst SelectContext = React.createContext<SelectContextValue | null>(null)\n\nconst useSelectContext = () => {\n const context = React.useContext(SelectContext)\n\n if (context === null) {\n throw new Error(\"useSelectContext must be used within a SelectProvider\")\n }\n\n return context\n}\n\nconst Root = ({ children, size = \"base\", ...props }: SelectProps) => {\n return (\n <SelectContext.Provider value={React.useMemo(() => ({ size }), [size])}>\n <SelectPrimitive.Root {...props}>{children}</SelectPrimitive.Root>\n </SelectContext.Provider>\n )\n}\n\nconst Group = SelectPrimitive.Group\n\nconst Value = SelectPrimitive.Value\n\nconst triggerVariants = cva({\n base: clx(\n \"bg-ui-bg-field txt-compact-medium shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md outline-none\",\n \"data-[placeholder]:text-ui-fg-muted text-ui-fg-base\",\n \"hover:bg-ui-bg-field-hover\",\n \"focus:shadow-borders-interactive-with-active data-[state=open]:!shadow-borders-interactive-with-active\",\n \"aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error\",\n \"invalid::border-ui-border-error invalid:shadow-borders-error\",\n \"disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled\",\n \"group/trigger\"\n ),\n variants: {\n size: {\n base: \"h-10 px-3 py-[9px]\",\n small: \"h-8 px-2 py-[5px]\",\n },\n },\n})\n\nconst Trigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => {\n const { size } = useSelectContext()\n\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={clx(triggerVariants({ size }), className)}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronUpDown className=\"text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n sideOffset = 8,\n collisionPadding = 24,\n ...props\n },\n ref\n ) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout relative max-h-[200px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-lg\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n {\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\":\n position === \"popper\",\n },\n className\n )}\n position={position}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={clx(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n)\nContent.displayName = SelectPrimitive.Content.displayName\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={clx(\n \"txt-compact-xsmall-plus text-ui-fg-subtle px-3 py-2\",\n className\n )}\n {...props}\n />\n))\nLabel.displayName = SelectPrimitive.Label.displayName\n\nconst Item = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => {\n const { size } = useSelectContext()\n\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={clx(\n \"txt-compact-medium bg-ui-bg-base grid cursor-pointer grid-cols-[20px_1fr] gap-x-2 rounded-md px-3 py-2 outline-none transition-colors\",\n \"hover:bg-ui-bg-base-hover focus:bg-ui-bg-base-hover\",\n {\n \"txt-compact-medium data-[state=checked]:txt-compact-medium-plus\":\n size === \"base\",\n \"txt-compact-small data-[state=checked]:txt-compact-medium-plus\":\n size === \"small\",\n },\n className\n )}\n {...props}\n >\n <span className=\"flex h-5 w-5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <EllipseMiniSolid />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText className=\"flex-1 truncate\">\n {children}\n </SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n})\nItem.displayName = SelectPrimitive.Item.displayName\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={clx(\"bg-ui-border-base -mx-1 my-1 h-px\", className)}\n {...props}\n />\n))\nSeparator.displayName = SelectPrimitive.Separator.displayName\n\nconst Select = Object.assign(Root, {\n Group,\n Value,\n Trigger,\n Content,\n Label,\n Item,\n Separator,\n})\n\nexport { Select }\n"]}
@@ -1,9 +1,63 @@
1
1
  import * as Primitives from "@radix-ui/react-switch";
2
- import { VariantProps } from "class-variance-authority";
2
+ import { VariantProps } from "cva";
3
3
  import * as React from "react";
4
4
  declare const switchVariants: (props?: ({
5
- size?: "base" | "small" | null | undefined;
6
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
5
+ size?: "base" | "small" | undefined;
6
+ } & ({
7
+ class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
8
+ [x: string]: any;
9
+ } | null | undefined)[] | {
10
+ [x: string]: any;
11
+ } | null | undefined)[] | {
12
+ [x: string]: any;
13
+ } | null | undefined)[] | {
14
+ [x: string]: any;
15
+ } | null | undefined)[] | {
16
+ [x: string]: any;
17
+ } | null | undefined)[] | {
18
+ [x: string]: any;
19
+ } | null | undefined)[] | {
20
+ [x: string]: any;
21
+ } | null | undefined)[] | {
22
+ [x: string]: any;
23
+ } | null | undefined)[] | {
24
+ [x: string]: any;
25
+ } | null | undefined)[] | {
26
+ [x: string]: any;
27
+ } | null | undefined)[] | {
28
+ [x: string]: any;
29
+ } | null | undefined)[] | {
30
+ [x: string]: any;
31
+ } | null | undefined;
32
+ className?: undefined;
33
+ } | {
34
+ class?: undefined;
35
+ className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
36
+ [x: string]: any;
37
+ } | null | undefined)[] | {
38
+ [x: string]: any;
39
+ } | null | undefined)[] | {
40
+ [x: string]: any;
41
+ } | null | undefined)[] | {
42
+ [x: string]: any;
43
+ } | null | undefined)[] | {
44
+ [x: string]: any;
45
+ } | null | undefined)[] | {
46
+ [x: string]: any;
47
+ } | null | undefined)[] | {
48
+ [x: string]: any;
49
+ } | null | undefined)[] | {
50
+ [x: string]: any;
51
+ } | null | undefined)[] | {
52
+ [x: string]: any;
53
+ } | null | undefined)[] | {
54
+ [x: string]: any;
55
+ } | null | undefined)[] | {
56
+ [x: string]: any;
57
+ } | null | undefined)[] | {
58
+ [x: string]: any;
59
+ } | null | undefined;
60
+ })) | undefined) => string;
7
61
  interface SwitchProps extends Omit<React.ComponentPropsWithoutRef<typeof Primitives.Root>, "asChild">, VariantProps<typeof switchVariants> {
8
62
  }
9
63
  declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
@@ -4,10 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Switch = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const Primitives = tslib_1.__importStar(require("@radix-ui/react-switch"));
7
- const class_variance_authority_1 = require("class-variance-authority");
7
+ const cva_1 = require("cva");
8
8
  const React = tslib_1.__importStar(require("react"));
9
9
  const clx_1 = require("../../utils/clx");
10
- const switchVariants = (0, class_variance_authority_1.cva)("bg-ui-bg-switch-off hover:bg-ui-bg-switch-off-hover data-[state=unchecked]:hover:after:bg-switch-off-hover-gradient before:shadow-details-switch-background focus:shadow-details-switch-background-focus data-[state=checked]:bg-ui-bg-interactive disabled:!bg-ui-bg-disabled group relative inline-flex items-center rounded-full outline-none transition-all before:absolute before:inset-0 before:rounded-full before:content-[''] after:absolute after:inset-0 after:rounded-full after:content-[''] disabled:cursor-not-allowed", {
10
+ const switchVariants = (0, cva_1.cva)({
11
+ base: "bg-ui-bg-switch-off hover:bg-ui-bg-switch-off-hover data-[state=unchecked]:hover:after:bg-switch-off-hover-gradient before:shadow-details-switch-background focus:shadow-details-switch-background-focus data-[state=checked]:bg-ui-bg-interactive disabled:!bg-ui-bg-disabled group relative inline-flex items-center rounded-full outline-none transition-all before:absolute before:inset-0 before:rounded-full before:content-[''] after:absolute after:inset-0 after:rounded-full after:content-[''] disabled:cursor-not-allowed",
11
12
  variants: {
12
13
  size: {
13
14
  small: "h-[16px] w-[28px]",
@@ -18,7 +19,8 @@ const switchVariants = (0, class_variance_authority_1.cva)("bg-ui-bg-switch-off
18
19
  size: "base",
19
20
  },
20
21
  });
21
- const thumbVariants = (0, class_variance_authority_1.cva)("bg-ui-fg-on-color shadow-details-switch-handle group-disabled:bg-ui-fg-disabled pointer-events-none h-[14px] w-[14px] rounded-full transition-all group-disabled:shadow-none", {
22
+ const thumbVariants = (0, cva_1.cva)({
23
+ base: "bg-ui-fg-on-color shadow-details-switch-handle group-disabled:bg-ui-fg-disabled pointer-events-none h-[14px] w-[14px] rounded-full transition-all group-disabled:shadow-none",
22
24
  variants: {
23
25
  size: {
24
26
  small: "h-[12px] w-[12px] data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0.5",
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../../src/components/switch/switch.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2EAAoD;AACpD,uEAA4D;AAC5D,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,cAAc,GAAG,IAAA,8BAAG,EACxB,ugBAAugB,EACvgB;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE,mBAAmB;SAC1B;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;CACF,CACF,CAAA;AAED,MAAM,aAAa,GAAG,IAAA,8BAAG,EACvB,8KAA8K,EAC9K;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,KAAK,EACH,+FAA+F;YACjG,IAAI,EAAE,kHAAkH;SACzH;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;CACF,CACF,CAAA;AASD,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAG7B,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACjD,oBAAC,UAAU,CAAC,IAAI,IACd,SAAS,EAAE,IAAA,SAAG,EAAC,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KAC/C,KAAK,EACT,GAAG,EAAE,GAAG;IAER,oBAAC,UAAU,CAAC,KAAK,IAAC,SAAS,EAAE,IAAA,SAAG,EAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAI,CAC7C,CACnB,CAAC,CAAA;AAGO,wBAAM;AAFf,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA","sourcesContent":["\"use client\"\n\nimport * as Primitives from \"@radix-ui/react-switch\"\nimport { VariantProps, cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst switchVariants = cva(\n \"bg-ui-bg-switch-off hover:bg-ui-bg-switch-off-hover data-[state=unchecked]:hover:after:bg-switch-off-hover-gradient before:shadow-details-switch-background focus:shadow-details-switch-background-focus data-[state=checked]:bg-ui-bg-interactive disabled:!bg-ui-bg-disabled group relative inline-flex items-center rounded-full outline-none transition-all before:absolute before:inset-0 before:rounded-full before:content-[''] after:absolute after:inset-0 after:rounded-full after:content-[''] disabled:cursor-not-allowed\",\n {\n variants: {\n size: {\n small: \"h-[16px] w-[28px]\",\n base: \"h-[18px] w-[32px]\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n }\n)\n\nconst thumbVariants = cva(\n \"bg-ui-fg-on-color shadow-details-switch-handle group-disabled:bg-ui-fg-disabled pointer-events-none h-[14px] w-[14px] rounded-full transition-all group-disabled:shadow-none\",\n {\n variants: {\n size: {\n small:\n \"h-[12px] w-[12px] data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0.5\",\n base: \"h-[14px] w-[14px] transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n }\n)\n\ninterface SwitchProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof Primitives.Root>,\n \"asChild\"\n >,\n VariantProps<typeof switchVariants> {}\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof Primitives.Root>,\n SwitchProps\n>(({ className, size = \"base\", ...props }, ref) => (\n <Primitives.Root\n className={clx(switchVariants({ size }), className)}\n {...props}\n ref={ref}\n >\n <Primitives.Thumb className={clx(thumbVariants({ size }))} />\n </Primitives.Root>\n))\nSwitch.displayName = \"Switch\"\n\nexport { Switch }\n"]}
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../../src/components/switch/switch.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2EAAoD;AACpD,6BAAuC;AACvC,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,cAAc,GAAG,IAAA,SAAG,EAAC;IACzB,IAAI,EAAE,ugBAAugB;IAC7gB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE,mBAAmB;SAC1B;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,IAAA,SAAG,EAAC;IACxB,IAAI,EAAE,8KAA8K;IACpL,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,KAAK,EACH,+FAA+F;YACjG,IAAI,EAAE,kHAAkH;SACzH;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CAAA;AASF,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAG7B,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACjD,oBAAC,UAAU,CAAC,IAAI,IACd,SAAS,EAAE,IAAA,SAAG,EAAC,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KAC/C,KAAK,EACT,GAAG,EAAE,GAAG;IAER,oBAAC,UAAU,CAAC,KAAK,IAAC,SAAS,EAAE,IAAA,SAAG,EAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAI,CAC7C,CACnB,CAAC,CAAA;AAGO,wBAAM;AAFf,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA","sourcesContent":["\"use client\"\n\nimport * as Primitives from \"@radix-ui/react-switch\"\nimport { VariantProps, cva } from \"cva\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst switchVariants = cva({\n base: \"bg-ui-bg-switch-off hover:bg-ui-bg-switch-off-hover data-[state=unchecked]:hover:after:bg-switch-off-hover-gradient before:shadow-details-switch-background focus:shadow-details-switch-background-focus data-[state=checked]:bg-ui-bg-interactive disabled:!bg-ui-bg-disabled group relative inline-flex items-center rounded-full outline-none transition-all before:absolute before:inset-0 before:rounded-full before:content-[''] after:absolute after:inset-0 after:rounded-full after:content-[''] disabled:cursor-not-allowed\",\n variants: {\n size: {\n small: \"h-[16px] w-[28px]\",\n base: \"h-[18px] w-[32px]\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n})\n\nconst thumbVariants = cva({\n base: \"bg-ui-fg-on-color shadow-details-switch-handle group-disabled:bg-ui-fg-disabled pointer-events-none h-[14px] w-[14px] rounded-full transition-all group-disabled:shadow-none\",\n variants: {\n size: {\n small:\n \"h-[12px] w-[12px] data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0.5\",\n base: \"h-[14px] w-[14px] transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n})\n\ninterface SwitchProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof Primitives.Root>,\n \"asChild\"\n >,\n VariantProps<typeof switchVariants> {}\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof Primitives.Root>,\n SwitchProps\n>(({ className, size = \"base\", ...props }, ref) => (\n <Primitives.Root\n className={clx(switchVariants({ size }), className)}\n {...props}\n ref={ref}\n >\n <Primitives.Thumb className={clx(thumbVariants({ size }))} />\n </Primitives.Root>\n))\nSwitch.displayName = \"Switch\"\n\nexport { Switch }\n"]}
@@ -1,11 +1,65 @@
1
- import { VariantProps } from "class-variance-authority";
1
+ import { VariantProps } from "cva";
2
2
  import * as React from "react";
3
3
  declare const textVariants: (props?: ({
4
- size?: "base" | "large" | "small" | "xlarge" | "xsmall" | null | undefined;
5
- weight?: "regular" | "plus" | null | undefined;
6
- family?: "sans" | "mono" | null | undefined;
7
- leading?: "normal" | "compact" | null | undefined;
8
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
4
+ size?: "base" | "large" | "small" | "xlarge" | "xsmall" | undefined;
5
+ weight?: "regular" | "plus" | undefined;
6
+ family?: "sans" | "mono" | undefined;
7
+ leading?: "normal" | "compact" | undefined;
8
+ } & ({
9
+ class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
10
+ [x: string]: any;
11
+ } | null | undefined)[] | {
12
+ [x: string]: any;
13
+ } | null | undefined)[] | {
14
+ [x: string]: any;
15
+ } | null | undefined)[] | {
16
+ [x: string]: any;
17
+ } | null | undefined)[] | {
18
+ [x: string]: any;
19
+ } | null | undefined)[] | {
20
+ [x: string]: any;
21
+ } | null | undefined)[] | {
22
+ [x: string]: any;
23
+ } | null | undefined)[] | {
24
+ [x: string]: any;
25
+ } | null | undefined)[] | {
26
+ [x: string]: any;
27
+ } | null | undefined)[] | {
28
+ [x: string]: any;
29
+ } | null | undefined)[] | {
30
+ [x: string]: any;
31
+ } | null | undefined)[] | {
32
+ [x: string]: any;
33
+ } | null | undefined;
34
+ className?: undefined;
35
+ } | {
36
+ class?: undefined;
37
+ className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
38
+ [x: string]: any;
39
+ } | null | undefined)[] | {
40
+ [x: string]: any;
41
+ } | null | undefined)[] | {
42
+ [x: string]: any;
43
+ } | null | undefined)[] | {
44
+ [x: string]: any;
45
+ } | null | undefined)[] | {
46
+ [x: string]: any;
47
+ } | null | undefined)[] | {
48
+ [x: string]: any;
49
+ } | null | undefined)[] | {
50
+ [x: string]: any;
51
+ } | null | undefined)[] | {
52
+ [x: string]: any;
53
+ } | null | undefined)[] | {
54
+ [x: string]: any;
55
+ } | null | undefined)[] | {
56
+ [x: string]: any;
57
+ } | null | undefined)[] | {
58
+ [x: string]: any;
59
+ } | null | undefined)[] | {
60
+ [x: string]: any;
61
+ } | null | undefined;
62
+ })) | undefined) => string;
9
63
  interface TextProps extends React.ComponentPropsWithoutRef<"p">, VariantProps<typeof textVariants> {
10
64
  asChild?: boolean;
11
65
  as?: "p" | "span" | "div";
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Text = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_slot_1 = require("@radix-ui/react-slot");
6
- const class_variance_authority_1 = require("class-variance-authority");
6
+ const cva_1 = require("cva");
7
7
  const React = tslib_1.__importStar(require("react"));
8
8
  const clx_1 = require("../../utils/clx");
9
- const textVariants = (0, class_variance_authority_1.cva)("", {
9
+ const textVariants = (0, cva_1.cva)({
10
10
  variants: {
11
11
  size: {
12
12
  xsmall: "",
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../src/components/text/text.tsx"],"names":[],"mappings":";;;;AAAA,qDAA2C;AAC3C,uEAA4D;AAC5D,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,YAAY,GAAG,IAAA,8BAAG,EAAC,EAAE,EAAE;IAC3B,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX;QACD,MAAM,EAAE;YACN,OAAO,EAAE,aAAa;YACtB,IAAI,EAAE,aAAa;SACpB;QACD,MAAM,EAAE;YACN,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,WAAW;SAClB;QACD,OAAO,EAAE;YACP,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,EAAE;SACZ;KACF;IACD,eAAe,EAAE;QACf,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,QAAQ;KAClB;IACD,gBAAgB,EAAE;QAChB;YACE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,YAAY;SACxB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,oBAAoB;SAChC;QACD;YACE,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,WAAW;SACvB;QACD;YACE,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,mBAAmB;SAC/B;QACD;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,YAAY;SACxB;QACD;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,oBAAoB;SAChC;QACD;YACE,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,WAAW;SACvB;QACD;YACE,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,mBAAmB;SAC/B;QACD;YACE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,YAAY;SACxB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,oBAAoB;SAChC;KACF;CACF,CAAC,CAAA;AASF,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAC3B,CACE,EACE,SAAS,EACT,OAAO,GAAG,KAAK,EACf,EAAE,GAAG,GAAG,EACR,IAAI,GAAG,MAAM,EACb,MAAM,GAAG,SAAS,EAClB,MAAM,GAAG,MAAM,EACf,OAAO,GAAG,QAAQ,EAClB,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,EAAE,CAAA;IAErC,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAC/C,SAAS,CACV,KACG,KAAK,IAER,QAAQ,CACC,CACb,CAAA;AACH,CAAC,CACF,CAAA;AAGQ,oBAAI;AAFb,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA","sourcesContent":["import { Slot } from \"@radix-ui/react-slot\"\nimport { VariantProps, cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst textVariants = cva(\"\", {\n variants: {\n size: {\n xsmall: \"\",\n small: \"\",\n base: \"\",\n large: \"\",\n xlarge: \"\",\n },\n weight: {\n regular: \"font-normal\",\n plus: \"font-medium\",\n },\n family: {\n sans: \"font-sans\",\n mono: \"font-mono\",\n },\n leading: {\n normal: \"\",\n compact: \"\",\n },\n },\n defaultVariants: {\n family: \"sans\",\n size: \"base\",\n weight: \"regular\",\n leading: \"normal\",\n },\n compoundVariants: [\n {\n size: \"xsmall\",\n leading: \"normal\",\n className: \"txt-xsmall\",\n },\n {\n size: \"xsmall\",\n leading: \"compact\",\n className: \"txt-compact-xsmall\",\n },\n {\n size: \"small\",\n leading: \"normal\",\n className: \"txt-small\",\n },\n {\n size: \"small\",\n leading: \"compact\",\n className: \"txt-compact-small\",\n },\n {\n size: \"base\",\n leading: \"normal\",\n className: \"txt-medium\",\n },\n {\n size: \"base\",\n leading: \"compact\",\n className: \"txt-compact-medium\",\n },\n {\n size: \"large\",\n leading: \"normal\",\n className: \"txt-large\",\n },\n {\n size: \"large\",\n leading: \"compact\",\n className: \"txt-compact-large\",\n },\n {\n size: \"xlarge\",\n leading: \"normal\",\n className: \"txt-xlarge\",\n },\n {\n size: \"xlarge\",\n leading: \"compact\",\n className: \"txt-compact-xlarge\",\n },\n ],\n})\n\ninterface TextProps\n extends React.ComponentPropsWithoutRef<\"p\">,\n VariantProps<typeof textVariants> {\n asChild?: boolean\n as?: \"p\" | \"span\" | \"div\"\n}\n\nconst Text = React.forwardRef<HTMLParagraphElement, TextProps>(\n (\n {\n className,\n asChild = false,\n as = \"p\",\n size = \"base\",\n weight = \"regular\",\n family = \"sans\",\n leading = \"normal\",\n children,\n ...props\n },\n ref\n ) => {\n const Component = asChild ? Slot : as\n\n return (\n <Component\n ref={ref}\n className={clx(\n textVariants({ size, weight, family, leading }),\n className\n )}\n {...props}\n >\n {children}\n </Component>\n )\n }\n)\nText.displayName = \"Text\"\n\nexport { Text }\n"]}
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../src/components/text/text.tsx"],"names":[],"mappings":";;;;AAAA,qDAA2C;AAC3C,6BAAuC;AACvC,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,YAAY,GAAG,IAAA,SAAG,EAAC;IACvB,QAAQ,EA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AY;SACxB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,oBAAoB;SAChC;KACF;CACF,CAAC,CAAA;AASF,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAC3B,CACE,EACE,SAAS,EACT,OAAO,GAAG,KAAK,EACf,EAAE,GAAG,GAAG,EACR,IAAI,GAAG,MAAM,EACb,MAAM,GAAG,SAAS,EAClB,MAAM,GAAG,MAAM,EACf,OAAO,GAAG,QAAQ,EAClB,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,EAAE,CAAA;IAErC,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAC/C,SAAS,CACV,KACG,KAAK,IAER,QAAQ,CACC,CACb,CAAA;AACH,CAAC,CACF,CAAA;AAGQ,oBAAI;AAFb,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA","sourcesContent":["import { Slot } from \"@radix-ui/react-slot\"\nimport { VariantProps, cva } from \"cva\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst textVariants = cva({\n variants: {\n size: {\n xsmall: \"\",\n small: \"\",\n base: \"\",\n large: \"\",\n xlarge: \"\",\n },\n weight: {\n regular: \"font-normal\",\n plus: \"font-medium\",\n },\n family: {\n sans: \"font-sans\",\n mono: \"font-mono\",\n },\n leading: {\n normal: \"\",\n compact: \"\",\n },\n },\n defaultVariants: {\n family: \"sans\",\n size: \"base\",\n weight: \"regular\",\n leading: \"normal\",\n },\n compoundVariants: [\n {\n size: \"xsmall\",\n leading: \"normal\",\n className: \"txt-xsmall\",\n },\n {\n size: \"xsmall\",\n leading: \"compact\",\n className: \"txt-compact-xsmall\",\n },\n {\n size: \"small\",\n leading: \"normal\",\n className: \"txt-small\",\n },\n {\n size: \"small\",\n leading: \"compact\",\n className: \"txt-compact-small\",\n },\n {\n size: \"base\",\n leading: \"normal\",\n className: \"txt-medium\",\n },\n {\n size: \"base\",\n leading: \"compact\",\n className: \"txt-compact-medium\",\n },\n {\n size: \"large\",\n leading: \"normal\",\n className: \"txt-large\",\n },\n {\n size: \"large\",\n leading: \"compact\",\n className: \"txt-compact-large\",\n },\n {\n size: \"xlarge\",\n leading: \"normal\",\n className: \"txt-xlarge\",\n },\n {\n size: \"xlarge\",\n leading: \"compact\",\n className: \"txt-compact-xlarge\",\n },\n ],\n})\n\ninterface TextProps\n extends React.ComponentPropsWithoutRef<\"p\">,\n VariantProps<typeof textVariants> {\n asChild?: boolean\n as?: \"p\" | \"span\" | \"div\"\n}\n\nconst Text = React.forwardRef<HTMLParagraphElement, TextProps>(\n (\n {\n className,\n asChild = false,\n as = \"p\",\n size = \"base\",\n weight = \"regular\",\n family = \"sans\",\n leading = \"normal\",\n children,\n ...props\n },\n ref\n ) => {\n const Component = asChild ? Slot : as\n\n return (\n <Component\n ref={ref}\n className={clx(\n textVariants({ size, weight, family, leading }),\n className\n )}\n {...props}\n >\n {children}\n </Component>\n )\n }\n)\nText.displayName = \"Text\"\n\nexport { Text }\n"]}
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- export type DialogProps = {
2
+ export type RenderPromptProps = {
3
3
  open: boolean;
4
4
  title: string;
5
5
  description: string;
@@ -9,5 +9,4 @@ export type DialogProps = {
9
9
  onConfirm: () => void;
10
10
  onCancel: () => void;
11
11
  };
12
- declare const Dialog: ({ open, title, description, verificationText, cancelText, confirmText, onConfirm, onCancel, }: DialogProps) => React.JSX.Element;
13
- export default Dialog;
12
+ export declare const RenderPrompt: ({ open, title, description, verificationText, cancelText, confirmText, onConfirm, onCancel, }: RenderPromptProps) => React.JSX.Element;
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  "use client";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RenderPrompt = void 0;
4
5
  const tslib_1 = require("tslib");
5
6
  const React = tslib_1.__importStar(require("react"));
6
7
  const input_1 = require("../../components/input");
7
8
  const label_1 = require("../../components/label");
8
9
  const prompt_1 = require("../../components/prompt");
9
- const Dialog = ({ open, title, description, verificationText, cancelText = "Cancel", confirmText = "Confirm", onConfirm, onCancel, }) => {
10
+ const RenderPrompt = ({ open, title, description, verificationText, cancelText = "Cancel", confirmText = "Confirm", onConfirm, onCancel, }) => {
10
11
  const [userInput, setUserInput] = React.useState("");
11
12
  const handleUserInput = (event) => {
12
13
  setUserInput(event.target.value);
@@ -55,5 +56,5 @@ const Dialog = ({ open, title, description, verificationText, cancelText = "Canc
55
56
  React.createElement(prompt_1.Prompt.Cancel, { onClick: onCancel }, cancelText),
56
57
  React.createElement(prompt_1.Prompt.Action, { disabled: !validInput, type: verificationText ? "submit" : "button", onClick: verificationText ? undefined : onConfirm }, confirmText))))));
57
58
  };
58
- exports.default = Dialog;
59
- //# sourceMappingURL=dialog.js.map
59
+ exports.RenderPrompt = RenderPrompt;
60
+ //# sourceMappingURL=render-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-prompt.js","sourceRoot":"","sources":["../../../../src/hooks/use-prompt/render-prompt.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,qDAA8B;AAE9B,8CAA0C;AAC1C,8CAA0C;AAC1C,gDAA4C;AAarC,MAAM,YAAY,GAAG,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,UAAU,GAAG,QAAQ,EACrB,WAAW,GAAG,SAAS,EACvB,SAAS,EACT,QAAQ,GACU,EAAE,EAAE;IACtB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IAEpD,MAAM,eAAe,GAAG,CAAC,KAA0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I,CACnB,6BAAK,SAAS,EAAC,+DAA+D;oBAC5E,oBAAC,aAAK,IAAC,OAAO,EAAC,kBAAkB,EAAC,SAAS,EAAC,mBAAmB;;wBACjD,GAAG;wBACf,8BAAM,SAAS,EAAC,yCAAyC,IACtD,gBAAgB,CACZ;wBAAC,GAAG;sCAEL;oBACR,oBAAC,aAAK,IACJ,SAAS,QACT,YAAY,EAAC,KAAK,EAClB,EAAE,EAAC,kBAAkB,EACrB,WAAW,EAAE,gBAAgB,EAC7B,QAAQ,EAAE,eAAe,GACzB,CACE,CACP;gBACD,oBAAC,eAAM,CAAC,MAAM;oBACZ,oBAAC,eAAM,CAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,IAAG,UAAU,CAAiB;oBAC9D,oBAAC,eAAM,CAAC,MAAM,IACZ,QAAQ,EAAE,CAAC,UAAU,EACrB,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAC5C,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,IAEhD,WAAW,CACE,CACF,CACX,CACQ,CACV,CACV,CAAA;AACH,CAAC,CAAA;AA1FY,QAAA,YAAY,gBA0FxB","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport { Input } from \"@/components/input\"\nimport { Label } from \"@/components/label\"\nimport { Prompt } from \"@/components/prompt\"\n\nexport type RenderPromptProps = {\n open: boolean\n title: string\n description: string\n verificationText?: string\n cancelText?: string\n confirmText?: string\n onConfirm: () => void\n onCancel: () => void\n}\n\nexport const RenderPrompt = ({\n open,\n title,\n description,\n verificationText,\n cancelText = \"Cancel\",\n confirmText = \"Confirm\",\n onConfirm,\n onCancel,\n}: RenderPromptProps) => {\n const [userInput, setUserInput] = React.useState(\"\")\n\n const handleUserInput = (event: React.ChangeEvent<HTMLInputElement>) => {\n setUserInput(event.target.value)\n }\n\n const validInput = React.useMemo(() => {\n if (!verificationText) {\n return true\n }\n\n return userInput === verificationText\n }, [userInput, verificationText])\n\n const handleFormSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault()\n\n if (!verificationText) {\n return\n }\n\n if (validInput) {\n onConfirm()\n }\n }\n\n React.useEffect(() => {\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && open) {\n onCancel()\n }\n }\n\n document.addEventListener(\"keydown\", handleEscape)\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape)\n }\n }, [onCancel, open])\n\n return (\n <Prompt open={open}>\n <Prompt.Content>\n <form onSubmit={handleFormSubmit}>\n <Prompt.Header>\n <Prompt.Title>{title}</Prompt.Title>\n <Prompt.Description>{description}</Prompt.Description>\n </Prompt.Header>\n {verificationText && (\n <div className=\"border-ui-border-base mt-6 flex flex-col gap-y-4 border-y p-6\">\n <Label htmlFor=\"verificationText\" className=\"text-ui-fg-subtle\">\n Please type{\" \"}\n <span className=\"text-ui-fg-base txt-compact-medium-plus\">\n {verificationText}\n </span>{\" \"}\n to confirm.\n </Label>\n <Input\n autoFocus\n autoComplete=\"off\"\n id=\"verificationText\"\n placeholder={verificationText}\n onChange={handleUserInput}\n />\n </div>\n )}\n <Prompt.Footer>\n <Prompt.Cancel onClick={onCancel}>{cancelText}</Prompt.Cancel>\n <Prompt.Action\n disabled={!validInput}\n type={verificationText ? \"submit\" : \"button\"}\n onClick={verificationText ? undefined : onConfirm}\n >\n {confirmText}\n </Prompt.Action>\n </Prompt.Footer>\n </form>\n </Prompt.Content>\n </Prompt>\n )\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { DialogProps } from "./dialog";
2
- type PromptProps = Omit<DialogProps, "onConfirm" | "onCancel" | "open">;
3
- declare const usePrompt: () => (props: PromptProps) => Promise<boolean>;
1
+ import { RenderPromptProps } from "./render-prompt";
2
+ type UsePromptProps = Omit<RenderPromptProps, "onConfirm" | "onCancel" | "open">;
3
+ declare const usePrompt: () => (props: UsePromptProps) => Promise<boolean>;
4
4
  export { usePrompt };
@@ -5,9 +5,9 @@ exports.usePrompt = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const React = tslib_1.__importStar(require("react"));
7
7
  const client_1 = require("react-dom/client");
8
- const dialog_1 = tslib_1.__importDefault(require("./dialog"));
8
+ const render_prompt_1 = require("./render-prompt");
9
9
  const usePrompt = () => {
10
- const dialog = async (props) => {
10
+ const prompt = async (props) => {
11
11
  return new Promise((resolve) => {
12
12
  let open = true;
13
13
  const onCancel = () => {
@@ -22,12 +22,12 @@ const usePrompt = () => {
22
22
  };
23
23
  const mountRoot = (0, client_1.createRoot)(document.createElement("div"));
24
24
  const render = () => {
25
- mountRoot.render(React.createElement(dialog_1.default, { open: open, onConfirm: onConfirm, onCancel: onCancel, ...props }));
25
+ mountRoot.render(React.createElement(render_prompt_1.RenderPrompt, { open: open, onConfirm: onConfirm, onCancel: onCancel, ...props }));
26
26
  };
27
27
  render();
28
28
  });
29
29
  };
30
- return dialog;
30
+ return prompt;
31
31
  };
32
32
  exports.usePrompt = usePrompt;
33
33
  //# sourceMappingURL=use-prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-prompt.js","sourceRoot":"","sources":["../../../../src/hooks/use-prompt/use-prompt.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,qDAA8B;AAC9B,6CAA6C;AAG7C,8DAA6B;AAI7B,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,KAAK,EAAE,KAAkB,EAAoB,EAAE;QAC5D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,IAAI,IAAI,GAAG,IAAI,CAAA;YAEf,MAAM,QAAQ,GAAG,GAAG,EAAE;gBACpB,IAAI,GAAG,KAAK,CAAA;gBACZ,MAAM,EAAE,CAAA;gBACR,OAAO,CAAC,KAAK,CAAC,CAAA;YAChB,CAAC,CAAA;YAED,MAAM,SAAS,GAAG,GAAG,EAAE;gBACrB,IAAI,GAAG,KAAK,CAAA;gBACZ,OAAO,CAAC,IAAI,CAAC,CAAA;gBACb,MAAM,EAAE,CAAA;YACV,CAAC,CAAA;YAED,MAAM,SAAS,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;YAE3D,MAAM,MAAM,GAAG,GAAG,EAAE;gBAClB,SAAS,CAAC,MAAM,CACd,oBAAC,gBAAM,IACL,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,KACd,KAAK,GACT,CACH,CAAA;YACH,CAAC,CAAA;YAED,MAAM,EAAE,CAAA;QACV,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAEQ,8BAAS","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { createRoot } from \"react-dom/client\"\nimport { DialogProps } from \"./dialog\"\n\nimport Dialog from \"./dialog\"\n\ntype PromptProps = Omit<DialogProps, \"onConfirm\" | \"onCancel\" | \"open\">\n\nconst usePrompt = () => {\n const dialog = async (props: PromptProps): Promise<boolean> => {\n return new Promise((resolve) => {\n let open = true\n\n const onCancel = () => {\n open = false\n render()\n resolve(false)\n }\n\n const onConfirm = () => {\n open = false\n resolve(true)\n render()\n }\n\n const mountRoot = createRoot(document.createElement(\"div\"))\n\n const render = () => {\n mountRoot.render(\n <Dialog\n open={open}\n onConfirm={onConfirm}\n onCancel={onCancel}\n {...props}\n />\n )\n }\n\n render()\n })\n }\n\n return dialog\n}\n\nexport { usePrompt }\n"]}
1
+ {"version":3,"file":"use-prompt.js","sourceRoot":"","sources":["../../../../src/hooks/use-prompt/use-prompt.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,qDAA8B;AAC9B,6CAA6C;AAC7C,mDAAiE;AAIjE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,KAAK,EAAE,KAAqB,EAAoB,EAAE;QAC/D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,IAAI,IAAI,GAAG,IAAI,CAAA;YAEf,MAAM,QAAQ,GAAG,GAAG,EAAE;gBACpB,IAAI,GAAG,KAAK,CAAA;gBACZ,MAAM,EAAE,CAAA;gBACR,OAAO,CAAC,KAAK,CAAC,CAAA;YAChB,CAAC,CAAA;YAED,MAAM,SAAS,GAAG,GAAG,EAAE;gBACrB,IAAI,GAAG,KAAK,CAAA;gBACZ,OAAO,CAAC,IAAI,CAAC,CAAA;gBACb,MAAM,EAAE,CAAA;YACV,CAAC,CAAA;YAED,MAAM,SAAS,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;YAE3D,MAAM,MAAM,GAAG,GAAG,EAAE;gBAClB,SAAS,CAAC,MAAM,CACd,oBAAC,4BAAY,IACX,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,KACd,KAAK,GACT,CACH,CAAA;YACH,CAAC,CAAA;YAED,MAAM,EAAE,CAAA;QACV,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAEQ,8BAAS","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { createRoot } from \"react-dom/client\"\nimport { RenderPrompt, RenderPromptProps } from \"./render-prompt\"\n\ntype UsePromptProps = Omit<RenderPromptProps, \"onConfirm\" | \"onCancel\" | \"open\">\n\nconst usePrompt = () => {\n const prompt = async (props: UsePromptProps): Promise<boolean> => {\n return new Promise((resolve) => {\n let open = true\n\n const onCancel = () => {\n open = false\n render()\n resolve(false)\n }\n\n const onConfirm = () => {\n open = false\n resolve(true)\n render()\n }\n\n const mountRoot = createRoot(document.createElement(\"div\"))\n\n const render = () => {\n mountRoot.render(\n <RenderPrompt\n open={open}\n onConfirm={onConfirm}\n onCancel={onCancel}\n {...props}\n />\n )\n }\n\n render()\n })\n }\n\n return prompt\n}\n\nexport { usePrompt }\n"]}