@xaui/native 0.9.1-alpha.12 → 0.9.1-alpha.14

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.
@@ -36,11 +36,11 @@ function _optionalChain(ops) {
36
36
  }
37
37
  return value;
38
38
  }
39
- var _chunkGZIOB63Ocjs = require('./chunk-GZIOB63O.cjs');
40
- var _chunkFDUI4IAMcjs = require('./chunk-FDUI4IAM.cjs');
39
+ var _chunkGRXC6J5Mcjs = require('./chunk-GRXC6J5M.cjs');
40
+ var _chunk6N5JXRUZcjs = require('./chunk-6N5JXRUZ.cjs');
41
41
 
42
42
  // src/components/button/button.context.ts
43
- var [ButtonProvider, useButton] = _chunkGZIOB63Ocjs.createSlotContext.call(void 0, "Button");
43
+ var [ButtonProvider, useButton] = _chunkGRXC6J5Mcjs.createSlotContext.call(void 0, "Button");
44
44
 
45
45
  // src/components/button/button-icon.tsx
46
46
  var _jsxruntime = require('react/jsx-runtime');
@@ -52,7 +52,7 @@ function ButtonIcon({
52
52
  const {
53
53
  icon
54
54
  } = useButton();
55
- return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkGZIOB63Ocjs.Icon, {
55
+ return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkGRXC6J5Mcjs.Icon, {
56
56
  size: _nullishCoalesce(size, () => icon.size),
57
57
  color: _nullishCoalesce(color, () => icon.color),
58
58
  ...rest
@@ -72,7 +72,7 @@ var ButtonLabel = _react.forwardRef.call(void 0, function ButtonLabel2({
72
72
  const {
73
73
  labelStyle
74
74
  } = useButton();
75
- const [styleProps, rest] = _chunkGZIOB63Ocjs.useStyleProps.call(void 0, props);
75
+ const [styleProps, rest] = _chunkGRXC6J5Mcjs.useStyleProps.call(void 0, props);
76
76
  return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Text, {
77
77
  ref,
78
78
  numberOfLines,
@@ -96,7 +96,7 @@ function ButtonSpinner({
96
96
  const {
97
97
  spinnerStyle
98
98
  } = useButton();
99
- const [styleProps] = _chunkGZIOB63Ocjs.useStyleProps.call(void 0, props);
99
+ const [styleProps] = _chunkGRXC6J5Mcjs.useStyleProps.call(void 0, props);
100
100
  const ringStyle = [spinnerStyle, styleProps, style];
101
101
  if (!animation) return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
102
102
  style: ringStyle
@@ -106,10 +106,10 @@ function ButtonSpinner({
106
106
  });
107
107
  }
108
108
  ButtonSpinner.displayName = "XAUI.Button.Spinner";
109
- const _worklet_5280721983457_init_data = {
110
- code: "function chunkCTULMYVICjs1(){const{angle}=this.__closure;return{transform:[{rotate:angle.value+\"deg\"}]};}",
111
- location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-CTULMYVI.cjs",
112
- sourceMap: "{\"version\":3,\"names\":[\"chunkCTULMYVICjs1\",\"angle\",\"__closure\",\"transform\",\"rotate\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-CTULMYVI.cjs\"],\"mappings\":\"AA0E6E,SAAAA,iBAAMA,CAAA,QAAAC,KAAA,OAAAC,SAAA,CAE/E,MAAO,CAAEC,SAAS,CAAE,CAAC,CAAEC,MAAM,CAAKH,KAAK,CAACI,KAAK,MAAM,CAAC,CAAE,CAAC,CACzD\",\"ignoreList\":[]}"
109
+ const _worklet_6282049362596_init_data = {
110
+ code: "function chunkMMSNVFXUCjs1(){const{angle}=this.__closure;return{transform:[{rotate:angle.value+\"deg\"}]};}",
111
+ location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-MMSNVFXU.cjs",
112
+ sourceMap: "{\"version\":3,\"names\":[\"chunkMMSNVFXUCjs1\",\"angle\",\"__closure\",\"transform\",\"rotate\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-MMSNVFXU.cjs\"],\"mappings\":\"AA0E6E,SAAAA,iBAAMA,CAAA,QAAAC,KAAA,OAAAC,SAAA,CAE/E,MAAO,CAAEC,SAAS,CAAE,CAAC,CAAEC,MAAM,CAAKH,KAAK,CAACI,KAAK,MAAM,CAAC,CAAE,CAAC,CACzD\",\"ignoreList\":[]}"
113
113
  };
114
114
  function SpinningRing({
115
115
  style
@@ -122,28 +122,28 @@ function SpinningRing({
122
122
  }), -1, false);
123
123
  return () => _reactnativereanimated.cancelAnimation.call(void 0, angle);
124
124
  }, [angle]);
125
- const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkCTULMYVICjs1Factory({
126
- _worklet_5280721983457_init_data,
125
+ const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkMMSNVFXUCjs1Factory({
126
+ _worklet_6282049362596_init_data,
127
127
  angle
128
128
  }) {
129
129
  const _e = [new global.Error(), -2, -27];
130
- const chunkCTULMYVICjs1 = function () {
130
+ const chunkMMSNVFXUCjs1 = function () {
131
131
  return {
132
132
  transform: [{
133
133
  rotate: `${angle.value}deg`
134
134
  }]
135
135
  };
136
136
  };
137
- chunkCTULMYVICjs1.__closure = {
137
+ chunkMMSNVFXUCjs1.__closure = {
138
138
  angle
139
139
  };
140
- chunkCTULMYVICjs1.__workletHash = 5280721983457;
141
- chunkCTULMYVICjs1.__pluginVersion = "0.7.4";
142
- chunkCTULMYVICjs1.__initData = _worklet_5280721983457_init_data;
143
- chunkCTULMYVICjs1.__stackDetails = _e;
144
- return chunkCTULMYVICjs1;
140
+ chunkMMSNVFXUCjs1.__workletHash = 6282049362596;
141
+ chunkMMSNVFXUCjs1.__pluginVersion = "0.7.4";
142
+ chunkMMSNVFXUCjs1.__initData = _worklet_6282049362596_init_data;
143
+ chunkMMSNVFXUCjs1.__stackDetails = _e;
144
+ return chunkMMSNVFXUCjs1;
145
145
  }({
146
- _worklet_5280721983457_init_data,
146
+ _worklet_6282049362596_init_data,
147
147
  angle
148
148
  }), [angle]);
149
149
  return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
@@ -188,7 +188,14 @@ var VARIANT_TOKENS = {
188
188
  bgPressed: "accentPressed",
189
189
  fg: "accentForeground"
190
190
  },
191
+ // The accent's soft slice, not a second neutral: `secondary` is to `primary` what
192
+ // `danger-soft` is to `danger`, and it reads as the same family at lower emphasis.
191
193
  secondary: {
194
+ bg: "accentSoft",
195
+ bgPressed: "accentSoftPressed",
196
+ fg: "accentSoftForeground"
197
+ },
198
+ default: {
192
199
  bg: "default",
193
200
  bgPressed: "defaultPressed",
194
201
  fg: "defaultForeground"
@@ -202,26 +209,6 @@ var VARIANT_TOKENS = {
202
209
  bgPressed: "defaultSoftPressed",
203
210
  fg: "foreground"
204
211
  },
205
- success: {
206
- bg: "success",
207
- bgPressed: "successPressed",
208
- fg: "successForeground"
209
- },
210
- "success-soft": {
211
- bg: "successSoft",
212
- bgPressed: "successSoftPressed",
213
- fg: "successSoftForeground"
214
- },
215
- warning: {
216
- bg: "warning",
217
- bgPressed: "warningPressed",
218
- fg: "warningForeground"
219
- },
220
- "warning-soft": {
221
- bg: "warningSoft",
222
- bgPressed: "warningSoftPressed",
223
- fg: "warningSoftForeground"
224
- },
225
212
  danger: {
226
213
  bg: "danger",
227
214
  bgPressed: "dangerPressed",
@@ -267,7 +254,7 @@ function sizeAxis(step) {
267
254
  spinner: ring(theme, theme.fontSizes[glyph])
268
255
  });
269
256
  }
270
- var buttonRecipe = _chunkGZIOB63Ocjs.createRecipe.call(void 0, {
257
+ var buttonRecipe = _chunkGRXC6J5Mcjs.createRecipe.call(void 0, {
271
258
  slots: SLOTS,
272
259
  base: theme => ({
273
260
  root: {
@@ -455,8 +442,8 @@ var ButtonRoot = _react.forwardRef.call(void 0, function Button({
455
442
  onPressOut,
456
443
  ...props
457
444
  }, ref) {
458
- const theme = _chunkFDUI4IAMcjs.useXAUITheme.call(void 0);
459
- const [styleProps, rest] = _chunkGZIOB63Ocjs.useStyleProps.call(void 0, props);
445
+ const theme = _chunk6N5JXRUZcjs.useXAUITheme.call(void 0);
446
+ const [styleProps, rest] = _chunkGRXC6J5Mcjs.useStyleProps.call(void 0, props);
460
447
  const [isPressed, press] = usePressState({
461
448
  onPressIn,
462
449
  onPressOut
@@ -500,14 +487,14 @@ var ButtonRoot = _react.forwardRef.call(void 0, function Button({
500
487
  const rootStyle = [styles.root, _optionalChain([tint, 'optionalAccess', _8 => _8.root]), styleProps, typeof style === "function" ? style({
501
488
  pressed: isPressed
502
489
  }) : style];
503
- const text = _chunkGZIOB63Ocjs.childrenToString.call(void 0, children);
490
+ const text = _chunkGRXC6J5Mcjs.childrenToString.call(void 0, children);
504
491
  const showSpinner = isLoading && !containsElementOfType(children, ButtonSpinner);
505
492
  if (isIconOnly && !rest.accessibilityLabel && !rest["aria-label"]) {
506
493
  warnDev("Button: an icon-only button needs an `accessibilityLabel` \u2014 there is no text for a screen reader to read, so it announces as an unlabelled button.");
507
494
  }
508
495
  return /* @__PURE__ */_jsxruntime.jsx.call(void 0, ButtonProvider, {
509
496
  value: context,
510
- children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkGZIOB63Ocjs.PressableFeedback, {
497
+ children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkGRXC6J5Mcjs.PressableFeedback, {
511
498
  ref,
512
499
  isPressed,
513
500
  isDisabled: isDisabled || isLoading,
@@ -107,7 +107,10 @@ function deriveTint(tint, theme) {
107
107
  foreground,
108
108
  soft: alpha(tint, 0.15),
109
109
  softForeground: mix(tint, theme.colors.foreground, 0.2),
110
- pressed: mix(tint, foreground, 0.1),
110
+ // Towards the mode's ink, not the tint's own foreground — the same single direction
111
+ // the token layer takes (P2-API-REVIEW §E). A raw tint has to behave like `accent`
112
+ // under the finger as much as it does at rest.
113
+ pressed: mix(tint, theme.colors.foreground, 0.1),
111
114
  softPressed: alpha(tint, 0.2)
112
115
  };
113
116
  cache.set(key, derived);
@@ -2,11 +2,11 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkCTULMYVIcjs = require('../../chunk-CTULMYVI.cjs');
6
- require('../../chunk-GZIOB63O.cjs');
7
- require('../../chunk-FDUI4IAM.cjs');
5
+ var _chunkMMSNVFXUcjs = require('../../chunk-MMSNVFXU.cjs');
6
+ require('../../chunk-GRXC6J5M.cjs');
7
+ require('../../chunk-6N5JXRUZ.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
- exports.Button = _chunkCTULMYVIcjs.Button; exports.buttonRecipe = _chunkCTULMYVIcjs.buttonRecipe; exports.useButton = _chunkCTULMYVIcjs.useButton;
12
+ exports.Button = _chunkMMSNVFXUcjs.Button; exports.buttonRecipe = _chunkMMSNVFXUcjs.buttonRecipe; exports.useButton = _chunkMMSNVFXUcjs.useButton;