@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.40
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/dist/chunk-2EGR4LWD.js +145 -0
- package/dist/chunk-2NRZKJG7.js +531 -0
- package/dist/chunk-2PMXMKS5.js +67 -0
- package/dist/chunk-2XPG2243.js +586 -0
- package/dist/chunk-36PRYGAM.js +13 -0
- package/dist/chunk-3E7CDKFO.cjs +696 -0
- package/dist/chunk-3GFRSZYR.js +54 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-4CUZZWFW.js +92 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4KFKWBN5.cjs +89 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5R26NM4M.cjs +402 -0
- package/dist/chunk-5VKYNBNA.js +607 -0
- package/dist/chunk-64MXEVT3.js +66 -0
- package/dist/chunk-6DOLGZVV.cjs +147 -0
- package/dist/chunk-6L2TS2R3.cjs +92 -0
- package/dist/chunk-6UEZJRVI.js +669 -0
- package/dist/chunk-734MFAX4.js +27 -0
- package/dist/chunk-73RKQC5X.js +104 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7GHM4GKL.cjs +119 -0
- package/dist/chunk-7YF5NAHQ.cjs +74 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-ABAGZTXZ.cjs +736 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-ACAPTWE3.cjs} +85 -81
- package/dist/chunk-AMCSSOJT.cjs +104 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BRRXFOBY.js +431 -0
- package/dist/chunk-C5YLPCFC.cjs +293 -0
- package/dist/chunk-DA3OKXHV.cjs +700 -0
- package/dist/chunk-DD4276RF.js +366 -0
- package/dist/chunk-DG2I4PJG.js +701 -0
- package/dist/chunk-DHGLGSH6.js +661 -0
- package/dist/chunk-DIBUQ46Y.js +346 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-EKS3W46M.cjs +66 -0
- package/dist/chunk-EZEYMLO3.js +402 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FHUYHV6J.js +89 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G7P3ERYF.cjs +478 -0
- package/dist/chunk-GA6PBWNT.js +147 -0
- package/dist/chunk-GFUZ3MUT.cjs +455 -0
- package/dist/chunk-GGW43Q37.cjs +1 -0
- package/dist/chunk-GTR5X65M.cjs +27 -0
- package/dist/chunk-H4E4HDEP.cjs +13 -0
- package/dist/chunk-H7DS4IO7.js +198 -0
- package/dist/chunk-HDVVZG4S.cjs +198 -0
- package/dist/chunk-IKJVLJKT.js +151 -0
- package/dist/chunk-J3MB4PI5.cjs +531 -0
- package/dist/chunk-K72UDPVN.js +119 -0
- package/dist/chunk-KCMYU7WF.js +86 -0
- package/dist/chunk-LRN3RNDO.js +940 -0
- package/dist/chunk-LTX6TB5I.js +124 -0
- package/dist/chunk-LUPCPLND.cjs +145 -0
- package/dist/chunk-M63GFNKV.js +194 -0
- package/dist/chunk-N3KTZMPG.js +293 -0
- package/dist/chunk-NCTOTTVW.js +13 -0
- package/dist/chunk-NWGLP6JX.cjs +410 -0
- package/dist/chunk-R73XQK7X.cjs +314 -0
- package/dist/chunk-RU7JCMWC.cjs +881 -0
- package/dist/chunk-SNIHUKDA.cjs +184 -0
- package/dist/chunk-T5FV5F7A.cjs +607 -0
- package/dist/chunk-TDTUAIFF.cjs +153 -0
- package/dist/chunk-TJ74XVZN.cjs +431 -0
- package/dist/chunk-TK44VBIE.cjs +194 -0
- package/dist/chunk-UAWBAD4E.cjs +346 -0
- package/dist/chunk-UFTCTTKK.js +381 -0
- package/dist/chunk-WDDXU3OH.cjs +67 -0
- package/dist/chunk-WFEMJCXO.cjs +13 -0
- package/dist/chunk-WHJTBTYM.js +0 -0
- package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
- package/dist/chunk-XFPQFCEK.js +455 -0
- package/dist/chunk-XSQPVDFH.cjs +60 -0
- package/dist/chunk-XTC2SLFT.js +153 -0
- package/dist/chunk-XV735BSA.cjs +366 -0
- package/dist/chunk-XWNG2U4K.cjs +124 -0
- package/dist/chunk-YGYYJ3LQ.js +314 -0
- package/dist/chunk-YVHT2UVW.js +74 -0
- package/dist/chunk-ZFOOJK37.cjs +86 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
- package/dist/components/accordion/index.cjs +35 -0
- package/dist/components/accordion/index.d.cts +299 -0
- package/dist/components/accordion/index.d.ts +299 -0
- package/dist/components/accordion/index.js +35 -0
- package/dist/components/alert/index.cjs +20 -0
- package/dist/components/alert/index.d.cts +169 -0
- package/dist/components/alert/index.d.ts +169 -0
- package/dist/components/alert/index.js +20 -0
- package/dist/components/avatar/index.cjs +16 -0
- package/dist/components/avatar/index.d.cts +131 -0
- package/dist/components/avatar/index.d.ts +131 -0
- package/dist/components/avatar/index.js +16 -0
- package/dist/components/badge/index.cjs +15 -0
- package/dist/components/badge/index.d.cts +157 -0
- package/dist/components/badge/index.d.ts +157 -0
- package/dist/components/badge/index.js +15 -0
- package/dist/components/button/index.cjs +22 -0
- package/dist/components/button/index.d.cts +613 -0
- package/dist/components/button/index.d.ts +613 -0
- package/dist/components/button/index.js +22 -0
- package/dist/components/card/index.cjs +22 -0
- package/dist/components/card/index.d.cts +620 -0
- package/dist/components/card/index.d.ts +620 -0
- package/dist/components/card/index.js +22 -0
- package/dist/components/checkbox/index.cjs +26 -0
- package/dist/components/checkbox/index.d.cts +1136 -0
- package/dist/components/checkbox/index.d.ts +1136 -0
- package/dist/components/checkbox/index.js +26 -0
- package/dist/components/chip/index.cjs +20 -0
- package/dist/components/chip/index.d.cts +608 -0
- package/dist/components/chip/index.d.ts +608 -0
- package/dist/components/chip/index.js +20 -0
- package/dist/components/divider/index.cjs +13 -0
- package/dist/components/divider/index.d.cts +117 -0
- package/dist/components/divider/index.d.ts +117 -0
- package/dist/components/divider/index.js +13 -0
- package/dist/components/field-group/index.cjs +27 -0
- package/dist/components/field-group/index.d.cts +270 -0
- package/dist/components/field-group/index.d.ts +270 -0
- package/dist/components/field-group/index.js +27 -0
- package/dist/components/input-otp/index.cjs +29 -0
- package/dist/components/input-otp/index.d.cts +325 -0
- package/dist/components/input-otp/index.d.ts +325 -0
- package/dist/components/input-otp/index.js +29 -0
- package/dist/components/menu/index.cjs +49 -0
- package/dist/components/menu/index.d.cts +351 -0
- package/dist/components/menu/index.d.ts +351 -0
- package/dist/components/menu/index.js +49 -0
- package/dist/components/popover/index.cjs +38 -0
- package/dist/components/popover/index.d.cts +254 -0
- package/dist/components/popover/index.d.ts +254 -0
- package/dist/components/popover/index.js +38 -0
- package/dist/components/radio/index.cjs +26 -0
- package/dist/components/radio/index.d.cts +1102 -0
- package/dist/components/radio/index.d.ts +1102 -0
- package/dist/components/radio/index.js +26 -0
- package/dist/components/select/index.cjs +50 -0
- package/dist/components/select/index.d.cts +498 -0
- package/dist/components/select/index.d.ts +498 -0
- package/dist/components/select/index.js +50 -0
- package/dist/components/skeleton/index.cjs +11 -0
- package/dist/components/skeleton/index.d.cts +111 -0
- package/dist/components/skeleton/index.d.ts +111 -0
- package/dist/components/skeleton/index.js +11 -0
- package/dist/components/spinner/index.cjs +17 -0
- package/dist/components/spinner/index.d.cts +104 -0
- package/dist/components/spinner/index.d.ts +104 -0
- package/dist/components/spinner/index.js +17 -0
- package/dist/components/switch/index.cjs +27 -0
- package/dist/components/switch/index.d.cts +1154 -0
- package/dist/components/switch/index.d.ts +1154 -0
- package/dist/components/switch/index.js +27 -0
- package/dist/components/text-area/index.cjs +14 -0
- package/dist/components/text-area/index.d.cts +73 -0
- package/dist/components/text-area/index.d.ts +73 -0
- package/dist/components/text-area/index.js +14 -0
- package/dist/components/text-field/index.cjs +25 -0
- package/dist/components/text-field/index.d.cts +205 -0
- package/dist/components/text-field/index.d.ts +205 -0
- package/dist/components/text-field/index.js +25 -0
- package/dist/components/typography/index.cjs +15 -0
- package/dist/components/typography/index.d.cts +116 -0
- package/dist/components/typography/index.d.ts +116 -0
- package/dist/components/typography/index.js +15 -0
- package/dist/components/view/index.cjs +17 -0
- package/dist/components/view/index.d.cts +152 -0
- package/dist/components/view/index.d.ts +152 -0
- package/dist/components/view/index.js +17 -0
- package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
- package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
- package/dist/icon.type-Kml72iSz.d.ts +73 -0
- package/dist/icon.type-d_i9ma-i.d.cts +73 -0
- package/dist/index.cjs +400 -4
- package/dist/index.d.cts +118 -4
- package/dist/index.d.ts +118 -4
- package/dist/index.js +423 -27
- package/dist/placement-DHa0Rrh1.d.cts +38 -0
- package/dist/placement-DHa0Rrh1.d.ts +38 -0
- package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
- package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
- package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
- package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
- package/dist/system/index.cjs +73 -4
- package/dist/system/index.d.cts +379 -193
- package/dist/system/index.d.ts +379 -193
- package/dist/system/index.js +87 -18
- package/dist/text-field.type-0l73acce.d.ts +167 -0
- package/dist/text-field.type-DBh06DU5.d.cts +167 -0
- package/dist/theme/index.cjs +5 -3
- package/dist/theme/index.d.cts +55 -24
- package/dist/theme/index.d.ts +55 -24
- package/dist/theme/index.js +4 -2
- package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
- package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
- package/package.json +254 -18
- package/dist/chunk-ECDWSSHJ.js +0 -688
- package/dist/chunk-IYFGO523.cjs +0 -688
package/dist/system/index.js
CHANGED
|
@@ -1,45 +1,114 @@
|
|
|
1
|
+
import "../chunk-WHJTBTYM.js";
|
|
1
2
|
import {
|
|
3
|
+
Portal,
|
|
4
|
+
PortalContext,
|
|
5
|
+
PortalHost
|
|
6
|
+
} from "../chunk-2PMXMKS5.js";
|
|
7
|
+
import {
|
|
8
|
+
INDICATOR_ROTATION,
|
|
9
|
+
INDICATOR_SPRING,
|
|
10
|
+
anchoredEntering,
|
|
11
|
+
anchoredExiting,
|
|
12
|
+
overlayEntering,
|
|
13
|
+
overlayExiting
|
|
14
|
+
} from "../chunk-64MXEVT3.js";
|
|
15
|
+
import {
|
|
16
|
+
CloseButton,
|
|
17
|
+
closeButtonBase
|
|
18
|
+
} from "../chunk-KCMYU7WF.js";
|
|
19
|
+
import {
|
|
20
|
+
ChevronDownIcon,
|
|
21
|
+
Icon,
|
|
22
|
+
IconContext,
|
|
23
|
+
useIconContext
|
|
24
|
+
} from "../chunk-FHUYHV6J.js";
|
|
25
|
+
import {
|
|
26
|
+
SelectionFill
|
|
27
|
+
} from "../chunk-BA2DBSAN.js";
|
|
28
|
+
import {
|
|
29
|
+
FEEDBACK_OVERLAY,
|
|
30
|
+
HIGHLIGHT_DURATION,
|
|
2
31
|
HIGHLIGHT_OPACITY,
|
|
3
32
|
PRESS_DURATION,
|
|
4
33
|
PRESS_SCALE,
|
|
5
|
-
Portal,
|
|
6
|
-
PortalContext,
|
|
7
|
-
PortalHost,
|
|
8
34
|
PressableFeedback,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
35
|
+
RIPPLE_CONFIRM_DURATION,
|
|
36
|
+
RIPPLE_EXPAND_DURATION,
|
|
37
|
+
RIPPLE_FADE_IN,
|
|
38
|
+
RIPPLE_FADE_OUT,
|
|
39
|
+
RIPPLE_FADE_OUT_DELAY,
|
|
12
40
|
RIPPLE_OPACITY,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
mergeProps,
|
|
18
|
-
mergeRefs,
|
|
41
|
+
RIPPLE_START_SCALE,
|
|
42
|
+
SCALE_REFERENCE_WIDTH,
|
|
43
|
+
markOverlay,
|
|
44
|
+
pressScaleFor,
|
|
19
45
|
resolveAnimation,
|
|
20
46
|
resolveSlotAnimation,
|
|
47
|
+
rippleRadiusFor,
|
|
21
48
|
useFeedback
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import "../chunk-
|
|
49
|
+
} from "../chunk-6UEZJRVI.js";
|
|
50
|
+
import "../chunk-423RQBOX.js";
|
|
51
|
+
import "../chunk-EGLLDKN6.js";
|
|
52
|
+
import {
|
|
53
|
+
createRecipe,
|
|
54
|
+
radiusAxis
|
|
55
|
+
} from "../chunk-4GTAZM2C.js";
|
|
56
|
+
import "../chunk-A3EGFI6T.js";
|
|
57
|
+
import {
|
|
58
|
+
Slot,
|
|
59
|
+
childrenToString,
|
|
60
|
+
createSlotContext,
|
|
61
|
+
mergeProps
|
|
62
|
+
} from "../chunk-K72UDPVN.js";
|
|
63
|
+
import {
|
|
64
|
+
mergeRefs
|
|
65
|
+
} from "../chunk-36PRYGAM.js";
|
|
66
|
+
import {
|
|
67
|
+
useStyleProps
|
|
68
|
+
} from "../chunk-M63GFNKV.js";
|
|
24
69
|
export {
|
|
70
|
+
ChevronDownIcon,
|
|
71
|
+
CloseButton,
|
|
72
|
+
FEEDBACK_OVERLAY,
|
|
73
|
+
HIGHLIGHT_DURATION,
|
|
25
74
|
HIGHLIGHT_OPACITY,
|
|
75
|
+
INDICATOR_ROTATION,
|
|
76
|
+
INDICATOR_SPRING,
|
|
77
|
+
Icon,
|
|
78
|
+
IconContext,
|
|
26
79
|
PRESS_DURATION,
|
|
27
80
|
PRESS_SCALE,
|
|
28
81
|
Portal,
|
|
29
82
|
PortalContext,
|
|
30
83
|
PortalHost,
|
|
31
84
|
PressableFeedback,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
85
|
+
RIPPLE_CONFIRM_DURATION,
|
|
86
|
+
RIPPLE_EXPAND_DURATION,
|
|
87
|
+
RIPPLE_FADE_IN,
|
|
88
|
+
RIPPLE_FADE_OUT,
|
|
89
|
+
RIPPLE_FADE_OUT_DELAY,
|
|
35
90
|
RIPPLE_OPACITY,
|
|
91
|
+
RIPPLE_START_SCALE,
|
|
92
|
+
SCALE_REFERENCE_WIDTH,
|
|
93
|
+
SelectionFill,
|
|
36
94
|
Slot,
|
|
95
|
+
anchoredEntering,
|
|
96
|
+
anchoredExiting,
|
|
37
97
|
childrenToString,
|
|
98
|
+
closeButtonBase,
|
|
38
99
|
createRecipe,
|
|
39
100
|
createSlotContext,
|
|
101
|
+
markOverlay,
|
|
40
102
|
mergeProps,
|
|
41
103
|
mergeRefs,
|
|
104
|
+
overlayEntering,
|
|
105
|
+
overlayExiting,
|
|
106
|
+
pressScaleFor,
|
|
107
|
+
radiusAxis,
|
|
42
108
|
resolveAnimation,
|
|
43
109
|
resolveSlotAnimation,
|
|
44
|
-
|
|
110
|
+
rippleRadiusFor,
|
|
111
|
+
useFeedback,
|
|
112
|
+
useIconContext,
|
|
113
|
+
useStyleProps
|
|
45
114
|
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle, TextInputProps, TextProps, ViewProps } from 'react-native';
|
|
3
|
+
import { T as TextStyleProps, V as ViewStyleProps } from './style-props.type-CfnoGEP7.js';
|
|
4
|
+
import { S as Size, R as RadiusKey } from './theme.type-C2gNHpEx.js';
|
|
5
|
+
|
|
6
|
+
type TextFieldSlot = 'root' | 'label' | 'field' | 'textArea' | 'placeholder' | 'description' | 'error' | 'prefix' | 'suffix' | 'icon';
|
|
7
|
+
/**
|
|
8
|
+
* The library's four emphasis levels, narrowed like the `Card`'s (§1 bis). A field
|
|
9
|
+
* **reports nothing** — an error is `isInvalid`, which is a state and not a variant — so
|
|
10
|
+
* `success`, `warning` and `danger` are absent here for the same reason they are there.
|
|
11
|
+
*
|
|
12
|
+
* This is where the theme's `field*` family is finally read, and the four names split
|
|
13
|
+
* HeroUI's two-name `primary | secondary` by saying what each of their ends already is:
|
|
14
|
+
*
|
|
15
|
+
* - **`primary`** — the `fieldBackground` fill plus the theme's `field` shadow. HeroUI's
|
|
16
|
+
* `primary`, with the elevation their flat token only implies.
|
|
17
|
+
* - **`secondary`** — the neutral `default` fill. HeroUI's `secondary`, and the default
|
|
18
|
+
* here: on a plain background a white field is its border and nothing else, while on a
|
|
19
|
+
* card the `fieldBackground` token *is* the card's own colour.
|
|
20
|
+
* - **`tertiary`** — the border alone, no fill. The same drop the `Button`'s `tertiary`
|
|
21
|
+
* makes.
|
|
22
|
+
* - **`ghost`** — neither. A bare field for a toolbar or an inline edit; it has no border
|
|
23
|
+
* to move, so its focus shows in the caret alone.
|
|
24
|
+
*
|
|
25
|
+
* The first three name the `fieldBorder` edge and `ghost` gives it up. Its width is the
|
|
26
|
+
* theme's `borderWidth.field` — HeroUI's `--field-border-width`, which they ship at `0`
|
|
27
|
+
* and we ship at `1`. That is the one shipped default where the two differ;
|
|
28
|
+
* `createTheme({ borderWidth: { field: 0 } })` reproduces theirs.
|
|
29
|
+
*/
|
|
30
|
+
type TextFieldVariant = 'primary' | 'secondary' | 'tertiary' | 'ghost';
|
|
31
|
+
/**
|
|
32
|
+
* Where the label sits relative to the field's box.
|
|
33
|
+
*
|
|
34
|
+
* `outside` is the label above the box, in the column's flow. `inside` lifts it into the
|
|
35
|
+
* box, above the text — the label is taken **out of flow** and placed against the box's
|
|
36
|
+
* own padding, so the JSX is identical either way and nothing is reparented (R4).
|
|
37
|
+
*
|
|
38
|
+
* Because the inside label positions itself against the top of the root, it assumes the
|
|
39
|
+
* field is the first thing in the column's flow: write `TextField.Description` and
|
|
40
|
+
* `TextField.Error` after the field, which is where they belong anyway.
|
|
41
|
+
*/
|
|
42
|
+
type TextFieldLabelPlacement = 'outside' | 'inside';
|
|
43
|
+
type TextFieldSize = Size;
|
|
44
|
+
/**
|
|
45
|
+
* What the `TextField` itself understands. R14 — a name in here is the component's, so the
|
|
46
|
+
* style prop that shares it is not exposed: `size` is the field's scale and never
|
|
47
|
+
* `ViewStyle`'s, and `color` is R7's tint.
|
|
48
|
+
*/
|
|
49
|
+
type TextFieldOwnProps = {
|
|
50
|
+
variant?: TextFieldVariant;
|
|
51
|
+
/** The field's height, its padding, the gaps and the type. Never width. */
|
|
52
|
+
size?: TextFieldSize;
|
|
53
|
+
/** Overrides the `field` radius the theme chose for every size. */
|
|
54
|
+
radius?: RadiusKey;
|
|
55
|
+
/** Above the box, or lifted into it. @default 'outside' */
|
|
56
|
+
labelPlacement?: TextFieldLabelPlacement;
|
|
57
|
+
/**
|
|
58
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). It lands where the variant put its
|
|
59
|
+
* tokens — the fill of a `default`, the border of a `tertiary` — and, because the focus
|
|
60
|
+
* colour is a role like any other, it is also what the field borders on focus.
|
|
61
|
+
*/
|
|
62
|
+
color?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Paints the border, the label and the description in `danger`, and takes the focus
|
|
65
|
+
* treatment off: an error outranks focus, and a field that is both should read as
|
|
66
|
+
* wrong rather than as busy.
|
|
67
|
+
*
|
|
68
|
+
* It does **not** mount or unmount `TextField.Error`. That stays the caller's — a slot that
|
|
69
|
+
* silently renders nothing is a slot you cannot debug.
|
|
70
|
+
*/
|
|
71
|
+
isInvalid?: boolean;
|
|
72
|
+
/** Dims the field and makes it uneditable. */
|
|
73
|
+
isDisabled?: boolean;
|
|
74
|
+
style?: StyleProp<ViewStyle>;
|
|
75
|
+
children?: ReactNode;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* R14 — the input's own props, the wrapper `View`'s, and every `ViewStyle` key neither
|
|
79
|
+
* already claims. **`TextInputProps` are not here**: they belong to `TextField.Field`, which
|
|
80
|
+
* is the node that has them.
|
|
81
|
+
*/
|
|
82
|
+
type TextFieldProps = TextFieldOwnProps & Omit<ViewProps, keyof TextFieldOwnProps> & Omit<ViewStyleProps, keyof TextFieldOwnProps | keyof ViewProps> & {
|
|
83
|
+
/** R12 — merge into the single child instead of rendering a `View`. */
|
|
84
|
+
asChild?: boolean;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Everything `TextInput` accepts, plus the `TextStyle` keys as props (R14).
|
|
88
|
+
*
|
|
89
|
+
* `editable` is absent: it is `disabled` under another name, and R8 keeps that off the
|
|
90
|
+
* public surface — `isDisabled` on the root is what stops the field.
|
|
91
|
+
*/
|
|
92
|
+
type TextFieldFieldProps = Omit<TextInputProps, 'editable'> & Omit<TextStyleProps, keyof TextInputProps>;
|
|
93
|
+
/** `Text`'s own props win over the `TextStyle` keys of the same name (R14). */
|
|
94
|
+
type TextFieldTextProps = TextProps & Omit<TextStyleProps, keyof TextProps> & {
|
|
95
|
+
children?: ReactNode;
|
|
96
|
+
};
|
|
97
|
+
type TextFieldLabelProps = TextFieldTextProps;
|
|
98
|
+
type TextFieldDescriptionProps = TextFieldTextProps;
|
|
99
|
+
type TextFieldErrorProps = TextFieldTextProps;
|
|
100
|
+
/**
|
|
101
|
+
* Read off `TextInput`'s own props rather than spelled out: React Native has renamed the
|
|
102
|
+
* payload of these two more than once, and a hand-written `NativeSyntheticEvent<…>` here
|
|
103
|
+
* would be a second declaration free to drift from the node that actually fires them.
|
|
104
|
+
*/
|
|
105
|
+
type FieldFocusEvent = Parameters<NonNullable<TextInputProps['onFocus']>>[0];
|
|
106
|
+
type FieldBlurEvent = Parameters<NonNullable<TextInputProps['onBlur']>>[0];
|
|
107
|
+
/**
|
|
108
|
+
* R5 — resolved styles, not props for a slot to resolve a second time. Each entry is the
|
|
109
|
+
* cached `StyleSheet` reference with the uncached tint pass layered over it, so a slot
|
|
110
|
+
* merges its own `style` on top and does no work of its own.
|
|
111
|
+
*/
|
|
112
|
+
type TextFieldContextValue = {
|
|
113
|
+
labelStyle: StyleProp<TextStyle>;
|
|
114
|
+
fieldStyle: StyleProp<TextStyle>;
|
|
115
|
+
/** Layered *over* `fieldStyle` by `TextField.TextArea`: only what a multiline field adds. */
|
|
116
|
+
textAreaStyle: StyleProp<TextStyle>;
|
|
117
|
+
/**
|
|
118
|
+
* Values, not a style: `rows` is a raw number, so the height it implies is arithmetic
|
|
119
|
+
* the slot does — and these are the two measurements it needs, flattened once here
|
|
120
|
+
* rather than in every text area on the screen.
|
|
121
|
+
*/
|
|
122
|
+
textArea: {
|
|
123
|
+
lineHeight: number;
|
|
124
|
+
paddingVertical: number;
|
|
125
|
+
};
|
|
126
|
+
descriptionStyle: StyleProp<TextStyle>;
|
|
127
|
+
errorStyle: StyleProp<TextStyle>;
|
|
128
|
+
/**
|
|
129
|
+
* The two decorators of a `FieldGroup`, already pinned to their edge and inset by the
|
|
130
|
+
* field's own padding. They are resolved here, on the root, because the size that
|
|
131
|
+
* decides that padding is the root's — the group itself adds no axis of its own.
|
|
132
|
+
*/
|
|
133
|
+
prefixStyle: StyleProp<ViewStyle>;
|
|
134
|
+
suffixStyle: StyleProp<ViewStyle>;
|
|
135
|
+
/**
|
|
136
|
+
* Values, not a style: an icon is a third party's component, and `size` and `color` are
|
|
137
|
+
* props it takes rather than a style it accepts. Flattened once here, the way the `Chip`
|
|
138
|
+
* and the `Alert` publish theirs.
|
|
139
|
+
*/
|
|
140
|
+
icon: {
|
|
141
|
+
size: number | undefined;
|
|
142
|
+
color: string | undefined;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* A value and not a style: `placeholderTextColor` is a `TextInput` prop, so the root
|
|
146
|
+
* flattens its placeholder slot once here rather than in the field.
|
|
147
|
+
*/
|
|
148
|
+
placeholderTextColor?: string;
|
|
149
|
+
/**
|
|
150
|
+
* The focus state lives on the **root**, because the root's recipe resolves on it (R5)
|
|
151
|
+
* and it needs the value before it renders — but the node that hears the event is
|
|
152
|
+
* `TextField.Field`, three levels down. These are how it reports back. Their identity is
|
|
153
|
+
* stable, so publishing them costs no re-render of a memoized slot.
|
|
154
|
+
*/
|
|
155
|
+
onFieldFocus: (event: FieldFocusEvent) => void;
|
|
156
|
+
onFieldBlur: (event: FieldBlurEvent) => void;
|
|
157
|
+
/**
|
|
158
|
+
* The id the label carries and the field points at, so a screen reader reads "Courriel,
|
|
159
|
+
* champ de saisie" rather than just the placeholder.
|
|
160
|
+
*/
|
|
161
|
+
labelId: string;
|
|
162
|
+
descriptionId: string;
|
|
163
|
+
isDisabled: boolean;
|
|
164
|
+
isInvalid: boolean;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export type { TextFieldFieldProps as T, TextFieldProps as a, TextFieldContextValue as b, TextFieldDescriptionProps as c, TextFieldErrorProps as d, TextFieldLabelPlacement as e, TextFieldLabelProps as f, TextFieldSize as g, TextFieldSlot as h, TextFieldVariant as i };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle, TextInputProps, TextProps, ViewProps } from 'react-native';
|
|
3
|
+
import { T as TextStyleProps, V as ViewStyleProps } from './style-props.type-CfnoGEP7.cjs';
|
|
4
|
+
import { S as Size, R as RadiusKey } from './theme.type-C2gNHpEx.cjs';
|
|
5
|
+
|
|
6
|
+
type TextFieldSlot = 'root' | 'label' | 'field' | 'textArea' | 'placeholder' | 'description' | 'error' | 'prefix' | 'suffix' | 'icon';
|
|
7
|
+
/**
|
|
8
|
+
* The library's four emphasis levels, narrowed like the `Card`'s (§1 bis). A field
|
|
9
|
+
* **reports nothing** — an error is `isInvalid`, which is a state and not a variant — so
|
|
10
|
+
* `success`, `warning` and `danger` are absent here for the same reason they are there.
|
|
11
|
+
*
|
|
12
|
+
* This is where the theme's `field*` family is finally read, and the four names split
|
|
13
|
+
* HeroUI's two-name `primary | secondary` by saying what each of their ends already is:
|
|
14
|
+
*
|
|
15
|
+
* - **`primary`** — the `fieldBackground` fill plus the theme's `field` shadow. HeroUI's
|
|
16
|
+
* `primary`, with the elevation their flat token only implies.
|
|
17
|
+
* - **`secondary`** — the neutral `default` fill. HeroUI's `secondary`, and the default
|
|
18
|
+
* here: on a plain background a white field is its border and nothing else, while on a
|
|
19
|
+
* card the `fieldBackground` token *is* the card's own colour.
|
|
20
|
+
* - **`tertiary`** — the border alone, no fill. The same drop the `Button`'s `tertiary`
|
|
21
|
+
* makes.
|
|
22
|
+
* - **`ghost`** — neither. A bare field for a toolbar or an inline edit; it has no border
|
|
23
|
+
* to move, so its focus shows in the caret alone.
|
|
24
|
+
*
|
|
25
|
+
* The first three name the `fieldBorder` edge and `ghost` gives it up. Its width is the
|
|
26
|
+
* theme's `borderWidth.field` — HeroUI's `--field-border-width`, which they ship at `0`
|
|
27
|
+
* and we ship at `1`. That is the one shipped default where the two differ;
|
|
28
|
+
* `createTheme({ borderWidth: { field: 0 } })` reproduces theirs.
|
|
29
|
+
*/
|
|
30
|
+
type TextFieldVariant = 'primary' | 'secondary' | 'tertiary' | 'ghost';
|
|
31
|
+
/**
|
|
32
|
+
* Where the label sits relative to the field's box.
|
|
33
|
+
*
|
|
34
|
+
* `outside` is the label above the box, in the column's flow. `inside` lifts it into the
|
|
35
|
+
* box, above the text — the label is taken **out of flow** and placed against the box's
|
|
36
|
+
* own padding, so the JSX is identical either way and nothing is reparented (R4).
|
|
37
|
+
*
|
|
38
|
+
* Because the inside label positions itself against the top of the root, it assumes the
|
|
39
|
+
* field is the first thing in the column's flow: write `TextField.Description` and
|
|
40
|
+
* `TextField.Error` after the field, which is where they belong anyway.
|
|
41
|
+
*/
|
|
42
|
+
type TextFieldLabelPlacement = 'outside' | 'inside';
|
|
43
|
+
type TextFieldSize = Size;
|
|
44
|
+
/**
|
|
45
|
+
* What the `TextField` itself understands. R14 — a name in here is the component's, so the
|
|
46
|
+
* style prop that shares it is not exposed: `size` is the field's scale and never
|
|
47
|
+
* `ViewStyle`'s, and `color` is R7's tint.
|
|
48
|
+
*/
|
|
49
|
+
type TextFieldOwnProps = {
|
|
50
|
+
variant?: TextFieldVariant;
|
|
51
|
+
/** The field's height, its padding, the gaps and the type. Never width. */
|
|
52
|
+
size?: TextFieldSize;
|
|
53
|
+
/** Overrides the `field` radius the theme chose for every size. */
|
|
54
|
+
radius?: RadiusKey;
|
|
55
|
+
/** Above the box, or lifted into it. @default 'outside' */
|
|
56
|
+
labelPlacement?: TextFieldLabelPlacement;
|
|
57
|
+
/**
|
|
58
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). It lands where the variant put its
|
|
59
|
+
* tokens — the fill of a `default`, the border of a `tertiary` — and, because the focus
|
|
60
|
+
* colour is a role like any other, it is also what the field borders on focus.
|
|
61
|
+
*/
|
|
62
|
+
color?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Paints the border, the label and the description in `danger`, and takes the focus
|
|
65
|
+
* treatment off: an error outranks focus, and a field that is both should read as
|
|
66
|
+
* wrong rather than as busy.
|
|
67
|
+
*
|
|
68
|
+
* It does **not** mount or unmount `TextField.Error`. That stays the caller's — a slot that
|
|
69
|
+
* silently renders nothing is a slot you cannot debug.
|
|
70
|
+
*/
|
|
71
|
+
isInvalid?: boolean;
|
|
72
|
+
/** Dims the field and makes it uneditable. */
|
|
73
|
+
isDisabled?: boolean;
|
|
74
|
+
style?: StyleProp<ViewStyle>;
|
|
75
|
+
children?: ReactNode;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* R14 — the input's own props, the wrapper `View`'s, and every `ViewStyle` key neither
|
|
79
|
+
* already claims. **`TextInputProps` are not here**: they belong to `TextField.Field`, which
|
|
80
|
+
* is the node that has them.
|
|
81
|
+
*/
|
|
82
|
+
type TextFieldProps = TextFieldOwnProps & Omit<ViewProps, keyof TextFieldOwnProps> & Omit<ViewStyleProps, keyof TextFieldOwnProps | keyof ViewProps> & {
|
|
83
|
+
/** R12 — merge into the single child instead of rendering a `View`. */
|
|
84
|
+
asChild?: boolean;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Everything `TextInput` accepts, plus the `TextStyle` keys as props (R14).
|
|
88
|
+
*
|
|
89
|
+
* `editable` is absent: it is `disabled` under another name, and R8 keeps that off the
|
|
90
|
+
* public surface — `isDisabled` on the root is what stops the field.
|
|
91
|
+
*/
|
|
92
|
+
type TextFieldFieldProps = Omit<TextInputProps, 'editable'> & Omit<TextStyleProps, keyof TextInputProps>;
|
|
93
|
+
/** `Text`'s own props win over the `TextStyle` keys of the same name (R14). */
|
|
94
|
+
type TextFieldTextProps = TextProps & Omit<TextStyleProps, keyof TextProps> & {
|
|
95
|
+
children?: ReactNode;
|
|
96
|
+
};
|
|
97
|
+
type TextFieldLabelProps = TextFieldTextProps;
|
|
98
|
+
type TextFieldDescriptionProps = TextFieldTextProps;
|
|
99
|
+
type TextFieldErrorProps = TextFieldTextProps;
|
|
100
|
+
/**
|
|
101
|
+
* Read off `TextInput`'s own props rather than spelled out: React Native has renamed the
|
|
102
|
+
* payload of these two more than once, and a hand-written `NativeSyntheticEvent<…>` here
|
|
103
|
+
* would be a second declaration free to drift from the node that actually fires them.
|
|
104
|
+
*/
|
|
105
|
+
type FieldFocusEvent = Parameters<NonNullable<TextInputProps['onFocus']>>[0];
|
|
106
|
+
type FieldBlurEvent = Parameters<NonNullable<TextInputProps['onBlur']>>[0];
|
|
107
|
+
/**
|
|
108
|
+
* R5 — resolved styles, not props for a slot to resolve a second time. Each entry is the
|
|
109
|
+
* cached `StyleSheet` reference with the uncached tint pass layered over it, so a slot
|
|
110
|
+
* merges its own `style` on top and does no work of its own.
|
|
111
|
+
*/
|
|
112
|
+
type TextFieldContextValue = {
|
|
113
|
+
labelStyle: StyleProp<TextStyle>;
|
|
114
|
+
fieldStyle: StyleProp<TextStyle>;
|
|
115
|
+
/** Layered *over* `fieldStyle` by `TextField.TextArea`: only what a multiline field adds. */
|
|
116
|
+
textAreaStyle: StyleProp<TextStyle>;
|
|
117
|
+
/**
|
|
118
|
+
* Values, not a style: `rows` is a raw number, so the height it implies is arithmetic
|
|
119
|
+
* the slot does — and these are the two measurements it needs, flattened once here
|
|
120
|
+
* rather than in every text area on the screen.
|
|
121
|
+
*/
|
|
122
|
+
textArea: {
|
|
123
|
+
lineHeight: number;
|
|
124
|
+
paddingVertical: number;
|
|
125
|
+
};
|
|
126
|
+
descriptionStyle: StyleProp<TextStyle>;
|
|
127
|
+
errorStyle: StyleProp<TextStyle>;
|
|
128
|
+
/**
|
|
129
|
+
* The two decorators of a `FieldGroup`, already pinned to their edge and inset by the
|
|
130
|
+
* field's own padding. They are resolved here, on the root, because the size that
|
|
131
|
+
* decides that padding is the root's — the group itself adds no axis of its own.
|
|
132
|
+
*/
|
|
133
|
+
prefixStyle: StyleProp<ViewStyle>;
|
|
134
|
+
suffixStyle: StyleProp<ViewStyle>;
|
|
135
|
+
/**
|
|
136
|
+
* Values, not a style: an icon is a third party's component, and `size` and `color` are
|
|
137
|
+
* props it takes rather than a style it accepts. Flattened once here, the way the `Chip`
|
|
138
|
+
* and the `Alert` publish theirs.
|
|
139
|
+
*/
|
|
140
|
+
icon: {
|
|
141
|
+
size: number | undefined;
|
|
142
|
+
color: string | undefined;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* A value and not a style: `placeholderTextColor` is a `TextInput` prop, so the root
|
|
146
|
+
* flattens its placeholder slot once here rather than in the field.
|
|
147
|
+
*/
|
|
148
|
+
placeholderTextColor?: string;
|
|
149
|
+
/**
|
|
150
|
+
* The focus state lives on the **root**, because the root's recipe resolves on it (R5)
|
|
151
|
+
* and it needs the value before it renders — but the node that hears the event is
|
|
152
|
+
* `TextField.Field`, three levels down. These are how it reports back. Their identity is
|
|
153
|
+
* stable, so publishing them costs no re-render of a memoized slot.
|
|
154
|
+
*/
|
|
155
|
+
onFieldFocus: (event: FieldFocusEvent) => void;
|
|
156
|
+
onFieldBlur: (event: FieldBlurEvent) => void;
|
|
157
|
+
/**
|
|
158
|
+
* The id the label carries and the field points at, so a screen reader reads "Courriel,
|
|
159
|
+
* champ de saisie" rather than just the placeholder.
|
|
160
|
+
*/
|
|
161
|
+
labelId: string;
|
|
162
|
+
descriptionId: string;
|
|
163
|
+
isDisabled: boolean;
|
|
164
|
+
isInvalid: boolean;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export type { TextFieldFieldProps as T, TextFieldProps as a, TextFieldContextValue as b, TextFieldDescriptionProps as c, TextFieldErrorProps as d, TextFieldLabelPlacement as e, TextFieldLabelProps as f, TextFieldSize as g, TextFieldSlot as h, TextFieldVariant as i };
|
package/dist/theme/index.cjs
CHANGED
|
@@ -9,14 +9,16 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkACAPTWE3cjs = require('../chunk-ACAPTWE3.cjs');
|
|
13
|
+
require('../chunk-WDDXU3OH.cjs');
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
var
|
|
20
|
+
var _chunk57SJ4LJFcjs = require('../chunk-57SJ4LJF.cjs');
|
|
21
|
+
require('../chunk-TK44VBIE.cjs');
|
|
20
22
|
|
|
21
23
|
|
|
22
24
|
|
|
@@ -33,4 +35,4 @@ var _chunk3QBT3Q65cjs = require('../chunk-3QBT3Q65.cjs');
|
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
|
|
36
|
-
exports.ThemeContext =
|
|
38
|
+
exports.ThemeContext = _chunk57SJ4LJFcjs.ThemeContext; exports.XAUIProvider = _chunkACAPTWE3cjs.XAUIProvider; exports.buildRadius = _chunkACAPTWE3cjs.buildRadius; exports.buildShadows = _chunkACAPTWE3cjs.buildShadows; exports.createTheme = _chunkACAPTWE3cjs.createTheme; exports.defaultTheme = _chunkACAPTWE3cjs.defaultTheme; exports.deriveColors = _chunkACAPTWE3cjs.deriveColors; exports.deriveTint = _chunk57SJ4LJFcjs.deriveTint; exports.palette = _chunkACAPTWE3cjs.palette; exports.primitives = _chunkACAPTWE3cjs.primitives; exports.sourceKeys = _chunkACAPTWE3cjs.sourceKeys; exports.tokens = _chunkACAPTWE3cjs.tokens; exports.useColorMode = _chunk57SJ4LJFcjs.useColorMode; exports.useThemeColor = _chunk57SJ4LJFcjs.useThemeColor; exports.useXAUITheme = _chunk57SJ4LJFcjs.useXAUITheme;
|
package/dist/theme/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { i as XAUIThemeSet, h as XAUIThemeConfig,
|
|
4
|
-
export { F as FontSizeKey,
|
|
3
|
+
import { i as XAUIThemeSet, h as XAUIThemeConfig, g as XAUISourceColors, c as XAUIDerivedColors, X as XAUITheme, e as XAUIRadius, C as ColorMode, a as XAUIColors } from '../theme.type-C2gNHpEx.cjs';
|
|
4
|
+
export { F as FontSizeKey, b as FontWeightKey, R as RadiusKey, S as Size, d as XAUIPrimitiveColors, f as XAUIShadow } from '../theme.type-C2gNHpEx.cjs';
|
|
5
5
|
import 'react-native';
|
|
6
6
|
|
|
7
7
|
/** `'system'` follows the device; the resolved value is never `'system'`. */
|
|
@@ -12,6 +12,14 @@ type XAUIProviderProps = {
|
|
|
12
12
|
theme?: XAUIThemeSet;
|
|
13
13
|
/** Controlled: the library owns neither the state nor its persistence. */
|
|
14
14
|
colorMode?: ColorModePreference;
|
|
15
|
+
/**
|
|
16
|
+
* Mounts the `PortalHost` overlays render into. Set false only to mount one yourself,
|
|
17
|
+
* somewhere the provider cannot reach — under a gesture root, say. Without a host
|
|
18
|
+
* anywhere, `Portal` renders nothing and overlays are silently absent.
|
|
19
|
+
*
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
hasPortalHost?: boolean;
|
|
15
23
|
};
|
|
16
24
|
|
|
17
25
|
/**
|
|
@@ -20,8 +28,14 @@ type XAUIProviderProps = {
|
|
|
20
28
|
* `theme` is expected to come from `createTheme` at module level. The provider selects a
|
|
21
29
|
* mode from an already-resolved set rather than memoizing on the prop's identity — which
|
|
22
30
|
* is what the v0 provider did, rebuilding every style in the app on each parent render.
|
|
31
|
+
*
|
|
32
|
+
* It also mounts the `PortalHost` every overlay renders into. That is here rather than in
|
|
33
|
+
* the app because forgetting it is silent: `Portal` renders nothing outside a host, so a
|
|
34
|
+
* select would open onto an empty screen with no error to read. An app that needs the
|
|
35
|
+
* host somewhere else — under a gesture root, or inside its own navigation container —
|
|
36
|
+
* sets `hasPortalHost={false}` and mounts one itself.
|
|
23
37
|
*/
|
|
24
|
-
declare function XAUIProvider({ children, theme, colorMode, }: XAUIProviderProps): react.JSX.Element;
|
|
38
|
+
declare function XAUIProvider({ children, theme, colorMode, hasPortalHost, }: XAUIProviderProps): react.JSX.Element;
|
|
25
39
|
|
|
26
40
|
/**
|
|
27
41
|
* Build a theme once, at module level:
|
|
@@ -44,6 +58,17 @@ declare const defaultTheme: XAUIThemeSet;
|
|
|
44
58
|
* These are HeroUI's `color-mix(in oklab, …)` formulas transposed to JS, because React
|
|
45
59
|
* Native has no `color-mix()`. Their `-hover` names became `-pressed`: what they feed is
|
|
46
60
|
* the press overlay, and the web name was a leftover.
|
|
61
|
+
*
|
|
62
|
+
* **One deliberate divergence: a pressed state always moves towards the mode's ink**
|
|
63
|
+
* (P2-API-REVIEW §E). Mixing towards the variant's own foreground — which is what their
|
|
64
|
+
* formula does — makes the direction follow the fill's lightness rather than a decision:
|
|
65
|
+
* `#9333ea` has near-white text and lightened under the finger in light mode, while
|
|
66
|
+
* `#c084fc` has dark text and darkened in dark mode. Same component, opposite gesture,
|
|
67
|
+
* nobody's choice. Towards `foreground` it is one direction — darker in light, lighter in
|
|
68
|
+
* dark — and the label's contrast rises in both instead of falling in one.
|
|
69
|
+
*
|
|
70
|
+
* The neutral fills already did this: `defaultForeground` and `surfaceForeground` *are*
|
|
71
|
+
* the ink, so only the four saturated intents ever flipped.
|
|
47
72
|
*/
|
|
48
73
|
declare function deriveColors(s: XAUISourceColors): XAUIDerivedColors;
|
|
49
74
|
|
|
@@ -380,6 +405,12 @@ declare function buildRadius(base: number): XAUIRadius;
|
|
|
380
405
|
/**
|
|
381
406
|
* Three roles, not an sm→xl scale — which is what lets dark mode drop the surface shadow
|
|
382
407
|
* entirely instead of shipping a scale that reads as dirt on a dark background.
|
|
408
|
+
*
|
|
409
|
+
* `overlay` was heavier: a 24-point blur eight points down at 16 of Android's elevation.
|
|
410
|
+
* Android draws elevation on its own curve and draws it strongly, so a panel that read as
|
|
411
|
+
* lifted on iOS read as detached on Android — a dark halo the width of the gap between it
|
|
412
|
+
* and the field it came out of. Half the elevation and two thirds of the blur still say
|
|
413
|
+
* "above the page" without the panel looking cut out of it.
|
|
383
414
|
*/
|
|
384
415
|
declare function buildShadows(mode: ColorMode): XAUITheme['shadows'];
|
|
385
416
|
|
|
@@ -389,7 +420,7 @@ declare const tokens: {
|
|
|
389
420
|
readonly foreground: "#18181b";
|
|
390
421
|
readonly surface: "#ffffff";
|
|
391
422
|
readonly surfaceForeground: "#18181b";
|
|
392
|
-
readonly surfaceSecondary: "#
|
|
423
|
+
readonly surfaceSecondary: "#ececee";
|
|
393
424
|
readonly surfaceSecondaryForeground: "#18181b";
|
|
394
425
|
readonly surfaceTertiary: "#e4e4e7";
|
|
395
426
|
readonly surfaceTertiaryForeground: "#18181b";
|
|
@@ -397,7 +428,7 @@ declare const tokens: {
|
|
|
397
428
|
readonly overlayForeground: "#18181b";
|
|
398
429
|
readonly backdrop: "rgba(0, 0, 0, 0.2)";
|
|
399
430
|
readonly muted: "#71717a";
|
|
400
|
-
readonly default: "#
|
|
431
|
+
readonly default: "#e4e4e7";
|
|
401
432
|
readonly defaultForeground: "#18181b";
|
|
402
433
|
readonly accent: "#9333ea";
|
|
403
434
|
readonly accentForeground: "#faf5ff";
|
|
@@ -407,7 +438,7 @@ declare const tokens: {
|
|
|
407
438
|
readonly fieldBorder: "#e4e4e7";
|
|
408
439
|
readonly success: "#15803d";
|
|
409
440
|
readonly successForeground: "#fafafa";
|
|
410
|
-
readonly warning: "#
|
|
441
|
+
readonly warning: "#c2410c";
|
|
411
442
|
readonly warningForeground: "#fafafa";
|
|
412
443
|
readonly danger: "#dc2626";
|
|
413
444
|
readonly dangerForeground: "#fafafa";
|
|
@@ -417,24 +448,24 @@ declare const tokens: {
|
|
|
417
448
|
readonly separator: "#d4d4d8";
|
|
418
449
|
readonly focus: "#9333ea";
|
|
419
450
|
readonly link: "#18181b";
|
|
420
|
-
readonly accentPressed: "#
|
|
421
|
-
readonly successPressed: "#
|
|
422
|
-
readonly warningPressed: "#
|
|
423
|
-
readonly dangerPressed: "#
|
|
424
|
-
readonly defaultPressed: "#
|
|
451
|
+
readonly accentPressed: "#8533d3";
|
|
452
|
+
readonly successPressed: "#1b753a";
|
|
453
|
+
readonly warningPressed: "#af3e15";
|
|
454
|
+
readonly dangerPressed: "#c72927";
|
|
455
|
+
readonly defaultPressed: "#dbdbde";
|
|
425
456
|
readonly surfacePressed: "#eaeaea";
|
|
426
|
-
readonly defaultSoft: "rgba(
|
|
457
|
+
readonly defaultSoft: "rgba(228, 228, 231, 0.5)";
|
|
427
458
|
readonly defaultSoftForeground: "#18181b";
|
|
428
|
-
readonly defaultSoftPressed: "rgba(
|
|
459
|
+
readonly defaultSoftPressed: "rgba(228, 228, 231, 0.6)";
|
|
429
460
|
readonly accentSoft: "rgba(147, 51, 234, 0.15)";
|
|
430
461
|
readonly accentSoftForeground: "#7833bc";
|
|
431
462
|
readonly accentSoftPressed: "rgba(147, 51, 234, 0.2)";
|
|
432
463
|
readonly successSoft: "rgba(21, 128, 61, 0.15)";
|
|
433
464
|
readonly successSoftForeground: "#205f34";
|
|
434
465
|
readonly successSoftPressed: "rgba(21, 128, 61, 0.2)";
|
|
435
|
-
readonly warningSoft: "rgba(
|
|
436
|
-
readonly warningSoftForeground: "#
|
|
437
|
-
readonly warningSoftPressed: "rgba(
|
|
466
|
+
readonly warningSoft: "rgba(194, 65, 12, 0.15)";
|
|
467
|
+
readonly warningSoftForeground: "#82361e";
|
|
468
|
+
readonly warningSoftPressed: "rgba(194, 65, 12, 0.2)";
|
|
438
469
|
readonly dangerSoft: "rgba(220, 38, 38, 0.15)";
|
|
439
470
|
readonly dangerSoftForeground: "#b22b28";
|
|
440
471
|
readonly dangerSoftPressed: "rgba(220, 38, 38, 0.2)";
|
|
@@ -477,7 +508,7 @@ declare const tokens: {
|
|
|
477
508
|
readonly fieldBorder: "#3f3f46";
|
|
478
509
|
readonly success: "#4ade80";
|
|
479
510
|
readonly successForeground: "#18181b";
|
|
480
|
-
readonly warning: "#
|
|
511
|
+
readonly warning: "#fb923c";
|
|
481
512
|
readonly warningForeground: "#18181b";
|
|
482
513
|
readonly danger: "#f87171";
|
|
483
514
|
readonly dangerForeground: "#18181b";
|
|
@@ -487,10 +518,10 @@ declare const tokens: {
|
|
|
487
518
|
readonly separator: "#52525b";
|
|
488
519
|
readonly focus: "#c084fc";
|
|
489
520
|
readonly link: "#fafafa";
|
|
490
|
-
readonly accentPressed: "#
|
|
491
|
-
readonly successPressed: "#
|
|
492
|
-
readonly warningPressed: "#
|
|
493
|
-
readonly dangerPressed: "#
|
|
521
|
+
readonly accentPressed: "#c691fd";
|
|
522
|
+
readonly successPressed: "#64e18d";
|
|
523
|
+
readonly warningPressed: "#fc9d55";
|
|
524
|
+
readonly dangerPressed: "#fa807e";
|
|
494
525
|
readonly defaultPressed: "#2e2e31";
|
|
495
526
|
readonly surfacePressed: "#27272a";
|
|
496
527
|
readonly defaultSoft: "rgba(39, 39, 42, 0.5)";
|
|
@@ -502,9 +533,9 @@ declare const tokens: {
|
|
|
502
533
|
readonly successSoft: "rgba(74, 222, 128, 0.15)";
|
|
503
534
|
readonly successSoftForeground: "#8de8a6";
|
|
504
535
|
readonly successSoftPressed: "rgba(74, 222, 128, 0.2)";
|
|
505
|
-
readonly warningSoft: "rgba(251,
|
|
506
|
-
readonly warningSoftForeground: "#
|
|
507
|
-
readonly warningSoftPressed: "rgba(251,
|
|
536
|
+
readonly warningSoft: "rgba(251, 146, 60, 0.15)";
|
|
537
|
+
readonly warningSoftForeground: "#feb887";
|
|
538
|
+
readonly warningSoftPressed: "rgba(251, 146, 60, 0.2)";
|
|
508
539
|
readonly dangerSoft: "rgba(248, 113, 113, 0.15)";
|
|
509
540
|
readonly dangerSoftForeground: "#fc8f8c";
|
|
510
541
|
readonly dangerSoftPressed: "rgba(248, 113, 113, 0.2)";
|