@zvndev/yable-themes 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/dist/index.css ADDED
@@ -0,0 +1,4 @@
1
+ /* @zvndev/yable-themes — YableTables Theme System */
2
+ @import './tokens.css';
3
+ @import './base.css';
4
+ @import './utilities.css';
package/dist/rtl.css ADDED
@@ -0,0 +1,180 @@
1
+ /* ============================================================================
2
+ @zvndev/yable-themes — RTL (Right-to-Left) Support
3
+ Mirrors layout, pinning, resize handles, sort indicators, and
4
+ all directional properties for RTL languages (Arabic, Hebrew, etc.).
5
+
6
+ Usage:
7
+ import '@zvndev/yable-themes/rtl.css'
8
+ <Table direction="rtl" />
9
+ ============================================================================ */
10
+
11
+ /* ── Base RTL Layout ────────────────────────────────────────────────────── */
12
+
13
+ .yable--rtl {
14
+ direction: rtl;
15
+ }
16
+
17
+ .yable--rtl .yable-table {
18
+ direction: rtl;
19
+ }
20
+
21
+ /* ── Header: Text alignment and content flow ────────────────────────────── */
22
+
23
+ .yable--rtl .yable-th {
24
+ text-align: right;
25
+ }
26
+
27
+ .yable--rtl .yable-th-content {
28
+ flex-direction: row-reverse;
29
+ justify-content: flex-end;
30
+ }
31
+
32
+ /* ── Sort indicator position ────────────────────────────────────────────── */
33
+
34
+ .yable--rtl .yable-sort-badge {
35
+ margin-left: 0;
36
+ margin-right: 2px;
37
+ }
38
+
39
+ /* ── Resize handle: Mirror to left edge ─────────────────────────────────── */
40
+
41
+ .yable--rtl .yable-resize-handle {
42
+ right: auto;
43
+ left: 0;
44
+ }
45
+
46
+ /* ── Column pinning: Swap left/right ────────────────────────────────────── */
47
+
48
+ .yable--rtl .yable-th[data-pinned="left"],
49
+ .yable--rtl .yable-td[data-pinned="left"] {
50
+ left: auto;
51
+ right: var(--yable-pin-offset, 0px);
52
+ }
53
+
54
+ .yable--rtl .yable-th[data-pinned="right"],
55
+ .yable--rtl .yable-td[data-pinned="right"] {
56
+ right: auto;
57
+ left: var(--yable-pin-offset, 0px);
58
+ }
59
+
60
+ /* Pinned shadow edges — mirror */
61
+ .yable--rtl .yable-th[data-pinned-edge="left"],
62
+ .yable--rtl .yable-td[data-pinned-edge="left"] {
63
+ box-shadow: calc(var(--yable-shadow-pinned) * -1);
64
+ clip-path: inset(0 0 0 -10px);
65
+ }
66
+
67
+ .yable--rtl .yable-th[data-pinned-edge="right"],
68
+ .yable--rtl .yable-td[data-pinned-edge="right"] {
69
+ box-shadow: var(--yable-shadow-pinned);
70
+ clip-path: inset(0 -10px 0 0);
71
+ }
72
+
73
+ /* ── Pagination: Reverse button order ───────────────────────────────────── */
74
+
75
+ .yable--rtl .yable-pagination {
76
+ flex-direction: row-reverse;
77
+ }
78
+
79
+ .yable--rtl .yable-pagination-pages {
80
+ flex-direction: row-reverse;
81
+ }
82
+
83
+ .yable--rtl .yable-pagination-info {
84
+ flex-direction: row-reverse;
85
+ }
86
+
87
+ /* Flip pagination arrow SVGs */
88
+ .yable--rtl .yable-pagination-btn svg {
89
+ transform: scaleX(-1);
90
+ }
91
+
92
+ /* ── Global Filter: Search icon on right ────────────────────────────────── */
93
+
94
+ .yable--rtl .yable-global-filter-input {
95
+ padding: 0 32px 0 10px;
96
+ background-position: right 10px center;
97
+ text-align: right;
98
+ }
99
+
100
+ /* ── Pagination Select: Arrow on left ───────────────────────────────────── */
101
+
102
+ .yable--rtl .yable-pagination-select {
103
+ padding: 0 8px 0 24px;
104
+ background-position: left 6px center;
105
+ }
106
+
107
+ /* ── Select element in cells ────────────────────────────────────────────── */
108
+
109
+ .yable--rtl .yable-select {
110
+ padding: 0 var(--yable-input-padding-x) 0 calc(var(--yable-input-padding-x) + 16px);
111
+ background-position: left 6px center;
112
+ }
113
+
114
+ /* ── Expand toggle ──────────────────────────────────────────────────────── */
115
+
116
+ .yable--rtl .yable-expand-toggle[data-expanded="true"] {
117
+ transform: rotate(-90deg);
118
+ }
119
+
120
+ /* ── Bordered: Mirror border side ───────────────────────────────────────── */
121
+
122
+ .yable--rtl.yable--bordered .yable-th,
123
+ .yable--rtl.yable--bordered .yable-td {
124
+ border-right: none;
125
+ border-left: var(--yable-border-width) solid var(--yable-border-color);
126
+ }
127
+
128
+ .yable--rtl.yable--bordered .yable-th:last-child,
129
+ .yable--rtl.yable--bordered .yable-td:last-child {
130
+ border-left: none;
131
+ }
132
+
133
+ /* ── Sidebar: Slide from left in RTL ────────────────────────────────────── */
134
+
135
+ .yable--rtl .yable-sidebar {
136
+ right: auto;
137
+ left: 0;
138
+ border-right: 1px solid var(--yable-border-color);
139
+ border-left: none;
140
+ transform: translateX(-100%);
141
+ }
142
+
143
+ .yable--rtl .yable-sidebar--open {
144
+ transform: translateX(0);
145
+ }
146
+
147
+ /* ── Context menu: Submenu opens to left ────────────────────────────────── */
148
+
149
+ .yable--rtl .yable-ctx-submenu {
150
+ left: auto;
151
+ right: 100%;
152
+ }
153
+
154
+ .yable--rtl .yable-ctx-item-arrow svg {
155
+ transform: scaleX(-1);
156
+ }
157
+
158
+ .yable--rtl .yable-ctx-item-shortcut {
159
+ margin-left: 0;
160
+ margin-right: auto;
161
+ padding-left: 0;
162
+ padding-right: 16px;
163
+ }
164
+
165
+ /* ── Status bar ─────────────────────────────────────────────────────────── */
166
+
167
+ .yable--rtl .yable-status-bar {
168
+ flex-direction: row-reverse;
169
+ }
170
+
171
+ /* ── Sidebar drag handle ────────────────────────────────────────────────── */
172
+
173
+ .yable--rtl .yable-sidebar-column-item {
174
+ flex-direction: row-reverse;
175
+ }
176
+
177
+ .yable--rtl .yable-sidebar-drag-handle {
178
+ margin-left: 8px;
179
+ margin-right: 0;
180
+ }
@@ -0,0 +1,69 @@
1
+ /* ============================================================================
2
+ @zvndev/yable-themes — Tailwind v4 Theme Bridge
3
+ ============================================================================
4
+
5
+ Imports Yable's CSS custom properties into Tailwind's `@theme` namespace
6
+ so consumers can write utilities like `bg-yable-bg`, `text-yable-primary`,
7
+ `border-yable`, `rounded-yable`, etc. in their components.
8
+
9
+ Usage (Tailwind v4):
10
+
11
+ @import "tailwindcss";
12
+ @import "@zvndev/yable-themes";
13
+ @import "@zvndev/yable-themes/tailwind.css";
14
+
15
+ The middle import provides the base table CSS + token defaults; this file
16
+ re-exposes those tokens to Tailwind so utility classes resolve to live
17
+ CSS variables (i.e. they automatically follow the active theme).
18
+ ============================================================================ */
19
+
20
+ @theme inline {
21
+ /* ── Surface colors ─────────────────────────────────────────────── */
22
+ --color-yable-bg: var(--yable-bg);
23
+ --color-yable-bg-header: var(--yable-bg-header);
24
+ --color-yable-bg-footer: var(--yable-bg-footer);
25
+ --color-yable-bg-row: var(--yable-bg-row);
26
+ --color-yable-bg-row-alt: var(--yable-bg-row-alt);
27
+ --color-yable-bg-row-hover: var(--yable-bg-row-hover);
28
+ --color-yable-bg-row-selected: var(--yable-bg-row-selected);
29
+ --color-yable-bg-row-expanded: var(--yable-bg-row-expanded);
30
+ --color-yable-bg-cell-editing: var(--yable-bg-cell-editing);
31
+ --color-yable-bg-pinned: var(--yable-bg-pinned);
32
+
33
+ /* ── Text colors ────────────────────────────────────────────────── */
34
+ --color-yable-text: var(--yable-text-primary);
35
+ --color-yable-text-secondary: var(--yable-text-secondary);
36
+ --color-yable-text-tertiary: var(--yable-text-tertiary);
37
+ --color-yable-text-header: var(--yable-text-header);
38
+ --color-yable-text-disabled: var(--yable-text-disabled);
39
+ --color-yable-text-link: var(--yable-text-link);
40
+ --color-yable-text-placeholder: var(--yable-text-placeholder);
41
+
42
+ /* ── Borders ────────────────────────────────────────────────────── */
43
+ --color-yable-border: var(--yable-border-color);
44
+ --color-yable-border-strong: var(--yable-border-color-strong);
45
+
46
+ /* ── Accent / interactive ───────────────────────────────────────── */
47
+ --color-yable-accent: var(--yable-accent);
48
+ --color-yable-accent-hover: var(--yable-accent-hover);
49
+ --color-yable-accent-light: var(--yable-accent-light);
50
+ --color-yable-accent-text: var(--yable-accent-text);
51
+ --color-yable-focus-ring: var(--yable-focus-ring);
52
+
53
+ /* ── Spacing tokens ─────────────────────────────────────────────── */
54
+ --spacing-yable-cell-x: var(--yable-cell-padding-x);
55
+ --spacing-yable-cell-y: var(--yable-cell-padding-y);
56
+ --spacing-yable-header-x: var(--yable-header-padding-x);
57
+ --spacing-yable-header-y: var(--yable-header-padding-y);
58
+
59
+ /* ── Border radius ──────────────────────────────────────────────── */
60
+ --radius-yable: var(--yable-border-radius);
61
+ --radius-yable-sm: var(--yable-border-radius-sm);
62
+ --radius-yable-lg: var(--yable-border-radius-lg);
63
+
64
+ /* ── Typography ─────────────────────────────────────────────────── */
65
+ --font-yable: var(--yable-font-family);
66
+ --text-yable: var(--yable-font-size);
67
+ --text-yable-sm: var(--yable-font-size-sm);
68
+ --text-yable-header: var(--yable-font-size-header);
69
+ }
@@ -0,0 +1,178 @@
1
+ /* ============================================================================
2
+ @zvndev/yable-themes — Compact Theme
3
+ Dense, data-heavy variant. Optimized for displaying maximum information
4
+ in minimum space. Think Bloomberg terminal meets modern design.
5
+
6
+ Usage:
7
+ import '@zvndev/yable-themes'
8
+ import '@zvndev/yable-themes/compact.css'
9
+ <Table className="yable-theme-compact" />
10
+ ============================================================================ */
11
+
12
+ .yable-theme-compact,
13
+ .yable[data-theme="compact"] {
14
+ /* Surface — light gray background for data density */
15
+ --yable-bg: #ffffff;
16
+ --yable-bg-header: #f3f4f6;
17
+ --yable-bg-footer: #f3f4f6;
18
+ --yable-bg-row-alt: rgba(0, 0, 0, 0.018);
19
+ --yable-bg-row-hover: rgba(0, 0, 0, 0.035);
20
+ --yable-bg-row-selected: rgba(16, 185, 129, 0.06);
21
+ --yable-bg-pinned: #fafafa;
22
+
23
+ /* Text — slightly smaller, sharper */
24
+ --yable-text-primary: #1f2937;
25
+ --yable-text-secondary: #6b7280;
26
+ --yable-text-tertiary: #9ca3af;
27
+ --yable-text-header: #374151;
28
+
29
+ /* Borders — more visible for dense data */
30
+ --yable-border-color: #e5e7eb;
31
+ --yable-border-color-strong: #d1d5db;
32
+ --yable-border-radius: 6px;
33
+
34
+ /* Tight spacing */
35
+ --yable-cell-padding-x: 8px;
36
+ --yable-cell-padding-y: 4px;
37
+ --yable-header-padding-x: 8px;
38
+ --yable-header-padding-y: 6px;
39
+
40
+ /* Small sizes */
41
+ --yable-row-min-height: 28px;
42
+ --yable-header-min-height: 30px;
43
+
44
+ /* Typography — smaller, monospace-friendly */
45
+ --yable-font-size: 12px;
46
+ --yable-font-size-sm: 11px;
47
+ --yable-font-size-header: 11px;
48
+ --yable-line-height: 1.4;
49
+
50
+ /* Accent — green for a data/financial feel */
51
+ --yable-accent: #10b981;
52
+ --yable-accent-hover: #059669;
53
+ --yable-accent-light: rgba(16, 185, 129, 0.08);
54
+ --yable-accent-text: #ffffff;
55
+
56
+ /* Shadows — minimal */
57
+ --yable-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
58
+ --yable-shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.06);
59
+
60
+ /* Form controls — extra small */
61
+ --yable-input-height: 24px;
62
+ --yable-input-padding-x: 6px;
63
+ --yable-input-font-size: 12px;
64
+ --yable-input-border-radius: 3px;
65
+
66
+ /* Checkbox — small */
67
+ --yable-checkbox-size: 14px;
68
+ --yable-checkbox-radius: 2px;
69
+
70
+ /* Pagination — compact */
71
+ --yable-pagination-button-size: 26px;
72
+ --yable-pagination-button-radius: 4px;
73
+ --yable-pagination-gap: 2px;
74
+
75
+ /* Resize handle */
76
+ --yable-resize-handle-width: 3px;
77
+ }
78
+
79
+ /* Headers — bold, borderline industrial */
80
+ .yable-theme-compact .yable-th,
81
+ .yable[data-theme="compact"] .yable-th {
82
+ text-transform: uppercase;
83
+ letter-spacing: 0.04em;
84
+ font-size: 10px;
85
+ font-weight: var(--yable-font-weight-semibold);
86
+ color: var(--yable-text-secondary);
87
+ background: var(--yable-bg-header);
88
+ }
89
+
90
+ /* All rows get separators */
91
+ .yable-theme-compact .yable-tr:not(:last-child) .yable-td,
92
+ .yable[data-theme="compact"] .yable-tr:not(:last-child) .yable-td {
93
+ border-bottom: var(--yable-border-width) solid var(--yable-border-color);
94
+ }
95
+
96
+ /* Also add vertical borders for the spreadsheet feel */
97
+ .yable-theme-compact .yable-th,
98
+ .yable[data-theme="compact"] .yable-th,
99
+ .yable-theme-compact .yable-td,
100
+ .yable[data-theme="compact"] .yable-td {
101
+ border-right: var(--yable-border-width) solid var(--yable-border-color);
102
+ }
103
+
104
+ .yable-theme-compact .yable-th:last-child,
105
+ .yable[data-theme="compact"] .yable-th:last-child,
106
+ .yable-theme-compact .yable-td:last-child,
107
+ .yable[data-theme="compact"] .yable-td:last-child {
108
+ border-right: none;
109
+ }
110
+
111
+ /* Number cells — monospace */
112
+ .yable-theme-compact [data-type="number"],
113
+ .yable[data-theme="compact"] [data-type="number"] {
114
+ font-variant-numeric: tabular-nums;
115
+ text-align: right;
116
+ }
117
+
118
+ /* ── Compact Dark Mode ───────────────────────────────────────────────────── */
119
+
120
+ @media (prefers-color-scheme: dark) {
121
+ .yable-theme-compact:not([data-yable-theme="light"]),
122
+ .yable[data-theme="compact"]:not([data-yable-theme="light"]) {
123
+ --yable-bg: #0d0f14;
124
+ --yable-bg-header: #141720;
125
+ --yable-bg-footer: #141720;
126
+ --yable-bg-row-alt: rgba(255, 255, 255, 0.02);
127
+ --yable-bg-row-hover: rgba(255, 255, 255, 0.04);
128
+ --yable-bg-row-selected: rgba(16, 185, 129, 0.1);
129
+ --yable-bg-pinned: #111318;
130
+
131
+ --yable-text-primary: #d1d5db;
132
+ --yable-text-secondary: #9ca3af;
133
+ --yable-text-tertiary: #6b7280;
134
+ --yable-text-header: #9ca3af;
135
+
136
+ --yable-border-color: #1f2937;
137
+ --yable-border-color-strong: #374151;
138
+
139
+ --yable-accent: #34d399;
140
+ --yable-accent-hover: #6ee7b7;
141
+ --yable-accent-light: rgba(52, 211, 153, 0.1);
142
+
143
+ --yable-input-border: #374151;
144
+ --yable-input-border-hover: #4b5563;
145
+ --yable-input-bg-focus: #1a1d28;
146
+ --yable-checkbox-border: #4b5563;
147
+ --yable-checkbox-bg: #1f2937;
148
+ }
149
+ }
150
+
151
+ [data-yable-theme="dark"] .yable-theme-compact,
152
+ [data-yable-theme="dark"] .yable[data-theme="compact"] {
153
+ --yable-bg: #0d0f14;
154
+ --yable-bg-header: #141720;
155
+ --yable-bg-footer: #141720;
156
+ --yable-bg-row-alt: rgba(255, 255, 255, 0.02);
157
+ --yable-bg-row-hover: rgba(255, 255, 255, 0.04);
158
+ --yable-bg-row-selected: rgba(16, 185, 129, 0.1);
159
+ --yable-bg-pinned: #111318;
160
+
161
+ --yable-text-primary: #d1d5db;
162
+ --yable-text-secondary: #9ca3af;
163
+ --yable-text-tertiary: #6b7280;
164
+ --yable-text-header: #9ca3af;
165
+
166
+ --yable-border-color: #1f2937;
167
+ --yable-border-color-strong: #374151;
168
+
169
+ --yable-accent: #34d399;
170
+ --yable-accent-hover: #6ee7b7;
171
+ --yable-accent-light: rgba(52, 211, 153, 0.1);
172
+
173
+ --yable-input-border: #374151;
174
+ --yable-input-border-hover: #4b5563;
175
+ --yable-input-bg-focus: #1a1d28;
176
+ --yable-checkbox-border: #4b5563;
177
+ --yable-checkbox-bg: #1f2937;
178
+ }
@@ -0,0 +1,127 @@
1
+ /* ============================================================================
2
+ @zvndev/yable-themes — Default Theme
3
+ Clean, minimal, modern. The Linear/Vercel aesthetic.
4
+ Import this after index.css for a polished look out of the box.
5
+
6
+ Usage:
7
+ import '@zvndev/yable-themes'
8
+ import '@zvndev/yable-themes/default.css'
9
+ ============================================================================ */
10
+
11
+ .yable-theme-default,
12
+ .yable[data-theme="default"] {
13
+ /* Surface — ultra-clean white with barely-there alternation */
14
+ --yable-bg: #ffffff;
15
+ --yable-bg-header: #fafbfc;
16
+ --yable-bg-footer: #fafbfc;
17
+ --yable-bg-row-alt: rgba(0, 0, 0, 0.012);
18
+ --yable-bg-row-hover: rgba(0, 0, 0, 0.022);
19
+ --yable-bg-row-selected: rgba(37, 99, 235, 0.05);
20
+
21
+ /* Text — high-contrast primaries, muted secondaries */
22
+ --yable-text-primary: #0f172a;
23
+ --yable-text-secondary: #64748b;
24
+ --yable-text-tertiary: #94a3b8;
25
+ --yable-text-header: #475569;
26
+
27
+ /* Borders — barely visible, structural only */
28
+ --yable-border-color: #f1f5f9;
29
+ --yable-border-color-strong: #e2e8f0;
30
+ --yable-border-radius: 10px;
31
+
32
+ /* Accent — cool blue */
33
+ --yable-accent: #2563eb;
34
+ --yable-accent-hover: #1d4ed8;
35
+ --yable-accent-light: rgba(37, 99, 235, 0.07);
36
+
37
+ /* Shadows — very subtle, barely there */
38
+ --yable-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
39
+ --yable-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.06);
40
+
41
+ /* Form — clean inputs */
42
+ --yable-input-border: #e2e8f0;
43
+ --yable-input-border-hover: #cbd5e1;
44
+ --yable-input-border-radius: 6px;
45
+
46
+ /* Checkbox — rounded for modern feel */
47
+ --yable-checkbox-radius: 4px;
48
+ --yable-checkbox-border: #cbd5e1;
49
+
50
+ /* Pagination — pill-style */
51
+ --yable-pagination-button-radius: 8px;
52
+ }
53
+
54
+ /* Default theme header — clean divider line only */
55
+ .yable-theme-default .yable-th,
56
+ .yable[data-theme="default"] .yable-th {
57
+ border-bottom-color: var(--yable-border-color-strong);
58
+ text-transform: none;
59
+ letter-spacing: normal;
60
+ font-size: var(--yable-font-size-sm);
61
+ font-weight: var(--yable-font-weight-medium);
62
+ color: var(--yable-text-secondary);
63
+ }
64
+
65
+ /* Subtle row separator */
66
+ .yable-theme-default .yable-tr:not(:last-child) .yable-td,
67
+ .yable[data-theme="default"] .yable-tr:not(:last-child) .yable-td {
68
+ border-bottom-color: var(--yable-border-color);
69
+ }
70
+
71
+ /* ── Default Dark Mode ───────────────────────────────────────────────────── */
72
+
73
+ @media (prefers-color-scheme: dark) {
74
+ .yable-theme-default:not([data-yable-theme="light"]),
75
+ .yable[data-theme="default"]:not([data-yable-theme="light"]) {
76
+ --yable-bg: #0c0e14;
77
+ --yable-bg-header: #111318;
78
+ --yable-bg-footer: #111318;
79
+ --yable-bg-row-alt: rgba(255, 255, 255, 0.015);
80
+ --yable-bg-row-hover: rgba(255, 255, 255, 0.03);
81
+ --yable-bg-row-selected: rgba(59, 130, 246, 0.08);
82
+
83
+ --yable-text-primary: #f1f5f9;
84
+ --yable-text-secondary: #94a3b8;
85
+ --yable-text-tertiary: #64748b;
86
+ --yable-text-header: #94a3b8;
87
+
88
+ --yable-border-color: #1e293b;
89
+ --yable-border-color-strong: #334155;
90
+
91
+ --yable-accent: #3b82f6;
92
+ --yable-accent-hover: #60a5fa;
93
+ --yable-accent-light: rgba(59, 130, 246, 0.12);
94
+
95
+ --yable-input-border: #334155;
96
+ --yable-input-border-hover: #475569;
97
+ --yable-checkbox-border: #475569;
98
+ --yable-checkbox-bg: #1e293b;
99
+ }
100
+ }
101
+
102
+ [data-yable-theme="dark"] .yable-theme-default,
103
+ [data-yable-theme="dark"] .yable[data-theme="default"] {
104
+ --yable-bg: #0c0e14;
105
+ --yable-bg-header: #111318;
106
+ --yable-bg-footer: #111318;
107
+ --yable-bg-row-alt: rgba(255, 255, 255, 0.015);
108
+ --yable-bg-row-hover: rgba(255, 255, 255, 0.03);
109
+ --yable-bg-row-selected: rgba(59, 130, 246, 0.08);
110
+
111
+ --yable-text-primary: #f1f5f9;
112
+ --yable-text-secondary: #94a3b8;
113
+ --yable-text-tertiary: #64748b;
114
+ --yable-text-header: #94a3b8;
115
+
116
+ --yable-border-color: #1e293b;
117
+ --yable-border-color-strong: #334155;
118
+
119
+ --yable-accent: #3b82f6;
120
+ --yable-accent-hover: #60a5fa;
121
+ --yable-accent-light: rgba(59, 130, 246, 0.12);
122
+
123
+ --yable-input-border: #334155;
124
+ --yable-input-border-hover: #475569;
125
+ --yable-checkbox-border: #475569;
126
+ --yable-checkbox-bg: #1e293b;
127
+ }