@nayhoo/ui 0.12.1 → 0.13.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-5VVYRZDU.mjs → chunk-24DFRL5Q.mjs} +12 -9
- package/dist/chunk-24DFRL5Q.mjs.map +1 -0
- package/dist/{chunk-OCXG5SMA.mjs → chunk-2WZQZIYN.mjs} +8 -5
- package/dist/chunk-2WZQZIYN.mjs.map +1 -0
- package/dist/chunk-BALC5CGU.mjs +23 -0
- package/dist/chunk-BALC5CGU.mjs.map +1 -0
- package/dist/chunk-DQ4T4WV3.mjs +16 -0
- package/dist/chunk-DQ4T4WV3.mjs.map +1 -0
- package/dist/{chunk-C53FYO65.mjs → chunk-ELXCOK2T.mjs} +8 -5
- package/dist/chunk-ELXCOK2T.mjs.map +1 -0
- package/dist/chunk-GED6IT3S.mjs +1 -0
- package/dist/{chunk-OKNO3BFR.mjs → chunk-L2MODHAE.mjs} +12 -9
- package/dist/chunk-L2MODHAE.mjs.map +1 -0
- package/dist/{chunk-WPNBONR3.mjs → chunk-LSB5JVS2.mjs} +1 -1
- package/dist/chunk-LSB5JVS2.mjs.map +1 -0
- package/dist/{chunk-HNOMBFLC.mjs → chunk-MIRMF5N3.mjs} +8 -5
- package/dist/chunk-MIRMF5N3.mjs.map +1 -0
- package/dist/{chunk-YJWLCDJE.mjs → chunk-XWF2DDXB.mjs} +8 -5
- package/dist/chunk-XWF2DDXB.mjs.map +1 -0
- package/dist/components/avatar.d.mts +1 -1
- package/dist/components/avatar.d.ts +1 -1
- package/dist/components/avatar.js +34 -9
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/avatar.mjs +18 -11
- package/dist/components/avatar.mjs.map +1 -1
- package/dist/components/badge.d.mts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +24 -5
- package/dist/components/badge.js.map +1 -1
- package/dist/components/badge.mjs +8 -4
- package/dist/components/badge.mjs.map +1 -1
- package/dist/components/box.d.mts +1 -1
- package/dist/components/box.d.ts +1 -1
- package/dist/components/box.js.map +1 -1
- package/dist/components/box.mjs +1 -1
- package/dist/components/button.js +32 -10
- package/dist/components/button.js.map +1 -1
- package/dist/components/button.mjs +4 -3
- package/dist/components/card.d.mts +1 -1
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/card.mjs.map +1 -1
- package/dist/components/checkbox.d.mts +1 -1
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +26 -6
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/checkbox.mjs +10 -5
- package/dist/components/checkbox.mjs.map +1 -1
- package/dist/components/container.d.mts +1 -1
- package/dist/components/container.d.ts +1 -1
- package/dist/components/container.js +24 -5
- package/dist/components/container.js.map +1 -1
- package/dist/components/container.mjs +8 -4
- package/dist/components/container.mjs.map +1 -1
- package/dist/components/dropdown-menu.d.mts +5 -1
- package/dist/components/dropdown-menu.d.ts +5 -1
- package/dist/components/dropdown-menu.js +21 -2
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/dropdown-menu.mjs +4 -3
- package/dist/components/dropdown-menu.mjs.map +1 -1
- package/dist/components/flex.d.mts +1 -1
- package/dist/components/flex.d.ts +1 -1
- package/dist/components/flex.js +24 -5
- package/dist/components/flex.js.map +1 -1
- package/dist/components/flex.mjs +3 -2
- package/dist/components/form.d.mts +4 -1
- package/dist/components/form.d.ts +4 -1
- package/dist/components/form.js +26 -7
- package/dist/components/form.js.map +1 -1
- package/dist/components/form.mjs +10 -6
- package/dist/components/form.mjs.map +1 -1
- package/dist/components/grid.d.mts +1 -1
- package/dist/components/grid.d.ts +1 -1
- package/dist/components/grid.js +24 -5
- package/dist/components/grid.js.map +1 -1
- package/dist/components/grid.mjs +8 -4
- package/dist/components/grid.mjs.map +1 -1
- package/dist/components/icon-button.d.mts +1 -1
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/icon-button.js +32 -10
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/icon-button.mjs +4 -3
- package/dist/components/label.d.mts +1 -1
- package/dist/components/label.d.ts +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/label.mjs.map +1 -1
- package/dist/components/link.d.mts +1 -1
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +24 -5
- package/dist/components/link.js.map +1 -1
- package/dist/components/link.mjs +8 -4
- package/dist/components/link.mjs.map +1 -1
- package/dist/components/menu.d.mts +3 -1
- package/dist/components/menu.d.ts +3 -1
- package/dist/components/menu.js +21 -2
- package/dist/components/menu.js.map +1 -1
- package/dist/components/menu.mjs +4 -3
- package/dist/components/menu.mjs.map +1 -1
- package/dist/components/panel.d.mts +1 -1
- package/dist/components/panel.d.ts +1 -1
- package/dist/components/panel.js.map +1 -1
- package/dist/components/panel.mjs.map +1 -1
- package/dist/components/paragraph.d.mts +1 -1
- package/dist/components/paragraph.d.ts +1 -1
- package/dist/components/paragraph.js.map +1 -1
- package/dist/components/paragraph.mjs.map +1 -1
- package/dist/components/popover.d.mts +4 -1
- package/dist/components/popover.d.ts +4 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/popover.mjs +2 -2
- package/dist/components/popover.mjs.map +1 -1
- package/dist/components/select.d.mts +3 -1
- package/dist/components/select.d.ts +3 -1
- package/dist/components/select.js +29 -7
- package/dist/components/select.js.map +1 -1
- package/dist/components/select.mjs +4 -3
- package/dist/components/select.mjs.map +1 -1
- package/dist/components/separator.d.mts +1 -1
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/separator.mjs.map +1 -1
- package/dist/components/skeleton.d.mts +1 -1
- package/dist/components/skeleton.d.ts +1 -1
- package/dist/components/skeleton.js +24 -5
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/skeleton.mjs +8 -4
- package/dist/components/skeleton.mjs.map +1 -1
- package/dist/components/spinner.d.mts +1 -1
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.js +24 -5
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/spinner.mjs +3 -2
- package/dist/components/status.d.mts +1 -1
- package/dist/components/status.d.ts +1 -1
- package/dist/components/status.js +24 -5
- package/dist/components/status.js.map +1 -1
- package/dist/components/status.mjs +3 -2
- package/dist/components/switch.d.mts +1 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +31 -9
- package/dist/components/switch.js.map +1 -1
- package/dist/components/switch.mjs +15 -8
- package/dist/components/switch.mjs.map +1 -1
- package/dist/components/text-field.d.mts +1 -1
- package/dist/components/text-field.d.ts +1 -1
- package/dist/components/text-field.js +24 -5
- package/dist/components/text-field.js.map +1 -1
- package/dist/components/text-field.mjs +8 -4
- package/dist/components/text-field.mjs.map +1 -1
- package/dist/components/text.d.mts +1 -1
- package/dist/components/text.d.ts +1 -1
- package/dist/components/text.js +24 -5
- package/dist/components/text.js.map +1 -1
- package/dist/components/text.mjs +3 -2
- package/dist/components/tooltip.d.mts +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +28 -6
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tooltip.mjs +12 -8
- package/dist/components/tooltip.mjs.map +1 -1
- package/dist/providers/index.js +45 -17
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/index.mjs +6 -5
- package/dist/providers/index.mjs.map +1 -1
- package/dist/utils/index.d.mts +3 -1
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +11 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +4 -2
- package/package.json +1 -1
- package/dist/chunk-4N6P3Y54.mjs +0 -13
- package/dist/chunk-4N6P3Y54.mjs.map +0 -1
- package/dist/chunk-5VVYRZDU.mjs.map +0 -1
- package/dist/chunk-C53FYO65.mjs.map +0 -1
- package/dist/chunk-CYDWEPFL.mjs +0 -1
- package/dist/chunk-HNOMBFLC.mjs.map +0 -1
- package/dist/chunk-OCXG5SMA.mjs.map +0 -1
- package/dist/chunk-OKNO3BFR.mjs.map +0 -1
- package/dist/chunk-WPNBONR3.mjs.map +0 -1
- package/dist/chunk-YJWLCDJE.mjs.map +0 -1
- /package/dist/{chunk-CYDWEPFL.mjs.map → chunk-GED6IT3S.mjs.map} +0 -0
|
@@ -28,9 +28,13 @@ module.exports = __toCommonJS(container_exports);
|
|
|
28
28
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
29
29
|
var containerRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "container_containerRecipe__1mebzt0", variantClassNames: { size: { "1": "container_containerRecipe_size_1__1mebzt1", "2": "container_containerRecipe_size_2__1mebzt2", "3": "container_containerRecipe_size_3__1mebzt3", "4": "container_containerRecipe_size_4__1mebzt4" } }, defaultVariants: { size: "4" }, compoundVariants: [] });
|
|
30
30
|
|
|
31
|
-
// src/utils/
|
|
32
|
-
function
|
|
33
|
-
|
|
31
|
+
// src/utils/omit.ts
|
|
32
|
+
function omit(obj, ...keys) {
|
|
33
|
+
const ret = { ...obj };
|
|
34
|
+
keys.forEach((key) => {
|
|
35
|
+
delete ret[key];
|
|
36
|
+
});
|
|
37
|
+
return ret;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
// src/utils/pick.ts
|
|
@@ -42,15 +46,30 @@ function pick(obj, ...keys) {
|
|
|
42
46
|
return ret;
|
|
43
47
|
}
|
|
44
48
|
|
|
49
|
+
// src/utils/get-variants.ts
|
|
50
|
+
function extractVariantsFromProps(obj, ...keys) {
|
|
51
|
+
const variants = pick(obj, ...keys);
|
|
52
|
+
const rest = omit(obj, ...keys);
|
|
53
|
+
return [variants, rest];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/utils/merge-classes.ts
|
|
57
|
+
function mergeClasses(...classes) {
|
|
58
|
+
return classes.filter((cls) => Boolean(cls)).join(" ");
|
|
59
|
+
}
|
|
60
|
+
|
|
45
61
|
// src/components/container.tsx
|
|
46
62
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
47
63
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
64
|
var defaultElement = "div";
|
|
49
65
|
var Container = ({ asChild, ...props }) => {
|
|
50
|
-
const variants =
|
|
66
|
+
const [variants, rest] = extractVariantsFromProps(
|
|
67
|
+
props,
|
|
68
|
+
...containerRecipe.variants()
|
|
69
|
+
);
|
|
51
70
|
const container = containerRecipe(variants);
|
|
52
71
|
const Comp = asChild ? import_react_slot.Slot : defaultElement;
|
|
53
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { ...
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { ...rest, className: mergeClasses(container, rest.className), children: rest.children });
|
|
54
73
|
};
|
|
55
74
|
// Annotate the CommonJS export names for ESM import in node:
|
|
56
75
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/container.tsx","../../src/theme/recipes/container.css.ts","../../src/utils/
|
|
1
|
+
{"version":3,"sources":["../../src/components/container.tsx","../../src/theme/recipes/container.css.ts","../../src/utils/omit.ts","../../src/utils/pick.ts","../../src/utils/get-variants.ts","../../src/utils/merge-classes.ts"],"sourcesContent":["import {\n ContainerVariants,\n containerRecipe,\n} from \"@/theme/recipes/container.css\";\nimport { ComponentProps } from \"@/types/component-props\";\nimport { extractVariantsFromProps } from \"@/utils/get-variants\";\nimport { mergeClasses } from \"@/utils/merge-classes\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nconst defaultElement = \"div\";\n\nexport type ContainerProps = ComponentProps<\n typeof defaultElement,\n ContainerVariants\n>;\n\nexport const Container = ({ asChild, ...props }: ContainerProps) => {\n const [variants, rest] = extractVariantsFromProps(\n props,\n ...containerRecipe.variants(),\n );\n const container = containerRecipe(variants);\n const Comp = asChild ? Slot : defaultElement;\n\n return (\n <Comp {...rest} className={mergeClasses(container, rest.className)}>\n {rest.children}\n </Comp>\n );\n};\n","import 'src/theme/recipes/container.css.ts.vanilla.css?source=LmNvbnRhaW5lcl9jb250YWluZXJSZWNpcGVfXzFtZWJ6dDAgewogIGJveC1zaXppbmc6IGJvcmRlci1ib3g7CiAgZmxleC1zaHJpbms6IDA7CiAgbWFyZ2luLWxlZnQ6IGF1dG87CiAgbWFyZ2luLXJpZ2h0OiBhdXRvOwogIHBhZGRpbmctbGVmdDogdmFyKC0tc3BhY2UtNV9fMTluYmU4ZDQpOwogIHBhZGRpbmctcmlnaHQ6IHZhcigtLXNwYWNlLTVfXzE5bmJlOGQ0KTsKfQouY29udGFpbmVyX2NvbnRhaW5lclJlY2lwZV9zaXplXzFfXzFtZWJ6dDEgewogIG1heC13aWR0aDogNDMwcHg7Cn0KLmNvbnRhaW5lcl9jb250YWluZXJSZWNpcGVfc2l6ZV8yX18xbWVienQyIHsKICBtYXgtd2lkdGg6IDcxNXB4Owp9Ci5jb250YWluZXJfY29udGFpbmVyUmVjaXBlX3NpemVfM19fMW1lYnp0MyB7CiAgbWF4LXdpZHRoOiAxMTQ1cHg7Cn0KLmNvbnRhaW5lcl9jb250YWluZXJSZWNpcGVfc2l6ZV80X18xbWVienQ0IHsKICBtYXgtd2lkdGg6IG5vbmU7Cn0=';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var containerRecipe = _7a468({defaultClassName:'container_containerRecipe__1mebzt0',variantClassNames:{size:{'1':'container_containerRecipe_size_1__1mebzt1','2':'container_containerRecipe_size_2__1mebzt2','3':'container_containerRecipe_size_3__1mebzt3','4':'container_containerRecipe_size_4__1mebzt4'}},defaultVariants:{size:'4'},compoundVariants:[]});","export function omit<T, K extends keyof T>(obj: T, ...keys: K[]): Omit<T, K> {\n const ret = { ...obj };\n keys.forEach((key) => {\n delete ret[key];\n });\n\n return ret;\n}\n","/**\n * https://stackoverflow.com/a/47232883\n */\nexport function pick<T, K extends keyof T>(obj: T, ...keys: K[]): Pick<T, K> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const ret: any = {};\n keys.forEach((key) => {\n ret[key] = obj[key];\n });\n\n return ret;\n}\n","import { omit } from \"./omit\";\nimport { pick } from \"./pick\";\n\n/**\n * TODO\n * @param obj\n * @param keys\n * @returns [variants, props]\n */\nexport function extractVariantsFromProps<T, K extends keyof T>(\n obj: T,\n ...keys: K[]\n): [Pick<T, K>, Omit<T, K>] {\n const variants = pick(obj, ...keys);\n const rest = omit(obj, ...keys);\n\n return [variants, rest];\n}\n","export function mergeClasses(...classes: (string | undefined)[]): string {\n return classes.filter((cls): cls is string => Boolean(cls)).join(\" \");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,6BAA0C;AACnC,IAAI,sBAAkB,uBAAAA,iBAAO,EAAC,kBAAiB,sCAAqC,mBAAkB,EAAC,MAAK,EAAC,KAAI,6CAA4C,KAAI,6CAA4C,KAAI,6CAA4C,KAAI,4CAA2C,EAAC,GAAE,iBAAgB,EAAC,MAAK,IAAG,GAAE,kBAAiB,CAAC,EAAC,CAAC;;;ACF9V,SAAS,KAA2B,QAAW,MAAuB;AAC3E,QAAM,MAAM,EAAE,GAAG,IAAI;AACrB,OAAK,QAAQ,CAAC,QAAQ;AACpB,WAAO,IAAI,GAAG;AAAA,EAChB,CAAC;AAED,SAAO;AACT;;;ACJO,SAAS,KAA2B,QAAW,MAAuB;AAE3E,QAAM,MAAW,CAAC;AAClB,OAAK,QAAQ,CAAC,QAAQ;AACpB,QAAI,GAAG,IAAI,IAAI,GAAG;AAAA,EACpB,CAAC;AAED,SAAO;AACT;;;ACFO,SAAS,yBACd,QACG,MACuB;AAC1B,QAAM,WAAW,KAAK,KAAK,GAAG,IAAI;AAClC,QAAM,OAAO,KAAK,KAAK,GAAG,IAAI;AAE9B,SAAO,CAAC,UAAU,IAAI;AACxB;;;ACjBO,SAAS,gBAAgB,SAAyC;AACvE,SAAO,QAAQ,OAAO,CAAC,QAAuB,QAAQ,GAAG,CAAC,EAAE,KAAK,GAAG;AACtE;;;ALKA,wBAAqB;AAkBjB;AAhBJ,IAAM,iBAAiB;AAOhB,IAAM,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,MAAsB;AAClE,QAAM,CAAC,UAAU,IAAI,IAAI;AAAA,IACvB;AAAA,IACA,GAAG,gBAAgB,SAAS;AAAA,EAC9B;AACA,QAAM,YAAY,gBAAgB,QAAQ;AAC1C,QAAM,OAAO,UAAU,yBAAO;AAE9B,SACE,4CAAC,QAAM,GAAG,MAAM,WAAW,aAAa,WAAW,KAAK,SAAS,GAC9D,eAAK,UACR;AAEJ;","names":["_7a468"]}
|
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
containerRecipe
|
|
3
3
|
} from "../chunk-PUW3KNR3.mjs";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "../chunk-
|
|
5
|
+
extractVariantsFromProps
|
|
6
|
+
} from "../chunk-DQ4T4WV3.mjs";
|
|
7
|
+
import "../chunk-BALC5CGU.mjs";
|
|
7
8
|
import {
|
|
8
9
|
mergeClasses
|
|
9
10
|
} from "../chunk-7EGQM3ZL.mjs";
|
|
@@ -13,10 +14,13 @@ import { Slot } from "@radix-ui/react-slot";
|
|
|
13
14
|
import { jsx } from "react/jsx-runtime";
|
|
14
15
|
var defaultElement = "div";
|
|
15
16
|
var Container = ({ asChild, ...props }) => {
|
|
16
|
-
const variants =
|
|
17
|
+
const [variants, rest] = extractVariantsFromProps(
|
|
18
|
+
props,
|
|
19
|
+
...containerRecipe.variants()
|
|
20
|
+
);
|
|
17
21
|
const container = containerRecipe(variants);
|
|
18
22
|
const Comp = asChild ? Slot : defaultElement;
|
|
19
|
-
return /* @__PURE__ */ jsx(Comp, { ...
|
|
23
|
+
return /* @__PURE__ */ jsx(Comp, { ...rest, className: mergeClasses(container, rest.className), children: rest.children });
|
|
20
24
|
};
|
|
21
25
|
export {
|
|
22
26
|
Container
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/container.tsx"],"sourcesContent":["import {\n ContainerVariants,\n containerRecipe,\n} from \"@/theme/recipes/container.css\";\nimport { ComponentProps } from \"@/types/component-props\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/container.tsx"],"sourcesContent":["import {\n ContainerVariants,\n containerRecipe,\n} from \"@/theme/recipes/container.css\";\nimport { ComponentProps } from \"@/types/component-props\";\nimport { extractVariantsFromProps } from \"@/utils/get-variants\";\nimport { mergeClasses } from \"@/utils/merge-classes\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nconst defaultElement = \"div\";\n\nexport type ContainerProps = ComponentProps<\n typeof defaultElement,\n ContainerVariants\n>;\n\nexport const Container = ({ asChild, ...props }: ContainerProps) => {\n const [variants, rest] = extractVariantsFromProps(\n props,\n ...containerRecipe.variants(),\n );\n const container = containerRecipe(variants);\n const Comp = asChild ? Slot : defaultElement;\n\n return (\n <Comp {...rest} className={mergeClasses(container, rest.className)}>\n {rest.children}\n </Comp>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAOA,SAAS,YAAY;AAkBjB;AAhBJ,IAAM,iBAAiB;AAOhB,IAAM,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,MAAsB;AAClE,QAAM,CAAC,UAAU,IAAI,IAAI;AAAA,IACvB;AAAA,IACA,GAAG,gBAAgB,SAAS;AAAA,EAC9B;AACA,QAAM,YAAY,gBAAgB,QAAQ;AAC1C,QAAM,OAAO,UAAU,OAAO;AAE9B,SACE,oBAAC,QAAM,GAAG,MAAM,WAAW,aAAa,WAAW,KAAK,SAAS,GAC9D,eAAK,UACR;AAEJ;","names":[]}
|
|
@@ -2,12 +2,15 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
4
4
|
|
|
5
|
+
type DropdownMenuProps = DropdownMenuPrimitive.DropdownMenuProps;
|
|
5
6
|
declare const DropdownMenu: react.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
7
|
+
type DropdownMenuTriggerProps = DropdownMenuPrimitive.DropdownMenuTriggerProps;
|
|
6
8
|
declare const DropdownMenuTrigger: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
7
9
|
type DropdownMenuContentProps = DropdownMenuPrimitive.DropdownMenuContentProps;
|
|
8
10
|
declare const DropdownMenuContent: ({ ...props }: DropdownMenuContentProps) => react_jsx_runtime.JSX.Element;
|
|
9
11
|
type DropdownMenuItemProps = DropdownMenuPrimitive.DropdownMenuItemProps;
|
|
10
12
|
declare const DropdownMenuItem: ({ ...props }: DropdownMenuItemProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
type DropdownMenuGroupProps = DropdownMenuPrimitive.DropdownMenuGroupProps;
|
|
11
14
|
declare const DropdownMenuGroup: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
12
15
|
type DropdownMenuLabelProps = DropdownMenuPrimitive.DropdownMenuLabelProps;
|
|
13
16
|
declare const DropdownMenuLabel: ({ ...props }: DropdownMenuLabelProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -15,8 +18,9 @@ type DropdownMenuSeparatorProps = DropdownMenuPrimitive.DropdownMenuSeparatorPro
|
|
|
15
18
|
declare const DropdownMenuSeparator: ({ ...props }: DropdownMenuSeparatorProps) => react_jsx_runtime.JSX.Element;
|
|
16
19
|
type DropdownMenuCheckboxItemProps = DropdownMenuPrimitive.DropdownMenuCheckboxItemProps;
|
|
17
20
|
declare const DropdownMenuCheckboxItem: ({ ...props }: DropdownMenuCheckboxItemProps) => react_jsx_runtime.JSX.Element;
|
|
21
|
+
type DropdownMenuRadioGroupProps = DropdownMenuPrimitive.DropdownMenuRadioGroupProps;
|
|
18
22
|
declare const DropdownMenuRadioGroup: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
19
23
|
type DropdownMenuRadioItemProps = DropdownMenuPrimitive.DropdownMenuRadioItemProps;
|
|
20
24
|
declare const DropdownMenuRadioItem: ({ children, ...props }: DropdownMenuRadioItemProps) => react_jsx_runtime.JSX.Element;
|
|
21
25
|
|
|
22
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger };
|
|
26
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|
|
@@ -2,12 +2,15 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
4
4
|
|
|
5
|
+
type DropdownMenuProps = DropdownMenuPrimitive.DropdownMenuProps;
|
|
5
6
|
declare const DropdownMenu: react.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
7
|
+
type DropdownMenuTriggerProps = DropdownMenuPrimitive.DropdownMenuTriggerProps;
|
|
6
8
|
declare const DropdownMenuTrigger: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
7
9
|
type DropdownMenuContentProps = DropdownMenuPrimitive.DropdownMenuContentProps;
|
|
8
10
|
declare const DropdownMenuContent: ({ ...props }: DropdownMenuContentProps) => react_jsx_runtime.JSX.Element;
|
|
9
11
|
type DropdownMenuItemProps = DropdownMenuPrimitive.DropdownMenuItemProps;
|
|
10
12
|
declare const DropdownMenuItem: ({ ...props }: DropdownMenuItemProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
type DropdownMenuGroupProps = DropdownMenuPrimitive.DropdownMenuGroupProps;
|
|
11
14
|
declare const DropdownMenuGroup: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
12
15
|
type DropdownMenuLabelProps = DropdownMenuPrimitive.DropdownMenuLabelProps;
|
|
13
16
|
declare const DropdownMenuLabel: ({ ...props }: DropdownMenuLabelProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -15,8 +18,9 @@ type DropdownMenuSeparatorProps = DropdownMenuPrimitive.DropdownMenuSeparatorPro
|
|
|
15
18
|
declare const DropdownMenuSeparator: ({ ...props }: DropdownMenuSeparatorProps) => react_jsx_runtime.JSX.Element;
|
|
16
19
|
type DropdownMenuCheckboxItemProps = DropdownMenuPrimitive.DropdownMenuCheckboxItemProps;
|
|
17
20
|
declare const DropdownMenuCheckboxItem: ({ ...props }: DropdownMenuCheckboxItemProps) => react_jsx_runtime.JSX.Element;
|
|
21
|
+
type DropdownMenuRadioGroupProps = DropdownMenuPrimitive.DropdownMenuRadioGroupProps;
|
|
18
22
|
declare const DropdownMenuRadioGroup: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
19
23
|
type DropdownMenuRadioItemProps = DropdownMenuPrimitive.DropdownMenuRadioItemProps;
|
|
20
24
|
declare const DropdownMenuRadioItem: ({ children, ...props }: DropdownMenuRadioItemProps) => react_jsx_runtime.JSX.Element;
|
|
21
25
|
|
|
22
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger };
|
|
26
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|
|
@@ -68,6 +68,15 @@ var flexRecipe = (0, import_createRuntimeFn.createRuntimeFn)(function() {
|
|
|
68
68
|
return x;
|
|
69
69
|
}());
|
|
70
70
|
|
|
71
|
+
// src/utils/omit.ts
|
|
72
|
+
function omit(obj, ...keys) {
|
|
73
|
+
const ret = { ...obj };
|
|
74
|
+
keys.forEach((key) => {
|
|
75
|
+
delete ret[key];
|
|
76
|
+
});
|
|
77
|
+
return ret;
|
|
78
|
+
}
|
|
79
|
+
|
|
71
80
|
// src/utils/pick.ts
|
|
72
81
|
function pick(obj, ...keys) {
|
|
73
82
|
const ret = {};
|
|
@@ -77,15 +86,25 @@ function pick(obj, ...keys) {
|
|
|
77
86
|
return ret;
|
|
78
87
|
}
|
|
79
88
|
|
|
89
|
+
// src/utils/get-variants.ts
|
|
90
|
+
function extractVariantsFromProps(obj, ...keys) {
|
|
91
|
+
const variants = pick(obj, ...keys);
|
|
92
|
+
const rest = omit(obj, ...keys);
|
|
93
|
+
return [variants, rest];
|
|
94
|
+
}
|
|
95
|
+
|
|
80
96
|
// src/components/flex.tsx
|
|
81
97
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
82
98
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
83
99
|
var defaultElement2 = "div";
|
|
84
100
|
var Flex = ({ asChild, ...props }) => {
|
|
85
|
-
const variants =
|
|
101
|
+
const [variants, rest] = extractVariantsFromProps(
|
|
102
|
+
props,
|
|
103
|
+
...flexRecipe.variants()
|
|
104
|
+
);
|
|
86
105
|
const flex = flexRecipe(variants);
|
|
87
106
|
const Comp = asChild ? import_react_slot2.Slot : defaultElement2;
|
|
88
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Comp, { ...
|
|
107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Comp, { ...rest, className: mergeClasses(flex, rest.className), children: rest.children });
|
|
89
108
|
};
|
|
90
109
|
|
|
91
110
|
// src/theme/styles/menu.css.ts
|