@nexxtmove/ui 1.1.8 → 1.2.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.
@@ -1,5 +1,5 @@
1
1
  interface NexxtChipProps {
2
- variant?: 'default' | 'warning' | 'success' | 'danger' | 'neutral';
2
+ variant?: 'default' | 'warning' | 'success' | 'danger' | 'neutral' | 'accent';
3
3
  ghost?: boolean;
4
4
  }
5
5
  declare var __VLS_1: {}, __VLS_3: {};
package/dist/index.js CHANGED
@@ -816,6 +816,11 @@ var tt = /* @__PURE__ */ p({
816
816
  border: "border border-gray-600",
817
817
  text: "text-gray-700"
818
818
  };
819
+ case "accent": return {
820
+ bg: "bg-purple-50",
821
+ border: "border border-purple-500",
822
+ text: "text-purple-500"
823
+ };
819
824
  default: return {
820
825
  bg: "bg-cornflower-blue-50",
821
826
  border: "border border-cornflower-blue-500",
@@ -843,6 +848,11 @@ var tt = /* @__PURE__ */ p({
843
848
  border: "",
844
849
  text: "text-white"
845
850
  };
851
+ case "accent": return {
852
+ bg: "bg-purple-600",
853
+ border: "",
854
+ text: "text-white"
855
+ };
846
856
  default: return {
847
857
  bg: "bg-cornflower-blue-600",
848
858
  border: "",
package/dist/nuxt.js CHANGED
@@ -47458,7 +47458,7 @@ var Yw, Xw, Zw, Qw, $w, eT = d((() => {
47458
47458
  return "[UnexpectedJSONParseError]: " + e.message;
47459
47459
  }
47460
47460
  };
47461
- })), bj = /* @__PURE__ */ h((/* @__PURE__ */ f(((e, t) => {
47461
+ })), bj = /* @__PURE__ */ f(((e, t) => {
47462
47462
  var n = v().promises, { compileTemplate: r } = ew(), { optimize: i } = gj(), a = yj()("vite-svg-loader");
47463
47463
  t.exports = function(e = {}) {
47464
47464
  let { svgoConfig: t, svgo: o, defaultImport: s } = e, c = /\.svg(\?(raw|component|skipsvgo))?$/;
@@ -47491,7 +47491,7 @@ var Yw, Xw, Zw, Qw, $w, eT = d((() => {
47491
47491
  }
47492
47492
  };
47493
47493
  }, t.exports.default = t.exports;
47494
- })))(), 1), xj = {
47494
+ })), xj = v(), Sj = /* @__PURE__ */ h(bj(), 1), Cj = {
47495
47495
  NexxtAnimatedNumber: "components/AnimatedNumber/AnimatedNumber.vue",
47496
47496
  NexxtAnnouncement: "components/Announcement/Announcement.vue",
47497
47497
  NexxtAvatar: "components/Avatar/Avatar.vue",
@@ -47546,7 +47546,7 @@ var Yw, Xw, Zw, Qw, $w, eT = d((() => {
47546
47546
  NexxtToggleGroup: "components/ToggleGroup/ToggleGroup.vue",
47547
47547
  NexxtTooltip: "components/Tooltip/Tooltip.vue",
47548
47548
  NexxtVideoPlayer: "components/VideoPlayer/VideoPlayer.vue"
47549
- }, Sj = i({
47549
+ }, wj = ["@nexxtmove/ui/ui.css", "@nexxtmove/ui/dist/ui.css"], Tj = (e, t) => e.some((e) => e === t || wj.includes(e)), Ej = i({
47550
47550
  meta: {
47551
47551
  name: "@nexxtmove/ui",
47552
47552
  configKey: "nexxtmoveUi",
@@ -47555,12 +47555,12 @@ var Yw, Xw, Zw, Qw, $w, eT = d((() => {
47555
47555
  defaults: { addCSS: !0 },
47556
47556
  setup(i, a) {
47557
47557
  let { resolve: o } = r(import.meta.url);
47558
- n((0, bj.default)()), a.hook("vite:extendConfig", (e) => {
47558
+ n((0, Sj.default)()), a.hook("vite:extendConfig", (e) => {
47559
47559
  e.resolve ??= {}, e.resolve.alias ??= {};
47560
47560
  let t = e.resolve.alias;
47561
47561
  t["@ui-assets"] = o("../src/assets");
47562
47562
  });
47563
- for (let t of Object.keys(xj)) e({
47563
+ for (let t of Object.keys(Cj)) e({
47564
47564
  name: t,
47565
47565
  export: t,
47566
47566
  filePath: "@nexxtmove/ui"
@@ -47576,8 +47576,10 @@ var Yw, Xw, Zw, Qw, $w, eT = d((() => {
47576
47576
  `,
47577
47577
  write: !0
47578
47578
  }), a.options.css.push("#build/nexxtmove-ui.css");
47579
+ let n = o("./ui.css");
47580
+ (0, xj.existsSync)(n) && !Tj(a.options.css, n) && a.options.css.push(n);
47579
47581
  }
47580
47582
  }
47581
47583
  });
47582
47584
  //#endregion
47583
- export { Sj as default };
47585
+ export { Ej as default };
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@nexxtmove/ui",
3
3
  "type": "module",
4
- "version": "1.1.8",
4
+ "version": "1.2.0",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
8
8
  "import": "./dist/index.js"
9
9
  },
10
10
  "./nuxt": "./dist/nuxt.js",
11
+ "./ui.css": "./dist/ui.css",
12
+ "./dist/ui.css": "./dist/ui.css",
11
13
  "./theme": "./tailwind/nexxtmove.tailwind.theme.css",
12
14
  "./components.json": "./src/components.json",
13
15
  "./components/*": "./src/components/*"
@@ -2,7 +2,7 @@
2
2
  import { computed } from 'vue'
3
3
 
4
4
  interface NexxtChipProps {
5
- variant?: 'default' | 'warning' | 'success' | 'danger' | 'neutral'
5
+ variant?: 'default' | 'warning' | 'success' | 'danger' | 'neutral' | 'accent'
6
6
  ghost?: boolean
7
7
  }
8
8
 
@@ -23,6 +23,8 @@ const styles = computed(() => {
23
23
  return { bg: 'bg-brick-100/20', border: 'border border-brick-500', text: 'text-brick-500' }
24
24
  case 'neutral':
25
25
  return { bg: 'bg-gray-100', border: 'border border-gray-600', text: 'text-gray-700' }
26
+ case 'accent':
27
+ return { bg: 'bg-purple-50', border: 'border border-purple-500', text: 'text-purple-500' }
26
28
  default:
27
29
  return {
28
30
  bg: 'bg-cornflower-blue-50',
@@ -40,6 +42,8 @@ const styles = computed(() => {
40
42
  return { bg: 'bg-brick-500', border: '', text: 'text-white' }
41
43
  case 'neutral':
42
44
  return { bg: 'bg-gray-700', border: '', text: 'text-white' }
45
+ case 'accent':
46
+ return { bg: 'bg-purple-600', border: '', text: 'text-white' }
43
47
  default:
44
48
  return { bg: 'bg-cornflower-blue-600', border: '', text: 'text-white' }
45
49
  }
package/src/nuxt.ts CHANGED
@@ -7,9 +7,17 @@ import {
7
7
  } from '@nuxt/kit'
8
8
  import type { NuxtModule } from '@nuxt/schema'
9
9
  import type { UserConfig } from 'vite'
10
+ import { existsSync } from 'node:fs'
10
11
  import svgLoader from 'vite-svg-loader'
11
12
  import components from './components.json'
12
13
 
14
+ // The stylesheet may already be listed by the app itself, either as a package
15
+ // specifier or as a resolved path — adding it twice would duplicate the rules.
16
+ const CSS_SPECIFIERS = ['@nexxtmove/ui/ui.css', '@nexxtmove/ui/dist/ui.css']
17
+
18
+ const hasComponentCSS = (css: string[], resolvedPath: string) =>
19
+ css.some((entry) => entry === resolvedPath || CSS_SPECIFIERS.includes(entry))
20
+
13
21
  export interface ModuleOptions {
14
22
  /**
15
23
  * Whether to automatically add the theme CSS.
@@ -68,6 +76,16 @@ const module: NuxtModule<ModuleOptions> = defineNuxtModule<ModuleOptions>({
68
76
  write: true,
69
77
  })
70
78
  nuxt.options.css.push('#build/nexxtmove-ui.css')
79
+
80
+ // Compiled component `<style>` blocks (scoped rules, keyframes). Not
81
+ // covered by the Tailwind entry above — that only scans the .vue source
82
+ // for class names. Pushed last so it stays unlayered and wins over
83
+ // Tailwind's layers.
84
+ const componentCSS = resolve('./ui.css')
85
+
86
+ if (existsSync(componentCSS) && !hasComponentCSS(nuxt.options.css, componentCSS)) {
87
+ nuxt.options.css.push(componentCSS)
88
+ }
71
89
  }
72
90
  },
73
91
  })