@neuralytics/alpine-ds 0.2.5 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @neuralytics/alpine-ds
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f6e964d: Add `./tailwind-tokens` entrypoint exporting pure Tailwind `content`/`theme`/`iconClasses` (no `@egoist/tailwindcss-icons` dependency), so consumers that only need the theme don't load the full icon collections into memory. `./tailwind-preset` keeps its previous behavior unchanged.
8
+
3
9
  ## 0.2.5
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -59,6 +59,26 @@ export default {
59
59
  } as Config
60
60
  ```
61
61
 
62
+ > **Note:** `./tailwind-preset` always loads this package's full icon collections (`mdi`, `line-md`) into memory via `@egoist/tailwindcss-icons`, even if you only need `content`/`theme`. If that's too heavy for your setup (e.g. it causes memory issues during your build), import those from `@neuralytics/alpine-ds/tailwind-tokens` instead — this entrypoint has zero dependency on the icon plugin:
63
+ >
64
+ > ```ts
65
+ > import type { Config } from "tailwindcss"
66
+ > import { content, theme } from "@neuralytics/alpine-ds/tailwind-tokens"
67
+ >
68
+ > export default {
69
+ > content: [
70
+ > ...content,
71
+ > // ... your source files ...
72
+ > ],
73
+ > theme,
74
+ > // No `plugins` here: configure your own icon plugin instead (e.g. `iconsPlugin`
75
+ > // from `@egoist/tailwindcss-icons`), with only the icon collections you actually
76
+ > // need. `tailwind-tokens` also exports `iconClasses`: the icon classes this
77
+ > // package's own components render internally, which your icon plugin setup must
78
+ > // still be able to generate.
79
+ > } as Config
80
+ > ```
81
+
62
82
  6. Set the accent color in your project's `main.ts`:
63
83
 
64
84
  ```js
@@ -0,0 +1,6 @@
1
+ const o = {
2
+ loader: "i-line-md-loading-twotone-loop"
3
+ };
4
+ export {
5
+ o as I
6
+ };
@@ -0,0 +1,3 @@
1
+ export declare const ICONS: {
2
+ readonly loader: "i-line-md-loading-twotone-loop";
3
+ };
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
- import { defineComponent as w, ref as _, computed as p, createElementBlock as y, openBlock as l, normalizeClass as L, unref as m, createBlock as k, createCommentVNode as f, toDisplayString as A } from "vue";
2
- import { tv as D } from "tailwind-variants";
3
- const q = ["xs", "sm", "md", "lg", "xl", "2xl"], S = /* @__PURE__ */ w({
1
+ import { defineComponent as w, ref as k, computed as y, createElementBlock as p, openBlock as l, normalizeClass as L, unref as m, createBlock as S, createCommentVNode as f, toDisplayString as A } from "vue";
2
+ import { I as D } from "./icons-DedUTX68.js";
3
+ import { tv as I } from "tailwind-variants";
4
+ const J = ["xs", "sm", "md", "lg", "xl", "2xl"], T = /* @__PURE__ */ w({
4
5
  name: "AlpineIcon",
5
6
  __name: "Icon",
6
7
  props: {
@@ -10,7 +11,7 @@ const q = ["xs", "sm", "md", "lg", "xl", "2xl"], S = /* @__PURE__ */ w({
10
11
  isLoading: { type: Boolean, default: !1 }
11
12
  },
12
13
  setup(t) {
13
- const e = t, a = D({
14
+ const e = t, a = I({
14
15
  variants: {
15
16
  size: {
16
17
  xs: "size-3",
@@ -21,14 +22,14 @@ const q = ["xs", "sm", "md", "lg", "xl", "2xl"], S = /* @__PURE__ */ w({
21
22
  "2xl": "size-8"
22
23
  }
23
24
  }
24
- }), s = _(!1), n = p(() => e.isLoading ? "i-line-md-loading-twotone-loop" : e.hoverIcon && s.value ? e.hoverIcon : e.icon);
25
- return (r, o) => (l(), y("span", {
25
+ }), s = k(!1), n = y(() => e.isLoading ? D.loader : e.hoverIcon && s.value ? e.hoverIcon : e.icon);
26
+ return (r, o) => (l(), p("span", {
26
27
  class: L([n.value, m(a)({ size: t.size })]),
27
28
  onMouseover: o[0] || (o[0] = (i) => s.value = !0),
28
29
  onMouseleave: o[1] || (o[1] = (i) => s.value = !1)
29
30
  }, null, 34));
30
31
  }
31
- }), T = D({
32
+ }), C = I({
32
33
  base: "rounded-lg flex items-center justify-center gap-2 font-medium transition-all max-w-full border",
33
34
  variants: {
34
35
  iconPosition: {
@@ -141,10 +142,10 @@ const q = ["xs", "sm", "md", "lg", "xl", "2xl"], S = /* @__PURE__ */ w({
141
142
  class: "cursor-pointer"
142
143
  }
143
144
  ]
144
- }), P = ["primary", "secondary", "invisible"], $ = ["left", "right"], C = ["button", "submit", "reset"], R = ["type", "aria-label", "disabled"], O = {
145
+ }), P = ["primary", "secondary", "invisible"], $ = ["left", "right"], O = ["button", "submit", "reset"], R = ["type", "aria-label", "disabled"], N = {
145
146
  key: 1,
146
147
  class: "min-w-0 truncate"
147
- }, G = /* @__PURE__ */ w({
148
+ }, K = /* @__PURE__ */ w({
148
149
  name: "AlpineButton",
149
150
  __name: "Button",
150
151
  props: {
@@ -155,14 +156,14 @@ const q = ["xs", "sm", "md", "lg", "xl", "2xl"], S = /* @__PURE__ */ w({
155
156
  isDisabled: { type: Boolean, default: !1 },
156
157
  isDanger: { type: Boolean, default: !1 },
157
158
  iconPosition: { default: $[0] },
158
- type: { default: C[0] }
159
+ type: { default: O[0] }
159
160
  },
160
161
  setup(t) {
161
- const e = t, a = p(() => e.isLoading ? "i-line-md-loading-twotone-loop" : e.icon), s = p(() => !e.icon && !e.label ? "-" : e.label);
162
- return (n, r) => (l(), y("button", {
162
+ const e = t, a = y(() => e.isLoading ? D.loader : e.icon), s = y(() => !e.icon && !e.label ? "-" : e.label);
163
+ return (n, r) => (l(), p("button", {
163
164
  type: e.type,
164
165
  "aria-label": e.label ?? e.icon ?? "Button without label or icon",
165
- class: L(m(T)({
166
+ class: L(m(C)({
166
167
  design: e.design,
167
168
  iconPosition: e.iconPosition,
168
169
  isLoading: e.isLoading,
@@ -172,17 +173,17 @@ const q = ["xs", "sm", "md", "lg", "xl", "2xl"], S = /* @__PURE__ */ w({
172
173
  })),
173
174
  disabled: e.isDisabled || e.isLoading
174
175
  }, [
175
- a.value ? (l(), k(m(S), {
176
+ a.value ? (l(), S(m(T), {
176
177
  key: 0,
177
178
  "aria-hidden": !0,
178
179
  icon: a.value,
179
180
  class: "shrink-0"
180
181
  }, null, 8, ["icon"])) : f("", !0),
181
- s.value ? (l(), y("span", O, A(s.value), 1)) : f("", !0)
182
+ s.value ? (l(), p("span", N, A(s.value), 1)) : f("", !0)
182
183
  ], 10, R));
183
184
  }
184
185
  });
185
- function N(t) {
186
+ function E(t) {
186
187
  const e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
187
188
  return e ? {
188
189
  r: Number.parseInt(e[1], 16),
@@ -194,10 +195,10 @@ function v(t) {
194
195
  const e = t / 255;
195
196
  return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
196
197
  }
197
- function E(t) {
198
- const { r: e, g: a, b: s } = N(t), n = v(e), r = v(a), o = v(s), i = 0.4122214708 * n + 0.5363325363 * r + 0.0514459929 * o, I = 0.2119034982 * n + 0.6806995451 * r + 0.1073969566 * o, z = 0.0883024619 * n + 0.2817188376 * r + 0.6299787005 * o, c = Math.cbrt(i), d = Math.cbrt(I), g = Math.cbrt(z), B = 0.2104542553 * c + 0.793617785 * d - 0.0040720468 * g, u = 1.9779984951 * c - 2.428592205 * d + 0.4505937099 * g, b = 0.0259040371 * c + 0.7827717662 * d - 0.808675766 * g, M = Math.sqrt(u * u + b * b);
198
+ function j(t) {
199
+ const { r: e, g: a, b: s } = E(t), n = v(e), r = v(a), o = v(s), i = 0.4122214708 * n + 0.5363325363 * r + 0.0514459929 * o, z = 0.2119034982 * n + 0.6806995451 * r + 0.1073969566 * o, B = 0.0883024619 * n + 0.2817188376 * r + 0.6299787005 * o, c = Math.cbrt(i), d = Math.cbrt(z), g = Math.cbrt(B), M = 0.2104542553 * c + 0.793617785 * d - 0.0040720468 * g, u = 1.9779984951 * c - 2.428592205 * d + 0.4505937099 * g, b = 0.0259040371 * c + 0.7827717662 * d - 0.808675766 * g, _ = Math.sqrt(u * u + b * b);
199
200
  let h = Math.atan2(b, u) * 180 / Math.PI;
200
- return h < 0 && (h += 360), { lightness: B, chroma: M, hue: h };
201
+ return h < 0 && (h += 360), { lightness: M, chroma: _, hue: h };
201
202
  }
202
203
  const x = {
203
204
  50: 1.4208,
@@ -210,7 +211,7 @@ const x = {
210
211
  700: 0.754,
211
212
  800: 0.6501,
212
213
  900: 0.5749
213
- }, j = {
214
+ }, F = {
214
215
  50: 0.0549,
215
216
  100: 0.135,
216
217
  200: 0.262,
@@ -222,27 +223,27 @@ const x = {
222
223
  800: 0.747,
223
224
  900: 0.595
224
225
  };
225
- function F(t) {
226
- const { lightness: e, chroma: a, hue: s } = E(t), n = {};
226
+ function H(t) {
227
+ const { lightness: e, chroma: a, hue: s } = j(t), n = {};
227
228
  for (const r of Object.keys(x)) {
228
- const o = Math.min(1, Math.max(0, e * x[r])), i = Math.max(0, a * j[r]);
229
+ const o = Math.min(1, Math.max(0, e * x[r])), i = Math.max(0, a * F[r]);
229
230
  n[`--color-accent-${r}`] = `oklch(${(o * 100).toFixed(1)}% ${i.toFixed(3)} ${s.toFixed(1)})`;
230
231
  }
231
232
  return n;
232
233
  }
233
- function J(t) {
234
- const e = F(t), a = document.documentElement;
234
+ function Q(t) {
235
+ const e = H(t), a = document.documentElement;
235
236
  for (const [s, n] of Object.entries(e))
236
237
  a.style.setProperty(s, n);
237
238
  }
238
- function K(t) {
239
+ function U(t) {
239
240
  document.documentElement.style.setProperty("--button-text-color", t);
240
241
  }
241
242
  export {
242
- G as AlpineButton,
243
- S as AlpineIcon,
244
- F as generateAccentScale,
245
- q as iconSizes,
246
- J as setAccentColorTheme,
247
- K as setButtonTextColor
243
+ K as AlpineButton,
244
+ T as AlpineIcon,
245
+ H as generateAccentScale,
246
+ J as iconSizes,
247
+ Q as setAccentColorTheme,
248
+ U as setButtonTextColor
248
249
  };
@@ -1,89 +1,3 @@
1
- declare const _default: {
2
- content: string[];
3
- theme: {
4
- colors: {
5
- transparent: string;
6
- current: string;
7
- black: string;
8
- white: string;
9
- gray: {
10
- 50: string;
11
- 100: string;
12
- 200: string;
13
- 300: string;
14
- 400: string;
15
- 500: string;
16
- 600: string;
17
- 700: string;
18
- 800: string;
19
- 900: string;
20
- };
21
- red: {
22
- 50: string;
23
- 100: string;
24
- 200: string;
25
- 300: string;
26
- 400: string;
27
- 500: string;
28
- 600: string;
29
- 700: string;
30
- 800: string;
31
- 900: string;
32
- };
33
- yellow: {
34
- 50: string;
35
- 100: string;
36
- 200: string;
37
- 300: string;
38
- 400: string;
39
- 500: string;
40
- 600: string;
41
- 700: string;
42
- 800: string;
43
- 900: string;
44
- };
45
- green: {
46
- 50: string;
47
- 100: string;
48
- 200: string;
49
- 300: string;
50
- 400: string;
51
- 500: string;
52
- 600: string;
53
- 700: string;
54
- 800: string;
55
- 900: string;
56
- };
57
- blue: {
58
- 50: string;
59
- 100: string;
60
- 200: string;
61
- 300: string;
62
- 400: string;
63
- 500: string;
64
- 600: string;
65
- 700: string;
66
- 800: string;
67
- 900: string;
68
- };
69
- accent: {
70
- 50: string;
71
- 100: string;
72
- 200: string;
73
- 300: string;
74
- 400: string;
75
- 500: string;
76
- 600: string;
77
- 700: string;
78
- 800: string;
79
- 900: string;
80
- };
81
- "button-text-color": string;
82
- };
83
- };
84
- plugins: {
85
- handler: tailwindcss_types_config.PluginCreator;
86
- config?: Partial<tailwindcss_types_config.Config>;
87
- }[];
88
- };
89
- export default _default;
1
+ import { Config } from 'tailwindcss';
2
+ declare const preset: Config;
3
+ export default preset;
@@ -1,93 +1,14 @@
1
- import { iconsPlugin as c, getIconCollections as o } from "@egoist/tailwindcss-icons";
2
- const l = new URL(import.meta.url).pathname.replace(/[^/]*$/, ""), h = {
3
- 50: "oklch(98.5% 0 0)",
4
- 100: "oklch(97% 0 0)",
5
- 200: "oklch(92.2% 0 0)",
6
- 300: "oklch(87% 0 0)",
7
- 400: "oklch(70.8% 0 0)",
8
- 500: "oklch(55.6% 0 0)",
9
- 600: "oklch(43.9% 0 0)",
10
- 700: "oklch(37.1% 0 0)",
11
- 800: "oklch(26.9% 0 0)",
12
- 900: "oklch(20.5% 0 0)"
13
- }, k = {
14
- 50: "oklch(97.1% 0.013 17.38)",
15
- 100: "oklch(93.6% 0.032 17.717)",
16
- 200: "oklch(88.5% 0.062 18.334)",
17
- 300: "oklch(80.8% 0.114 19.571)",
18
- 400: "oklch(70.4% 0.191 22.216)",
19
- 500: "oklch(63.7% 0.237 25.331)",
20
- 600: "oklch(57.7% 0.245 27.325)",
21
- 700: "oklch(50.5% 0.213 27.518)",
22
- 800: "oklch(44.4% 0.177 26.899)",
23
- 900: "oklch(39.6% 0.141 25.723)"
24
- }, t = {
25
- 50: "oklch(98.7% 0.022 95.277)",
26
- 100: "oklch(96.2% 0.059 95.617)",
27
- 200: "oklch(92.4% 0.12 95.746)",
28
- 300: "oklch(87.9% 0.169 91.605)",
29
- 400: "oklch(82.8% 0.189 84.429)",
30
- 500: "oklch(76.9% 0.188 70.08)",
31
- 600: "oklch(66.6% 0.179 58.318)",
32
- 700: "oklch(55.5% 0.163 48.998)",
33
- 800: "oklch(47.3% 0.137 46.201)",
34
- 900: "oklch(41.4% 0.112 45.904)"
35
- }, r = {
36
- 50: "oklch(98.2% 0.018 155.826)",
37
- 100: "oklch(96.2% 0.044 156.743)",
38
- 200: "oklch(92.5% 0.084 155.995)",
39
- 300: "oklch(87.1% 0.15 154.449)",
40
- 400: "oklch(79.2% 0.209 151.711)",
41
- 500: "oklch(72.3% 0.219 149.579)",
42
- 600: "oklch(62.7% 0.194 149.214)",
43
- 700: "oklch(52.7% 0.154 150.069)",
44
- 800: "oklch(44.8% 0.119 151.328)",
45
- 900: "oklch(39.3% 0.095 152.535)"
46
- }, e = {
47
- 50: "oklch(97% 0.014 254.604)",
48
- 100: "oklch(93.2% 0.032 255.585)",
49
- 200: "oklch(88.2% 0.059 254.128)",
50
- 300: "oklch(80.9% 0.105 251.813)",
51
- 400: "oklch(70.7% 0.165 254.624)",
52
- 500: "oklch(62.3% 0.214 259.815)",
53
- 600: "oklch(54.6% 0.245 262.881)",
54
- 700: "oklch(48.8% 0.243 264.376)",
55
- 800: "oklch(42.4% 0.199 265.638)",
56
- 900: "oklch(37.9% 0.146 265.522)"
57
- }, a = {
58
- content: [`${l}**/*.{js,mjs}`],
59
- theme: {
60
- colors: {
61
- transparent: "transparent",
62
- current: "currentColor",
63
- black: "#000000",
64
- white: "#ffffff",
65
- gray: h,
66
- red: k,
67
- yellow: t,
68
- green: r,
69
- blue: e,
70
- accent: {
71
- 50: "var(--color-accent-50)",
72
- 100: "var(--color-accent-100)",
73
- 200: "var(--color-accent-200)",
74
- 300: "var(--color-accent-300)",
75
- 400: "var(--color-accent-400)",
76
- 500: "var(--color-accent-500)",
77
- 600: "var(--color-accent-600)",
78
- 700: "var(--color-accent-700)",
79
- 800: "var(--color-accent-800)",
80
- 900: "var(--color-accent-900)"
81
- },
82
- "button-text-color": "var(--button-text-color, #ffffff)"
83
- }
84
- },
1
+ import { iconsPlugin as o, getIconCollections as t } from "@egoist/tailwindcss-icons";
2
+ import { theme as e, content as n } from "./tailwind-tokens.mjs";
3
+ const c = {
4
+ content: n,
5
+ theme: e,
85
6
  plugins: [
86
- c({
87
- collections: o(["mdi", "line-md"])
7
+ o({
8
+ collections: t(["mdi", "line-md"])
88
9
  })
89
10
  ]
90
11
  };
91
12
  export {
92
- a as default
13
+ c as default
93
14
  };
@@ -0,0 +1,4 @@
1
+ import { Config } from 'tailwindcss';
2
+ export declare const content: Config["content"];
3
+ export declare const theme: Config["theme"];
4
+ export declare const iconClasses: "i-line-md-loading-twotone-loop"[];
@@ -0,0 +1,87 @@
1
+ import { I as c } from "./icons-DedUTX68.js";
2
+ const o = new URL(import.meta.url).pathname.replace(/[^/]*$/, ""), l = {
3
+ 50: "oklch(98.5% 0 0)",
4
+ 100: "oklch(97% 0 0)",
5
+ 200: "oklch(92.2% 0 0)",
6
+ 300: "oklch(87% 0 0)",
7
+ 400: "oklch(70.8% 0 0)",
8
+ 500: "oklch(55.6% 0 0)",
9
+ 600: "oklch(43.9% 0 0)",
10
+ 700: "oklch(37.1% 0 0)",
11
+ 800: "oklch(26.9% 0 0)",
12
+ 900: "oklch(20.5% 0 0)"
13
+ }, h = {
14
+ 50: "oklch(97.1% 0.013 17.38)",
15
+ 100: "oklch(93.6% 0.032 17.717)",
16
+ 200: "oklch(88.5% 0.062 18.334)",
17
+ 300: "oklch(80.8% 0.114 19.571)",
18
+ 400: "oklch(70.4% 0.191 22.216)",
19
+ 500: "oklch(63.7% 0.237 25.331)",
20
+ 600: "oklch(57.7% 0.245 27.325)",
21
+ 700: "oklch(50.5% 0.213 27.518)",
22
+ 800: "oklch(44.4% 0.177 26.899)",
23
+ 900: "oklch(39.6% 0.141 25.723)"
24
+ }, k = {
25
+ 50: "oklch(98.7% 0.022 95.277)",
26
+ 100: "oklch(96.2% 0.059 95.617)",
27
+ 200: "oklch(92.4% 0.12 95.746)",
28
+ 300: "oklch(87.9% 0.169 91.605)",
29
+ 400: "oklch(82.8% 0.189 84.429)",
30
+ 500: "oklch(76.9% 0.188 70.08)",
31
+ 600: "oklch(66.6% 0.179 58.318)",
32
+ 700: "oklch(55.5% 0.163 48.998)",
33
+ 800: "oklch(47.3% 0.137 46.201)",
34
+ 900: "oklch(41.4% 0.112 45.904)"
35
+ }, t = {
36
+ 50: "oklch(98.2% 0.018 155.826)",
37
+ 100: "oklch(96.2% 0.044 156.743)",
38
+ 200: "oklch(92.5% 0.084 155.995)",
39
+ 300: "oklch(87.1% 0.15 154.449)",
40
+ 400: "oklch(79.2% 0.209 151.711)",
41
+ 500: "oklch(72.3% 0.219 149.579)",
42
+ 600: "oklch(62.7% 0.194 149.214)",
43
+ 700: "oklch(52.7% 0.154 150.069)",
44
+ 800: "oklch(44.8% 0.119 151.328)",
45
+ 900: "oklch(39.3% 0.095 152.535)"
46
+ }, r = {
47
+ 50: "oklch(97% 0.014 254.604)",
48
+ 100: "oklch(93.2% 0.032 255.585)",
49
+ 200: "oklch(88.2% 0.059 254.128)",
50
+ 300: "oklch(80.9% 0.105 251.813)",
51
+ 400: "oklch(70.7% 0.165 254.624)",
52
+ 500: "oklch(62.3% 0.214 259.815)",
53
+ 600: "oklch(54.6% 0.245 262.881)",
54
+ 700: "oklch(48.8% 0.243 264.376)",
55
+ 800: "oklch(42.4% 0.199 265.638)",
56
+ 900: "oklch(37.9% 0.146 265.522)"
57
+ }, e = [`${o}**/*.{js,mjs}`], n = {
58
+ colors: {
59
+ transparent: "transparent",
60
+ current: "currentColor",
61
+ black: "#000000",
62
+ white: "#ffffff",
63
+ gray: l,
64
+ red: h,
65
+ yellow: k,
66
+ green: t,
67
+ blue: r,
68
+ accent: {
69
+ 50: "var(--color-accent-50)",
70
+ 100: "var(--color-accent-100)",
71
+ 200: "var(--color-accent-200)",
72
+ 300: "var(--color-accent-300)",
73
+ 400: "var(--color-accent-400)",
74
+ 500: "var(--color-accent-500)",
75
+ 600: "var(--color-accent-600)",
76
+ 700: "var(--color-accent-700)",
77
+ 800: "var(--color-accent-800)",
78
+ 900: "var(--color-accent-900)"
79
+ },
80
+ "button-text-color": "var(--button-text-color, #ffffff)"
81
+ }
82
+ }, s = Object.values(c);
83
+ export {
84
+ e as content,
85
+ s as iconClasses,
86
+ n as theme
87
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neuralytics/alpine-ds",
3
3
  "type": "module",
4
- "version": "0.2.5",
4
+ "version": "0.3.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -18,6 +18,10 @@
18
18
  "./tailwind-preset": {
19
19
  "types": "./dist/tailwind-preset.d.ts",
20
20
  "import": "./dist/tailwind-preset.mjs"
21
+ },
22
+ "./tailwind-tokens": {
23
+ "types": "./dist/tailwind-tokens.d.ts",
24
+ "import": "./dist/tailwind-tokens.mjs"
21
25
  }
22
26
  },
23
27
  "main": "./dist/index.mjs",