@neuralytics/alpine-ds 0.5.0 → 0.6.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 +6 -0
- package/README.md +17 -17
- package/dist/tailwind-preset.d.ts +3 -0
- package/dist/theme.css +89 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -38,28 +38,28 @@ export default defineConfig({
|
|
|
38
38
|
})
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
4. Import the
|
|
41
|
+
4. Import the design system's CSS theme in your main style file:
|
|
42
|
+
|
|
43
|
+
**Without a `tailwind.config` (recommended)** — `theme.css` already handles detection of the package's classes, no `content` entry needed:
|
|
42
44
|
|
|
43
45
|
```css
|
|
44
46
|
@import "tailwindcss";
|
|
45
|
-
@
|
|
47
|
+
@import "@neuralytics/alpine-ds/theme.css";
|
|
46
48
|
```
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
**With a `tailwind.config`** — if your project already has a `tailwind.config.ts`/`.js` (custom `theme.extend`, plugins, `content`...), keep it alongside the CSS import:
|
|
49
51
|
|
|
50
|
-
```
|
|
51
|
-
import
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export default {
|
|
55
|
-
presets: [alpineDsPreset],
|
|
56
|
-
content: [
|
|
57
|
-
// ... your source files ...
|
|
58
|
-
],
|
|
59
|
-
} as Config
|
|
52
|
+
```css
|
|
53
|
+
@import "tailwindcss";
|
|
54
|
+
@config "./tailwind.config.ts";
|
|
55
|
+
@import "@neuralytics/alpine-ds/theme.css";
|
|
60
56
|
```
|
|
61
57
|
|
|
62
|
-
|
|
58
|
+
Nothing needs to change in `tailwind.config.ts` itself — keep your own `theme.extend`, plugins, `content`, etc. as they are, the DS's classes and colors come entirely from `theme.css`.
|
|
59
|
+
|
|
60
|
+
> Migrating from the old JS preset? Remove the `presets: [alpineDsPreset]` entry (or wherever you imported `@neuralytics/alpine-ds/tailwind-preset`) and any `content` glob you'd added just to scan `@neuralytics/alpine-ds`'s own files — both are now handled by `theme.css`. `tailwind-preset` is still published but deprecated.
|
|
61
|
+
|
|
62
|
+
5. Set the accent color in your project's `main.ts`:
|
|
63
63
|
|
|
64
64
|
```js
|
|
65
65
|
import { setAccentColorTheme } from "@neuralytics/alpine-ds"
|
|
@@ -69,7 +69,7 @@ setAccentColorTheme("#fe4e29")
|
|
|
69
69
|
|
|
70
70
|
Note that this function can be called at any time. Calling it in your `main.ts` gives you a default value.
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
6. (Optional) Set the text color of the primary `AlpineButton` if `white` doesn't fit your accent color:
|
|
73
73
|
|
|
74
74
|
```js
|
|
75
75
|
import { setButtonTextColor } from "@neuralytics/alpine-ds"
|
|
@@ -79,7 +79,7 @@ setButtonTextColor("#000000")
|
|
|
79
79
|
|
|
80
80
|
This only affects the primary button's text (not disabled or loading states) and defaults to `white` if never called.
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
7. Import a component in a `.vue` file
|
|
83
83
|
|
|
84
84
|
```js
|
|
85
85
|
import { AlpineButton } from "@neuralytics/alpine-ds"
|
|
@@ -99,7 +99,7 @@ The Design System uses the following Tailwind colors:
|
|
|
99
99
|
These are the only colors available: any other Tailwind color utility (e.g. `bg-purple-500`) will not generate any CSS.
|
|
100
100
|
|
|
101
101
|
Note that all colors use 10 shades: `50`, `100`, `200`, ..., `900`.
|
|
102
|
-
`accent` must be provided by the consumer via `setAccentColorTheme` (see step
|
|
102
|
+
`accent` must be provided by the consumer via `setAccentColorTheme` (see step 5 of [Integration](#integration)); the other colors already have a default value.
|
|
103
103
|
|
|
104
104
|
## Icons
|
|
105
105
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Config } from 'tailwindcss';
|
|
2
|
+
/** @deprecated Use `@neuralytics/alpine-ds/theme.css` (native Tailwind v4 `@theme`) instead. */
|
|
2
3
|
export declare const content: Config["content"];
|
|
4
|
+
/** @deprecated Use `@neuralytics/alpine-ds/theme.css` (native Tailwind v4 `@theme`) instead. */
|
|
3
5
|
export declare const theme: Config["theme"];
|
|
6
|
+
/** @deprecated Use `@neuralytics/alpine-ds/theme.css` (native Tailwind v4 `@theme`) instead. */
|
|
4
7
|
declare const preset: Config;
|
|
5
8
|
export default preset;
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Native Tailwind v4 CSS-first equivalent of `tailwind-preset.ts`.
|
|
3
|
+
* `--color-*: initial` clears Tailwind's default palette because `theme.colors`
|
|
4
|
+
* in the JS preset was a full replacement, not an `extend` — same behavior here.
|
|
5
|
+
*/
|
|
6
|
+
@theme {
|
|
7
|
+
--color-*: initial;
|
|
8
|
+
|
|
9
|
+
--color-transparent: transparent;
|
|
10
|
+
--color-current: currentColor;
|
|
11
|
+
--color-black: #000000;
|
|
12
|
+
--color-white: #ffffff;
|
|
13
|
+
|
|
14
|
+
--color-gray-50: oklch(98.5% 0 0);
|
|
15
|
+
--color-gray-100: oklch(97% 0 0);
|
|
16
|
+
--color-gray-200: oklch(92.2% 0 0);
|
|
17
|
+
--color-gray-300: oklch(87% 0 0);
|
|
18
|
+
--color-gray-400: oklch(70.8% 0 0);
|
|
19
|
+
--color-gray-500: oklch(55.6% 0 0);
|
|
20
|
+
--color-gray-600: oklch(43.9% 0 0);
|
|
21
|
+
--color-gray-700: oklch(37.1% 0 0);
|
|
22
|
+
--color-gray-800: oklch(26.9% 0 0);
|
|
23
|
+
--color-gray-900: oklch(20.5% 0 0);
|
|
24
|
+
|
|
25
|
+
--color-red-50: oklch(97.1% 0.013 17.38);
|
|
26
|
+
--color-red-100: oklch(93.6% 0.032 17.717);
|
|
27
|
+
--color-red-200: oklch(88.5% 0.062 18.334);
|
|
28
|
+
--color-red-300: oklch(80.8% 0.114 19.571);
|
|
29
|
+
--color-red-400: oklch(70.4% 0.191 22.216);
|
|
30
|
+
--color-red-500: oklch(63.7% 0.237 25.331);
|
|
31
|
+
--color-red-600: oklch(57.7% 0.245 27.325);
|
|
32
|
+
--color-red-700: oklch(50.5% 0.213 27.518);
|
|
33
|
+
--color-red-800: oklch(44.4% 0.177 26.899);
|
|
34
|
+
--color-red-900: oklch(39.6% 0.141 25.723);
|
|
35
|
+
|
|
36
|
+
--color-yellow-50: oklch(98.7% 0.022 95.277);
|
|
37
|
+
--color-yellow-100: oklch(96.2% 0.059 95.617);
|
|
38
|
+
--color-yellow-200: oklch(92.4% 0.12 95.746);
|
|
39
|
+
--color-yellow-300: oklch(87.9% 0.169 91.605);
|
|
40
|
+
--color-yellow-400: oklch(82.8% 0.189 84.429);
|
|
41
|
+
--color-yellow-500: oklch(76.9% 0.188 70.08);
|
|
42
|
+
--color-yellow-600: oklch(66.6% 0.179 58.318);
|
|
43
|
+
--color-yellow-700: oklch(55.5% 0.163 48.998);
|
|
44
|
+
--color-yellow-800: oklch(47.3% 0.137 46.201);
|
|
45
|
+
--color-yellow-900: oklch(41.4% 0.112 45.904);
|
|
46
|
+
|
|
47
|
+
--color-green-50: oklch(98.2% 0.018 155.826);
|
|
48
|
+
--color-green-100: oklch(96.2% 0.044 156.743);
|
|
49
|
+
--color-green-200: oklch(92.5% 0.084 155.995);
|
|
50
|
+
--color-green-300: oklch(87.1% 0.15 154.449);
|
|
51
|
+
--color-green-400: oklch(79.2% 0.209 151.711);
|
|
52
|
+
--color-green-500: oklch(72.3% 0.219 149.579);
|
|
53
|
+
--color-green-600: oklch(62.7% 0.194 149.214);
|
|
54
|
+
--color-green-700: oklch(52.7% 0.154 150.069);
|
|
55
|
+
--color-green-800: oklch(44.8% 0.119 151.328);
|
|
56
|
+
--color-green-900: oklch(39.3% 0.095 152.535);
|
|
57
|
+
|
|
58
|
+
--color-blue-50: oklch(97% 0.014 254.604);
|
|
59
|
+
--color-blue-100: oklch(93.2% 0.032 255.585);
|
|
60
|
+
--color-blue-200: oklch(88.2% 0.059 254.128);
|
|
61
|
+
--color-blue-300: oklch(80.9% 0.105 251.813);
|
|
62
|
+
--color-blue-400: oklch(70.7% 0.165 254.624);
|
|
63
|
+
--color-blue-500: oklch(62.3% 0.214 259.815);
|
|
64
|
+
--color-blue-600: oklch(54.6% 0.245 262.881);
|
|
65
|
+
--color-blue-700: oklch(48.8% 0.243 264.376);
|
|
66
|
+
--color-blue-800: oklch(42.4% 0.199 265.638);
|
|
67
|
+
--color-blue-900: oklch(37.9% 0.146 265.522);
|
|
68
|
+
|
|
69
|
+
/* Runtime-themed via inline style (setAccentColorTheme/setButtonTextColor in
|
|
70
|
+
utils/colors.ts), which overrides these defaults through cascade specificity. */
|
|
71
|
+
--color-accent-50: transparent;
|
|
72
|
+
--color-accent-100: transparent;
|
|
73
|
+
--color-accent-200: transparent;
|
|
74
|
+
--color-accent-300: transparent;
|
|
75
|
+
--color-accent-400: transparent;
|
|
76
|
+
--color-accent-500: transparent;
|
|
77
|
+
--color-accent-600: transparent;
|
|
78
|
+
--color-accent-700: transparent;
|
|
79
|
+
--color-accent-800: transparent;
|
|
80
|
+
--color-accent-900: transparent;
|
|
81
|
+
|
|
82
|
+
/* Aliases `--button-text-color` (not `--color-button-text-color`) because that's
|
|
83
|
+
the variable name setButtonTextColor() in utils/colors.ts writes to. */
|
|
84
|
+
--color-button-text-color: var(--button-text-color, #ffffff);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Lets consumers `@import` this file without also adding the package's own
|
|
88
|
+
built output to their content globs. */
|
|
89
|
+
@source "./**/*.{js,mjs}";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neuralytics/alpine-ds",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"./tailwind-preset": {
|
|
19
19
|
"types": "./dist/tailwind-preset.d.ts",
|
|
20
20
|
"import": "./dist/tailwind-preset.mjs"
|
|
21
|
-
}
|
|
21
|
+
},
|
|
22
|
+
"./theme.css": "./dist/theme.css"
|
|
22
23
|
},
|
|
23
24
|
"main": "./dist/index.mjs",
|
|
24
25
|
"types": "dist/index.d.ts",
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
"vue-tsc": "^3.1.5"
|
|
54
55
|
},
|
|
55
56
|
"scripts": {
|
|
56
|
-
"build": "vite build",
|
|
57
|
+
"build": "vite build && cp src/theme.css dist/theme.css",
|
|
57
58
|
"test": "vitest run",
|
|
58
59
|
"test:watch": "vitest",
|
|
59
60
|
"typecheck": "vue-tsc -p tsconfig.app.json --noEmit"
|