@brickflow/ui 0.0.44 → 0.0.45

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/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "configKey": "brickflowUi",
6
6
  "name": "@brickflow/ui",
7
- "version": "0.0.44",
7
+ "version": "0.0.45",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,18 +1,13 @@
1
1
  import { defineNuxtModule, createResolver, resolvePath, addTypeTemplate, addTemplate, updateTemplates, addImportsDir, addComponentsDir } from '@nuxt/kit';
2
2
  import tailwindcss from '@tailwindcss/vite';
3
3
  import { createJiti } from 'jiti';
4
- import { readdir, mkdir, readFile, writeFile } from 'node:fs/promises';
5
- import { join, basename, extname, dirname, resolve, relative } from 'node:path';
4
+ import { readdir, readFile } from 'node:fs/promises';
5
+ import { basename, extname, dirname, resolve, relative, join } from 'node:path';
6
6
  import { isBrickflowUiStyleReference, getBrickflowUiStyleReferencePath, defineBrickflowUi } from '../dist/runtime/tailwind.js';
7
- import { generateFonts, FontAssetType, OtherAssetType } from 'fantasticon';
7
+ import { getIconFontCssPath as getIconFontCssPath$1, generateIcons } from '@brickflow/cli/icon';
8
8
 
9
9
  const ICON_FILE_PATTERN = /\.svg$/i;
10
- const minifyCss = (css) => css.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;\}/g, "}").trim();
11
- const normalizeGeneratedCss = (css) => `${css.replace(/"/g, "'").replace(/^ {4}/gm, " ").replace(/(\.(?:eot|ttf|woff2?))\?[^#'")]+(#iefix)?/gi, "$1$2").replace(/src: ([^\n]+),\n([^\n]+),\n([^\n]+);/, "src:\n $1,\n $2,\n $3;").replace(
12
- /i\[class\^='icon-'\]:before, i\[class\*=' icon-'\]:before \{/,
13
- "@layer base {\n i[class^='icon-'],\n i[class*=' icon-'] {\n container-type: inline-size;\n display: inline-flex;justify-content: center;align-items: center;\n width: 1em;\n }\n}\n\ni[class^='icon-']:before,\ni[class*=' icon-']:before {\n font-size: 100cqw;"
14
- ).replace(/\n{3,}/g, "\n\n").trim()}
15
- `;
10
+ const ICON_FONT_NAME = "brickflow-icon";
16
11
  const getIconFontNames = async (inputDir) => {
17
12
  const entries = await readdir(inputDir, { withFileTypes: true });
18
13
  const invalidEntries = entries.filter((entry) => !entry.isFile() || !ICON_FILE_PATTERN.test(entry.name));
@@ -26,7 +21,7 @@ const getIconFontNames = async (inputDir) => {
26
21
  }
27
22
  return entries.map((entry) => entry.name.replace(ICON_FILE_PATTERN, "")).sort((a, b) => a.localeCompare(b));
28
23
  };
29
- const getIconFontCssPath = (outputDir) => join(outputDir, "icon.minify.css");
24
+ const getIconFontCssPath = (outputDir) => getIconFontCssPath$1(outputDir, ICON_FONT_NAME);
30
25
  const createIconFontAssetsInlineLimit = (outputDir, currentLimit) => {
31
26
  const normalizedOutputDir = outputDir.replaceAll("\\", "/");
32
27
  return (filePath, content) => {
@@ -41,20 +36,11 @@ const createIconFontAssetsInlineLimit = (outputDir, currentLimit) => {
41
36
  };
42
37
  const generateIconFont = async ({ inputDir, outputDir }) => {
43
38
  await getIconFontNames(inputDir);
44
- await mkdir(outputDir, { recursive: true });
45
- await generateFonts({
46
- assetTypes: [OtherAssetType.CSS],
47
- fontsUrl: ".",
48
- fontTypes: [FontAssetType.EOT, FontAssetType.WOFF2, FontAssetType.WOFF],
39
+ await generateIcons({
49
40
  inputDir,
50
- name: "icon",
51
- normalize: true,
41
+ name: ICON_FONT_NAME,
52
42
  outputDir
53
43
  });
54
- const cssPath = join(outputDir, "icon.css");
55
- const css = normalizeGeneratedCss(await readFile(cssPath, "utf8"));
56
- await writeFile(cssPath, css);
57
- await writeFile(getIconFontCssPath(outputDir), minifyCss(css));
58
44
  };
59
45
  const brickflowUiIconFontPlugin = (options) => ({
60
46
  buildStart: () => generateIconFont(options),
@@ -43,5 +43,20 @@
43
43
  class="text-2xl text-red-400"
44
44
  />
45
45
  </div>
46
+
47
+ <p>
48
+ Text with icon
49
+ <Icon :name="iconName" />
50
+ sample words.
51
+ </p>
52
+
53
+ <div class="flex items-start gap-2">
54
+ <div class="bg-gray-700">
55
+ <Icon :name="iconName" />
56
+ </div>
57
+ <div class="bg-gray-700 leading-0">
58
+ <Icon :name="iconName" />
59
+ </div>
60
+ </div>
46
61
  </div>
47
62
  </template>
@@ -18,7 +18,28 @@
18
18
  <template>
19
19
  <i
20
20
  v-bind="$attrs"
21
- :class="[classes, 'aspect-square']"
21
+ :class="classes"
22
22
  role="img"
23
23
  />
24
24
  </template>
25
+
26
+ <style scoped>
27
+ @layer base {
28
+ i {
29
+ aspect-ratio: 1;
30
+ container-type: inline-size;
31
+ display: inline-flex;
32
+ flex-shrink: 0;
33
+ align-items: center;
34
+ justify-content: center;
35
+ width: 1em;
36
+ line-height: 1;
37
+ vertical-align: -0.125em;
38
+ }
39
+
40
+ i::before {
41
+ font-size: 100cqi;
42
+ line-height: 1;
43
+ }
44
+ }
45
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickflow/ui",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "type": "module",
5
5
  "description": "brickflow UI Nuxt module.",
6
6
  "files": [
@@ -33,8 +33,8 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
+ "@brickflow/cli": "workspace:*",
36
37
  "@tailwindcss/vite": "4.3.3",
37
- "fantasticon": "4.1.0",
38
38
  "jiti": "2.7.0",
39
39
  "tailwindcss": "4.3.3"
40
40
  },