@c15t/dev-tools 0.0.1-rc.3 → 0.0.1-rc.4

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 (107) hide show
  1. package/README.md +1 -1
  2. package/dist/components/error-state.cjs +87 -115
  3. package/dist/components/error-state.css +51 -0
  4. package/dist/components/error-state.d.ts +5 -6
  5. package/dist/components/error-state.d.ts.map +1 -1
  6. package/dist/components/error-state.js +61 -107
  7. package/dist/components/header.cjs +54 -77
  8. package/dist/components/header.css +29 -0
  9. package/dist/components/header.d.ts +4 -5
  10. package/dist/components/header.d.ts.map +1 -1
  11. package/dist/components/header.js +28 -53
  12. package/dist/components/ui/accordion.cjs +64 -107
  13. package/dist/components/ui/accordion.css +72 -0
  14. package/dist/components/ui/accordion.d.ts +6 -32
  15. package/dist/components/ui/accordion.d.ts.map +1 -1
  16. package/dist/components/ui/accordion.js +36 -81
  17. package/dist/components/ui/alert.cjs +62 -93
  18. package/dist/components/ui/alert.css +59 -0
  19. package/dist/components/ui/alert.d.ts +7 -22
  20. package/dist/components/ui/alert.d.ts.map +1 -1
  21. package/dist/components/ui/alert.js +34 -64
  22. package/dist/components/ui/badge.cjs +61 -0
  23. package/dist/components/ui/badge.css +52 -0
  24. package/dist/components/ui/badge.d.ts +11 -0
  25. package/dist/components/ui/badge.d.ts.map +1 -0
  26. package/dist/components/ui/badge.js +26 -0
  27. package/dist/components/ui/button.cjs +65 -85
  28. package/dist/components/ui/button.css +87 -0
  29. package/dist/components/ui/button.d.ts +9 -24
  30. package/dist/components/ui/button.d.ts.map +1 -1
  31. package/dist/components/ui/button.js +38 -53
  32. package/dist/components/ui/card.cjs +65 -106
  33. package/dist/components/ui/card.css +41 -0
  34. package/dist/components/ui/card.d.ts +9 -29
  35. package/dist/components/ui/card.d.ts.map +1 -1
  36. package/dist/components/ui/card.js +35 -94
  37. package/dist/components/ui/error-state.css +34 -0
  38. package/dist/components/ui/expandable-tabs.cjs +117 -182
  39. package/dist/components/ui/expandable-tabs.css +57 -0
  40. package/dist/components/ui/expandable-tabs.d.ts +14 -20
  41. package/dist/components/ui/expandable-tabs.d.ts.map +1 -1
  42. package/dist/components/ui/expandable-tabs.js +91 -159
  43. package/dist/components/ui/logo.cjs +101 -0
  44. package/dist/components/ui/logo.d.ts +8 -0
  45. package/dist/components/ui/logo.d.ts.map +1 -0
  46. package/dist/components/ui/logo.js +67 -0
  47. package/dist/components/ui/scroll-area.cjs +54 -94
  48. package/dist/components/ui/scroll-area.css +42 -0
  49. package/dist/components/ui/scroll-area.d.ts +4 -17
  50. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  51. package/dist/components/ui/scroll-area.js +28 -72
  52. package/dist/components/ui/switch.cjs +38 -60
  53. package/dist/components/ui/switch.css +49 -0
  54. package/dist/components/ui/switch.d.ts +3 -9
  55. package/dist/components/ui/switch.d.ts.map +1 -1
  56. package/dist/components/ui/switch.js +13 -31
  57. package/dist/components/ui/tooltip.cjs +41 -61
  58. package/dist/components/ui/tooltip.css +101 -0
  59. package/dist/components/ui/tooltip.d.ts +6 -14
  60. package/dist/components/ui/tooltip.d.ts.map +1 -1
  61. package/dist/components/ui/tooltip.js +16 -36
  62. package/dist/components/wrapper.cjs +144 -185
  63. package/dist/components/wrapper.css +90 -0
  64. package/dist/components/wrapper.d.ts +8 -12
  65. package/dist/components/wrapper.d.ts.map +1 -1
  66. package/dist/components/wrapper.js +117 -161
  67. package/dist/dev-tool.cjs +110 -150
  68. package/dist/dev-tool.d.ts +8 -7
  69. package/dist/dev-tool.d.ts.map +1 -1
  70. package/dist/dev-tool.js +70 -106
  71. package/dist/index.cjs +27 -37
  72. package/dist/index.d.ts +2 -3
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +3 -4
  75. package/dist/libs/utils.cjs +42 -57
  76. package/dist/libs/utils.d.ts +1 -1
  77. package/dist/libs/utils.js +3 -5
  78. package/dist/router/router.cjs +145 -265
  79. package/dist/router/router.d.ts +3 -5
  80. package/dist/router/router.d.ts.map +1 -1
  81. package/dist/router/router.js +119 -256
  82. package/dist/styles/theme.css +42 -0
  83. package/package.json +2 -2
  84. package/.turbo/turbo-build.log +0 -56
  85. package/.turbo/turbo-fmt.log +0 -6
  86. package/.turbo/turbo-lint.log +0 -73
  87. package/dist/components/ui/overlay.cjs +0 -69
  88. package/dist/components/ui/overlay.d.ts +0 -7
  89. package/dist/components/ui/overlay.d.ts.map +0 -1
  90. package/dist/components/ui/overlay.js +0 -28
  91. package/rslib.config.ts +0 -28
  92. package/src/components/error-state.tsx +0 -44
  93. package/src/components/header.tsx +0 -28
  94. package/src/components/ui/accordion.tsx +0 -64
  95. package/src/components/ui/alert.tsx +0 -59
  96. package/src/components/ui/button.tsx +0 -56
  97. package/src/components/ui/card.tsx +0 -81
  98. package/src/components/ui/expandable-tabs.tsx +0 -174
  99. package/src/components/ui/overlay.tsx +0 -21
  100. package/src/components/ui/scroll-area.tsx +0 -52
  101. package/src/components/ui/switch.tsx +0 -28
  102. package/src/components/ui/tooltip.tsx +0 -32
  103. package/src/components/wrapper.tsx +0 -103
  104. package/src/dev-tool.tsx +0 -117
  105. package/src/index.ts +0 -3
  106. package/src/libs/utils.ts +0 -6
  107. package/src/router/router.tsx +0 -164
@@ -1,278 +1,158 @@
1
1
  'use client';
2
- 'use strict';
2
+ "use strict";
3
3
  var __webpack_require__ = {};
4
- (() => {
5
- __webpack_require__.d = function (exports1, definition) {
6
- for (var key in definition)
7
- if (
8
- __webpack_require__.o(definition, key) &&
9
- !__webpack_require__.o(exports1, key)
10
- )
11
- Object.defineProperty(exports1, key, {
12
- enumerable: true,
13
- get: definition[key],
14
- });
15
- };
4
+ (()=>{
5
+ __webpack_require__.d = function(exports1, definition) {
6
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ get: definition[key]
9
+ });
10
+ };
16
11
  })();
17
- (() => {
18
- __webpack_require__.o = function (obj, prop) {
19
- return Object.prototype.hasOwnProperty.call(obj, prop);
20
- };
12
+ (()=>{
13
+ __webpack_require__.o = function(obj, prop) {
14
+ return Object.prototype.hasOwnProperty.call(obj, prop);
15
+ };
21
16
  })();
22
- (() => {
23
- __webpack_require__.r = function (exports1) {
24
- if ('undefined' != typeof Symbol && Symbol.toStringTag)
25
- Object.defineProperty(exports1, Symbol.toStringTag, {
26
- value: 'Module',
27
- });
28
- Object.defineProperty(exports1, '__esModule', {
29
- value: true,
30
- });
31
- };
17
+ (()=>{
18
+ __webpack_require__.r = function(exports1) {
19
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
20
+ value: 'Module'
21
+ });
22
+ Object.defineProperty(exports1, '__esModule', {
23
+ value: true
24
+ });
25
+ };
32
26
  })();
33
27
  var __webpack_exports__ = {};
34
28
  __webpack_require__.r(__webpack_exports__);
35
29
  __webpack_require__.d(__webpack_exports__, {
36
- Router: () => Router,
30
+ Router: ()=>Router
37
31
  });
38
- const jsx_runtime_namespaceObject = require('react/jsx-runtime');
39
- const external_lucide_react_namespaceObject = require('lucide-react');
40
- const react_namespaceObject = require('motion/react');
41
- const external_react_namespaceObject = require('react');
42
- const button_cjs_namespaceObject = require('../components/ui/button.cjs');
43
- const expandable_tabs_cjs_namespaceObject = require('../components/ui/expandable-tabs.cjs');
44
- const scroll_area_cjs_namespaceObject = require('../components/ui/scroll-area.cjs');
45
- const external_dev_tool_cjs_namespaceObject = require('../dev-tool.cjs');
46
- const utils_cjs_namespaceObject = require('../libs/utils.cjs');
32
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
33
+ const external_lucide_react_namespaceObject = require("lucide-react");
34
+ const react_namespaceObject = require("motion/react");
35
+ const external_react_namespaceObject = require("react");
36
+ const expandable_tabs_cjs_namespaceObject = require("../components/ui/expandable-tabs.cjs");
37
+ const scroll_area_cjs_namespaceObject = require("../components/ui/scroll-area.cjs");
38
+ const external_dev_tool_cjs_namespaceObject = require("../dev-tool.cjs");
39
+ const badge_cjs_namespaceObject = require("../components/ui/badge.cjs");
47
40
  const tabs = [
48
- {
49
- title: 'Consents',
50
- icon: external_lucide_react_namespaceObject.ToggleLeft,
51
- },
52
- {
53
- title: 'Compliance',
54
- icon: external_lucide_react_namespaceObject.GanttChartSquare,
55
- },
41
+ {
42
+ title: 'Consents',
43
+ icon: external_lucide_react_namespaceObject.ToggleLeft
44
+ },
45
+ {
46
+ title: 'Compliance',
47
+ icon: external_lucide_react_namespaceObject.GanttChartSquare
48
+ }
56
49
  ];
57
- function Router({ onClose }) {
58
- const privacyConsent = (0, external_dev_tool_cjs_namespaceObject.getStore)();
59
- const { clearAllData, setIsPrivacyDialogOpen, setShowPopup } = privacyConsent;
60
- const [activeSection, setActiveSection] = (0,
61
- external_react_namespaceObject.useState)('Consents');
62
- const handleTabChange = (0, external_react_namespaceObject.useCallback)(
63
- (index) => {
64
- if (null !== index) setActiveSection(tabs[index].title);
65
- },
66
- []
67
- );
68
- const renderingState = [
69
- {
70
- componentName: 'MarketingContent',
71
- consentType: 'marketing',
72
- },
73
- {
74
- componentName: 'AnalyticsContent',
75
- consentType: 'measurement',
76
- },
77
- {
78
- componentName: 'PersonalizationComponent',
79
- consentType: 'ad_personalization',
80
- },
81
- ];
82
- const contentItems =
83
- 'Consents' === activeSection
84
- ? Object.entries(privacyConsent.consents).map(([name, value]) => ({
85
- title: name,
86
- status: value ? 'Enabled' : 'Disabled',
87
- }))
88
- : 'Compliance' === activeSection
89
- ? Object.entries(privacyConsent.complianceSettings).map(
90
- ([region, settings]) => ({
91
- title: region,
92
- status: settings.enabled ? 'Active' : 'Inactive',
93
- })
94
- )
95
- : 'Conditional' === activeSection
96
- ? renderingState.map((item) => ({
97
- title: item.componentName,
98
- status: 'Rendered',
99
- details: `Requires: ${item.consentType}`,
100
- }))
101
- : [];
102
- const handleResetConsent = (0,
103
- external_react_namespaceObject.useCallback)(() => {
104
- clearAllData();
105
- onClose();
106
- }, [clearAllData, onClose]);
107
- const handleOpenPrivacyModal = (0,
108
- external_react_namespaceObject.useCallback)(() => {
109
- setIsPrivacyDialogOpen(true);
110
- }, [setIsPrivacyDialogOpen]);
111
- const handleOpenCookiePopup = (0,
112
- external_react_namespaceObject.useCallback)(() => {
113
- setShowPopup(true);
114
- }, [setShowPopup]);
115
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
116
- jsx_runtime_namespaceObject.Fragment,
117
- {
118
- children: [
119
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)('div', {
120
- className: 'border-b p-4',
121
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
122
- expandable_tabs_cjs_namespaceObject.ExpandableTabs,
123
- {
124
- tabs: Array.from(tabs),
125
- activeColor: 'text-primary',
126
- className: 'border-muted',
127
- onChange: handleTabChange,
128
- }
129
- ),
130
- }),
131
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
132
- scroll_area_cjs_namespaceObject.ScrollArea,
133
- {
134
- className: 'h-[300px]',
135
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
136
- react_namespaceObject.motion.div,
137
- {
138
- className: 'space-y-2 p-4',
139
- initial: {
140
- opacity: 0,
141
- },
142
- animate: {
143
- opacity: 1,
144
- },
145
- exit: {
146
- opacity: 0,
147
- },
148
- children: contentItems.map((item, index) =>
149
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
150
- react_namespaceObject.motion.div,
151
- {
152
- className:
153
- 'flex items-center justify-between rounded-lg border bg-card p-3',
154
- initial: {
155
- opacity: 0,
156
- y: 20,
157
- },
158
- animate: {
159
- opacity: 1,
160
- y: 0,
161
- },
162
- transition: {
163
- delay: 0.05 * index,
164
- },
165
- children: [
166
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
167
- 'div',
168
- {
169
- className: 'flex flex-col',
170
- children: [
171
- /*#__PURE__*/ (0,
172
- jsx_runtime_namespaceObject.jsx)('span', {
173
- className: 'font-medium text-sm',
174
- children: item.title,
175
- }),
176
- item.details &&
177
- /*#__PURE__*/ (0,
178
- jsx_runtime_namespaceObject.jsx)('span', {
179
- className: 'text-muted-foreground text-xs',
180
- children: item.details,
181
- }),
182
- ],
183
- }
184
- ),
185
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
186
- 'span',
187
- {
188
- className: (0, utils_cjs_namespaceObject.cn)(
189
- 'rounded-full px-2 py-1 text-xs',
190
- 'Enabled' === item.status ||
191
- 'Active' === item.status ||
192
- 'active' === item.status ||
193
- 'Rendered' === item.status
194
- ? 'bg-green-100 text-green-800'
195
- : 'bg-red-100 text-red-800'
196
- ),
197
- children: item.status,
198
- }
199
- ),
200
- ],
201
- },
202
- `${activeSection}-${item.title}`
203
- )
204
- ),
205
- }
206
- ),
207
- }
208
- ),
209
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)('div', {
210
- className: 'border-t p-4',
211
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)('div', {
212
- className: 'flex flex-col gap-2',
213
- children: [
214
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
215
- button_cjs_namespaceObject.Button,
216
- {
217
- variant: 'outline',
218
- size: 'sm',
219
- onClick: handleResetConsent,
220
- children: [
221
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
222
- external_lucide_react_namespaceObject.RefreshCw,
223
- {
224
- className: 'mr-2 h-4 w-4',
225
- }
226
- ),
227
- 'Reset Local Storage Consent',
228
- ],
229
- }
230
- ),
231
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
232
- button_cjs_namespaceObject.Button,
233
- {
234
- variant: 'outline',
235
- size: 'sm',
236
- onClick: handleOpenPrivacyModal,
237
- children: [
238
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
239
- external_lucide_react_namespaceObject.FileText,
240
- {
241
- className: 'mr-2 h-4 w-4',
242
- }
243
- ),
244
- 'Open Privacy Settings',
245
- ],
246
- }
247
- ),
248
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
249
- button_cjs_namespaceObject.Button,
250
- {
251
- variant: 'outline',
252
- size: 'sm',
253
- onClick: handleOpenCookiePopup,
254
- children: [
255
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
256
- external_lucide_react_namespaceObject.Cookie,
257
- {
258
- className: 'mr-2 h-4 w-4',
259
- }
260
- ),
261
- 'Open Cookie Popup',
262
- ],
263
- }
264
- ),
265
- ],
266
- }),
267
- }),
268
- ],
269
- }
270
- );
50
+ function Router({ onClose: _onClose }) {
51
+ const privacyConsent = (0, external_dev_tool_cjs_namespaceObject.getStore)();
52
+ const [activeSection, setActiveSection] = (0, external_react_namespaceObject.useState)('Consents');
53
+ const handleTabChange = (0, external_react_namespaceObject.useCallback)((index)=>{
54
+ if (null !== index) setActiveSection(tabs[index].title);
55
+ }, []);
56
+ const renderingState = [
57
+ {
58
+ componentName: 'MarketingContent',
59
+ consentType: 'marketing'
60
+ },
61
+ {
62
+ componentName: 'AnalyticsContent',
63
+ consentType: 'measurement'
64
+ },
65
+ {
66
+ componentName: 'PersonalizationComponent',
67
+ consentType: 'ad_personalization'
68
+ }
69
+ ];
70
+ const contentItems = (()=>{
71
+ switch(activeSection){
72
+ case 'Consents':
73
+ return Object.entries(privacyConsent.consents).map(([name, value])=>({
74
+ title: name,
75
+ status: value ? 'Enabled' : 'Disabled'
76
+ }));
77
+ case 'Compliance':
78
+ return Object.entries(privacyConsent.complianceSettings).map(([region, settings])=>({
79
+ title: region,
80
+ status: settings.enabled ? 'Active' : 'Inactive'
81
+ }));
82
+ case 'Conditional':
83
+ return renderingState.map((item)=>({
84
+ title: item.componentName,
85
+ status: 'Rendered',
86
+ details: `Requires: ${item.consentType}`
87
+ }));
88
+ default:
89
+ return [];
90
+ }
91
+ })();
92
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
93
+ children: [
94
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
95
+ className: "border-b p-4",
96
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(expandable_tabs_cjs_namespaceObject.ExpandableTabs, {
97
+ tabs: Array.from(tabs),
98
+ activeColor: "text-primary",
99
+ className: "border-muted",
100
+ onChange: handleTabChange
101
+ })
102
+ }),
103
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(scroll_area_cjs_namespaceObject.ScrollArea, {
104
+ className: "h-[300px]",
105
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.motion.div, {
106
+ className: "space-y-2 p-4",
107
+ initial: {
108
+ opacity: 0
109
+ },
110
+ animate: {
111
+ opacity: 1
112
+ },
113
+ exit: {
114
+ opacity: 0
115
+ },
116
+ children: contentItems.map((item, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_namespaceObject.motion.div, {
117
+ className: "flex items-center justify-between rounded-lg border bg-card p-3",
118
+ initial: {
119
+ opacity: 0,
120
+ y: 20
121
+ },
122
+ animate: {
123
+ opacity: 1,
124
+ y: 0
125
+ },
126
+ transition: {
127
+ delay: 0.05 * index
128
+ },
129
+ children: [
130
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
131
+ className: "flex flex-col",
132
+ children: [
133
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
134
+ className: "font-medium text-sm",
135
+ children: item.title
136
+ }),
137
+ item.details && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
138
+ className: "text-muted-foreground text-xs",
139
+ children: item.details
140
+ })
141
+ ]
142
+ }),
143
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(badge_cjs_namespaceObject.Badge, {
144
+ variant: 'Enabled' === item.status || 'Active' === item.status || 'active' === item.status || 'Rendered' === item.status ? 'default' : 'destructive',
145
+ children: item.status
146
+ })
147
+ ]
148
+ }, `${activeSection}-${item.title}`))
149
+ })
150
+ })
151
+ ]
152
+ });
271
153
  }
272
154
  var __webpack_export_target__ = exports;
273
- for (var __webpack_i__ in __webpack_exports__)
274
- __webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
275
- if (__webpack_exports__.__esModule)
276
- Object.defineProperty(__webpack_export_target__, '__esModule', {
277
- value: true,
278
- });
155
+ for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
156
+ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
157
+ value: true
158
+ });
@@ -1,8 +1,6 @@
1
1
  interface RouterProps {
2
- onClose: () => void;
2
+ onClose: () => void;
3
3
  }
4
- export declare function Router({
5
- onClose,
6
- }: RouterProps): import('react/jsx-runtime').JSX.Element;
4
+ export declare function Router({ onClose: _onClose }: RouterProps): import("react/jsx-runtime").JSX.Element;
7
5
  export {};
8
- //# sourceMappingURL=router.d.ts.map
6
+ //# sourceMappingURL=router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.tsx"],"names":[],"mappings":"AAgCA,UAAU,WAAW;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,WAAW,2CA+H9C"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.tsx"],"names":[],"mappings":"AAyBA,UAAU,WAAW;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,WAAW,2CAkIxD"}