@flytedan/flytebot-design-system 0.38.0 → 0.40.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": "@flytedan/flytebot-design-system",
3
- "version": "0.38.0",
3
+ "version": "0.40.0",
4
4
  "description": "flytedesk Design System — shared component library, tokens, and business-logic kits for flytedesk apps.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -34,23 +34,42 @@
34
34
  .fd-btn:hover {
35
35
  text-decoration: none;
36
36
  }
37
+ /* While a real mouse holds a button down, the pointer is over it, so :hover's own rule is
38
+ also matching — but :hover and :active are equal specificity, and each variant's own
39
+ :active rule below is declared after that variant's :hover rule, so the cascade resolves
40
+ to :active's background/box-shadow, not :hover's. That is what gives an enabled button a
41
+ pressed colour genuinely distinct from its hovered one, on top of the translateY here
42
+ shared by every variant. */
37
43
  .fd-btn:active {
38
44
  transform: translateY(1px);
39
45
  }
46
+ /* The disabled look lives on the content and fill alone, both via tokens — never `opacity`
47
+ on the whole element, which would also fade the :focus-visible ring drawn as this same
48
+ element's box-shadow (see the ring rule just below). One flat, variant-independent fill
49
+ (--surface-3/--border) and text/icon color (--text-disabled, inherited by the icon font
50
+ and by .fd-spinner's `currentColor` border) replace every variant's own resting look while
51
+ disabled — a disabled button never needs to keep reading as "primary" or "danger". */
40
52
  .fd-btn[disabled],
41
53
  .fd-btn[aria-disabled="true"] {
42
- opacity: 0.4;
43
54
  cursor: not-allowed;
55
+ background: var(--surface-3);
56
+ border-color: var(--border);
57
+ color: var(--text-disabled);
44
58
  box-shadow: none;
45
59
  transform: none;
46
60
  }
61
+ .fd-btn-link[disabled],
62
+ .fd-btn-link[aria-disabled="true"] {
63
+ background: none;
64
+ border-color: transparent;
65
+ }
47
66
  /* A focusableWhenDisabled button (aria-disabled, never native disabled) keeps the same
48
- :focus-visible ring an enabled button gets — that is the whole point of keeping it in
49
- the tab order. Restated here because the box-shadow:none above is a compound selector
50
- (0,2,0: one class + one attribute) that beats plain button:focus-visible from
51
- foundations.css (0,1,1: one element + one pseudo-class), so without this the ring never
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
67
+ :focus-visible ring an enabled button gets, drawn at full strength — that is the whole
68
+ point of keeping it in the tab order. Restated here because the box-shadow:none above is a
69
+ compound selector (0,2,0: one class + one attribute) that beats plain button:focus-visible
70
+ from foundations.css (0,1,1: one element + one pseudo-class), so without this the ring
71
+ never shows on a control Tab can still land on. Native [disabled] is included for symmetry
72
+ — a real browser never actually gives a natively disabled control focus at all, so it
54
73
  never matches there, but nothing here should depend on that platform behaviour to stay
55
74
  correct. */
56
75
  .fd-btn[disabled]:focus-visible,
@@ -58,43 +77,28 @@
58
77
  box-shadow: var(--focus-ring);
59
78
  }
60
79
  /* A disabled or aria-disabled button never shows a hover or pressed look, in any variant —
61
- each compound selector below (variant class + [disabled]/[aria-disabled] + :hover/
62
- :active) is specificity 0,3,0, which beats that variant's own :hover/:active (0,2,0)
63
- regardless of source order, so a real mouse hovering or pressing a disabled button sees
64
- only its resting look. Every value restated here is the same token the variant's own
65
- resting rule already uses above — nothing new, just re-declared at higher specificity. */
66
- .fd-btn-primary[disabled]:hover,
67
- .fd-btn-primary[aria-disabled="true"]:hover,
68
- .fd-btn-primary[disabled]:active,
69
- .fd-btn-primary[aria-disabled="true"]:active {
70
- background: var(--grad-primary);
71
- }
72
- .fd-btn-brandsoft[disabled]:hover,
73
- .fd-btn-brandsoft[aria-disabled="true"]:hover {
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);
80
+ this compound selector (class + attribute + pseudo-class = 0,3,0) beats every variant's
81
+ own :hover/:active (class + pseudo-class = 0,2,0) regardless of source order, so a real
82
+ mouse hovering or pressing a disabled button sees only its resting disabled look. One rule
83
+ suffices for every variant now that the disabled fill/text no longer vary by variant.
84
+ box-shadow and transform are deliberately NOT restated here: the base [disabled]/
85
+ [aria-disabled] rule above already sets both, and restating box-shadow here would tie this
86
+ rule's specificity with the :focus-visible rule above it, letting a still-:hover'd (mouse
87
+ left in place) focused button lose its ring to source order. */
88
+ .fd-btn[disabled]:hover,
89
+ .fd-btn[aria-disabled="true"]:hover,
90
+ .fd-btn[disabled]:active,
91
+ .fd-btn[aria-disabled="true"]:active {
92
+ background: var(--surface-3);
81
93
  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);
94
+ color: var(--text-disabled);
95
95
  }
96
96
  .fd-btn-link[disabled]:hover,
97
- .fd-btn-link[aria-disabled="true"]:hover {
97
+ .fd-btn-link[aria-disabled="true"]:hover,
98
+ .fd-btn-link[disabled]:active,
99
+ .fd-btn-link[aria-disabled="true"]:active {
100
+ background: none;
101
+ border-color: transparent;
98
102
  text-decoration: none;
99
103
  }
100
104
  .fd-btn-sm {
@@ -168,7 +172,7 @@
168
172
  background: #b93a31;
169
173
  }
170
174
  .fd-btn-danger:active {
171
- background: #9e2f27;
175
+ background: var(--btn-solid-danger-bg-active);
172
176
  box-shadow: none;
173
177
  }
174
178
  .fd-btn-link {
@@ -193,7 +197,11 @@
193
197
  font-size: 12px;
194
198
  transition: transform var(--dur-base) var(--ease-out);
195
199
  }
196
- .fd-btn:hover .fd-btn-arrow {
200
+ /* Excludes [disabled]/[aria-disabled="true"] so a disabled arrow button never nudges on
201
+ hover — the disabled selector's own :hover rule above sets no transform, but this rule
202
+ targets a *descendant* (.fd-btn-arrow), which that selector's specificity can't reach, so
203
+ it needs its own explicit exclusion. */
204
+ .fd-btn:hover:not([disabled]):not([aria-disabled="true"]) .fd-btn-arrow {
197
205
  transform: translateX(2px);
198
206
  }
199
207
  .fd-btn-loading {