@c15t/dev-tools 0.0.1-rc.10
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/CHANGELOG.md +23 -0
- package/LICENSE.md +595 -0
- package/README.md +47 -0
- package/dist/components/error-state.cjs +98 -0
- package/dist/components/error-state.css +51 -0
- package/dist/components/error-state.d.ts +5 -0
- package/dist/components/error-state.d.ts.map +1 -0
- package/dist/components/error-state.js +64 -0
- package/dist/components/header.cjs +65 -0
- package/dist/components/header.css +29 -0
- package/dist/components/header.d.ts +7 -0
- package/dist/components/header.d.ts.map +1 -0
- package/dist/components/header.js +31 -0
- package/dist/components/ui/accordion.cjs +76 -0
- package/dist/components/ui/accordion.css +72 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +39 -0
- package/dist/components/ui/alert.cjs +73 -0
- package/dist/components/ui/alert.css +59 -0
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +37 -0
- package/dist/components/ui/badge.cjs +61 -0
- package/dist/components/ui/badge.css +52 -0
- package/dist/components/ui/badge.d.ts +11 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +26 -0
- package/dist/components/ui/button.cjs +75 -0
- package/dist/components/ui/button.css +87 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +40 -0
- package/dist/components/ui/card.cjs +79 -0
- package/dist/components/ui/card.css +41 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +40 -0
- package/dist/components/ui/error-state.css +34 -0
- package/dist/components/ui/expandable-tabs.cjs +136 -0
- package/dist/components/ui/expandable-tabs.css +57 -0
- package/dist/components/ui/expandable-tabs.d.ts +23 -0
- package/dist/components/ui/expandable-tabs.d.ts.map +1 -0
- package/dist/components/ui/expandable-tabs.js +102 -0
- package/dist/components/ui/logo.cjs +101 -0
- package/dist/components/ui/logo.d.ts +8 -0
- package/dist/components/ui/logo.d.ts.map +1 -0
- package/dist/components/ui/logo.js +67 -0
- package/dist/components/ui/scroll-area.cjs +65 -0
- package/dist/components/ui/scroll-area.css +42 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +30 -0
- package/dist/components/ui/switch.cjs +49 -0
- package/dist/components/ui/switch.css +49 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +15 -0
- package/dist/components/ui/tooltip.cjs +55 -0
- package/dist/components/ui/tooltip.css +101 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +18 -0
- package/dist/components/wrapper.cjs +156 -0
- package/dist/components/wrapper.css +90 -0
- package/dist/components/wrapper.d.ts +20 -0
- package/dist/components/wrapper.d.ts.map +1 -0
- package/dist/components/wrapper.js +121 -0
- package/dist/dev-tool.cjs +124 -0
- package/dist/dev-tool.d.ts +15 -0
- package/dist/dev-tool.d.ts.map +1 -0
- package/dist/dev-tool.js +74 -0
- package/dist/index.cjs +36 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/libs/utils.cjs +54 -0
- package/dist/libs/utils.d.ts +3 -0
- package/dist/libs/utils.d.ts.map +1 -0
- package/dist/libs/utils.js +6 -0
- package/dist/router/router.cjs +158 -0
- package/dist/router/router.d.ts +6 -0
- package/dist/router/router.d.ts.map +1 -0
- package/dist/router/router.js +124 -0
- package/dist/styles/theme.css +42 -0
- package/package.json +49 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__ from "lucide-react";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__ from "motion/react";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__components_ui_expandable_tabs_js_ecd49e25__ from "../components/ui/expandable-tabs.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__components_ui_scroll_area_js_68572765__ from "../components/ui/scroll-area.js";
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__dev_tool_js_649ec346__ from "../dev-tool.js";
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE__components_ui_badge_js_d7eff882__ from "../components/ui/badge.js";
|
|
10
|
+
const tabs = [
|
|
11
|
+
{
|
|
12
|
+
title: 'Consents',
|
|
13
|
+
icon: __WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.ToggleLeft
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
title: 'Compliance',
|
|
17
|
+
icon: __WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.GanttChartSquare
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
function Router({ onClose: _onClose }) {
|
|
21
|
+
const privacyConsent = (0, __WEBPACK_EXTERNAL_MODULE__dev_tool_js_649ec346__.getStore)();
|
|
22
|
+
const [activeSection, setActiveSection] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)('Consents');
|
|
23
|
+
const handleTabChange = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((index)=>{
|
|
24
|
+
if (null !== index) setActiveSection(tabs[index].title);
|
|
25
|
+
}, []);
|
|
26
|
+
const renderingState = [
|
|
27
|
+
{
|
|
28
|
+
componentName: 'MarketingContent',
|
|
29
|
+
consentType: 'marketing'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
componentName: 'AnalyticsContent',
|
|
33
|
+
consentType: 'measurement'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
componentName: 'PersonalizationComponent',
|
|
37
|
+
consentType: 'ad_personalization'
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
const contentItems = (()=>{
|
|
41
|
+
switch(activeSection){
|
|
42
|
+
case 'Consents':
|
|
43
|
+
return Object.entries(privacyConsent.consents).map(([name, value])=>({
|
|
44
|
+
title: name,
|
|
45
|
+
status: value ? 'Enabled' : 'Disabled'
|
|
46
|
+
}));
|
|
47
|
+
case 'Compliance':
|
|
48
|
+
return Object.entries(privacyConsent.complianceSettings).map(([region, settings])=>({
|
|
49
|
+
title: region,
|
|
50
|
+
status: settings.enabled ? 'Active' : 'Inactive'
|
|
51
|
+
}));
|
|
52
|
+
case 'Conditional':
|
|
53
|
+
return renderingState.map((item)=>({
|
|
54
|
+
title: item.componentName,
|
|
55
|
+
status: 'Rendered',
|
|
56
|
+
details: `Requires: ${item.consentType}`
|
|
57
|
+
}));
|
|
58
|
+
default:
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
})();
|
|
62
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
65
|
+
className: "border-b p-4",
|
|
66
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__components_ui_expandable_tabs_js_ecd49e25__.ExpandableTabs, {
|
|
67
|
+
tabs: Array.from(tabs),
|
|
68
|
+
activeColor: "text-primary",
|
|
69
|
+
className: "border-muted",
|
|
70
|
+
onChange: handleTabChange
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__components_ui_scroll_area_js_68572765__.ScrollArea, {
|
|
74
|
+
className: "h-[300px]",
|
|
75
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.motion.div, {
|
|
76
|
+
className: "space-y-2 p-4",
|
|
77
|
+
initial: {
|
|
78
|
+
opacity: 0
|
|
79
|
+
},
|
|
80
|
+
animate: {
|
|
81
|
+
opacity: 1
|
|
82
|
+
},
|
|
83
|
+
exit: {
|
|
84
|
+
opacity: 0
|
|
85
|
+
},
|
|
86
|
+
children: contentItems.map((item, index)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.motion.div, {
|
|
87
|
+
className: "flex items-center justify-between rounded-lg border bg-card p-3",
|
|
88
|
+
initial: {
|
|
89
|
+
opacity: 0,
|
|
90
|
+
y: 20
|
|
91
|
+
},
|
|
92
|
+
animate: {
|
|
93
|
+
opacity: 1,
|
|
94
|
+
y: 0
|
|
95
|
+
},
|
|
96
|
+
transition: {
|
|
97
|
+
delay: 0.05 * index
|
|
98
|
+
},
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
|
|
101
|
+
className: "flex flex-col",
|
|
102
|
+
children: [
|
|
103
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
104
|
+
className: "font-medium text-sm",
|
|
105
|
+
children: item.title
|
|
106
|
+
}),
|
|
107
|
+
item.details && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
108
|
+
className: "text-muted-foreground text-xs",
|
|
109
|
+
children: item.details
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__components_ui_badge_js_d7eff882__.Badge, {
|
|
114
|
+
variant: 'Enabled' === item.status || 'Active' === item.status || 'active' === item.status || 'Rendered' === item.status ? 'default' : 'destructive',
|
|
115
|
+
children: item.status
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
}, `${activeSection}-${item.title}`))
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
export { Router };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.c15t-devtool-wrapper-overlay {
|
|
2
|
+
--c15t-dev-tools-background: #fff;
|
|
3
|
+
--c15t-dev-tools-foreground: #171717;
|
|
4
|
+
--c15t-dev-tools-primary: #171717;
|
|
5
|
+
--c15t-dev-tools-primary-foreground: #fff;
|
|
6
|
+
--c15t-dev-tools-secondary: #f5f5f5;
|
|
7
|
+
--c15t-dev-tools-secondary-foreground: #171717;
|
|
8
|
+
--c15t-dev-tools-accent: #f5f5f5;
|
|
9
|
+
--c15t-dev-tools-accent-foreground: #171717;
|
|
10
|
+
--c15t-dev-tools-muted: #f5f5f5;
|
|
11
|
+
--c15t-dev-tools-muted-foreground: #5c5c5c;
|
|
12
|
+
--c15t-dev-tools-card: #fff;
|
|
13
|
+
--c15t-dev-tools-card-foreground: #171717;
|
|
14
|
+
--c15t-dev-tools-border: #ebebeb;
|
|
15
|
+
--c15t-dev-tools-input: #ebebeb;
|
|
16
|
+
--c15t-dev-tools-ring: #5c5c5c;
|
|
17
|
+
--c15t-dev-tools-destructive: #ef4343;
|
|
18
|
+
--c15t-dev-tools-destructive-foreground: #fff;
|
|
19
|
+
--c15t-dev-tools-overlay: #0003;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.dark .c15t-devtool-wrapper-overlay {
|
|
23
|
+
--c15t-dev-tools-background: #1a1a1a;
|
|
24
|
+
--c15t-dev-tools-foreground: #e6e6e6;
|
|
25
|
+
--c15t-dev-tools-primary: #e6e6e6;
|
|
26
|
+
--c15t-dev-tools-primary-foreground: #1a1a1a;
|
|
27
|
+
--c15t-dev-tools-secondary: #333;
|
|
28
|
+
--c15t-dev-tools-secondary-foreground: #e6e6e6;
|
|
29
|
+
--c15t-dev-tools-accent: #333;
|
|
30
|
+
--c15t-dev-tools-accent-foreground: #e6e6e6;
|
|
31
|
+
--c15t-dev-tools-muted: #333;
|
|
32
|
+
--c15t-dev-tools-muted-foreground: #999;
|
|
33
|
+
--c15t-dev-tools-card: #1a1a1a;
|
|
34
|
+
--c15t-dev-tools-card-foreground: #e6e6e6;
|
|
35
|
+
--c15t-dev-tools-border: #333;
|
|
36
|
+
--c15t-dev-tools-input: #333;
|
|
37
|
+
--c15t-dev-tools-ring: #999;
|
|
38
|
+
--c15t-dev-tools-destructive: #8d0c0c;
|
|
39
|
+
--c15t-dev-tools-destructive-foreground: #e6e6e6;
|
|
40
|
+
--c15t-dev-tools-overlay: #00000080;
|
|
41
|
+
}
|
|
42
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@c15t/dev-tools",
|
|
3
|
+
"version": "0.0.1-rc.10",
|
|
4
|
+
"license": "GPL-3.0-only",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"browserslist": [
|
|
10
|
+
">0.2%",
|
|
11
|
+
"not dead",
|
|
12
|
+
"not op_mini all"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@radix-ui/react-accordion": "1.2.3",
|
|
16
|
+
"@radix-ui/react-scroll-area": "^1.2.3",
|
|
17
|
+
"@radix-ui/react-slot": "1.1.2",
|
|
18
|
+
"@radix-ui/react-switch": "1.1.3",
|
|
19
|
+
"@radix-ui/react-tooltip": "^1.1.8",
|
|
20
|
+
"class-variance-authority": "^0.7.1",
|
|
21
|
+
"clsx": "2.1.1",
|
|
22
|
+
"lucide-react": "^0.475.0",
|
|
23
|
+
"motion": "^12.4.7",
|
|
24
|
+
"react-draggable": "^4.4.6",
|
|
25
|
+
"tailwind-merge": "3.0.2",
|
|
26
|
+
"tsc-alias": "^1.8.10",
|
|
27
|
+
"usehooks-ts": "^3.1.1",
|
|
28
|
+
"zustand": "^5.0.3",
|
|
29
|
+
"c15t": "0.0.1-rc.10"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"postcss": "^8.5.3",
|
|
33
|
+
"@c15t/typescript-config": "0.0.1-beta.1"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
37
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "rslib build",
|
|
44
|
+
"check-types": "tsc --noEmit",
|
|
45
|
+
"dev": "rslib build --watch",
|
|
46
|
+
"fmt": "pnpm biome format --write .",
|
|
47
|
+
"lint": "pnpm biome lint ./src"
|
|
48
|
+
}
|
|
49
|
+
}
|
package/tsconfig.json
ADDED