@tokis/theme 1.0.1 → 1.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 CHANGED
@@ -1,44 +1,44 @@
1
- # /theme
1
+ # @tokis/theme
2
2
 
3
3
  Default visual theme for the Tokis design system — CSS variables, component styles, reset, and typography. Zero-runtime, precompiled CSS.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install /theme
8
+ npm install @tokis/theme
9
9
  ```
10
10
 
11
- > Or install everything at once: `npm install tokis`
11
+ > Or install everything at once: `npm install @tokis/tokis`
12
12
 
13
13
  ## Usage
14
14
 
15
15
  Import the full theme (recommended):
16
16
 
17
17
  ```tsx
18
- import '/theme';
18
+ import '@tokis/theme';
19
19
  ```
20
20
 
21
21
  Or import individual layers:
22
22
 
23
23
  ```tsx
24
- import '/theme/base'; // Variables + reset
25
- import '/theme/components'; // All component styles
26
- import '/theme/utilities'; // Utility classes
24
+ import '@tokis/theme/base'; // Variables + reset
25
+ import '@tokis/theme/components'; // All component styles
26
+ import '@tokis/theme/utilities'; // Utility classes
27
27
  ```
28
28
 
29
29
  Or import specific component styles:
30
30
 
31
31
  ```tsx
32
- import '/theme/base';
33
- import '/theme/components/button';
34
- import '/theme/components/dialog';
32
+ import '@tokis/theme/base';
33
+ import '@tokis/theme/components/button';
34
+ import '@tokis/theme/components/dialog';
35
35
  ```
36
36
 
37
37
  ## What's Included
38
38
 
39
39
  - **CSS Variables** — Full token set: colors, spacing, radius, shadows, typography, motion, z-index
40
40
  - **Reset** — Minimal, opinionated CSS reset
41
- - **Component Styles** — Styles for every `/react` component
41
+ - **Component Styles** — Styles for every `@tokis/react` component
42
42
  - **Dark Mode** — Automatic via `[data-theme="dark"]` attribute
43
43
  - **Utilities** — Common helper classes
44
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokis/theme",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Default visual theme for Tokis — CSS variables, component styles, reset, and typography. Zero-runtime, precompiled CSS.",
5
5
  "exports": {
6
6
  ".": "./src/index.css",
@@ -36,7 +36,7 @@
36
36
  color: var(--tokis-text-primary);
37
37
  background: none;
38
38
  border: none;
39
- text-align: left;
39
+ text-align: start;
40
40
  cursor: pointer;
41
41
  transition: background var(--tokis-duration-fast) var(--tokis-ease-out);
42
42
  outline: none;
@@ -107,12 +107,12 @@
107
107
  /* ── Flush variant ──────────────────────────────────────────── */
108
108
 
109
109
  .tokis-accordion-root--flush .tokis-accordion-trigger {
110
- padding-left: 0;
111
- padding-right: 0;
110
+ padding-inline-start: 0;
111
+ padding-inline-end: 0;
112
112
  }
113
113
  .tokis-accordion-root--flush .tokis-accordion-content-inner {
114
- padding-left: 0;
115
- padding-right: 0;
114
+ padding-inline-start: 0;
115
+ padding-inline-end: 0;
116
116
  }
117
117
 
118
118
  /* ── Reduced motion ─────────────────────────────────────────── */
@@ -9,7 +9,7 @@
9
9
  gap: var(--tokis-spacing-3);
10
10
  padding: var(--tokis-spacing-4);
11
11
  border-radius: var(--tokis-radius-lg);
12
- border-left: 3px solid transparent;
12
+ border-inline-start: 3px solid transparent;
13
13
  font-size: var(--tokis-font-size-sm);
14
14
  line-height: var(--tokis-line-height-normal);
15
15
  animation: tokis-alert-in 250ms var(--tokis-ease-spring) both;
@@ -23,22 +23,22 @@
23
23
  .tokis-alert--info {
24
24
  background: var(--tokis-color-info-subtle);
25
25
  color: var(--tokis-color-info);
26
- border-left-color: var(--tokis-color-info);
26
+ border-inline-start-color: var(--tokis-color-info);
27
27
  }
28
28
  .tokis-alert--success {
29
29
  background: var(--tokis-color-success-subtle);
30
30
  color: var(--tokis-color-success);
31
- border-left-color: var(--tokis-color-success);
31
+ border-inline-start-color: var(--tokis-color-success);
32
32
  }
33
33
  .tokis-alert--warning {
34
34
  background: var(--tokis-color-warning-subtle);
35
35
  color: var(--tokis-color-warning);
36
- border-left-color: var(--tokis-color-warning);
36
+ border-inline-start-color: var(--tokis-color-warning);
37
37
  }
38
38
  .tokis-alert--error {
39
39
  background: var(--tokis-color-error-subtle);
40
40
  color: var(--tokis-color-error);
41
- border-left-color: var(--tokis-color-error);
41
+ border-inline-start-color: var(--tokis-color-error);
42
42
  }
43
43
 
44
44
  /* Dark mode: softer, more readable versions */
@@ -83,7 +83,7 @@
83
83
  .tokis-snackbar-container {
84
84
  position: fixed;
85
85
  bottom: var(--tokis-spacing-6);
86
- right: var(--tokis-spacing-6);
86
+ inset-inline-end: var(--tokis-spacing-6);
87
87
  z-index: var(--tokis-z-toast);
88
88
  display: flex;
89
89
  flex-direction: column;
@@ -92,7 +92,7 @@
92
92
  width: calc(100% - var(--tokis-spacing-8));
93
93
  pointer-events: none;
94
94
  }
95
- .tokis-snackbar-container--top-right { top: var(--tokis-spacing-6); bottom: auto; right: var(--tokis-spacing-6); }
95
+ .tokis-snackbar-container--top-right { top: var(--tokis-spacing-6); bottom: auto; inset-inline-end: var(--tokis-spacing-6); }
96
96
  .tokis-snackbar-container--top-center { top: var(--tokis-spacing-6); bottom: auto; left: 50%; right: auto; transform: translateX(-50%); }
97
97
  .tokis-snackbar-container--bottom-center { bottom: var(--tokis-spacing-6); left: 50%; right: auto; transform: translateX(-50%); }
98
98
 
@@ -112,29 +112,29 @@
112
112
  min-width: 280px;
113
113
  pointer-events: all;
114
114
  border: 1px solid rgb(255 255 255 / 0.08);
115
- border-left-width: 3px;
116
- border-left-color: rgb(255 255 255 / 0.15);
115
+ border-inline-start-width: 3px;
116
+ border-inline-start-color: rgb(255 255 255 / 0.15);
117
117
  }
118
118
 
119
119
  [data-theme="dark"] .tokis-snackbar {
120
120
  background: var(--tokis-color-neutral-800);
121
121
  color: var(--tokis-text-primary);
122
122
  border-color: var(--tokis-color-border);
123
- border-left-color: var(--tokis-color-border-strong);
123
+ border-inline-start-color: var(--tokis-color-border-strong);
124
124
  }
125
125
 
126
126
  /* Variant color accents — minimal, left-border only */
127
127
  .tokis-snackbar--success {
128
- border-left-color: var(--tokis-color-success);
128
+ border-inline-start-color: var(--tokis-color-success);
129
129
  }
130
130
  .tokis-snackbar--error {
131
- border-left-color: var(--tokis-color-error);
131
+ border-inline-start-color: var(--tokis-color-error);
132
132
  }
133
133
  .tokis-snackbar--warning {
134
- border-left-color: var(--tokis-color-warning);
134
+ border-inline-start-color: var(--tokis-color-warning);
135
135
  }
136
136
  .tokis-snackbar--info {
137
- border-left-color: var(--tokis-color-info);
137
+ border-inline-start-color: var(--tokis-color-info);
138
138
  }
139
139
 
140
140
  .tokis-snackbar__icon { flex-shrink: 0; margin-top: 1px; }
@@ -65,5 +65,5 @@
65
65
  display: flex;
66
66
  align-items: center;
67
67
  gap: var(--tokis-spacing-2);
68
- margin-left: auto;
68
+ margin-inline-start: auto;
69
69
  }
@@ -43,7 +43,7 @@
43
43
  .tokis-avatar-status {
44
44
  position: absolute;
45
45
  bottom: 1px;
46
- right: 1px;
46
+ inset-inline-end: 1px;
47
47
  width: 10px;
48
48
  height: 10px;
49
49
  border-radius: var(--tokis-radius-full);
@@ -61,10 +61,10 @@
61
61
  }
62
62
  .tokis-avatar-group .tokis-avatar {
63
63
  border: 2px solid var(--tokis-color-background);
64
- margin-left: -8px;
64
+ margin-inline-start: -8px;
65
65
  }
66
66
  .tokis-avatar-group .tokis-avatar:first-child {
67
- margin-left: 0;
67
+ margin-inline-start: 0;
68
68
  }
69
69
  .tokis-avatar-group .tokis-avatar-overflow {
70
70
  background: var(--tokis-color-neutral-200);
@@ -72,7 +72,7 @@
72
72
  font-size: var(--tokis-font-size-xs);
73
73
  font-weight: var(--tokis-font-weight-semibold);
74
74
  border: 2px solid var(--tokis-color-background);
75
- margin-left: -8px;
75
+ margin-inline-start: -8px;
76
76
  }
77
77
 
78
78
  /* ── Badge ──────────────────────────────────────────────────── */
@@ -179,7 +179,7 @@
179
179
  cursor: pointer;
180
180
  opacity: 0.55;
181
181
  transition: opacity var(--tokis-duration-fast) var(--tokis-ease-out), background var(--tokis-duration-fast) var(--tokis-ease-out);
182
- margin-right: -4px;
182
+ margin-inline-end: -4px;
183
183
  flex-shrink: 0;
184
184
  border: none;
185
185
  background: none;
@@ -53,7 +53,7 @@
53
53
  .tokis-bottom-nav__badge {
54
54
  position: absolute;
55
55
  top: -4px;
56
- right: -8px;
56
+ inset-inline-end: -8px;
57
57
  min-width: 16px;
58
58
  height: 16px;
59
59
  padding: 0 4px;
@@ -191,13 +191,19 @@
191
191
  border-radius: 0;
192
192
  }
193
193
  .tokis-btn-group .tokis-btn:first-child {
194
- border-radius: var(--tokis-radius-md) 0 0 var(--tokis-radius-md);
194
+ border-start-start-radius: var(--tokis-radius-md);
195
+ border-end-start-radius: var(--tokis-radius-md);
196
+ border-start-end-radius: 0;
197
+ border-end-end-radius: 0;
195
198
  }
196
199
  .tokis-btn-group .tokis-btn:last-child {
197
- border-radius: 0 var(--tokis-radius-md) var(--tokis-radius-md) 0;
200
+ border-start-start-radius: 0;
201
+ border-end-start-radius: 0;
202
+ border-start-end-radius: var(--tokis-radius-md);
203
+ border-end-end-radius: var(--tokis-radius-md);
198
204
  }
199
205
  .tokis-btn-group .tokis-btn--secondary + .tokis-btn--secondary {
200
- border-left-color: transparent;
206
+ border-inline-start-color: transparent;
201
207
  }
202
208
 
203
209
  /* ── Reduced motion ─────────────────────────────────────────── */
@@ -98,7 +98,7 @@
98
98
  }
99
99
  .tokis-divider--vertical {
100
100
  border-top: none;
101
- border-left: 1px solid var(--tokis-color-border);
101
+ border-inline-start: 1px solid var(--tokis-color-border);
102
102
  height: auto;
103
103
  align-self: stretch;
104
104
  }
@@ -212,7 +212,7 @@
212
212
  padding: var(--tokis-spacing-3) var(--tokis-spacing-4);
213
213
  font-weight: var(--tokis-font-weight-semibold);
214
214
  color: var(--tokis-text-secondary);
215
- text-align: left;
215
+ text-align: start;
216
216
  white-space: nowrap;
217
217
  font-size: var(--tokis-font-size-xs);
218
218
  text-transform: uppercase;
@@ -108,9 +108,9 @@
108
108
  color: var(--tokis-text-tertiary);
109
109
  font-size: var(--tokis-font-size-sm);
110
110
  line-height: 1.6;
111
- border-right: 1px solid var(--tokis-color-border);
111
+ border-inline-end: 1px solid var(--tokis-color-border);
112
112
  min-width: 2.5rem;
113
- text-align: right;
113
+ text-align: end;
114
114
  user-select: none;
115
115
  flex-shrink: 0;
116
116
  }
@@ -121,7 +121,7 @@
121
121
  }
122
122
 
123
123
  [data-theme='dark'] .tokis-codeblock__lines {
124
- border-right-color: #30363d;
124
+ border-inline-end-color: #30363d;
125
125
  color: #6e7681;
126
126
  }
127
127
 
@@ -101,7 +101,7 @@
101
101
  background: transparent;
102
102
  border: none;
103
103
  cursor: pointer;
104
- text-align: left;
104
+ text-align: start;
105
105
  font-family: var(--tokis-font-family);
106
106
  transition: background var(--tokis-duration-fast) var(--tokis-ease-out);
107
107
  }
@@ -31,7 +31,7 @@
31
31
  font-family: var(--tokis-font-family);
32
32
  color: var(--tokis-text-primary);
33
33
  cursor: pointer;
34
- text-align: left;
34
+ text-align: start;
35
35
  transition: background var(--tokis-duration-fast) var(--tokis-ease-out);
36
36
  }
37
37
 
@@ -0,0 +1,268 @@
1
+ /* ── DataGrid ──────────────────────────────────────────────────────────────── */
2
+
3
+ .tokis-datagrid {
4
+ --dg-border: var(--tokis-color-border, #e2e8f0);
5
+ --dg-header-bg: var(--tokis-color-surface, #f8f9fa);
6
+ --dg-row-hover: var(--tokis-color-surface-hover, #f1f5f9);
7
+ --dg-row-selected: var(--tokis-color-primary-subtle, #e6f0ff);
8
+ --dg-row-selected-border: var(--tokis-color-primary, #0066ff);
9
+ --dg-text: var(--tokis-color-text-primary, #0f172a);
10
+ --dg-text-secondary: var(--tokis-color-text-secondary, #475569);
11
+ --dg-font-size: var(--tokis-typography-fontSize-sm, 0.875rem);
12
+ --dg-cell-pad: 0 var(--tokis-spacing-4, 16px);
13
+ --dg-radius: var(--tokis-radius-md, 8px);
14
+
15
+ display: flex;
16
+ flex-direction: column;
17
+ border: 1px solid var(--dg-border);
18
+ border-radius: var(--dg-radius);
19
+ font-size: var(--dg-font-size);
20
+ color: var(--dg-text);
21
+ overflow: hidden;
22
+ background: var(--tokis-color-background, #fff);
23
+ }
24
+
25
+ /* ── Toolbar ────────────────────────────────────────────────────────────────── */
26
+
27
+ .tokis-dg-toolbar {
28
+ display: flex;
29
+ align-items: center;
30
+ gap: var(--tokis-spacing-3, 12px);
31
+ padding: var(--tokis-spacing-3, 12px) var(--tokis-spacing-4, 16px);
32
+ border-bottom: 1px solid var(--dg-border);
33
+ background: var(--dg-header-bg);
34
+ }
35
+
36
+ .tokis-dg-search {
37
+ flex: 1;
38
+ max-width: 280px;
39
+ padding: var(--tokis-spacing-2, 8px) var(--tokis-spacing-3, 12px);
40
+ border: 1px solid var(--dg-border);
41
+ border-radius: var(--tokis-radius-md, 8px);
42
+ font-size: var(--dg-font-size);
43
+ color: var(--dg-text);
44
+ background: var(--tokis-color-background, #fff);
45
+ outline: none;
46
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
47
+ }
48
+
49
+ .tokis-dg-search:focus {
50
+ border-color: var(--tokis-color-primary, #0066ff);
51
+ box-shadow: 0 0 0 3px var(--tokis-color-focus-ring, rgb(0 102 255 / 0.15));
52
+ }
53
+
54
+ /* ── Row layout ─────────────────────────────────────────────────────────────── */
55
+
56
+ .tokis-dg-header {
57
+ border-bottom: 1px solid var(--dg-border);
58
+ }
59
+
60
+ .tokis-dg-row {
61
+ display: flex;
62
+ align-items: center;
63
+ min-height: 48px;
64
+ border-bottom: 1px solid var(--dg-border);
65
+ transition: background 0.1s ease;
66
+ }
67
+
68
+ .tokis-dg-row:last-child {
69
+ border-bottom: none;
70
+ }
71
+
72
+ .tokis-dg-row--header {
73
+ background: var(--dg-header-bg);
74
+ font-weight: 600;
75
+ color: var(--dg-text);
76
+ }
77
+
78
+ .tokis-dg-row--filter-row {
79
+ background: var(--dg-header-bg);
80
+ border-top: 1px solid var(--dg-border);
81
+ }
82
+
83
+ .tokis-dg-row:not(.tokis-dg-row--header):not(.tokis-dg-row--filter-row):not(.tokis-dg-row--skeleton):hover {
84
+ background: var(--dg-row-hover);
85
+ cursor: pointer;
86
+ }
87
+
88
+ .tokis-dg-row--selected {
89
+ background: var(--dg-row-selected) !important;
90
+ border-inline-start: 2px solid var(--dg-row-selected-border);
91
+ }
92
+
93
+ /* ── Cell ───────────────────────────────────────────────────────────────────── */
94
+
95
+ .tokis-dg-cell {
96
+ flex: 1;
97
+ display: flex;
98
+ align-items: center;
99
+ justify-content: var(--dg-align, start);
100
+ padding: var(--dg-cell-pad);
101
+ overflow: hidden;
102
+ text-overflow: ellipsis;
103
+ white-space: nowrap;
104
+ min-width: 0;
105
+ }
106
+
107
+ .tokis-dg-cell--header {
108
+ user-select: none;
109
+ gap: var(--tokis-spacing-1, 4px);
110
+ }
111
+
112
+ .tokis-dg-cell--sortable {
113
+ cursor: pointer;
114
+ }
115
+
116
+ .tokis-dg-cell--sortable:hover {
117
+ color: var(--tokis-color-primary, #0066ff);
118
+ }
119
+
120
+ .tokis-dg-cell--checkbox {
121
+ flex: 0 0 48px;
122
+ max-width: 48px;
123
+ justify-content: center;
124
+ }
125
+
126
+ .tokis-dg-cell--filter {
127
+ padding-block: var(--tokis-spacing-1, 4px);
128
+ }
129
+
130
+ /* ── Sort icon ──────────────────────────────────────────────────────────────── */
131
+
132
+ .tokis-dg-sort-icon {
133
+ font-size: 0.75rem;
134
+ line-height: 1;
135
+ color: var(--tokis-color-primary, #0066ff);
136
+ }
137
+
138
+ .tokis-dg-sort-icon--none {
139
+ color: var(--dg-text-secondary);
140
+ opacity: 0.4;
141
+ }
142
+
143
+ .tokis-dg-cell--header:hover .tokis-dg-sort-icon--none {
144
+ opacity: 1;
145
+ }
146
+
147
+ /* ── Column filter input ────────────────────────────────────────────────────── */
148
+
149
+ .tokis-dg-col-filter {
150
+ width: 100%;
151
+ padding: var(--tokis-spacing-1, 4px) var(--tokis-spacing-2, 8px);
152
+ border: 1px solid var(--dg-border);
153
+ border-radius: var(--tokis-radius-sm, 4px);
154
+ font-size: calc(var(--dg-font-size) - 0.0625rem);
155
+ color: var(--dg-text);
156
+ background: var(--tokis-color-background, #fff);
157
+ outline: none;
158
+ transition: border-color 0.15s ease;
159
+ }
160
+
161
+ .tokis-dg-col-filter:focus {
162
+ border-color: var(--tokis-color-primary, #0066ff);
163
+ }
164
+
165
+ /* ── Body ───────────────────────────────────────────────────────────────────── */
166
+
167
+ .tokis-dg-body {
168
+ flex: 1;
169
+ overflow-x: auto;
170
+ }
171
+
172
+ /* ── Empty state ────────────────────────────────────────────────────────────── */
173
+
174
+ .tokis-dg-empty {
175
+ display: flex;
176
+ justify-content: center;
177
+ padding: var(--tokis-spacing-12, 48px) var(--tokis-spacing-4, 16px);
178
+ color: var(--dg-text-secondary);
179
+ }
180
+
181
+ /* ── Skeleton ───────────────────────────────────────────────────────────────── */
182
+
183
+ .tokis-dg-skeleton-bar {
184
+ display: block;
185
+ height: 12px;
186
+ width: 60%;
187
+ border-radius: var(--tokis-radius-xs, 2px);
188
+ background: linear-gradient(
189
+ 90deg,
190
+ var(--tokis-color-neutral-100, #f1f5f9) 0%,
191
+ var(--tokis-color-neutral-200, #e2e8f0) 50%,
192
+ var(--tokis-color-neutral-100, #f1f5f9) 100%
193
+ );
194
+ background-size: 200% 100%;
195
+ animation: tokis-dg-shimmer 1.4s ease-in-out infinite;
196
+ }
197
+
198
+ @keyframes tokis-dg-shimmer {
199
+ 0% { background-position: 200% 0; }
200
+ 100% { background-position: -200% 0; }
201
+ }
202
+
203
+ /* ── Pagination ─────────────────────────────────────────────────────────────── */
204
+
205
+ .tokis-dg-pagination {
206
+ display: flex;
207
+ align-items: center;
208
+ gap: var(--tokis-spacing-2, 8px);
209
+ padding: var(--tokis-spacing-3, 12px) var(--tokis-spacing-4, 16px);
210
+ border-top: 1px solid var(--dg-border);
211
+ background: var(--dg-header-bg);
212
+ font-size: calc(var(--dg-font-size) - 0.0625rem);
213
+ color: var(--dg-text-secondary);
214
+ }
215
+
216
+ .tokis-dg-pagination-info {
217
+ flex: 1;
218
+ }
219
+
220
+ .tokis-dg-page-size {
221
+ padding: var(--tokis-spacing-1, 4px) var(--tokis-spacing-2, 8px);
222
+ border: 1px solid var(--dg-border);
223
+ border-radius: var(--tokis-radius-sm, 4px);
224
+ font-size: inherit;
225
+ color: var(--dg-text);
226
+ background: var(--tokis-color-background, #fff);
227
+ cursor: pointer;
228
+ outline: none;
229
+ }
230
+
231
+ .tokis-dg-page-size:focus {
232
+ border-color: var(--tokis-color-primary, #0066ff);
233
+ }
234
+
235
+ .tokis-dg-page-btn {
236
+ display: inline-flex;
237
+ align-items: center;
238
+ justify-content: center;
239
+ width: 32px;
240
+ height: 32px;
241
+ padding: 0;
242
+ border: 1px solid var(--dg-border);
243
+ border-radius: var(--tokis-radius-sm, 4px);
244
+ background: var(--tokis-color-background, #fff);
245
+ color: var(--dg-text);
246
+ cursor: pointer;
247
+ font-size: 0.9375rem;
248
+ line-height: 1;
249
+ transition: background 0.1s ease, color 0.1s ease;
250
+ }
251
+
252
+ .tokis-dg-page-btn:hover:not(:disabled) {
253
+ background: var(--dg-row-hover);
254
+ color: var(--tokis-color-primary, #0066ff);
255
+ }
256
+
257
+ .tokis-dg-page-btn:disabled {
258
+ opacity: 0.35;
259
+ cursor: not-allowed;
260
+ }
261
+
262
+ /* ── Dark mode ──────────────────────────────────────────────────────────────── */
263
+
264
+ [data-theme="dark"] .tokis-datagrid {
265
+ --dg-border: var(--tokis-color-border, #2d3748);
266
+ --dg-header-bg: var(--tokis-color-surface, #1a202c);
267
+ --dg-row-hover: var(--tokis-color-surface-hover, #2d3748);
268
+ }