@nayhoo/ui 0.8.0 → 0.9.0
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/dist/chunk-3Z2HB2J6.mjs +25 -0
- package/dist/chunk-3Z2HB2J6.mjs.map +1 -0
- package/dist/chunk-GI2XNLAW.mjs +39 -0
- package/dist/chunk-GI2XNLAW.mjs.map +1 -0
- package/dist/chunk-NU7XYEVP.mjs +43 -0
- package/dist/chunk-NU7XYEVP.mjs.map +1 -0
- package/dist/chunk-RAS2GZOT.mjs +25 -0
- package/dist/chunk-RAS2GZOT.mjs.map +1 -0
- package/dist/chunk-X6UXW66P.mjs +39 -0
- package/dist/chunk-X6UXW66P.mjs.map +1 -0
- package/dist/components/button.d.mts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/button.mjs +6 -33
- package/dist/components/button.mjs.map +1 -1
- package/dist/components/heading.mjs +4 -37
- package/dist/components/heading.mjs.map +1 -1
- package/dist/components/icon-button.mjs +6 -33
- package/dist/components/icon-button.mjs.map +1 -1
- package/dist/components/text.mjs +5 -19
- package/dist/components/text.mjs.map +1 -1
- package/dist/providers/index.css +564 -0
- package/dist/providers/index.css.map +1 -1
- package/dist/providers/index.d.mts +21 -1
- package/dist/providers/index.d.ts +21 -1
- package/dist/providers/index.js +371 -2
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/index.mjs +248 -3
- package/dist/providers/index.mjs.map +1 -1
- package/dist/theme/index.css +258 -0
- package/dist/theme/index.css.map +1 -1
- package/dist/theme/index.d.mts +8 -1
- package/dist/theme/index.d.ts +8 -1
- package/dist/theme/index.js +20 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +14 -2
- package/dist/theme/index.mjs.map +1 -1
- package/package.json +2 -3
- package/dist/chunk-5WQXUS72.mjs +0 -11
- package/dist/chunk-5WQXUS72.mjs.map +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
textRecipe
|
|
3
|
+
} from "./chunk-IPBDMBQP.mjs";
|
|
4
|
+
import {
|
|
5
|
+
pick
|
|
6
|
+
} from "./chunk-4N6P3Y54.mjs";
|
|
7
|
+
import {
|
|
8
|
+
mergeClasses
|
|
9
|
+
} from "./chunk-7EGQM3ZL.mjs";
|
|
10
|
+
|
|
11
|
+
// src/components/text.tsx
|
|
12
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var defaultElement = "span";
|
|
15
|
+
var Text = ({ asChild, ...props }) => {
|
|
16
|
+
const variants = pick(props, ...textRecipe.variants());
|
|
17
|
+
const text = textRecipe(variants);
|
|
18
|
+
const Comp = asChild ? Slot : defaultElement;
|
|
19
|
+
return /* @__PURE__ */ jsx(Comp, { ...props, className: mergeClasses(text, props.className), children: props.children });
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
Text
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=chunk-3Z2HB2J6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/text.tsx"],"sourcesContent":["import { TextVariants, textRecipe } from \"@/theme/recipes/text.css\";\nimport { ComponentProps } from \"@/types/component-props\";\nimport { mergeClasses } from \"@/utils/merge-classes\";\nimport { pick } from \"@/utils/pick\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nconst defaultElement = \"span\";\n\ntype TextProps = ComponentProps<typeof defaultElement, TextVariants>;\n\nexport const Text = ({ asChild, ...props }: TextProps) => {\n const variants = pick(props, ...textRecipe.variants());\n const text = textRecipe(variants);\n const Comp = asChild ? Slot : defaultElement;\n\n return (\n <Comp {...props} className={mergeClasses(text, props.className)}>\n {props.children}\n </Comp>\n );\n};\n"],"mappings":";;;;;;;;;;;AAIA,SAAS,YAAY;AAYjB;AAVJ,IAAM,iBAAiB;AAIhB,IAAM,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,MAAiB;AACxD,QAAM,WAAW,KAAK,OAAO,GAAG,WAAW,SAAS,CAAC;AACrD,QAAM,OAAO,WAAW,QAAQ;AAChC,QAAM,OAAO,UAAU,OAAO;AAE9B,SACE,oBAAC,QAAM,GAAG,OAAO,WAAW,aAAa,MAAM,MAAM,SAAS,GAC3D,gBAAM,UACT;AAEJ;","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
iconButtonRecipe
|
|
3
|
+
} from "./chunk-IRWT2CO3.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Spinner
|
|
6
|
+
} from "./chunk-A2I7UNX6.mjs";
|
|
7
|
+
import {
|
|
8
|
+
pick
|
|
9
|
+
} from "./chunk-4N6P3Y54.mjs";
|
|
10
|
+
import {
|
|
11
|
+
mergeClasses
|
|
12
|
+
} from "./chunk-7EGQM3ZL.mjs";
|
|
13
|
+
|
|
14
|
+
// src/components/icon-button.tsx
|
|
15
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
var defaultElement = "button";
|
|
18
|
+
var IconButton = ({ asChild, ...props }) => {
|
|
19
|
+
const variants = pick(props, ...iconButtonRecipe.variants());
|
|
20
|
+
const iconButton = iconButtonRecipe(variants);
|
|
21
|
+
const Comp = asChild ? Slot : defaultElement;
|
|
22
|
+
return /* @__PURE__ */ jsxs(
|
|
23
|
+
Comp,
|
|
24
|
+
{
|
|
25
|
+
...props,
|
|
26
|
+
className: mergeClasses(iconButton, props.className),
|
|
27
|
+
disabled: props.disabled || Boolean(variants.loading),
|
|
28
|
+
children: [
|
|
29
|
+
props.children,
|
|
30
|
+
variants.loading && /* @__PURE__ */ jsx(Spinner, { style: { position: "absolute" } })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
IconButton
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=chunk-GI2XNLAW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/icon-button.tsx"],"sourcesContent":["import { Spinner } from \"@/components/spinner\";\nimport {\n IconButtonVariants,\n iconButtonRecipe,\n} from \"@/theme/recipes/icon-button.css\";\nimport { ComponentProps } from \"@/types/component-props\";\nimport { mergeClasses } from \"@/utils/merge-classes\";\nimport { pick } from \"@/utils/pick\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nconst defaultElement = \"button\";\n\ntype IconButtonProps = ComponentProps<\n typeof defaultElement,\n IconButtonVariants\n>;\n\nexport const IconButton = ({ asChild, ...props }: IconButtonProps) => {\n const variants = pick(props, ...iconButtonRecipe.variants());\n const iconButton = iconButtonRecipe(variants);\n const Comp = asChild ? Slot : defaultElement;\n\n return (\n <Comp\n {...props}\n className={mergeClasses(iconButton, props.className)}\n disabled={props.disabled || Boolean(variants.loading)}\n >\n {props.children}\n {variants.loading && <Spinner style={{ position: \"absolute\" }} />}\n </Comp>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAQA,SAAS,YAAY;AAejB,SAMuB,KANvB;AAbJ,IAAM,iBAAiB;AAOhB,IAAM,aAAa,CAAC,EAAE,SAAS,GAAG,MAAM,MAAuB;AACpE,QAAM,WAAW,KAAK,OAAO,GAAG,iBAAiB,SAAS,CAAC;AAC3D,QAAM,aAAa,iBAAiB,QAAQ;AAC5C,QAAM,OAAO,UAAU,OAAO;AAE9B,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,aAAa,YAAY,MAAM,SAAS;AAAA,MACnD,UAAU,MAAM,YAAY,QAAQ,SAAS,OAAO;AAAA,MAEnD;AAAA,cAAM;AAAA,QACN,SAAS,WAAW,oBAAC,WAAQ,OAAO,EAAE,UAAU,WAAW,GAAG;AAAA;AAAA;AAAA,EACjE;AAEJ;","names":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
textRecipe
|
|
3
|
+
} from "./chunk-IPBDMBQP.mjs";
|
|
4
|
+
import {
|
|
5
|
+
mergeClasses
|
|
6
|
+
} from "./chunk-7EGQM3ZL.mjs";
|
|
7
|
+
|
|
8
|
+
// src/components/heading.tsx
|
|
9
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var textAs = {
|
|
12
|
+
1: "h1",
|
|
13
|
+
2: "h2",
|
|
14
|
+
3: "h3",
|
|
15
|
+
4: "h4",
|
|
16
|
+
5: "h5",
|
|
17
|
+
6: "h6"
|
|
18
|
+
};
|
|
19
|
+
var textSize = {
|
|
20
|
+
1: "8",
|
|
21
|
+
2: "7",
|
|
22
|
+
3: "6",
|
|
23
|
+
4: "5",
|
|
24
|
+
5: "4",
|
|
25
|
+
6: "3"
|
|
26
|
+
};
|
|
27
|
+
var Heading = ({
|
|
28
|
+
asChild,
|
|
29
|
+
color,
|
|
30
|
+
level = "1",
|
|
31
|
+
weight = "medium",
|
|
32
|
+
// overrides defaultVariant
|
|
33
|
+
...props
|
|
34
|
+
}) => {
|
|
35
|
+
const text = textRecipe({ color, size: textSize[level], weight });
|
|
36
|
+
const Comp = asChild ? Slot : textAs[level];
|
|
37
|
+
return /* @__PURE__ */ jsx(Comp, { ...props, className: mergeClasses(text, props.className), children: props.children });
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
Heading
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=chunk-NU7XYEVP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/heading.tsx"],"sourcesContent":["import { TextVariants, textRecipe } from \"@/theme/recipes/text.css\";\nimport { ComponentProps } from \"@/types/component-props\";\nimport { mergeClasses } from \"@/utils/merge-classes\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport React from \"react\";\n\ntype HeadingLevelVariants = \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n\nexport type HeadingProps = ComponentProps<\n \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\",\n Omit<TextVariants, \"size\">\n> & {\n level?: HeadingLevelVariants;\n};\n\nconst textAs: Record<HeadingLevelVariants, React.ElementType> = {\n 1: \"h1\",\n 2: \"h2\",\n 3: \"h3\",\n 4: \"h4\",\n 5: \"h5\",\n 6: \"h6\",\n};\n\nconst textSize: Record<HeadingLevelVariants, TextVariants[\"size\"]> = {\n 1: \"8\",\n 2: \"7\",\n 3: \"6\",\n 4: \"5\",\n 5: \"4\",\n 6: \"3\",\n};\n\nexport const Heading = ({\n asChild,\n color,\n level = \"1\",\n weight = \"medium\", // overrides defaultVariant\n ...props\n}: HeadingProps) => {\n const text = textRecipe({ color, size: textSize[level], weight });\n const Comp = asChild ? Slot : textAs[level];\n\n return (\n <Comp {...props} className={mergeClasses(text, props.className)}>\n {props.children}\n </Comp>\n );\n};\n"],"mappings":";;;;;;;;AAGA,SAAS,YAAY;AAyCjB;AA7BJ,IAAM,SAA0D;AAAA,EAC9D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,IAAM,WAA+D;AAAA,EACnE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,IAAM,UAAU,CAAC;AAAA,EACtB;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,SAAS;AAAA;AAAA,EACT,GAAG;AACL,MAAoB;AAClB,QAAM,OAAO,WAAW,EAAE,OAAO,MAAM,SAAS,KAAK,GAAG,OAAO,CAAC;AAChE,QAAM,OAAO,UAAU,OAAO,OAAO,KAAK;AAE1C,SACE,oBAAC,QAAM,GAAG,OAAO,WAAW,aAAa,MAAM,MAAM,SAAS,GAC3D,gBAAM,UACT;AAEJ;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/theme/themes/dark-theme.css.ts
|
|
2
|
+
var darkTheme = "dark-theme__1mh7hnp0";
|
|
3
|
+
|
|
4
|
+
// src/theme/themes/light-theme.css.ts
|
|
5
|
+
var lightTheme = "light-theme__6in2mz0";
|
|
6
|
+
|
|
7
|
+
// src/theme/styles/toaster.css.ts
|
|
8
|
+
var checkmark = "toaster_checkmark__3jyebmb";
|
|
9
|
+
var error = "toaster_error__3jyebmc";
|
|
10
|
+
var toastClose = "toaster_toastClose__3jyebm6";
|
|
11
|
+
var toastInner = "toaster_toastInner__3jyebm5";
|
|
12
|
+
var toastRoot = "toaster_toastRoot__3jyebm4";
|
|
13
|
+
var toastViewport = "toaster_toastViewport__3jyebm3";
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
darkTheme,
|
|
17
|
+
lightTheme,
|
|
18
|
+
checkmark,
|
|
19
|
+
error,
|
|
20
|
+
toastClose,
|
|
21
|
+
toastInner,
|
|
22
|
+
toastRoot,
|
|
23
|
+
toastViewport
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=chunk-RAS2GZOT.mjs.map
|