@flanksource/clicky-ui 0.1.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.
@@ -0,0 +1,64 @@
1
+ //#region src/tailwind-preset.ts
2
+ const preset = {
3
+ darkMode: ["selector", "[data-theme=\"dark\"]"],
4
+ theme: { extend: {
5
+ colors: {
6
+ border: "hsl(var(--border))",
7
+ input: "hsl(var(--input))",
8
+ ring: "hsl(var(--ring))",
9
+ background: "hsl(var(--background))",
10
+ foreground: "hsl(var(--foreground))",
11
+ primary: {
12
+ DEFAULT: "hsl(var(--primary))",
13
+ foreground: "hsl(var(--primary-foreground))"
14
+ },
15
+ secondary: {
16
+ DEFAULT: "hsl(var(--secondary))",
17
+ foreground: "hsl(var(--secondary-foreground))"
18
+ },
19
+ destructive: {
20
+ DEFAULT: "hsl(var(--destructive))",
21
+ foreground: "hsl(var(--destructive-foreground))"
22
+ },
23
+ muted: {
24
+ DEFAULT: "hsl(var(--muted))",
25
+ foreground: "hsl(var(--muted-foreground))"
26
+ },
27
+ accent: {
28
+ DEFAULT: "hsl(var(--accent))",
29
+ foreground: "hsl(var(--accent-foreground))"
30
+ },
31
+ popover: {
32
+ DEFAULT: "hsl(var(--popover))",
33
+ foreground: "hsl(var(--popover-foreground))"
34
+ },
35
+ card: {
36
+ DEFAULT: "hsl(var(--card))",
37
+ foreground: "hsl(var(--card-foreground))"
38
+ }
39
+ },
40
+ borderRadius: {
41
+ lg: "var(--radius)",
42
+ md: "calc(var(--radius) - 2px)",
43
+ sm: "calc(var(--radius) - 4px)"
44
+ },
45
+ spacing: {
46
+ "control-h": "var(--control-height)",
47
+ "control-px": "var(--control-padding-x)",
48
+ "density-1": "var(--spacing-unit)",
49
+ "density-2": "calc(var(--spacing-unit) * 2)",
50
+ "density-3": "calc(var(--spacing-unit) * 3)",
51
+ "density-4": "calc(var(--spacing-unit) * 4)"
52
+ },
53
+ fontSize: { "density-base": "var(--font-size-base)" }
54
+ } },
55
+ plugins: [({ addVariant }) => {
56
+ addVariant("density-compact", "[data-density=\"compact\"] &");
57
+ addVariant("density-comfortable", "[data-density=\"comfortable\"] &");
58
+ addVariant("density-spacious", "[data-density=\"spacious\"] &");
59
+ }]
60
+ };
61
+
62
+ //#endregion
63
+ export { preset as default };
64
+ //# sourceMappingURL=tailwind-preset.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tailwind-preset.mjs","names":[],"sources":["../src/tailwind-preset.ts"],"sourcesContent":["import type { Config } from \"tailwindcss\";\n\nconst preset: Partial<Config> = {\n darkMode: [\"selector\", '[data-theme=\"dark\"]'],\n theme: {\n extend: {\n colors: {\n border: \"hsl(var(--border))\",\n input: \"hsl(var(--input))\",\n ring: \"hsl(var(--ring))\",\n background: \"hsl(var(--background))\",\n foreground: \"hsl(var(--foreground))\",\n primary: {\n DEFAULT: \"hsl(var(--primary))\",\n foreground: \"hsl(var(--primary-foreground))\",\n },\n secondary: {\n DEFAULT: \"hsl(var(--secondary))\",\n foreground: \"hsl(var(--secondary-foreground))\",\n },\n destructive: {\n DEFAULT: \"hsl(var(--destructive))\",\n foreground: \"hsl(var(--destructive-foreground))\",\n },\n muted: {\n DEFAULT: \"hsl(var(--muted))\",\n foreground: \"hsl(var(--muted-foreground))\",\n },\n accent: {\n DEFAULT: \"hsl(var(--accent))\",\n foreground: \"hsl(var(--accent-foreground))\",\n },\n popover: {\n DEFAULT: \"hsl(var(--popover))\",\n foreground: \"hsl(var(--popover-foreground))\",\n },\n card: {\n DEFAULT: \"hsl(var(--card))\",\n foreground: \"hsl(var(--card-foreground))\",\n },\n },\n borderRadius: {\n lg: \"var(--radius)\",\n md: \"calc(var(--radius) - 2px)\",\n sm: \"calc(var(--radius) - 4px)\",\n },\n spacing: {\n \"control-h\": \"var(--control-height)\",\n \"control-px\": \"var(--control-padding-x)\",\n \"density-1\": \"var(--spacing-unit)\",\n \"density-2\": \"calc(var(--spacing-unit) * 2)\",\n \"density-3\": \"calc(var(--spacing-unit) * 3)\",\n \"density-4\": \"calc(var(--spacing-unit) * 4)\",\n },\n fontSize: {\n \"density-base\": \"var(--font-size-base)\",\n },\n },\n },\n plugins: [\n ({ addVariant }: { addVariant: (name: string, selector: string) => void }) => {\n addVariant(\"density-compact\", '[data-density=\"compact\"] &');\n addVariant(\"density-comfortable\", '[data-density=\"comfortable\"] &');\n addVariant(\"density-spacious\", '[data-density=\"spacious\"] &');\n },\n ],\n};\n\nexport default preset;\n"],"mappings":";AAEA,MAAM,SAA0B;CAC9B,UAAU,CAAC,YAAY,wBAAsB;CAC7C,OAAO,EACL,QAAQ;EACN,QAAQ;GACN,QAAQ;GACR,OAAO;GACP,MAAM;GACN,YAAY;GACZ,YAAY;GACZ,SAAS;IACP,SAAS;IACT,YAAY;IACb;GACD,WAAW;IACT,SAAS;IACT,YAAY;IACb;GACD,aAAa;IACX,SAAS;IACT,YAAY;IACb;GACD,OAAO;IACL,SAAS;IACT,YAAY;IACb;GACD,QAAQ;IACN,SAAS;IACT,YAAY;IACb;GACD,SAAS;IACP,SAAS;IACT,YAAY;IACb;GACD,MAAM;IACJ,SAAS;IACT,YAAY;IACb;GACF;EACD,cAAc;GACZ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,SAAS;GACP,aAAa;GACb,cAAc;GACd,aAAa;GACb,aAAa;GACb,aAAa;GACb,aAAa;GACd;EACD,UAAU,EACR,gBAAgB,yBACjB;EACF,EACF;CACD,SAAS,EACN,EAAE,iBAA2E;AAC5E,aAAW,mBAAmB,+BAA6B;AAC3D,aAAW,uBAAuB,mCAAiC;AACnE,aAAW,oBAAoB,gCAA8B;GAEhE;CACF"}
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@flanksource/clicky-ui",
3
+ "version": "0.1.0",
4
+ "description": "Flanksource Clicky UI — React component library built on shadcn/ui with light/dark and density theming.",
5
+ "homepage": "https://github.com/flanksource/clicky-ui#readme",
6
+ "bugs": "https://github.com/flanksource/clicky-ui/issues",
7
+ "license": "Apache-2.0",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/flanksource/clicky-ui.git",
11
+ "directory": "packages/ui"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "src/styles",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
19
+ "type": "module",
20
+ "sideEffects": [
21
+ "**/*.css"
22
+ ],
23
+ "main": "./dist/index.mjs",
24
+ "module": "./dist/index.mjs",
25
+ "types": "./dist/index.d.mts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.mts",
29
+ "import": "./dist/index.mjs"
30
+ },
31
+ "./styles.css": "./src/styles/tokens.css",
32
+ "./tailwind-preset": {
33
+ "types": "./dist/tailwind-preset.d.mts",
34
+ "import": "./dist/tailwind-preset.mjs",
35
+ "require": "./dist/tailwind-preset.cjs",
36
+ "default": "./dist/tailwind-preset.mjs"
37
+ }
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "scripts": {
43
+ "dev": "vp dev",
44
+ "build": "vp pack src/index.ts src/tailwind-preset.ts --sourcemap --no-minify && vp pack src/tailwind-preset.ts -f cjs --no-clean --sourcemap --no-minify",
45
+ "test": "vp test",
46
+ "check": "vp check"
47
+ },
48
+ "dependencies": {
49
+ "@radix-ui/react-slot": "catalog:",
50
+ "class-variance-authority": "catalog:",
51
+ "clsx": "catalog:",
52
+ "lucide-react": "catalog:",
53
+ "tailwind-merge": "catalog:"
54
+ },
55
+ "devDependencies": {
56
+ "@storybook/react": "catalog:",
57
+ "@storybook/react-vite": "catalog:",
58
+ "@storybook/test": "catalog:",
59
+ "@testing-library/jest-dom": "catalog:",
60
+ "@testing-library/react": "catalog:",
61
+ "@types/react": "catalog:",
62
+ "@types/react-dom": "catalog:",
63
+ "jsdom": "catalog:",
64
+ "react": "catalog:",
65
+ "react-dom": "catalog:",
66
+ "tailwindcss": "catalog:",
67
+ "typescript": "catalog:",
68
+ "vite": "catalog:",
69
+ "vite-plugin-dts": "catalog:",
70
+ "vite-plus": "catalog:",
71
+ "vitest": "catalog:"
72
+ },
73
+ "peerDependencies": {
74
+ "marked": "^15.0.0",
75
+ "react": "^18.0.0 || ^19.0.0",
76
+ "react-dom": "^18.0.0 || ^19.0.0",
77
+ "tailwindcss": "^3.4.0"
78
+ },
79
+ "peerDependenciesMeta": {
80
+ "marked": {
81
+ "optional": true
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,78 @@
1
+ @layer clicky-tokens {
2
+ :root,
3
+ [data-theme="light"] {
4
+ --background: 0 0% 100%;
5
+ --foreground: 240 10% 3.9%;
6
+ --card: 0 0% 100%;
7
+ --card-foreground: 240 10% 3.9%;
8
+ --popover: 0 0% 100%;
9
+ --popover-foreground: 240 10% 3.9%;
10
+ --primary: 240 5.9% 10%;
11
+ --primary-foreground: 0 0% 98%;
12
+ --secondary: 240 4.8% 95.9%;
13
+ --secondary-foreground: 240 5.9% 10%;
14
+ --muted: 240 4.8% 95.9%;
15
+ --muted-foreground: 240 3.8% 46.1%;
16
+ --accent: 240 4.8% 95.9%;
17
+ --accent-foreground: 240 5.9% 10%;
18
+ --destructive: 0 84.2% 60.2%;
19
+ --destructive-foreground: 0 0% 98%;
20
+ --border: 240 5.9% 90%;
21
+ --input: 240 5.9% 90%;
22
+ --ring: 240 5.9% 10%;
23
+ --radius: 0.5rem;
24
+ }
25
+
26
+ [data-theme="dark"] {
27
+ --background: 240 10% 3.9%;
28
+ --foreground: 0 0% 98%;
29
+ --card: 240 10% 3.9%;
30
+ --card-foreground: 0 0% 98%;
31
+ --popover: 240 10% 3.9%;
32
+ --popover-foreground: 0 0% 98%;
33
+ --primary: 0 0% 98%;
34
+ --primary-foreground: 240 5.9% 10%;
35
+ --secondary: 240 3.7% 15.9%;
36
+ --secondary-foreground: 0 0% 98%;
37
+ --muted: 240 3.7% 15.9%;
38
+ --muted-foreground: 240 5% 64.9%;
39
+ --accent: 240 3.7% 15.9%;
40
+ --accent-foreground: 0 0% 98%;
41
+ --destructive: 0 62.8% 30.6%;
42
+ --destructive-foreground: 0 0% 98%;
43
+ --border: 240 3.7% 15.9%;
44
+ --input: 240 3.7% 15.9%;
45
+ --ring: 240 4.9% 83.9%;
46
+ }
47
+
48
+ :root,
49
+ [data-density="comfortable"] {
50
+ --spacing-unit: 0.25rem;
51
+ --control-height: 2.25rem;
52
+ --control-padding-x: 0.75rem;
53
+ --font-size-base: 0.875rem;
54
+ }
55
+
56
+ [data-density="compact"] {
57
+ --spacing-unit: 0.1875rem;
58
+ --control-height: 1.875rem;
59
+ --control-padding-x: 0.5rem;
60
+ --font-size-base: 0.8125rem;
61
+ }
62
+
63
+ [data-density="spacious"] {
64
+ --spacing-unit: 0.3125rem;
65
+ --control-height: 2.75rem;
66
+ --control-padding-x: 1rem;
67
+ --font-size-base: 1rem;
68
+ }
69
+
70
+ * {
71
+ border-color: hsl(var(--border));
72
+ }
73
+
74
+ body {
75
+ background-color: hsl(var(--background));
76
+ color: hsl(var(--foreground));
77
+ }
78
+ }