@neuralytics/alpine-ds 0.3.0 → 0.5.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 +18 -0
- package/README.md +7 -21
- package/dist/components/button/Button.vue.d.ts +11 -5
- package/dist/components/floating-layer/FloatingLayer.types.d.ts +18 -0
- package/dist/components/floating-layer/FloatingLayer.vue.d.ts +30 -0
- package/dist/components/floating-layer/index.d.ts +2 -0
- package/dist/components/icon/Icon.types.d.ts +1 -0
- package/dist/components/icon/Icon.vue.d.ts +8 -4
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/icon/warnIfNotAllowed.d.ts +2 -0
- package/dist/components/tooltip/Tooltip.types.d.ts +9 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +26 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/constants/iconOptions.d.ts +12 -10
- package/dist/constants/zIndex.d.ts +4 -0
- package/dist/icons.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +2274 -66
- package/dist/tailwind-preset.d.ts +2 -0
- package/dist/tailwind-preset.mjs +86 -11
- package/package.json +3 -8
- package/dist/icons-DedUTX68.js +0 -6
- package/dist/tailwind-tokens.d.ts +0 -4
- package/dist/tailwind-tokens.mjs +0 -87
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @neuralytics/alpine-ds
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- afbad30: Add AlpineTooltip component: hover/focus-triggered tooltip built on the internal FloatingLayer primitive, with placement, openDelay and isDisabled props.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 4dcf040: Add internal FloatingLayer positioning primitive (Teleport + floating-ui/dom, with an optional arrow slot and configurable z-index) used to build upcoming floating components — no public API change.
|
|
12
|
+
- 9d5a342: Add tooltip and tooltip-position props to AlpineIcon, and disabled-tooltip and tooltip-position props to AlpineButton, built on the AlpineTooltip component.
|
|
13
|
+
|
|
14
|
+
## 0.4.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 498adb8: AlpineIcon and AlpineButton's `icon` prop now uses Iconify names (e.g. `mdi:home`) instead of Tailwind CSS classes, rendered via `@iconify/vue`. Icons are limited to the `mdi` and `line-md` collections.
|
|
19
|
+
- 498adb8: Merged `tailwind-tokens` into `tailwind-preset`: the `@neuralytics/alpine-ds/tailwind-tokens` entrypoint is removed. Import `content`/`theme` from `@neuralytics/alpine-ds/tailwind-preset` instead — it now exports them as named exports alongside the default preset. This was only kept separate to let consumers opt out of the icon plugin's memory usage, which no longer applies now that icons render via `@iconify/vue`.
|
|
20
|
+
|
|
3
21
|
## 0.3.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ export default defineConfig({
|
|
|
45
45
|
@config "./tailwind.config.ts";
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
5. Configure Tailwind (`tailwind.config.ts`) using the design system's preset, which already handles detection of the package's classes
|
|
48
|
+
5. Configure Tailwind (`tailwind.config.ts`) using the design system's preset, which already handles detection of the package's classes:
|
|
49
49
|
|
|
50
50
|
```ts
|
|
51
51
|
import type { Config } from "tailwindcss"
|
|
@@ -59,26 +59,6 @@ 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
|
-
|
|
82
62
|
6. Set the accent color in your project's `main.ts`:
|
|
83
63
|
|
|
84
64
|
```js
|
|
@@ -120,3 +100,9 @@ These are the only colors available: any other Tailwind color utility (e.g. `bg-
|
|
|
120
100
|
|
|
121
101
|
Note that all colors use 10 shades: `50`, `100`, `200`, ..., `900`.
|
|
122
102
|
`accent` must be provided by the consumer via `setAccentColorTheme` (see step 6 of [Integration](#integration)); the other colors already have a default value.
|
|
103
|
+
|
|
104
|
+
## Icons
|
|
105
|
+
|
|
106
|
+
`AlpineIcon` and `AlpineButton`'s `icon` prop accept [Iconify](https://iconify.design/) names from two collections only: `mdi:*` ([Material Design Icons](https://icon-sets.iconify.design/mdi/)) and `line-md:*` ([Material Line Icons](https://icon-sets.iconify.design/line-md/)). Any other collection logs a console warning and won't render.
|
|
107
|
+
|
|
108
|
+
Icons are fetched on demand from the Iconify API and cached — no bundling or extra Tailwind configuration needed for icons.
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
+
import { IconName } from '../icon';
|
|
2
|
+
import { TooltipPlacement } from '../tooltip/Tooltip.types';
|
|
1
3
|
import { ButtonDesign as ButtonDesignType, ButtonIconPosition as ButtonIconPositionType, ButtonType as ButtonTypeType } from './Button.types';
|
|
2
4
|
export interface ButtonProps {
|
|
3
5
|
label?: string | null;
|
|
4
|
-
icon?:
|
|
6
|
+
icon?: IconName | null;
|
|
5
7
|
design?: ButtonDesignType;
|
|
6
8
|
isLoading?: boolean;
|
|
7
9
|
isDisabled?: boolean;
|
|
8
10
|
isDanger?: boolean;
|
|
9
11
|
iconPosition?: ButtonIconPositionType;
|
|
10
12
|
type?: ButtonTypeType;
|
|
13
|
+
disabledTooltip?: string;
|
|
14
|
+
tooltipPosition?: TooltipPlacement;
|
|
11
15
|
}
|
|
12
16
|
declare const _default: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
|
|
13
|
-
icon: string | null;
|
|
14
|
-
isLoading: boolean;
|
|
15
17
|
type: ButtonTypeType;
|
|
18
|
+
isDisabled: boolean;
|
|
19
|
+
icon: IconName | null;
|
|
20
|
+
isLoading: boolean;
|
|
21
|
+
tooltipPosition: TooltipPlacement;
|
|
16
22
|
design: ButtonDesignType;
|
|
17
23
|
isDanger: boolean;
|
|
18
|
-
isDisabled: boolean;
|
|
19
24
|
iconPosition: ButtonIconPositionType;
|
|
20
|
-
|
|
25
|
+
disabledTooltip: string;
|
|
26
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
27
|
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VirtualElement } from '@floating-ui/dom';
|
|
2
|
+
export declare const Placement: {
|
|
3
|
+
readonly Top: "top";
|
|
4
|
+
readonly Right: "right";
|
|
5
|
+
readonly Bottom: "bottom";
|
|
6
|
+
readonly Left: "left";
|
|
7
|
+
};
|
|
8
|
+
export type FloatingLayerPlacement = typeof Placement[keyof typeof Placement];
|
|
9
|
+
export declare const floatingLayerPlacements: ("left" | "right" | "top" | "bottom")[];
|
|
10
|
+
export interface FloatingLayerProps {
|
|
11
|
+
referenceElement: HTMLElement | VirtualElement | null;
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
placement?: FloatingLayerPlacement;
|
|
14
|
+
zIndex?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface FloatingLayerSlotProps {
|
|
17
|
+
placement: FloatingLayerPlacement;
|
|
18
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FloatingLayerPlacement, FloatingLayerProps } from './FloatingLayer.types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {
|
|
6
|
+
placement: FloatingLayerPlacement;
|
|
7
|
+
}): any;
|
|
8
|
+
arrow?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {
|
|
11
|
+
floatingElement: HTMLDivElement;
|
|
12
|
+
arrowElement: HTMLDivElement;
|
|
13
|
+
};
|
|
14
|
+
rootEl: any;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
+
declare const __VLS_component: import('vue').DefineComponent<FloatingLayerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FloatingLayerProps> & Readonly<{}>, {
|
|
18
|
+
placement: FloatingLayerPlacement;
|
|
19
|
+
zIndex: number;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
21
|
+
floatingElement: HTMLDivElement;
|
|
22
|
+
arrowElement: HTMLDivElement;
|
|
23
|
+
}, any>;
|
|
24
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TooltipPlacement } from '../tooltip/Tooltip.types';
|
|
2
|
+
import { IconName, IconSize as IconSizeType } from './Icon.types';
|
|
2
3
|
export interface IconProps {
|
|
3
|
-
icon:
|
|
4
|
-
hoverIcon?:
|
|
4
|
+
icon: IconName;
|
|
5
|
+
hoverIcon?: IconName;
|
|
5
6
|
size?: IconSizeType;
|
|
6
7
|
isLoading?: boolean;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
tooltipPosition?: TooltipPlacement;
|
|
7
10
|
}
|
|
8
11
|
declare const _default: import('vue').DefineComponent<IconProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IconProps> & Readonly<{}>, {
|
|
9
12
|
size: IconSizeType;
|
|
10
13
|
isLoading: boolean;
|
|
11
|
-
|
|
14
|
+
tooltipPosition: TooltipPlacement;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
16
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type IconSize, iconSizes } from './Icon.types';
|
|
1
|
+
export { type IconName, type IconSize, iconSizes } from './Icon.types';
|
|
2
2
|
export { default as AlpineIcon, type IconProps as AlpineIconProps, } from './Icon.vue';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FloatingLayerPlacement, Placement } from '../floating-layer/FloatingLayer.types';
|
|
2
|
+
export type { FloatingLayerPlacement as TooltipPlacement };
|
|
3
|
+
export { Placement };
|
|
4
|
+
export interface TooltipProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
placement?: FloatingLayerPlacement;
|
|
7
|
+
openDelay?: number;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TooltipProps } from './Tooltip.types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {
|
|
8
|
+
triggerWrapper: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
rootEl: any;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<TooltipProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TooltipProps> & Readonly<{}>, {
|
|
14
|
+
placement: import('./Tooltip.types').TooltipPlacement;
|
|
15
|
+
openDelay: number;
|
|
16
|
+
isDisabled: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
18
|
+
triggerWrapper: HTMLDivElement;
|
|
19
|
+
}, any>;
|
|
20
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
export declare const iconMap: {
|
|
2
|
-
readonly home: "
|
|
3
|
-
readonly account: "
|
|
4
|
-
readonly bell: "
|
|
5
|
-
readonly cog: "
|
|
6
|
-
readonly email: "
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
2
|
+
readonly home: "mdi:home";
|
|
3
|
+
readonly account: "mdi:account";
|
|
4
|
+
readonly bell: "mdi:bell";
|
|
5
|
+
readonly cog: "mdi:cog";
|
|
6
|
+
readonly email: "mdi:email";
|
|
7
|
+
readonly eyeClosed: "mdi:eye-off";
|
|
8
|
+
readonly eyeOpen: "mdi:eye";
|
|
9
|
+
readonly file: "mdi:file";
|
|
10
|
+
readonly folder: "mdi:folder";
|
|
11
|
+
readonly gear: "mdi:gear";
|
|
12
|
+
readonly heart: "mdi:heart";
|
|
11
13
|
};
|
|
12
14
|
export declare const iconOptions: {
|
|
13
15
|
label: string;
|
|
14
|
-
value: "
|
|
16
|
+
value: "mdi:home" | "mdi:account" | "mdi:bell" | "mdi:cog" | "mdi:email" | "mdi:eye-off" | "mdi:eye" | "mdi:file" | "mdi:folder" | "mdi:gear" | "mdi:heart";
|
|
15
17
|
}[];
|
package/dist/icons.d.ts
CHANGED
package/dist/index.d.ts
CHANGED