@gits-id/badge
Advanced tools
Comparing version 0.1.17-alpha.0 to 0.1.17-alpha.32
{ | ||
"name": "@gits-id/badge", | ||
"version": "0.1.17-alpha.0", | ||
"version": "0.1.17-alpha.32+4a1b6a4", | ||
"description": "GITS Badge Component", | ||
"main": "src/index.ts", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
@@ -20,6 +16,19 @@ "badge", | ||
"devDependencies": { | ||
"@gits-id/utils": "^0.1.17-alpha.0", | ||
"tailwindcss": "^3.0.23" | ||
"@gits-id/tailwind-config": "^0.1.17-alpha.32+4a1b6a4", | ||
"@gits-id/utils": "^0.1.17-alpha.32+4a1b6a4", | ||
"@vue/test-utils": "^2.0.0-rc.17", | ||
"tailwindcss": "^3.0.23", | ||
"vitest": "^0.7.10" | ||
}, | ||
"gitHead": "ef49408d6371355445fbb4012a9376e0d4416d30" | ||
} | ||
"main": "dist/badge.umd.js", | ||
"unpkg": "dist/badge.iife.js", | ||
"jsdelivr": "dist/badge.iife.js", | ||
"module": "./dist/badge.es.js", | ||
"types": "./dist/types/index.d.ts", | ||
"gitHead": "4a1b6a4a542fd8bd952d23549ac5389fe8917e38", | ||
"scripts": { | ||
"build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types", | ||
"test": "vitest" | ||
}, | ||
"readme": "# GITS Badge Component\n\n> Reusable Badge Component\n\n## Installation\n\nnpm\n\n```\nnpm i @gits-id/badge\n```\n\nyarn\n\n```\nyarn add @gits-id/badge\n```\n\npnpm\n\n```\npnpm i @gits-id/badge\n```\n\n## Usage\n\n```vue\n<script setup lang=\"ts\">\n// import styles\nimport '@gits-id/badge/dist/style.css';\n// import component\nimport Badge from '@gits-id/badge';\n</script>\n\n<template>\n <Badge color=\"primary\">Text</Badge>\n</template>\n```\n\n## Documentation\n\nView `Badge` documentation [here](https://gits-ui.web.app/?path=/story/components-badge--default).\n\n## Licence\n\nISC\n" | ||
} |
@@ -11,2 +11,4 @@ export type VBadgeProps = { | ||
class: string; | ||
dismissable: boolean; | ||
outlined: boolean; | ||
}; |
@@ -1,4 +0,4 @@ | ||
import MyBadge from './VBadge.vue'; | ||
import VBadge from './VBadge.vue'; | ||
import {themeColors} from '@gits-id/utils/colors'; | ||
import type {VBadgeProps} from './VBadge'; | ||
import type {VBadgeProps} from './types'; | ||
import {Story, Meta} from '@storybook/vue3'; | ||
@@ -8,3 +8,3 @@ | ||
title: 'Components/Badge', | ||
component: MyBadge, | ||
component: VBadge, | ||
argTypes: { | ||
@@ -16,5 +16,6 @@ color: { | ||
args: { | ||
label: 'Badge text', | ||
label: '', | ||
dismissable: false, | ||
icon: false, | ||
outlined: false, | ||
}, | ||
@@ -26,49 +27,22 @@ } as Meta; | ||
components: { | ||
'my-component': MyBadge, | ||
VBadge, | ||
}, | ||
// The story's `args` need to be mapped into the template through the `setup()` method | ||
setup() { | ||
return {args}; | ||
return {args, themeColors}; | ||
}, | ||
// And then the `args` are bound to your component with `v-bind="args"` | ||
template: `<my-component v-bind="args">{{ args.label }}</my-component>`, | ||
template: ` | ||
<div class="flex flex-row flex-wrap gap-2"> | ||
<VBadge v-for="color in themeColors" :key="color" v-bind="args" :color="color">{{ args.label || color }}</VBadge> | ||
</div> | ||
`, | ||
}); | ||
export const Default = Template.bind({}); | ||
Default.args = {}; | ||
export const Variants = Template.bind({}); | ||
Variants.args = {}; | ||
export const Primary = Template.bind({}); | ||
Primary.args = { | ||
color: 'primary', | ||
}; | ||
export const Secondary = Template.bind({}); | ||
Secondary.args = { | ||
color: 'secondary', | ||
}; | ||
export const Info = Template.bind({}); | ||
Info.args = { | ||
color: 'info', | ||
}; | ||
export const Warning = Template.bind({}); | ||
Warning.args = { | ||
color: 'warning', | ||
}; | ||
export const Success = Template.bind({}); | ||
Success.args = { | ||
color: 'success', | ||
}; | ||
export const Error = Template.bind({}); | ||
Error.args = { | ||
color: 'error', | ||
}; | ||
export const Rounded = Template.bind({}); | ||
Rounded.args = { | ||
rounded: true, | ||
color: 'success', | ||
}; | ||
@@ -80,3 +54,2 @@ | ||
label: 20, | ||
color: 'error', | ||
}; | ||
@@ -86,3 +59,2 @@ | ||
Large.args = { | ||
color: 'success', | ||
large: true, | ||
@@ -93,11 +65,40 @@ }; | ||
Small.args = { | ||
color: 'success', | ||
small: true, | ||
}; | ||
export const CustomColor = Template.bind({}); | ||
CustomColor.args = { | ||
bgColor: 'bg-white', | ||
textColor: 'text-info', | ||
class: 'border border-info', | ||
export const Dismissable = Template.bind({}); | ||
Dismissable.args = { | ||
dismissable: true, | ||
}; | ||
export const Outlined = Template.bind({}); | ||
Outlined.args = { | ||
outlined: true, | ||
}; | ||
// export const CustomColor = Template.bind({}); | ||
// CustomColor.args = { | ||
// bgColor: 'bg-white', | ||
// textColor: 'text-info-500', | ||
// class: 'border border-info-500', | ||
// }; | ||
const SingleTemplate: Story<VBadgeProps> = (args) => ({ | ||
// Components used in your story `template` are defined in the `components` object | ||
components: { | ||
VBadge, | ||
}, | ||
// The story's `args` need to be mapped into the template through the `setup()` method | ||
setup() { | ||
return {args}; | ||
}, | ||
// And then the `args` are bound to your component with `v-bind="args"` | ||
template: `<VBadge v-bind="args">{{ args.label || 'Text' }}</VBadge>`, | ||
}); | ||
export const CustomClass = SingleTemplate.bind({}); | ||
CustomClass.args = { | ||
bgColor: 'bg-teal-500', | ||
textColor: 'text-white', | ||
class: 'uppercase text-sm', | ||
}; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
23431
17
362
1
47
5
4
2