@atom63/ui-react 0.2.0-beta.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 +121 -0
- package/dist/button-sktq-nvV.d.ts +13 -0
- package/dist/chunk-7VSPECOH.js +73 -0
- package/dist/chunk-7VSPECOH.js.map +1 -0
- package/dist/chunk-AJLHJRK6.js +11 -0
- package/dist/chunk-AJLHJRK6.js.map +1 -0
- package/dist/chunk-MXNO63TC.js +2745 -0
- package/dist/chunk-MXNO63TC.js.map +1 -0
- package/dist/chunk-STCXERLM.js +354 -0
- package/dist/chunk-STCXERLM.js.map +1 -0
- package/dist/destination-link-C9NKeKLe.d.ts +34 -0
- package/dist/index.d.ts +1605 -0
- package/dist/index.js +7337 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.d.ts +196 -0
- package/dist/layout/index.js +500 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/media/index.d.ts +208 -0
- package/dist/media/index.js +1498 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/media-lightbox/parts/index.d.ts +284 -0
- package/dist/media/media-lightbox/parts/index.js +5 -0
- package/dist/media/media-lightbox/parts/index.js.map +1 -0
- package/dist/theme/index.d.ts +350 -0
- package/dist/theme/index.js +1173 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/types-Dxe5IzjE.d.ts +145 -0
- package/package.json +188 -0
- package/src/components/accordion/accordion.css +196 -0
- package/src/components/alert/alert.css +189 -0
- package/src/components/alert-dialog/alert-dialog.css +205 -0
- package/src/components/autocomplete/autocomplete.css +240 -0
- package/src/components/avatar/avatar.css +147 -0
- package/src/components/badge/badge.css +223 -0
- package/src/components/breadcrumb/breadcrumb.css +99 -0
- package/src/components/button/button.css +594 -0
- package/src/components/button-group/button-group.css +412 -0
- package/src/components/calendar/calendar.css +271 -0
- package/src/components/card/card.css +421 -0
- package/src/components/carousel/carousel.css +163 -0
- package/src/components/checkbox/checkbox.css +113 -0
- package/src/components/collapsible/collapsible.css +59 -0
- package/src/components/command/command.css +226 -0
- package/src/components/connected-panel/connected-panel.css +437 -0
- package/src/components/copy-button/copy-button.css +57 -0
- package/src/components/dialog/dialog.css +221 -0
- package/src/components/drawer/drawer.css +265 -0
- package/src/components/empty/empty.css +145 -0
- package/src/components/feedback-state/feedback-state.css +141 -0
- package/src/components/field/field.css +260 -0
- package/src/components/form/form.css +32 -0
- package/src/components/frame/frame.css +115 -0
- package/src/components/hover-card/hover-card.css +80 -0
- package/src/components/input/input.css +291 -0
- package/src/components/input-otp/input-otp.css +145 -0
- package/src/components/item/item.css +216 -0
- package/src/components/kbd/kbd.css +72 -0
- package/src/components/label/label.css +37 -0
- package/src/components/load-more-trigger/load-more-trigger.css +109 -0
- package/src/components/marquee/marquee.css +79 -0
- package/src/components/menu/menu.css +216 -0
- package/src/components/menubar/menubar.css +67 -0
- package/src/components/navigation-menu/navigation-menu.css +275 -0
- package/src/components/pagination/pagination.css +86 -0
- package/src/components/panel-setting-button/panel-setting-button.css +76 -0
- package/src/components/popover/popover.css +89 -0
- package/src/components/preview-card/preview-card.css +69 -0
- package/src/components/progress/progress.css +70 -0
- package/src/components/radio/radio.css +115 -0
- package/src/components/resizable/resizable.css +99 -0
- package/src/components/scroll-area/scroll-area.css +130 -0
- package/src/components/scrollable-list/scrollable-list.css +144 -0
- package/src/components/segmented-control/segmented-control.css +235 -0
- package/src/components/select/select.css +261 -0
- package/src/components/separator/separator.css +43 -0
- package/src/components/sheet/sheet.css +209 -0
- package/src/components/sidebar/sidebar.css +728 -0
- package/src/components/sidebar-nav-tree/sidebar-nav-tree.css +179 -0
- package/src/components/skeleton/skeleton.css +42 -0
- package/src/components/slider/slider.css +124 -0
- package/src/components/switch/switch.css +149 -0
- package/src/components/table/table.css +183 -0
- package/src/components/tabs/tabs.css +416 -0
- package/src/components/text-ticker/text-ticker.css +139 -0
- package/src/components/textarea/textarea.css +122 -0
- package/src/components/toggle/toggle.css +185 -0
- package/src/components/toggle-group/toggle-group.css +102 -0
- package/src/components/tooltip/tooltip.css +133 -0
- package/src/media/media-lightbox/media-lightbox.css +171 -0
- package/src/styles/index.css +3 -0
- package/src/styles/recipes.css +70 -0
- package/src/styles/reset.css +22 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SidebarNavTree recipe — restyle of prod @atom63/ui sidebar-nav-tree.tsx's
|
|
3
|
+
* Tailwind utilities to --a63-* tokens. It leans on the Sidebar recipe's local
|
|
4
|
+
* aliases (--sidebar-accent / --sidebar-border / --sidebar-ring), which are
|
|
5
|
+
* declared on .a63-Sidebar-wrapper, so these rows inherit the same vocabulary.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.a63-SidebarNavTree-ticker,
|
|
9
|
+
.a63-SidebarNavTree-ticker-inner {
|
|
10
|
+
min-width: 0;
|
|
11
|
+
flex: 1;
|
|
12
|
+
}
|
|
13
|
+
.a63-SidebarNavTree-ticker-inner {
|
|
14
|
+
flex: unset;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.a63-SidebarNavTree-group-label {
|
|
18
|
+
min-width: 0;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
text-overflow: ellipsis;
|
|
21
|
+
color: color-mix(in oklch, var(--sidebar-fg) 40%, transparent);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.a63-SidebarNavTree-group-content {
|
|
25
|
+
margin-block-start: var(--a63-space-0_5);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.a63-SidebarNavTree-list {
|
|
29
|
+
gap: var(--a63-space-0_5);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Nav rows: transparent by default, tinted accent on hover, primary when active. */
|
|
33
|
+
.a63-SidebarNavTree-item {
|
|
34
|
+
/* Content floor — see button.css. */
|
|
35
|
+
--nav-row-content-floor: calc(var(--typography-xs-line-height) + 2 * var(--a63-space-0_5));
|
|
36
|
+
|
|
37
|
+
height: max(
|
|
38
|
+
calc(var(--a63-control-height-sm) * var(--a63-density-scale, 1)),
|
|
39
|
+
var(--a63-control-min-size),
|
|
40
|
+
var(--nav-row-content-floor)
|
|
41
|
+
);
|
|
42
|
+
min-width: 0;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
background-color: transparent;
|
|
47
|
+
font-size: var(--a63-control-font-size-sm);
|
|
48
|
+
color: var(--sidebar-fg);
|
|
49
|
+
}
|
|
50
|
+
.a63-SidebarNavTree-item:hover {
|
|
51
|
+
background-color: color-mix(in oklch, var(--sidebar-accent) 50%, transparent);
|
|
52
|
+
color: var(--sidebar-fg);
|
|
53
|
+
}
|
|
54
|
+
.a63-SidebarNavTree-item[data-active='true'] {
|
|
55
|
+
background-color: transparent;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
color: var(--a63-action-primary);
|
|
58
|
+
}
|
|
59
|
+
.a63-SidebarNavTree-item[data-active='true']:hover {
|
|
60
|
+
background-color: color-mix(in oklch, var(--sidebar-accent) 50%, transparent);
|
|
61
|
+
color: var(--a63-action-primary);
|
|
62
|
+
}
|
|
63
|
+
.a63-SidebarNavTree-item > span {
|
|
64
|
+
min-width: 0;
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
text-overflow: ellipsis;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* The rendered row is sm-sized, but a coarse pointer still needs a full target.
|
|
70
|
+
* Both sidebar part classes are named so this outranks their own height rules. */
|
|
71
|
+
@media (pointer: coarse) {
|
|
72
|
+
.a63-Sidebar-menu-button.a63-SidebarNavTree-item,
|
|
73
|
+
.a63-Sidebar-menu-sub-button.a63-SidebarNavTree-item {
|
|
74
|
+
height: max(
|
|
75
|
+
calc(var(--a63-control-height-sm) * var(--a63-density-scale, 1)),
|
|
76
|
+
var(--a63-control-min-target),
|
|
77
|
+
var(--nav-row-content-floor)
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Collapsible row: link + expand toggle share a hover surface. */
|
|
83
|
+
.a63-SidebarNavTree-row {
|
|
84
|
+
display: flex;
|
|
85
|
+
width: 100%;
|
|
86
|
+
min-width: 0;
|
|
87
|
+
align-items: center;
|
|
88
|
+
gap: var(--a63-space-0_5);
|
|
89
|
+
padding-inline-end: var(--a63-space-0_5);
|
|
90
|
+
border-radius: var(--radius-md);
|
|
91
|
+
transition: background-color var(--a63-control-feedback-duration) var(--a63-control-feedback-ease);
|
|
92
|
+
}
|
|
93
|
+
.a63-SidebarNavTree-row:hover,
|
|
94
|
+
.a63-SidebarNavTree-row:focus-within {
|
|
95
|
+
background-color: color-mix(in oklch, var(--sidebar-accent) 50%, transparent);
|
|
96
|
+
}
|
|
97
|
+
.a63-SidebarNavTree-row-item {
|
|
98
|
+
min-width: 0;
|
|
99
|
+
flex: 1;
|
|
100
|
+
border-top-right-radius: 0;
|
|
101
|
+
border-bottom-right-radius: 0;
|
|
102
|
+
}
|
|
103
|
+
.a63-SidebarNavTree-row-item:hover {
|
|
104
|
+
background-color: transparent;
|
|
105
|
+
}
|
|
106
|
+
.a63-SidebarNavTree-row:hover .a63-SidebarNavTree-row-item {
|
|
107
|
+
color: var(--sidebar-fg);
|
|
108
|
+
}
|
|
109
|
+
.a63-SidebarNavTree-row-item[data-active='true'] {
|
|
110
|
+
background-color: transparent;
|
|
111
|
+
}
|
|
112
|
+
.a63-SidebarNavTree-row:hover .a63-SidebarNavTree-row-item[data-active='true'] {
|
|
113
|
+
color: var(--a63-action-primary);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* Trigger-only row: the section has no page, so the whole row is one control. */
|
|
117
|
+
.a63-SidebarNavTree-row-trigger {
|
|
118
|
+
gap: var(--a63-space-0_5);
|
|
119
|
+
}
|
|
120
|
+
.a63-SidebarNavTree-row-trigger .a63-SidebarNavTree-chevron {
|
|
121
|
+
flex-shrink: 0;
|
|
122
|
+
color: color-mix(in oklch, var(--sidebar-fg) 65%, transparent);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.a63-SidebarNavTree-toggle {
|
|
126
|
+
position: relative;
|
|
127
|
+
display: flex;
|
|
128
|
+
width: var(--a63-control-min-target);
|
|
129
|
+
height: var(--a63-control-min-target);
|
|
130
|
+
flex-shrink: 0;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
padding: 0;
|
|
134
|
+
border-radius: var(--radius-sm);
|
|
135
|
+
color: color-mix(in oklch, var(--sidebar-fg) 65%, transparent);
|
|
136
|
+
outline: none;
|
|
137
|
+
transition: background-color var(--a63-control-feedback-duration) var(--a63-control-feedback-ease);
|
|
138
|
+
}
|
|
139
|
+
@media (hover: hover) {
|
|
140
|
+
.a63-SidebarNavTree-toggle:hover {
|
|
141
|
+
background-color: var(--sidebar-accent);
|
|
142
|
+
color: color-mix(in oklch, var(--sidebar-fg) 70%, transparent);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
.a63-SidebarNavTree-toggle:focus-visible {
|
|
146
|
+
box-shadow: 0 0 0 2px var(--sidebar-ring);
|
|
147
|
+
}
|
|
148
|
+
/* Hide the expand toggle when the sidebar is collapsed to the icon rail. */
|
|
149
|
+
.a63-Sidebar-root[data-collapsible='icon'] .a63-SidebarNavTree-toggle,
|
|
150
|
+
.a63-Sidebar-root[data-collapsible='icon']
|
|
151
|
+
.a63-SidebarNavTree-row-trigger
|
|
152
|
+
.a63-SidebarNavTree-chevron {
|
|
153
|
+
display: none;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.a63-SidebarNavTree-chevron {
|
|
157
|
+
width: 0.75rem;
|
|
158
|
+
height: 0.75rem;
|
|
159
|
+
transition: transform var(--a63-control-feedback-duration) var(--a63-control-feedback-ease);
|
|
160
|
+
}
|
|
161
|
+
.a63-SidebarNavTree-chevron--open {
|
|
162
|
+
rotate: 180deg;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.a63-SidebarNavTree-sub-list {
|
|
166
|
+
gap: var(--a63-space-0_5);
|
|
167
|
+
margin-inline: var(--a63-space-2) 0;
|
|
168
|
+
border-left-color: color-mix(in oklch, var(--sidebar-border) 70%, transparent);
|
|
169
|
+
padding-inline: var(--a63-space-2) 0;
|
|
170
|
+
padding-block: var(--a63-space-0_5);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@media (prefers-reduced-motion: reduce) {
|
|
174
|
+
.a63-SidebarNavTree-row,
|
|
175
|
+
.a63-SidebarNavTree-toggle,
|
|
176
|
+
.a63-SidebarNavTree-chevron {
|
|
177
|
+
transition: none;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Skeleton recipe — a loading placeholder: the muted surface + a light shimmer
|
|
3
|
+
* that sweeps across via a ::after gradient (brighter in light mode, faint in
|
|
4
|
+
* dark). Disabled under reduced-motion. Presentational; consumer sizes it.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.a63-Skeleton {
|
|
8
|
+
position: relative;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
border-radius: var(--radius-md);
|
|
11
|
+
background-color: var(--a63-skeleton-base);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.a63-Skeleton::after {
|
|
15
|
+
content: '';
|
|
16
|
+
position: absolute;
|
|
17
|
+
inset: 0;
|
|
18
|
+
width: 200%;
|
|
19
|
+
height: 200%;
|
|
20
|
+
background-image: linear-gradient(
|
|
21
|
+
90deg,
|
|
22
|
+
transparent 0%,
|
|
23
|
+
var(--a63-skeleton-highlight) 50%,
|
|
24
|
+
transparent 100%
|
|
25
|
+
);
|
|
26
|
+
animation: a63-skeleton-shimmer var(--a63-motion-skeleton-shimmer-duration) linear infinite;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@keyframes a63-skeleton-shimmer {
|
|
30
|
+
0% {
|
|
31
|
+
transform: translateX(-100%);
|
|
32
|
+
}
|
|
33
|
+
100% {
|
|
34
|
+
transform: translateX(100%);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (prefers-reduced-motion: reduce) {
|
|
39
|
+
.a63-Skeleton::after {
|
|
40
|
+
animation: none;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Slider recipe — a single-thumb value control. The rail is a recessed track
|
|
3
|
+
* (track archetype: --a63-track-shadow inset well over --a63-surface-muted); the
|
|
4
|
+
* filled portion is the brand accent; the thumb is a raised control that reads the
|
|
5
|
+
* CONTROL archetype shadow. Geometry via local --slider-* constants.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.a63-Slider {
|
|
9
|
+
--slider-rail: 0.25rem;
|
|
10
|
+
--slider-thumb: var(--a63-control-icon-size-md);
|
|
11
|
+
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: var(--a63-space-2);
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: var(--slider-thumb);
|
|
18
|
+
min-height: var(--a63-control-min-target);
|
|
19
|
+
touch-action: none;
|
|
20
|
+
user-select: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.a63-Slider-control {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
align-items: center;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.a63-Slider-track {
|
|
33
|
+
position: relative;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: var(--slider-rail);
|
|
36
|
+
border-radius: var(--radius-full);
|
|
37
|
+
background-color: var(--a63-surface-muted);
|
|
38
|
+
box-shadow: var(--a63-track-shadow);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.a63-Slider-indicator {
|
|
42
|
+
position: absolute;
|
|
43
|
+
height: 100%;
|
|
44
|
+
border-radius: var(--radius-full);
|
|
45
|
+
background-color: var(--a63-action-primary);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.a63-Slider-thumb {
|
|
49
|
+
position: relative;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
width: var(--slider-thumb);
|
|
52
|
+
height: var(--slider-thumb);
|
|
53
|
+
border: 1px solid var(--a63-border-control);
|
|
54
|
+
border-radius: var(--radius-full);
|
|
55
|
+
background-color: var(--a63-surface-overlay);
|
|
56
|
+
box-shadow:
|
|
57
|
+
var(--a63-control-shadow),
|
|
58
|
+
0 1px 2px color-mix(in oklch, black 20%, transparent);
|
|
59
|
+
outline: none;
|
|
60
|
+
transition:
|
|
61
|
+
box-shadow var(--a63-control-feedback-duration) var(--a63-control-feedback-ease),
|
|
62
|
+
scale var(--a63-control-feedback-duration) var(--a63-control-feedback-ease);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Interaction floor, using the same pattern as Checkbox/Radio/Switch/Button.
|
|
66
|
+
The old arithmetic form (`inset: calc((min-target - thumb) / -2)`) subtracted
|
|
67
|
+
the thumb's border-box size, but an absolutely positioned pseudo-element is
|
|
68
|
+
laid out against the PADDING box, so the 1px border was double-counted and the
|
|
69
|
+
target measured 42px instead of 44px. Sizing the pseudo directly can't drift. */
|
|
70
|
+
.a63-Slider-thumb::after {
|
|
71
|
+
content: '';
|
|
72
|
+
position: absolute;
|
|
73
|
+
inset: 50%;
|
|
74
|
+
min-width: var(--a63-control-min-target);
|
|
75
|
+
min-height: var(--a63-control-min-target);
|
|
76
|
+
translate: -50% -50%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.a63-Slider-thumb:focus-visible {
|
|
80
|
+
box-shadow: 0 0 0 var(--a63-control-focus-ring-width) var(--a63-focus-ring);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.a63-Slider-thumb[data-dragging] {
|
|
84
|
+
scale: 1.2;
|
|
85
|
+
box-shadow: 0 0 0 var(--a63-control-focus-ring-width) var(--a63-focus-ring);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.a63-Slider-value {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex: none;
|
|
91
|
+
justify-content: flex-end;
|
|
92
|
+
font-size: var(--a63-control-font-size-sm);
|
|
93
|
+
font-variant-numeric: tabular-nums;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.a63-Slider[data-disabled] {
|
|
97
|
+
cursor: not-allowed;
|
|
98
|
+
opacity: 0.56;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.a63-Slider[data-orientation='vertical'] {
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
width: var(--slider-thumb);
|
|
104
|
+
min-width: var(--a63-control-min-target);
|
|
105
|
+
height: 100%;
|
|
106
|
+
}
|
|
107
|
+
.a63-Slider[data-orientation='vertical'] .a63-Slider-control {
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
min-height: 0;
|
|
110
|
+
}
|
|
111
|
+
.a63-Slider[data-orientation='vertical'] .a63-Slider-track {
|
|
112
|
+
width: var(--slider-rail);
|
|
113
|
+
height: 100%;
|
|
114
|
+
}
|
|
115
|
+
.a63-Slider[data-orientation='vertical'] .a63-Slider-indicator {
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: auto;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@media (prefers-reduced-motion: reduce) {
|
|
121
|
+
.a63-Slider-thumb {
|
|
122
|
+
transition: none;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Switch recipe — the selection archetype (bistable on/off). `.a63-Switch` is the
|
|
3
|
+
* track, `.a63-Switch-thumb` the knob. Checked = the brand-accent fill (shared
|
|
4
|
+
* --a63-selection-* tokens) + the thumb slides right; a press squishes the thumb.
|
|
5
|
+
*
|
|
6
|
+
* Geometry is driven by --a63-switch-thumb-size, so design language reshapes it for
|
|
7
|
+
* free (iOS enlarges the token → a bigger pill). With border-box + 1px border + 2px
|
|
8
|
+
* padding, the content box is exactly thumb·2 wide and thumb tall, so the checked
|
|
9
|
+
* travel is a clean translateX(thumb).
|
|
10
|
+
*
|
|
11
|
+
* Axis-dependent selection tokens resolve HERE (the use-site) via
|
|
12
|
+
* var(--a63-selection-X, <live semantic>), so mode/theme/brand read from the
|
|
13
|
+
* switch's own scope — never frozen through a :root indirection.
|
|
14
|
+
*
|
|
15
|
+
* Color overrides (consumers): set `--switch-track`, `--switch-accent`,
|
|
16
|
+
* `--switch-border`, and/or `--switch-focus-ring` on the root. Thumb fill/ink
|
|
17
|
+
* default to `--a63-selection-thumb` / `--a63-selection-thumb-fg` (white knob +
|
|
18
|
+
* dark icon — mode-independent). Override with `--switch-thumb-bg` / `--switch-thumb-fg`.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
.a63-Switch {
|
|
22
|
+
--switch-thumb: var(--a63-switch-thumb-size);
|
|
23
|
+
--switch-track: var(--a63-selection-track-off, var(--a63-surface-muted));
|
|
24
|
+
--switch-border: var(--a63-selection-border, var(--a63-border-control));
|
|
25
|
+
--switch-accent: var(--a63-selection-accent, var(--a63-action-primary));
|
|
26
|
+
--switch-focus-ring: var(--a63-selection-focus-ring, var(--a63-focus-ring));
|
|
27
|
+
--switch-thumb-bg: var(--a63-selection-thumb);
|
|
28
|
+
--switch-thumb-fg: var(--a63-selection-thumb-fg, color-mix(in oklch, black 78%, transparent));
|
|
29
|
+
--switch-shadow: var(--a63-choice-box-shadow, none);
|
|
30
|
+
--switch-shadow-checked: var(--a63-choice-box-shadow-checked, var(--switch-shadow));
|
|
31
|
+
--switch-current-shadow: var(--switch-shadow);
|
|
32
|
+
--switch-gloss-checked: var(--a63-choice-indicator-gloss, none);
|
|
33
|
+
|
|
34
|
+
position: relative;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
flex: none;
|
|
38
|
+
align-items: center;
|
|
39
|
+
width: calc(var(--switch-thumb) * 2 + 6px);
|
|
40
|
+
height: calc(var(--switch-thumb) + 6px);
|
|
41
|
+
padding: 2px;
|
|
42
|
+
border: 1px solid var(--switch-border);
|
|
43
|
+
border-radius: var(--radius-full);
|
|
44
|
+
background-color: var(--switch-track);
|
|
45
|
+
background-image: none;
|
|
46
|
+
box-shadow: var(--switch-current-shadow);
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
outline: none;
|
|
49
|
+
transition:
|
|
50
|
+
background-color var(--a63-control-feedback-duration) var(--a63-control-feedback-ease),
|
|
51
|
+
border-color var(--a63-control-feedback-duration) var(--a63-control-feedback-ease),
|
|
52
|
+
box-shadow var(--a63-control-feedback-duration) var(--a63-control-feedback-ease);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Interaction floor, using the same pattern as Checkbox/Radio/Button. The old
|
|
56
|
+
arithmetic form (`inset: calc((min-target - track-height) / -2)`) subtracted
|
|
57
|
+
the border-box track height, but an absolutely positioned pseudo-element is
|
|
58
|
+
laid out against the PADDING box, so the 1px borders were double-counted and
|
|
59
|
+
the target resolved to 42px instead of 44px. Sizing the pseudo directly can't
|
|
60
|
+
drift. */
|
|
61
|
+
.a63-Switch::after {
|
|
62
|
+
content: '';
|
|
63
|
+
position: absolute;
|
|
64
|
+
inset: 50%;
|
|
65
|
+
min-width: var(--a63-control-min-target);
|
|
66
|
+
min-height: var(--a63-control-min-target);
|
|
67
|
+
translate: -50% -50%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.a63-Switch-thumb {
|
|
71
|
+
--thumb-x: 0;
|
|
72
|
+
--thumb-sx: 1;
|
|
73
|
+
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
display: grid;
|
|
76
|
+
place-items: center;
|
|
77
|
+
height: 100%;
|
|
78
|
+
aspect-ratio: 1;
|
|
79
|
+
border: 1px solid color-mix(in oklch, black 8%, transparent);
|
|
80
|
+
border-radius: var(--radius-full);
|
|
81
|
+
background: var(--switch-thumb-bg);
|
|
82
|
+
color: var(--switch-thumb-fg);
|
|
83
|
+
box-shadow: 0 1px 2px color-mix(in oklch, black 20%, transparent);
|
|
84
|
+
transform: translateX(var(--thumb-x)) scaleX(var(--thumb-sx));
|
|
85
|
+
transform-origin: left center;
|
|
86
|
+
transition:
|
|
87
|
+
transform var(--a63-control-feedback-duration) var(--a63-control-feedback-ease),
|
|
88
|
+
background-color var(--a63-control-feedback-duration) var(--a63-control-feedback-ease),
|
|
89
|
+
color var(--a63-control-feedback-duration) var(--a63-control-feedback-ease),
|
|
90
|
+
box-shadow var(--a63-control-feedback-duration) var(--a63-control-feedback-ease);
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Keep thumb children optically round when the press squash runs on the knob. */
|
|
95
|
+
.a63-Switch-thumb > * {
|
|
96
|
+
display: grid;
|
|
97
|
+
place-items: center;
|
|
98
|
+
transform: scaleX(calc(1 / var(--thumb-sx)));
|
|
99
|
+
transition: transform var(--a63-control-feedback-duration) var(--a63-control-feedback-ease);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ── States ────────────────────────────────────────────────────────────── */
|
|
103
|
+
|
|
104
|
+
.a63-Switch[data-checked] {
|
|
105
|
+
--switch-current-shadow: var(--switch-shadow-checked);
|
|
106
|
+
|
|
107
|
+
background-color: var(--switch-accent);
|
|
108
|
+
background-image: var(--switch-gloss-checked);
|
|
109
|
+
border-color: var(--switch-accent);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.a63-Switch[data-checked] .a63-Switch-thumb {
|
|
113
|
+
--thumb-x: var(--switch-thumb);
|
|
114
|
+
|
|
115
|
+
transform-origin: right center;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.a63-Switch:hover:not([data-disabled]):not([data-checked]) {
|
|
119
|
+
border-color: color-mix(in oklch, var(--switch-border), var(--a63-text-primary) 20%);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.a63-Switch:active:not([data-disabled]) .a63-Switch-thumb {
|
|
123
|
+
--thumb-sx: 1.12;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.a63-Switch:focus-visible {
|
|
127
|
+
box-shadow:
|
|
128
|
+
var(--switch-current-shadow),
|
|
129
|
+
0 0 0 var(--a63-control-focus-ring-width) var(--switch-focus-ring);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.a63-Switch[data-disabled] {
|
|
133
|
+
cursor: not-allowed;
|
|
134
|
+
opacity: 0.56;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* ── Sizes (md is the base rule above) ─────────────────────────────────── */
|
|
138
|
+
|
|
139
|
+
.a63-Switch[data-size='sm'] {
|
|
140
|
+
--switch-thumb: calc(var(--a63-switch-thumb-size) * 0.8);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@media (prefers-reduced-motion: reduce) {
|
|
144
|
+
.a63-Switch,
|
|
145
|
+
.a63-Switch-thumb,
|
|
146
|
+
.a63-Switch-thumb > * {
|
|
147
|
+
transition: none;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Table recipe — the tabular-data set. Faithful port of prod @atom63/ui Table.
|
|
3
|
+
* The container scrolls horizontally with a thin themed scrollbar; the base
|
|
4
|
+
* table is a full-width, small-text grid with a header underline, hover/selected
|
|
5
|
+
* row surfaces, and muted head text. A `frame` ancestor (data-slot="frame")
|
|
6
|
+
* switches on the bordered-card treatment: separated borders, rounded outer
|
|
7
|
+
* corners, and a hairline body outline.
|
|
8
|
+
*
|
|
9
|
+
* Token notes: prod's app-level --theme-row-hover/selected-background /
|
|
10
|
+
* -foreground vars map to canonical DS semantics — row hover to
|
|
11
|
+
* --a63-surface-control-hover, selected row to the brand accent
|
|
12
|
+
* (--a63-action-primary + -foreground). text-muted-foreground ->
|
|
13
|
+
* --a63-text-secondary, bg-background -> --a63-surface-page, borders ->
|
|
14
|
+
* --a63-border-subtle.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
.a63-Table-container {
|
|
18
|
+
position: relative;
|
|
19
|
+
width: 100%;
|
|
20
|
+
overflow-x: auto;
|
|
21
|
+
scrollbar-width: thin;
|
|
22
|
+
}
|
|
23
|
+
.a63-Table-container::-webkit-scrollbar {
|
|
24
|
+
display: block;
|
|
25
|
+
height: 0.375rem;
|
|
26
|
+
}
|
|
27
|
+
.a63-Table-container::-webkit-scrollbar-track {
|
|
28
|
+
border-radius: 9999px;
|
|
29
|
+
background: var(--a63-surface-muted);
|
|
30
|
+
}
|
|
31
|
+
.a63-Table-container::-webkit-scrollbar-thumb {
|
|
32
|
+
border-radius: 9999px;
|
|
33
|
+
background: color-mix(in oklch, var(--a63-text-secondary) 30%, transparent);
|
|
34
|
+
}
|
|
35
|
+
.a63-Table-container:hover::-webkit-scrollbar-thumb {
|
|
36
|
+
background: color-mix(in oklch, var(--a63-text-secondary) 50%, transparent);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.a63-Table {
|
|
40
|
+
width: 100%;
|
|
41
|
+
caption-side: bottom;
|
|
42
|
+
font-size: var(--a63-control-font-size-sm);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* ── Header ────────────────────────────────────────────────────────────── */
|
|
46
|
+
.a63-Table-header .a63-Table-row {
|
|
47
|
+
border-bottom: 1px solid var(--a63-border-subtle);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* ── Head cells ────────────────────────────────────────────────────────── */
|
|
51
|
+
.a63-Table-head {
|
|
52
|
+
height: 2.5rem;
|
|
53
|
+
padding-inline: 0.625rem;
|
|
54
|
+
text-align: left;
|
|
55
|
+
vertical-align: middle;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
line-height: 1;
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
color: var(--a63-text-secondary);
|
|
60
|
+
}
|
|
61
|
+
.a63-Table-head:has([role='checkbox']) {
|
|
62
|
+
width: 1px;
|
|
63
|
+
padding-inline-end: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ── Body cells ────────────────────────────────────────────────────────── */
|
|
67
|
+
.a63-Table-cell {
|
|
68
|
+
padding: 0.625rem;
|
|
69
|
+
vertical-align: middle;
|
|
70
|
+
line-height: 1;
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
}
|
|
73
|
+
.a63-Table-cell:has([role='checkbox']) {
|
|
74
|
+
padding-inline-end: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.a63-Table-body .a63-Table-row:last-child {
|
|
78
|
+
border-bottom: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* ── Rows ──────────────────────────────────────────────────────────────── */
|
|
82
|
+
.a63-Table-row {
|
|
83
|
+
border-bottom: 1px solid var(--a63-border-subtle);
|
|
84
|
+
transition: background-color var(--a63-control-feedback-duration) var(--a63-control-feedback-ease);
|
|
85
|
+
}
|
|
86
|
+
.a63-Table-row:hover {
|
|
87
|
+
background: var(--a63-surface-control-hover);
|
|
88
|
+
}
|
|
89
|
+
.a63-Table-row[data-state='selected'] {
|
|
90
|
+
background: var(--a63-action-primary);
|
|
91
|
+
color: var(--a63-action-primary-foreground);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* ── Footer ────────────────────────────────────────────────────────────── */
|
|
95
|
+
.a63-Table-footer {
|
|
96
|
+
border-top: 1px solid var(--a63-border-subtle);
|
|
97
|
+
background: color-mix(in oklch, var(--a63-surface-muted) 72%, transparent);
|
|
98
|
+
font-weight: 500;
|
|
99
|
+
}
|
|
100
|
+
.a63-Table-footer .a63-Table-row:last-child {
|
|
101
|
+
border-bottom: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* ── Caption ───────────────────────────────────────────────────────────── */
|
|
105
|
+
.a63-Table-caption {
|
|
106
|
+
margin-top: var(--a63-space-4);
|
|
107
|
+
font-size: var(--a63-control-font-size-sm);
|
|
108
|
+
color: var(--a63-text-secondary);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* ── Frame variant (bordered-card treatment) ──────────────────────────────
|
|
112
|
+
Enabled when the table sits inside an element with data-slot="frame". */
|
|
113
|
+
[data-slot='frame'] .a63-Table {
|
|
114
|
+
border-collapse: separate;
|
|
115
|
+
border-spacing: 0;
|
|
116
|
+
}
|
|
117
|
+
[data-slot='frame'] .a63-Table-header .a63-Table-head {
|
|
118
|
+
height: 2.25rem;
|
|
119
|
+
}
|
|
120
|
+
[data-slot='frame'] .a63-Table-header .a63-Table-row {
|
|
121
|
+
border-bottom: 0;
|
|
122
|
+
}
|
|
123
|
+
[data-slot='frame'] .a63-Table-header .a63-Table-row:hover {
|
|
124
|
+
background: transparent;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-slot='frame'] .a63-Table-body {
|
|
128
|
+
position: relative;
|
|
129
|
+
border-radius: calc(var(--radius-2xl) - 0.25rem);
|
|
130
|
+
}
|
|
131
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-row {
|
|
132
|
+
border-bottom: 0;
|
|
133
|
+
}
|
|
134
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-row:hover {
|
|
135
|
+
background: transparent;
|
|
136
|
+
}
|
|
137
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-row[data-state='selected'] {
|
|
138
|
+
background: transparent;
|
|
139
|
+
}
|
|
140
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-cell {
|
|
141
|
+
border-bottom: 1px solid var(--a63-border-subtle);
|
|
142
|
+
background: var(--a63-surface-page);
|
|
143
|
+
background-clip: padding-box;
|
|
144
|
+
}
|
|
145
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-cell:first-child {
|
|
146
|
+
border-inline-start: 1px solid var(--a63-border-subtle);
|
|
147
|
+
}
|
|
148
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-cell:last-child {
|
|
149
|
+
border-inline-end: 1px solid var(--a63-border-subtle);
|
|
150
|
+
}
|
|
151
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-row:first-child .a63-Table-cell {
|
|
152
|
+
border-top: 1px solid var(--a63-border-subtle);
|
|
153
|
+
}
|
|
154
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-row:first-child .a63-Table-cell:first-child {
|
|
155
|
+
border-start-start-radius: calc(var(--radius-2xl) - 0.25rem);
|
|
156
|
+
}
|
|
157
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-row:first-child .a63-Table-cell:last-child {
|
|
158
|
+
border-start-end-radius: calc(var(--radius-2xl) - 0.25rem);
|
|
159
|
+
}
|
|
160
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-row:last-child .a63-Table-cell:first-child {
|
|
161
|
+
border-end-start-radius: calc(var(--radius-2xl) - 0.25rem);
|
|
162
|
+
}
|
|
163
|
+
[data-slot='frame'] .a63-Table-body .a63-Table-row:last-child .a63-Table-cell:last-child {
|
|
164
|
+
border-end-end-radius: calc(var(--radius-2xl) - 0.25rem);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[data-slot='frame'] .a63-Table-footer {
|
|
168
|
+
border-top: 0;
|
|
169
|
+
background: transparent;
|
|
170
|
+
}
|
|
171
|
+
[data-slot='frame'] .a63-Table-footer .a63-Table-row:hover {
|
|
172
|
+
background: transparent;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
[data-slot='frame'] .a63-Table-caption {
|
|
176
|
+
margin-block: var(--a63-space-4);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@media (prefers-reduced-motion: reduce) {
|
|
180
|
+
.a63-Table-row {
|
|
181
|
+
transition: none;
|
|
182
|
+
}
|
|
183
|
+
}
|