@okam/next-component 1.2.4 → 1.3.1

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 +29 -3
  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 +10 -3
  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,72 @@
1
+ "use strict";
2
+ const tailwindVariants = require("tailwind-variants");
3
+ const index$1 = require("../Button/index.js");
4
+ const index = require("../Typography/index.js");
5
+ const filterTagGroupWrapper = tailwindVariants.tv({
6
+ base: "w-full flex flex-col gap-2"
7
+ });
8
+ const filterTagGroupTags = tailwindVariants.tv({
9
+ base: "flex flex-col gap-2 max-w-[150px] items-center mx-auto"
10
+ });
11
+ const filterTagGroupLabel = tailwindVariants.tv({
12
+ extend: index,
13
+ defaultVariants: { size: "h4" }
14
+ });
15
+ const filterTagGroupDescription = tailwindVariants.tv({
16
+ extend: index,
17
+ base: "block",
18
+ defaultVariants: { size: "footnotes" }
19
+ });
20
+ const filterTagGroupErrorMessage = tailwindVariants.tv({
21
+ extend: index,
22
+ base: "block",
23
+ defaultVariants: { isError: true }
24
+ });
25
+ const filterTagGroupTagWrapper = tailwindVariants.tv({
26
+ base: [
27
+ index$1({ buttonStyle: "outline" }),
28
+ `
29
+ focus-visible:outline
30
+ focus-visible:outline-offset-2
31
+ focus-visible:outline-2
32
+ focus-visible:outline-black
33
+ `
34
+ ],
35
+ variants: {
36
+ isSelected: {
37
+ true: [index$1({ buttonStyle: "default" })]
38
+ },
39
+ isDisabled: {
40
+ true: "pointer-events-none opacity-30"
41
+ }
42
+ }
43
+ });
44
+ const filterTagGroupTagContainer = tailwindVariants.tv({
45
+ extend: index,
46
+ base: "flex items-center justify-center"
47
+ });
48
+ const filterPopoverButton = tailwindVariants.tv({
49
+ extend: index$1,
50
+ base: "!min-w-[200px]"
51
+ });
52
+ const filterPopoverPopover = tailwindVariants.tv({
53
+ base: "w-[var(--filter-popover-container-width)] bg-gray-300 rounded-md p-4"
54
+ });
55
+ const filterTheme = {
56
+ popover: {
57
+ button: filterPopoverButton,
58
+ popover: filterPopoverPopover
59
+ },
60
+ tagGroup: {
61
+ wrapper: filterTagGroupWrapper,
62
+ tags: filterTagGroupTags,
63
+ label: filterTagGroupLabel,
64
+ description: filterTagGroupDescription,
65
+ errorMessage: filterTagGroupErrorMessage,
66
+ tag: {
67
+ wrapper: filterTagGroupTagWrapper,
68
+ container: filterTagGroupTagContainer
69
+ }
70
+ }
71
+ };
72
+ module.exports = filterTheme;
@@ -0,0 +1,73 @@
1
+ import { tv } from "tailwind-variants";
2
+ import button from "../Button/index.mjs";
3
+ import typography from "../Typography/index.mjs";
4
+ const filterTagGroupWrapper = tv({
5
+ base: "w-full flex flex-col gap-2"
6
+ });
7
+ const filterTagGroupTags = tv({
8
+ base: "flex flex-col gap-2 max-w-[150px] items-center mx-auto"
9
+ });
10
+ const filterTagGroupLabel = tv({
11
+ extend: typography,
12
+ defaultVariants: { size: "h4" }
13
+ });
14
+ const filterTagGroupDescription = tv({
15
+ extend: typography,
16
+ base: "block",
17
+ defaultVariants: { size: "footnotes" }
18
+ });
19
+ const filterTagGroupErrorMessage = tv({
20
+ extend: typography,
21
+ base: "block",
22
+ defaultVariants: { isError: true }
23
+ });
24
+ const filterTagGroupTagWrapper = tv({
25
+ base: [
26
+ button({ buttonStyle: "outline" }),
27
+ `
28
+ focus-visible:outline
29
+ focus-visible:outline-offset-2
30
+ focus-visible:outline-2
31
+ focus-visible:outline-black
32
+ `
33
+ ],
34
+ variants: {
35
+ isSelected: {
36
+ true: [button({ buttonStyle: "default" })]
37
+ },
38
+ isDisabled: {
39
+ true: "pointer-events-none opacity-30"
40
+ }
41
+ }
42
+ });
43
+ const filterTagGroupTagContainer = tv({
44
+ extend: typography,
45
+ base: "flex items-center justify-center"
46
+ });
47
+ const filterPopoverButton = tv({
48
+ extend: button,
49
+ base: "!min-w-[200px]"
50
+ });
51
+ const filterPopoverPopover = tv({
52
+ base: "w-[var(--filter-popover-container-width)] bg-gray-300 rounded-md p-4"
53
+ });
54
+ const filterTheme = {
55
+ popover: {
56
+ button: filterPopoverButton,
57
+ popover: filterPopoverPopover
58
+ },
59
+ tagGroup: {
60
+ wrapper: filterTagGroupWrapper,
61
+ tags: filterTagGroupTags,
62
+ label: filterTagGroupLabel,
63
+ description: filterTagGroupDescription,
64
+ errorMessage: filterTagGroupErrorMessage,
65
+ tag: {
66
+ wrapper: filterTagGroupTagWrapper,
67
+ container: filterTagGroupTagContainer
68
+ }
69
+ }
70
+ };
71
+ export {
72
+ filterTheme as default
73
+ };
@@ -0,0 +1,233 @@
1
+ declare const typography: import('tailwind-variants').TVReturnType<{
2
+ size: {
3
+ h1: string;
4
+ h2: string;
5
+ h3: string;
6
+ h4: string;
7
+ h5: string;
8
+ h6: string;
9
+ leading: string;
10
+ paragraph: string;
11
+ footnotes: string;
12
+ xs: string;
13
+ };
14
+ font: {
15
+ body: string;
16
+ };
17
+ weight: {
18
+ normal: string;
19
+ light: string;
20
+ bold: string;
21
+ };
22
+ color: {
23
+ gray: string;
24
+ white: string;
25
+ };
26
+ isError: {
27
+ true: string;
28
+ };
29
+ align: {
30
+ center: string;
31
+ left: string;
32
+ right: string;
33
+ };
34
+ }, undefined, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
35
+ size: {
36
+ h1: string;
37
+ h2: string;
38
+ h3: string;
39
+ h4: string;
40
+ h5: string;
41
+ h6: string;
42
+ leading: string;
43
+ paragraph: string;
44
+ footnotes: string;
45
+ xs: string;
46
+ };
47
+ font: {
48
+ body: string;
49
+ };
50
+ weight: {
51
+ normal: string;
52
+ light: string;
53
+ bold: string;
54
+ };
55
+ color: {
56
+ gray: string;
57
+ white: string;
58
+ };
59
+ isError: {
60
+ true: string;
61
+ };
62
+ align: {
63
+ center: string;
64
+ left: string;
65
+ right: string;
66
+ };
67
+ }, {
68
+ size: {
69
+ h1: string;
70
+ h2: string;
71
+ h3: string;
72
+ h4: string;
73
+ h5: string;
74
+ h6: string;
75
+ leading: string;
76
+ paragraph: string;
77
+ footnotes: string;
78
+ xs: string;
79
+ };
80
+ font: {
81
+ body: string;
82
+ };
83
+ weight: {
84
+ normal: string;
85
+ light: string;
86
+ bold: string;
87
+ };
88
+ color: {
89
+ gray: string;
90
+ white: string;
91
+ };
92
+ isError: {
93
+ true: string;
94
+ };
95
+ align: {
96
+ center: string;
97
+ left: string;
98
+ right: string;
99
+ };
100
+ }>, {
101
+ size: {
102
+ h1: string;
103
+ h2: string;
104
+ h3: string;
105
+ h4: string;
106
+ h5: string;
107
+ h6: string;
108
+ leading: string;
109
+ paragraph: string;
110
+ footnotes: string;
111
+ xs: string;
112
+ };
113
+ font: {
114
+ body: string;
115
+ };
116
+ weight: {
117
+ normal: string;
118
+ light: string;
119
+ bold: string;
120
+ };
121
+ color: {
122
+ gray: string;
123
+ white: string;
124
+ };
125
+ isError: {
126
+ true: string;
127
+ };
128
+ align: {
129
+ center: string;
130
+ left: string;
131
+ right: string;
132
+ };
133
+ }, undefined, import('tailwind-variants').TVReturnType<{
134
+ size: {
135
+ h1: string;
136
+ h2: string;
137
+ h3: string;
138
+ h4: string;
139
+ h5: string;
140
+ h6: string;
141
+ leading: string;
142
+ paragraph: string;
143
+ footnotes: string;
144
+ xs: string;
145
+ };
146
+ font: {
147
+ body: string;
148
+ };
149
+ weight: {
150
+ normal: string;
151
+ light: string;
152
+ bold: string;
153
+ };
154
+ color: {
155
+ gray: string;
156
+ white: string;
157
+ };
158
+ isError: {
159
+ true: string;
160
+ };
161
+ align: {
162
+ center: string;
163
+ left: string;
164
+ right: string;
165
+ };
166
+ }, undefined, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
167
+ size: {
168
+ h1: string;
169
+ h2: string;
170
+ h3: string;
171
+ h4: string;
172
+ h5: string;
173
+ h6: string;
174
+ leading: string;
175
+ paragraph: string;
176
+ footnotes: string;
177
+ xs: string;
178
+ };
179
+ font: {
180
+ body: string;
181
+ };
182
+ weight: {
183
+ normal: string;
184
+ light: string;
185
+ bold: string;
186
+ };
187
+ color: {
188
+ gray: string;
189
+ white: string;
190
+ };
191
+ isError: {
192
+ true: string;
193
+ };
194
+ align: {
195
+ center: string;
196
+ left: string;
197
+ right: string;
198
+ };
199
+ }, {
200
+ size: {
201
+ h1: string;
202
+ h2: string;
203
+ h3: string;
204
+ h4: string;
205
+ h5: string;
206
+ h6: string;
207
+ leading: string;
208
+ paragraph: string;
209
+ footnotes: string;
210
+ xs: string;
211
+ };
212
+ font: {
213
+ body: string;
214
+ };
215
+ weight: {
216
+ normal: string;
217
+ light: string;
218
+ bold: string;
219
+ };
220
+ color: {
221
+ gray: string;
222
+ white: string;
223
+ };
224
+ isError: {
225
+ true: string;
226
+ };
227
+ align: {
228
+ center: string;
229
+ left: string;
230
+ right: string;
231
+ };
232
+ }>, unknown, unknown, undefined>>;
233
+ export default typography;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ const tailwindVariants = require("tailwind-variants");
3
+ const typography = tailwindVariants.tv({
4
+ variants: {
5
+ size: {
6
+ h1: `text-5xl`,
7
+ h2: `text-4xl`,
8
+ h3: `text-3xl`,
9
+ h4: `text-2xl`,
10
+ h5: `text-xl`,
11
+ h6: `text-lg`,
12
+ leading: `text-md font-bold leading-normal`,
13
+ paragraph: `text-md inline`,
14
+ footnotes: `text-sm`,
15
+ xs: `text-xs`
16
+ },
17
+ font: {
18
+ body: `font-body`
19
+ },
20
+ weight: {
21
+ normal: `font-normal`,
22
+ light: `font-light`,
23
+ bold: "font-bold"
24
+ },
25
+ color: {
26
+ gray: `text-gray-500`,
27
+ white: `text-white`
28
+ },
29
+ isError: {
30
+ true: "text-sm text-error py-3"
31
+ },
32
+ align: {
33
+ center: "text-center",
34
+ left: "text-left",
35
+ right: "text-right"
36
+ }
37
+ },
38
+ defaultVariants: {
39
+ size: "paragraph",
40
+ font: "body"
41
+ }
42
+ });
43
+ module.exports = typography;
@@ -0,0 +1,44 @@
1
+ import { tv } from "tailwind-variants";
2
+ const typography = tv({
3
+ variants: {
4
+ size: {
5
+ h1: `text-5xl`,
6
+ h2: `text-4xl`,
7
+ h3: `text-3xl`,
8
+ h4: `text-2xl`,
9
+ h5: `text-xl`,
10
+ h6: `text-lg`,
11
+ leading: `text-md font-bold leading-normal`,
12
+ paragraph: `text-md inline`,
13
+ footnotes: `text-sm`,
14
+ xs: `text-xs`
15
+ },
16
+ font: {
17
+ body: `font-body`
18
+ },
19
+ weight: {
20
+ normal: `font-normal`,
21
+ light: `font-light`,
22
+ bold: "font-bold"
23
+ },
24
+ color: {
25
+ gray: `text-gray-500`,
26
+ white: `text-white`
27
+ },
28
+ isError: {
29
+ true: "text-sm text-error py-3"
30
+ },
31
+ align: {
32
+ center: "text-center",
33
+ left: "text-left",
34
+ right: "text-right"
35
+ }
36
+ },
37
+ defaultVariants: {
38
+ size: "paragraph",
39
+ font: "body"
40
+ }
41
+ });
42
+ export {
43
+ typography as default
44
+ };
package/theme/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- declare const _default: import('react').MemoExoticComponent<({ children }: {
1
+ import { default as React } from 'react';
2
+
3
+ declare const _default: React.MemoExoticComponent<({ children }: {
2
4
  children: React.ReactNode;
3
5
  }) => import("react/jsx-runtime").JSX.Element>;
4
6
  export default _default;
package/theme/index.js ADDED
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ "use strict";
3
+ const stackUi = require("@okam/stack-ui");
4
+ const React = require("react");
5
+ const index$1 = require("./AdminBar/index.js");
6
+ const index$3 = require("./Button/index.js");
7
+ const index$4 = require("./Filter/index.js");
8
+ const index$2 = require("./Typography/index.js");
9
+ const BaseTheme = stackUi.makeTheme({
10
+ filter: index$4,
11
+ button: index$3,
12
+ typography: index$2,
13
+ adminBar: index$1.adminBarTheme
14
+ });
15
+ const index = React.memo(stackUi.createThemeProvider(BaseTheme));
16
+ module.exports = index;
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { makeTheme, createThemeProvider } from "@okam/stack-ui";
3
+ import React from "react";
4
+ import { adminBarTheme } from "./AdminBar/index.mjs";
5
+ import button from "./Button/index.mjs";
6
+ import filterTheme from "./Filter/index.mjs";
7
+ import typography from "./Typography/index.mjs";
8
+ const BaseTheme = makeTheme({
9
+ filter: filterTheme,
10
+ button,
11
+ typography,
12
+ adminBar: adminBarTheme
13
+ });
14
+ const index = React.memo(createThemeProvider(BaseTheme));
15
+ export {
16
+ index as default
17
+ };