@neuralytics/alpine-ds 0.4.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @neuralytics/alpine-ds
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - df0d828: Add theme.css, a native Tailwind v4 CSS theme (deprecates the JS preset, which remains supported).
8
+
9
+ ## 0.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - afbad30: Add AlpineTooltip component: hover/focus-triggered tooltip built on the internal FloatingLayer primitive, with placement, openDelay and isDisabled props.
14
+
15
+ ### Patch Changes
16
+
17
+ - 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.
18
+ - 9d5a342: Add tooltip and tooltip-position props to AlpineIcon, and disabled-tooltip and tooltip-position props to AlpineButton, built on the AlpineTooltip component.
19
+
3
20
  ## 0.4.0
4
21
 
5
22
  ### Minor Changes
package/README.md CHANGED
@@ -38,28 +38,28 @@ export default defineConfig({
38
38
  })
39
39
  ```
40
40
 
41
- 4. Import the Tailwind configuration in your main style file. The path in `@config` is relative to this CSS file — adjust it if your `tailwind.config.ts` isn't next to it (e.g. `../tailwind.config.ts` if your CSS lives in `src/` and the config is at your project root):
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
- @config "./tailwind.config.ts";
47
+ @import "@neuralytics/alpine-ds/theme.css";
46
48
  ```
47
49
 
48
- 5. Configure Tailwind (`tailwind.config.ts`) using the design system's preset, which already handles detection of the package's classes:
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
- ```ts
51
- import type { Config } from "tailwindcss"
52
- import alpineDsPreset from "@neuralytics/alpine-ds/tailwind-preset"
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
- 6. Set the accent color in your project's `main.ts`:
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
- 7. (Optional) Set the text color of the primary `AlpineButton` if `white` doesn't fit your accent color:
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
- 8. Import a component in a `.vue` file
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 6 of [Integration](#integration)); the other colors already have a default value.
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,4 +1,5 @@
1
1
  import { IconName } from '../icon';
2
+ import { TooltipPlacement } from '../tooltip/Tooltip.types';
2
3
  import { ButtonDesign as ButtonDesignType, ButtonIconPosition as ButtonIconPositionType, ButtonType as ButtonTypeType } from './Button.types';
3
4
  export interface ButtonProps {
4
5
  label?: string | null;
@@ -9,14 +10,18 @@ export interface ButtonProps {
9
10
  isDanger?: boolean;
10
11
  iconPosition?: ButtonIconPositionType;
11
12
  type?: ButtonTypeType;
13
+ disabledTooltip?: string;
14
+ tooltipPosition?: TooltipPlacement;
12
15
  }
13
16
  declare const _default: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
17
+ type: ButtonTypeType;
18
+ isDisabled: boolean;
14
19
  icon: IconName | null;
15
20
  isLoading: boolean;
16
- type: ButtonTypeType;
21
+ tooltipPosition: TooltipPlacement;
17
22
  design: ButtonDesignType;
18
23
  isDanger: boolean;
19
- isDisabled: boolean;
20
24
  iconPosition: ButtonIconPositionType;
21
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
25
+ disabledTooltip: string;
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
22
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,12 +1,16 @@
1
+ import { TooltipPlacement } from '../tooltip/Tooltip.types';
1
2
  import { IconName, IconSize as IconSizeType } from './Icon.types';
2
3
  export interface IconProps {
3
4
  icon: IconName;
4
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;
14
+ tooltipPosition: TooltipPlacement;
11
15
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
16
  export default _default;
@@ -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';
@@ -4,6 +4,8 @@ export declare const iconMap: {
4
4
  readonly bell: "mdi:bell";
5
5
  readonly cog: "mdi:cog";
6
6
  readonly email: "mdi:email";
7
+ readonly eyeClosed: "mdi:eye-off";
8
+ readonly eyeOpen: "mdi:eye";
7
9
  readonly file: "mdi:file";
8
10
  readonly folder: "mdi:folder";
9
11
  readonly gear: "mdi:gear";
@@ -11,5 +13,5 @@ export declare const iconMap: {
11
13
  };
12
14
  export declare const iconOptions: {
13
15
  label: string;
14
- value: "mdi:home" | "mdi:account" | "mdi:bell" | "mdi:cog" | "mdi:email" | "mdi:file" | "mdi:folder" | "mdi:gear" | "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/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';