uniskin 0.0.1 → 0.3.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/LICENSE +21 -0
- package/README.md +122 -1
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +9 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/css.d.ts +25 -0
- package/dist/cli/css.d.ts.map +1 -0
- package/dist/cli/css.js +68 -0
- package/dist/cli/css.js.map +1 -0
- package/dist/cli/init.d.ts +20 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +92 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/main.d.ts +5 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +85 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/new-adapter.d.ts +11 -0
- package/dist/cli/new-adapter.d.ts.map +1 -0
- package/dist/cli/new-adapter.js +66 -0
- package/dist/cli/new-adapter.js.map +1 -0
- package/dist/cli/project.d.ts +30 -0
- package/dist/cli/project.d.ts.map +1 -0
- package/dist/cli/project.js +158 -0
- package/dist/cli/project.js.map +1 -0
- package/dist/default-theme.d.ts +948 -0
- package/dist/default-theme.d.ts.map +1 -0
- package/dist/default-theme.js +944 -0
- package/dist/default-theme.js.map +1 -0
- package/dist/emit.d.ts +23 -0
- package/dist/emit.d.ts.map +1 -0
- package/dist/emit.js +105 -0
- package/dist/emit.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/merge.d.ts +49 -0
- package/dist/merge.d.ts.map +1 -0
- package/dist/merge.js +188 -0
- package/dist/merge.js.map +1 -0
- package/dist/types.d.ts +94 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +44 -0
- package/dist/types.js.map +1 -0
- package/package.json +56 -4
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Uniskin adapter interface.
|
|
3
|
+
*
|
|
4
|
+
* An adapter is a plain object describing how the `ui-*` vocabulary looks.
|
|
5
|
+
* Adapters are deep-merged over the built-in default theme: anything an
|
|
6
|
+
* adapter does not define silently falls back to the default style.
|
|
7
|
+
*/
|
|
8
|
+
/** A flat map of CSS declarations. Keys are CSS property names. */
|
|
9
|
+
export type CssDeclarations = Record<string, string>;
|
|
10
|
+
/**
|
|
11
|
+
* CSS rules for one compound selector, expressed as CSS-in-JS.
|
|
12
|
+
* Nested selectors (`&:hover`, `&::after`, `@media …`) are supported —
|
|
13
|
+
* they are resolved relative to the compound selector (e.g.
|
|
14
|
+
* `.ui-button.ui-outline:hover`).
|
|
15
|
+
*/
|
|
16
|
+
export interface CssRuleObject {
|
|
17
|
+
[key: string]: string | CssRuleObject | undefined;
|
|
18
|
+
}
|
|
19
|
+
/** Intent modifiers: `.ui-primary`, `.ui-secondary`, … */
|
|
20
|
+
export declare const INTENTS: readonly ["primary", "secondary", "success", "warning", "danger"];
|
|
21
|
+
export type Intent = (typeof INTENTS)[number];
|
|
22
|
+
/** Style modifiers: `.ui-outline`, `.ui-ghost`, `.ui-soft` (`solid` is the default). */
|
|
23
|
+
export declare const STYLES: readonly ["outline", "ghost", "soft"];
|
|
24
|
+
export type StyleModifier = (typeof STYLES)[number];
|
|
25
|
+
/** Size modifiers: `.ui-sm`, `.ui-lg` (`md` is the default). */
|
|
26
|
+
export declare const SIZES: readonly ["sm", "lg"];
|
|
27
|
+
export type SizeModifier = (typeof SIZES)[number];
|
|
28
|
+
/** State modifiers: `.ui-disabled`, `.ui-loading`, `.ui-active`. */
|
|
29
|
+
export declare const STATES: readonly ["disabled", "loading", "active"];
|
|
30
|
+
export type StateModifier = (typeof STATES)[number];
|
|
31
|
+
/**
|
|
32
|
+
* A component (or component part) definition.
|
|
33
|
+
*
|
|
34
|
+
* Every slot maps to a compound selector on the component class:
|
|
35
|
+
* - `base` → `.ui-button`
|
|
36
|
+
* - `intents.primary` → `.ui-button.ui-primary`
|
|
37
|
+
* - `styles.outline` → `.ui-button.ui-outline`
|
|
38
|
+
* - `sizes.sm` → `.ui-button.ui-sm`
|
|
39
|
+
* - `states.disabled` → `.ui-button.ui-disabled`, `.ui-button:disabled`,
|
|
40
|
+
* `.ui-button[aria-disabled="true"]`
|
|
41
|
+
*/
|
|
42
|
+
export interface ComponentDef {
|
|
43
|
+
/** Rules for `.ui-<name>`. */
|
|
44
|
+
base?: CssRuleObject;
|
|
45
|
+
/** Rules for `.ui-<name>.ui-<intent>` — usually just sets `--ui-*` vars. */
|
|
46
|
+
intents?: Partial<Record<Intent, CssRuleObject>>;
|
|
47
|
+
/** Rules for `.ui-<name>.ui-<style>`. */
|
|
48
|
+
styles?: Partial<Record<StyleModifier, CssRuleObject>>;
|
|
49
|
+
/** Rules for `.ui-<name>.ui-<size>`. */
|
|
50
|
+
sizes?: Partial<Record<SizeModifier, CssRuleObject>>;
|
|
51
|
+
/**
|
|
52
|
+
* Rules for `.ui-<name>.ui-<state>` — emitted together with the native
|
|
53
|
+
* equivalents (`:disabled`, `[aria-disabled]`, `[aria-busy]`,
|
|
54
|
+
* `[aria-selected]`, `[aria-pressed]`).
|
|
55
|
+
*/
|
|
56
|
+
states?: Partial<Record<StateModifier, CssRuleObject>>;
|
|
57
|
+
}
|
|
58
|
+
/** Component names shipped in vocabulary v1. */
|
|
59
|
+
export declare const VOCABULARY: readonly ["button", "input", "textarea", "select", "checkbox", "radio", "switch", "field", "field-label", "field-hint", "field-error", "card", "card-header", "card-body", "card-footer", "badge", "alert", "modal", "modal-box", "tabs", "tab"];
|
|
60
|
+
export type ComponentName = (typeof VOCABULARY)[number];
|
|
61
|
+
export interface Adapter {
|
|
62
|
+
/** Adapter name, used in build warnings. */
|
|
63
|
+
name: string;
|
|
64
|
+
/**
|
|
65
|
+
* Design tokens — CSS custom properties emitted on `rootSelector`
|
|
66
|
+
* (`:root` by default). Deep-merged over the default tokens: set only
|
|
67
|
+
* what you want to change. Values may reference other variables
|
|
68
|
+
* (`var(--primary)`) including variables you define yourself.
|
|
69
|
+
*/
|
|
70
|
+
tokens?: Record<string, string>;
|
|
71
|
+
/**
|
|
72
|
+
* Selector the tokens are emitted under. Defaults to `":root"`.
|
|
73
|
+
* Useful for adapters that target a theme attribute, e.g. `[data-theme=x]`.
|
|
74
|
+
*/
|
|
75
|
+
rootSelector?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Token overrides for dark mode, emitted under `.dark, [data-theme="dark"]`
|
|
78
|
+
* and (unless the `dark` plugin option says otherwise) inside
|
|
79
|
+
* `@media (prefers-color-scheme: dark)`. When defined — even as `{}` — it
|
|
80
|
+
* replaces the default theme's dark tokens entirely; leave it undefined to
|
|
81
|
+
* inherit them. Adapters whose tokens already follow an external theme
|
|
82
|
+
* (daisyUI) should set `{}`. Tokens that are `var()` aliases of other
|
|
83
|
+
* variables must be repeated here so they re-resolve inside the dark scope.
|
|
84
|
+
*/
|
|
85
|
+
darkTokens?: Record<string, string>;
|
|
86
|
+
/**
|
|
87
|
+
* Per-component overrides, deep-merged over the default theme.
|
|
88
|
+
* Only define what your style changes — everything else falls back.
|
|
89
|
+
*/
|
|
90
|
+
components?: Partial<Record<ComponentName, ComponentDef>>;
|
|
91
|
+
}
|
|
92
|
+
/** Identity helper that gives adapter authors full typing + inference. */
|
|
93
|
+
export declare function defineAdapter<const A extends Adapter>(adapter: A): A;
|
|
94
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,mEAAmE;AACnE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,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4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;CAC3D;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,KAAK,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAEpE"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Uniskin adapter interface.
|
|
3
|
+
*
|
|
4
|
+
* An adapter is a plain object describing how the `ui-*` vocabulary looks.
|
|
5
|
+
* Adapters are deep-merged over the built-in default theme: anything an
|
|
6
|
+
* adapter does not define silently falls back to the default style.
|
|
7
|
+
*/
|
|
8
|
+
/** Intent modifiers: `.ui-primary`, `.ui-secondary`, … */
|
|
9
|
+
export const INTENTS = ["primary", "secondary", "success", "warning", "danger"];
|
|
10
|
+
/** Style modifiers: `.ui-outline`, `.ui-ghost`, `.ui-soft` (`solid` is the default). */
|
|
11
|
+
export const STYLES = ["outline", "ghost", "soft"];
|
|
12
|
+
/** Size modifiers: `.ui-sm`, `.ui-lg` (`md` is the default). */
|
|
13
|
+
export const SIZES = ["sm", "lg"];
|
|
14
|
+
/** State modifiers: `.ui-disabled`, `.ui-loading`, `.ui-active`. */
|
|
15
|
+
export const STATES = ["disabled", "loading", "active"];
|
|
16
|
+
/** Component names shipped in vocabulary v1. */
|
|
17
|
+
export const VOCABULARY = [
|
|
18
|
+
"button",
|
|
19
|
+
"input",
|
|
20
|
+
"textarea",
|
|
21
|
+
"select",
|
|
22
|
+
"checkbox",
|
|
23
|
+
"radio",
|
|
24
|
+
"switch",
|
|
25
|
+
"field",
|
|
26
|
+
"field-label",
|
|
27
|
+
"field-hint",
|
|
28
|
+
"field-error",
|
|
29
|
+
"card",
|
|
30
|
+
"card-header",
|
|
31
|
+
"card-body",
|
|
32
|
+
"card-footer",
|
|
33
|
+
"badge",
|
|
34
|
+
"alert",
|
|
35
|
+
"modal",
|
|
36
|
+
"modal-box",
|
|
37
|
+
"tabs",
|
|
38
|
+
"tab",
|
|
39
|
+
];
|
|
40
|
+
/** Identity helper that gives adapter authors full typing + inference. */
|
|
41
|
+
export function defineAdapter(adapter) {
|
|
42
|
+
return adapter;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAGzF,wFAAwF;AACxF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAG5D,gEAAgE;AAChE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,CAAU,CAAC;AAG3C,oEAAoE;AACpE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AA+BjE,gDAAgD;AAChD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ;IACR,OAAO;IACP,UAAU;IACV,QAAQ;IACR,UAAU;IACV,OAAO;IACP,QAAQ;IACR,OAAO;IACP,aAAa;IACb,YAAY;IACZ,aAAa;IACb,MAAM;IACN,aAAa;IACb,WAAW;IACX,aAAa;IACb,OAAO;IACP,OAAO;IACP,OAAO;IACP,WAAW;IACX,MAAM;IACN,KAAK;CACG,CAAC;AAmCX,0EAA0E;AAC1E,MAAM,UAAU,aAAa,CAA0B,OAAU;IAC/D,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniskin",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "One semantic class vocabulary, swappable Tailwind CSS v4 UI skins
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "One semantic class vocabulary, swappable Tailwind CSS v4 UI skins",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"uniskin": "./dist/cli/bin.js"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./adapter": {
|
|
17
|
+
"types": "./dist/types.d.ts",
|
|
18
|
+
"default": "./dist/types.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"tailwindcss",
|
|
26
|
+
"tailwind",
|
|
27
|
+
"css",
|
|
28
|
+
"ui",
|
|
29
|
+
"theme",
|
|
30
|
+
"adapter"
|
|
31
|
+
],
|
|
5
32
|
"license": "MIT",
|
|
6
|
-
"repository":
|
|
7
|
-
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/Munawarhussain729/uniskin.git",
|
|
36
|
+
"directory": "packages/uniskin"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/Munawarhussain729/uniskin#readme",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/Munawarhussain729/uniskin/issues"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"tailwindcss": "^4.3.3"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^26.6.6",
|
|
50
|
+
"tailwindcss": "^4.3.5",
|
|
51
|
+
"typescript": "^5.9.3",
|
|
52
|
+
"vitest": "^3.2.4"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsc -p tsconfig.json",
|
|
56
|
+
"test": "vitest run",
|
|
57
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
58
|
+
}
|
|
59
|
+
}
|