@blenx-dev/components 0.0.1 → 0.0.2
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/components/Accordion/accordion.css.js +2 -2
- package/dist/components/Accordion/accordion.js +1 -1
- package/dist/components/Alert/alert.css.js +2 -2
- package/dist/components/Alert/alert.js +1 -1
- package/dist/components/AlertDialog/alert-dialog.css.js +2 -2
- package/dist/components/AlertDialog/alert-dialog.js +1 -1
- package/dist/components/Autocomplete/autocomplete.css.js +2 -2
- package/dist/components/Autocomplete/autocomplete.js +1 -1
- package/dist/components/Avatar/avatar.css.js +3 -3
- package/dist/components/Avatar/avatar.js +1 -1
- package/dist/components/Badge/badge.css.js +3 -3
- package/dist/components/Badge/badge.js +1 -1
- package/dist/components/Box/box.css.js +1 -1
- package/dist/components/Box/box.js +1 -1
- package/dist/components/Breadcrumbs/breadcrumbs.css.js +1 -1
- package/dist/components/Breadcrumbs/breadcrumbs.js +1 -1
- package/dist/components/Button/button.css.js +3 -3
- package/dist/components/Button/button.js +1 -1
- package/dist/components/Calendar/calendar.css.js +2 -2
- package/dist/components/Calendar/calendar.js +1 -1
- package/dist/components/Checkbox/checkbox.css.js +2 -2
- package/dist/components/Checkbox/checkbox.js +1 -1
- package/dist/components/Combobox/combobox.css.js +2 -2
- package/dist/components/Combobox/combobox.js +1 -1
- package/dist/components/Command/command.css.js +2 -2
- package/dist/components/Command/command.js +1 -1
- package/dist/components/Container/container.css.js +1 -1
- package/dist/components/Container/container.js +1 -1
- package/dist/components/Dialog/dialog.css.js +2 -2
- package/dist/components/Dialog/dialog.js +1 -1
- package/dist/components/Drawer/drawer.css.js +2 -2
- package/dist/components/Drawer/drawer.js +1 -1
- package/dist/components/Field/field.css.js +2 -2
- package/dist/components/Field/field.js +1 -1
- package/dist/components/Grid/grid.js +1 -1
- package/dist/components/Icon/icon.js +1 -1
- package/dist/components/IconButton/icon-button.js +1 -1
- package/dist/components/Input/input.css.js +2 -2
- package/dist/components/Input/input.js +1 -1
- package/dist/components/InputGroup/input-group.css.js +2 -2
- package/dist/components/InputGroup/input-group.js +1 -1
- package/dist/components/Menu/menu.css.js +2 -2
- package/dist/components/Menu/menu.js +1 -1
- package/dist/components/OTPField/otp-field.css.js +3 -3
- package/dist/components/OTPField/otp-field.js +1 -1
- package/dist/components/Popover/popover.css.js +2 -2
- package/dist/components/Popover/popover.js +1 -1
- package/dist/components/Progress/progress.css.js +2 -2
- package/dist/components/Progress/progress.js +1 -1
- package/dist/components/Radio/radio.css.js +2 -2
- package/dist/components/Radio/radio.js +1 -1
- package/dist/components/ScrollArea/scroll-area.css.js +2 -2
- package/dist/components/ScrollArea/scroll-area.js +1 -1
- package/dist/components/Select/select.css.js +2 -2
- package/dist/components/Select/select.js +1 -1
- package/dist/components/Separator/separator.css.js +3 -3
- package/dist/components/Separator/separator.js +1 -1
- package/dist/components/Sheet/sheet.css.js +2 -2
- package/dist/components/Sheet/sheet.js +1 -1
- package/dist/components/Slider/slider.css.js +2 -2
- package/dist/components/Slider/slider.js +1 -1
- package/dist/components/Spinner/spinner.js +1 -1
- package/dist/components/Splitter/splitter.css.js +2 -2
- package/dist/components/Splitter/splitter.js +1 -1
- package/dist/components/Stack/stack.css.js +3 -3
- package/dist/components/Stack/stack.js +1 -1
- package/dist/components/Surface/surface.css.js +2 -2
- package/dist/components/Surface/surface.js +1 -1
- package/dist/components/Switch/switch.css.js +2 -2
- package/dist/components/Switch/switch.js +1 -1
- package/dist/components/Table/table.css.js +2 -2
- package/dist/components/Table/table.js +1 -1
- package/dist/components/Tabs/tabs.css.js +2 -2
- package/dist/components/Tabs/tabs.js +1 -1
- package/dist/components/Text/text.css.js +3 -3
- package/dist/components/Text/text.js +1 -1
- package/dist/components/Textarea/textarea.css.js +1 -1
- package/dist/components/Textarea/textarea.js +1 -1
- package/dist/components/Toggle/toggle.css.js +3 -3
- package/dist/components/Toggle/toggle.js +1 -1
- package/dist/components/ToggleGroup/toggle-group.css.js +2 -2
- package/dist/components/ToggleGroup/toggle-group.js +1 -1
- package/dist/utils/sprinkles.css.js +2 -2
- package/package.json +1 -1
- package/scripts/generate-package.ts +86 -79
- package/vite.config.ts +5 -0
- package/dist/node_modules/.bun/@vanilla-extract_recipes@0.5.7_19e937df7e0b57ed/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js +0 -89
- package/dist/node_modules/.bun/@vanilla-extract_sprinkles@1.6.5_19e937df7e0b57ed/node_modules/@vanilla-extract/sprinkles/createRuntimeSprinkles/dist/vanilla-extract-sprinkles-createRuntimeSprinkles.esm.js +0 -8
- package/dist/node_modules/.bun/@vanilla-extract_sprinkles@1.6.5_19e937df7e0b57ed/node_modules/@vanilla-extract/sprinkles/dist/createSprinkles-74286718.esm.js +0 -141
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
- package/dist/package.json +0 -233
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
1
|
import { spinner } from "./spinner.css.js";
|
|
3
2
|
import { CircleNotchIcon } from "@phosphor-icons/react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/Spinner/spinner.tsx
|
|
6
6
|
function Spinner({ className, style, ...props }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
3
2
|
import { handle, handleHorizontal, handleVertical, panel, root, rootHorizontal, rootVertical } from "./splitter.css.js";
|
|
3
|
+
import clsx from "clsx";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import React, { createContext, createElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
//#region src/components/Splitter/splitter.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* empty css
|
|
2
|
-
/* empty css
|
|
3
|
-
import { createRuntimeFn } from "../../node_modules/.bun/@vanilla-extract_recipes@0.5.7_19e937df7e0b57ed/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js";
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
4
3
|
/* empty css */
|
|
4
|
+
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
5
5
|
//#region src/components/Stack/stack.css.ts
|
|
6
6
|
var stackRecipe = createRuntimeFn({
|
|
7
7
|
defaultClassName: "_82zwcu0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
1
|
import { Box } from "../Box/box.js";
|
|
3
2
|
import { stackRecipe } from "./stack.css.js";
|
|
3
|
+
import clsx from "clsx";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/Stack/stack.tsx
|
|
6
6
|
function Stack({ gap, align, justify, wrap, className, style, ...props }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* empty css
|
|
2
|
-
import { createRuntimeFn } from "../../node_modules/.bun/@vanilla-extract_recipes@0.5.7_19e937df7e0b57ed/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js";
|
|
1
|
+
/* empty css */
|
|
3
2
|
/* empty css */
|
|
3
|
+
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
4
4
|
//#region src/components/Surface/surface.css.ts
|
|
5
5
|
var variantRecipe = createRuntimeFn({
|
|
6
6
|
defaultClassName: "_1vnk5c40",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
1
|
import { Box } from "../Box/box.js";
|
|
3
2
|
import { variantRecipe } from "./surface.css.js";
|
|
3
|
+
import clsx from "clsx";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/Surface/surface.tsx
|
|
6
6
|
function Surface({ variant, interactive, className, style, ...props }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
1
|
import { root, thumb } from "./switch.css.js";
|
|
2
|
+
import clsx from "clsx";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Switch } from "@base-ui/react/switch";
|
|
5
5
|
//#region src/components/Switch/switch.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
1
|
import { alignCenter, alignLeft, alignRight, cell, head, header, root, row, wrapper } from "./table.css.js";
|
|
2
|
+
import clsx from "clsx";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Table/table.tsx
|
|
5
5
|
var cellAlignMap = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
1
|
import { list, panel, root, tab } from "./tabs.css.js";
|
|
2
|
+
import clsx from "clsx";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
5
|
import { Tabs } from "@base-ui/react/tabs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* empty css
|
|
2
|
-
/* empty css
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { createRuntimeFn } from "
|
|
4
|
+
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
5
5
|
//#region src/components/Text/text.css.ts
|
|
6
6
|
var textVariants = createRuntimeFn({
|
|
7
7
|
defaultClassName: "_1wmhbih0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
1
|
import { textVariants } from "./text.css.js";
|
|
3
2
|
import { applyBaseSprinkles } from "../../utils/ve-style.utils.js";
|
|
3
|
+
import clsx from "clsx";
|
|
4
4
|
import { useRender } from "@base-ui/react/use-render";
|
|
5
5
|
//#region src/components/Text/text.tsx
|
|
6
6
|
var variantTag = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
3
2
|
import { shell, textarea } from "./textarea.css.js";
|
|
3
|
+
import clsx from "clsx";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Field } from "@base-ui/react/field";
|
|
6
6
|
//#region src/components/Textarea/textarea.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* empty css
|
|
2
|
-
/* empty css
|
|
3
|
-
import { createRuntimeFn } from "../../node_modules/.bun/@vanilla-extract_recipes@0.5.7_19e937df7e0b57ed/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js";
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
4
3
|
/* empty css */
|
|
4
|
+
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
5
5
|
//#region src/components/Toggle/toggle.css.ts
|
|
6
6
|
var base = "_11fokac0";
|
|
7
7
|
var size = createRuntimeFn({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
3
2
|
import { base, pressed, radius, size, variant } from "./toggle.css.js";
|
|
3
|
+
import clsx from "clsx";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Toggle } from "@base-ui/react/toggle";
|
|
6
6
|
//#region src/components/Toggle/toggle.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import clsx from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
3
2
|
import { Separator } from "../Separator/separator.js";
|
|
4
3
|
import { Toggle } from "../Toggle/toggle.js";
|
|
5
4
|
import { groupBase, groupDefault, groupHorizontal, groupOutline, groupVertical } from "./toggle-group.css.js";
|
|
5
|
+
import clsx from "clsx";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import * as React$1 from "react";
|
|
8
8
|
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* empty css
|
|
1
|
+
/* empty css */
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { createSprinkles } from "
|
|
3
|
+
import { createSprinkles } from "@vanilla-extract/sprinkles/createRuntimeSprinkles";
|
|
4
4
|
//#region src/utils/sprinkles.css.ts
|
|
5
5
|
var gridSprinkles = createSprinkles({
|
|
6
6
|
conditions: {
|
package/package.json
CHANGED
|
@@ -1,99 +1,106 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
const entries = await fs.readdir(componentRoot, {
|
|
24
|
-
withFileTypes: true,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
exports["*"] = {
|
|
28
|
-
types: "./components/*/index.d.ts",
|
|
29
|
-
import: "./components/*/index.js",
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
for (const entry of entries) {
|
|
33
|
-
if (!entry.isDirectory()) continue;
|
|
34
|
-
|
|
35
|
-
const component = entry.name;
|
|
36
|
-
|
|
37
|
-
exports[`./${component}`] = {
|
|
38
|
-
types: `./components/${component}/index.d.ts`,
|
|
39
|
-
import: `./components/${component}/index.js`,
|
|
40
|
-
};
|
|
4
|
+
const packageRoot = process.cwd();
|
|
5
|
+
const repoRoot = path.resolve(packageRoot, "../..");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Read the root package.json (for catalog dependencies)
|
|
9
|
+
*/
|
|
10
|
+
const rootPackage = JSON.parse(
|
|
11
|
+
await readFile(path.join(repoRoot, "package.json"), "utf8"),
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Discover every workspace package and its version.
|
|
16
|
+
*/
|
|
17
|
+
const workspacePackages = new Map<
|
|
18
|
+
string,
|
|
19
|
+
{
|
|
20
|
+
version: string;
|
|
21
|
+
directory: string;
|
|
41
22
|
}
|
|
42
|
-
|
|
23
|
+
>();
|
|
43
24
|
|
|
44
|
-
|
|
45
|
-
// utils
|
|
46
|
-
//
|
|
25
|
+
const packagesDir = path.join(repoRoot, "packages");
|
|
47
26
|
|
|
48
|
-
|
|
27
|
+
for (const dir of await readdir(packagesDir, { withFileTypes: true })) {
|
|
28
|
+
if (!dir.isDirectory()) continue;
|
|
49
29
|
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
const packageJsonPath = path.join(
|
|
31
|
+
packagesDir,
|
|
32
|
+
dir.name,
|
|
33
|
+
"package.json",
|
|
34
|
+
);
|
|
52
35
|
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
try {
|
|
37
|
+
const pkg = JSON.parse(await readFile(packageJsonPath, "utf8"));
|
|
55
38
|
|
|
56
|
-
|
|
39
|
+
workspacePackages.set(pkg.name, {
|
|
40
|
+
version: pkg.version,
|
|
41
|
+
directory: path.join(packagesDir, dir.name),
|
|
42
|
+
});
|
|
43
|
+
} catch {
|
|
44
|
+
// ignore folders without package.json
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function resolveVersion(
|
|
49
|
+
packageName: string,
|
|
50
|
+
version: string,
|
|
51
|
+
): Promise<string> {
|
|
52
|
+
//
|
|
53
|
+
// Normal dependency
|
|
54
|
+
//
|
|
55
|
+
if (!version.startsWith("workspace:") && version !== "catalog:") {
|
|
56
|
+
return version;
|
|
57
|
+
}
|
|
57
58
|
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// } catch {}
|
|
59
|
+
//
|
|
60
|
+
// Workspace dependency
|
|
61
|
+
//
|
|
62
|
+
if (version.startsWith("workspace:")) {
|
|
63
|
+
const workspace = workspacePackages.get(packageName);
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
if (!workspace) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
`Unable to resolve workspace package "${packageName}"`,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
exports["./globals.css"] = "./assets/components.css";
|
|
72
|
-
} catch {}
|
|
71
|
+
return `^${workspace.version}`;
|
|
72
|
+
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
repository: pkg.repository,
|
|
80
|
-
homepage: pkg.homepage,
|
|
81
|
-
bugs: pkg.bugs,
|
|
82
|
-
keywords: pkg.keywords,
|
|
74
|
+
//
|
|
75
|
+
// Bun catalog dependency
|
|
76
|
+
//
|
|
77
|
+
if (version === "catalog:") {
|
|
78
|
+
const catalog = rootPackage.catalog ?? {};
|
|
83
79
|
|
|
84
|
-
|
|
80
|
+
const resolved = catalog[packageName];
|
|
85
81
|
|
|
86
|
-
|
|
82
|
+
if (!resolved) {
|
|
83
|
+
throw new Error(
|
|
84
|
+
`Unable to resolve catalog dependency "${packageName}"`,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
return resolved;
|
|
89
|
+
}
|
|
89
90
|
|
|
90
|
-
|
|
91
|
+
return version;
|
|
92
|
+
}
|
|
91
93
|
|
|
92
|
-
|
|
94
|
+
export async function resolveDependencies(
|
|
95
|
+
deps?: Record<string, string>,
|
|
96
|
+
) {
|
|
97
|
+
if (!deps) return {};
|
|
93
98
|
|
|
94
|
-
|
|
95
|
-
};
|
|
99
|
+
const resolved: Record<string, string> = {};
|
|
96
100
|
|
|
97
|
-
|
|
101
|
+
for (const [name, version] of Object.entries(deps)) {
|
|
102
|
+
resolved[name] = await resolveVersion(name, version);
|
|
103
|
+
}
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
return resolved;
|
|
106
|
+
}
|
package/vite.config.ts
CHANGED
|
@@ -29,8 +29,13 @@ export default defineConfig({
|
|
|
29
29
|
/^@phosphor-icons\/react/,
|
|
30
30
|
/^@tanstack\/react-table/,
|
|
31
31
|
/^@tanstack\/react-query/,
|
|
32
|
+
/^@vanilla-extract\/recipes/,
|
|
33
|
+
/^@vanilla-extract\/css/,
|
|
34
|
+
/^@vanilla-extract\/recipes/,
|
|
35
|
+
/^@vanilla-extract\/sprinkles/,
|
|
32
36
|
/react-colorful/,
|
|
33
37
|
/react-day-picker/,
|
|
38
|
+
/clsx/,
|
|
34
39
|
],
|
|
35
40
|
|
|
36
41
|
output: {
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.bun/@vanilla-extract+recipes@0.5.7+19e937df7e0b57ed/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
2
|
-
function toPrimitive(t, r) {
|
|
3
|
-
if ("object" != typeof t || !t) return t;
|
|
4
|
-
var e = t[Symbol.toPrimitive];
|
|
5
|
-
if (void 0 !== e) {
|
|
6
|
-
var i = e.call(t, r || "default");
|
|
7
|
-
if ("object" != typeof i) return i;
|
|
8
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
9
|
-
}
|
|
10
|
-
return ("string" === r ? String : Number)(t);
|
|
11
|
-
}
|
|
12
|
-
function toPropertyKey(t) {
|
|
13
|
-
var i = toPrimitive(t, "string");
|
|
14
|
-
return "symbol" == typeof i ? i : String(i);
|
|
15
|
-
}
|
|
16
|
-
function _defineProperty(obj, key, value) {
|
|
17
|
-
key = toPropertyKey(key);
|
|
18
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
19
|
-
value,
|
|
20
|
-
enumerable: true,
|
|
21
|
-
configurable: true,
|
|
22
|
-
writable: true
|
|
23
|
-
});
|
|
24
|
-
else obj[key] = value;
|
|
25
|
-
return obj;
|
|
26
|
-
}
|
|
27
|
-
function ownKeys(e, r) {
|
|
28
|
-
var t = Object.keys(e);
|
|
29
|
-
if (Object.getOwnPropertySymbols) {
|
|
30
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
31
|
-
r && (o = o.filter(function(r) {
|
|
32
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
33
|
-
})), t.push.apply(t, o);
|
|
34
|
-
}
|
|
35
|
-
return t;
|
|
36
|
-
}
|
|
37
|
-
function _objectSpread2(e) {
|
|
38
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
39
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
40
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
41
|
-
_defineProperty(e, r, t[r]);
|
|
42
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
43
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return e;
|
|
47
|
-
}
|
|
48
|
-
function mapValues(input, fn) {
|
|
49
|
-
var result = {};
|
|
50
|
-
for (var _key in input) result[_key] = fn(input[_key], _key);
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
54
|
-
for (var key of Object.keys(compoundCheck)) {
|
|
55
|
-
var _selections$key;
|
|
56
|
-
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) return false;
|
|
57
|
-
}
|
|
58
|
-
return true;
|
|
59
|
-
};
|
|
60
|
-
var createRuntimeFn = (config) => {
|
|
61
|
-
var runtimeFn = (options) => {
|
|
62
|
-
var className = config.defaultClassName;
|
|
63
|
-
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
64
|
-
for (var variantName in selections) {
|
|
65
|
-
var _selections$variantNa;
|
|
66
|
-
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
67
|
-
if (variantSelection != null) {
|
|
68
|
-
var selection = variantSelection;
|
|
69
|
-
if (typeof selection === "boolean") selection = selection === true ? "true" : "false";
|
|
70
|
-
var selectionClassName = config.variantClassNames[variantName][selection];
|
|
71
|
-
if (selectionClassName) className += " " + selectionClassName;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
for (var [compoundCheck, compoundClassName] of config.compoundVariants) if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) className += " " + compoundClassName;
|
|
75
|
-
return className;
|
|
76
|
-
};
|
|
77
|
-
runtimeFn.variants = () => Object.keys(config.variantClassNames);
|
|
78
|
-
runtimeFn.classNames = {
|
|
79
|
-
get base() {
|
|
80
|
-
return config.defaultClassName.split(" ")[0];
|
|
81
|
-
},
|
|
82
|
-
get variants() {
|
|
83
|
-
return mapValues(config.variantClassNames, (classNames) => mapValues(classNames, (className) => className.split(" ")[0]));
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
return runtimeFn;
|
|
87
|
-
};
|
|
88
|
-
//#endregion
|
|
89
|
-
export { createRuntimeFn };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createSprinkles as createSprinkles$1 } from "../../dist/createSprinkles-74286718.esm.js";
|
|
2
|
-
//#region ../../node_modules/.bun/@vanilla-extract+sprinkles@1.6.5+19e937df7e0b57ed/node_modules/@vanilla-extract/sprinkles/createRuntimeSprinkles/dist/vanilla-extract-sprinkles-createRuntimeSprinkles.esm.js
|
|
3
|
-
var composeStyles = (classList) => classList;
|
|
4
|
-
var createSprinkles = function createSprinkles() {
|
|
5
|
-
return createSprinkles$1(composeStyles)(...arguments);
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
export { createSprinkles };
|