@darthcharles/greda 1.0.0 → 1.2.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.
- package/README.md +51 -0
- package/THIRD_PARTY_NOTICES.md +2 -1
- package/dist/components/ui/popover.d.ts +22 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +243 -189
- package/dist/index.js.map +1 -1
- package/dist/styles.css +36 -1
- package/dist/themes/cobalto.css +53 -0
- package/dist/themes/comal.css +37 -0
- package/dist/tokens.css +83 -0
- package/dist/utils.js +13 -7
- package/dist/utils.js.map +1 -1
- package/package.json +13 -3
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* Optional Comal theme: override generic base colors only. Greda owns
|
|
2
|
+
all surface, text, border, and component color assignments. Fonts and shape
|
|
3
|
+
are separate, optional customizations. */
|
|
4
|
+
:where([data-theme="comal"]) {
|
|
5
|
+
--base-white: 40 60% 96.078%;
|
|
6
|
+
--base-black: 37.5 10.256% 15.294%;
|
|
7
|
+
--base-gray-50: 42.857 100% 98.627%;
|
|
8
|
+
--base-gray-100: 36.923 37.143% 93.137%;
|
|
9
|
+
--base-gray-200: 38.824 27.869% 88.039%;
|
|
10
|
+
--base-gray-300: 33.103 19.205% 70.392%;
|
|
11
|
+
--base-gray-500: 41.25 7.273% 43.137%;
|
|
12
|
+
--base-gray-600: 30 15.476% 32.941%;
|
|
13
|
+
--base-gray-800: 30 16.216% 14.51%;
|
|
14
|
+
--base-gray-900: 30 17.857% 10.98%;
|
|
15
|
+
--base-primary: 9.5 55.556% 42.353%;
|
|
16
|
+
--base-primary-hover: 9.714 56.15% 36.667%;
|
|
17
|
+
--base-secondary: 25.385 56.522% 90.98%;
|
|
18
|
+
--base-tertiary: 85.714 29.167% 90.588%;
|
|
19
|
+
--base-accent: 85.714 29.167% 90.588%;
|
|
20
|
+
--base-destructive: 6.512 57.848% 43.725%;
|
|
21
|
+
--font-sans: "DM Sans Variable", "DM Sans", sans-serif;
|
|
22
|
+
--font-heading: "Fraunces Variable", "Fraunces", serif;
|
|
23
|
+
--radius: 0.75rem;
|
|
24
|
+
--radius-sm: 0.375rem;
|
|
25
|
+
--radius-lg: 1.5rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Complementary dark palette. Put both attributes on the theme boundary. */
|
|
29
|
+
:where([data-theme="comal"][data-color-scheme="dark"]) {
|
|
30
|
+
--base-white: 34.286 51.22% 91.961%;
|
|
31
|
+
--base-primary: 15.625 75% 74.902%;
|
|
32
|
+
--base-primary-hover: 15.789 77.551% 80.784%;
|
|
33
|
+
--base-secondary: 22.5 24.49% 19.216%;
|
|
34
|
+
--base-tertiary: 108 14.286% 20.588%;
|
|
35
|
+
--base-accent: 108 14.286% 20.588%;
|
|
36
|
+
--base-destructive: 7.174 79.31% 77.255%;
|
|
37
|
+
}
|
package/dist/tokens.css
CHANGED
|
@@ -64,6 +64,41 @@
|
|
|
64
64
|
--z-toast: 70;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/* Complete typography roles. Rebind font and scale aliases at theme boundaries
|
|
68
|
+
so scoped font overrides resolve locally. Colors and casing stay independent. */
|
|
69
|
+
:where(:root, [data-theme], [data-color-scheme]) {
|
|
70
|
+
--type-display-family: var(--font-heading);
|
|
71
|
+
--type-display-size: clamp(2.25rem, 4.8vw, 3.5rem);
|
|
72
|
+
--type-display-weight: 500;
|
|
73
|
+
--type-display-leading: 1.1;
|
|
74
|
+
--type-display-tracking: -0.04em;
|
|
75
|
+
--type-title-family: var(--font-heading);
|
|
76
|
+
--type-title-size: clamp(1.75rem, 3vw, 2.25rem);
|
|
77
|
+
--type-title-weight: 500;
|
|
78
|
+
--type-title-leading: 1.2;
|
|
79
|
+
--type-title-tracking: normal;
|
|
80
|
+
--type-body-family: var(--font-sans);
|
|
81
|
+
--type-body-size: 1rem;
|
|
82
|
+
--type-body-weight: 400;
|
|
83
|
+
--type-body-leading: 1.5;
|
|
84
|
+
--type-body-tracking: normal;
|
|
85
|
+
--type-label-family: var(--font-sans);
|
|
86
|
+
--type-label-size: var(--font-size-sm);
|
|
87
|
+
--type-label-weight: var(--font-weight-medium);
|
|
88
|
+
--type-label-leading: var(--line-height);
|
|
89
|
+
--type-label-tracking: normal;
|
|
90
|
+
--type-caption-family: var(--font-sans);
|
|
91
|
+
--type-caption-size: var(--font-size-xs);
|
|
92
|
+
--type-caption-weight: 400;
|
|
93
|
+
--type-caption-leading: var(--line-height);
|
|
94
|
+
--type-caption-tracking: normal;
|
|
95
|
+
--type-eyebrow-family: var(--font-sans);
|
|
96
|
+
--type-eyebrow-size: var(--font-size-xs);
|
|
97
|
+
--type-eyebrow-weight: var(--font-weight-bold);
|
|
98
|
+
--type-eyebrow-leading: var(--line-height);
|
|
99
|
+
--type-eyebrow-tracking: 0.1em;
|
|
100
|
+
}
|
|
101
|
+
|
|
67
102
|
/* Rebind roles at theme boundaries so scoped base overrides update every role.
|
|
68
103
|
Low specificity lets consumers supply base colors in either import order. */
|
|
69
104
|
:where(:root, [data-theme], [data-color-scheme]) {
|
|
@@ -227,6 +262,54 @@
|
|
|
227
262
|
|
|
228
263
|
@custom-variant dark (&:where([data-color-scheme="dark"], [data-color-scheme="dark"] *));
|
|
229
264
|
|
|
265
|
+
@utility text-display {
|
|
266
|
+
font-family: var(--type-display-family);
|
|
267
|
+
font-size: var(--type-display-size);
|
|
268
|
+
font-weight: var(--type-display-weight);
|
|
269
|
+
line-height: var(--type-display-leading);
|
|
270
|
+
letter-spacing: var(--type-display-tracking);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@utility text-title {
|
|
274
|
+
font-family: var(--type-title-family);
|
|
275
|
+
font-size: var(--type-title-size);
|
|
276
|
+
font-weight: var(--type-title-weight);
|
|
277
|
+
line-height: var(--type-title-leading);
|
|
278
|
+
letter-spacing: var(--type-title-tracking);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
@utility text-body {
|
|
282
|
+
font-family: var(--type-body-family);
|
|
283
|
+
font-size: var(--type-body-size);
|
|
284
|
+
font-weight: var(--type-body-weight);
|
|
285
|
+
line-height: var(--type-body-leading);
|
|
286
|
+
letter-spacing: var(--type-body-tracking);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@utility text-label {
|
|
290
|
+
font-family: var(--type-label-family);
|
|
291
|
+
font-size: var(--type-label-size);
|
|
292
|
+
font-weight: var(--type-label-weight);
|
|
293
|
+
line-height: var(--type-label-leading);
|
|
294
|
+
letter-spacing: var(--type-label-tracking);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
@utility text-caption {
|
|
298
|
+
font-family: var(--type-caption-family);
|
|
299
|
+
font-size: var(--type-caption-size);
|
|
300
|
+
font-weight: var(--type-caption-weight);
|
|
301
|
+
line-height: var(--type-caption-leading);
|
|
302
|
+
letter-spacing: var(--type-caption-tracking);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
@utility text-eyebrow {
|
|
306
|
+
font-family: var(--type-eyebrow-family);
|
|
307
|
+
font-size: var(--type-eyebrow-size);
|
|
308
|
+
font-weight: var(--type-eyebrow-weight);
|
|
309
|
+
line-height: var(--type-eyebrow-leading);
|
|
310
|
+
letter-spacing: var(--type-eyebrow-tracking);
|
|
311
|
+
}
|
|
312
|
+
|
|
230
313
|
@utility bg-* {
|
|
231
314
|
background-color: hsl(--value(--greda-bg-*));
|
|
232
315
|
background-color: hsl(--value(--greda-bg-*) / calc(--modifier(integer) * 1%));
|
package/dist/utils.js
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { clsx as
|
|
2
|
-
import { extendTailwindMerge as
|
|
3
|
-
const
|
|
1
|
+
import { clsx as r } from "clsx";
|
|
2
|
+
import { extendTailwindMerge as t } from "tailwind-merge";
|
|
3
|
+
const o = t({
|
|
4
4
|
extend: {
|
|
5
5
|
classGroups: {
|
|
6
|
-
"bg-color": [{ surface: ["primary", "secondary", "tertiary", "raised", "inverse"] }]
|
|
6
|
+
"bg-color": [{ surface: ["primary", "secondary", "tertiary", "raised", "inverse"] }],
|
|
7
|
+
typography: [{ text: ["display", "title", "body", "label", "caption", "eyebrow"] }]
|
|
8
|
+
},
|
|
9
|
+
// A later complete role replaces earlier typography axes. A later single
|
|
10
|
+
// axis keeps the role so its other properties still apply.
|
|
11
|
+
conflictingClassGroups: {
|
|
12
|
+
typography: ["font-family", "font-size", "font-weight", "leading", "tracking"]
|
|
7
13
|
}
|
|
8
14
|
}
|
|
9
15
|
});
|
|
10
|
-
function
|
|
11
|
-
return
|
|
16
|
+
function a(...e) {
|
|
17
|
+
return o(r(e));
|
|
12
18
|
}
|
|
13
19
|
export {
|
|
14
|
-
|
|
20
|
+
a as cn
|
|
15
21
|
};
|
|
16
22
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\nconst twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n \"bg-color\": [{ surface: [\"primary\", \"secondary\", \"tertiary\", \"raised\", \"inverse\"] }],\n },\n },\n});\n\n/** Combine conditional classes and resolve conflicting Tailwind utilities. */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"names":["twMerge","extendTailwindMerge","cn","inputs","clsx"],"mappings":";;AAGA,MAAMA,IAAUC,
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\nconst twMerge = extendTailwindMerge<\"typography\">({\n extend: {\n classGroups: {\n \"bg-color\": [{ surface: [\"primary\", \"secondary\", \"tertiary\", \"raised\", \"inverse\"] }],\n typography: [{ text: [\"display\", \"title\", \"body\", \"label\", \"caption\", \"eyebrow\"] }],\n },\n // A later complete role replaces earlier typography axes. A later single\n // axis keeps the role so its other properties still apply.\n conflictingClassGroups: {\n typography: [\"font-family\", \"font-size\", \"font-weight\", \"leading\", \"tracking\"],\n },\n },\n});\n\n/** Combine conditional classes and resolve conflicting Tailwind utilities. */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"names":["twMerge","extendTailwindMerge","cn","inputs","clsx"],"mappings":";;AAGA,MAAMA,IAAUC,EAAkC;AAAA,EAChD,QAAQ;AAAA,IACN,aAAa;AAAA,MACX,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,aAAa,YAAY,UAAU,SAAS,GAAG;AAAA,MACnF,YAAY,CAAC,EAAE,MAAM,CAAC,WAAW,SAAS,QAAQ,SAAS,WAAW,SAAS,EAAA,CAAG;AAAA,IAAA;AAAA;AAAA;AAAA,IAIpF,wBAAwB;AAAA,MACtB,YAAY,CAAC,eAAe,aAAa,eAAe,WAAW,UAAU;AAAA,IAAA;AAAA,EAC/E;AAEJ,CAAC;AAGM,SAASC,KAAMC,GAAsB;AAC1C,SAAOH,EAAQI,EAAKD,CAAM,CAAC;AAC7B;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darthcharles/greda",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Generic React components with a complete, overridable base theme.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/DarthCharles/greda.git"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
7
14
|
"files": [
|
|
8
15
|
"dist",
|
|
9
16
|
"README.md",
|
|
@@ -24,7 +31,9 @@
|
|
|
24
31
|
"import": "./dist/utils.js"
|
|
25
32
|
},
|
|
26
33
|
"./styles.css": "./dist/styles.css",
|
|
27
|
-
"./tokens.css": "./dist/tokens.css"
|
|
34
|
+
"./tokens.css": "./dist/tokens.css",
|
|
35
|
+
"./themes/cobalto.css": "./dist/themes/cobalto.css",
|
|
36
|
+
"./themes/comal.css": "./dist/themes/comal.css"
|
|
28
37
|
},
|
|
29
38
|
"sideEffects": [
|
|
30
39
|
"**/*.css"
|
|
@@ -46,7 +55,7 @@
|
|
|
46
55
|
"validate:package": "node scripts/validate-package.mjs",
|
|
47
56
|
"check": "npm run typecheck && npm test && npm run validate:stories && npm run build && npm run validate:package && npm run build-storybook",
|
|
48
57
|
"changeset": "changeset",
|
|
49
|
-
"version-packages": "changeset version",
|
|
58
|
+
"version-packages": "changeset version && npm install --package-lock-only --ignore-scripts",
|
|
50
59
|
"release": "npm run check && changeset publish",
|
|
51
60
|
"prepack": "npm run build",
|
|
52
61
|
"test:browser": "playwright test",
|
|
@@ -56,6 +65,7 @@
|
|
|
56
65
|
"@radix-ui/react-checkbox": "^1.0.0",
|
|
57
66
|
"@radix-ui/react-dialog": "^1.0.0",
|
|
58
67
|
"@radix-ui/react-label": "^2.1.17",
|
|
68
|
+
"@radix-ui/react-popover": "^1.3.1",
|
|
59
69
|
"@radix-ui/react-select": "^2.4.1",
|
|
60
70
|
"@radix-ui/react-slot": "^1.0.0",
|
|
61
71
|
"@radix-ui/react-tabs": "^1.0.0",
|