@plexui/react-native 0.2.27 → 0.2.28
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.
|
@@ -81,6 +81,10 @@ function iosPress(theme, variant, colors) {
|
|
|
81
81
|
const pressed = variant === "solid" ? lighten(theme, colors.background) : variant === "ghost" ? colors.background : withAlpha(colors.background, 0.7);
|
|
82
82
|
return { ...colors, pressed, pressedText: lighten(theme, colors.text) };
|
|
83
83
|
}
|
|
84
|
+
/** iOS: a disabled button's label, the tertiary label unless a brand sets its own (`--button-mobile-disabled-color`). */
|
|
85
|
+
function disabledLabel(theme) {
|
|
86
|
+
return theme.color("--button-mobile-disabled-color", theme.colors.labelTertiary);
|
|
87
|
+
}
|
|
84
88
|
export function buttonColors(theme, color, variant, disabled, selected) {
|
|
85
89
|
const c = (name) => theme.color(`--color-${name}`);
|
|
86
90
|
if (disabled) {
|
|
@@ -93,13 +97,13 @@ export function buttonColors(theme, color, variant, disabled, selected) {
|
|
|
93
97
|
const flat = variant === "ghost" || variant === "outline";
|
|
94
98
|
return { background: flat ? "transparent" : veil, pressed: flat ? "transparent" : veil, text: withAlpha(onSurface, 0.38), border: variant === "outline" ? veil : undefined };
|
|
95
99
|
}
|
|
96
|
-
// The phone CSS: the tertiary label in every style (iOS 27's disabled content-area button),
|
|
97
|
-
// button behind a solid or soft one
|
|
100
|
+
// The phone CSS: the tertiary label in every style (iOS 27's disabled content-area button), or a brand's own
|
|
101
|
+
// disabled label (`--button-mobile-disabled-color`); the fill of a gray button behind a solid or soft one
|
|
98
102
|
// An outline button is iOS's Gray (below): disabled, the gray fill as the others
|
|
99
103
|
return {
|
|
100
104
|
background: variant === "ghost" ? "transparent" : theme.color("--button-mobile-disabled-background"),
|
|
101
105
|
pressed: "transparent",
|
|
102
|
-
text: theme
|
|
106
|
+
text: disabledLabel(theme),
|
|
103
107
|
};
|
|
104
108
|
}
|
|
105
109
|
const colors = (() => {
|
|
@@ -170,7 +174,7 @@ function barColors(theme, colors, { bar, prominent, neutral, disabled, selected,
|
|
|
170
174
|
// replace the fill
|
|
171
175
|
if (neutral && !selected && (bar.inGroup || !flat)) {
|
|
172
176
|
const pressed = bar.inGroup ? theme.color("--toolbar-group-item-active") : theme.color("--mobile-glass-background-active");
|
|
173
|
-
return { background: "transparent", pressed, text: disabled ? theme
|
|
177
|
+
return { background: "transparent", pressed, text: disabled ? disabledLabel(theme) : colors.text };
|
|
174
178
|
}
|
|
175
179
|
return colors;
|
|
176
180
|
}
|
|
@@ -294,7 +298,7 @@ function ListActionButton({ place, color = "primary", disabled = false, loading
|
|
|
294
298
|
: // The web's phone rows tint an action with the info text (#0169cc, blue-200 in the dark)
|
|
295
299
|
theme.color("--color-text-info", theme.colors.accent)
|
|
296
300
|
: buttonColors(theme, color, "ghost", false, false).text;
|
|
297
|
-
const ink = disabled ? (android ? withAlpha(base, 0.5) : theme
|
|
301
|
+
const ink = disabled ? (android ? withAlpha(base, 0.5) : disabledLabel(theme)) : !row && pressed && !android ? lighten(theme, base) : base;
|
|
298
302
|
// Android: a row's words 16/20, a header's 15/20 Medium (the web's FieldGroup header action)
|
|
299
303
|
const type = android
|
|
300
304
|
? row
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plexui/react-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.28",
|
|
4
4
|
"description": "Plex UI components for React Native and Expo: iOS 26 and Material 3, on the shared @plexui/styles tokens",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://plexui.com",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"test": "npm run typecheck && npm run lint && npm run test:web --prefix example"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@plexui/styles": "^0.17.
|
|
87
|
+
"@plexui/styles": "^0.17.6",
|
|
88
88
|
"libphonenumber-js": "^1.13.17"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
@@ -211,6 +211,11 @@ function iosPress(theme: Theme, variant: ButtonVariant, colors: Colors): Colors
|
|
|
211
211
|
return { ...colors, pressed, pressedText: lighten(theme, colors.text) }
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
/** iOS: a disabled button's label, the tertiary label unless a brand sets its own (`--button-mobile-disabled-color`). */
|
|
215
|
+
function disabledLabel(theme: Theme) {
|
|
216
|
+
return theme.color("--button-mobile-disabled-color", theme.colors.labelTertiary)
|
|
217
|
+
}
|
|
218
|
+
|
|
214
219
|
export function buttonColors(theme: Theme, color: ButtonColor, variant: ButtonVariant, disabled: boolean, selected: boolean): Colors {
|
|
215
220
|
const c = (name: string) => theme.color(`--color-${name}`)
|
|
216
221
|
if (disabled) {
|
|
@@ -223,13 +228,13 @@ export function buttonColors(theme: Theme, color: ButtonColor, variant: ButtonVa
|
|
|
223
228
|
const flat = variant === "ghost" || variant === "outline"
|
|
224
229
|
return { background: flat ? "transparent" : veil, pressed: flat ? "transparent" : veil, text: withAlpha(onSurface, 0.38), border: variant === "outline" ? veil : undefined }
|
|
225
230
|
}
|
|
226
|
-
// The phone CSS: the tertiary label in every style (iOS 27's disabled content-area button),
|
|
227
|
-
// button behind a solid or soft one
|
|
231
|
+
// The phone CSS: the tertiary label in every style (iOS 27's disabled content-area button), or a brand's own
|
|
232
|
+
// disabled label (`--button-mobile-disabled-color`); the fill of a gray button behind a solid or soft one
|
|
228
233
|
// An outline button is iOS's Gray (below): disabled, the gray fill as the others
|
|
229
234
|
return {
|
|
230
235
|
background: variant === "ghost" ? "transparent" : theme.color("--button-mobile-disabled-background"),
|
|
231
236
|
pressed: "transparent",
|
|
232
|
-
text: theme
|
|
237
|
+
text: disabledLabel(theme),
|
|
233
238
|
}
|
|
234
239
|
}
|
|
235
240
|
const colors = ((): Colors => {
|
|
@@ -303,7 +308,7 @@ function barColors(
|
|
|
303
308
|
// replace the fill
|
|
304
309
|
if (neutral && !selected && (bar.inGroup || !flat)) {
|
|
305
310
|
const pressed = bar.inGroup ? theme.color("--toolbar-group-item-active") : theme.color("--mobile-glass-background-active")
|
|
306
|
-
return { background: "transparent", pressed, text: disabled ? theme
|
|
311
|
+
return { background: "transparent", pressed, text: disabled ? disabledLabel(theme) : colors.text }
|
|
307
312
|
}
|
|
308
313
|
return colors
|
|
309
314
|
}
|
|
@@ -468,7 +473,7 @@ function ListActionButton({
|
|
|
468
473
|
: // The web's phone rows tint an action with the info text (#0169cc, blue-200 in the dark)
|
|
469
474
|
theme.color("--color-text-info", theme.colors.accent)
|
|
470
475
|
: buttonColors(theme, color, "ghost", false, false).text
|
|
471
|
-
const ink = disabled ? (android ? withAlpha(base, 0.5) : theme
|
|
476
|
+
const ink = disabled ? (android ? withAlpha(base, 0.5) : disabledLabel(theme)) : !row && pressed && !android ? lighten(theme, base) : base
|
|
472
477
|
// Android: a row's words 16/20, a header's 15/20 Medium (the web's FieldGroup header action)
|
|
473
478
|
const type = android
|
|
474
479
|
? row
|