dirdoc-ui 1.0.1 → 1.0.2

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/dist/index.cjs.js CHANGED
@@ -38,8 +38,8 @@ var DButton = vue.defineComponent({
38
38
  const base = 'flex items-center justify-center py-2 px-3 rounded-xl focus:outline-none';
39
39
  const icon = 'flex items-center justify-center w-10 h-10 rounded-full ';
40
40
  const variants = {
41
- primary: 'text-white bg-blue-900 hover:bg-blue-950',
42
- secondary: 'bg-gray-200 text-gray-800 hover:bg-gray-300',
41
+ primary: 'bg-blue-900 hover:bg-blue-950',
42
+ secondary: 'bg-gray-200 hover:bg-gray-300',
43
43
  };
44
44
  function onClick(e) {
45
45
  if (props.disabled)
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/components/DButton/DButton.tsx","../src/components/DSkeleton/DSkeletonLoader.tsx","../src/index.ts"],"sourcesContent":["import { defineComponent, h, PropType, SetupContext, VNode } from 'vue'\n\nexport interface UseLink {\n navigate: () => void | null\n}\nexport default defineComponent({\n name: 'DButton',\n props: {\n label: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n url: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n type: {\n type: String as PropType<'button' | 'submit' | 'reset'>,\n default: 'button'\n },\n variant: {\n type: String as PropType<'primary' | 'secondary'>,\n default: 'primary'\n },\n disabled: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n icon: {\n type: [String, Object, Function] as PropType<string | object | (() => VNode) | VNode | null>,\n default: null\n },\n },\n emits: ['click'],\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots, emit } = ctx\n const base = 'flex items-center justify-center py-2 px-3 rounded-xl focus:outline-none'\n const icon = 'flex items-center justify-center w-10 h-10 rounded-full '\n const variants: Record<string, string> = {\n primary: 'text-white bg-blue-900 hover:bg-blue-950',\n secondary: 'bg-gray-200 text-gray-800 hover:bg-gray-300',\n }\n\n function onClick(e: MouseEvent) {\n if (props.disabled) return\n emit('click', e)\n }\n\n return (): VNode => {\n const children = slots.default ? slots.default() : props.label\n if (props.icon) {\n return h(\n props.url ? 'a' : 'button',\n {\n type: props.type,\n class: `${icon} ${variants[props.variant]} ${props.disabled ? '' : ''} focus:outline-none`,\n disabled: props.disabled,\n href: props.url,\n onClick,\n },\n [\n typeof props.icon === 'string' ? h('i', { class: props.icon + ' mdi' }, ) : h(props.icon),\n children\n ]\n )\n }\n \n return h(\n props.url ? 'a' : 'button',\n {\n type: props.type,\n class: `${base} ${variants[props.variant]} ${props.disabled ? 'opacity-50' : ''}`,\n disabled: props.disabled,\n onClick\n },\n children\n )\n }\n }\n})\n","import { defineComponent, PropType, h, SetupContext, VNode } from 'vue'\nexport default defineComponent({\n name: 'DSkeletonLoader',\n props: {\n animation: {\n type: String as PropType<'pulse' | 'wave'>, \n default: 'pulse'\n },\n type: {\n type: String as PropType<'text' | 'circle' | 'avatar'>,\n default: 'text'\n }\n },\n \n\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots } = ctx\n\n const base = 'bg-gray-100 dark:bg-gray-200'\n const animations: Record<string, string> = {\n pulse: 'animate-pulse',\n wave: 'animate-wave'\n }\n const types: Record<string, string> = {\n text: 'rounded-full w-full p-2',\n circle: 'rounded-full',\n avatar: 'rounded-full w-10 h-10 ',\n }\n const children = slots.default ? slots.default() : props.label\n\n return (): VNode => {\n return h(\n children ? 'div' :\n 'div',\n {\n class: `${animations[props.animation]} `,\n },\n [\n h('div', { class: ` ${base} ${types[props.type]}` }),\n ],\n \n \n )\n }\n}\n\n})\n","export * from './components/DButton'\nexport * from './components/DSkeleton'\nexport interface UIOptions {\n components?: Record<string, any>\n}\n\nexport function createDirdocUI( options: UIOptions = {}) {\n const { components = {} } = options\n\n return {\n install(app: any) {\n for (const key in components) {\n app.component(key, components[key])\n }\n }\n }\n}"],"names":["defineComponent","h"],"mappings":";;;;AAKA,cAAeA,mBAAe,CAAC;AAC7B,IAAA,IAAI,EAAE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
+ {"version":3,"file":"index.cjs.js","sources":["../src/components/DButton/DButton.tsx","../src/components/DSkeleton/DSkeletonLoader.tsx","../src/index.ts"],"sourcesContent":["import { defineComponent, h, PropType, SetupContext, VNode } from 'vue'\n\nexport interface UseLink {\n navigate: () => void | null\n}\nexport default defineComponent({\n name: 'DButton',\n props: {\n label: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n url: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n type: {\n type: String as PropType<'button' | 'submit' | 'reset'>,\n default: 'button'\n },\n variant: {\n type: String as PropType<'primary' | 'secondary'>,\n default: 'primary'\n },\n disabled: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n icon: {\n type: [String, Object, Function] as PropType<string | object | (() => VNode) | VNode | null>,\n default: null\n },\n },\n emits: ['click'],\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots, emit } = ctx\n const base = 'flex items-center justify-center py-2 px-3 rounded-xl focus:outline-none'\n const icon = 'flex items-center justify-center w-10 h-10 rounded-full '\n const variants: Record<string, string> = {\n primary: 'bg-blue-900 hover:bg-blue-950',\n secondary: 'bg-gray-200 hover:bg-gray-300',\n }\n\n function onClick(e: MouseEvent) {\n if (props.disabled) return\n emit('click', e)\n }\n\n return (): VNode => {\n const children = slots.default ? slots.default() : props.label\n if (props.icon) {\n return h(\n props.url ? 'a' : 'button',\n {\n type: props.type,\n class: `${icon} ${variants[props.variant]} ${props.disabled ? '' : ''} focus:outline-none`,\n disabled: props.disabled,\n href: props.url,\n onClick,\n },\n [\n typeof props.icon === 'string' ? h('i', { class: props.icon + ' mdi' }, ) : h(props.icon),\n children\n ]\n )\n }\n \n return h(\n props.url ? 'a' : 'button',\n {\n type: props.type,\n class: `${base} ${variants[props.variant]} ${props.disabled ? 'opacity-50' : ''}`,\n disabled: props.disabled,\n onClick\n },\n children\n )\n }\n }\n})\n","import { defineComponent, PropType, h, SetupContext, VNode } from 'vue'\nexport default defineComponent({\n name: 'DSkeletonLoader',\n props: {\n animation: {\n type: String as PropType<'pulse' | 'wave'>, \n default: 'pulse'\n },\n type: {\n type: String as PropType<'text' | 'circle' | 'avatar'>,\n default: 'text'\n }\n },\n \n\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots } = ctx\n\n const base = 'bg-gray-100 dark:bg-gray-200'\n const animations: Record<string, string> = {\n pulse: 'animate-pulse',\n wave: 'animate-wave'\n }\n const types: Record<string, string> = {\n text: 'rounded-full w-full p-2',\n circle: 'rounded-full',\n avatar: 'rounded-full w-10 h-10 ',\n }\n const children = slots.default ? slots.default() : props.label\n\n return (): VNode => {\n return h(\n children ? 'div' :\n 'div',\n {\n class: `${animations[props.animation]} `,\n },\n [\n h('div', { class: ` ${base} ${types[props.type]}` }),\n ],\n \n \n )\n }\n}\n\n})\n","export * from './components/DButton'\nexport * from './components/DSkeleton'\nexport interface UIOptions {\n components?: Record<string, any>\n}\n\nexport function createDirdocUI( options: UIOptions = {}) {\n const { components = {} } = options\n\n return {\n install(app: any) {\n for (const key in components) {\n app.component(key, components[key])\n }\n }\n }\n}"],"names":["defineComponent","h"],"mappings":";;;;AAKA,cAAeA,mBAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,KAAK,EAAE;AACL,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,GAAG,EAAE;AACH,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,MAAiD;AACvD,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,MAA2C;AACjD,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,OAA4B;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AAG,KAAK,CAAC,KAAK;AAE9D,QAAA,OAAO,MAAY;YACjB,OAAOC,KAAC,CACN,QAAQ,GAAG,KAAK;AAChB,gBAAA,KAAK,EACL;gBACE,KAAK,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA,CAAA,CAAG;aACzC,EACD;AACE,gBAAAA,KAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,EAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA,CAAE,EAAE,CAAC;AACrD,aAAA,CAGF;AACH,QAAA,CAAC;IACL;AAEC,CAAA,CAAC;;ACxCI,SAAU,cAAc,CAAE,OAAA,GAAqB,EAAE,EAAA;AACnD,IAAA,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,OAAO;IAEnC,OAAO;AACH,QAAA,OAAO,CAAC,GAAQ,EAAA;AACZ,YAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;gBAC1B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACvC;QACJ;KACH;AACL;;;;;;"}
package/dist/index.esm.js CHANGED
@@ -36,8 +36,8 @@ var DButton = defineComponent({
36
36
  const base = 'flex items-center justify-center py-2 px-3 rounded-xl focus:outline-none';
37
37
  const icon = 'flex items-center justify-center w-10 h-10 rounded-full ';
38
38
  const variants = {
39
- primary: 'text-white bg-blue-900 hover:bg-blue-950',
40
- secondary: 'bg-gray-200 text-gray-800 hover:bg-gray-300',
39
+ primary: 'bg-blue-900 hover:bg-blue-950',
40
+ secondary: 'bg-gray-200 hover:bg-gray-300',
41
41
  };
42
42
  function onClick(e) {
43
43
  if (props.disabled)
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/components/DButton/DButton.tsx","../src/components/DSkeleton/DSkeletonLoader.tsx","../src/index.ts"],"sourcesContent":["import { defineComponent, h, PropType, SetupContext, VNode } from 'vue'\n\nexport interface UseLink {\n navigate: () => void | null\n}\nexport default defineComponent({\n name: 'DButton',\n props: {\n label: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n url: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n type: {\n type: String as PropType<'button' | 'submit' | 'reset'>,\n default: 'button'\n },\n variant: {\n type: String as PropType<'primary' | 'secondary'>,\n default: 'primary'\n },\n disabled: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n icon: {\n type: [String, Object, Function] as PropType<string | object | (() => VNode) | VNode | null>,\n default: null\n },\n },\n emits: ['click'],\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots, emit } = ctx\n const base = 'flex items-center justify-center py-2 px-3 rounded-xl focus:outline-none'\n const icon = 'flex items-center justify-center w-10 h-10 rounded-full '\n const variants: Record<string, string> = {\n primary: 'text-white bg-blue-900 hover:bg-blue-950',\n secondary: 'bg-gray-200 text-gray-800 hover:bg-gray-300',\n }\n\n function onClick(e: MouseEvent) {\n if (props.disabled) return\n emit('click', e)\n }\n\n return (): VNode => {\n const children = slots.default ? slots.default() : props.label\n if (props.icon) {\n return h(\n props.url ? 'a' : 'button',\n {\n type: props.type,\n class: `${icon} ${variants[props.variant]} ${props.disabled ? '' : ''} focus:outline-none`,\n disabled: props.disabled,\n href: props.url,\n onClick,\n },\n [\n typeof props.icon === 'string' ? h('i', { class: props.icon + ' mdi' }, ) : h(props.icon),\n children\n ]\n )\n }\n \n return h(\n props.url ? 'a' : 'button',\n {\n type: props.type,\n class: `${base} ${variants[props.variant]} ${props.disabled ? 'opacity-50' : ''}`,\n disabled: props.disabled,\n onClick\n },\n children\n )\n }\n }\n})\n","import { defineComponent, PropType, h, SetupContext, VNode } from 'vue'\nexport default defineComponent({\n name: 'DSkeletonLoader',\n props: {\n animation: {\n type: String as PropType<'pulse' | 'wave'>, \n default: 'pulse'\n },\n type: {\n type: String as PropType<'text' | 'circle' | 'avatar'>,\n default: 'text'\n }\n },\n \n\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots } = ctx\n\n const base = 'bg-gray-100 dark:bg-gray-200'\n const animations: Record<string, string> = {\n pulse: 'animate-pulse',\n wave: 'animate-wave'\n }\n const types: Record<string, string> = {\n text: 'rounded-full w-full p-2',\n circle: 'rounded-full',\n avatar: 'rounded-full w-10 h-10 ',\n }\n const children = slots.default ? slots.default() : props.label\n\n return (): VNode => {\n return h(\n children ? 'div' :\n 'div',\n {\n class: `${animations[props.animation]} `,\n },\n [\n h('div', { class: ` ${base} ${types[props.type]}` }),\n ],\n \n \n )\n }\n}\n\n})\n","export * from './components/DButton'\nexport * from './components/DSkeleton'\nexport interface UIOptions {\n components?: Record<string, any>\n}\n\nexport function createDirdocUI( options: UIOptions = {}) {\n const { components = {} } = options\n\n return {\n install(app: any) {\n for (const key in components) {\n app.component(key, components[key])\n }\n }\n }\n}"],"names":[],"mappings":";;AAKA,cAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,KAAK,EAAE;AACL,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,GAAG,EAAE;AACH,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,MAAiD;AACvD,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,MAA2C;AACjD,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,OAA4B;AAClC,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAA6D;AAC5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AAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA,CAAA,CAAG;aACzC,EACD;AACE,gBAAA,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,EAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA,CAAE,EAAE,CAAC;AACrD,aAAA,CAGF;AACH,QAAA,CAAC;IACL;AAEC,CAAA,CAAC;;ACxCI,SAAU,cAAc,CAAE,OAAA,GAAqB,EAAE,EAAA;AACnD,IAAA,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,OAAO;IAEnC,OAAO;AACH,QAAA,OAAO,CAAC,GAAQ,EAAA;AACZ,YAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;gBAC1B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACvC;QACJ;KACH;AACL;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/components/DButton/DButton.tsx","../src/components/DSkeleton/DSkeletonLoader.tsx","../src/index.ts"],"sourcesContent":["import { defineComponent, h, PropType, SetupContext, VNode } from 'vue'\n\nexport interface UseLink {\n navigate: () => void | null\n}\nexport default defineComponent({\n name: 'DButton',\n props: {\n label: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n url: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n type: {\n type: String as PropType<'button' | 'submit' | 'reset'>,\n default: 'button'\n },\n variant: {\n type: String as PropType<'primary' | 'secondary'>,\n default: 'primary'\n },\n disabled: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n icon: {\n type: [String, Object, Function] as PropType<string | object | (() => VNode) | VNode | null>,\n default: null\n },\n },\n emits: ['click'],\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots, emit } = ctx\n const base = 'flex items-center justify-center py-2 px-3 rounded-xl focus:outline-none'\n const icon = 'flex items-center justify-center w-10 h-10 rounded-full '\n const variants: Record<string, string> = {\n primary: 'bg-blue-900 hover:bg-blue-950',\n secondary: 'bg-gray-200 hover:bg-gray-300',\n }\n\n function onClick(e: MouseEvent) {\n if (props.disabled) return\n emit('click', e)\n }\n\n return (): VNode => {\n const children = slots.default ? slots.default() : props.label\n if (props.icon) {\n return h(\n props.url ? 'a' : 'button',\n {\n type: props.type,\n class: `${icon} ${variants[props.variant]} ${props.disabled ? '' : ''} focus:outline-none`,\n disabled: props.disabled,\n href: props.url,\n onClick,\n },\n [\n typeof props.icon === 'string' ? h('i', { class: props.icon + ' mdi' }, ) : h(props.icon),\n children\n ]\n )\n }\n \n return h(\n props.url ? 'a' : 'button',\n {\n type: props.type,\n class: `${base} ${variants[props.variant]} ${props.disabled ? 'opacity-50' : ''}`,\n disabled: props.disabled,\n onClick\n },\n children\n )\n }\n }\n})\n","import { defineComponent, PropType, h, SetupContext, VNode } from 'vue'\nexport default defineComponent({\n name: 'DSkeletonLoader',\n props: {\n animation: {\n type: String as PropType<'pulse' | 'wave'>, \n default: 'pulse'\n },\n type: {\n type: String as PropType<'text' | 'circle' | 'avatar'>,\n default: 'text'\n }\n },\n \n\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots } = ctx\n\n const base = 'bg-gray-100 dark:bg-gray-200'\n const animations: Record<string, string> = {\n pulse: 'animate-pulse',\n wave: 'animate-wave'\n }\n const types: Record<string, string> = {\n text: 'rounded-full w-full p-2',\n circle: 'rounded-full',\n avatar: 'rounded-full w-10 h-10 ',\n }\n const children = slots.default ? slots.default() : props.label\n\n return (): VNode => {\n return h(\n children ? 'div' :\n 'div',\n {\n class: `${animations[props.animation]} `,\n },\n [\n h('div', { class: ` ${base} ${types[props.type]}` }),\n ],\n \n \n )\n }\n}\n\n})\n","export * from './components/DButton'\nexport * from './components/DSkeleton'\nexport interface UIOptions {\n components?: Record<string, any>\n}\n\nexport function createDirdocUI( options: UIOptions = {}) {\n const { components = {} } = options\n\n return {\n install(app: any) {\n for (const key in components) {\n app.component(key, components[key])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G,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACvC;QACJ;KACH;AACL;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirdoc-ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",