@flytedan/flytebot-design-system 0.38.0 → 0.39.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.cjs +3 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +3 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components.css +51 -57
package/package.json
CHANGED
package/styles/components.css
CHANGED
|
@@ -34,23 +34,43 @@
|
|
|
34
34
|
.fd-btn:hover {
|
|
35
35
|
text-decoration: none;
|
|
36
36
|
}
|
|
37
|
+
/* This translateY is the only press feedback any variant gets: while a real mouse holds a
|
|
38
|
+
button down, the pointer is over it, so :hover's own background is already showing —
|
|
39
|
+
restating a different :active-only background/box-shadow per variant is unreachable
|
|
40
|
+
without also losing :hover the moment the button is pressed, and a real browser clears
|
|
41
|
+
:active the instant the pointer leaves the element during a held press (there is no
|
|
42
|
+
sticky/dragged-off :active to distinguish from :hover here), so no per-variant :active
|
|
43
|
+
rule was ever independently observable. */
|
|
37
44
|
.fd-btn:active {
|
|
38
45
|
transform: translateY(1px);
|
|
39
46
|
}
|
|
47
|
+
/* The disabled look lives on the content and fill alone, both via tokens — never `opacity`
|
|
48
|
+
on the whole element, which would also fade the :focus-visible ring drawn as this same
|
|
49
|
+
element's box-shadow (see the ring rule just below). One flat, variant-independent fill
|
|
50
|
+
(--surface-3/--border) and text/icon color (--text-disabled, inherited by the icon font
|
|
51
|
+
and by .fd-spinner's `currentColor` border) replace every variant's own resting look while
|
|
52
|
+
disabled — a disabled button never needs to keep reading as "primary" or "danger". */
|
|
40
53
|
.fd-btn[disabled],
|
|
41
54
|
.fd-btn[aria-disabled="true"] {
|
|
42
|
-
opacity: 0.4;
|
|
43
55
|
cursor: not-allowed;
|
|
56
|
+
background: var(--surface-3);
|
|
57
|
+
border-color: var(--border);
|
|
58
|
+
color: var(--text-disabled);
|
|
44
59
|
box-shadow: none;
|
|
45
60
|
transform: none;
|
|
46
61
|
}
|
|
62
|
+
.fd-btn-link[disabled],
|
|
63
|
+
.fd-btn-link[aria-disabled="true"] {
|
|
64
|
+
background: none;
|
|
65
|
+
border-color: transparent;
|
|
66
|
+
}
|
|
47
67
|
/* A focusableWhenDisabled button (aria-disabled, never native disabled) keeps the same
|
|
48
|
-
:focus-visible ring an enabled button gets — that is the whole
|
|
49
|
-
the tab order. Restated here because the box-shadow:none above is a
|
|
50
|
-
(0,2,0: one class + one attribute) that beats plain button:focus-visible
|
|
51
|
-
foundations.css (0,1,1: one element + one pseudo-class), so without this the ring
|
|
52
|
-
shows on a control Tab can still land on. Native [disabled] is included for symmetry
|
|
53
|
-
a real browser never actually gives a natively disabled control focus at all, so it
|
|
68
|
+
:focus-visible ring an enabled button gets, drawn at full strength — that is the whole
|
|
69
|
+
point of keeping it in the tab order. Restated here because the box-shadow:none above is a
|
|
70
|
+
compound selector (0,2,0: one class + one attribute) that beats plain button:focus-visible
|
|
71
|
+
from foundations.css (0,1,1: one element + one pseudo-class), so without this the ring
|
|
72
|
+
never shows on a control Tab can still land on. Native [disabled] is included for symmetry
|
|
73
|
+
— a real browser never actually gives a natively disabled control focus at all, so it
|
|
54
74
|
never matches there, but nothing here should depend on that platform behaviour to stay
|
|
55
75
|
correct. */
|
|
56
76
|
.fd-btn[disabled]:focus-visible,
|
|
@@ -58,43 +78,28 @@
|
|
|
58
78
|
box-shadow: var(--focus-ring);
|
|
59
79
|
}
|
|
60
80
|
/* A disabled or aria-disabled button never shows a hover or pressed look, in any variant —
|
|
61
|
-
|
|
62
|
-
:active
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
.
|
|
69
|
-
.fd-btn
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
.fd-btn-
|
|
73
|
-
|
|
74
|
-
background: var(--grad-brand-soft);
|
|
75
|
-
}
|
|
76
|
-
.fd-btn-secondary[disabled]:hover,
|
|
77
|
-
.fd-btn-secondary[aria-disabled="true"]:hover,
|
|
78
|
-
.fd-btn-secondary[disabled]:active,
|
|
79
|
-
.fd-btn-secondary[aria-disabled="true"]:active {
|
|
80
|
-
background: var(--surface);
|
|
81
|
+
this compound selector (class + attribute + pseudo-class = 0,3,0) beats every variant's
|
|
82
|
+
own :hover/:active (class + pseudo-class = 0,2,0) regardless of source order, so a real
|
|
83
|
+
mouse hovering or pressing a disabled button sees only its resting disabled look. One rule
|
|
84
|
+
suffices for every variant now that the disabled fill/text no longer vary by variant.
|
|
85
|
+
box-shadow and transform are deliberately NOT restated here: the base [disabled]/
|
|
86
|
+
[aria-disabled] rule above already sets both, and restating box-shadow here would tie this
|
|
87
|
+
rule's specificity with the :focus-visible rule above it, letting a still-:hover'd (mouse
|
|
88
|
+
left in place) focused button lose its ring to source order. */
|
|
89
|
+
.fd-btn[disabled]:hover,
|
|
90
|
+
.fd-btn[aria-disabled="true"]:hover,
|
|
91
|
+
.fd-btn[disabled]:active,
|
|
92
|
+
.fd-btn[aria-disabled="true"]:active {
|
|
93
|
+
background: var(--surface-3);
|
|
81
94
|
border-color: var(--border);
|
|
82
|
-
|
|
83
|
-
.fd-btn-ghost[disabled]:hover,
|
|
84
|
-
.fd-btn-ghost[aria-disabled="true"]:hover,
|
|
85
|
-
.fd-btn-ghost[disabled]:active,
|
|
86
|
-
.fd-btn-ghost[aria-disabled="true"]:active {
|
|
87
|
-
background: transparent;
|
|
88
|
-
color: var(--text-2);
|
|
89
|
-
}
|
|
90
|
-
.fd-btn-danger[disabled]:hover,
|
|
91
|
-
.fd-btn-danger[aria-disabled="true"]:hover,
|
|
92
|
-
.fd-btn-danger[disabled]:active,
|
|
93
|
-
.fd-btn-danger[aria-disabled="true"]:active {
|
|
94
|
-
background: var(--danger-solid);
|
|
95
|
+
color: var(--text-disabled);
|
|
95
96
|
}
|
|
96
97
|
.fd-btn-link[disabled]:hover,
|
|
97
|
-
.fd-btn-link[aria-disabled="true"]:hover
|
|
98
|
+
.fd-btn-link[aria-disabled="true"]:hover,
|
|
99
|
+
.fd-btn-link[disabled]:active,
|
|
100
|
+
.fd-btn-link[aria-disabled="true"]:active {
|
|
101
|
+
background: none;
|
|
102
|
+
border-color: transparent;
|
|
98
103
|
text-decoration: none;
|
|
99
104
|
}
|
|
100
105
|
.fd-btn-sm {
|
|
@@ -120,10 +125,6 @@
|
|
|
120
125
|
.fd-btn-primary:hover {
|
|
121
126
|
background: var(--grad-primary-hover);
|
|
122
127
|
}
|
|
123
|
-
.fd-btn-primary:active {
|
|
124
|
-
background: var(--blue-800);
|
|
125
|
-
box-shadow: none;
|
|
126
|
-
}
|
|
127
128
|
.fd-btn-brandsoft {
|
|
128
129
|
background: var(--grad-brand-soft);
|
|
129
130
|
color: #fff;
|
|
@@ -144,10 +145,6 @@
|
|
|
144
145
|
background: var(--surface-2);
|
|
145
146
|
border-color: var(--border-strong);
|
|
146
147
|
}
|
|
147
|
-
.fd-btn-secondary:active {
|
|
148
|
-
background: var(--surface-3);
|
|
149
|
-
box-shadow: none;
|
|
150
|
-
}
|
|
151
148
|
.fd-btn-ghost {
|
|
152
149
|
background: transparent;
|
|
153
150
|
color: var(--text-2);
|
|
@@ -156,9 +153,6 @@
|
|
|
156
153
|
background: var(--surface-3);
|
|
157
154
|
color: var(--text);
|
|
158
155
|
}
|
|
159
|
-
.fd-btn-ghost:active {
|
|
160
|
-
background: var(--border);
|
|
161
|
-
}
|
|
162
156
|
.fd-btn-danger {
|
|
163
157
|
background: var(--danger-solid);
|
|
164
158
|
color: #fff;
|
|
@@ -167,10 +161,6 @@
|
|
|
167
161
|
.fd-btn-danger:hover {
|
|
168
162
|
background: #b93a31;
|
|
169
163
|
}
|
|
170
|
-
.fd-btn-danger:active {
|
|
171
|
-
background: #9e2f27;
|
|
172
|
-
box-shadow: none;
|
|
173
|
-
}
|
|
174
164
|
.fd-btn-link {
|
|
175
165
|
background: none;
|
|
176
166
|
color: var(--link);
|
|
@@ -193,7 +183,11 @@
|
|
|
193
183
|
font-size: 12px;
|
|
194
184
|
transition: transform var(--dur-base) var(--ease-out);
|
|
195
185
|
}
|
|
196
|
-
|
|
186
|
+
/* Excludes [disabled]/[aria-disabled="true"] so a disabled arrow button never nudges on
|
|
187
|
+
hover — the disabled selector's own :hover rule above sets no transform, but this rule
|
|
188
|
+
targets a *descendant* (.fd-btn-arrow), which that selector's specificity can't reach, so
|
|
189
|
+
it needs its own explicit exclusion. */
|
|
190
|
+
.fd-btn:hover:not([disabled]):not([aria-disabled="true"]) .fd-btn-arrow {
|
|
197
191
|
transform: translateX(2px);
|
|
198
192
|
}
|
|
199
193
|
.fd-btn-loading {
|