@creativecodeco/ui 0.6.2 → 1.0.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.
Files changed (71) hide show
  1. package/README.md +13 -19
  2. package/lib/helpers/index.js +8 -2
  3. package/lib/helpers/react-hook-form/controller.component.js +7 -4
  4. package/lib/helpers/react-hook-form/index.js +7 -2
  5. package/lib/hooks/index.js +8 -2
  6. package/lib/hooks/use-safe-button-props.hook.d.ts +98 -97
  7. package/lib/hooks/use-safe-button-props.hook.js +17 -8
  8. package/lib/index.js +23 -7
  9. package/lib/theme/css/accordion.css +5 -7
  10. package/lib/theme/css/avatar.css +19 -21
  11. package/lib/theme/css/badge.css +38 -44
  12. package/lib/theme/css/button.css +49 -53
  13. package/lib/theme/css/checkbox.css +31 -35
  14. package/lib/theme/css/main.css +3 -4
  15. package/lib/theme/css/radio.css +31 -35
  16. package/lib/theme/css/span.css +2 -4
  17. package/lib/theme/css/textbox.css +115 -0
  18. package/lib/theme/index.js +10 -6
  19. package/lib/theme/main.css +2669 -4112
  20. package/lib/types/helpers/controller.types.js +2 -1
  21. package/lib/types/index.js +2 -1
  22. package/lib/types/ui/base/constants.types.js +2 -1
  23. package/lib/types/ui/base/dom.types.js +2 -1
  24. package/lib/types/ui/base/error.types.js +2 -1
  25. package/lib/types/ui/base/index.js +2 -1
  26. package/lib/types/ui/components/accordion.types.js +2 -1
  27. package/lib/types/ui/components/avatar.types.js +2 -1
  28. package/lib/types/ui/components/badge.types.js +2 -1
  29. package/lib/types/ui/components/button.types.js +2 -1
  30. package/lib/types/ui/components/index.js +2 -1
  31. package/lib/types/ui/forms/checkbox.types.js +2 -1
  32. package/lib/types/ui/forms/dropdown.types.d.ts +1 -1
  33. package/lib/types/ui/forms/dropdown.types.js +2 -1
  34. package/lib/types/ui/forms/index.d.ts +1 -1
  35. package/lib/types/ui/forms/index.js +2 -1
  36. package/lib/types/ui/forms/radio.types.js +2 -1
  37. package/lib/types/ui/forms/textbox.types.js +2 -0
  38. package/lib/ui/components/accordion/accordion.component.js +11 -6
  39. package/lib/ui/components/accordion/index.js +8 -2
  40. package/lib/ui/components/avatar/avatar.component.js +18 -13
  41. package/lib/ui/components/avatar/index.js +8 -2
  42. package/lib/ui/components/badge/badge.component.js +12 -7
  43. package/lib/ui/components/badge/index.js +8 -2
  44. package/lib/ui/components/button/button.component.js +18 -13
  45. package/lib/ui/components/button/index.js +8 -2
  46. package/lib/ui/components/index.js +20 -4
  47. package/lib/ui/forms/checkbox/checkbox.component.js +15 -10
  48. package/lib/ui/forms/checkbox/index.js +8 -2
  49. package/lib/ui/forms/dropdown/dropdown.component.js +20 -18
  50. package/lib/ui/forms/dropdown/index.js +8 -2
  51. package/lib/ui/forms/index.d.ts +1 -1
  52. package/lib/ui/forms/index.js +21 -5
  53. package/lib/ui/forms/radio/index.js +8 -2
  54. package/lib/ui/forms/radio/radio.component.js +15 -10
  55. package/lib/ui/forms/radio-list/index.js +8 -2
  56. package/lib/ui/forms/radio-list/radio-list.component.js +6 -4
  57. package/lib/ui/forms/textbox/index.d.ts +2 -0
  58. package/lib/ui/forms/textbox/index.js +8 -0
  59. package/lib/ui/forms/textbox/textbox.component.js +26 -0
  60. package/lib/ui/provider/creativecode/creativecode-ui.provider.js +8 -5
  61. package/lib/ui/provider/index.js +8 -2
  62. package/lib/utils/index.js +17 -1
  63. package/lib/utils/string.utils.js +7 -3
  64. package/package.json +54 -61
  65. package/lib/theme/css/text-box.css +0 -113
  66. package/lib/types/ui/forms/text-box.types.js +0 -1
  67. package/lib/ui/forms/text-box/index.d.ts +0 -2
  68. package/lib/ui/forms/text-box/index.js +0 -2
  69. package/lib/ui/forms/text-box/text-box.component.js +0 -21
  70. /package/lib/types/ui/forms/{text-box.types.d.ts → textbox.types.d.ts} +0 -0
  71. /package/lib/ui/forms/{text-box/text-box.component.d.ts → textbox/textbox.component.d.ts} +0 -0
@@ -1,71 +1,67 @@
1
1
  .button {
2
- &-link {
3
- @apply btn-link;
2
+ &:focus,
3
+ &:hover,
4
+ &:active {
5
+ @apply btn-active;
4
6
  }
7
+ }
5
8
 
6
- &-outline {
7
- @apply btn-outline;
8
- }
9
+ .button-link {
10
+ @apply btn-link;
11
+ }
9
12
 
10
- &-color {
11
- &-neutral {
12
- @apply btn-neutral;
13
- }
13
+ .button-outline {
14
+ @apply btn-outline;
15
+ }
14
16
 
15
- &-primary {
16
- @apply btn-primary;
17
- }
17
+ .button-color-neutral {
18
+ @apply btn-neutral;
19
+ }
18
20
 
19
- &-secondary {
20
- @apply btn-secondary;
21
- }
21
+ .button-color-primary {
22
+ @apply btn-primary;
23
+ }
22
24
 
23
- &-accent {
24
- @apply btn-accent;
25
- }
25
+ .button-color-secondary {
26
+ @apply btn-secondary;
27
+ }
26
28
 
27
- &-success {
28
- @apply btn-success;
29
- }
29
+ .button-color-accent {
30
+ @apply btn-accent;
31
+ }
30
32
 
31
- &-warning {
32
- @apply btn-warning;
33
- }
33
+ .button-color-success {
34
+ @apply btn-success;
35
+ }
34
36
 
35
- &-info {
36
- @apply btn-info;
37
- }
37
+ .button-color-warning {
38
+ @apply btn-warning;
39
+ }
38
40
 
39
- &-error {
40
- @apply btn-error;
41
- }
41
+ .button-color-info {
42
+ @apply btn-info;
43
+ }
42
44
 
43
- &-ghost {
44
- @apply btn-ghost;
45
- }
46
- }
45
+ .button-color-error {
46
+ @apply btn-error;
47
+ }
47
48
 
48
- &-size {
49
- &-lg {
50
- @apply btn-lg;
51
- }
49
+ .button-color-ghost {
50
+ @apply btn-ghost;
51
+ }
52
52
 
53
- &-sm {
54
- @apply btn-sm;
55
- }
53
+ .button-size-lg {
54
+ @apply btn-lg;
55
+ }
56
56
 
57
- &-xs {
58
- @apply btn-xs;
59
- }
60
- }
57
+ .button-size-sm {
58
+ @apply btn-sm;
59
+ }
61
60
 
62
- &-loading {
63
- @apply pointer-events-none cursor-default;
64
- }
61
+ .button-size-xs {
62
+ @apply btn-xs;
63
+ }
65
64
 
66
- &:focus,
67
- &:hover,
68
- &:active {
69
- @apply btn-active;
70
- }
65
+ .button-loading {
66
+ @apply pointer-events-none cursor-default;
71
67
  }
@@ -1,47 +1,43 @@
1
- .checkbox-color {
2
- &-primary {
3
- @apply checkbox-primary;
4
- }
1
+ .checkbox-color-primary {
2
+ @apply checkbox-primary;
3
+ }
5
4
 
6
- &-secondary {
7
- @apply checkbox-secondary;
8
- }
5
+ .checkbox-color-secondary {
6
+ @apply checkbox-secondary;
7
+ }
9
8
 
10
- &-accent {
11
- @apply checkbox-accent;
12
- }
9
+ .checkbox-color-accent {
10
+ @apply checkbox-accent;
11
+ }
13
12
 
14
- &-success {
15
- @apply checkbox-success;
16
- }
13
+ .checkbox-color-success {
14
+ @apply checkbox-success;
15
+ }
17
16
 
18
- &-warning {
19
- @apply checkbox-warning;
20
- }
17
+ .checkbox-color-warning {
18
+ @apply checkbox-warning;
19
+ }
21
20
 
22
- &-info {
23
- @apply checkbox-info;
24
- }
21
+ .checkbox-color-info {
22
+ @apply checkbox-info;
23
+ }
25
24
 
26
- &-error {
27
- @apply checkbox-error;
28
- }
25
+ .checkbox-color-error {
26
+ @apply checkbox-error;
29
27
  }
30
28
 
31
- .checkbox-size {
32
- &-xs {
33
- @apply checkbox-xs;
34
- }
29
+ .checkbox-size-xs {
30
+ @apply checkbox-xs;
31
+ }
35
32
 
36
- &-sm {
37
- @apply checkbox-sm;
38
- }
33
+ .checkbox-size-sm {
34
+ @apply checkbox-sm;
35
+ }
39
36
 
40
- &-md {
41
- @apply checkbox-md;
42
- }
37
+ .checkbox-size-md {
38
+ @apply checkbox-md;
39
+ }
43
40
 
44
- &-lg {
45
- @apply checkbox-lg;
46
- }
41
+ .checkbox-size-lg {
42
+ @apply checkbox-lg;
47
43
  }
@@ -1,6 +1,5 @@
1
- @import 'tailwindcss/base';
2
- @import 'tailwindcss/components';
3
- @import 'tailwindcss/utilities';
1
+ @import 'tailwindcss';
2
+ @plugin "daisyui";
4
3
 
5
4
  @import './accordion.css';
6
5
  @import './avatar.css';
@@ -9,4 +8,4 @@
9
8
  @import './checkbox.css';
10
9
  @import './radio.css';
11
10
  @import './span.css';
12
- @import './text-box.css';
11
+ @import './textbox.css';
@@ -1,47 +1,43 @@
1
- .radio-color {
2
- &-primary {
3
- @apply radio-primary;
4
- }
1
+ .radio-color-primary {
2
+ @apply radio-primary;
3
+ }
5
4
 
6
- &-secondary {
7
- @apply radio-secondary;
8
- }
5
+ .radio-color-secondary {
6
+ @apply radio-secondary;
7
+ }
9
8
 
10
- &-accent {
11
- @apply radio-accent;
12
- }
9
+ .radio-color-accent {
10
+ @apply radio-accent;
11
+ }
13
12
 
14
- &-success {
15
- @apply radio-success;
16
- }
13
+ .radio-color-success {
14
+ @apply radio-success;
15
+ }
17
16
 
18
- &-warning {
19
- @apply radio-warning;
20
- }
17
+ .radio-color-warning {
18
+ @apply radio-warning;
19
+ }
21
20
 
22
- &-info {
23
- @apply radio-info;
24
- }
21
+ .radio-color-info {
22
+ @apply radio-info;
23
+ }
25
24
 
26
- &-error {
27
- @apply radio-error;
28
- }
25
+ .radio-color-error {
26
+ @apply radio-error;
29
27
  }
30
28
 
31
- .radio-size {
32
- &-xs {
33
- @apply radio-xs;
34
- }
29
+ .radio-size-xs {
30
+ @apply radio-xs;
31
+ }
35
32
 
36
- &-sm {
37
- @apply radio-sm;
38
- }
33
+ .radio-size-sm {
34
+ @apply radio-sm;
35
+ }
39
36
 
40
- &-md {
41
- @apply radio-md;
42
- }
37
+ .radio-size-md {
38
+ @apply radio-md;
39
+ }
43
40
 
44
- &-lg {
45
- @apply radio-lg;
46
- }
41
+ .radio-size-lg {
42
+ @apply radio-lg;
47
43
  }
@@ -1,5 +1,3 @@
1
- .span {
2
- &-loading {
3
- @apply loading loading-spinner;
4
- }
1
+ .span-loading {
2
+ @apply loading loading-spinner;
5
3
  }
@@ -0,0 +1,115 @@
1
+ .textbox-size-xs {
2
+ @apply input-xs;
3
+
4
+ &.textbox-with-left-icon {
5
+ @apply pl-8;
6
+ }
7
+
8
+ &.textbox-with-right-icon {
9
+ @apply pr-8;
10
+ }
11
+ }
12
+
13
+ .textbox-size-sm {
14
+ @apply input-sm;
15
+
16
+ &.textbox-with-left-icon {
17
+ @apply pl-8;
18
+ }
19
+
20
+ &.textbox-with-right-icon {
21
+ @apply pr-8;
22
+ }
23
+ }
24
+
25
+ .textbox-size-md {
26
+ @apply input-md;
27
+
28
+ &.textbox-with-left-icon {
29
+ @apply pl-9;
30
+ }
31
+
32
+ &.textbox-with-right-icon {
33
+ @apply pr-9;
34
+ }
35
+ }
36
+
37
+ .textbox-size-lg {
38
+ @apply input-lg;
39
+
40
+ &.textbox-with-left-icon {
41
+ @apply pl-9;
42
+ }
43
+
44
+ &.textbox-with-right-icon {
45
+ @apply pr-9;
46
+ }
47
+ }
48
+
49
+ .textbox-left-icon {
50
+ @apply absolute z-10;
51
+ }
52
+
53
+ .textbox-left-icon-size-xs {
54
+ @apply top-[5px] left-2;
55
+ }
56
+
57
+ .textbox-left-icon-size-sm {
58
+ @apply top-2 left-2;
59
+ }
60
+
61
+ .textbox-left-icon-size-md {
62
+ @apply top-4 left-3;
63
+ }
64
+
65
+ .textbox-left-icon-size-lg {
66
+ @apply top-6 left-3;
67
+ }
68
+
69
+ .textbox-right-icon {
70
+ @apply absolute z-10;
71
+ }
72
+
73
+ .textbox-right-icon-size-xs {
74
+ @apply top-[5px] right-2;
75
+ }
76
+
77
+ .textbox-right-icon-size-sm {
78
+ @apply top-2 right-2;
79
+ }
80
+
81
+ .textbox-right-icon-size-md {
82
+ @apply top-3 right-3;
83
+ }
84
+
85
+ .textbox-right-icon-size-lg {
86
+ @apply top-6 right-3;
87
+ }
88
+
89
+ .textbox-color-primary {
90
+ @apply input-primary;
91
+ }
92
+
93
+ .textbox-color-secondary {
94
+ @apply input-secondary;
95
+ }
96
+
97
+ .textbox-color-accent {
98
+ @apply input-accent;
99
+ }
100
+
101
+ .textbox-color-success {
102
+ @apply input-success;
103
+ }
104
+
105
+ .textbox-color-warning {
106
+ @apply input-warning;
107
+ }
108
+
109
+ .textbox-color-info {
110
+ @apply input-info;
111
+ }
112
+
113
+ .textbox-color-error {
114
+ @apply input-error;
115
+ }
@@ -1,13 +1,17 @@
1
- export const creativeCodeTheme = {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.creativeCodeTheme = void 0;
4
+ exports.creativeCodeTheme = {
2
5
  content: [
3
- "./src/**/*.{html,js,ts,jsx,tsx,mdx}",
4
- "./node_modules/creativecodeco/ui/lib/**/*.{js,jsx,ts,tsx}",
6
+ './src/**/*.{html,js,ts,jsx,tsx,mdx}',
7
+ './node_modules/creativecodeco/ui/lib/**/*.{js,jsx,ts,tsx}'
5
8
  ],
6
9
  theme: {
7
- extend: {},
10
+ extend: {}
8
11
  },
9
12
  daisyui: {
10
- themes: ["light"],
13
+ themes: ['light']
11
14
  },
12
- plugins: [require("daisyui")],
15
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
16
+ plugins: [require('daisyui')]
13
17
  };