ionbase-ui 0.3.0 → 0.4.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.
@@ -89,10 +89,34 @@
89
89
  border-style: solid;
90
90
  border-width: var(--border-width-default);
91
91
  border-radius: var(--radius-md);
92
+
93
+ /*
94
+ * `base` + `ease-out`, from the shared motion ladder in motion.css.
95
+ *
96
+ * This was `150ms cubic-bezier(0.4, 0, 0.2, 1)`, hardcoded here and in eleven
97
+ * other stylesheets. Both halves were wrong for a state change: 150ms is
98
+ * short enough to read as a jump rather than a change, and that curve is
99
+ * symmetric — its slow tail means a colour appears to arrive late and then
100
+ * snap. `ease-out` leaves immediately and decelerates in, so the same change
101
+ * reads as settling.
102
+ */
92
103
  transition:
93
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
94
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
95
- box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
104
+ background-color var(--ion-duration-base) var(--ion-ease-out),
105
+ border-color var(--ion-duration-base) var(--ion-ease-out),
106
+ box-shadow var(--ion-duration-base) var(--ion-ease-out);
107
+ }
108
+
109
+ /*
110
+ * Press drops to `fast`.
111
+ *
112
+ * A press must resolve while the pointer is still down or the feedback reads as
113
+ * lag rather than as a press — it is the one interaction the user is actively
114
+ * waiting on. Release still returns at `base`, because the rule only overrides
115
+ * the duration while the pressed state holds.
116
+ */
117
+ .ion-button:active,
118
+ .ion-button[data-pressed='true'] {
119
+ transition-duration: var(--ion-duration-fast);
96
120
  }
97
121
 
98
122
  /* Size modifiers — radius, border-width and font-weight are size-invariant. */
@@ -204,12 +228,12 @@
204
228
 
205
229
  @media (hover: hover) {
206
230
  .ion-button--primary-neutral:hover {
207
- background-color: var(--surface-inverse);
231
+ background-color: var(--surface-inverse-subtle);
208
232
  }
209
233
  }
210
234
 
211
235
  .ion-button--primary-neutral[data-hovered='true'] {
212
- background-color: var(--surface-inverse);
236
+ background-color: var(--surface-inverse-subtle);
213
237
  }
214
238
 
215
239
  .ion-button--primary-neutral:active,
@@ -229,16 +253,20 @@
229
253
  border-color: var(--border-strong);
230
254
  }
231
255
 
256
+ /*
257
+ * The border does NOT move on hover — Figma binds `border/strong` on Default,
258
+ * Hover and Focus alike, and only steps to `border/stronger` on Pressed. The
259
+ * hover step was previously reproduced here and is a difference the current
260
+ * design does not draw.
261
+ */
232
262
  @media (hover: hover) {
233
263
  .ion-button--secondary:hover {
234
264
  background-color: var(--surface-page);
235
- border-color: var(--border-stronger);
236
265
  }
237
266
  }
238
267
 
239
268
  .ion-button--secondary[data-hovered='true'] {
240
269
  background-color: var(--surface-page);
241
- border-color: var(--border-stronger);
242
270
  }
243
271
 
244
272
  .ion-button--secondary:active,
@@ -246,6 +274,7 @@
246
274
  --ion-button-elevation: var(--ion-button-pressed);
247
275
 
248
276
  background-color: var(--surface-muted);
277
+ border-color: var(--border-stronger);
249
278
  }
250
279
 
251
280
  /* Tertiary Variant — intentionally flat; a ghost button has no surface to raise. */
@@ -124,8 +124,8 @@
124
124
  (var(--ion-checkbox-line-height) - var(--ion-checkbox-size)) / 2
125
125
  );
126
126
  transition:
127
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
128
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
127
+ background-color var(--ion-duration-base) var(--ion-ease-out),
128
+ border-color var(--ion-duration-base) var(--ion-ease-out);
129
129
  }
130
130
 
131
131
  .ion-checkbox__mark {
@@ -63,8 +63,8 @@
63
63
  font-size: var(--ion-input-font-size);
64
64
  line-height: var(--ion-input-line-height);
65
65
  transition:
66
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
67
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
66
+ border-color var(--ion-duration-base) var(--ion-ease-out),
67
+ background-color var(--ion-duration-base) var(--ion-ease-out);
68
68
  }
69
69
 
70
70
  /*
@@ -54,7 +54,7 @@
54
54
  width: 100%;
55
55
  cursor: pointer;
56
56
  user-select: none;
57
- transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
57
+ transition: background-color var(--ion-duration-base) var(--ion-ease-out);
58
58
  }
59
59
 
60
60
  .ion-menu__icon,
@@ -37,7 +37,7 @@
37
37
  text-decoration: none;
38
38
  cursor: pointer;
39
39
  user-select: none;
40
- transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
40
+ transition: color var(--ion-duration-base) var(--ion-ease-out);
41
41
  }
42
42
 
43
43
  .ion-nav-item__icon,
@@ -47,7 +47,7 @@
47
47
  justify-content: center;
48
48
  flex-shrink: 0;
49
49
  color: var(--icon-tertiary);
50
- transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
50
+ transition: color var(--ion-duration-base) var(--ion-ease-out);
51
51
  }
52
52
 
53
53
  .ion-nav-item__icon svg,
@@ -96,8 +96,8 @@
96
96
  /* Centred on the label's first line — see checkbox.css. */
97
97
  margin-top: calc((var(--ion-radio-line-height) - var(--ion-radio-size)) / 2);
98
98
  transition:
99
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
100
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
99
+ background-color var(--ion-duration-base) var(--ion-ease-out),
100
+ border-color var(--ion-duration-base) var(--ion-ease-out);
101
101
  }
102
102
 
103
103
  .ion-radio__dot {
@@ -29,8 +29,10 @@
29
29
  *
30
30
  * REVEAL TRANSITION IS DELIBERATELY PLAIN
31
31
  *
32
- * Opacity and an 8px slide, the same 150ms/cubic-bezier(0.4,0,0.2,1) language
33
- * every hover state in the system already uses. The deeper choreography this
32
+ * Opacity and an 8px slide on the shared motion ladder — `--ion-duration-base`
33
+ * and `--ion-ease-out`, the same language every hover state in the system
34
+ * already uses. It reads as a reveal rather than travel, so it stays on `base`
35
+ * rather than taking the `slow` rung. The deeper choreography this
34
36
  * component could eventually justify — a staggered reveal per row, easing
35
37
  * that matches the rail's own scale — is future work, tracked in
36
38
  * docs/motion-system.md, not invented here ahead of that decision.
@@ -62,7 +64,7 @@
62
64
  font-family: var(--font-family-sans);
63
65
  font-size: var(--type-body-sm);
64
66
  line-height: var(--type-body-sm-line-height);
65
- transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
67
+ transition: color var(--ion-duration-base) var(--ion-ease-out);
66
68
  }
67
69
 
68
70
  .ion-scroll-progress__rail {
@@ -76,7 +78,7 @@
76
78
  width: var(--spacing-32);
77
79
  height: var(--border-width-thick);
78
80
  background-color: var(--border-strong);
79
- transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
81
+ transition: background-color var(--ion-duration-base) var(--ion-ease-out);
80
82
  }
81
83
 
82
84
  .ion-scroll-progress__tick--active {
@@ -118,9 +120,9 @@
118
120
  pointer-events: none;
119
121
  transform: translateY(-50%) translateX(-4px);
120
122
  transition:
121
- opacity 150ms cubic-bezier(0.4, 0, 0.2, 1),
122
- transform 150ms cubic-bezier(0.4, 0, 0.2, 1),
123
- visibility 150ms;
123
+ opacity var(--ion-duration-base) var(--ion-ease-out),
124
+ transform var(--ion-duration-base) var(--ion-ease-out),
125
+ visibility var(--ion-duration-base);
124
126
  }
125
127
 
126
128
  .ion-scroll-progress__panel[data-open='true'] {
@@ -145,8 +147,8 @@
145
147
  text-align: left;
146
148
  cursor: pointer;
147
149
  transition:
148
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
149
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
150
+ background-color var(--ion-duration-base) var(--ion-ease-out),
151
+ border-color var(--ion-duration-base) var(--ion-ease-out);
150
152
  }
151
153
 
152
154
  @media (hover: hover) {
@@ -47,8 +47,8 @@
47
47
  font-size: var(--ion-select-font-size);
48
48
  line-height: var(--ion-select-line-height);
49
49
  transition:
50
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
51
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
50
+ border-color var(--ion-duration-base) var(--ion-ease-out),
51
+ background-color var(--ion-duration-base) var(--ion-ease-out);
52
52
  }
53
53
 
54
54
  /* Small shares Medium's padding — see input.css. */
@@ -107,7 +107,7 @@
107
107
 
108
108
  .ion-table tr {
109
109
  background-color: var(--surface-default);
110
- transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
110
+ transition: background-color var(--ion-duration-base) var(--ion-ease-out);
111
111
  }
112
112
 
113
113
  .ion-table tbody tr {
@@ -80,9 +80,9 @@
80
80
  cursor: pointer;
81
81
  user-select: none;
82
82
  transition:
83
- color 150ms cubic-bezier(0.4, 0, 0.2, 1),
84
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
85
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
83
+ color var(--ion-duration-base) var(--ion-ease-out),
84
+ background-color var(--ion-duration-base) var(--ion-ease-out),
85
+ border-color var(--ion-duration-base) var(--ion-ease-out);
86
86
  }
87
87
 
88
88
  .ion-tabs__item--sm {
@@ -115,8 +115,8 @@
115
115
  (var(--ion-toggle-line-height) - var(--ion-toggle-track-h)) / 2
116
116
  );
117
117
  transition:
118
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
119
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
118
+ background-color var(--ion-duration-base) var(--ion-ease-out),
119
+ border-color var(--ion-duration-base) var(--ion-ease-out);
120
120
  }
121
121
 
122
122
  .ion-toggle__thumb {
@@ -127,7 +127,14 @@
127
127
 
128
128
  /* Cast, not bevelled — and the same in both states, so it is unconditional. */
129
129
  box-shadow: var(--ion-shadow-shadow-xs);
130
- transition: margin 150ms cubic-bezier(0.4, 0, 0.2, 1);
130
+
131
+ /*
132
+ * `ease-in-out`, not the `ease-out` every colour change uses. The knob is the
133
+ * one thing in the system that travels the same path in both directions, so
134
+ * a symmetric curve is what makes on and off feel like the same gesture
135
+ * reversed. Everything else enters a state and stays there.
136
+ */
137
+ transition: margin var(--ion-duration-base) var(--ion-ease-in-out);
131
138
  }
132
139
 
133
140
  .ion-toggle__label {
@@ -288,7 +288,7 @@
288
288
  --surface-raised: #ffffff;
289
289
  --surface-overlay: #ffffff;
290
290
  --surface-scrim: rgba(0, 0, 0, 0.4);
291
- --surface-inverse: #131923;
291
+ --surface-inverse: #1d2735;
292
292
  --surface-inverse-subtle: #384252;
293
293
  --surface-disabled: #f0f2f4;
294
294
  --surface-placeholder: #dde0e4;
@@ -34,25 +34,25 @@
34
34
  0px 8px 8px -4px rgb(0 0 0 / 4%);
35
35
 
36
36
  --ion-shadow-raised-lifted-xs:
37
- inset 0px -2px 1px 0px rgb(0 0 0 / 40%),
37
+ inset 0px -2px 1px 0px rgb(0 0 0 / 25%),
38
38
  inset 0px 2px 1px 0px rgb(255 255 255 / 20%),
39
39
  0px 1px 1px 0px rgb(7 10 13 / 6%),
40
40
  0px 1px 2px 0px rgb(7 10 13 / 4%);
41
41
 
42
42
  --ion-shadow-raised-lifted-sm:
43
- inset 0px -3px 1px 0px rgb(0 0 0 / 30%),
43
+ inset 0px -3px 1px 0px rgb(0 0 0 / 25%),
44
44
  inset 0px 3px 1px 0px rgb(255 255 255 / 20%),
45
45
  0px 1px 2px 0px rgb(7 10 13 / 8%),
46
46
  0px 2px 4px 0px rgb(7 10 13 / 5%);
47
47
 
48
48
  --ion-shadow-raised-lifted-lg:
49
- inset 0px -4px 2px 0px rgb(0 0 0 / 40%),
49
+ inset 0px -4px 2px 0px rgb(0 0 0 / 25%),
50
50
  inset 0px 4px 2px 0px rgb(255 255 255 / 20%),
51
51
  0px 1px 1px 0px rgb(7 10 13 / 32%),
52
52
  0px 1px 2px 0px rgb(7 10 13 / 16%);
53
53
 
54
54
  --ion-shadow-raised-lifted-xl:
55
- inset 0px -6px 2px 0px rgb(0 0 0 / 35%),
55
+ inset 0px -6px 2px 0px rgb(0 0 0 / 25%),
56
56
  inset 0px 6px 2px 0px rgb(255 255 255 / 20%),
57
57
  0px 1px 2px 0px rgb(7 10 13 / 30%),
58
58
  0px 2px 4px 0px rgb(7 10 13 / 14%);
@@ -74,19 +74,19 @@
74
74
  0px 2px 6px 0px rgb(7 10 13 / 20%);
75
75
 
76
76
  --ion-shadow-raised-flush-xs:
77
- inset 0px -2px 1px 0px rgb(0 0 0 / 40%),
77
+ inset 0px -2px 1px 0px rgb(0 0 0 / 25%),
78
78
  inset 0px 2px 1px 0px rgb(255 255 255 / 20%);
79
79
 
80
80
  --ion-shadow-raised-flush-sm:
81
- inset 0px -3px 1px 0px rgb(0 0 0 / 30%),
81
+ inset 0px -3px 1px 0px rgb(0 0 0 / 25%),
82
82
  inset 0px 3px 1px 0px rgb(255 255 255 / 20%);
83
83
 
84
84
  --ion-shadow-raised-flush-lg:
85
- inset 0px -4px 2px 0px rgb(0 0 0 / 40%),
85
+ inset 0px -4px 2px 0px rgb(0 0 0 / 25%),
86
86
  inset 0px 4px 2px 0px rgb(255 255 255 / 20%);
87
87
 
88
88
  --ion-shadow-raised-flush-xl:
89
- inset 0px -6px 2px 0px rgb(0 0 0 / 35%),
89
+ inset 0px -6px 2px 0px rgb(0 0 0 / 25%),
90
90
  inset 0px 6px 2px 0px rgb(255 255 255 / 20%);
91
91
 
92
92
  --ion-shadow-inset-lifted-xs:
@@ -4,3 +4,4 @@
4
4
  @import "./breakpoint-mobile.css";
5
5
  @import "./typography.css";
6
6
  @import "./elevation.css";
7
+ @import "./motion.css";
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Generated from motion.json. Do not edit.
3
+ * Regenerate with `pnpm --filter @ionbase-ui/tokens build`.
4
+ *
5
+ * Source: motion.json (repo-owned — NOT a Figma export)
6
+ *
7
+ * These are NOT tokens. Figma expresses motion as prototype reactions rather
8
+ * than variables, so there is nothing for them to alias; the values are
9
+ * committed and generated instead. The `--ion-` prefix marks that, the same
10
+ * way it does for `--ion-shadow-*`.
11
+ *
12
+ * A LADDER, NOT RECIPES. Pick a rung per component. There is deliberately no
13
+ * `--ion-duration-hover`: that is indexed by usage, so it needs a new name
14
+ * per usage pattern.
15
+ *
16
+ * Reduced motion is handled globally in the package's index.css, not here —
17
+ * one block covering every `ion-*` rule, rather than a media query per value.
18
+ */
19
+
20
+ :root {
21
+ /* Press and release. Must resolve before the finger leaves the button, or */
22
+ /* the feedback reads as lag rather than as a press. */
23
+ --ion-duration-fast: 120ms;
24
+
25
+ /* The default for any state colour change — hover, focus, selection, */
26
+ /* validation. Replaces a hardcoded 150ms that read as abrupt. */
27
+ --ion-duration-base: 200ms;
28
+
29
+ /* Anything that travels or changes size: panels, overlays, disclosure. */
30
+ /* Distance needs time; a colour does not. */
31
+ --ion-duration-slow: 320ms;
32
+
33
+ /* The default. Leaves immediately and decelerates into the end state, so */
34
+ /* the change reads as settling. Correct for anything entering a state and */
35
+ /* staying there. */
36
+ --ion-ease-out: cubic-bezier(0.2, 0, 0, 1);
37
+
38
+ /* Accelerates and arrives at full velocity. Only for things leaving — */
39
+ /* dismissing an overlay, collapsing a panel. On a state a user is entering */
40
+ /* it reads as a snap. */
41
+ --ion-ease-in: cubic-bezier(0.4, 0, 1, 1);
42
+
43
+ /* Symmetric, for two-way travel where the same element moves back and */
44
+ /* forth — the Toggle knob. This is the curve every stylesheet used for */
45
+ /* everything, which is why state changes felt jerky. */
46
+ --ion-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
47
+
48
+ /* Continuous progress only, where easing would misreport position. Never */
49
+ /* for interaction. */
50
+ --ion-ease-linear: linear;
51
+ }
@@ -1093,7 +1093,7 @@ export declare const tokenValues: {
1093
1093
  readonly Dark: "{alpha.black-60}";
1094
1094
  };
1095
1095
  readonly "surface/inverse": {
1096
- readonly Light: "{neutral.900}";
1096
+ readonly Light: "{neutral.800}";
1097
1097
  readonly Dark: "{base.white}";
1098
1098
  };
1099
1099
  readonly "surface/inverse-subtle": {
@@ -698,7 +698,7 @@ export const tokenValues = {
698
698
  "Dark": "{alpha.black-60}"
699
699
  },
700
700
  "surface/inverse": {
701
- "Light": "{neutral.900}",
701
+ "Light": "{neutral.800}",
702
702
  "Dark": "{base.white}"
703
703
  },
704
704
  "surface/inverse-subtle": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ionbase-ui",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "IonBase Design System — accessible React components, styles and design tokens in one package",
5
5
  "license": "MIT",
6
6
  "type": "module",