@florianke/components 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/alert-dialog.d.mts +42 -0
- package/dist/alert-dialog.d.mts.map +1 -0
- package/dist/alert-dialog.mjs +57 -0
- package/dist/alert-dialog.mjs.map +1 -0
- package/dist/avatar.mjs +1 -1
- package/dist/button.d.mts +1 -1
- package/dist/button.d.mts.map +1 -1
- package/dist/button.mjs +3 -2
- package/dist/button.mjs.map +1 -1
- package/dist/field.d.mts +11 -0
- package/dist/field.d.mts.map +1 -0
- package/dist/field.mjs +14 -0
- package/dist/field.mjs.map +1 -0
- package/dist/heading.d.mts +17 -0
- package/dist/heading.d.mts.map +1 -0
- package/dist/heading.mjs +20 -0
- package/dist/heading.mjs.map +1 -0
- package/dist/hint.d.mts +17 -0
- package/dist/hint.d.mts.map +1 -0
- package/dist/hint.mjs +22 -0
- package/dist/hint.mjs.map +1 -0
- package/dist/hooks/use-confirm.d.mts +23 -0
- package/dist/hooks/use-confirm.d.mts.map +1 -0
- package/dist/hooks/use-confirm.mjs +97 -0
- package/dist/hooks/use-confirm.mjs.map +1 -0
- package/dist/index.d.mts +11 -1
- package/dist/index.mjs +12 -2
- package/dist/input.d.mts +1 -0
- package/dist/input.d.mts.map +1 -1
- package/dist/input.mjs +73 -6
- package/dist/input.mjs.map +1 -1
- package/dist/label.d.mts +20 -0
- package/dist/label.d.mts.map +1 -0
- package/dist/label.mjs +19 -0
- package/dist/label.mjs.map +1 -0
- package/dist/providers.d.mts +12 -0
- package/dist/providers.d.mts.map +1 -0
- package/dist/providers.mjs +14 -0
- package/dist/providers.mjs.map +1 -0
- package/dist/text.d.mts +30 -0
- package/dist/text.d.mts.map +1 -0
- package/dist/text.mjs +37 -0
- package/dist/text.mjs.map +1 -0
- package/dist/toast.d.mts +56 -0
- package/dist/toast.d.mts.map +1 -0
- package/dist/toast.mjs +166 -0
- package/dist/toast.mjs.map +1 -0
- package/dist/tooltip.d.mts +35 -0
- package/dist/tooltip.d.mts.map +1 -0
- package/dist/tooltip.mjs +45 -0
- package/dist/tooltip.mjs.map +1 -0
- package/package.json +1 -1
- package/src/styles.css +13 -1
package/dist/input.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.mjs","names":["BaseInput"],"sources":["../src/components/input/input.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"input.mjs","names":["BaseInput"],"sources":["../src/components/input/input.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Input as BaseInput } from \"@base-ui/react/input\";\nimport { cn } from \"@/lib/cn\";\n\ntype InputSize = \"sm\" | \"md\";\n\ntype InputProps = Omit<\n React.ComponentPropsWithoutRef<typeof BaseInput>,\n \"size\"\n> & {\n size?: InputSize;\n};\n\nconst sizes: Record<InputSize, string> = {\n sm: \"h-7 rounded-md text-[12px]\",\n md: \"h-8 rounded-md text-[14px]\",\n};\n\nconst paddingX: Record<InputSize, string> = {\n sm: \"px-1.5\",\n md: \"px-2\",\n};\n\nexport function Input({ className, size = \"md\", type, ...props }: InputProps) {\n if (type === \"password\") {\n return <PasswordInput className={className} size={size} {...props} />;\n }\n\n return (\n <BaseInput\n type={type}\n className={cn(\n \"w-full min-w-0 border bg-(--input) text-(--foreground) outline-none\",\n \"placeholder:text-(--muted-foreground)\",\n \"selection:bg-(--ring)/30 selection:text-(--foreground)\",\n \"border-(--input-border) transition-[border-color,box-shadow] duration-150 ease-out\",\n \"hover:bg-(--foreground)/4\",\n \"focus-visible:border-(--ring) focus-visible:ring-[3px] focus-visible:ring-(--ring)/20\",\n \"aria-invalid:border-(--destructive) aria-invalid:ring-[3px] aria-invalid:ring-(--destructive)/20\",\n \"aria-invalid:focus-visible:border-(--destructive) aria-invalid:focus-visible:ring-(--destructive)/20\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"any-pointer-coarse:text-base\",\n sizes[size],\n paddingX[size],\n className,\n )}\n {...props}\n />\n );\n}\n\ntype PasswordInputProps = Omit<InputProps, \"type\">;\n\nfunction PasswordInput({\n className,\n size = \"md\",\n disabled,\n ...props\n}: PasswordInputProps) {\n const [visible, setVisible] = React.useState(false);\n const ariaInvalid = props[\"aria-invalid\"];\n const invalid = ariaInvalid === true || ariaInvalid === \"true\";\n\n return (\n <div\n className={cn(\n \"flex w-full min-w-0 items-stretch border bg-(--input) text-(--foreground)\",\n \"border-(--input-border) transition-[border-color,box-shadow] duration-150 ease-out\",\n \"hover:bg-(--foreground)/4\",\n \"focus-within:border-(--ring) focus-within:ring-[3px] focus-within:ring-(--ring)/20\",\n invalid && \"border-(--destructive) ring-[3px] ring-(--destructive)/20\",\n invalid &&\n \"focus-within:border-(--destructive) focus-within:ring-(--destructive)/20\",\n disabled && \"pointer-events-none opacity-50\",\n sizes[size],\n className,\n )}\n >\n <BaseInput\n type={visible ? \"text\" : \"password\"}\n disabled={disabled}\n className={cn(\n \"min-w-0 flex-1 border-0 bg-transparent text-inherit outline-none\",\n \"placeholder:text-(--muted-foreground)\",\n \"selection:bg-(--ring)/30 selection:text-(--foreground)\",\n \"any-pointer-coarse:text-base\",\n paddingX[size],\n )}\n {...props}\n />\n <button\n type=\"button\"\n onClick={() => setVisible((current) => !current)}\n disabled={disabled}\n aria-label={visible ? \"Passwort verbergen\" : \"Passwort anzeigen\"}\n aria-pressed={visible}\n className={cn(\n \"flex shrink-0 items-center justify-center border-l border-(--input-border) text-(--muted-foreground) outline-none transition-colors duration-150 ease-out\",\n \"hover:bg-(--foreground)/4 hover:text-(--foreground)\",\n \"focus-visible:bg-(--foreground)/4 focus-visible:text-(--foreground)\",\n \"disabled:pointer-events-none\",\n paddingX[size],\n )}\n >\n {visible ? (\n <EyeOffIcon className=\"size-4\" />\n ) : (\n <EyeIcon className=\"size-4\" />\n )}\n </button>\n </div>\n );\n}\n\nfunction EyeIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nfunction EyeOffIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M9.9 5.1A9.4 9.4 0 0 1 12 5c6.5 0 10 7 10 7a16.8 16.8 0 0 1-3.1 4.1M6.2 6.2C3.7 7.9 2 12 2 12s3.5 7 10 7a9.7 9.7 0 0 0 5-1.4\" />\n <path d=\"M14.1 14.1a3 3 0 1 1-4.2-4.2\" />\n <path d=\"M2 2l20 20\" />\n </svg>\n );\n}\n"],"mappings":";;;;;;AAeA,MAAM,QAAmC;CACvC,IAAI;CACJ,IAAI;CACL;AAED,MAAM,WAAsC;CAC1C,IAAI;CACJ,IAAI;CACL;AAED,SAAgB,MAAM,EAAE,WAAW,OAAO,MAAM,MAAM,GAAG,SAAqB;AAC5E,KAAI,SAAS,WACX,QAAO,oBAAC,eAAD;EAA0B;EAAiB;EAAM,GAAI;EAAS,CAAA;AAGvE,QACE,oBAACA,SAAD;EACQ;EACN,WAAW,GACT,uEACA,yCACA,0DACA,sFACA,6BACA,yFACA,oGACA,wGACA,oDACA,gCACA,MAAM,OACN,SAAS,OACT,UACD;EACD,GAAI;EACJ,CAAA;;AAMN,SAAS,cAAc,EACrB,WACA,OAAO,MACP,UACA,GAAG,SACkB;CACrB,MAAM,CAAC,SAAS,cAAc,MAAM,SAAS,MAAM;CACnD,MAAM,cAAc,MAAM;CAC1B,MAAM,UAAU,gBAAgB,QAAQ,gBAAgB;AAExD,QACE,qBAAC,OAAD;EACE,WAAW,GACT,6EACA,sFACA,6BACA,sFACA,WAAW,6DACX,WACE,4EACF,YAAY,kCACZ,MAAM,OACN,UACD;YAZH,CAcE,oBAACA,SAAD;GACE,MAAM,UAAU,SAAS;GACf;GACV,WAAW,GACT,oEACA,yCACA,0DACA,gCACA,SAAS,MACV;GACD,GAAI;GACJ,CAAA,EACF,oBAAC,UAAD;GACE,MAAK;GACL,eAAe,YAAY,YAAY,CAAC,QAAQ;GACtC;GACV,cAAY,UAAU,uBAAuB;GAC7C,gBAAc;GACd,WAAW,GACT,6JACA,uDACA,uEACA,gCACA,SAAS,MACV;aAEA,UACC,oBAAC,YAAD,EAAY,WAAU,UAAW,CAAA,GAEjC,oBAAC,SAAD,EAAS,WAAU,UAAW,CAAA;GAEzB,CAAA,CACL;;;AAIV,SAAS,QAAQ,OAAoC;AACnD,QACE,qBAAC,OAAD;EACE,OAAM;EACN,SAAQ;EACR,MAAK;EACL,QAAO;EACP,aAAY;EACZ,eAAc;EACd,gBAAe;EACf,GAAI;YARN,CAUE,oBAAC,QAAD,EAAM,GAAE,oDAAqD,CAAA,EAC7D,oBAAC,UAAD;GAAQ,IAAG;GAAK,IAAG;GAAK,GAAE;GAAM,CAAA,CAC5B;;;AAIV,SAAS,WAAW,OAAoC;AACtD,QACE,qBAAC,OAAD;EACE,OAAM;EACN,SAAQ;EACR,MAAK;EACL,QAAO;EACP,aAAY;EACZ,eAAc;EACd,gBAAe;EACf,GAAI;YARN;GAUE,oBAAC,QAAD,EAAM,GAAE,gIAAiI,CAAA;GACzI,oBAAC,QAAD,EAAM,GAAE,gCAAiC,CAAA;GACzC,oBAAC,QAAD,EAAM,GAAE,cAAe,CAAA;GACnB"}
|
package/dist/label.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/label/label.d.ts
|
|
4
|
+
type LabelSize = "small" | "base" | "large";
|
|
5
|
+
type LabelWeight = "regular" | "plus";
|
|
6
|
+
type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
7
|
+
size?: LabelSize;
|
|
8
|
+
weight?: LabelWeight;
|
|
9
|
+
ref?: React.Ref<HTMLLabelElement>;
|
|
10
|
+
};
|
|
11
|
+
declare function Label({
|
|
12
|
+
className,
|
|
13
|
+
size,
|
|
14
|
+
weight,
|
|
15
|
+
ref,
|
|
16
|
+
...props
|
|
17
|
+
}: LabelProps): React.JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Label };
|
|
20
|
+
//# sourceMappingURL=label.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.mts","names":[],"sources":["../src/components/label/label.tsx"],"mappings":";;;KAIK,SAAA;AAAA,KACA,WAAA;AAAA,KAEA,UAAA,GAAa,KAAA,CAAM,mBAAA,CAAoB,gBAAA;EAC1C,IAAA,GAAO,SAAA;EACP,MAAA,GAAS,WAAA;EACT,GAAA,GAAM,KAAA,CAAM,GAAA,CAAI,gBAAA;AAAA;AAAA,iBAGF,KAAA,CAAA;EACd,SAAA;EACA,IAAA;EACA,MAAA;EACA,GAAA;EAAA,GACG;AAAA,GACF,UAAA,GAAU,KAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/label.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as cn } from "./cn-BpvCVwZv.mjs";
|
|
2
|
+
import { Text } from "./text.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/label/label.tsx
|
|
6
|
+
function Label({ className, size = "base", weight = "plus", ref, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
8
|
+
as: "label",
|
|
9
|
+
size,
|
|
10
|
+
weight,
|
|
11
|
+
ref,
|
|
12
|
+
className: cn("text-(--foreground)", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Label };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=label.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.mjs","names":[],"sources":["../src/components/label/label.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport { Text } from \"../text/text\";\n\ntype LabelSize = \"small\" | \"base\" | \"large\";\ntype LabelWeight = \"regular\" | \"plus\";\n\ntype LabelProps = React.LabelHTMLAttributes<HTMLLabelElement> & {\n size?: LabelSize;\n weight?: LabelWeight;\n ref?: React.Ref<HTMLLabelElement>;\n};\n\nexport function Label({\n className,\n size = \"base\",\n weight = \"plus\",\n ref,\n ...props\n}: LabelProps) {\n return (\n <Text\n as=\"label\"\n size={size}\n weight={weight}\n ref={ref as React.Ref<HTMLElement>}\n className={cn(\"text-(--foreground)\", className)}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;AAaA,SAAgB,MAAM,EACpB,WACA,OAAO,QACP,SAAS,QACT,KACA,GAAG,SACU;AACb,QACE,oBAAC,MAAD;EACE,IAAG;EACG;EACE;EACH;EACL,WAAW,GAAG,uBAAuB,UAAU;EAC/C,GAAI;EACJ,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/providers/providers.d.ts
|
|
4
|
+
type ProvidersProps = {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare function Providers({
|
|
8
|
+
children
|
|
9
|
+
}: ProvidersProps): React.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Providers };
|
|
12
|
+
//# sourceMappingURL=providers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.d.mts","names":[],"sources":["../src/components/providers/providers.tsx"],"mappings":";;;KAOK,cAAA;EACH,QAAA,GAAW,KAAA,CAAM,SAAA;AAAA;AAAA,iBAGH,SAAA,CAAA;EAAY;AAAA,GAAY,cAAA,GAAc,KAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ConfirmProvider } from "./hooks/use-confirm.mjs";
|
|
3
|
+
import { Toast } from "./toast.mjs";
|
|
4
|
+
import { Tooltip } from "./tooltip.mjs";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/providers/providers.tsx
|
|
8
|
+
function Providers({ children }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Toast.Provider, { children: /* @__PURE__ */ jsx(Tooltip.Provider, { children: /* @__PURE__ */ jsxs(ConfirmProvider, { children: [children, /* @__PURE__ */ jsx(Toast.Viewport, { children: /* @__PURE__ */ jsx(Toast.List, {}) })] }) }) });
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Providers };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=providers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.mjs","names":[],"sources":["../src/components/providers/providers.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { ConfirmProvider } from \"../../hooks/use-confirm\";\nimport { Toast } from \"../toast/toast\";\nimport { Tooltip } from \"../tooltip/tooltip\";\n\ntype ProvidersProps = {\n children?: React.ReactNode;\n};\n\nexport function Providers({ children }: ProvidersProps) {\n return (\n <Toast.Provider>\n <Tooltip.Provider>\n <ConfirmProvider>\n {children}\n <Toast.Viewport>\n <Toast.List />\n </Toast.Viewport>\n </ConfirmProvider>\n </Tooltip.Provider>\n </Toast.Provider>\n );\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,UAAU,EAAE,YAA4B;AACtD,QACE,oBAAC,MAAM,UAAP,EAAA,UACE,oBAAC,QAAQ,UAAT,EAAA,UACE,qBAAC,iBAAD,EAAA,UAAA,CACG,UACD,oBAAC,MAAM,UAAP,EAAA,UACE,oBAAC,MAAM,MAAP,EAAc,CAAA,EACC,CAAA,CACD,EAAA,CAAA,EACD,CAAA,EACJ,CAAA"}
|
package/dist/text.d.mts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/text/text.d.ts
|
|
4
|
+
type TextSize = "small" | "base" | "large";
|
|
5
|
+
type TextWeight = "regular" | "plus";
|
|
6
|
+
type TextFamily = "sans" | "mono";
|
|
7
|
+
type TextLeading = "normal" | "compact";
|
|
8
|
+
type TextElement = "p" | "span" | "div" | "label";
|
|
9
|
+
type TextProps = React.HTMLAttributes<HTMLElement> & {
|
|
10
|
+
as?: TextElement;
|
|
11
|
+
size?: TextSize;
|
|
12
|
+
weight?: TextWeight;
|
|
13
|
+
family?: TextFamily;
|
|
14
|
+
leading?: TextLeading;
|
|
15
|
+
htmlFor?: string;
|
|
16
|
+
ref?: React.Ref<HTMLElement>;
|
|
17
|
+
};
|
|
18
|
+
declare function Text({
|
|
19
|
+
className,
|
|
20
|
+
as: Tag,
|
|
21
|
+
size,
|
|
22
|
+
weight,
|
|
23
|
+
family,
|
|
24
|
+
leading,
|
|
25
|
+
ref,
|
|
26
|
+
...props
|
|
27
|
+
}: TextProps): React.JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Text };
|
|
30
|
+
//# sourceMappingURL=text.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.mts","names":[],"sources":["../src/components/text/text.tsx"],"mappings":";;;KAGK,QAAA;AAAA,KACA,UAAA;AAAA,KACA,UAAA;AAAA,KACA,WAAA;AAAA,KACA,WAAA;AAAA,KA2BA,SAAA,GAAY,KAAA,CAAM,cAAA,CAAe,WAAA;EACpC,EAAA,GAAK,WAAA;EACL,IAAA,GAAO,QAAA;EACP,MAAA,GAAS,UAAA;EACT,MAAA,GAAS,UAAA;EACT,OAAA,GAAU,WAAA;EACV,OAAA;EACA,GAAA,GAAM,KAAA,CAAM,GAAA,CAAI,WAAA;AAAA;AAAA,iBAGF,IAAA,CAAA;EACd,SAAA;EACA,EAAA,EAAI,GAAA;EACJ,IAAA;EACA,MAAA;EACA,MAAA;EACA,OAAA;EACA,GAAA;EAAA,GACG;AAAA,GACF,SAAA,GAAS,KAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/text.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { t as cn } from "./cn-BpvCVwZv.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/text/text.tsx
|
|
5
|
+
const sizes = {
|
|
6
|
+
small: {
|
|
7
|
+
normal: "text-[0.8125rem] leading-6",
|
|
8
|
+
compact: "text-[0.8125rem] leading-5"
|
|
9
|
+
},
|
|
10
|
+
base: {
|
|
11
|
+
normal: "text-sm leading-6",
|
|
12
|
+
compact: "text-sm leading-5"
|
|
13
|
+
},
|
|
14
|
+
large: {
|
|
15
|
+
normal: "text-base leading-7",
|
|
16
|
+
compact: "text-base leading-5"
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const weights = {
|
|
20
|
+
regular: "font-normal",
|
|
21
|
+
plus: "font-medium"
|
|
22
|
+
};
|
|
23
|
+
const families = {
|
|
24
|
+
sans: "font-sans",
|
|
25
|
+
mono: "font-mono"
|
|
26
|
+
};
|
|
27
|
+
function Text({ className, as: Tag = "p", size = "base", weight = "regular", family = "sans", leading = "normal", ref, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(Tag, {
|
|
29
|
+
ref,
|
|
30
|
+
className: cn(sizes[size][leading], weights[weight], families[family], className),
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Text };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=text.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.mjs","names":["Element"],"sources":["../src/components/text/text.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/lib/cn\";\n\ntype TextSize = \"small\" | \"base\" | \"large\";\ntype TextWeight = \"regular\" | \"plus\";\ntype TextFamily = \"sans\" | \"mono\";\ntype TextLeading = \"normal\" | \"compact\";\ntype TextElement = \"p\" | \"span\" | \"div\" | \"label\";\n\nconst sizes: Record<TextSize, Record<TextLeading, string>> = {\n small: {\n normal: \"text-[0.8125rem] leading-6\",\n compact: \"text-[0.8125rem] leading-5\",\n },\n base: {\n normal: \"text-sm leading-6\",\n compact: \"text-sm leading-5\",\n },\n large: {\n normal: \"text-base leading-7\",\n compact: \"text-base leading-5\",\n },\n};\n\nconst weights: Record<TextWeight, string> = {\n regular: \"font-normal\",\n plus: \"font-medium\",\n};\n\nconst families: Record<TextFamily, string> = {\n sans: \"font-sans\",\n mono: \"font-mono\",\n};\n\ntype TextProps = React.HTMLAttributes<HTMLElement> & {\n as?: TextElement;\n size?: TextSize;\n weight?: TextWeight;\n family?: TextFamily;\n leading?: TextLeading;\n htmlFor?: string;\n ref?: React.Ref<HTMLElement>;\n};\n\nexport function Text({\n className,\n as: Tag = \"p\",\n size = \"base\",\n weight = \"regular\",\n family = \"sans\",\n leading = \"normal\",\n ref,\n ...props\n}: TextProps) {\n const Element = Tag as React.ElementType;\n\n return (\n <Element\n ref={ref}\n className={cn(\n sizes[size][leading],\n weights[weight],\n families[family],\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":";;;;AASA,MAAM,QAAuD;CAC3D,OAAO;EACL,QAAQ;EACR,SAAS;EACV;CACD,MAAM;EACJ,QAAQ;EACR,SAAS;EACV;CACD,OAAO;EACL,QAAQ;EACR,SAAS;EACV;CACF;AAED,MAAM,UAAsC;CAC1C,SAAS;CACT,MAAM;CACP;AAED,MAAM,WAAuC;CAC3C,MAAM;CACN,MAAM;CACP;AAYD,SAAgB,KAAK,EACnB,WACA,IAAI,MAAM,KACV,OAAO,QACP,SAAS,WACT,SAAS,QACT,UAAU,UACV,KACA,GAAG,SACS;AAGZ,QACE,oBAACA,KAAD;EACO;EACL,WAAW,GACT,MAAM,MAAM,UACZ,QAAQ,SACR,SAAS,SACT,UACD;EACD,GAAI;EACJ,CAAA"}
|
package/dist/toast.d.mts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Toast as Toast$1 } from "@base-ui/react/toast";
|
|
3
|
+
|
|
4
|
+
//#region src/components/toast/toast.d.ts
|
|
5
|
+
type ToastProviderProps = React.ComponentPropsWithoutRef<typeof Toast$1.Provider>;
|
|
6
|
+
declare function ToastProvider(props: ToastProviderProps): React.JSX.Element;
|
|
7
|
+
type ToastViewportProps = React.ComponentPropsWithoutRef<typeof Toast$1.Viewport>;
|
|
8
|
+
declare function ToastViewport({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: ToastViewportProps): React.JSX.Element;
|
|
12
|
+
type ToastRootProps = React.ComponentPropsWithoutRef<typeof Toast$1.Root>;
|
|
13
|
+
declare function ToastRoot({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}: ToastRootProps): React.JSX.Element;
|
|
17
|
+
type ToastContentProps = React.ComponentPropsWithoutRef<typeof Toast$1.Content>;
|
|
18
|
+
declare function ToastContent({
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
}: ToastContentProps): React.JSX.Element;
|
|
22
|
+
type ToastTitleProps = React.ComponentPropsWithoutRef<typeof Toast$1.Title>;
|
|
23
|
+
declare function ToastTitle({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: ToastTitleProps): React.JSX.Element;
|
|
27
|
+
type ToastDescriptionProps = React.ComponentPropsWithoutRef<typeof Toast$1.Description>;
|
|
28
|
+
declare function ToastDescription({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: ToastDescriptionProps): React.JSX.Element;
|
|
32
|
+
type ToastIconProps = React.SVGProps<SVGSVGElement> & {
|
|
33
|
+
type: string | undefined;
|
|
34
|
+
};
|
|
35
|
+
declare function ToastIcon({
|
|
36
|
+
type,
|
|
37
|
+
className,
|
|
38
|
+
...props
|
|
39
|
+
}: ToastIconProps): React.JSX.Element | null;
|
|
40
|
+
type ToastCloseProps = React.ComponentPropsWithoutRef<typeof Toast$1.Close>;
|
|
41
|
+
declare function ToastClose(props: ToastCloseProps): React.JSX.Element;
|
|
42
|
+
declare function ToastList(): React.JSX.Element[];
|
|
43
|
+
declare const Toast: typeof ToastRoot & {
|
|
44
|
+
Provider: typeof ToastProvider;
|
|
45
|
+
Viewport: typeof ToastViewport;
|
|
46
|
+
Content: typeof ToastContent;
|
|
47
|
+
Title: typeof ToastTitle;
|
|
48
|
+
Description: typeof ToastDescription;
|
|
49
|
+
Close: typeof ToastClose;
|
|
50
|
+
Icon: typeof ToastIcon;
|
|
51
|
+
List: typeof ToastList;
|
|
52
|
+
useToastManager: typeof Toast$1.useToastManager;
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { Toast };
|
|
56
|
+
//# sourceMappingURL=toast.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.mts","names":[],"sources":["../src/components/toast/toast.tsx"],"mappings":";;;;KAQK,kBAAA,GAAqB,KAAA,CAAM,wBAAA,QACvB,OAAA,CAAU,QAAA;AAAA,iBAGV,aAAA,CAAc,KAAA,EAAO,kBAAA,GAAkB,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,KAI3C,kBAAA,GAAqB,KAAA,CAAM,wBAAA,QACvB,OAAA,CAAU,QAAA;AAAA,iBAGV,aAAA,CAAA;EAAgB,SAAA;EAAA,GAAc;AAAA,GAAS,kBAAA,GAAkB,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,KAc7D,cAAA,GAAiB,KAAA,CAAM,wBAAA,QAAgC,OAAA,CAAU,IAAA;AAAA,iBAE7D,SAAA,CAAA;EAAY,SAAA;EAAA,GAAc;AAAA,GAAS,cAAA,GAAc,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,KA6BrD,iBAAA,GAAoB,KAAA,CAAM,wBAAA,QACtB,OAAA,CAAU,OAAA;AAAA,iBAGV,YAAA,CAAA;EAAe,SAAA;EAAA,GAAc;AAAA,GAAS,iBAAA,GAAiB,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,KAa3D,eAAA,GAAkB,KAAA,CAAM,wBAAA,QAAgC,OAAA,CAAU,KAAA;AAAA,iBAE9D,UAAA,CAAA;EAAa,SAAA;EAAA,GAAc;AAAA,GAAS,eAAA,GAAe,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,KASvD,qBAAA,GAAwB,KAAA,CAAM,wBAAA,QAC1B,OAAA,CAAU,WAAA;AAAA,iBAGV,gBAAA,CAAA;EAAmB,SAAA;EAAA,GAAc;AAAA,GAAS,qBAAA,GAAqB,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,KAuFnE,cAAA,GAAiB,KAAA,CAAM,QAAA,CAAS,aAAA;EACnC,IAAA;AAAA;AAAA,iBAGO,SAAA,CAAA;EAAY,IAAA;EAAM,SAAA;EAAA,GAAc;AAAA,GAAS,cAAA,GAAc,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,KAgB3D,eAAA,GAAkB,KAAA,CAAM,wBAAA,QAAgC,OAAA,CAAU,KAAA;AAAA,iBAE9D,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBASjC,SAAA,CAAA,GAAS,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAiBL,KAAA,SAAK,SAAA"}
|
package/dist/toast.mjs
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as cn } from "./cn-BpvCVwZv.mjs";
|
|
3
|
+
import { Button } from "./button.mjs";
|
|
4
|
+
import { Text } from "./text.mjs";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Toast as Toast$1 } from "@base-ui/react/toast";
|
|
8
|
+
//#region src/components/toast/toast.tsx
|
|
9
|
+
function ToastProvider(props) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Toast$1.Provider, { ...props });
|
|
11
|
+
}
|
|
12
|
+
function ToastViewport({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(Toast$1.Portal, { children: /* @__PURE__ */ jsx(Toast$1.Viewport, {
|
|
14
|
+
className: cn("fixed right-4 bottom-4 z-50 mx-auto w-[calc(100vw-2rem)] sm:right-6 sm:bottom-6 sm:w-90", className),
|
|
15
|
+
...props
|
|
16
|
+
}) });
|
|
17
|
+
}
|
|
18
|
+
function ToastRoot({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Toast$1.Root, {
|
|
20
|
+
className: cn("[--gap:0.75rem] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]", "absolute right-0 bottom-0 left-auto z-[calc(1000-var(--toast-index))] w-full origin-bottom", "transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))]", "rounded-lg border border-(--border) bg-(--popover) text-(--popover-foreground) shadow-lg select-none", "data-ending-style:opacity-0 data-limited:opacity-0", "data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]", "data-starting-style:transform-[translateY(150%)]", "[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:transform-[translateY(150%)]", "data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))]", "data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))]", "data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]", "data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]", "data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]", "data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]", "data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]", "data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]", "h-(--height) data-expanded:h-(--toast-height)", "[transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.5s,height_0.15s]", className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function ToastContent({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(Toast$1.Content, {
|
|
26
|
+
className: cn("flex h-full items-center gap-4 overflow-hidden p-3 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)]", "data-behind:opacity-0 data-expanded:opacity-100", className),
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function ToastTitle({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(Toast$1.Title, {
|
|
32
|
+
className: cn("text-[13px] font-semibold", className),
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function ToastDescription({ className, ...props }) {
|
|
37
|
+
return /* @__PURE__ */ jsx(Toast$1.Description, {
|
|
38
|
+
render: /* @__PURE__ */ jsx(Text, {
|
|
39
|
+
as: "p",
|
|
40
|
+
size: "small"
|
|
41
|
+
}),
|
|
42
|
+
className: cn("text-(--muted-foreground)", className),
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const variantIcons = {
|
|
47
|
+
success: (props) => /* @__PURE__ */ jsxs("svg", {
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
fill: "none",
|
|
51
|
+
stroke: "currentColor",
|
|
52
|
+
strokeWidth: "2",
|
|
53
|
+
strokeLinecap: "round",
|
|
54
|
+
strokeLinejoin: "round",
|
|
55
|
+
...props,
|
|
56
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
57
|
+
cx: "12",
|
|
58
|
+
cy: "12",
|
|
59
|
+
r: "9"
|
|
60
|
+
}), /* @__PURE__ */ jsx("path", { d: "m8.5 12.5 2.5 2.5 4.5-5" })]
|
|
61
|
+
}),
|
|
62
|
+
error: (props) => /* @__PURE__ */ jsxs("svg", {
|
|
63
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
64
|
+
viewBox: "0 0 24 24",
|
|
65
|
+
fill: "none",
|
|
66
|
+
stroke: "currentColor",
|
|
67
|
+
strokeWidth: "2",
|
|
68
|
+
strokeLinecap: "round",
|
|
69
|
+
strokeLinejoin: "round",
|
|
70
|
+
...props,
|
|
71
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
72
|
+
cx: "12",
|
|
73
|
+
cy: "12",
|
|
74
|
+
r: "9"
|
|
75
|
+
}), /* @__PURE__ */ jsx("path", { d: "m9.5 9.5 5 5m0-5-5 5" })]
|
|
76
|
+
}),
|
|
77
|
+
warning: (props) => /* @__PURE__ */ jsxs("svg", {
|
|
78
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
79
|
+
viewBox: "0 0 24 24",
|
|
80
|
+
fill: "none",
|
|
81
|
+
stroke: "currentColor",
|
|
82
|
+
strokeWidth: "2",
|
|
83
|
+
strokeLinecap: "round",
|
|
84
|
+
strokeLinejoin: "round",
|
|
85
|
+
...props,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ jsx("path", { d: "M12 3.5 2.5 20h19L12 3.5Z" }),
|
|
88
|
+
/* @__PURE__ */ jsx("path", { d: "M12 10v4" }),
|
|
89
|
+
/* @__PURE__ */ jsx("path", { d: "M12 17.5h.01" })
|
|
90
|
+
]
|
|
91
|
+
}),
|
|
92
|
+
info: (props) => /* @__PURE__ */ jsxs("svg", {
|
|
93
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
94
|
+
viewBox: "0 0 24 24",
|
|
95
|
+
fill: "none",
|
|
96
|
+
stroke: "currentColor",
|
|
97
|
+
strokeWidth: "2",
|
|
98
|
+
strokeLinecap: "round",
|
|
99
|
+
strokeLinejoin: "round",
|
|
100
|
+
...props,
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ jsx("circle", {
|
|
103
|
+
cx: "12",
|
|
104
|
+
cy: "12",
|
|
105
|
+
r: "9"
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ jsx("path", { d: "M12 11v5.5" }),
|
|
108
|
+
/* @__PURE__ */ jsx("path", { d: "M12 7.5h.01" })
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
};
|
|
112
|
+
const variantColors = {
|
|
113
|
+
success: "text-(--success)",
|
|
114
|
+
error: "text-(--destructive)",
|
|
115
|
+
warning: "text-(--warning)",
|
|
116
|
+
info: "text-(--info)"
|
|
117
|
+
};
|
|
118
|
+
function ToastIcon({ type, className, ...props }) {
|
|
119
|
+
if (!isToastVariant(type)) return null;
|
|
120
|
+
const Icon = variantIcons[type];
|
|
121
|
+
return /* @__PURE__ */ jsx(Icon, {
|
|
122
|
+
className: cn("size-4 shrink-0", variantColors[type], className),
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function isToastVariant(type) {
|
|
127
|
+
return !!type && type in variantIcons;
|
|
128
|
+
}
|
|
129
|
+
function ToastClose(props) {
|
|
130
|
+
return /* @__PURE__ */ jsx(Toast$1.Close, {
|
|
131
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
132
|
+
variant: "outline",
|
|
133
|
+
size: "sm"
|
|
134
|
+
}),
|
|
135
|
+
...props
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function ToastList() {
|
|
139
|
+
const { toasts } = Toast$1.useToastManager();
|
|
140
|
+
return toasts.map((toast) => /* @__PURE__ */ jsx(ToastRoot, {
|
|
141
|
+
toast,
|
|
142
|
+
children: /* @__PURE__ */ jsxs(ToastContent, { children: [
|
|
143
|
+
/* @__PURE__ */ jsx(ToastIcon, { type: toast.type }),
|
|
144
|
+
/* @__PURE__ */ jsxs("div", {
|
|
145
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
146
|
+
children: [/* @__PURE__ */ jsx(ToastTitle, {}), /* @__PURE__ */ jsx(ToastDescription, {})]
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ jsx(ToastClose, { children: "Dismiss" })
|
|
149
|
+
] })
|
|
150
|
+
}, toast.id));
|
|
151
|
+
}
|
|
152
|
+
const Toast = Object.assign(ToastRoot, {
|
|
153
|
+
Provider: ToastProvider,
|
|
154
|
+
Viewport: ToastViewport,
|
|
155
|
+
Content: ToastContent,
|
|
156
|
+
Title: ToastTitle,
|
|
157
|
+
Description: ToastDescription,
|
|
158
|
+
Close: ToastClose,
|
|
159
|
+
Icon: ToastIcon,
|
|
160
|
+
List: ToastList,
|
|
161
|
+
useToastManager: Toast$1.useToastManager
|
|
162
|
+
});
|
|
163
|
+
//#endregion
|
|
164
|
+
export { Toast };
|
|
165
|
+
|
|
166
|
+
//# sourceMappingURL=toast.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.mjs","names":["BaseToast"],"sources":["../src/components/toast/toast.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { cn } from \"@/lib/cn\";\nimport { Button } from \"../button/button\";\nimport { Text } from \"../text/text\";\n\ntype ToastProviderProps = React.ComponentPropsWithoutRef<\n typeof BaseToast.Provider\n>;\n\nfunction ToastProvider(props: ToastProviderProps) {\n return <BaseToast.Provider {...props} />;\n}\n\ntype ToastViewportProps = React.ComponentPropsWithoutRef<\n typeof BaseToast.Viewport\n>;\n\nfunction ToastViewport({ className, ...props }: ToastViewportProps) {\n return (\n <BaseToast.Portal>\n <BaseToast.Viewport\n className={cn(\n \"fixed right-4 bottom-4 z-50 mx-auto w-[calc(100vw-2rem)] sm:right-6 sm:bottom-6 sm:w-90\",\n className,\n )}\n {...props}\n />\n </BaseToast.Portal>\n );\n}\n\ntype ToastRootProps = React.ComponentPropsWithoutRef<typeof BaseToast.Root>;\n\nfunction ToastRoot({ className, ...props }: ToastRootProps) {\n return (\n <BaseToast.Root\n className={cn(\n \"[--gap:0.75rem] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]\",\n \"absolute right-0 bottom-0 left-auto z-[calc(1000-var(--toast-index))] w-full origin-bottom\",\n \"transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))]\",\n \"rounded-lg border border-(--border) bg-(--popover) text-(--popover-foreground) shadow-lg select-none\",\n \"data-ending-style:opacity-0 data-limited:opacity-0\",\n \"data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]\",\n \"data-starting-style:transform-[translateY(150%)]\",\n \"[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:transform-[translateY(150%)]\",\n \"data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))]\",\n \"data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))]\",\n \"data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]\",\n \"data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]\",\n \"data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]\",\n \"data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]\",\n \"data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]\",\n \"data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]\",\n \"h-(--height) data-expanded:h-(--toast-height)\",\n \"[transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.5s,height_0.15s]\",\n className,\n )}\n {...props}\n />\n );\n}\n\ntype ToastContentProps = React.ComponentPropsWithoutRef<\n typeof BaseToast.Content\n>;\n\nfunction ToastContent({ className, ...props }: ToastContentProps) {\n return (\n <BaseToast.Content\n className={cn(\n \"flex h-full items-center gap-4 overflow-hidden p-3 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)]\",\n \"data-behind:opacity-0 data-expanded:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\ntype ToastTitleProps = React.ComponentPropsWithoutRef<typeof BaseToast.Title>;\n\nfunction ToastTitle({ className, ...props }: ToastTitleProps) {\n return (\n <BaseToast.Title\n className={cn(\"text-[13px] font-semibold\", className)}\n {...props}\n />\n );\n}\n\ntype ToastDescriptionProps = React.ComponentPropsWithoutRef<\n typeof BaseToast.Description\n>;\n\nfunction ToastDescription({ className, ...props }: ToastDescriptionProps) {\n return (\n <BaseToast.Description\n render={<Text as=\"p\" size=\"small\" />}\n className={cn(\"text-(--muted-foreground)\", className)}\n {...props}\n />\n );\n}\n\ntype ToastVariant = \"success\" | \"error\" | \"warning\" | \"info\";\n\nconst variantIcons: Record<\n ToastVariant,\n (props: React.SVGProps<SVGSVGElement>) => React.ReactElement\n> = {\n success: (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"m8.5 12.5 2.5 2.5 4.5-5\" />\n </svg>\n ),\n error: (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"m9.5 9.5 5 5m0-5-5 5\" />\n </svg>\n ),\n warning: (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M12 3.5 2.5 20h19L12 3.5Z\" />\n <path d=\"M12 10v4\" />\n <path d=\"M12 17.5h.01\" />\n </svg>\n ),\n info: (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 11v5.5\" />\n <path d=\"M12 7.5h.01\" />\n </svg>\n ),\n};\n\nconst variantColors: Record<ToastVariant, string> = {\n success: \"text-(--success)\",\n error: \"text-(--destructive)\",\n warning: \"text-(--warning)\",\n info: \"text-(--info)\",\n};\n\ntype ToastIconProps = React.SVGProps<SVGSVGElement> & {\n type: string | undefined;\n};\n\nfunction ToastIcon({ type, className, ...props }: ToastIconProps) {\n if (!isToastVariant(type)) return null;\n\n const Icon = variantIcons[type];\n return (\n <Icon\n className={cn(\"size-4 shrink-0\", variantColors[type], className)}\n {...props}\n />\n );\n}\n\nfunction isToastVariant(type: string | undefined): type is ToastVariant {\n return !!type && type in variantIcons;\n}\n\ntype ToastCloseProps = React.ComponentPropsWithoutRef<typeof BaseToast.Close>;\n\nfunction ToastClose(props: ToastCloseProps) {\n return (\n <BaseToast.Close\n render={<Button variant=\"outline\" size=\"sm\" />}\n {...props}\n />\n );\n}\n\nfunction ToastList() {\n const { toasts } = BaseToast.useToastManager();\n\n return toasts.map((toast) => (\n <ToastRoot key={toast.id} toast={toast}>\n <ToastContent>\n <ToastIcon type={toast.type} />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <ToastTitle />\n <ToastDescription />\n </div>\n <ToastClose>Dismiss</ToastClose>\n </ToastContent>\n </ToastRoot>\n ));\n}\n\nexport const Toast = Object.assign(ToastRoot, {\n Provider: ToastProvider,\n Viewport: ToastViewport,\n Content: ToastContent,\n Title: ToastTitle,\n Description: ToastDescription,\n Close: ToastClose,\n Icon: ToastIcon,\n List: ToastList,\n useToastManager: BaseToast.useToastManager,\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
3
|
+
|
|
4
|
+
//#region src/components/tooltip/tooltip.d.ts
|
|
5
|
+
type TooltipProviderProps = React.ComponentPropsWithoutRef<typeof Tooltip$1.Provider>;
|
|
6
|
+
declare function TooltipProvider({
|
|
7
|
+
delay,
|
|
8
|
+
closeDelay,
|
|
9
|
+
...props
|
|
10
|
+
}: TooltipProviderProps): React.JSX.Element;
|
|
11
|
+
type TooltipRootProps = React.ComponentPropsWithoutRef<typeof Tooltip$1.Root>;
|
|
12
|
+
declare function TooltipRoot(props: TooltipRootProps): React.JSX.Element;
|
|
13
|
+
type TooltipTriggerProps = React.ComponentPropsWithoutRef<typeof Tooltip$1.Trigger>;
|
|
14
|
+
declare function TooltipTrigger({
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
}: TooltipTriggerProps): React.JSX.Element;
|
|
18
|
+
type TooltipContentProps = React.ComponentPropsWithoutRef<typeof Tooltip$1.Popup> & Pick<React.ComponentPropsWithoutRef<typeof Tooltip$1.Positioner>, "side" | "align" | "sideOffset" | "alignOffset">;
|
|
19
|
+
declare function TooltipContent({
|
|
20
|
+
className,
|
|
21
|
+
side,
|
|
22
|
+
align,
|
|
23
|
+
sideOffset,
|
|
24
|
+
alignOffset,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}: TooltipContentProps): React.JSX.Element;
|
|
28
|
+
declare const Tooltip: typeof TooltipRoot & {
|
|
29
|
+
Provider: typeof TooltipProvider;
|
|
30
|
+
Trigger: typeof TooltipTrigger;
|
|
31
|
+
Content: typeof TooltipContent;
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Tooltip };
|
|
35
|
+
//# sourceMappingURL=tooltip.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.mts","names":[],"sources":["../src/components/tooltip/tooltip.tsx"],"mappings":";;;;KAMK,oBAAA,GAAuB,KAAA,CAAM,wBAAA,QACzB,SAAA,CAAY,QAAA;AAAA,iBAGZ,eAAA,CAAA;EACP,KAAA;EACA,UAAA;EAAA,GACG;AAAA,GACF,oBAAA,GAAoB,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,KAMlB,gBAAA,GAAmB,KAAA,CAAM,wBAAA,QAAgC,SAAA,CAAY,IAAA;AAAA,iBAEjE,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,KAIvC,mBAAA,GAAsB,KAAA,CAAM,wBAAA,QACxB,SAAA,CAAY,OAAA;AAAA,iBAGZ,cAAA,CAAA;EAAiB,SAAA;EAAA,GAAc;AAAA,GAAS,mBAAA,GAAmB,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,KAY/D,mBAAA,GAAsB,KAAA,CAAM,wBAAA,QACxB,SAAA,CAAY,KAAA,IAEnB,IAAA,CACE,KAAA,CAAM,wBAAA,QAAgC,SAAA,CAAY,UAAA;AAAA,iBAI7C,cAAA,CAAA;EACP,SAAA;EACA,IAAA;EACA,KAAA;EACA,UAAA;EACA,WAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAmB,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cA4BT,OAAA,SAAO,WAAA"}
|
package/dist/tooltip.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as cn } from "./cn-BpvCVwZv.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
6
|
+
//#region src/components/tooltip/tooltip.tsx
|
|
7
|
+
function TooltipProvider({ delay = 150, closeDelay = 0, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Provider, {
|
|
9
|
+
delay,
|
|
10
|
+
closeDelay,
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function TooltipRoot(props) {
|
|
15
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Root, { ...props });
|
|
16
|
+
}
|
|
17
|
+
function TooltipTrigger({ className, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Trigger, {
|
|
19
|
+
className: cn("rounded-md outline-none focus-visible:ring-2 focus-visible:ring-(--ring)/30", className),
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function TooltipContent({ className, side, align = "center", sideOffset = 8, alignOffset, children, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
|
|
25
|
+
side,
|
|
26
|
+
align,
|
|
27
|
+
sideOffset,
|
|
28
|
+
alignOffset,
|
|
29
|
+
className: "z-50 outline-none",
|
|
30
|
+
children: /* @__PURE__ */ jsx(Tooltip$1.Popup, {
|
|
31
|
+
className: cn("relative max-w-64 origin-(--transform-origin) text-pretty rounded-md border border-(--border) bg-(--popover) px-2 py-1 text-[12px] text-(--popover-foreground) shadow-md outline-none", "transition-[transform,opacity] duration-150 ease-out", "data-starting-style:scale-90 data-starting-style:opacity-0", "data-ending-style:scale-90 data-ending-style:opacity-0", "data-instant:transition-none", className),
|
|
32
|
+
...props,
|
|
33
|
+
children
|
|
34
|
+
})
|
|
35
|
+
}) });
|
|
36
|
+
}
|
|
37
|
+
const Tooltip = Object.assign(TooltipRoot, {
|
|
38
|
+
Provider: TooltipProvider,
|
|
39
|
+
Trigger: TooltipTrigger,
|
|
40
|
+
Content: TooltipContent
|
|
41
|
+
});
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Tooltip };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=tooltip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.mjs","names":["BaseTooltip"],"sources":["../src/components/tooltip/tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\nimport { cn } from \"@/lib/cn\";\n\ntype TooltipProviderProps = React.ComponentPropsWithoutRef<\n typeof BaseTooltip.Provider\n>;\n\nfunction TooltipProvider({\n delay = 150,\n closeDelay = 0,\n ...props\n}: TooltipProviderProps) {\n return (\n <BaseTooltip.Provider delay={delay} closeDelay={closeDelay} {...props} />\n );\n}\n\ntype TooltipRootProps = React.ComponentPropsWithoutRef<typeof BaseTooltip.Root>;\n\nfunction TooltipRoot(props: TooltipRootProps) {\n return <BaseTooltip.Root {...props} />;\n}\n\ntype TooltipTriggerProps = React.ComponentPropsWithoutRef<\n typeof BaseTooltip.Trigger\n>;\n\nfunction TooltipTrigger({ className, ...props }: TooltipTriggerProps) {\n return (\n <BaseTooltip.Trigger\n className={cn(\n \"rounded-md outline-none focus-visible:ring-2 focus-visible:ring-(--ring)/30\",\n className,\n )}\n {...props}\n />\n );\n}\n\ntype TooltipContentProps = React.ComponentPropsWithoutRef<\n typeof BaseTooltip.Popup\n> &\n Pick<\n React.ComponentPropsWithoutRef<typeof BaseTooltip.Positioner>,\n \"side\" | \"align\" | \"sideOffset\" | \"alignOffset\"\n >;\n\nfunction TooltipContent({\n className,\n side,\n align = \"center\",\n sideOffset = 8,\n alignOffset,\n children,\n ...props\n}: TooltipContentProps) {\n return (\n <BaseTooltip.Portal>\n <BaseTooltip.Positioner\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n className=\"z-50 outline-none\"\n >\n <BaseTooltip.Popup\n className={cn(\n \"relative max-w-64 origin-(--transform-origin) text-pretty rounded-md border border-(--border) bg-(--popover) px-2 py-1 text-[12px] text-(--popover-foreground) shadow-md outline-none\",\n \"transition-[transform,opacity] duration-150 ease-out\",\n \"data-starting-style:scale-90 data-starting-style:opacity-0\",\n \"data-ending-style:scale-90 data-ending-style:opacity-0\",\n \"data-instant:transition-none\",\n className,\n )}\n {...props}\n >\n {children}\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n </BaseTooltip.Portal>\n );\n}\n\nexport const Tooltip = Object.assign(TooltipRoot, {\n Provider: TooltipProvider,\n Trigger: TooltipTrigger,\n Content: TooltipContent,\n});\n"],"mappings":";;;;;;AAUA,SAAS,gBAAgB,EACvB,QAAQ,KACR,aAAa,GACb,GAAG,SACoB;AACvB,QACE,oBAACA,UAAY,UAAb;EAA6B;EAAmB;EAAY,GAAI;EAAS,CAAA;;AAM7E,SAAS,YAAY,OAAyB;AAC5C,QAAO,oBAACA,UAAY,MAAb,EAAkB,GAAI,OAAS,CAAA;;AAOxC,SAAS,eAAe,EAAE,WAAW,GAAG,SAA8B;AACpE,QACE,oBAACA,UAAY,SAAb;EACE,WAAW,GACT,+EACA,UACD;EACD,GAAI;EACJ,CAAA;;AAYN,SAAS,eAAe,EACtB,WACA,MACA,QAAQ,UACR,aAAa,GACb,aACA,UACA,GAAG,SACmB;AACtB,QACE,oBAACA,UAAY,QAAb,EAAA,UACE,oBAACA,UAAY,YAAb;EACQ;EACC;EACK;EACC;EACb,WAAU;YAEV,oBAACA,UAAY,OAAb;GACE,WAAW,GACT,yLACA,wDACA,8DACA,0DACA,gCACA,UACD;GACD,GAAI;GAEH;GACiB,CAAA;EACG,CAAA,EACN,CAAA;;AAIzB,MAAa,UAAU,OAAO,OAAO,aAAa;CAChD,UAAU;CACV,SAAS;CACT,SAAS;CACV,CAAC"}
|
package/package.json
CHANGED
package/src/styles.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
6
6
|
|
|
7
7
|
:root {
|
|
8
|
-
--background: oklch(
|
|
8
|
+
--background: oklch(1 0 0);
|
|
9
9
|
--foreground: oklch(0.15 0 0);
|
|
10
10
|
--card: oklch(1 0 0);
|
|
11
11
|
--card-foreground: oklch(0.15 0 0);
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
--accent: oklch(0.975 0 0);
|
|
20
20
|
--accent-foreground: oklch(0.15 0 0);
|
|
21
21
|
--ring: oklch(0.62 0.19 259);
|
|
22
|
+
--success: oklch(0.6 0.15 145);
|
|
23
|
+
--warning: oklch(0.72 0.16 80);
|
|
24
|
+
--destructive: oklch(0.58 0.22 25);
|
|
25
|
+
--info: oklch(0.6 0.19 259);
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
@media (prefers-color-scheme: dark) {
|
|
@@ -37,6 +41,10 @@
|
|
|
37
41
|
--accent: oklch(0.23 0.006 264);
|
|
38
42
|
--accent-foreground: oklch(0.97 0.003 264);
|
|
39
43
|
--ring: oklch(0.72 0.16 262);
|
|
44
|
+
--success: oklch(0.72 0.17 145);
|
|
45
|
+
--warning: oklch(0.8 0.16 80);
|
|
46
|
+
--destructive: oklch(0.7 0.19 25);
|
|
47
|
+
--info: oklch(0.72 0.16 262);
|
|
40
48
|
}
|
|
41
49
|
}
|
|
42
50
|
|
|
@@ -55,6 +63,10 @@
|
|
|
55
63
|
--accent: oklch(0.23 0.006 264);
|
|
56
64
|
--accent-foreground: oklch(0.97 0.003 264);
|
|
57
65
|
--ring: oklch(0.72 0.16 262);
|
|
66
|
+
--success: oklch(0.72 0.17 145);
|
|
67
|
+
--warning: oklch(0.8 0.16 80);
|
|
68
|
+
--destructive: oklch(0.7 0.19 25);
|
|
69
|
+
--info: oklch(0.72 0.16 262);
|
|
58
70
|
}
|
|
59
71
|
|
|
60
72
|
body {
|