@neuralytics/alpine-ds 0.2.4 → 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 +12 -0
- package/README.md +20 -0
- package/dist/components/button/Button.styles.d.ts +70 -0
- package/dist/components/button/Button.types.d.ts +2 -0
- package/dist/components/button/Button.vue.d.ts +4 -2
- package/dist/icons-DedUTX68.js +6 -0
- package/dist/icons.d.ts +3 -0
- package/dist/index.mjs +160 -155
- package/dist/tailwind-preset.d.ts +3 -89
- package/dist/tailwind-preset.mjs +8 -87
- package/dist/tailwind-tokens.d.ts +4 -0
- package/dist/tailwind-tokens.mjs +87 -0
- package/package.json +12 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
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
|
+
|
|
9
|
+
## 0.2.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 8964133: Add `type` prop to `AlpineButton` (defaults to `button`) and fix content to always be centered.
|
|
14
|
+
|
|
3
15
|
## 0.2.4
|
|
4
16
|
|
|
5
17
|
### 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,70 @@
|
|
|
1
|
+
export declare const buttonStyle: import('tailwind-variants').TVReturnType<{
|
|
2
|
+
iconPosition: {
|
|
3
|
+
left: string;
|
|
4
|
+
right: string;
|
|
5
|
+
};
|
|
6
|
+
design: {
|
|
7
|
+
primary: string;
|
|
8
|
+
secondary: string;
|
|
9
|
+
invisible: string;
|
|
10
|
+
};
|
|
11
|
+
isDisabled: {
|
|
12
|
+
true: string;
|
|
13
|
+
};
|
|
14
|
+
isLoading: {
|
|
15
|
+
true: string;
|
|
16
|
+
};
|
|
17
|
+
isDanger: {
|
|
18
|
+
true: string;
|
|
19
|
+
};
|
|
20
|
+
hasLabel: {
|
|
21
|
+
true: string;
|
|
22
|
+
false: string;
|
|
23
|
+
};
|
|
24
|
+
}, undefined, "rounded-lg flex items-center justify-center gap-2 font-medium transition-all max-w-full border", {
|
|
25
|
+
iconPosition: {
|
|
26
|
+
left: string;
|
|
27
|
+
right: string;
|
|
28
|
+
};
|
|
29
|
+
design: {
|
|
30
|
+
primary: string;
|
|
31
|
+
secondary: string;
|
|
32
|
+
invisible: string;
|
|
33
|
+
};
|
|
34
|
+
isDisabled: {
|
|
35
|
+
true: string;
|
|
36
|
+
};
|
|
37
|
+
isLoading: {
|
|
38
|
+
true: string;
|
|
39
|
+
};
|
|
40
|
+
isDanger: {
|
|
41
|
+
true: string;
|
|
42
|
+
};
|
|
43
|
+
hasLabel: {
|
|
44
|
+
true: string;
|
|
45
|
+
false: string;
|
|
46
|
+
};
|
|
47
|
+
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
48
|
+
iconPosition: {
|
|
49
|
+
left: string;
|
|
50
|
+
right: string;
|
|
51
|
+
};
|
|
52
|
+
design: {
|
|
53
|
+
primary: string;
|
|
54
|
+
secondary: string;
|
|
55
|
+
invisible: string;
|
|
56
|
+
};
|
|
57
|
+
isDisabled: {
|
|
58
|
+
true: string;
|
|
59
|
+
};
|
|
60
|
+
isLoading: {
|
|
61
|
+
true: string;
|
|
62
|
+
};
|
|
63
|
+
isDanger: {
|
|
64
|
+
true: string;
|
|
65
|
+
};
|
|
66
|
+
hasLabel: {
|
|
67
|
+
true: string;
|
|
68
|
+
false: string;
|
|
69
|
+
};
|
|
70
|
+
}, undefined, "rounded-lg flex items-center justify-center gap-2 font-medium transition-all max-w-full border", unknown, unknown, undefined>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const buttonDesigns: readonly ["primary", "secondary", "invisible"];
|
|
2
2
|
export declare const buttonIconPositions: readonly ["left", "right"];
|
|
3
|
+
export declare const buttonTypes: readonly ["button", "submit", "reset"];
|
|
3
4
|
export type ButtonDesign = typeof buttonDesigns[number];
|
|
4
5
|
export type ButtonIconPosition = typeof buttonIconPositions[number];
|
|
6
|
+
export type ButtonType = typeof buttonTypes[number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonDesign as ButtonDesignType, ButtonIconPosition as ButtonIconPositionType } from './Button.types';
|
|
1
|
+
import { ButtonDesign as ButtonDesignType, ButtonIconPosition as ButtonIconPositionType, ButtonType as ButtonTypeType } from './Button.types';
|
|
2
2
|
export interface ButtonProps {
|
|
3
3
|
label?: string | null;
|
|
4
4
|
icon?: string | null;
|
|
@@ -7,13 +7,15 @@ export interface ButtonProps {
|
|
|
7
7
|
isDisabled?: boolean;
|
|
8
8
|
isDanger?: boolean;
|
|
9
9
|
iconPosition?: ButtonIconPositionType;
|
|
10
|
+
type?: ButtonTypeType;
|
|
10
11
|
}
|
|
11
12
|
declare const _default: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
|
|
12
13
|
icon: string | null;
|
|
13
14
|
isLoading: boolean;
|
|
15
|
+
type: ButtonTypeType;
|
|
14
16
|
design: ButtonDesignType;
|
|
15
|
-
isDisabled: boolean;
|
|
16
17
|
isDanger: boolean;
|
|
18
|
+
isDisabled: boolean;
|
|
17
19
|
iconPosition: ButtonIconPositionType;
|
|
18
20
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
19
21
|
export default _default;
|
package/dist/icons.d.ts
ADDED
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { defineComponent as w, ref as
|
|
2
|
-
import {
|
|
3
|
-
|
|
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({
|
|
5
|
+
name: "AlpineIcon",
|
|
4
6
|
__name: "Icon",
|
|
5
7
|
props: {
|
|
6
8
|
icon: {},
|
|
@@ -9,7 +11,7 @@ const H = ["xs", "sm", "md", "lg", "xl", "2xl"], P = /* @__PURE__ */ w({
|
|
|
9
11
|
isLoading: { type: Boolean, default: !1 }
|
|
10
12
|
},
|
|
11
13
|
setup(t) {
|
|
12
|
-
const e = t,
|
|
14
|
+
const e = t, a = I({
|
|
13
15
|
variants: {
|
|
14
16
|
size: {
|
|
15
17
|
xs: "size-3",
|
|
@@ -20,145 +22,148 @@ const H = ["xs", "sm", "md", "lg", "xl", "2xl"], P = /* @__PURE__ */ w({
|
|
|
20
22
|
"2xl": "size-8"
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
|
-
}),
|
|
24
|
-
return (r,
|
|
25
|
-
class: L([
|
|
26
|
-
onMouseover:
|
|
27
|
-
onMouseleave:
|
|
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", {
|
|
27
|
+
class: L([n.value, m(a)({ size: t.size })]),
|
|
28
|
+
onMouseover: o[0] || (o[0] = (i) => s.value = !0),
|
|
29
|
+
onMouseleave: o[1] || (o[1] = (i) => s.value = !1)
|
|
28
30
|
}, null, 34));
|
|
29
31
|
}
|
|
30
|
-
}),
|
|
32
|
+
}), C = I({
|
|
33
|
+
base: "rounded-lg flex items-center justify-center gap-2 font-medium transition-all max-w-full border",
|
|
34
|
+
variants: {
|
|
35
|
+
iconPosition: {
|
|
36
|
+
left: "flex-row",
|
|
37
|
+
right: "flex-row-reverse"
|
|
38
|
+
},
|
|
39
|
+
design: {
|
|
40
|
+
primary: "h-9 bg-accent-500 border-transparent shadow-xs hover:shadow hover:brightness-110 active:bg-accent-600 active:shadow-none active:brightness-100 text-button-text-color",
|
|
41
|
+
secondary: "h-9 bg-white border-gray-200 text-gray-900 shadow-xs hover:shadow active:shadow-inner",
|
|
42
|
+
invisible: "h-7 bg-transparent hover:bg-gray-100 active:bg-gray-200 text-gray-900 border-transparent underline"
|
|
43
|
+
},
|
|
44
|
+
isDisabled: {
|
|
45
|
+
true: "cursor-not-allowed hover:brightness-100 shadow-none"
|
|
46
|
+
},
|
|
47
|
+
isLoading: {
|
|
48
|
+
true: "cursor-wait hover:brightness-100 shadow-none"
|
|
49
|
+
},
|
|
50
|
+
isDanger: {
|
|
51
|
+
true: ""
|
|
52
|
+
},
|
|
53
|
+
hasLabel: {
|
|
54
|
+
true: "w-auto",
|
|
55
|
+
false: "px-0"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
compoundVariants: [
|
|
59
|
+
// Has Label
|
|
60
|
+
{
|
|
61
|
+
hasLabel: !0,
|
|
62
|
+
design: "primary",
|
|
63
|
+
class: "px-3"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
hasLabel: !0,
|
|
67
|
+
design: "secondary",
|
|
68
|
+
class: "px-3"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
hasLabel: !0,
|
|
72
|
+
design: "invisible",
|
|
73
|
+
class: "px-2"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
hasLabel: !1,
|
|
77
|
+
design: "primary",
|
|
78
|
+
class: "size-9"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
hasLabel: !1,
|
|
82
|
+
design: "secondary",
|
|
83
|
+
class: "size-9"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
hasLabel: !1,
|
|
87
|
+
design: "invisible",
|
|
88
|
+
class: "size-7"
|
|
89
|
+
},
|
|
90
|
+
// Danger
|
|
91
|
+
{
|
|
92
|
+
design: "primary",
|
|
93
|
+
isDanger: !0,
|
|
94
|
+
class: "bg-red-600 text-white active:bg-red-700"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
design: "secondary",
|
|
98
|
+
isDanger: !0,
|
|
99
|
+
class: "bg-white text-red-600"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
design: "invisible",
|
|
103
|
+
isDanger: !0,
|
|
104
|
+
class: "text-red-600 hover:bg-red-100 active:bg-red-200"
|
|
105
|
+
},
|
|
106
|
+
// Disabled
|
|
107
|
+
{
|
|
108
|
+
design: "primary",
|
|
109
|
+
isDisabled: !0,
|
|
110
|
+
class: "bg-gray-200 text-gray-500 hover:bg-gray-200 active:bg-gray-200 hover:shadow-none active:shadow-none"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
design: "secondary",
|
|
114
|
+
isDisabled: !0,
|
|
115
|
+
class: "bg-gray-50 text-gray-500 hover:bg-gray-50 active:bg-gray-50 hover:shadow-none active:shadow-none"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
design: "invisible",
|
|
119
|
+
isDisabled: !0,
|
|
120
|
+
class: "bg-transparent text-gray-500 hover:bg-transparent active:bg-transparent hover:text-gray-500 hover:shadow-none active:shadow-none"
|
|
121
|
+
},
|
|
122
|
+
// Loading
|
|
123
|
+
{
|
|
124
|
+
design: "primary",
|
|
125
|
+
isLoading: !0,
|
|
126
|
+
class: "bg-gray-200 text-gray-500 hover:bg-gray-200 active:bg-gray-200 hover:shadow-none active:shadow-none"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
design: "secondary",
|
|
130
|
+
isLoading: !0,
|
|
131
|
+
class: "bg-gray-50 text-gray-500 hover:bg-gray-50 active:bg-gray-50 hover:shadow-none active:shadow-none"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
design: "invisible",
|
|
135
|
+
isLoading: !0,
|
|
136
|
+
class: "bg-transparent text-gray-500 hover:bg-transparent active:bg-transparent hover:text-gray-500 hover:shadow-none active:shadow-none"
|
|
137
|
+
},
|
|
138
|
+
// Default
|
|
139
|
+
{
|
|
140
|
+
isLoading: !1,
|
|
141
|
+
isDisabled: !1,
|
|
142
|
+
class: "cursor-pointer"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}), P = ["primary", "secondary", "invisible"], $ = ["left", "right"], O = ["button", "submit", "reset"], R = ["type", "aria-label", "disabled"], N = {
|
|
31
146
|
key: 1,
|
|
32
|
-
class: "
|
|
33
|
-
},
|
|
147
|
+
class: "min-w-0 truncate"
|
|
148
|
+
}, K = /* @__PURE__ */ w({
|
|
149
|
+
name: "AlpineButton",
|
|
34
150
|
__name: "Button",
|
|
35
151
|
props: {
|
|
36
152
|
label: {},
|
|
37
153
|
icon: { default: null },
|
|
38
|
-
design: { default:
|
|
154
|
+
design: { default: P[0] },
|
|
39
155
|
isLoading: { type: Boolean, default: !1 },
|
|
40
156
|
isDisabled: { type: Boolean, default: !1 },
|
|
41
157
|
isDanger: { type: Boolean, default: !1 },
|
|
42
|
-
iconPosition: { default: $[0] }
|
|
158
|
+
iconPosition: { default: $[0] },
|
|
159
|
+
type: { default: O[0] }
|
|
43
160
|
},
|
|
44
161
|
setup(t) {
|
|
45
|
-
const e = t,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
iconPosition: {
|
|
49
|
-
left: "flex-row",
|
|
50
|
-
right: "flex-row-reverse"
|
|
51
|
-
},
|
|
52
|
-
design: {
|
|
53
|
-
primary: "h-9 bg-accent-500 border-transparent shadow-xs hover:shadow hover:brightness-110 active:bg-accent-600 active:shadow-none active:brightness-100 text-button-text-color",
|
|
54
|
-
secondary: "h-9 bg-white border-gray-200 text-gray-900 shadow-xs hover:shadow active:shadow-inner",
|
|
55
|
-
invisible: "h-7 bg-transparent hover:bg-gray-100 active:bg-gray-200 text-gray-900 border-transparent underline"
|
|
56
|
-
},
|
|
57
|
-
isDisabled: {
|
|
58
|
-
true: "cursor-not-allowed hover:brightness-100 shadow-none"
|
|
59
|
-
},
|
|
60
|
-
isLoading: {
|
|
61
|
-
true: "cursor-wait hover:brightness-100 shadow-none"
|
|
62
|
-
},
|
|
63
|
-
isDanger: {
|
|
64
|
-
true: ""
|
|
65
|
-
},
|
|
66
|
-
hasLabel: {
|
|
67
|
-
true: "w-auto",
|
|
68
|
-
false: "px-0 justify-center"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
compoundVariants: [
|
|
72
|
-
// Has Label
|
|
73
|
-
{
|
|
74
|
-
hasLabel: !0,
|
|
75
|
-
design: "primary",
|
|
76
|
-
class: "px-3"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
hasLabel: !0,
|
|
80
|
-
design: "secondary",
|
|
81
|
-
class: "px-3"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
hasLabel: !0,
|
|
85
|
-
design: "invisible",
|
|
86
|
-
class: "px-2"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
hasLabel: !1,
|
|
90
|
-
design: "primary",
|
|
91
|
-
class: "size-9"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
hasLabel: !1,
|
|
95
|
-
design: "secondary",
|
|
96
|
-
class: "size-9"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
hasLabel: !1,
|
|
100
|
-
design: "invisible",
|
|
101
|
-
class: "size-7"
|
|
102
|
-
},
|
|
103
|
-
// Danger
|
|
104
|
-
{
|
|
105
|
-
design: "primary",
|
|
106
|
-
isDanger: !0,
|
|
107
|
-
class: "bg-red-600 text-white active:bg-red-700"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
design: "secondary",
|
|
111
|
-
isDanger: !0,
|
|
112
|
-
class: "bg-white text-red-600"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
design: "invisible",
|
|
116
|
-
isDanger: !0,
|
|
117
|
-
class: "text-red-600 hover:bg-red-100 active:bg-red-200"
|
|
118
|
-
},
|
|
119
|
-
// Disabled
|
|
120
|
-
{
|
|
121
|
-
design: "primary",
|
|
122
|
-
isDisabled: !0,
|
|
123
|
-
class: "bg-gray-200 text-gray-500 hover:bg-gray-200 active:bg-gray-200 hover:shadow-none active:shadow-none"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
design: "secondary",
|
|
127
|
-
isDisabled: !0,
|
|
128
|
-
class: "bg-gray-50 text-gray-500 hover:bg-gray-50 active:bg-gray-50 hover:shadow-none active:shadow-none"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
design: "invisible",
|
|
132
|
-
isDisabled: !0,
|
|
133
|
-
class: "bg-transparent text-gray-500 hover:bg-transparent active:bg-transparent hover:text-gray-500 hover:shadow-none active:shadow-none"
|
|
134
|
-
},
|
|
135
|
-
// Loading
|
|
136
|
-
{
|
|
137
|
-
design: "primary",
|
|
138
|
-
isLoading: !0,
|
|
139
|
-
class: "bg-gray-200 text-gray-500 hover:bg-gray-200 active:bg-gray-200 hover:shadow-none active:shadow-none"
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
design: "secondary",
|
|
143
|
-
isLoading: !0,
|
|
144
|
-
class: "bg-gray-50 text-gray-500 hover:bg-gray-50 active:bg-gray-50 hover:shadow-none active:shadow-none"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
design: "invisible",
|
|
148
|
-
isLoading: !0,
|
|
149
|
-
class: "bg-transparent text-gray-500 hover:bg-transparent active:bg-transparent hover:text-gray-500 hover:shadow-none active:shadow-none"
|
|
150
|
-
},
|
|
151
|
-
// Default
|
|
152
|
-
{
|
|
153
|
-
isLoading: !1,
|
|
154
|
-
isDisabled: !1,
|
|
155
|
-
class: "cursor-pointer"
|
|
156
|
-
}
|
|
157
|
-
]
|
|
158
|
-
}), n = y(() => e.isLoading ? "i-line-md-loading-twotone-loop" : e.icon), s = y(() => !e.icon && !e.label ? "-" : e.label);
|
|
159
|
-
return (r, a) => (l(), p("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", {
|
|
164
|
+
type: e.type,
|
|
160
165
|
"aria-label": e.label ?? e.icon ?? "Button without label or icon",
|
|
161
|
-
class: L(
|
|
166
|
+
class: L(m(C)({
|
|
162
167
|
design: e.design,
|
|
163
168
|
iconPosition: e.iconPosition,
|
|
164
169
|
isLoading: e.isLoading,
|
|
@@ -168,17 +173,17 @@ const H = ["xs", "sm", "md", "lg", "xl", "2xl"], P = /* @__PURE__ */ w({
|
|
|
168
173
|
})),
|
|
169
174
|
disabled: e.isDisabled || e.isLoading
|
|
170
175
|
}, [
|
|
171
|
-
|
|
176
|
+
a.value ? (l(), S(m(T), {
|
|
172
177
|
key: 0,
|
|
173
178
|
"aria-hidden": !0,
|
|
174
|
-
icon:
|
|
179
|
+
icon: a.value,
|
|
175
180
|
class: "shrink-0"
|
|
176
|
-
}, null, 8, ["icon"])) :
|
|
177
|
-
s.value ? (l(), p("span",
|
|
178
|
-
], 10,
|
|
181
|
+
}, null, 8, ["icon"])) : f("", !0),
|
|
182
|
+
s.value ? (l(), p("span", N, A(s.value), 1)) : f("", !0)
|
|
183
|
+
], 10, R));
|
|
179
184
|
}
|
|
180
185
|
});
|
|
181
|
-
function
|
|
186
|
+
function E(t) {
|
|
182
187
|
const e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
183
188
|
return e ? {
|
|
184
189
|
r: Number.parseInt(e[1], 16),
|
|
@@ -190,8 +195,8 @@ function v(t) {
|
|
|
190
195
|
const e = t / 255;
|
|
191
196
|
return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
|
|
192
197
|
}
|
|
193
|
-
function
|
|
194
|
-
const { r: e, g:
|
|
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);
|
|
195
200
|
let h = Math.atan2(b, u) * 180 / Math.PI;
|
|
196
201
|
return h < 0 && (h += 360), { lightness: M, chroma: _, hue: h };
|
|
197
202
|
}
|
|
@@ -206,7 +211,7 @@ const x = {
|
|
|
206
211
|
700: 0.754,
|
|
207
212
|
800: 0.6501,
|
|
208
213
|
900: 0.5749
|
|
209
|
-
},
|
|
214
|
+
}, F = {
|
|
210
215
|
50: 0.0549,
|
|
211
216
|
100: 0.135,
|
|
212
217
|
200: 0.262,
|
|
@@ -218,27 +223,27 @@ const x = {
|
|
|
218
223
|
800: 0.747,
|
|
219
224
|
900: 0.595
|
|
220
225
|
};
|
|
221
|
-
function
|
|
222
|
-
const { lightness: e, chroma:
|
|
226
|
+
function H(t) {
|
|
227
|
+
const { lightness: e, chroma: a, hue: s } = j(t), n = {};
|
|
223
228
|
for (const r of Object.keys(x)) {
|
|
224
|
-
const
|
|
225
|
-
|
|
229
|
+
const o = Math.min(1, Math.max(0, e * x[r])), i = Math.max(0, a * F[r]);
|
|
230
|
+
n[`--color-accent-${r}`] = `oklch(${(o * 100).toFixed(1)}% ${i.toFixed(3)} ${s.toFixed(1)})`;
|
|
226
231
|
}
|
|
227
|
-
return
|
|
232
|
+
return n;
|
|
228
233
|
}
|
|
229
|
-
function
|
|
230
|
-
const e =
|
|
231
|
-
for (const [
|
|
232
|
-
|
|
234
|
+
function Q(t) {
|
|
235
|
+
const e = H(t), a = document.documentElement;
|
|
236
|
+
for (const [s, n] of Object.entries(e))
|
|
237
|
+
a.style.setProperty(s, n);
|
|
233
238
|
}
|
|
234
|
-
function
|
|
239
|
+
function U(t) {
|
|
235
240
|
document.documentElement.style.setProperty("--button-text-color", t);
|
|
236
241
|
}
|
|
237
242
|
export {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
243
|
+
K as AlpineButton,
|
|
244
|
+
T as AlpineIcon,
|
|
245
|
+
H as generateAccentScale,
|
|
246
|
+
J as iconSizes,
|
|
247
|
+
Q as setAccentColorTheme,
|
|
248
|
+
U as setButtonTextColor
|
|
244
249
|
};
|
|
@@ -1,89 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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;
|
package/dist/tailwind-preset.mjs
CHANGED
|
@@ -1,93 +1,14 @@
|
|
|
1
|
-
import { iconsPlugin as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
87
|
-
collections:
|
|
7
|
+
o({
|
|
8
|
+
collections: t(["mdi", "line-md"])
|
|
88
9
|
})
|
|
89
10
|
]
|
|
90
11
|
};
|
|
91
12
|
export {
|
|
92
|
-
|
|
13
|
+
c as default
|
|
93
14
|
};
|
|
@@ -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.
|
|
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",
|
|
@@ -29,12 +33,6 @@
|
|
|
29
33
|
"engines": {
|
|
30
34
|
"node": ">=24"
|
|
31
35
|
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "vite build",
|
|
34
|
-
"test": "vitest run",
|
|
35
|
-
"test:watch": "vitest",
|
|
36
|
-
"typecheck": "vue-tsc -p tsconfig.app.json --noEmit"
|
|
37
|
-
},
|
|
38
36
|
"peerDependencies": {
|
|
39
37
|
"tailwindcss": "^4.1.17",
|
|
40
38
|
"vue": "^3.5.25"
|
|
@@ -58,5 +56,11 @@
|
|
|
58
56
|
"vitest": "^4.0.14",
|
|
59
57
|
"vue": "^3.5.25",
|
|
60
58
|
"vue-tsc": "^3.1.5"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "vite build",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"test:watch": "vitest",
|
|
64
|
+
"typecheck": "vue-tsc -p tsconfig.app.json --noEmit"
|
|
61
65
|
}
|
|
62
|
-
}
|
|
66
|
+
}
|