@jdpo2008/ngx-ds 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +111 -2
- package/fesm2022/jdpo2008-ngx-ds.mjs +5592 -0
- package/fesm2022/jdpo2008-ngx-ds.mjs.map +1 -0
- package/package.json +45 -3
- package/styles/_legacy.scss +53 -0
- package/styles/_themes.scss +73 -0
- package/styles/_tokens.scss +92 -0
- package/styles/index.scss +11 -0
- package/styles/ngx-ds.scss +23 -0
- package/types/jdpo2008-ngx-ds.d.ts +2130 -0
package/package.json
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jdpo2008/ngx-ds",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Angular 21 component library: standalone signal-based components with design tokens and an opt-in dark theme.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"angular",
|
|
8
|
+
"components",
|
|
9
|
+
"design-system",
|
|
10
|
+
"ui",
|
|
11
|
+
"signals"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/jdpo2008/ngx-ds.git",
|
|
16
|
+
"directory": "projects/ngx-ds"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/jdpo2008/ngx-ds#readme",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/jdpo2008/ngx-ds/issues"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@angular/common": "^21.0.0",
|
|
27
|
+
"@angular/core": "^21.0.0",
|
|
28
|
+
"@angular/forms": "^21.0.0",
|
|
29
|
+
"@angular/platform-browser": "^21.0.0",
|
|
30
|
+
"lucide-angular": "^1.0.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"tslib": "^2.3.0"
|
|
34
|
+
},
|
|
35
|
+
"sideEffects": false,
|
|
36
|
+
"module": "fesm2022/jdpo2008-ngx-ds.mjs",
|
|
37
|
+
"typings": "types/jdpo2008-ngx-ds.d.ts",
|
|
38
|
+
"exports": {
|
|
39
|
+
"./package.json": {
|
|
40
|
+
"default": "./package.json"
|
|
41
|
+
},
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./types/jdpo2008-ngx-ds.d.ts",
|
|
44
|
+
"default": "./fesm2022/jdpo2008-ngx-ds.mjs"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"type": "module"
|
|
6
48
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// ngx-ds — Legacy tokens (deprecated)
|
|
2
|
+
// No component reads these any more. They are kept as aliases so consumer
|
|
3
|
+
// stylesheets that still reference them keep working; they will be removed in
|
|
4
|
+
// the next major. Use the primitive/semantic tokens from _tokens.scss instead.
|
|
5
|
+
//
|
|
6
|
+
// Note: overriding a deprecated alias no longer re-themes the components —
|
|
7
|
+
// override the canonical token (e.g. `--primary-500`) instead.
|
|
8
|
+
//
|
|
9
|
+
// `--ngx-color-*` predates the token system in _tokens.scss.
|
|
10
|
+
// The old brand green (#1fdd5e) is not part of the theme: the primary color is
|
|
11
|
+
// the indigo --primary-* scale. Its aliases stay literal until the next major.
|
|
12
|
+
|
|
13
|
+
@layer base {
|
|
14
|
+
:root {
|
|
15
|
+
// ── Gen-2.5 aliases (deprecated) ────────────────────────────────────────
|
|
16
|
+
--color-primary: var(--primary-500);
|
|
17
|
+
--color-primary-50: var(--primary-50);
|
|
18
|
+
--color-danger: var(--danger-500);
|
|
19
|
+
--color-success: var(--success-500);
|
|
20
|
+
--color-warning: var(--warning-500);
|
|
21
|
+
--color-secondary: var(--gray-500);
|
|
22
|
+
--border-color: var(--border-base);
|
|
23
|
+
--text-primary: var(--text-base);
|
|
24
|
+
--surface-secondary: var(--surface-subtle);
|
|
25
|
+
|
|
26
|
+
// ── --ngx-color-* (deprecated) ──────────────────────────────────────────
|
|
27
|
+
// Primary (brand green — literal, no equivalent)
|
|
28
|
+
--ngx-color-primary: #1fdd5e;
|
|
29
|
+
--ngx-color-primary-dark: #1bbf52;
|
|
30
|
+
--ngx-color-primary-success: var(--success-500);
|
|
31
|
+
--ngx-color-primary-error: var(--danger-500);
|
|
32
|
+
--ngx-color-primary-warning: var(--warning-500);
|
|
33
|
+
--ngx-color-primary-info: var(--info-500);
|
|
34
|
+
|
|
35
|
+
// Neutral
|
|
36
|
+
--ngx-color-primary-background: var(--surface-subtle);
|
|
37
|
+
|
|
38
|
+
// Text
|
|
39
|
+
--ngx-color-primary-title: var(--text-base);
|
|
40
|
+
--ngx-color-primary-text: var(--text-muted);
|
|
41
|
+
--ngx-color-primary-text-hover: var(--text-muted);
|
|
42
|
+
--ngx-color-primary-text-dark: #fff;
|
|
43
|
+
--ngx-color-primary-text-dark-hover: #fff;
|
|
44
|
+
--ngx-color-primary-text-dark-active: #fff;
|
|
45
|
+
--ngx-color-primary-text-dark-focus: #fff;
|
|
46
|
+
--ngx-color-primary-text-dark-hover-active: #fff;
|
|
47
|
+
--ngx-color-primary-text-dark-hover-focus: #fff;
|
|
48
|
+
--ngx-color-primary-text-dark-active-focus: #fff;
|
|
49
|
+
|
|
50
|
+
// Border
|
|
51
|
+
--ngx-color-primary-border: var(--border-base);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// ngx-ds — Dark theme
|
|
2
|
+
// Opt-in only: consumers activate it with <html data-theme="dark"> or by
|
|
3
|
+
// adding the `dark` class (compatible with Tailwind darkMode: 'class').
|
|
4
|
+
// No automatic `prefers-color-scheme` — enabling it is the consumer's call.
|
|
5
|
+
|
|
6
|
+
@layer base {
|
|
7
|
+
:root[data-theme='dark'],
|
|
8
|
+
.dark {
|
|
9
|
+
// Primary lightened for dark surfaces
|
|
10
|
+
--primary-50: #1e1b4b;
|
|
11
|
+
--primary-100: #312e81;
|
|
12
|
+
--primary-200: #3730a3;
|
|
13
|
+
--primary-500: #818cf8;
|
|
14
|
+
--primary-600: #6366f1;
|
|
15
|
+
--primary-700: #a5b4fc;
|
|
16
|
+
|
|
17
|
+
// State soft backgrounds darkened
|
|
18
|
+
--danger-50: #450a0a;
|
|
19
|
+
--danger-100: #7f1d1d;
|
|
20
|
+
--danger-200: #991b1b;
|
|
21
|
+
--success-50: #022c22;
|
|
22
|
+
--success-100: #064e3b;
|
|
23
|
+
--success-200: #065f46;
|
|
24
|
+
--warning-50: #451a03;
|
|
25
|
+
--warning-100: #78350f;
|
|
26
|
+
--warning-200: #92400e;
|
|
27
|
+
--info-50: #172554;
|
|
28
|
+
--info-100: #1e3a8a;
|
|
29
|
+
--info-200: #1e40af;
|
|
30
|
+
|
|
31
|
+
// State accents lightened for contrast on dark surfaces
|
|
32
|
+
--danger-500: #f87171;
|
|
33
|
+
--danger-600: #ef4444;
|
|
34
|
+
--danger-700: #fca5a5;
|
|
35
|
+
--danger-800: #fecaca;
|
|
36
|
+
--success-500: #34d399;
|
|
37
|
+
--success-600: #10b981;
|
|
38
|
+
--success-700: #6ee7b7;
|
|
39
|
+
--success-800: #a7f3d0;
|
|
40
|
+
--warning-400: #fcd34d;
|
|
41
|
+
--warning-500: #fbbf24;
|
|
42
|
+
--warning-600: #fcd34d;
|
|
43
|
+
--warning-700: #fcd34d;
|
|
44
|
+
--warning-800: #fde68a;
|
|
45
|
+
--info-500: #60a5fa;
|
|
46
|
+
--info-600: #3b82f6;
|
|
47
|
+
--info-700: #93c5fd;
|
|
48
|
+
--info-800: #bfdbfe;
|
|
49
|
+
|
|
50
|
+
// Text
|
|
51
|
+
--text-base: #f9fafb;
|
|
52
|
+
--text-secondary: #d1d5db;
|
|
53
|
+
--text-muted: #9ca3af;
|
|
54
|
+
--text-placeholder: #8b93a1; // ≥ 4.5:1 on the dark surfaces
|
|
55
|
+
--text-disabled: #4b5563;
|
|
56
|
+
--text-inverse: #111827;
|
|
57
|
+
--text-on-color: #111827; // dark fills are lighter here, so text goes dark
|
|
58
|
+
|
|
59
|
+
// Surfaces
|
|
60
|
+
--surface-base: #111827;
|
|
61
|
+
--surface-subtle: #1f2937;
|
|
62
|
+
--surface-muted: #374151;
|
|
63
|
+
--surface-hover: #1f2937;
|
|
64
|
+
--surface-active: #374151;
|
|
65
|
+
--fill-neutral: #9ca3af; // lighter so dark --text-on-color stays readable
|
|
66
|
+
|
|
67
|
+
// Borders
|
|
68
|
+
--border-subtle: #1f2937;
|
|
69
|
+
--border-base: #374151;
|
|
70
|
+
--border-input: #4b5563;
|
|
71
|
+
--border-strong: #6b7280;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// ngx-ds — Design tokens (light theme, canonical source)
|
|
2
|
+
// Values mirror the historical `var(--x, #hex)` fallbacks so defining them
|
|
3
|
+
// in :root produces zero visual change.
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
:root {
|
|
7
|
+
// ── Primitives ──────────────────────────────────────────────────────────
|
|
8
|
+
// Gray (Tailwind gray)
|
|
9
|
+
--gray-50: #f9fafb;
|
|
10
|
+
--gray-100: #f3f4f6;
|
|
11
|
+
--gray-200: #e5e7eb;
|
|
12
|
+
--gray-300: #d1d5db;
|
|
13
|
+
--gray-400: #9ca3af;
|
|
14
|
+
--gray-500: #6b7280;
|
|
15
|
+
--gray-600: #4b5563;
|
|
16
|
+
--gray-700: #374151;
|
|
17
|
+
--gray-800: #1f2937;
|
|
18
|
+
--gray-900: #111827;
|
|
19
|
+
|
|
20
|
+
// Primary (indigo)
|
|
21
|
+
--primary-50: #eef2ff;
|
|
22
|
+
--primary-100: #e0e7ff;
|
|
23
|
+
--primary-200: #c7d2fe;
|
|
24
|
+
--primary-300: #a5b4fc;
|
|
25
|
+
--primary-400: #818cf8;
|
|
26
|
+
--primary-500: #6366f1;
|
|
27
|
+
--primary-600: #4f46e5;
|
|
28
|
+
--primary-700: #4338ca;
|
|
29
|
+
|
|
30
|
+
// Danger (red)
|
|
31
|
+
--danger-50: #fef2f2;
|
|
32
|
+
--danger-100: #fee2e2;
|
|
33
|
+
--danger-200: #fecaca;
|
|
34
|
+
--danger-500: #ef4444;
|
|
35
|
+
--danger-600: #dc2626;
|
|
36
|
+
--danger-700: #b91c1c;
|
|
37
|
+
--danger-800: #991b1b;
|
|
38
|
+
|
|
39
|
+
// Success (green)
|
|
40
|
+
--success-50: #ecfdf5;
|
|
41
|
+
--success-100: #d1fae5;
|
|
42
|
+
--success-200: #a7f3d0;
|
|
43
|
+
--success-500: #10b981;
|
|
44
|
+
--success-600: #059669;
|
|
45
|
+
--success-700: #047857;
|
|
46
|
+
--success-800: #065f46;
|
|
47
|
+
|
|
48
|
+
// Warning (amber)
|
|
49
|
+
--warning-50: #fffbeb;
|
|
50
|
+
--warning-100: #fef3c7;
|
|
51
|
+
--warning-200: #fde68a;
|
|
52
|
+
--warning-400: #fbbf24;
|
|
53
|
+
--warning-500: #f59e0b;
|
|
54
|
+
--warning-600: #d97706;
|
|
55
|
+
--warning-700: #b45309;
|
|
56
|
+
--warning-800: #92400e;
|
|
57
|
+
|
|
58
|
+
// Info (blue)
|
|
59
|
+
--info-50: #eff6ff;
|
|
60
|
+
--info-100: #dbeafe;
|
|
61
|
+
--info-200: #bfdbfe;
|
|
62
|
+
--info-500: #3b82f6;
|
|
63
|
+
--info-600: #2563eb;
|
|
64
|
+
--info-700: #1d4ed8;
|
|
65
|
+
--info-800: #1e40af;
|
|
66
|
+
|
|
67
|
+
// ── Semantic ────────────────────────────────────────────────────────────
|
|
68
|
+
// Text
|
|
69
|
+
--text-base: var(--gray-900);
|
|
70
|
+
--text-secondary: var(--gray-700);
|
|
71
|
+
--text-muted: var(--gray-500);
|
|
72
|
+
--text-placeholder: var(--gray-400);
|
|
73
|
+
--text-disabled: var(--gray-300);
|
|
74
|
+
--text-inverse: #ffffff;
|
|
75
|
+
--text-on-color: #ffffff; // text/marks on solid colored fills
|
|
76
|
+
|
|
77
|
+
// Surfaces
|
|
78
|
+
--surface-base: #ffffff;
|
|
79
|
+
--surface-subtle: var(--gray-50);
|
|
80
|
+
--surface-muted: var(--gray-100);
|
|
81
|
+
--surface-hover: var(--gray-100);
|
|
82
|
+
--surface-active: var(--gray-200);
|
|
83
|
+
--surface-thumb: #ffffff; // switch / slider thumbs; same in dark
|
|
84
|
+
--fill-neutral: var(--gray-500); // solid neutral fills (secondary variants)
|
|
85
|
+
|
|
86
|
+
// Borders
|
|
87
|
+
--border-subtle: var(--gray-100);
|
|
88
|
+
--border-base: var(--gray-200);
|
|
89
|
+
--border-input: var(--gray-300);
|
|
90
|
+
--border-strong: var(--gray-400);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// ngx-ds — Storybook / workspace global styles
|
|
2
|
+
// Consumer apps should load `ngx-ds.scss` instead: it carries the same
|
|
3
|
+
// tokens without the Tailwind directives used by the Storybook wrappers.
|
|
4
|
+
|
|
5
|
+
// Sass requires @use before any other rule; Tailwind relocates the
|
|
6
|
+
// `@layer base` content into the @tailwind base insertion point below.
|
|
7
|
+
@use './ngx-ds';
|
|
8
|
+
|
|
9
|
+
@tailwind base;
|
|
10
|
+
@tailwind components;
|
|
11
|
+
@tailwind utilities;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// ngx-ds — consumer stylesheet (no Tailwind required)
|
|
2
|
+
// Add it to the "styles" array in angular.json:
|
|
3
|
+
// "node_modules/@jdpo2008/ngx-ds/styles/ngx-ds.scss"
|
|
4
|
+
// or load it from your global styles.scss:
|
|
5
|
+
// @use '@jdpo2008/ngx-ds/styles/ngx-ds';
|
|
6
|
+
//
|
|
7
|
+
// Design tokens (primitives + semantic), opt-in dark theme and deprecated
|
|
8
|
+
// aliases. Everything lives in `@layer base`, so your own unlayered
|
|
9
|
+
// :root overrides always win.
|
|
10
|
+
@use './tokens';
|
|
11
|
+
@use './themes';
|
|
12
|
+
@use './legacy';
|
|
13
|
+
|
|
14
|
+
@layer base {
|
|
15
|
+
:root {
|
|
16
|
+
// Font family (the library does not load the font files themselves)
|
|
17
|
+
--ngx-primary-font-family: 'Poppins', sans-serif;
|
|
18
|
+
--ngx-secondary-font-family: 'Roboto', sans-serif;
|
|
19
|
+
--ngx-font-size-base: 1rem;
|
|
20
|
+
--ngx-font-size-sm: 0.875rem;
|
|
21
|
+
--ngx-font-size-lg: 1.125rem;
|
|
22
|
+
}
|
|
23
|
+
}
|