@digiko-npm/designsystem 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/README.md +89 -0
- package/dist/designsystem.css +4642 -0
- package/dist/designsystem.js +67 -0
- package/package.json +32 -0
- package/src/base/index.css +2 -0
- package/src/base/reset.css +120 -0
- package/src/base/typography.css +163 -0
- package/src/components/accordion.css +150 -0
- package/src/components/alert.css +150 -0
- package/src/components/avatar.css +109 -0
- package/src/components/badge.css +80 -0
- package/src/components/breadcrumb.css +95 -0
- package/src/components/button.css +168 -0
- package/src/components/card.css +121 -0
- package/src/components/command.css +185 -0
- package/src/components/divider.css +66 -0
- package/src/components/drawer.css +209 -0
- package/src/components/dropdown.css +139 -0
- package/src/components/empty-state.css +69 -0
- package/src/components/index.css +35 -0
- package/src/components/input.css +116 -0
- package/src/components/kbd.css +55 -0
- package/src/components/modal.css +103 -0
- package/src/components/nav.css +153 -0
- package/src/components/pagination.css +166 -0
- package/src/components/popover.css +112 -0
- package/src/components/progress.css +214 -0
- package/src/components/skeleton.css +96 -0
- package/src/components/slider.css +125 -0
- package/src/components/table.css +48 -0
- package/src/components/tabs.css +163 -0
- package/src/components/tag.css +159 -0
- package/src/components/timeline.css +131 -0
- package/src/components/toast.css +70 -0
- package/src/components/toggle.css +135 -0
- package/src/components/tooltip.css +161 -0
- package/src/index.css +19 -0
- package/src/js/theme.js +67 -0
- package/src/tokens/colors.css +180 -0
- package/src/tokens/index.css +11 -0
- package/src/tokens/shadows.css +26 -0
- package/src/tokens/spacing.css +53 -0
- package/src/tokens/typography.css +51 -0
- package/src/utilities/index.css +3 -0
- package/src/utilities/layout.css +134 -0
- package/src/utilities/spacing.css +75 -0
- package/src/utilities/text.css +221 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ds/designsystem — Theme Manager
|
|
3
|
+
*
|
|
4
|
+
* Handles light/dark theme toggling with localStorage persistence.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* import { theme } from '@ds/designsystem/js';
|
|
8
|
+
* theme.toggle();
|
|
9
|
+
* theme.set('dark');
|
|
10
|
+
* theme.get(); // 'light' | 'dark' | 'system'
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const STORAGE_KEY = 'ds-theme';
|
|
14
|
+
|
|
15
|
+
function getSystemTheme() {
|
|
16
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function applyTheme(mode) {
|
|
20
|
+
const resolved = mode === 'system' ? getSystemTheme() : mode;
|
|
21
|
+
document.documentElement.setAttribute('data-theme', resolved);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const theme = {
|
|
25
|
+
/** Initialize theme from stored preference or system default */
|
|
26
|
+
init() {
|
|
27
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
28
|
+
if (stored) {
|
|
29
|
+
applyTheme(stored);
|
|
30
|
+
}
|
|
31
|
+
// Listen for system theme changes
|
|
32
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
|
33
|
+
const current = localStorage.getItem(STORAGE_KEY);
|
|
34
|
+
if (!current || current === 'system') {
|
|
35
|
+
applyTheme('system');
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
/** Set theme: 'light', 'dark', or 'system' */
|
|
41
|
+
set(mode) {
|
|
42
|
+
localStorage.setItem(STORAGE_KEY, mode);
|
|
43
|
+
applyTheme(mode);
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
/** Get current stored preference */
|
|
47
|
+
get() {
|
|
48
|
+
return localStorage.getItem(STORAGE_KEY) || 'system';
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
/** Toggle between light and dark */
|
|
52
|
+
toggle() {
|
|
53
|
+
const current = document.documentElement.getAttribute('data-theme');
|
|
54
|
+
const next = current === 'dark' ? 'light' : 'dark';
|
|
55
|
+
this.set(next);
|
|
56
|
+
return next;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// Auto-init if script is loaded directly
|
|
61
|
+
if (typeof document !== 'undefined') {
|
|
62
|
+
if (document.readyState === 'loading') {
|
|
63
|
+
document.addEventListener('DOMContentLoaded', () => theme.init());
|
|
64
|
+
} else {
|
|
65
|
+
theme.init();
|
|
66
|
+
}
|
|
67
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@digiko-npm/designsystem",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Design system — installable, extensible, indestructible.",
|
|
5
|
+
"main": "dist/designsystem.css",
|
|
6
|
+
"style": "dist/designsystem.css",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/designsystem.css",
|
|
9
|
+
"./tokens": "./src/tokens/index.css",
|
|
10
|
+
"./base": "./src/base/index.css",
|
|
11
|
+
"./components": "./src/components/index.css",
|
|
12
|
+
"./utilities": "./src/utilities/index.css",
|
|
13
|
+
"./js": "./dist/designsystem.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/",
|
|
17
|
+
"src/"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "node scripts/build.js",
|
|
21
|
+
"dev": "node scripts/build.js --watch"
|
|
22
|
+
},
|
|
23
|
+
"keywords": ["design-system", "css", "tokens", "components"],
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/digiko-dev/designsystem.git"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Base: Reset
|
|
3
|
+
Clean, modern, antialiased.
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
*,
|
|
7
|
+
*::before,
|
|
8
|
+
*::after {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
html {
|
|
15
|
+
-webkit-font-smoothing: antialiased;
|
|
16
|
+
-moz-osx-font-smoothing: grayscale;
|
|
17
|
+
text-size-adjust: 100%;
|
|
18
|
+
tab-size: 4;
|
|
19
|
+
scroll-behavior: smooth;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
html, body {
|
|
23
|
+
max-width: 100vw;
|
|
24
|
+
overflow-x: hidden;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body {
|
|
28
|
+
min-height: 100dvh;
|
|
29
|
+
font-family: var(--ds-font-sans);
|
|
30
|
+
font-size: var(--ds-text-base);
|
|
31
|
+
line-height: var(--ds-leading-normal);
|
|
32
|
+
color: var(--ds-color-text);
|
|
33
|
+
background-color: var(--ds-color-bg);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
img, picture, video, canvas, svg {
|
|
37
|
+
display: block;
|
|
38
|
+
max-width: 100%;
|
|
39
|
+
height: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
input, button, textarea, select {
|
|
43
|
+
font: inherit;
|
|
44
|
+
color: inherit;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
button,
|
|
48
|
+
[role="button"],
|
|
49
|
+
select,
|
|
50
|
+
summary {
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
button {
|
|
55
|
+
background: none;
|
|
56
|
+
border: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
a {
|
|
60
|
+
color: inherit;
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
ul, ol {
|
|
65
|
+
list-style: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
table {
|
|
69
|
+
border-collapse: collapse;
|
|
70
|
+
border-spacing: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Hide number input spinners */
|
|
74
|
+
input[type="number"] { -moz-appearance: textfield; }
|
|
75
|
+
input[type="number"]::-webkit-outer-spin-button,
|
|
76
|
+
input[type="number"]::-webkit-inner-spin-button {
|
|
77
|
+
-webkit-appearance: none;
|
|
78
|
+
margin: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Focus: subtle ring */
|
|
82
|
+
*:focus-visible {
|
|
83
|
+
outline: var(--ds-ring-width) solid var(--ds-ring-color);
|
|
84
|
+
outline-offset: var(--ds-ring-offset);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Selection — inverted */
|
|
88
|
+
::selection {
|
|
89
|
+
background-color: var(--ds-color-selection-bg);
|
|
90
|
+
color: var(--ds-color-selection-text);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Scrollbar */
|
|
94
|
+
::-webkit-scrollbar {
|
|
95
|
+
width: 8px;
|
|
96
|
+
height: 8px;
|
|
97
|
+
}
|
|
98
|
+
::-webkit-scrollbar-track {
|
|
99
|
+
background: transparent;
|
|
100
|
+
}
|
|
101
|
+
::-webkit-scrollbar-thumb {
|
|
102
|
+
background: var(--ds-scrollbar-thumb);
|
|
103
|
+
border-radius: var(--ds-radius-sm);
|
|
104
|
+
}
|
|
105
|
+
::-webkit-scrollbar-thumb:hover {
|
|
106
|
+
background: var(--ds-scrollbar-thumb-hover);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ds-no-scrollbar::-webkit-scrollbar { display: none; }
|
|
110
|
+
.ds-no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
|
|
111
|
+
|
|
112
|
+
/* Reduce motion */
|
|
113
|
+
@media (prefers-reduced-motion: reduce) {
|
|
114
|
+
*, *::before, *::after {
|
|
115
|
+
animation-duration: 0.01ms !important;
|
|
116
|
+
animation-iteration-count: 1 !important;
|
|
117
|
+
transition-duration: 0.01ms !important;
|
|
118
|
+
scroll-behavior: auto !important;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Base: Typography
|
|
3
|
+
Display font for headings, generous sizes, editorial hierarchy.
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
/* Display font utility — use on headings to get the display typeface */
|
|
7
|
+
.ds-font-display {
|
|
8
|
+
font-family: var(--ds-font-display);
|
|
9
|
+
font-weight: var(--ds-font-display-weight);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
h1, h2, h3, h4, h5, h6 {
|
|
13
|
+
font-family: var(--ds-font-display);
|
|
14
|
+
font-weight: var(--ds-font-display-weight);
|
|
15
|
+
line-height: var(--ds-leading-tight);
|
|
16
|
+
letter-spacing: var(--ds-tracking-tight);
|
|
17
|
+
color: var(--ds-color-text);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
h1 { font-size: var(--ds-text-5xl); }
|
|
21
|
+
h2 { font-size: var(--ds-text-4xl); }
|
|
22
|
+
h3 { font-size: var(--ds-text-2xl); }
|
|
23
|
+
h4 { font-size: var(--ds-text-xl); }
|
|
24
|
+
h5 { font-size: var(--ds-text-lg); }
|
|
25
|
+
h6 { font-size: var(--ds-text-base); font-weight: var(--ds-weight-medium); }
|
|
26
|
+
|
|
27
|
+
p {
|
|
28
|
+
line-height: var(--ds-leading-normal);
|
|
29
|
+
color: var(--ds-color-text-secondary);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
p + p {
|
|
33
|
+
margin-top: var(--ds-space-4);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
small {
|
|
37
|
+
font-size: var(--ds-text-xs);
|
|
38
|
+
color: var(--ds-color-text-tertiary);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
strong, b {
|
|
42
|
+
font-weight: var(--ds-weight-semibold);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Overline / label style (like "PRODUCT DESIGNER & DEVELOPER") */
|
|
46
|
+
.ds-overline {
|
|
47
|
+
font-size: var(--ds-text-sm);
|
|
48
|
+
font-weight: var(--ds-weight-medium);
|
|
49
|
+
letter-spacing: var(--ds-tracking-wide);
|
|
50
|
+
text-transform: uppercase;
|
|
51
|
+
color: var(--ds-color-text-secondary);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Section title style */
|
|
55
|
+
.ds-section-title {
|
|
56
|
+
font-family: var(--ds-font-display);
|
|
57
|
+
font-weight: var(--ds-font-display-weight);
|
|
58
|
+
font-size: var(--ds-text-3xl);
|
|
59
|
+
letter-spacing: var(--ds-tracking-tight);
|
|
60
|
+
color: var(--ds-color-text);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (min-width: 640px) {
|
|
64
|
+
.ds-section-title { font-size: var(--ds-text-4xl); }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Hero title — large editorial display */
|
|
68
|
+
.ds-hero-title {
|
|
69
|
+
font-family: var(--ds-font-display);
|
|
70
|
+
font-weight: var(--ds-font-display-weight);
|
|
71
|
+
font-size: var(--ds-text-4xl);
|
|
72
|
+
line-height: var(--ds-leading-tight);
|
|
73
|
+
letter-spacing: var(--ds-tracking-tight);
|
|
74
|
+
color: var(--ds-color-text);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media (min-width: 640px) {
|
|
78
|
+
.ds-hero-title { font-size: var(--ds-text-5xl); }
|
|
79
|
+
}
|
|
80
|
+
@media (min-width: 768px) {
|
|
81
|
+
.ds-hero-title { font-size: var(--ds-text-6xl); }
|
|
82
|
+
}
|
|
83
|
+
@media (min-width: 1024px) {
|
|
84
|
+
.ds-hero-title { font-size: var(--ds-text-7xl); }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
code, kbd, samp {
|
|
88
|
+
font-family: var(--ds-font-mono);
|
|
89
|
+
font-size: 0.9em;
|
|
90
|
+
background-color: var(--ds-color-bg-elevated);
|
|
91
|
+
padding: 2px 6px;
|
|
92
|
+
border-radius: var(--ds-radius-sm);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
pre {
|
|
96
|
+
font-family: var(--ds-font-mono);
|
|
97
|
+
font-size: var(--ds-text-sm);
|
|
98
|
+
line-height: var(--ds-leading-relaxed);
|
|
99
|
+
background-color: var(--ds-color-surface);
|
|
100
|
+
border: 1px solid var(--ds-color-border);
|
|
101
|
+
padding: var(--ds-space-4);
|
|
102
|
+
border-radius: var(--ds-radius-lg);
|
|
103
|
+
overflow-x: auto;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
pre code {
|
|
107
|
+
background: none;
|
|
108
|
+
padding: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
blockquote {
|
|
112
|
+
padding-left: var(--ds-space-4);
|
|
113
|
+
border-left: 2px solid var(--ds-color-border-hover);
|
|
114
|
+
color: var(--ds-color-text-secondary);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
hr {
|
|
118
|
+
border: none;
|
|
119
|
+
height: 1px;
|
|
120
|
+
background-color: var(--ds-color-border);
|
|
121
|
+
margin: var(--ds-space-8) 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Prose: opt-in rich text styling */
|
|
125
|
+
.ds-prose a {
|
|
126
|
+
color: var(--ds-color-info);
|
|
127
|
+
text-decoration: underline;
|
|
128
|
+
text-underline-offset: 2px;
|
|
129
|
+
transition: color var(--ds-duration-fast) var(--ds-ease-default);
|
|
130
|
+
}
|
|
131
|
+
.ds-prose a:hover {
|
|
132
|
+
opacity: 0.8;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ds-prose ul, .ds-prose ol {
|
|
136
|
+
padding-left: var(--ds-space-6);
|
|
137
|
+
margin-top: var(--ds-space-2);
|
|
138
|
+
margin-bottom: var(--ds-space-2);
|
|
139
|
+
}
|
|
140
|
+
.ds-prose ul { list-style-type: disc; }
|
|
141
|
+
.ds-prose ol { list-style-type: decimal; }
|
|
142
|
+
|
|
143
|
+
.ds-prose li {
|
|
144
|
+
line-height: var(--ds-leading-normal);
|
|
145
|
+
color: var(--ds-color-text-secondary);
|
|
146
|
+
}
|
|
147
|
+
.ds-prose li + li {
|
|
148
|
+
margin-top: var(--ds-space-1);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Tabular figures for numbers */
|
|
152
|
+
.ds-tabular-nums {
|
|
153
|
+
font-variant-numeric: tabular-nums;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* Stat numbers — display font, large */
|
|
157
|
+
.ds-stat-number {
|
|
158
|
+
font-family: var(--ds-font-display);
|
|
159
|
+
font-weight: var(--ds-font-display-weight);
|
|
160
|
+
font-variant-numeric: tabular-nums;
|
|
161
|
+
font-size: var(--ds-text-2xl);
|
|
162
|
+
color: var(--ds-color-text);
|
|
163
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
* Accordion / Collapse
|
|
3
|
+
* ==========================================================================
|
|
4
|
+
*
|
|
5
|
+
* A vertically stacked set of collapsible sections. Supports CSS-only
|
|
6
|
+
* open/close via the `.ds-accordion__item--open` modifier.
|
|
7
|
+
*
|
|
8
|
+
* Variants:
|
|
9
|
+
* --flush – borderless, full-bleed style
|
|
10
|
+
* --separated – visually detached items with individual borders
|
|
11
|
+
*
|
|
12
|
+
* Markup:
|
|
13
|
+
* <div class="ds-accordion">
|
|
14
|
+
* <div class="ds-accordion__item ds-accordion__item--open">
|
|
15
|
+
* <button class="ds-accordion__trigger">Section</button>
|
|
16
|
+
* <div class="ds-accordion__content">
|
|
17
|
+
* <div class="ds-accordion__body">…</div>
|
|
18
|
+
* </div>
|
|
19
|
+
* </div>
|
|
20
|
+
* </div>
|
|
21
|
+
* ========================================================================== */
|
|
22
|
+
|
|
23
|
+
/* Container
|
|
24
|
+
* -------------------------------------------------------------------------- */
|
|
25
|
+
|
|
26
|
+
.ds-accordion {
|
|
27
|
+
border: 1px solid var(--ds-color-border);
|
|
28
|
+
border-radius: var(--ds-radius-xl);
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Item
|
|
33
|
+
* -------------------------------------------------------------------------- */
|
|
34
|
+
|
|
35
|
+
.ds-accordion__item {
|
|
36
|
+
border-top: 1px solid var(--ds-color-border);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ds-accordion__item:first-child {
|
|
40
|
+
border-top: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Trigger (button)
|
|
44
|
+
* -------------------------------------------------------------------------- */
|
|
45
|
+
|
|
46
|
+
.ds-accordion__trigger {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
align-items: center;
|
|
51
|
+
width: 100%;
|
|
52
|
+
padding: var(--ds-space-4);
|
|
53
|
+
text-align: left;
|
|
54
|
+
font-family: var(--ds-font-sans);
|
|
55
|
+
font-size: var(--ds-text-sm);
|
|
56
|
+
font-weight: var(--ds-weight-medium);
|
|
57
|
+
color: var(--ds-color-text);
|
|
58
|
+
background: transparent;
|
|
59
|
+
border: 0;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
transition: background-color var(--ds-duration-fast) var(--ds-ease-default);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Chevron indicator (CSS border-arrow) */
|
|
65
|
+
.ds-accordion__trigger::after {
|
|
66
|
+
content: "";
|
|
67
|
+
display: inline-block;
|
|
68
|
+
width: 0.5rem;
|
|
69
|
+
height: 0.5rem;
|
|
70
|
+
border-right: 2px solid var(--ds-color-text-secondary);
|
|
71
|
+
border-bottom: 2px solid var(--ds-color-text-secondary);
|
|
72
|
+
transform: rotate(45deg);
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
margin-left: var(--ds-space-3);
|
|
75
|
+
transition: transform var(--ds-duration-fast) var(--ds-ease-default);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ds-accordion__trigger:hover {
|
|
79
|
+
background-color: var(--ds-color-overlay);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Open state – rotate chevron */
|
|
83
|
+
.ds-accordion__item--open .ds-accordion__trigger::after {
|
|
84
|
+
transform: rotate(225deg);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Collapsible content wrapper
|
|
88
|
+
* -------------------------------------------------------------------------- */
|
|
89
|
+
|
|
90
|
+
.ds-accordion__content {
|
|
91
|
+
max-height: 0;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
transition:
|
|
94
|
+
max-height var(--ds-duration-normal) var(--ds-ease-default),
|
|
95
|
+
padding var(--ds-duration-normal) var(--ds-ease-default);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ds-accordion__item--open .ds-accordion__content {
|
|
99
|
+
max-height: 80rem;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Inner body (visible content)
|
|
103
|
+
* -------------------------------------------------------------------------- */
|
|
104
|
+
|
|
105
|
+
.ds-accordion__body {
|
|
106
|
+
padding: var(--ds-space-4);
|
|
107
|
+
padding-top: 0;
|
|
108
|
+
font-size: var(--ds-text-sm);
|
|
109
|
+
color: var(--ds-color-text-secondary);
|
|
110
|
+
line-height: 1.625;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* ==========================================================================
|
|
114
|
+
* Variant: Flush
|
|
115
|
+
* ========================================================================== */
|
|
116
|
+
|
|
117
|
+
.ds-accordion--flush {
|
|
118
|
+
border: 0;
|
|
119
|
+
border-radius: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ds-accordion--flush .ds-accordion__item {
|
|
123
|
+
border-top: 0;
|
|
124
|
+
border-bottom: 1px solid var(--ds-color-border);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ds-accordion--flush .ds-accordion__item:last-child {
|
|
128
|
+
border-bottom: 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* ==========================================================================
|
|
132
|
+
* Variant: Separated
|
|
133
|
+
* ========================================================================== */
|
|
134
|
+
|
|
135
|
+
.ds-accordion--separated {
|
|
136
|
+
border: 0;
|
|
137
|
+
border-radius: 0;
|
|
138
|
+
overflow: visible;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.ds-accordion--separated .ds-accordion__item {
|
|
142
|
+
border: 1px solid var(--ds-color-border);
|
|
143
|
+
border-radius: var(--ds-radius-xl);
|
|
144
|
+
margin-bottom: var(--ds-space-3);
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ds-accordion--separated .ds-accordion__item:last-child {
|
|
149
|
+
margin-bottom: 0;
|
|
150
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Alert
|
|
3
|
+
Contextual feedback banners with semantic variants and dismissibility.
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
.ds-alert {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
align-items: flex-start;
|
|
10
|
+
gap: var(--ds-space-3);
|
|
11
|
+
padding: var(--ds-space-4);
|
|
12
|
+
border: 1px solid var(--ds-color-border);
|
|
13
|
+
border-radius: var(--ds-radius-lg);
|
|
14
|
+
background-color: var(--ds-color-surface);
|
|
15
|
+
border-left: 3px solid var(--ds-color-border);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* --- Semantic Variants --- */
|
|
19
|
+
|
|
20
|
+
.ds-alert--info {
|
|
21
|
+
background-color: var(--ds-color-info-subtle);
|
|
22
|
+
border-color: var(--ds-color-info-border);
|
|
23
|
+
border-left-color: var(--ds-color-info);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ds-alert--success {
|
|
27
|
+
background-color: var(--ds-color-success-subtle);
|
|
28
|
+
border-color: var(--ds-color-success-border);
|
|
29
|
+
border-left-color: var(--ds-color-success);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ds-alert--warning {
|
|
33
|
+
background-color: var(--ds-color-warning-subtle);
|
|
34
|
+
border-color: var(--ds-color-warning-border);
|
|
35
|
+
border-left-color: var(--ds-color-warning);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ds-alert--error {
|
|
39
|
+
background-color: var(--ds-color-error-subtle);
|
|
40
|
+
border-color: var(--ds-color-error-border);
|
|
41
|
+
border-left-color: var(--ds-color-error);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* --- Icon --- */
|
|
45
|
+
|
|
46
|
+
.ds-alert__icon {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
flex-shrink: 0;
|
|
51
|
+
width: 1.25rem;
|
|
52
|
+
height: 1.25rem;
|
|
53
|
+
color: var(--ds-color-text-secondary);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ds-alert--info .ds-alert__icon { color: var(--ds-color-info); }
|
|
57
|
+
.ds-alert--success .ds-alert__icon { color: var(--ds-color-success); }
|
|
58
|
+
.ds-alert--warning .ds-alert__icon { color: var(--ds-color-warning); }
|
|
59
|
+
.ds-alert--error .ds-alert__icon { color: var(--ds-color-error); }
|
|
60
|
+
|
|
61
|
+
/* --- Content --- */
|
|
62
|
+
|
|
63
|
+
.ds-alert__content {
|
|
64
|
+
flex: 1;
|
|
65
|
+
min-width: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ds-alert__title {
|
|
69
|
+
font-family: var(--ds-font-sans);
|
|
70
|
+
font-size: var(--ds-text-sm);
|
|
71
|
+
font-weight: var(--ds-weight-medium);
|
|
72
|
+
line-height: var(--ds-leading-snug);
|
|
73
|
+
color: var(--ds-color-text);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ds-alert__description {
|
|
77
|
+
font-size: var(--ds-text-sm);
|
|
78
|
+
line-height: var(--ds-leading-normal);
|
|
79
|
+
color: var(--ds-color-text-secondary);
|
|
80
|
+
margin-top: var(--ds-space-1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ds-alert__title + .ds-alert__description {
|
|
84
|
+
margin-top: var(--ds-space-1);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* --- Close Button --- */
|
|
88
|
+
|
|
89
|
+
.ds-alert__close {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
flex-shrink: 0;
|
|
94
|
+
width: 1.5rem;
|
|
95
|
+
height: 1.5rem;
|
|
96
|
+
padding: 0;
|
|
97
|
+
border: none;
|
|
98
|
+
background: none;
|
|
99
|
+
color: var(--ds-color-text-tertiary);
|
|
100
|
+
border-radius: var(--ds-radius-sm);
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
transition: color var(--ds-duration-fast) ease;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ds-alert__close:hover {
|
|
106
|
+
color: var(--ds-color-text);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ds-alert__close:focus-visible {
|
|
110
|
+
outline: var(--ds-ring-width) solid var(--ds-ring-color);
|
|
111
|
+
outline-offset: var(--ds-ring-offset);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* --- Compact Variant --- */
|
|
115
|
+
|
|
116
|
+
.ds-alert--compact {
|
|
117
|
+
padding: var(--ds-space-2) var(--ds-space-3);
|
|
118
|
+
border-radius: var(--ds-radius-none);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* --- Banner Variant --- */
|
|
122
|
+
|
|
123
|
+
.ds-alert--banner {
|
|
124
|
+
border-radius: var(--ds-radius-none);
|
|
125
|
+
border-left: none;
|
|
126
|
+
border-right: none;
|
|
127
|
+
border-top: 1px solid var(--ds-color-border);
|
|
128
|
+
border-bottom: 1px solid var(--ds-color-border);
|
|
129
|
+
width: 100%;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.ds-alert--banner.ds-alert--info {
|
|
133
|
+
border-top-color: var(--ds-color-info-border);
|
|
134
|
+
border-bottom-color: var(--ds-color-info-border);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.ds-alert--banner.ds-alert--success {
|
|
138
|
+
border-top-color: var(--ds-color-success-border);
|
|
139
|
+
border-bottom-color: var(--ds-color-success-border);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.ds-alert--banner.ds-alert--warning {
|
|
143
|
+
border-top-color: var(--ds-color-warning-border);
|
|
144
|
+
border-bottom-color: var(--ds-color-warning-border);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ds-alert--banner.ds-alert--error {
|
|
148
|
+
border-top-color: var(--ds-color-error-border);
|
|
149
|
+
border-bottom-color: var(--ds-color-error-border);
|
|
150
|
+
}
|