@apo100l/ace-ui-kit 0.0.0-stage → 0.0.2

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aleksandr Apostol
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,57 @@
1
- # Temporary Holding Version
1
+ # @apo100l/ace-ui-kit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Framework-agnostic admin UI kit: CSS design tokens + components (`ak-*`) and small vanilla TS
4
+ behaviours, plus an optional compatibility stylesheet for legacy Ace Admin / Bootstrap 3 markup.
5
+
6
+ > Early development (`0.x`). See [docs/ROADMAP.md](docs/ROADMAP.md).
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm i @apo100l/ace-ui-kit
12
+ ```
13
+
14
+ ```ts
15
+ import '@apo100l/ace-ui-kit/css';
16
+ // optional, while migrating old Ace/Bootstrap 3 templates:
17
+ import '@apo100l/ace-ui-kit/compat.css';
18
+ import { init } from '@apo100l/ace-ui-kit';
19
+
20
+ init(); // wires data-ak-* behaviours; call init({ root }) again after injecting HTML
21
+ ```
22
+
23
+ ```html
24
+ <button class="ak-btn ak-btn--primary">Save</button>
25
+ <div class="ak-alert ak-alert--success">Saved <button data-ak-dismiss aria-label="Close">×</button></div>
26
+ ```
27
+
28
+ ## Theming
29
+
30
+ Override tokens in your own CSS:
31
+
32
+ ```css
33
+ :root {
34
+ --ak-color-primary: #1a73e8;
35
+ --ak-font-family: 'Golos Text Variable', system-ui, sans-serif;
36
+ }
37
+ ```
38
+
39
+ SCSS sources are shipped too: `@use '@apo100l/ace-ui-kit/scss/tokens';`.
40
+
41
+ ## Development
42
+
43
+ ```bash
44
+ npm ci
45
+ npm run dev # playground (demo/index.html)
46
+ npm run build # dist/: ace-ui-kit.js, ace-ui-kit.css, ace-compat.css, *.d.ts
47
+ ```
48
+
49
+ ## Releasing
50
+
51
+ Bump `version`, merge to `main`, then publish a GitHub Release tagged `vX.Y.Z`.
52
+ `.github/workflows/publish.yml` publishes to npm via trusted publishing with provenance
53
+ (pre-releases go to the `next` dist-tag).
54
+
55
+ ## License
56
+
57
+ MIT
@@ -0,0 +1 @@
1
+ :root{--ak-color-primary: #428bca;--ak-color-primary-hover: #2a6496;--ak-color-success: #87b87f;--ak-color-info: #6fb3e0;--ak-color-warning: #ffb752;--ak-color-danger: #d15b47;--ak-color-on-accent: #fff;--ak-color-bg: #e4e6e9;--ak-color-surface: #fff;--ak-color-surface-muted: #f5f5f5;--ak-color-border: #ddd;--ak-color-text: #393939;--ak-color-text-muted: #777;--ak-font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--ak-font-size: 13px;--ak-font-size-sm: 12px;--ak-font-size-lg: 15px;--ak-line-height: 1.5;--ak-space-1: 4px;--ak-space-2: 8px;--ak-space-3: 12px;--ak-space-4: 16px;--ak-space-6: 24px;--ak-radius: 2px;--ak-focus-ring: 0 0 0 2px rgb(66 139 202 / 40%);--ak-transition: .15s ease-out}.widget-box{margin:var(--ak-space-3) 0;border:1px solid var(--ak-color-border);border-radius:var(--ak-radius);background:var(--ak-color-surface)}
@@ -0,0 +1 @@
1
+ :root{--ak-color-primary: #428bca;--ak-color-primary-hover: #2a6496;--ak-color-success: #87b87f;--ak-color-info: #6fb3e0;--ak-color-warning: #ffb752;--ak-color-danger: #d15b47;--ak-color-on-accent: #fff;--ak-color-bg: #e4e6e9;--ak-color-surface: #fff;--ak-color-surface-muted: #f5f5f5;--ak-color-border: #ddd;--ak-color-text: #393939;--ak-color-text-muted: #777;--ak-font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--ak-font-size: 13px;--ak-font-size-sm: 12px;--ak-font-size-lg: 15px;--ak-line-height: 1.5;--ak-space-1: 4px;--ak-space-2: 8px;--ak-space-3: 12px;--ak-space-4: 16px;--ak-space-6: 24px;--ak-radius: 2px;--ak-focus-ring: 0 0 0 2px rgb(66 139 202 / 40%);--ak-transition: .15s ease-out}.ak-btn{--_bg: var(--ak-color-surface-muted);--_fg: var(--ak-color-text);display:inline-flex;align-items:center;justify-content:center;gap:var(--ak-space-1);padding:var(--ak-space-1) var(--ak-space-3);border:1px solid transparent;border-radius:var(--ak-radius);background:var(--_bg);color:var(--_fg);font:inherit;font-size:var(--ak-font-size);line-height:var(--ak-line-height);text-decoration:none;cursor:pointer;transition:filter var(--ak-transition),box-shadow var(--ak-transition)}.ak-btn:hover{filter:brightness(.95)}.ak-btn:focus-visible{outline:none;box-shadow:var(--ak-focus-ring)}.ak-btn:disabled,.ak-btn[aria-disabled=true]{opacity:.6;cursor:not-allowed;filter:none}.ak-btn--primary{--_bg: var(--ak-color-primary);--_fg: var(--ak-color-on-accent)}.ak-btn--success{--_bg: var(--ak-color-success);--_fg: var(--ak-color-on-accent)}.ak-btn--info{--_bg: var(--ak-color-info);--_fg: var(--ak-color-on-accent)}.ak-btn--warning{--_bg: var(--ak-color-warning);--_fg: var(--ak-color-on-accent)}.ak-btn--danger{--_bg: var(--ak-color-danger);--_fg: var(--ak-color-on-accent)}.ak-btn--sm{padding:2px var(--ak-space-2);font-size:var(--ak-font-size-sm)}.ak-btn--lg{padding:var(--ak-space-2) var(--ak-space-4);font-size:var(--ak-font-size-lg)}.ak-btn--block{display:flex;width:100%}.ak-alert{--_accent: var(--ak-color-info);position:relative;padding:var(--ak-space-3) var(--ak-space-4);border:1px solid var(--ak-color-border);border-left:3px solid var(--_accent);border-radius:var(--ak-radius);background:var(--ak-color-surface);color:var(--ak-color-text)}.ak-alert--success{--_accent: var(--ak-color-success)}.ak-alert--info{--_accent: var(--ak-color-info)}.ak-alert--warning{--_accent: var(--ak-color-warning)}.ak-alert--danger{--_accent: var(--ak-color-danger)}.ak-alert [data-ak-dismiss]{position:absolute;top:var(--ak-space-2);right:var(--ak-space-2);border:0;background:none;color:var(--ak-color-text-muted);font-size:var(--ak-font-size-lg);line-height:1;cursor:pointer}
@@ -0,0 +1,16 @@
1
+ const e = "akBound";
2
+ function s(a = document) {
3
+ a.querySelectorAll("[data-ak-dismiss]").forEach((t) => {
4
+ t.dataset[e] || (t.dataset[e] = "1", t.addEventListener("click", () => {
5
+ t.closest("[data-ak-dismissible], .ak-alert")?.remove();
6
+ }));
7
+ });
8
+ }
9
+ function d({ root: a = document } = {}) {
10
+ s(a);
11
+ }
12
+ export {
13
+ s as dismissible,
14
+ d as init
15
+ };
16
+ //# sourceMappingURL=ace-ui-kit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ace-ui-kit.js","sources":["../src/js/dismissible.ts","../src/js/init.ts"],"sourcesContent":["const BOUND = 'akBound';\n\n/**\n * `<div class=\"ak-alert\"><button data-ak-dismiss>…</button></div>` —\n * removes the closest `[data-ak-dismissible]` (or `.ak-alert`) when the trigger is clicked.\n */\nexport function dismissible(root: ParentNode = document): void {\n root.querySelectorAll<HTMLElement>('[data-ak-dismiss]').forEach((trigger) => {\n if (trigger.dataset[BOUND]) return;\n trigger.dataset[BOUND] = '1';\n trigger.addEventListener('click', () => {\n trigger.closest('[data-ak-dismissible], .ak-alert')?.remove();\n });\n });\n}\n","import { dismissible } from './dismissible';\n\nexport interface InitOptions {\n /** Root to scan for `data-ak-*` behaviours. Defaults to `document`. */\n root?: ParentNode;\n}\n\n/**\n * Wires every declarative `data-ak-*` behaviour inside `root`.\n * Safe to call repeatedly (e.g. after injecting HTML): each behaviour marks nodes it has bound.\n */\nexport function init({ root = document }: InitOptions = {}): void {\n dismissible(root);\n}\n"],"names":["BOUND","dismissible","root","trigger","init"],"mappings":"AAAA,MAAMA,IAAQ;AAMP,SAASC,EAAYC,IAAmB,UAAgB;AAC7D,EAAAA,EAAK,iBAA8B,mBAAmB,EAAE,QAAQ,CAACC,MAAY;AAC3E,IAAIA,EAAQ,QAAQH,CAAK,MACzBG,EAAQ,QAAQH,CAAK,IAAI,KACzBG,EAAQ,iBAAiB,SAAS,MAAM;AACtC,MAAAA,EAAQ,QAAQ,kCAAkC,GAAG,OAAA;AAAA,IACvD,CAAC;AAAA,EACH,CAAC;AACH;ACHO,SAASC,EAAK,EAAE,MAAAF,IAAO,SAAA,IAA0B,CAAA,GAAU;AAChE,EAAAD,EAAYC,CAAI;AAClB;"}
@@ -0,0 +1,4 @@
1
+ import './scss/index.scss';
2
+ export { init } from './js/init';
3
+ export type { InitOptions } from './js/init';
4
+ export { dismissible } from './js/dismissible';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * `<div class="ak-alert"><button data-ak-dismiss>…</button></div>` —
3
+ * removes the closest `[data-ak-dismissible]` (or `.ak-alert`) when the trigger is clicked.
4
+ */
5
+ export declare function dismissible(root?: ParentNode): void;
@@ -0,0 +1,9 @@
1
+ export interface InitOptions {
2
+ /** Root to scan for `data-ak-*` behaviours. Defaults to `document`. */
3
+ root?: ParentNode;
4
+ }
5
+ /**
6
+ * Wires every declarative `data-ak-*` behaviour inside `root`.
7
+ * Safe to call repeatedly (e.g. after injecting HTML): each behaviour marks nodes it has bound.
8
+ */
9
+ export declare function init({ root }?: InitOptions): void;
package/package.json CHANGED
@@ -1,6 +1,63 @@
1
1
  {
2
2
  "name": "@apo100l/ace-ui-kit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "description": "Framework-agnostic admin UI kit (CSS + vanilla TS) with a compatibility layer for legacy Ace/Bootstrap 3 markup",
5
+ "license": "MIT",
6
+ "author": "Aleksandr Apostol <dev@apo100l.ru>",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/apo100l/ace-ui-kit.git"
10
+ },
11
+ "homepage": "https://github.com/apo100l/ace-ui-kit#readme",
12
+ "bugs": "https://github.com/apo100l/ace-ui-kit/issues",
13
+ "keywords": [
14
+ "admin",
15
+ "ui-kit",
16
+ "css",
17
+ "design-tokens",
18
+ "ace",
19
+ "bootstrap3"
20
+ ],
21
+ "type": "module",
22
+ "main": "./dist/ace-ui-kit.js",
23
+ "module": "./dist/ace-ui-kit.js",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/ace-ui-kit.js"
29
+ },
30
+ "./css": "./dist/ace-ui-kit.css",
31
+ "./compat.css": "./dist/ace-compat.css",
32
+ "./scss/*": "./src/scss/*",
33
+ "./package.json": "./package.json"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "!dist/ace-compat.js*",
38
+ "src/scss"
39
+ ],
40
+ "sideEffects": [
41
+ "*.css",
42
+ "*.scss"
43
+ ],
44
+ "engines": {
45
+ "node": ">=22.14"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public",
49
+ "provenance": true
50
+ },
51
+ "scripts": {
52
+ "dev": "vite",
53
+ "build": "vite build && vite build --mode compat && tsc -p tsconfig.build.json",
54
+ "typecheck": "tsc --noEmit",
55
+ "pack:check": "npm pack --dry-run",
56
+ "prepublishOnly": "npm run build"
57
+ },
58
+ "devDependencies": {
59
+ "sass": "1.97.3",
60
+ "typescript": "5.9.3",
61
+ "vite": "7.3.8"
62
+ }
63
+ }
@@ -0,0 +1,41 @@
1
+ // Design tokens. Everything themable is a CSS custom property on :root,
2
+ // so a host admin re-skins the kit by overriding variables, not by recompiling.
3
+ // Values start from the classic Ace palette (blue skin) to keep the migration visually calm.
4
+
5
+ :root {
6
+ // Palette
7
+ --ak-color-primary: #428bca;
8
+ --ak-color-primary-hover: #2a6496;
9
+ --ak-color-success: #87b87f;
10
+ --ak-color-info: #6fb3e0;
11
+ --ak-color-warning: #ffb752;
12
+ --ak-color-danger: #d15b47;
13
+ --ak-color-on-accent: #fff;
14
+
15
+ // Surfaces & text
16
+ --ak-color-bg: #e4e6e9;
17
+ --ak-color-surface: #fff;
18
+ --ak-color-surface-muted: #f5f5f5;
19
+ --ak-color-border: #ddd;
20
+ --ak-color-text: #393939;
21
+ --ak-color-text-muted: #777;
22
+
23
+ // Typography
24
+ --ak-font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
25
+ --ak-font-size: 13px;
26
+ --ak-font-size-sm: 12px;
27
+ --ak-font-size-lg: 15px;
28
+ --ak-line-height: 1.5;
29
+
30
+ // Spacing scale (4px base)
31
+ --ak-space-1: 4px;
32
+ --ak-space-2: 8px;
33
+ --ak-space-3: 12px;
34
+ --ak-space-4: 16px;
35
+ --ak-space-6: 24px;
36
+
37
+ // Shape & motion
38
+ --ak-radius: 2px;
39
+ --ak-focus-ring: 0 0 0 2px rgb(66 139 202 / 40%);
40
+ --ak-transition: 150ms ease-out;
41
+ }
@@ -0,0 +1,11 @@
1
+ // Compatibility layer: restyles legacy Ace 1.x / Bootstrap 3 class names with kit tokens,
2
+ // so an existing admin can drop ace.min.css (and later bootstrap.min.css) without
3
+ // rewriting its templates at once. Filled component by component — see docs/ROADMAP.md.
4
+ @use '../tokens';
5
+
6
+ .widget-box {
7
+ margin: var(--ak-space-3) 0;
8
+ border: 1px solid var(--ak-color-border);
9
+ border-radius: var(--ak-radius);
10
+ background: var(--ak-color-surface);
11
+ }
@@ -0,0 +1,29 @@
1
+ // .ak-alert [.ak-alert--success|info|warning|danger], close button: [data-ak-dismiss]
2
+
3
+ .ak-alert {
4
+ --_accent: var(--ak-color-info);
5
+
6
+ position: relative;
7
+ padding: var(--ak-space-3) var(--ak-space-4);
8
+ border: 1px solid var(--ak-color-border);
9
+ border-left: 3px solid var(--_accent);
10
+ border-radius: var(--ak-radius);
11
+ background: var(--ak-color-surface);
12
+ color: var(--ak-color-text);
13
+
14
+ @each $name in success, info, warning, danger {
15
+ &--#{$name} { --_accent: var(--ak-color-#{$name}); }
16
+ }
17
+
18
+ [data-ak-dismiss] {
19
+ position: absolute;
20
+ top: var(--ak-space-2);
21
+ right: var(--ak-space-2);
22
+ border: 0;
23
+ background: none;
24
+ color: var(--ak-color-text-muted);
25
+ font-size: var(--ak-font-size-lg);
26
+ line-height: 1;
27
+ cursor: pointer;
28
+ }
29
+ }
@@ -0,0 +1,38 @@
1
+ // .ak-btn [.ak-btn--primary|success|info|warning|danger] [.ak-btn--sm|lg] [.ak-btn--block]
2
+
3
+ .ak-btn {
4
+ --_bg: var(--ak-color-surface-muted);
5
+ --_fg: var(--ak-color-text);
6
+
7
+ display: inline-flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ gap: var(--ak-space-1);
11
+ padding: var(--ak-space-1) var(--ak-space-3);
12
+ border: 1px solid transparent;
13
+ border-radius: var(--ak-radius);
14
+ background: var(--_bg);
15
+ color: var(--_fg);
16
+ font: inherit;
17
+ font-size: var(--ak-font-size);
18
+ line-height: var(--ak-line-height);
19
+ text-decoration: none;
20
+ cursor: pointer;
21
+ transition: filter var(--ak-transition), box-shadow var(--ak-transition);
22
+
23
+ &:hover { filter: brightness(0.95); }
24
+ &:focus-visible { outline: none; box-shadow: var(--ak-focus-ring); }
25
+ &:disabled,
26
+ &[aria-disabled='true'] { opacity: 0.6; cursor: not-allowed; filter: none; }
27
+
28
+ @each $name in primary, success, info, warning, danger {
29
+ &--#{$name} {
30
+ --_bg: var(--ak-color-#{$name});
31
+ --_fg: var(--ak-color-on-accent);
32
+ }
33
+ }
34
+
35
+ &--sm { padding: 2px var(--ak-space-2); font-size: var(--ak-font-size-sm); }
36
+ &--lg { padding: var(--ak-space-2) var(--ak-space-4); font-size: var(--ak-font-size-lg); }
37
+ &--block { display: flex; width: 100%; }
38
+ }
@@ -0,0 +1,5 @@
1
+ // Public kit stylesheet. All component classes use the `ak-` prefix so the kit
2
+ // can live next to legacy Ace/Bootstrap 3 CSS on the same page during migration.
3
+ @use 'tokens';
4
+ @use 'components/button';
5
+ @use 'components/alert';