@neuralytics/alpine-ds 0.3.0 → 0.4.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,12 @@
1
1
  # @neuralytics/alpine-ds
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 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.
8
+ - 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`.
9
+
3
10
  ## 0.3.0
4
11
 
5
12
  ### 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,7 +1,8 @@
1
+ import { IconName } from '../icon';
1
2
  import { ButtonDesign as ButtonDesignType, ButtonIconPosition as ButtonIconPositionType, ButtonType as ButtonTypeType } from './Button.types';
2
3
  export interface ButtonProps {
3
4
  label?: string | null;
4
- icon?: string | null;
5
+ icon?: IconName | null;
5
6
  design?: ButtonDesignType;
6
7
  isLoading?: boolean;
7
8
  isDisabled?: boolean;
@@ -10,7 +11,7 @@ export interface ButtonProps {
10
11
  type?: ButtonTypeType;
11
12
  }
12
13
  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
+ icon: IconName | null;
14
15
  isLoading: boolean;
15
16
  type: ButtonTypeType;
16
17
  design: ButtonDesignType;
@@ -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,12 @@
1
- import { IconSize as IconSizeType } from './Icon.types';
1
+ import { IconName, IconSize as IconSizeType } from './Icon.types';
2
2
  export interface IconProps {
3
- icon: string;
4
- hoverIcon?: string;
3
+ icon: IconName;
4
+ hoverIcon?: IconName;
5
5
  size?: IconSizeType;
6
6
  isLoading?: boolean;
7
7
  }
8
8
  declare const _default: import('vue').DefineComponent<IconProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IconProps> & Readonly<{}>, {
9
9
  size: IconSizeType;
10
10
  isLoading: boolean;
11
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
11
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
12
  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;
@@ -1,15 +1,15 @@
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 file: "mdi:file";
8
+ readonly folder: "mdi:folder";
9
+ readonly gear: "mdi:gear";
10
+ readonly heart: "mdi:heart";
11
11
  };
12
12
  export declare const iconOptions: {
13
13
  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";
14
+ value: "mdi:home" | "mdi:account" | "mdi:bell" | "mdi:cog" | "mdi:email" | "mdi:file" | "mdi:folder" | "mdi:gear" | "mdi:heart";
15
15
  }[];
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
  };