@voidable/theme 0.1.0 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidable/theme",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "exports": {
@@ -10,6 +10,7 @@ void-badge {
10
10
  padding: 0.25rem 0.375rem 0.125rem;
11
11
  min-width: 1.25rem;
12
12
  min-height: 1.25rem;
13
+ border: 1px solid transparent;
13
14
  border-radius: var(--void-radius-full);
14
15
  background: var(--tone);
15
16
  color: var(--void-color-text-on-accent);
@@ -29,6 +30,13 @@ void-badge[color="info"] { --tone: var(--void-color-info); }
29
30
  void-badge[color="notice"] { --tone: var(--void-color-notice); }
30
31
  void-badge[color="highlight"] { --tone: var(--void-color-highlight); }
31
32
 
33
+ /* Variants */
34
+ void-badge[variant="outline"] {
35
+ background: color-mix(in srgb, var(--tone) 14%, transparent);
36
+ border: 1px solid color-mix(in srgb, var(--tone) 36%, transparent);
37
+ color: var(--tone);
38
+ }
39
+
32
40
  /* Sizes */
33
41
  void-badge[size="sm"] { min-width: 1rem; min-height: 1rem; font-size: var(--void-text-2xs); padding: 0.0625rem var(--void-space-1) 0; }
34
42
  void-badge[size="lg"] { min-width: 1.75rem; min-height: 1.75rem; font-size: var(--void-text-sm); padding: 0.3125rem var(--void-space-3) 0.1875rem; }
@@ -27,6 +27,7 @@ void-compose-input {
27
27
  font-size: var(--void-text-sm);
28
28
  resize: none;
29
29
  outline: none;
30
+ height: var(--void-compose-input-height, auto);
30
31
  min-height: 1.5rem;
31
32
  max-height: 8rem;
32
33
  overflow-y: auto;
@@ -0,0 +1,76 @@
1
+ void-dropdown-menu {
2
+ position: relative;
3
+ display: inline-flex;
4
+ }
5
+
6
+ .void-dropdown-menu-panel {
7
+ display: none;
8
+ position: absolute;
9
+ z-index: var(--void-z-dropdown, 100);
10
+ min-width: 180px;
11
+ padding: var(--void-space-1) 0;
12
+ background: var(--void-color-bg-elevated);
13
+ border: 1px solid var(--void-color-border);
14
+ border-radius: var(--void-radius-md);
15
+ box-shadow: 0 4px 16px var(--void-color-bg-overlay);
16
+ transition: opacity var(--void-duration-fast) var(--void-ease-in-out);
17
+ }
18
+
19
+ void-dropdown-menu[open] .void-dropdown-menu-panel {
20
+ display: block;
21
+ }
22
+
23
+ void-dropdown-menu[position='bottom-start'] .void-dropdown-menu-panel {
24
+ top: calc(100% + var(--void-space-1));
25
+ left: 0;
26
+ }
27
+
28
+ void-dropdown-menu[position='bottom-end'] .void-dropdown-menu-panel {
29
+ top: calc(100% + var(--void-space-1));
30
+ right: 0;
31
+ left: auto;
32
+ }
33
+
34
+ void-dropdown-menu[position='top-start'] .void-dropdown-menu-panel {
35
+ bottom: calc(100% + var(--void-space-1));
36
+ top: auto;
37
+ left: 0;
38
+ }
39
+
40
+ void-dropdown-menu[position='top-end'] .void-dropdown-menu-panel {
41
+ bottom: calc(100% + var(--void-space-1));
42
+ top: auto;
43
+ right: 0;
44
+ left: auto;
45
+ }
46
+
47
+ void-dropdown-menu-item {
48
+ display: flex;
49
+ align-items: center;
50
+ gap: var(--void-space-2);
51
+ padding: var(--void-space-2) var(--void-space-3);
52
+ font-family: var(--void-font-sans);
53
+ font-size: var(--void-text-sm);
54
+ color: var(--void-color-text);
55
+ cursor: pointer;
56
+ user-select: none;
57
+ outline: none;
58
+ }
59
+
60
+ void-dropdown-menu-item:hover {
61
+ background: var(--void-color-bg-hover);
62
+ }
63
+
64
+ void-dropdown-menu-item:focus-visible {
65
+ background: var(--void-color-bg-hover);
66
+ }
67
+
68
+ void-dropdown-menu-item[destructive] {
69
+ color: var(--void-color-error);
70
+ }
71
+
72
+ void-dropdown-menu-item[disabled] {
73
+ opacity: 0.5;
74
+ pointer-events: none;
75
+ cursor: default;
76
+ }
@@ -0,0 +1,62 @@
1
+ void-indicator {
2
+ --tone: var(--void-color-accent);
3
+ position: relative;
4
+ display: inline-flex;
5
+ }
6
+
7
+ .void-indicator-dot {
8
+ position: absolute;
9
+ display: inline-grid;
10
+ place-content: center;
11
+ min-width: 8px;
12
+ min-height: 8px;
13
+ border-radius: var(--void-radius-full);
14
+ background: var(--tone);
15
+ font-family: var(--void-font-sans);
16
+ font-size: var(--void-text-2xs);
17
+ font-weight: var(--void-weight-semibold);
18
+ color: var(--void-color-text-on-accent);
19
+ pointer-events: none;
20
+ line-height: 1;
21
+ }
22
+
23
+ .void-indicator-dot:not(:empty) {
24
+ min-width: 16px;
25
+ min-height: 16px;
26
+ padding: 0 4px;
27
+ }
28
+
29
+ void-indicator[position="top-right"] .void-indicator-dot { top: -4px; right: -4px; }
30
+ void-indicator[position="top-left"] .void-indicator-dot { top: -4px; left: -4px; }
31
+ void-indicator[position="bottom-right"] .void-indicator-dot { bottom: -4px; right: -4px; }
32
+ void-indicator[position="bottom-left"] .void-indicator-dot { bottom: -4px; left: -4px; }
33
+
34
+ void-indicator[color="error"] { --tone: var(--void-color-error); }
35
+ void-indicator[color="warning"] { --tone: var(--void-color-warning); }
36
+ void-indicator[color="success"] { --tone: var(--void-color-success); }
37
+ void-indicator[color="info"] { --tone: var(--void-color-info); }
38
+ void-indicator[color="notice"] { --tone: var(--void-color-notice); }
39
+
40
+ void-indicator[ping] .void-indicator-dot::before {
41
+ content: '';
42
+ position: absolute;
43
+ inset: 0;
44
+ border-radius: var(--void-radius-full);
45
+ background: var(--tone);
46
+ animation: void-indicator-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
47
+ }
48
+
49
+ @keyframes void-indicator-ping {
50
+ 75%, 100% { transform: scale(2); opacity: 0; }
51
+ }
52
+
53
+ void-indicator[size="sm"] .void-indicator-dot { min-width: 6px; min-height: 6px; }
54
+ void-indicator[size="sm"] .void-indicator-dot:not(:empty) { min-width: 14px; min-height: 14px; }
55
+ void-indicator[size="lg"] .void-indicator-dot { min-width: 10px; min-height: 10px; }
56
+ void-indicator[size="lg"] .void-indicator-dot:not(:empty) { min-width: 20px; min-height: 20px; font-size: var(--void-text-xs); }
57
+ void-indicator[size="xl"] .void-indicator-dot { min-width: 12px; min-height: 12px; }
58
+ void-indicator[size="xl"] .void-indicator-dot:not(:empty) { min-width: 24px; min-height: 24px; font-size: var(--void-text-sm); }
59
+ void-indicator[size="xxl"] .void-indicator-dot { min-width: 14px; min-height: 14px; }
60
+ void-indicator[size="xxl"] .void-indicator-dot:not(:empty) { min-width: 28px; min-height: 28px; font-size: var(--void-text-base); }
61
+
62
+ void-indicator[color="success"] .void-indicator-dot { box-shadow: 0 0 6px var(--void-color-success); }
@@ -15,6 +15,7 @@ void-progress {
15
15
 
16
16
  .void-progress-fill {
17
17
  height: 100%;
18
+ width: var(--void-progress-fill, 0%);
18
19
  background: var(--tone);
19
20
  border-radius: var(--void-radius-full);
20
21
  transition: width var(--void-duration-normal) var(--void-ease-in-out);
@@ -4,6 +4,7 @@ void-scroll-area {
4
4
 
5
5
  .void-scroll-area-viewport {
6
6
  overflow: hidden;
7
+ max-height: var(--void-scroll-area-max-height);
7
8
  }
8
9
 
9
10
  void-scroll-area[direction="vertical"] .void-scroll-area-viewport {
@@ -0,0 +1,64 @@
1
+ void-segmented-control {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ padding: 2px;
5
+ background: var(--void-color-bg-secondary);
6
+ border: 1px solid var(--void-color-border);
7
+ border-radius: var(--void-radius-md);
8
+ gap: 2px;
9
+ }
10
+
11
+ void-segmented-control-item {
12
+ display: inline-grid;
13
+ place-content: center;
14
+ padding: var(--void-space-1) var(--void-space-3);
15
+ border-radius: calc(var(--void-radius-md) - 2px);
16
+ font-family: var(--void-font-sans);
17
+ font-size: var(--void-text-sm);
18
+ color: var(--void-color-text-secondary);
19
+ cursor: pointer;
20
+ user-select: none;
21
+ transition: background var(--void-duration-fast) var(--void-ease-in-out),
22
+ color var(--void-duration-fast) var(--void-ease-in-out);
23
+ outline: none;
24
+ }
25
+
26
+ void-segmented-control-item:hover {
27
+ color: var(--void-color-text);
28
+ }
29
+
30
+ void-segmented-control-item:focus-visible {
31
+ outline: 2px solid var(--void-color-border-focus);
32
+ outline-offset: -2px;
33
+ }
34
+
35
+ void-segmented-control-item[aria-checked="true"] {
36
+ background: var(--void-color-bg-elevated);
37
+ color: var(--void-color-text);
38
+ box-shadow: var(--void-shadow-sm);
39
+ }
40
+
41
+ void-segmented-control-item[disabled] {
42
+ opacity: 0.5;
43
+ pointer-events: none;
44
+ }
45
+
46
+ void-segmented-control[size="sm"] void-segmented-control-item {
47
+ padding: 2px var(--void-space-2);
48
+ font-size: var(--void-text-xs);
49
+ }
50
+
51
+ void-segmented-control[size="lg"] void-segmented-control-item {
52
+ padding: var(--void-space-2) var(--void-space-4);
53
+ font-size: var(--void-text-base);
54
+ }
55
+
56
+ void-segmented-control[size="xl"] void-segmented-control-item {
57
+ padding: var(--void-space-3) var(--void-space-5);
58
+ font-size: var(--void-text-lg);
59
+ }
60
+
61
+ void-segmented-control[size="xxl"] void-segmented-control-item {
62
+ padding: var(--void-space-4) var(--void-space-6);
63
+ font-size: var(--void-text-xl);
64
+ }
@@ -0,0 +1,22 @@
1
+ void-sidebar {
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: var(--void-sidebar-width);
5
+ height: 100%;
6
+ background: var(--void-color-bg);
7
+ border-right: 1px solid var(--void-color-border);
8
+ overflow: hidden;
9
+ font-family: var(--void-font-sans);
10
+ color: var(--void-color-text);
11
+ transition: width var(--void-duration-normal) var(--void-ease-in-out);
12
+ flex-shrink: 0;
13
+ }
14
+
15
+ void-sidebar[position="right"] {
16
+ border-right: none;
17
+ border-left: 1px solid var(--void-color-border);
18
+ }
19
+
20
+ void-sidebar[collapsed] {
21
+ white-space: nowrap;
22
+ }
@@ -0,0 +1,88 @@
1
+ void-stat {
2
+ --tone: var(--void-color-accent);
3
+ --tone-subtle: color-mix(in srgb, var(--tone) 14%, transparent);
4
+ --tone-border: color-mix(in srgb, var(--tone) 36%, transparent);
5
+
6
+ display: flex;
7
+ flex-direction: column;
8
+ gap: var(--void-space-1);
9
+ padding: var(--void-space-4);
10
+ border: 1px solid var(--tone-border);
11
+ border-radius: var(--void-radius-lg);
12
+ background: var(--tone-subtle);
13
+ }
14
+
15
+ .void-stat-label {
16
+ font-family: var(--void-font-sans);
17
+ font-size: var(--void-text-xs);
18
+ color: var(--void-color-text-muted);
19
+ text-transform: uppercase;
20
+ letter-spacing: 0.06em;
21
+ }
22
+
23
+ .void-stat-value {
24
+ font-family: var(--void-font-mono);
25
+ font-size: var(--void-text-3xl);
26
+ font-weight: var(--void-weight-bold);
27
+ color: var(--void-color-text);
28
+ letter-spacing: -0.02em;
29
+ line-height: var(--void-leading-tight);
30
+ }
31
+
32
+ .void-stat-delta {
33
+ display: inline-flex;
34
+ align-items: center;
35
+ gap: var(--void-space-1);
36
+ font-family: var(--void-font-mono);
37
+ font-size: var(--void-text-xs);
38
+ color: var(--void-color-text-secondary);
39
+ }
40
+
41
+ void-stat[trend="up"] .void-stat-delta { color: var(--void-color-success); }
42
+ void-stat[trend="down"] .void-stat-delta { color: var(--void-color-error); }
43
+ void-stat[trend="error"] .void-stat-delta { color: var(--void-color-error); }
44
+ void-stat[trend="warning"] .void-stat-delta { color: var(--void-color-warning); }
45
+ void-stat[trend="success"] .void-stat-delta { color: var(--void-color-success); }
46
+ void-stat[trend="info"] .void-stat-delta { color: var(--void-color-info); }
47
+ void-stat[trend="notice"] .void-stat-delta { color: var(--void-color-notice); }
48
+ void-stat[trend="highlight"] .void-stat-delta { color: var(--void-color-highlight); }
49
+
50
+ /* Sizes */
51
+ void-stat[size="sm"] {
52
+ padding: var(--void-space-3);
53
+ }
54
+
55
+ void-stat[size="sm"] .void-stat-value {
56
+ font-size: var(--void-text-2xl);
57
+ }
58
+
59
+ void-stat[size="lg"] {
60
+ padding: var(--void-space-6);
61
+ }
62
+
63
+ void-stat[size="lg"] .void-stat-value {
64
+ font-size: var(--void-text-4xl);
65
+ }
66
+
67
+ void-stat[size="xl"] {
68
+ padding: var(--void-space-8);
69
+ }
70
+
71
+ void-stat[size="xl"] .void-stat-value {
72
+ font-size: var(--void-text-5xl);
73
+ }
74
+
75
+ void-stat[size="xxl"] {
76
+ padding: var(--void-space-10);
77
+ }
78
+
79
+ void-stat[size="xxl"] .void-stat-value {
80
+ font-size: 4rem;
81
+ }
82
+
83
+ void-stat[color="error"] { --tone: var(--void-color-error); }
84
+ void-stat[color="warning"] { --tone: var(--void-color-warning); }
85
+ void-stat[color="success"] { --tone: var(--void-color-success); }
86
+ void-stat[color="info"] { --tone: var(--void-color-info); }
87
+ void-stat[color="notice"] { --tone: var(--void-color-notice); }
88
+ void-stat[color="highlight"] { --tone: var(--void-color-highlight); }
@@ -8,9 +8,10 @@ void-stepper {
8
8
  display: flex;
9
9
  flex-direction: column;
10
10
  align-items: center;
11
- gap: var(--void-space-1);
12
- flex: 1;
11
+ gap: var(--void-space-2);
12
+ flex: 0 0 auto;
13
13
  position: relative;
14
+ padding-bottom: calc(var(--void-text-xs) + var(--void-space-2));
14
15
  }
15
16
 
16
17
  .void-stepper-circle {
@@ -45,9 +46,14 @@ void-stepper {
45
46
  }
46
47
 
47
48
  .void-stepper-label {
49
+ position: absolute;
50
+ bottom: 0;
51
+ left: 50%;
52
+ transform: translateX(-50%);
48
53
  font-size: var(--void-text-xs);
49
54
  color: var(--void-color-text-muted);
50
55
  text-align: center;
56
+ white-space: nowrap;
51
57
  }
52
58
 
53
59
  .void-stepper-step[data-state="active"] .void-stepper-label {
@@ -58,9 +64,9 @@ void-stepper {
58
64
  .void-stepper-connector {
59
65
  height: 2px;
60
66
  background-color: var(--void-color-border);
61
- flex: 1;
67
+ flex: 1 1 0%;
62
68
  align-self: flex-start;
63
- margin-top: 1rem;
69
+ margin-top: calc(1rem - 1px);
64
70
  }
65
71
 
66
72
  .void-stepper-connector[data-state="completed"] {
@@ -8,6 +8,7 @@ void-tabs {
8
8
  display: flex;
9
9
  border-bottom: 1px solid var(--void-color-border);
10
10
  gap: var(--void-space-1);
11
+ order: -1;
11
12
  }
12
13
 
13
14
  .void-tabs-tab {
@@ -7,6 +7,7 @@ void-textarea {
7
7
 
8
8
  void-textarea textarea {
9
9
  width: 100%;
10
+ resize: var(--void-textarea-resize, vertical);
10
11
  padding: var(--void-space-2) var(--void-space-3);
11
12
  background: var(--void-color-bg-secondary);
12
13
  border: 1px solid var(--void-color-border);
@@ -45,6 +45,7 @@ void-toast[color='info'] { --tone: var(--void-color-info); }
45
45
 
46
46
  .void-toast-heading {
47
47
  font-weight: var(--void-weight-medium);
48
+ order: -1;
48
49
  }
49
50
 
50
51
  .void-toast-close {
@@ -0,0 +1,84 @@
1
+ void-toggle {
2
+ --tone: var(--void-color-accent);
3
+ --tone-subtle: color-mix(in srgb, var(--tone) 14%, transparent);
4
+ --tone-border: color-mix(in srgb, var(--tone) 36%, transparent);
5
+ --tone-hover: color-mix(in srgb, var(--tone) 22%, transparent);
6
+
7
+ display: inline-grid;
8
+ place-content: center;
9
+ padding: var(--void-space-2);
10
+ border: 1px solid var(--void-color-border);
11
+ border-radius: var(--void-radius-md);
12
+ background: transparent;
13
+ color: var(--void-color-text-secondary);
14
+ font-family: var(--void-font-sans);
15
+ font-size: var(--void-text-sm);
16
+ font-weight: var(--void-weight-medium);
17
+ cursor: pointer;
18
+ user-select: none;
19
+ transition: background var(--void-duration-fast) var(--void-ease-in-out),
20
+ border-color var(--void-duration-fast) var(--void-ease-in-out),
21
+ color var(--void-duration-fast) var(--void-ease-in-out);
22
+ }
23
+
24
+ void-toggle:hover {
25
+ background: var(--tone-hover);
26
+ border-color: var(--void-color-border-strong);
27
+ }
28
+
29
+ void-toggle:focus-visible {
30
+ outline: 2px solid var(--void-color-border-focus);
31
+ outline-offset: 2px;
32
+ }
33
+
34
+ void-toggle[pressed] {
35
+ background: var(--tone-subtle);
36
+ border-color: var(--tone-border);
37
+ color: var(--void-color-text);
38
+ }
39
+
40
+ void-toggle[pressed]:hover {
41
+ background: var(--tone-hover);
42
+ }
43
+
44
+ void-toggle[variant="filled"][pressed] {
45
+ background: var(--tone);
46
+ border-color: var(--tone);
47
+ color: var(--void-color-text-on-accent);
48
+ }
49
+
50
+ void-toggle[variant="filled"][pressed]:hover {
51
+ opacity: 0.9;
52
+ }
53
+
54
+ void-toggle[color="error"] { --tone: var(--void-color-error); }
55
+ void-toggle[color="warning"] { --tone: var(--void-color-warning); }
56
+ void-toggle[color="success"] { --tone: var(--void-color-success); }
57
+ void-toggle[color="info"] { --tone: var(--void-color-info); }
58
+ void-toggle[color="notice"] { --tone: var(--void-color-notice); }
59
+
60
+ void-toggle[size="sm"] {
61
+ padding: var(--void-space-1);
62
+ font-size: var(--void-text-xs);
63
+ }
64
+
65
+ void-toggle[size="lg"] {
66
+ padding: var(--void-space-3);
67
+ font-size: var(--void-text-base);
68
+ }
69
+
70
+ void-toggle[size="xl"] {
71
+ padding: var(--void-space-4);
72
+ font-size: var(--void-text-lg);
73
+ }
74
+
75
+ void-toggle[size="xxl"] {
76
+ padding: var(--void-space-5);
77
+ font-size: var(--void-text-xl);
78
+ }
79
+
80
+ void-toggle[disabled] {
81
+ opacity: 0.5;
82
+ pointer-events: none;
83
+ cursor: not-allowed;
84
+ }
package/src/index.css CHANGED
@@ -44,3 +44,10 @@
44
44
  @import './components/nav-bar.css';
45
45
  @import './components/hamburger.css';
46
46
  @import './components/compose-input.css';
47
+ @import './components/sidebar.css';
48
+ @import './components/segmented-control.css';
49
+ @import './components/toggle.css';
50
+ @import './components/stat.css';
51
+
52
+ @import './components/dropdown-menu.css';
53
+ @import './components/indicator.css';
@@ -108,17 +108,28 @@
108
108
 
109
109
  /* ── Spacing (rem) ── */
110
110
  --void-space-1: 0.25rem;
111
+ --void-space-1h: 0.375rem;
111
112
  --void-space-2: 0.5rem;
113
+ --void-space-2h: 0.625rem;
112
114
  --void-space-3: 0.75rem;
113
115
  --void-space-4: 1rem;
114
116
  --void-space-5: 1.25rem;
115
117
  --void-space-6: 1.5rem;
118
+ --void-space-7: 1.75rem;
116
119
  --void-space-8: 2rem;
120
+ --void-space-9: 2.25rem;
117
121
  --void-space-10: 2.5rem;
118
122
  --void-space-12: 3rem;
123
+ --void-space-14: 3.5rem;
124
+ --void-space-15: 3.75rem;
119
125
  --void-space-16: 4rem;
120
126
  --void-space-20: 5rem;
121
127
  --void-space-24: 6rem;
128
+ --void-space-28: 7rem;
129
+ --void-space-30: 7.5rem;
130
+ --void-space-32: 8rem;
131
+ --void-space-35: 8.75rem;
132
+ --void-space-40: 10rem;
122
133
 
123
134
  --void-space-xs: var(--void-space-1);
124
135
  --void-space-sm: var(--void-space-2);
@@ -146,9 +157,23 @@
146
157
  --void-weight-bold: 700;
147
158
 
148
159
  /* ── Typography — line heights ── */
160
+ --void-leading-display: 0.92;
161
+ --void-leading-none: 1;
162
+ --void-leading-snug: 1.05;
149
163
  --void-leading-tight: 1.2;
150
164
  --void-leading-normal: 1.5;
151
165
  --void-leading-relaxed: 1.7;
166
+ --void-leading-loose: 1.75;
167
+
168
+ /* ── Typography — letter spacing (tracking) ── */
169
+ --void-tracking-tightest: -0.05em;
170
+ --void-tracking-tighter: -0.04em;
171
+ --void-tracking-tight: -0.025em;
172
+ --void-tracking-snug: -0.01em;
173
+ --void-tracking-normal: 0em;
174
+ --void-tracking-wide: 0.04em;
175
+ --void-tracking-wider: 0.06em;
176
+ --void-tracking-widest: 0.1em;
152
177
 
153
178
  /* ── Font stacks ── */
154
179
  --void-font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
@@ -189,4 +214,11 @@
189
214
  --void-z-modal: 300;
190
215
  --void-z-toast: 400;
191
216
  --void-z-tooltip: 500;
217
+
218
+ /* ── Icon ── */
219
+ --void-icon-stroke-width: 1.5;
220
+
221
+ /* ── Sidebar ── */
222
+ --void-sidebar-width: 15rem;
223
+ --void-sidebar-collapsed-width: 3.75rem;
192
224
  }