@creativecodeco/ui 0.0.5 → 0.2.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/README.md +37 -4
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/theme/css/avatar.css +37 -0
- package/lib/theme/css/checkbox.css +47 -0
- package/lib/theme/css/main.css +2 -0
- package/lib/theme/main.css +590 -1
- package/lib/types/helpers/controller.types.d.ts +5 -5
- package/lib/types/index.d.ts +3 -2
- package/lib/types/index.js +3 -1
- package/lib/types/ui/base/constants.types.d.ts +1 -0
- package/lib/types/ui/base/error.types.d.ts +4 -0
- package/lib/types/ui/base/error.types.js +1 -0
- package/lib/types/ui/base/index.d.ts +2 -0
- package/lib/types/ui/base/index.js +1 -0
- package/lib/types/ui/components/avatar.types.d.ts +9 -0
- package/lib/types/ui/components/avatar.types.js +1 -0
- package/lib/types/ui/components/index.d.ts +2 -0
- package/lib/types/ui/components/index.js +1 -0
- package/lib/types/ui/forms/checkbox.types.d.ts +11 -0
- package/lib/types/ui/forms/checkbox.types.js +1 -0
- package/lib/types/ui/forms/{drop-down.types.d.ts → dropdown.types.d.ts} +3 -3
- package/lib/types/ui/forms/dropdown.types.js +1 -0
- package/lib/types/ui/forms/index.d.ts +3 -3
- package/lib/types/ui/forms/text-box.types.d.ts +3 -4
- package/lib/ui/components/avatar/avatar.component.d.ts +3 -0
- package/lib/ui/components/avatar/avatar.component.js +18 -0
- package/lib/ui/components/avatar/index.d.ts +2 -0
- package/lib/ui/components/avatar/index.js +2 -0
- package/lib/ui/components/index.d.ts +1 -0
- package/lib/ui/components/index.js +1 -0
- package/lib/ui/forms/checkbox/checkbox.component.d.ts +4 -0
- package/lib/ui/forms/checkbox/checkbox.component.js +14 -0
- package/lib/ui/forms/checkbox/index.d.ts +2 -0
- package/lib/ui/forms/checkbox/index.js +2 -0
- package/lib/ui/forms/dropdown/dropdown.component.d.ts +4 -0
- package/lib/ui/forms/{drop-down/drop-down.component.js → dropdown/dropdown.component.js} +4 -2
- package/lib/ui/forms/dropdown/index.d.ts +2 -0
- package/lib/ui/forms/dropdown/index.js +2 -0
- package/lib/ui/forms/index.d.ts +3 -3
- package/lib/ui/forms/index.js +3 -3
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/string.utils.d.ts +51 -0
- package/lib/utils/string.utils.js +75 -0
- package/package.json +29 -26
- package/lib/ui/forms/drop-down/drop-down.component.d.ts +0 -4
- package/lib/ui/forms/drop-down/index.d.ts +0 -2
- package/lib/ui/forms/drop-down/index.js +0 -2
- /package/lib/types/ui/{forms/drop-down.types.js → base/constants.types.js} +0 -0
package/README.md
CHANGED
|
@@ -25,11 +25,11 @@ yarn add @creativecodeco/ui
|
|
|
25
25
|
### Dependencies
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npm install --save-dev tailwindcss postcss postcss-import autoprefixer usehooks-ts
|
|
28
|
+
npm install --save-dev tailwindcss postcss postcss-import autoprefixer usehooks-ts cssnano
|
|
29
29
|
|
|
30
30
|
or
|
|
31
31
|
|
|
32
|
-
yarn add -D tailwindcss postcss postcss-import autoprefixer usehooks-ts
|
|
32
|
+
yarn add -D tailwindcss postcss postcss-import autoprefixer usehooks-ts cssnano
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
### Setting Tailwind
|
|
@@ -46,13 +46,45 @@ const themeConfig = {
|
|
|
46
46
|
...creativeCodeTheme.content,
|
|
47
47
|
'./src/**/*.{js,jsx,ts,tsx}',
|
|
48
48
|
'./app/**/*.{js,jsx,ts,tsx}',
|
|
49
|
-
'./node_modules/@creativecodeco/ui/lib/**/*.{js,jsx,ts,tsx}',
|
|
50
49
|
],
|
|
51
50
|
};
|
|
52
51
|
|
|
53
52
|
export default themeConfig;
|
|
54
53
|
```
|
|
55
54
|
|
|
55
|
+
#### Custom theme
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
/** @type {import('tailwindcss').Config} */
|
|
59
|
+
import { creativeCodeTheme } from '@creativecodeco/ui';
|
|
60
|
+
|
|
61
|
+
const themeConfig = {
|
|
62
|
+
...creativeCodeTheme,
|
|
63
|
+
content: [
|
|
64
|
+
...creativeCodeTheme.content,
|
|
65
|
+
'./src/**/*.{js,jsx,ts,tsx}',
|
|
66
|
+
'./app/**/*.{js,jsx,ts,tsx}',
|
|
67
|
+
],
|
|
68
|
+
daisyui: {
|
|
69
|
+
...creativeCodeTheme.daisyui,
|
|
70
|
+
themes: [
|
|
71
|
+
{
|
|
72
|
+
customTheme: {
|
|
73
|
+
...require('daisyui/src/theming/themes')['light'],
|
|
74
|
+
primary: '#08448c',
|
|
75
|
+
secondary: '#427AA1',
|
|
76
|
+
neutral: '#EBF2FA',
|
|
77
|
+
accent: '#679436',
|
|
78
|
+
other: '#A5BE00',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default themeConfig;
|
|
86
|
+
```
|
|
87
|
+
|
|
56
88
|
### Setting Postcss
|
|
57
89
|
|
|
58
90
|
Create file `postcss.config.js` and add
|
|
@@ -64,6 +96,7 @@ module.exports = {
|
|
|
64
96
|
'tailwindcss/nesting': {},
|
|
65
97
|
tailwindcss: {},
|
|
66
98
|
autoprefixer: {},
|
|
99
|
+
...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {}),
|
|
67
100
|
},
|
|
68
101
|
};
|
|
69
102
|
```
|
|
@@ -75,7 +108,7 @@ Add on layout `layout.tsx`
|
|
|
75
108
|
```tsx
|
|
76
109
|
import { CreativeCodeUIProvider } from '@creativecodeco/ui';
|
|
77
110
|
|
|
78
|
-
import '@creativecodeco/ui/lib/theme/main.css';
|
|
111
|
+
import '@creativecodeco/ui/lib/theme/css/main.css';
|
|
79
112
|
|
|
80
113
|
export default function RootLayout({ children }) {
|
|
81
114
|
return (
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.avatar-size {
|
|
2
|
+
&-xs {
|
|
3
|
+
@apply w-8;
|
|
4
|
+
|
|
5
|
+
> span {
|
|
6
|
+
@apply text-xs;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&-sm {
|
|
11
|
+
@apply w-12;
|
|
12
|
+
|
|
13
|
+
> span {
|
|
14
|
+
@apply text-sm;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&-md {
|
|
19
|
+
@apply w-16;
|
|
20
|
+
|
|
21
|
+
> span {
|
|
22
|
+
@apply text-xl;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-lg {
|
|
27
|
+
@apply w-24;
|
|
28
|
+
|
|
29
|
+
> span {
|
|
30
|
+
@apply text-3xl;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.avatar-ring {
|
|
36
|
+
@apply ring ring-primary ring-offset-base-100 ring-offset-2;
|
|
37
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.checkbox-color {
|
|
2
|
+
&-primary {
|
|
3
|
+
@apply checkbox-primary;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&-secondary {
|
|
7
|
+
@apply checkbox-secondary;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&-accent {
|
|
11
|
+
@apply checkbox-accent;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-success {
|
|
15
|
+
@apply checkbox-success;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&-warning {
|
|
19
|
+
@apply checkbox-warning;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&-info {
|
|
23
|
+
@apply checkbox-info;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-error {
|
|
27
|
+
@apply checkbox-error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.checkbox-size {
|
|
32
|
+
&-xs {
|
|
33
|
+
@apply checkbox-xs;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&-sm {
|
|
37
|
+
@apply checkbox-sm;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-md {
|
|
41
|
+
@apply checkbox-md;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-lg {
|
|
45
|
+
@apply checkbox-lg;
|
|
46
|
+
}
|
|
47
|
+
}
|