@adamarant/designsystem 0.11.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/README.md +101 -0
- package/dist/designsystem.css +13494 -0
- package/dist/designsystem.js +67 -0
- package/dist/designsystem.min.css +2 -0
- package/package.json +111 -0
- package/src/base/index.css +2 -0
- package/src/base/reset.css +119 -0
- package/src/base/typography.css +172 -0
- package/src/components/accordion.css +166 -0
- package/src/components/admin-layout.css +371 -0
- package/src/components/alert.css +159 -0
- package/src/components/avatar.css +109 -0
- package/src/components/badge.css +80 -0
- package/src/components/bottom-nav.css +125 -0
- package/src/components/bottom-sheet.css +146 -0
- package/src/components/breadcrumb.css +102 -0
- package/src/components/button.css +250 -0
- package/src/components/card.css +117 -0
- package/src/components/chip.css +79 -0
- package/src/components/collapsible.css +112 -0
- package/src/components/color-picker.css +82 -0
- package/src/components/combobox.css +420 -0
- package/src/components/command.css +210 -0
- package/src/components/context-menu.css +162 -0
- package/src/components/copy-button.css +106 -0
- package/src/components/custom-select.css +446 -0
- package/src/components/datepicker.css +301 -0
- package/src/components/description-list.css +100 -0
- package/src/components/divider.css +66 -0
- package/src/components/drawer.css +234 -0
- package/src/components/drop-zone.css +166 -0
- package/src/components/dropdown.css +169 -0
- package/src/components/empty-state.css +75 -0
- package/src/components/field.css +112 -0
- package/src/components/gallery.css +257 -0
- package/src/components/hero.css +111 -0
- package/src/components/icon-btn.css +103 -0
- package/src/components/index.css +74 -0
- package/src/components/input.css +311 -0
- package/src/components/kbd.css +54 -0
- package/src/components/media-library.css +230 -0
- package/src/components/modal.css +136 -0
- package/src/components/nav.css +198 -0
- package/src/components/number-input.css +163 -0
- package/src/components/pagination.css +175 -0
- package/src/components/pin-input.css +136 -0
- package/src/components/popover.css +111 -0
- package/src/components/progress.css +217 -0
- package/src/components/prose.css +337 -0
- package/src/components/result.css +80 -0
- package/src/components/scroll-area.css +73 -0
- package/src/components/search.css +311 -0
- package/src/components/segmented-control.css +94 -0
- package/src/components/skeleton.css +100 -0
- package/src/components/slider.css +133 -0
- package/src/components/sortable.css +70 -0
- package/src/components/spinner.css +60 -0
- package/src/components/star-rating.css +121 -0
- package/src/components/stat-card.css +44 -0
- package/src/components/table.css +359 -0
- package/src/components/tabs.css +215 -0
- package/src/components/tag.css +188 -0
- package/src/components/timeline.css +130 -0
- package/src/components/toast.css +90 -0
- package/src/components/toggle.css +173 -0
- package/src/components/toolbar.css +206 -0
- package/src/components/tooltip.css +167 -0
- package/src/components/truncated-text.css +75 -0
- package/src/index.css +21 -0
- package/src/js/theme.js +67 -0
- package/src/tokens/colors.css +256 -0
- package/src/tokens/index.css +11 -0
- package/src/tokens/shadows.css +55 -0
- package/src/tokens/spacing.css +82 -0
- package/src/tokens/tokens.json +413 -0
- package/src/tokens/typography.css +90 -0
- package/src/utilities/a11y.css +102 -0
- package/src/utilities/index.css +7 -0
- package/src/utilities/interactive.css +121 -0
- package/src/utilities/layout.css +273 -0
- package/src/utilities/sizing.css +85 -0
- package/src/utilities/spacing.css +204 -0
- package/src/utilities/states.css +182 -0
- package/src/utilities/text.css +381 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Card
|
|
3
|
+
Surface + border, hover with shadow lift, rounded-xl.
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
.ds-card {
|
|
7
|
+
background-color: var(--ds-color-surface);
|
|
8
|
+
border: 1px solid var(--ds-color-border);
|
|
9
|
+
border-radius: var(--ds-radius-xl);
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
transition: all var(--ds-duration-normal) var(--ds-ease-default);
|
|
12
|
+
container-type: inline-size;
|
|
13
|
+
|
|
14
|
+
/* Container query: stack body content when card is narrow */
|
|
15
|
+
@container (max-width: 200px) {
|
|
16
|
+
& .ds-card__body {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
& .ds-card__footer {
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: stretch;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Interactive card — lifts on hover (like ProjectCard) */
|
|
28
|
+
&--interactive {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
border-color: var(--ds-color-border-hover);
|
|
33
|
+
box-shadow: var(--ds-shadow-lg);
|
|
34
|
+
transform: translateY(-4px);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:focus-visible {
|
|
38
|
+
outline: none;
|
|
39
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:hover:focus-visible {
|
|
43
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color), var(--ds-shadow-lg);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Elevated card — visible shadow */
|
|
48
|
+
&--elevated {
|
|
49
|
+
background-color: var(--ds-color-surface-muted);
|
|
50
|
+
box-shadow: var(--ds-shadow-lg);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Hover card — border highlight */
|
|
54
|
+
&--hover:hover {
|
|
55
|
+
border-color: var(--ds-color-border-active);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__header {
|
|
59
|
+
padding: var(--ds-space-5);
|
|
60
|
+
border-block-end: 1px solid var(--ds-color-border);
|
|
61
|
+
|
|
62
|
+
& h3,
|
|
63
|
+
& .ds-card__title {
|
|
64
|
+
font-family: var(--ds-font-display);
|
|
65
|
+
font-weight: var(--ds-font-display-weight);
|
|
66
|
+
font-size: var(--ds-text-lg);
|
|
67
|
+
letter-spacing: var(--ds-tracking-tight);
|
|
68
|
+
color: var(--ds-color-text);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__description {
|
|
73
|
+
font-size: var(--ds-text-sm);
|
|
74
|
+
color: var(--ds-color-text-tertiary);
|
|
75
|
+
margin-block-start: var(--ds-space-1);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&__body {
|
|
79
|
+
padding: var(--ds-space-5);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&__footer {
|
|
83
|
+
padding: var(--ds-space-4) var(--ds-space-5);
|
|
84
|
+
border-block-start: 1px solid var(--ds-color-border);
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: var(--ds-space-2);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&__media {
|
|
91
|
+
width: 100%;
|
|
92
|
+
aspect-ratio: 16/10;
|
|
93
|
+
object-fit: cover;
|
|
94
|
+
background-color: var(--ds-color-surface-muted);
|
|
95
|
+
|
|
96
|
+
&--square { aspect-ratio: 1; }
|
|
97
|
+
&--video { aspect-ratio: 16/9; }
|
|
98
|
+
&--auto { aspect-ratio: auto; }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Compact */
|
|
102
|
+
&--compact {
|
|
103
|
+
& .ds-card__header,
|
|
104
|
+
& .ds-card__body,
|
|
105
|
+
& .ds-card__footer {
|
|
106
|
+
padding: var(--ds-space-3) var(--ds-space-4);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Flush — no internal dividers */
|
|
111
|
+
&--flush {
|
|
112
|
+
& .ds-card__header { border-block-end: none; }
|
|
113
|
+
& .ds-card__footer { border-block-start: none; }
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Stat card — extracted to stat-card.css */
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Chip
|
|
3
|
+
Interactive filter/sort chips with optional remove button. Distinct from
|
|
4
|
+
ds-tag (which is a static label). Chips represent active filter state.
|
|
5
|
+
|
|
6
|
+
ARIA requirements (consumer responsibility):
|
|
7
|
+
- Remove button: add aria-label="Remove [filter name]"
|
|
8
|
+
- Logic chip (AND/OR): use aria-pressed="true|false" on <button>
|
|
9
|
+
- Chip group: wrap in role="group" with aria-label="Active filters"
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
<span class="ds-chip">
|
|
13
|
+
Status: Active
|
|
14
|
+
<button class="ds-chip__remove" aria-label="Remove Status filter">×</button>
|
|
15
|
+
</span>
|
|
16
|
+
<button class="ds-chip ds-chip--logic">AND</button>
|
|
17
|
+
<span class="ds-chip ds-chip--sort">Date ↑</span>
|
|
18
|
+
|
|
19
|
+
Modifiers:
|
|
20
|
+
.ds-chip--logic — AND/OR toggle chip (clickable, no bg)
|
|
21
|
+
.ds-chip--sort — Sort indicator (dashed border)
|
|
22
|
+
========================================================================== */
|
|
23
|
+
|
|
24
|
+
.ds-chip {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: var(--ds-space-1);
|
|
28
|
+
padding: var(--ds-space-0-5) var(--ds-space-2);
|
|
29
|
+
font-size: var(--ds-text-xs);
|
|
30
|
+
font-family: inherit;
|
|
31
|
+
color: var(--ds-color-text-secondary);
|
|
32
|
+
background: var(--ds-color-surface-muted);
|
|
33
|
+
border: 1px solid var(--ds-color-border);
|
|
34
|
+
border-radius: var(--ds-radius-full);
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
|
|
37
|
+
/* Logic chip (AND/OR toggle) */
|
|
38
|
+
&--logic {
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
font-weight: var(--ds-weight-semibold);
|
|
41
|
+
color: var(--ds-color-text-tertiary);
|
|
42
|
+
background: transparent;
|
|
43
|
+
border-color: var(--ds-color-border);
|
|
44
|
+
transition: background-color var(--ds-duration-fast) var(--ds-ease-default);
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
background: var(--ds-color-surface-hover);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Sort chip (dashed border) */
|
|
52
|
+
&--sort {
|
|
53
|
+
border-style: dashed;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Remove button */
|
|
57
|
+
&__remove {
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
width: 14px;
|
|
62
|
+
height: 14px;
|
|
63
|
+
min-width: 1.5rem; /* WCAG 2.5.8: minimum 24px target */
|
|
64
|
+
min-height: 1.5rem;
|
|
65
|
+
border: none;
|
|
66
|
+
border-radius: var(--ds-radius-full);
|
|
67
|
+
background: transparent;
|
|
68
|
+
color: var(--ds-color-text-tertiary);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
transition:
|
|
71
|
+
color var(--ds-duration-fast) var(--ds-ease-default),
|
|
72
|
+
background-color var(--ds-duration-fast) var(--ds-ease-default);
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
color: var(--ds-color-text);
|
|
76
|
+
background: var(--ds-color-surface-hover);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Collapsible
|
|
3
|
+
Single collapsible section — a simplified, standalone accordion item.
|
|
4
|
+
|
|
5
|
+
ARIA requirements (consumer responsibility):
|
|
6
|
+
- Trigger: <button> with aria-expanded="true|false"
|
|
7
|
+
- Trigger: aria-controls="[content-panel-id]"
|
|
8
|
+
- Content: id matching aria-controls
|
|
9
|
+
========================================================================== */
|
|
10
|
+
|
|
11
|
+
.ds-collapsible {
|
|
12
|
+
border: 1px solid var(--ds-color-border);
|
|
13
|
+
border-radius: var(--ds-radius-xl);
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
|
|
16
|
+
/* ---------------------------------------------------------------------------
|
|
17
|
+
Trigger (button)
|
|
18
|
+
--------------------------------------------------------------------------- */
|
|
19
|
+
|
|
20
|
+
&__trigger {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
align-items: center;
|
|
25
|
+
width: 100%;
|
|
26
|
+
padding: var(--ds-space-4);
|
|
27
|
+
text-align: start;
|
|
28
|
+
font-family: var(--ds-font-sans);
|
|
29
|
+
font-size: var(--ds-text-sm);
|
|
30
|
+
font-weight: var(--ds-weight-medium);
|
|
31
|
+
color: var(--ds-color-text);
|
|
32
|
+
background: transparent;
|
|
33
|
+
border: 0;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
transition: background-color var(--ds-duration-fast) var(--ds-ease-default);
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
background-color: var(--ds-color-surface-hover);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:focus-visible {
|
|
42
|
+
outline: none;
|
|
43
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
44
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* ---------------------------------------------------------------------------
|
|
49
|
+
Chevron icon (CSS border-arrow)
|
|
50
|
+
--------------------------------------------------------------------------- */
|
|
51
|
+
|
|
52
|
+
&__icon {
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
width: 0.5rem;
|
|
55
|
+
height: 0.5rem;
|
|
56
|
+
border-inline-end: 2px solid var(--ds-color-text-secondary);
|
|
57
|
+
border-block-end: 2px solid var(--ds-color-text-secondary);
|
|
58
|
+
transform: rotate(45deg);
|
|
59
|
+
margin-inline-start: var(--ds-space-3);
|
|
60
|
+
transition: transform var(--ds-duration-fast) var(--ds-ease-default);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&--open &__icon {
|
|
64
|
+
transform: rotate(225deg);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* ---------------------------------------------------------------------------
|
|
68
|
+
Collapsible content
|
|
69
|
+
--------------------------------------------------------------------------- */
|
|
70
|
+
|
|
71
|
+
&__content {
|
|
72
|
+
max-height: 0;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
transition:
|
|
75
|
+
max-height var(--ds-duration-normal) var(--ds-ease-default),
|
|
76
|
+
padding var(--ds-duration-normal) var(--ds-ease-default);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&--open &__content {
|
|
80
|
+
max-height: 80rem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* ---------------------------------------------------------------------------
|
|
84
|
+
Inner body
|
|
85
|
+
--------------------------------------------------------------------------- */
|
|
86
|
+
|
|
87
|
+
&__body {
|
|
88
|
+
padding: var(--ds-space-4);
|
|
89
|
+
padding-block-start: 0;
|
|
90
|
+
font-size: var(--ds-text-sm);
|
|
91
|
+
color: var(--ds-color-text-secondary);
|
|
92
|
+
line-height: var(--ds-leading-relaxed);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* ---------------------------------------------------------------------------
|
|
96
|
+
Variant: Flush (no border, no radius)
|
|
97
|
+
--------------------------------------------------------------------------- */
|
|
98
|
+
|
|
99
|
+
&--flush {
|
|
100
|
+
border: 0;
|
|
101
|
+
border-radius: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* ---------------------------------------------------------------------------
|
|
105
|
+
Variant: Ghost (no border, transparent bg)
|
|
106
|
+
--------------------------------------------------------------------------- */
|
|
107
|
+
|
|
108
|
+
&--ghost {
|
|
109
|
+
border: 0;
|
|
110
|
+
background: transparent;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Color Picker
|
|
3
|
+
Grid of color swatches for selection. CSS-only styling.
|
|
4
|
+
|
|
5
|
+
ARIA requirements (consumer responsibility):
|
|
6
|
+
- Container: role="radiogroup", aria-label="Color"
|
|
7
|
+
- Each swatch: role="radio", aria-checked="true|false", aria-label="[color name]"
|
|
8
|
+
- Keyboard: ArrowKeys to navigate, Space/Enter to select
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
<div class="ds-color-picker" role="radiogroup" aria-label="Color">
|
|
12
|
+
<button class="ds-color-picker__swatch ds-color-picker__swatch--active"
|
|
13
|
+
role="radio" aria-checked="true" aria-label="Red"
|
|
14
|
+
style="--swatch-color: #ef4444"></button>
|
|
15
|
+
<button class="ds-color-picker__swatch"
|
|
16
|
+
role="radio" aria-checked="false" aria-label="Blue"
|
|
17
|
+
style="--swatch-color: #3b82f6"></button>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
Modifiers:
|
|
21
|
+
.ds-color-picker--sm — Smaller swatches
|
|
22
|
+
.ds-color-picker--lg — Larger swatches
|
|
23
|
+
========================================================================== */
|
|
24
|
+
|
|
25
|
+
.ds-color-picker {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
gap: var(--ds-space-1-5);
|
|
29
|
+
|
|
30
|
+
&__swatch {
|
|
31
|
+
width: 2rem;
|
|
32
|
+
height: 2rem;
|
|
33
|
+
border-radius: var(--ds-radius-md);
|
|
34
|
+
border: 2px solid transparent;
|
|
35
|
+
background-color: var(--swatch-color);
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
padding: 0;
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
transition:
|
|
40
|
+
border-color var(--ds-duration-fast) var(--ds-ease-default),
|
|
41
|
+
transform var(--ds-duration-fast) var(--ds-ease-default),
|
|
42
|
+
box-shadow var(--ds-duration-fast) var(--ds-ease-default);
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
transform: scale(1.1);
|
|
46
|
+
border-color: var(--ds-color-border);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:focus-visible {
|
|
50
|
+
outline: none;
|
|
51
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
52
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--active {
|
|
56
|
+
border-color: var(--ds-color-text);
|
|
57
|
+
box-shadow: 0 0 0 2px var(--ds-color-surface), 0 0 0 4px var(--swatch-color);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* --- Small variant --- */
|
|
62
|
+
&--sm &__swatch {
|
|
63
|
+
width: 1.5rem;
|
|
64
|
+
height: 1.5rem;
|
|
65
|
+
border-radius: var(--ds-radius-sm);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&--sm {
|
|
69
|
+
gap: var(--ds-space-1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* --- Large variant --- */
|
|
73
|
+
&--lg &__swatch {
|
|
74
|
+
width: 2.5rem;
|
|
75
|
+
height: 2.5rem;
|
|
76
|
+
border-radius: var(--ds-radius-lg);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&--lg {
|
|
80
|
+
gap: var(--ds-space-2);
|
|
81
|
+
}
|
|
82
|
+
}
|