@mdocify/components 0.0.1 → 0.0.3

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/README.md CHANGED
@@ -33,4 +33,4 @@ All commands are run from the root of the project, from a terminal:
33
33
  | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
34
34
  | `npm link` | Registers this package locally. Run `npm link my-component-library` in an Astro project to install your components |
35
35
  | `npm publish` | [Publishes](https://docs.npmjs.com/creating-and-publishing-unscoped-public-packages#publishing-unscoped-public-packages) this package to NPM. Requires you to be [logged in](https://docs.npmjs.com/cli/v8/commands/npm-adduser) |
36
- # mdocify-components
36
+ # mdocify-components
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- declare module '*.astro' {
2
- import type { ComponentType } from 'astro'
3
- const Component: ComponentType<Record<string, unknown>>
4
- export { ComponentType }
5
- export default Component
6
- }
1
+ declare module '*.astro' {
2
+ import type { ComponentType } from 'astro'
3
+ const Component: ComponentType<Record<string, unknown>>
4
+ export { ComponentType }
5
+ export default Component
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdocify/components",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "exports": {
@@ -36,8 +36,7 @@
36
36
  "astro": "^4.0.0 || ^5.0.0",
37
37
  "@lucide/astro": "^0.562.0"
38
38
  },
39
- "dependencies": {
40
- },
39
+ "dependencies": {},
41
40
  "author": "Lazaro Osee <oseelazaro@gmail.com> (https://www.lazaroosee.xyz)",
42
41
  "license": "MIT",
43
42
  "repository": {
package/src/callout.astro CHANGED
@@ -1,39 +1,39 @@
1
- ---
2
- import Icon from './icon.astro';
3
- import type { CalloutProps } from './types';
4
-
5
- interface Props extends CalloutProps {}
6
- const { title, type } = Astro.props;
7
-
8
- const icon = type === "danger" ? "triangle-alert" : type ==="success" ? "circle-check" : type === 'warning' ? 'circle-alert' : 'lightbulb'
9
- ---
10
-
11
- <div class:list={[
12
- 'block m-1 border border-spacing-1.5 overflow-hidden rounded-xl [corner-shape:squircle]',
13
- {'border-teal-700': type === 'tip'},
14
- {'border-orange-700': type === 'warning'},
15
- {'border-red-700': type === 'danger'},
16
- {'border-green-700': type === 'success'}
17
- ]}>
18
- <div class:list={[
19
- 'flex font-semibold p-2 gap-2 justify-start items-center text-white',
20
- {'bg-teal-500': type === 'tip'},
21
- {'bg-orange-500': type === 'warning'},
22
- {'bg-red-500': type === 'danger'},
23
- {'bg-green-500': type === 'success'}
24
- ]}>
25
- <slot name="icon">
26
- <Icon name={icon} class="w-8" />
27
- </slot>
28
- <slot name="title">{title}</slot>
29
- </div>
30
- <div class:list={[
31
- "block p-2",
32
- {'bg-teal-50': type === 'tip'},
33
- {'bg-orange-50': type === 'warning'},
34
- {'bg-red-50': type === 'danger'},
35
- {'bg-green-50': type === 'success'}
36
- ]}>
37
- <slot></slot>
38
- </div>
39
- </div>
1
+ ---
2
+ import Icon from './icon.astro';
3
+ import type { CalloutProps } from './types';
4
+
5
+ interface Props extends CalloutProps {}
6
+ const { title, type } = Astro.props;
7
+
8
+ const icon = type === "danger" ? "triangle-alert" : type ==="success" ? "circle-check" : type === 'warning' ? 'circle-alert' : 'lightbulb'
9
+ ---
10
+
11
+ <div class:list={[
12
+ 'not-prose block m-1 border border-spacing-1.5 overflow-hidden rounded-xl [corner-shape:squircle]',
13
+ {'border-teal-700!': type === 'tip'},
14
+ {'border-orange-700!': type === 'warning'},
15
+ {'border-red-700!': type === 'danger'},
16
+ {'border-green-700!': type === 'success'}
17
+ ]}>
18
+ <div class:list={[
19
+ 'not-prose flex font-semibold p-2 gap-2 justify-start items-center text-white',
20
+ {'bg-teal-500!': type === 'tip'},
21
+ {'bg-orange-500!': type === 'warning'},
22
+ {'bg-red-500!': type === 'danger'},
23
+ {'bg-green-500!': type === 'success'}
24
+ ]}>
25
+ <slot name="icon">
26
+ <Icon name={icon} class="w-8" />
27
+ </slot>
28
+ <slot name="title">{title}</slot>
29
+ </div>
30
+ <div class:list={[
31
+ "block p-2",
32
+ {'bg-teal-50': type === 'tip'},
33
+ {'bg-orange-50': type === 'warning'},
34
+ {'bg-red-50': type === 'danger'},
35
+ {'bg-green-50': type === 'success'}
36
+ ]}>
37
+ <slot></slot>
38
+ </div>
39
+ </div>
package/src/icon.astro CHANGED
@@ -1,16 +1,16 @@
1
- ---
2
- import type { HTMLAttributes } from 'astro/types';
3
- import { iconsList } from './icons';
4
- import type { IconProps } from './types';
5
-
6
- type Props = IconProps & Omit<HTMLAttributes<'svg'>, "color">;
7
- const { name, slot, ...rest } = Astro.props
8
-
9
- const LucideIcon = iconsList[name] as any;
10
- ---
11
-
12
- { (slot===undefined) ? (
13
- <LucideIcon {...rest} />
14
- ) : (
15
- <LucideIcon {slot} {...rest} />
16
- )}
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types';
3
+ import { iconsList } from './icons';
4
+ import type { IconProps } from './types';
5
+
6
+ type Props = IconProps & Omit<HTMLAttributes<'svg'>, "color">;
7
+ const { name, slot, ...rest } = Astro.props
8
+
9
+ const LucideIcon = iconsList[name] as any;
10
+ ---
11
+
12
+ { (slot===undefined) ? (
13
+ <LucideIcon {...rest} />
14
+ ) : (
15
+ <LucideIcon {slot} {...rest} />
16
+ )}
package/src/icons.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { CircleAlert, CircleCheck, Lightbulb, TriangleAlert } from '@lucide/astro/icons/index'
2
-
3
- export const iconsList = {
4
- lightbulb: Lightbulb,
5
- 'circle-check': CircleCheck,
6
- 'circle-alert': CircleAlert,
7
- 'triangle-alert': TriangleAlert,
8
- } as const
9
-
10
- export type IconType = keyof typeof iconsList
1
+ import { CircleAlert, CircleCheck, Lightbulb, TriangleAlert } from '@lucide/astro/icons/index'
2
+
3
+ export const iconsList = {
4
+ lightbulb: Lightbulb,
5
+ 'circle-check': CircleCheck,
6
+ 'circle-alert': CircleAlert,
7
+ 'triangle-alert': TriangleAlert,
8
+ } as const
9
+
10
+ export type IconType = keyof typeof iconsList
package/src/types.ts CHANGED
@@ -1,11 +1,11 @@
1
- import type { IconType } from './icons'
2
-
3
- export type CalloutProps = {
4
- title: string
5
- type: 'tip' | 'warning' | 'danger' | 'success'
6
- }
7
-
8
- export type IconProps = {
9
- name: IconType
10
- slot?: string
11
- }
1
+ import type { IconType } from './icons'
2
+
3
+ export type CalloutProps = {
4
+ title: string
5
+ type: 'tip' | 'warning' | 'danger' | 'success'
6
+ }
7
+
8
+ export type IconProps = {
9
+ name: IconType
10
+ slot?: string
11
+ }