@fiscozen/checkbox 0.1.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/src/types.ts ADDED
@@ -0,0 +1,75 @@
1
+ export type FzCheckboxProps = {
2
+ /**
3
+ * The label of the checkbox
4
+ */
5
+ label: string;
6
+ /**
7
+ * The value of the checkbox. If not provided, the value will be the label
8
+ */
9
+ value?: string;
10
+ /**
11
+ * The size of the checkbox
12
+ */
13
+ size: "sm" | "md";
14
+ /**
15
+ * If the checkbox is checked
16
+ */
17
+ checked?: boolean;
18
+ /**
19
+ * if the checkbox is indeterminate
20
+ */
21
+ indeterminate?: boolean;
22
+ /**
23
+ * If true, the checkbox will be emphasized
24
+ */
25
+ emphasis?: boolean;
26
+ /**
27
+ * If true, the checkbox will be disabled
28
+ */
29
+ disabled?: boolean;
30
+ /**
31
+ * If true, the checkbox will be in an error state
32
+ */
33
+ error?: boolean;
34
+ /**
35
+ * If the checkbox is required
36
+ */
37
+ required?: boolean;
38
+ /**
39
+ * If the checkbox is standalone
40
+ */
41
+ standalone?: boolean;
42
+ };
43
+
44
+ export type FzCheckboxGroupProps = {
45
+ /**
46
+ * The label of the checkbox group
47
+ */
48
+ label: string;
49
+ /**
50
+ * The size of the checkbox
51
+ */
52
+ size: "sm" | "md";
53
+ /**
54
+ * The checkbox to render
55
+ */
56
+ options: ParentCheckbox[];
57
+ /**
58
+ * If true, the checkbox will be emphasized
59
+ */
60
+ emphasis?: boolean;
61
+ /**
62
+ * If true, the checkbox will be disabled
63
+ */
64
+ disabled?: boolean;
65
+ /**
66
+ * If true, the checkbox will be in an error state
67
+ */
68
+ error?: boolean;
69
+ /**
70
+ * If the checkbox group is required
71
+ */
72
+ required?: boolean;
73
+ };
74
+ export type ParentCheckbox = ChildCheckbox & { children?: ChildCheckbox[] };
75
+ export type ChildCheckbox = Omit<FzCheckboxProps, "size">;
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "@fiscozen/tsconfig",
3
+ "exclude": ["src/__tests__", "vite.config.ts", "vitest.config.ts"]
4
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { fileURLToPath, URL } from 'node:url'
2
+ import { resolve } from 'node:path';
3
+ import { defineConfig } from 'vite'
4
+ import vue from '@vitejs/plugin-vue'
5
+ import dts from 'vite-plugin-dts'
6
+
7
+ export default defineConfig({
8
+ plugins: [
9
+ vue(),
10
+ dts({
11
+ insertTypesEntry: true,
12
+ })
13
+ ],
14
+ resolve: {
15
+ alias: {
16
+ '@': fileURLToPath(new URL('./src', import.meta.url))
17
+ }
18
+ },
19
+ build: {
20
+ lib: {
21
+ entry: resolve(__dirname, './src/index.ts'),
22
+ name: 'FzCheckbox',
23
+ },
24
+ rollupOptions: {
25
+ external: ['vue', "@fiscozen/icons"],
26
+ output: {
27
+ globals: {
28
+ vue: 'Vue',
29
+ },
30
+ },
31
+ }
32
+ }
33
+ })
@@ -0,0 +1,19 @@
1
+ import { fileURLToPath } from 'node:url'
2
+ import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'
3
+ import viteConfig from './vite.config'
4
+
5
+ export default mergeConfig(
6
+ viteConfig,
7
+ defineConfig({
8
+ test: {
9
+ environment: 'jsdom',
10
+ exclude: [...configDefaults.exclude, 'e2e/*'],
11
+ root: fileURLToPath(new URL('./', import.meta.url)),
12
+ coverage: {
13
+ provider: 'v8',
14
+ include: ['**/src/**'],
15
+ exclude: ['**/index.ts']
16
+ }
17
+ }
18
+ })
19
+ )