@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 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 and the icon plugin:
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?: string | null;
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
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
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
+ };
@@ -0,0 +1,2 @@
1
+ export type { FloatingLayerPlacement, FloatingLayerProps, FloatingLayerSlotProps, } from './FloatingLayer.types';
2
+ export { default as FloatingLayer } from './FloatingLayer.vue';
@@ -1,2 +1,3 @@
1
1
  export declare const iconSizes: readonly ["xs", "sm", "md", "lg", "xl", "2xl"];
2
2
  export type IconSize = typeof iconSizes[number];
3
+ export type IconName = `mdi:${string}` | `line-md:${string}`;
@@ -1,12 +1,16 @@
1
- import { IconSize as IconSizeType } from './Icon.types';
1
+ import { TooltipPlacement } from '../tooltip/Tooltip.types';
2
+ import { IconName, IconSize as IconSizeType } from './Icon.types';
2
3
  export interface IconProps {
3
- icon: string;
4
- hoverIcon?: string;
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
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
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,2 @@
1
+ import { IconName } from './Icon.types';
2
+ export declare function warnIfNotAllowed(icons: (IconName | undefined)[]): void;
@@ -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
+ };
@@ -0,0 +1,2 @@
1
+ export type { TooltipProps as AlpineTooltipProps, TooltipPlacement } from './Tooltip.types';
2
+ export { default as AlpineTooltip } from './Tooltip.vue';
@@ -1,15 +1,17 @@
1
1
  export declare const iconMap: {
2
- readonly home: "i-mdi-home";
3
- readonly account: "i-mdi-account";
4
- readonly bell: "i-mdi-bell";
5
- readonly cog: "i-mdi-cog";
6
- readonly email: "i-mdi-email";
7
- readonly file: "i-mdi-file";
8
- readonly folder: "i-mdi-folder";
9
- readonly gear: "i-mdi-gear";
10
- readonly heart: "i-mdi-heart";
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: "i-mdi-home" | "i-mdi-account" | "i-mdi-bell" | "i-mdi-cog" | "i-mdi-email" | "i-mdi-file" | "i-mdi-folder" | "i-mdi-gear" | "i-mdi-heart";
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
  }[];
@@ -0,0 +1,4 @@
1
+ export declare const Z_INDEX: {
2
+ readonly default: 1000;
3
+ readonly tooltip: 5000;
4
+ };
package/dist/icons.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const ICONS: {
2
- readonly loader: "i-line-md-loading-twotone-loop";
2
+ readonly loader: "line-md:loading-twotone-loop";
3
3
  };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './components/button';
2
2
  export * from './components/icon';
3
+ export * from './components/tooltip';
3
4
  export * from './utils/colors';