@okam/next-component 1.2.3 → 1.3.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 (51) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/components/AdminBar/components/AdminBarError.d.ts +4 -0
  3. package/components/AdminBar/index.d.ts +5 -0
  4. package/components/AdminBar/index.js +14 -0
  5. package/components/AdminBar/index.mjs +15 -0
  6. package/components/AdminBar/interface.d.ts +14 -0
  7. package/components/Filter/index.d.ts +26 -0
  8. package/components/Filter/index.js +54 -0
  9. package/components/Filter/index.mjs +55 -0
  10. package/components/Filter/interface.d.ts +9 -0
  11. package/components/Link/index.js +2 -2
  12. package/hooks/useFilterState/index.d.ts +15 -0
  13. package/hooks/useFilterState/index.js +50 -0
  14. package/hooks/useFilterState/index.mjs +50 -0
  15. package/hooks/useFilterState/interface.d.ts +17 -0
  16. package/hooks/useHash/index.js +2 -2
  17. package/hooks/useLink/index.js +5 -5
  18. package/index.d.ts +7 -0
  19. package/index.js +16 -4
  20. package/index.mjs +12 -0
  21. package/lib/createServerContext/index.js +2 -2
  22. package/package.json +11 -4
  23. package/providers/AdminBar/index.d.ts +4 -0
  24. package/providers/AdminBar/index.js +16 -0
  25. package/providers/AdminBar/index.mjs +16 -0
  26. package/providers/AdminBar/interface.d.ts +10 -0
  27. package/providers/DraftMode/index.d.ts +4 -0
  28. package/providers/DraftMode/index.js +15 -0
  29. package/providers/DraftMode/index.mjs +15 -0
  30. package/providers/DraftMode/interface.d.ts +12 -0
  31. package/providers/DraftMode/server.d.ts +4 -0
  32. package/providers/DraftMode/server.js +10 -0
  33. package/providers/DraftMode/server.mjs +11 -0
  34. package/server.d.ts +2 -0
  35. package/server.js +6 -2
  36. package/server.mjs +4 -0
  37. package/theme/AdminBar/index.d.ts +900 -0
  38. package/theme/AdminBar/index.js +120 -0
  39. package/theme/AdminBar/index.mjs +120 -0
  40. package/theme/Button/index.d.ts +149 -0
  41. package/theme/Button/index.js +75 -0
  42. package/theme/Button/index.mjs +76 -0
  43. package/theme/Filter/index.d.ts +2030 -0
  44. package/theme/Filter/index.js +72 -0
  45. package/theme/Filter/index.mjs +73 -0
  46. package/theme/Typography/index.d.ts +233 -0
  47. package/theme/Typography/index.js +43 -0
  48. package/theme/Typography/index.mjs +44 -0
  49. package/theme/index.d.ts +3 -1
  50. package/theme/index.js +16 -0
  51. package/theme/index.mjs +17 -0
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const tailwindVariants = require("tailwind-variants");
4
+ const adminBarContainer = tailwindVariants.tv({
5
+ base: "w-full bg-gray-100 py-2 px-4 border-gray-200 fixed left-0 right-0 z-50",
6
+ variants: {
7
+ position: {
8
+ top: "top-0 border-b",
9
+ bottom: "bottom-0 border-t"
10
+ },
11
+ fullWidth: {
12
+ true: "max-w-full"
13
+ },
14
+ background: {
15
+ grey: "bg-gray-100",
16
+ dark: "bg-gray-800 text-white",
17
+ light: "bg-white"
18
+ },
19
+ padding: {
20
+ small: "py-1 px-2",
21
+ medium: "py-2 px-4",
22
+ large: "py-3 px-6"
23
+ }
24
+ },
25
+ defaultVariants: {
26
+ position: "top",
27
+ background: "grey",
28
+ padding: "medium"
29
+ }
30
+ });
31
+ const adminBarContent = tailwindVariants.tv({
32
+ base: "flex items-center",
33
+ variants: {
34
+ justify: {
35
+ start: "justify-start",
36
+ center: "justify-center",
37
+ end: "justify-end",
38
+ between: "justify-between",
39
+ around: "justify-around",
40
+ evenly: "justify-evenly"
41
+ },
42
+ gap: {
43
+ small: "gap-2",
44
+ medium: "gap-4",
45
+ large: "gap-6"
46
+ },
47
+ wrap: {
48
+ true: "flex-wrap",
49
+ false: "flex-nowrap"
50
+ }
51
+ },
52
+ defaultVariants: {
53
+ justify: "between",
54
+ gap: "medium",
55
+ wrap: false
56
+ }
57
+ });
58
+ const adminBarButton = tailwindVariants.tv({
59
+ base: "px-3 py-1 rounded text-sm font-medium transition-colors",
60
+ variants: {
61
+ variant: {
62
+ primary: "bg-blue-600 text-white hover:bg-blue-700",
63
+ secondary: "bg-gray-200 text-gray-800 hover:bg-gray-300",
64
+ danger: "bg-red-600 text-white hover:bg-red-700"
65
+ },
66
+ size: {
67
+ small: "text-xs px-2 py-0.5",
68
+ medium: "text-sm px-3 py-1",
69
+ large: "text-base px-4 py-2"
70
+ }
71
+ },
72
+ defaultVariants: {
73
+ variant: "secondary",
74
+ size: "medium"
75
+ }
76
+ });
77
+ const adminBarError = tailwindVariants.tv({
78
+ base: "flex items-center justify-center bg-red-50 text-red-700 px-3 py-1 rounded-md text-sm",
79
+ variants: {
80
+ severity: {
81
+ low: "bg-yellow-50 text-yellow-700",
82
+ medium: "bg-red-50 text-red-700",
83
+ high: "bg-red-100 text-red-800 font-bold"
84
+ },
85
+ hasBorder: {
86
+ true: "border border-red-300",
87
+ false: ""
88
+ }
89
+ },
90
+ defaultVariants: {
91
+ severity: "medium",
92
+ hasBorder: true
93
+ }
94
+ });
95
+ const adminBarErrorTypography = tailwindVariants.tv({
96
+ base: "text-red-700 text-sm font-medium",
97
+ variants: {
98
+ severity: {
99
+ low: "text-yellow-700",
100
+ medium: "text-red-700",
101
+ high: "text-red-800 font-bold"
102
+ }
103
+ },
104
+ defaultVariants: {
105
+ severity: "medium"
106
+ }
107
+ });
108
+ const adminBarTheme = {
109
+ container: adminBarContainer,
110
+ content: adminBarContent,
111
+ button: adminBarButton,
112
+ error: adminBarError,
113
+ errorTypography: adminBarErrorTypography
114
+ };
115
+ exports.adminBarButton = adminBarButton;
116
+ exports.adminBarContainer = adminBarContainer;
117
+ exports.adminBarContent = adminBarContent;
118
+ exports.adminBarError = adminBarError;
119
+ exports.adminBarErrorTypography = adminBarErrorTypography;
120
+ exports.adminBarTheme = adminBarTheme;
@@ -0,0 +1,120 @@
1
+ import { tv } from "tailwind-variants";
2
+ const adminBarContainer = tv({
3
+ base: "w-full bg-gray-100 py-2 px-4 border-gray-200 fixed left-0 right-0 z-50",
4
+ variants: {
5
+ position: {
6
+ top: "top-0 border-b",
7
+ bottom: "bottom-0 border-t"
8
+ },
9
+ fullWidth: {
10
+ true: "max-w-full"
11
+ },
12
+ background: {
13
+ grey: "bg-gray-100",
14
+ dark: "bg-gray-800 text-white",
15
+ light: "bg-white"
16
+ },
17
+ padding: {
18
+ small: "py-1 px-2",
19
+ medium: "py-2 px-4",
20
+ large: "py-3 px-6"
21
+ }
22
+ },
23
+ defaultVariants: {
24
+ position: "top",
25
+ background: "grey",
26
+ padding: "medium"
27
+ }
28
+ });
29
+ const adminBarContent = tv({
30
+ base: "flex items-center",
31
+ variants: {
32
+ justify: {
33
+ start: "justify-start",
34
+ center: "justify-center",
35
+ end: "justify-end",
36
+ between: "justify-between",
37
+ around: "justify-around",
38
+ evenly: "justify-evenly"
39
+ },
40
+ gap: {
41
+ small: "gap-2",
42
+ medium: "gap-4",
43
+ large: "gap-6"
44
+ },
45
+ wrap: {
46
+ true: "flex-wrap",
47
+ false: "flex-nowrap"
48
+ }
49
+ },
50
+ defaultVariants: {
51
+ justify: "between",
52
+ gap: "medium",
53
+ wrap: false
54
+ }
55
+ });
56
+ const adminBarButton = tv({
57
+ base: "px-3 py-1 rounded text-sm font-medium transition-colors",
58
+ variants: {
59
+ variant: {
60
+ primary: "bg-blue-600 text-white hover:bg-blue-700",
61
+ secondary: "bg-gray-200 text-gray-800 hover:bg-gray-300",
62
+ danger: "bg-red-600 text-white hover:bg-red-700"
63
+ },
64
+ size: {
65
+ small: "text-xs px-2 py-0.5",
66
+ medium: "text-sm px-3 py-1",
67
+ large: "text-base px-4 py-2"
68
+ }
69
+ },
70
+ defaultVariants: {
71
+ variant: "secondary",
72
+ size: "medium"
73
+ }
74
+ });
75
+ const adminBarError = tv({
76
+ base: "flex items-center justify-center bg-red-50 text-red-700 px-3 py-1 rounded-md text-sm",
77
+ variants: {
78
+ severity: {
79
+ low: "bg-yellow-50 text-yellow-700",
80
+ medium: "bg-red-50 text-red-700",
81
+ high: "bg-red-100 text-red-800 font-bold"
82
+ },
83
+ hasBorder: {
84
+ true: "border border-red-300",
85
+ false: ""
86
+ }
87
+ },
88
+ defaultVariants: {
89
+ severity: "medium",
90
+ hasBorder: true
91
+ }
92
+ });
93
+ const adminBarErrorTypography = tv({
94
+ base: "text-red-700 text-sm font-medium",
95
+ variants: {
96
+ severity: {
97
+ low: "text-yellow-700",
98
+ medium: "text-red-700",
99
+ high: "text-red-800 font-bold"
100
+ }
101
+ },
102
+ defaultVariants: {
103
+ severity: "medium"
104
+ }
105
+ });
106
+ const adminBarTheme = {
107
+ container: adminBarContainer,
108
+ content: adminBarContent,
109
+ button: adminBarButton,
110
+ error: adminBarError,
111
+ errorTypography: adminBarErrorTypography
112
+ };
113
+ export {
114
+ adminBarButton,
115
+ adminBarContainer,
116
+ adminBarContent,
117
+ adminBarError,
118
+ adminBarErrorTypography,
119
+ adminBarTheme
120
+ };
@@ -0,0 +1,149 @@
1
+ declare const button: import('tailwind-variants').TVReturnType<{
2
+ type: {
3
+ button: string;
4
+ menu: string;
5
+ };
6
+ buttonStyle: {
7
+ default: string;
8
+ outline: string;
9
+ hollow: string;
10
+ };
11
+ intent: {
12
+ error: string;
13
+ };
14
+ size: {
15
+ default: string;
16
+ large: string;
17
+ };
18
+ shape: {
19
+ rounded: string;
20
+ circular: string;
21
+ };
22
+ }, undefined, "\n flex\n items-center\n justify-center\n gap-4\n transition\n duration-300\n ease-in-out\n disabled:pointer-events-none\n disabled:opacity-30\n focus-ring-black\n ", import('tailwind-variants/dist/config.js').TVConfig<{
23
+ type: {
24
+ button: string;
25
+ menu: string;
26
+ };
27
+ buttonStyle: {
28
+ default: string;
29
+ outline: string;
30
+ hollow: string;
31
+ };
32
+ intent: {
33
+ error: string;
34
+ };
35
+ size: {
36
+ default: string;
37
+ large: string;
38
+ };
39
+ shape: {
40
+ rounded: string;
41
+ circular: string;
42
+ };
43
+ }, {
44
+ type: {
45
+ button: string;
46
+ menu: string;
47
+ };
48
+ buttonStyle: {
49
+ default: string;
50
+ outline: string;
51
+ hollow: string;
52
+ };
53
+ intent: {
54
+ error: string;
55
+ };
56
+ size: {
57
+ default: string;
58
+ large: string;
59
+ };
60
+ shape: {
61
+ rounded: string;
62
+ circular: string;
63
+ };
64
+ }>, {
65
+ type: {
66
+ button: string;
67
+ menu: string;
68
+ };
69
+ buttonStyle: {
70
+ default: string;
71
+ outline: string;
72
+ hollow: string;
73
+ };
74
+ intent: {
75
+ error: string;
76
+ };
77
+ size: {
78
+ default: string;
79
+ large: string;
80
+ };
81
+ shape: {
82
+ rounded: string;
83
+ circular: string;
84
+ };
85
+ }, undefined, import('tailwind-variants').TVReturnType<{
86
+ type: {
87
+ button: string;
88
+ menu: string;
89
+ };
90
+ buttonStyle: {
91
+ default: string;
92
+ outline: string;
93
+ hollow: string;
94
+ };
95
+ intent: {
96
+ error: string;
97
+ };
98
+ size: {
99
+ default: string;
100
+ large: string;
101
+ };
102
+ shape: {
103
+ rounded: string;
104
+ circular: string;
105
+ };
106
+ }, undefined, "\n flex\n items-center\n justify-center\n gap-4\n transition\n duration-300\n ease-in-out\n disabled:pointer-events-none\n disabled:opacity-30\n focus-ring-black\n ", import('tailwind-variants/dist/config.js').TVConfig<{
107
+ type: {
108
+ button: string;
109
+ menu: string;
110
+ };
111
+ buttonStyle: {
112
+ default: string;
113
+ outline: string;
114
+ hollow: string;
115
+ };
116
+ intent: {
117
+ error: string;
118
+ };
119
+ size: {
120
+ default: string;
121
+ large: string;
122
+ };
123
+ shape: {
124
+ rounded: string;
125
+ circular: string;
126
+ };
127
+ }, {
128
+ type: {
129
+ button: string;
130
+ menu: string;
131
+ };
132
+ buttonStyle: {
133
+ default: string;
134
+ outline: string;
135
+ hollow: string;
136
+ };
137
+ intent: {
138
+ error: string;
139
+ };
140
+ size: {
141
+ default: string;
142
+ large: string;
143
+ };
144
+ shape: {
145
+ rounded: string;
146
+ circular: string;
147
+ };
148
+ }>, unknown, unknown, undefined>>;
149
+ export default button;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ const tailwindVariants = require("tailwind-variants");
3
+ const button = tailwindVariants.tv({
4
+ base: `
5
+ flex
6
+ items-center
7
+ justify-center
8
+ gap-4
9
+ transition
10
+ duration-300
11
+ ease-in-out
12
+ disabled:pointer-events-none
13
+ disabled:opacity-30
14
+ focus-ring-black
15
+ `,
16
+ defaultVariants: {
17
+ buttonStyle: "default",
18
+ type: "button",
19
+ size: "default",
20
+ shape: "rounded"
21
+ },
22
+ variants: {
23
+ type: {
24
+ button: "",
25
+ menu: "text-2xl"
26
+ },
27
+ buttonStyle: {
28
+ default: `
29
+ px-4
30
+ py-2
31
+ text-white
32
+ !bg-color-1-500
33
+ hover:!bg-color-1-400
34
+ active:!bg-color-1-400
35
+ `,
36
+ outline: `
37
+ px-4
38
+ py-2
39
+ bg-transparent
40
+ !border-color-1-500
41
+ border-2
42
+ text-color-1-500
43
+ hover:bg-color-1-500
44
+ hover:text-white
45
+ active:bg-color-1-500
46
+ active:text-white
47
+ `,
48
+ hollow: `
49
+ px-2
50
+ bg-transparent
51
+ text-color-1-500
52
+ hover:border-b-color-1-500
53
+ active:border-b-color-1-500
54
+ focus:border-b-color-1-500
55
+ `
56
+ },
57
+ intent: {
58
+ error: `
59
+ !bg-error
60
+ text-white
61
+ pointer-events-none
62
+ !border-error
63
+ `
64
+ },
65
+ size: {
66
+ default: `min-w-12 min-h-6`,
67
+ large: `min-w-36 min-h-18`
68
+ },
69
+ shape: {
70
+ rounded: `rounded-md`,
71
+ circular: `rounded-full`
72
+ }
73
+ }
74
+ });
75
+ module.exports = button;
@@ -0,0 +1,76 @@
1
+ import { tv } from "tailwind-variants";
2
+ const button = tv({
3
+ base: `
4
+ flex
5
+ items-center
6
+ justify-center
7
+ gap-4
8
+ transition
9
+ duration-300
10
+ ease-in-out
11
+ disabled:pointer-events-none
12
+ disabled:opacity-30
13
+ focus-ring-black
14
+ `,
15
+ defaultVariants: {
16
+ buttonStyle: "default",
17
+ type: "button",
18
+ size: "default",
19
+ shape: "rounded"
20
+ },
21
+ variants: {
22
+ type: {
23
+ button: "",
24
+ menu: "text-2xl"
25
+ },
26
+ buttonStyle: {
27
+ default: `
28
+ px-4
29
+ py-2
30
+ text-white
31
+ !bg-color-1-500
32
+ hover:!bg-color-1-400
33
+ active:!bg-color-1-400
34
+ `,
35
+ outline: `
36
+ px-4
37
+ py-2
38
+ bg-transparent
39
+ !border-color-1-500
40
+ border-2
41
+ text-color-1-500
42
+ hover:bg-color-1-500
43
+ hover:text-white
44
+ active:bg-color-1-500
45
+ active:text-white
46
+ `,
47
+ hollow: `
48
+ px-2
49
+ bg-transparent
50
+ text-color-1-500
51
+ hover:border-b-color-1-500
52
+ active:border-b-color-1-500
53
+ focus:border-b-color-1-500
54
+ `
55
+ },
56
+ intent: {
57
+ error: `
58
+ !bg-error
59
+ text-white
60
+ pointer-events-none
61
+ !border-error
62
+ `
63
+ },
64
+ size: {
65
+ default: `min-w-12 min-h-6`,
66
+ large: `min-w-36 min-h-18`
67
+ },
68
+ shape: {
69
+ rounded: `rounded-md`,
70
+ circular: `rounded-full`
71
+ }
72
+ }
73
+ });
74
+ export {
75
+ button as default
76
+ };