@flytedan/flytebot-design-system 0.37.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flytedan/flytebot-design-system",
3
- "version": "0.37.0",
3
+ "version": "0.39.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",
@@ -43,8 +43,9 @@
43
43
  "dev": "tsup --watch",
44
44
  "typecheck": "tsc --noEmit",
45
45
  "lint": "eslint .",
46
- "test": "vitest run",
46
+ "test": "vitest run --project unit && vitest run --project browser",
47
47
  "test:dist": "tsup && vitest run --config scripts/vitest.dist.config.ts",
48
+ "test:unit": "vitest run --project unit",
48
49
  "test:browser": "vitest run --project browser",
49
50
  "sync-icons": "node scripts/sync-icons.mjs",
50
51
  "docs": "vite --config vite.docs.config.ts",
@@ -34,16 +34,74 @@
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
+ }
67
+ /* A focusableWhenDisabled button (aria-disabled, never native disabled) keeps the same
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
74
+ never matches there, but nothing here should depend on that platform behaviour to stay
75
+ correct. */
76
+ .fd-btn[disabled]:focus-visible,
77
+ .fd-btn[aria-disabled="true"]:focus-visible {
78
+ box-shadow: var(--focus-ring);
79
+ }
80
+ /* A disabled or aria-disabled button never shows a hover or pressed look, in any variant —
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);
94
+ border-color: var(--border);
95
+ color: var(--text-disabled);
96
+ }
97
+ .fd-btn-link[disabled]: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;
103
+ text-decoration: none;
104
+ }
47
105
  .fd-btn-sm {
48
106
  height: var(--control-h-sm);
49
107
  padding: 0 14px;
@@ -67,10 +125,6 @@
67
125
  .fd-btn-primary:hover {
68
126
  background: var(--grad-primary-hover);
69
127
  }
70
- .fd-btn-primary:active {
71
- background: var(--blue-800);
72
- box-shadow: none;
73
- }
74
128
  .fd-btn-brandsoft {
75
129
  background: var(--grad-brand-soft);
76
130
  color: #fff;
@@ -91,10 +145,6 @@
91
145
  background: var(--surface-2);
92
146
  border-color: var(--border-strong);
93
147
  }
94
- .fd-btn-secondary:active {
95
- background: var(--surface-3);
96
- box-shadow: none;
97
- }
98
148
  .fd-btn-ghost {
99
149
  background: transparent;
100
150
  color: var(--text-2);
@@ -103,9 +153,6 @@
103
153
  background: var(--surface-3);
104
154
  color: var(--text);
105
155
  }
106
- .fd-btn-ghost:active {
107
- background: var(--border);
108
- }
109
156
  .fd-btn-danger {
110
157
  background: var(--danger-solid);
111
158
  color: #fff;
@@ -114,10 +161,6 @@
114
161
  .fd-btn-danger:hover {
115
162
  background: #b93a31;
116
163
  }
117
- .fd-btn-danger:active {
118
- background: #9e2f27;
119
- box-shadow: none;
120
- }
121
164
  .fd-btn-link {
122
165
  background: none;
123
166
  color: var(--link);
@@ -140,7 +183,11 @@
140
183
  font-size: 12px;
141
184
  transition: transform var(--dur-base) var(--ease-out);
142
185
  }
143
- .fd-btn:hover .fd-btn-arrow {
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 {
144
191
  transform: translateX(2px);
145
192
  }
146
193
  .fd-btn-loading {