@xaui/native 0.9.1-alpha.3 → 0.9.1-alpha.30
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-27ZRTZEE.js +293 -0
- package/dist/chunk-3FV4COTM.js +68 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4XPLPQLM.cjs +147 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5GO7MAVY.cjs +74 -0
- package/dist/chunk-5RQ7AZPN.cjs +455 -0
- package/dist/chunk-5Z4P6WHR.cjs +525 -0
- package/dist/chunk-6RVCGLKZ.js +661 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7SEZGVTY.js +62 -0
- package/dist/chunk-7XKQJQF2.cjs +70 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-A5OCK3C2.js +525 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BFMTUMTU.js +669 -0
- package/dist/chunk-BVJQ3UPZ.js +62 -0
- package/dist/chunk-DFME724B.js +147 -0
- package/dist/chunk-E2CWBQTV.js +119 -0
- package/dist/chunk-E4TS6632.cjs +314 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FMZQW35T.js +431 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G7K652GC.js +145 -0
- package/dist/chunk-GGW42MY4.js +20 -0
- package/dist/chunk-GI24YJPE.js +314 -0
- package/dist/chunk-GLGU2WFL.cjs +190 -0
- package/dist/chunk-GPVNCJ3Z.cjs +696 -0
- package/dist/chunk-GVQOD3VW.js +74 -0
- package/dist/chunk-KOC3KQIT.js +124 -0
- package/dist/chunk-KPWZLUES.cjs +124 -0
- package/dist/chunk-KWCHSIMI.cjs +293 -0
- package/dist/chunk-MC7SY2QH.cjs +20 -0
- package/dist/chunk-N527BTY4.cjs +366 -0
- package/dist/chunk-NBFWWQFW.cjs +346 -0
- package/dist/chunk-NYRXUGVL.js +104 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-OHEHPQLC.cjs} +72 -72
- package/dist/chunk-Q3WFY5N3.js +366 -0
- package/dist/chunk-QGN2BBJO.cjs +104 -0
- package/dist/chunk-TGZZ3RZU.cjs +86 -0
- package/dist/{chunk-2KXQATVL.js → chunk-TZG3DERP.js} +46 -46
- package/dist/chunk-UBQLKIZC.cjs +431 -0
- package/dist/chunk-URSKA2VR.js +190 -0
- package/dist/chunk-V4WDMM6Z.js +86 -0
- package/dist/chunk-VJEER76X.js +455 -0
- package/dist/chunk-VZBWYWEI.cjs +736 -0
- package/dist/chunk-WR7YLDVV.cjs +68 -0
- package/dist/chunk-X4HQ4H2V.js +701 -0
- package/dist/chunk-XFSW3ZNI.cjs +145 -0
- package/dist/chunk-XQFAUDR2.cjs +62 -0
- package/dist/chunk-YKL6XHM6.js +346 -0
- package/dist/chunk-ZP2E2H2G.cjs +119 -0
- package/dist/chunk-ZSLNGBDS.cjs +700 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -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/button/index.cjs +21 -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 +21 -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/input/index.cjs +25 -0
- package/dist/components/input/index.d.cts +205 -0
- package/dist/components/input/index.d.ts +205 -0
- package/dist/components/input/index.js +25 -0
- package/dist/components/input-group/index.cjs +27 -0
- package/dist/components/input-group/index.d.cts +270 -0
- package/dist/components/input-group/index.d.ts +270 -0
- package/dist/components/input-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/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/spinner/index.cjs +16 -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 +16 -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/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 +246 -4
- package/dist/index.d.cts +109 -4
- package/dist/index.d.ts +109 -4
- package/dist/index.js +266 -24
- package/dist/input.type-BUMDlzL9.d.cts +167 -0
- package/dist/input.type-D2qgi03E.d.ts +167 -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 +60 -3
- package/dist/system/index.d.cts +347 -181
- package/dist/system/index.d.ts +347 -181
- package/dist/system/index.js +71 -14
- package/dist/theme/index.cjs +4 -3
- package/dist/theme/index.d.cts +34 -23
- package/dist/theme/index.d.ts +34 -23
- package/dist/theme/index.js +3 -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 +174 -18
- package/dist/chunk-QAMNNTGM.js +0 -637
- package/dist/chunk-V63JO65F.cjs +0 -637
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Switch,
|
|
3
|
+
SwitchLabel,
|
|
4
|
+
SwitchRoot,
|
|
5
|
+
SwitchThumb,
|
|
6
|
+
SwitchTrack,
|
|
7
|
+
switchRecipe,
|
|
8
|
+
useSwitch
|
|
9
|
+
} from "../../chunk-6RVCGLKZ.js";
|
|
10
|
+
import "../../chunk-BFMTUMTU.js";
|
|
11
|
+
import "../../chunk-423RQBOX.js";
|
|
12
|
+
import "../../chunk-F6W3JQ7K.js";
|
|
13
|
+
import "../../chunk-EGLLDKN6.js";
|
|
14
|
+
import "../../chunk-4GTAZM2C.js";
|
|
15
|
+
import "../../chunk-A3EGFI6T.js";
|
|
16
|
+
import "../../chunk-E2CWBQTV.js";
|
|
17
|
+
import "../../chunk-URSKA2VR.js";
|
|
18
|
+
import "../../chunk-GGW42MY4.js";
|
|
19
|
+
export {
|
|
20
|
+
Switch,
|
|
21
|
+
SwitchLabel,
|
|
22
|
+
SwitchRoot,
|
|
23
|
+
SwitchThumb,
|
|
24
|
+
SwitchTrack,
|
|
25
|
+
switchRecipe,
|
|
26
|
+
useSwitch
|
|
27
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk5GO7MAVYcjs = require('../../chunk-5GO7MAVY.cjs');
|
|
5
|
+
require('../../chunk-5Z4P6WHR.cjs');
|
|
6
|
+
require('../../chunk-FNEUOBCV.cjs');
|
|
7
|
+
require('../../chunk-57SJ4LJF.cjs');
|
|
8
|
+
require('../../chunk-ZP2E2H2G.cjs');
|
|
9
|
+
require('../../chunk-GLGU2WFL.cjs');
|
|
10
|
+
require('../../chunk-MC7SY2QH.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.TextArea = _chunk5GO7MAVYcjs.TextArea; exports.useTextArea = _chunk5GO7MAVYcjs.useTextArea;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { I as InputFieldProps, a as InputProps } from '../../input.type-BUMDlzL9.cjs';
|
|
4
|
+
import * as react_native from 'react-native';
|
|
5
|
+
import { T as TextStyleProps } from '../../style-props.type-CfnoGEP7.cjs';
|
|
6
|
+
import '../../theme.type-C2gNHpEx.cjs';
|
|
7
|
+
|
|
8
|
+
type TextAreaOwnProps = {
|
|
9
|
+
/**
|
|
10
|
+
* How many lines tall the field starts. It is a **raw value**, not a token: it resolves
|
|
11
|
+
* outside the style cache from the line height the size chose, the same path `color`
|
|
12
|
+
* takes — which is what lets `rows={7}` exist without seven entries in the cache.
|
|
13
|
+
*
|
|
14
|
+
* @default 3
|
|
15
|
+
*/
|
|
16
|
+
rows?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The ceiling, in lines. Past it the field stops growing and scrolls; unset, it grows
|
|
19
|
+
* with the text for as long as the text goes on.
|
|
20
|
+
*/
|
|
21
|
+
maxRows?: number;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Everything the `Input` root understands, plus the two the shape of a multiline field
|
|
26
|
+
* needs. They sit on the **root** rather than on `TextArea.Field` for the reason `size`
|
|
27
|
+
* and `variant` do: the root is where the field's shape is decided, and the slot reads
|
|
28
|
+
* what it resolved.
|
|
29
|
+
*/
|
|
30
|
+
type TextAreaProps = Omit<InputProps, 'children'> & TextAreaOwnProps;
|
|
31
|
+
/**
|
|
32
|
+
* Everything `Input.Field` accepts except `multiline`, which this sets — it is the same
|
|
33
|
+
* `TextInput`, and the same props, with the three things several lines need.
|
|
34
|
+
*/
|
|
35
|
+
type TextAreaFieldProps = Omit<InputFieldProps, 'multiline'>;
|
|
36
|
+
/**
|
|
37
|
+
* The one thing the `Input`'s own context cannot carry, because `rows` is not the
|
|
38
|
+
* `Input`'s business: a single-line field has no use for it, and a prop that does nothing
|
|
39
|
+
* in the common case is a prop that reads as broken.
|
|
40
|
+
*/
|
|
41
|
+
type TextAreaContextValue = {
|
|
42
|
+
rows: number;
|
|
43
|
+
maxRows: number | undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
declare const useTextArea: () => TextAreaContextValue;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Three of the four slots **are** the `Input`'s, re-exported rather than wrapped.
|
|
50
|
+
*
|
|
51
|
+
* A wrapper would add three components to the tree to change a `displayName` string, and
|
|
52
|
+
* the string it would change is the one that tells you the truth: a `XAUI.Input.Label`
|
|
53
|
+
* showing up inside a `XAUI.TextArea.Root` is exactly what is happening. Only the field
|
|
54
|
+
* differs, and it is the only one written here.
|
|
55
|
+
*/
|
|
56
|
+
declare const TextArea: react.ForwardRefExoticComponent<Omit<InputProps, "children"> & {
|
|
57
|
+
rows?: number;
|
|
58
|
+
maxRows?: number;
|
|
59
|
+
children?: react.ReactNode;
|
|
60
|
+
} & react.RefAttributes<react_native.View>> & {
|
|
61
|
+
Label: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
62
|
+
children?: react.ReactNode;
|
|
63
|
+
} & react.RefAttributes<react_native.Text>>;
|
|
64
|
+
Field: react.ForwardRefExoticComponent<TextAreaFieldProps & react.RefAttributes<react_native.TextInput>>;
|
|
65
|
+
Description: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
66
|
+
children?: react.ReactNode;
|
|
67
|
+
} & react.RefAttributes<react_native.Text>>;
|
|
68
|
+
Error: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
69
|
+
children?: react.ReactNode;
|
|
70
|
+
} & react.RefAttributes<react_native.Text>>;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { TextArea, type TextAreaContextValue, type TextAreaFieldProps, type TextAreaProps, useTextArea };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { I as InputFieldProps, a as InputProps } from '../../input.type-D2qgi03E.js';
|
|
4
|
+
import * as react_native from 'react-native';
|
|
5
|
+
import { T as TextStyleProps } from '../../style-props.type-CfnoGEP7.js';
|
|
6
|
+
import '../../theme.type-C2gNHpEx.js';
|
|
7
|
+
|
|
8
|
+
type TextAreaOwnProps = {
|
|
9
|
+
/**
|
|
10
|
+
* How many lines tall the field starts. It is a **raw value**, not a token: it resolves
|
|
11
|
+
* outside the style cache from the line height the size chose, the same path `color`
|
|
12
|
+
* takes — which is what lets `rows={7}` exist without seven entries in the cache.
|
|
13
|
+
*
|
|
14
|
+
* @default 3
|
|
15
|
+
*/
|
|
16
|
+
rows?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The ceiling, in lines. Past it the field stops growing and scrolls; unset, it grows
|
|
19
|
+
* with the text for as long as the text goes on.
|
|
20
|
+
*/
|
|
21
|
+
maxRows?: number;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Everything the `Input` root understands, plus the two the shape of a multiline field
|
|
26
|
+
* needs. They sit on the **root** rather than on `TextArea.Field` for the reason `size`
|
|
27
|
+
* and `variant` do: the root is where the field's shape is decided, and the slot reads
|
|
28
|
+
* what it resolved.
|
|
29
|
+
*/
|
|
30
|
+
type TextAreaProps = Omit<InputProps, 'children'> & TextAreaOwnProps;
|
|
31
|
+
/**
|
|
32
|
+
* Everything `Input.Field` accepts except `multiline`, which this sets — it is the same
|
|
33
|
+
* `TextInput`, and the same props, with the three things several lines need.
|
|
34
|
+
*/
|
|
35
|
+
type TextAreaFieldProps = Omit<InputFieldProps, 'multiline'>;
|
|
36
|
+
/**
|
|
37
|
+
* The one thing the `Input`'s own context cannot carry, because `rows` is not the
|
|
38
|
+
* `Input`'s business: a single-line field has no use for it, and a prop that does nothing
|
|
39
|
+
* in the common case is a prop that reads as broken.
|
|
40
|
+
*/
|
|
41
|
+
type TextAreaContextValue = {
|
|
42
|
+
rows: number;
|
|
43
|
+
maxRows: number | undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
declare const useTextArea: () => TextAreaContextValue;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Three of the four slots **are** the `Input`'s, re-exported rather than wrapped.
|
|
50
|
+
*
|
|
51
|
+
* A wrapper would add three components to the tree to change a `displayName` string, and
|
|
52
|
+
* the string it would change is the one that tells you the truth: a `XAUI.Input.Label`
|
|
53
|
+
* showing up inside a `XAUI.TextArea.Root` is exactly what is happening. Only the field
|
|
54
|
+
* differs, and it is the only one written here.
|
|
55
|
+
*/
|
|
56
|
+
declare const TextArea: react.ForwardRefExoticComponent<Omit<InputProps, "children"> & {
|
|
57
|
+
rows?: number;
|
|
58
|
+
maxRows?: number;
|
|
59
|
+
children?: react.ReactNode;
|
|
60
|
+
} & react.RefAttributes<react_native.View>> & {
|
|
61
|
+
Label: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
62
|
+
children?: react.ReactNode;
|
|
63
|
+
} & react.RefAttributes<react_native.Text>>;
|
|
64
|
+
Field: react.ForwardRefExoticComponent<TextAreaFieldProps & react.RefAttributes<react_native.TextInput>>;
|
|
65
|
+
Description: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
66
|
+
children?: react.ReactNode;
|
|
67
|
+
} & react.RefAttributes<react_native.Text>>;
|
|
68
|
+
Error: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
69
|
+
children?: react.ReactNode;
|
|
70
|
+
} & react.RefAttributes<react_native.Text>>;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { TextArea, type TextAreaContextValue, type TextAreaFieldProps, type TextAreaProps, useTextArea };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TextArea,
|
|
3
|
+
useTextArea
|
|
4
|
+
} from "../../chunk-GVQOD3VW.js";
|
|
5
|
+
import "../../chunk-A5OCK3C2.js";
|
|
6
|
+
import "../../chunk-4GTAZM2C.js";
|
|
7
|
+
import "../../chunk-A3EGFI6T.js";
|
|
8
|
+
import "../../chunk-E2CWBQTV.js";
|
|
9
|
+
import "../../chunk-URSKA2VR.js";
|
|
10
|
+
import "../../chunk-GGW42MY4.js";
|
|
11
|
+
export {
|
|
12
|
+
TextArea,
|
|
13
|
+
useTextArea
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkQGN2BBJOcjs = require('../../chunk-QGN2BBJO.cjs');
|
|
6
|
+
require('../../chunk-FNEUOBCV.cjs');
|
|
7
|
+
require('../../chunk-57SJ4LJF.cjs');
|
|
8
|
+
require('../../chunk-ZP2E2H2G.cjs');
|
|
9
|
+
require('../../chunk-GLGU2WFL.cjs');
|
|
10
|
+
require('../../chunk-MC7SY2QH.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.TextSpan = _chunkQGN2BBJOcjs.TextSpan; exports.Typography = _chunkQGN2BBJOcjs.Typography; exports.typographyRecipe = _chunkQGN2BBJOcjs.typographyRecipe;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_native from 'react-native';
|
|
4
|
+
import { TextProps, StyleProp, TextStyle, Text } from 'react-native';
|
|
5
|
+
import { T as TextStyleProps } from '../../style-props.type-CfnoGEP7.cjs';
|
|
6
|
+
import { R as Recipe } from '../../create-recipe-dC7wMfnj.cjs';
|
|
7
|
+
import { X as XAUITheme } from '../../theme.type-C2gNHpEx.cjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The ten roles, aligned with HeroUI Native's `text` — six headings, three body steps and
|
|
11
|
+
* inline code. Each one fixes **size, line height, weight and family together**, which is
|
|
12
|
+
* what removes the separate `size` and `weight` props the legacy component carried, and
|
|
13
|
+
* with them the illegal combinations they allowed: a heading in `weight="light"`, a
|
|
14
|
+
* caption in `lg`.
|
|
15
|
+
*
|
|
16
|
+
* `h1`–`h6` name a level, not an HTML tag — React Native has no document outline, so the
|
|
17
|
+
* number is the step on the scale and nothing more. Announcing a heading to a screen
|
|
18
|
+
* reader stays explicit: `accessibilityRole="header"`.
|
|
19
|
+
*/
|
|
20
|
+
type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body' | 'body-sm' | 'body-xs' | 'code';
|
|
21
|
+
type TypographySlot = 'root';
|
|
22
|
+
type TypographyOwnProps = {
|
|
23
|
+
/** The role. It fixes size, line height, weight and family at once. */
|
|
24
|
+
variant?: TypographyVariant;
|
|
25
|
+
/**
|
|
26
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). In a text component there is only one
|
|
27
|
+
* thing to tint, so it lands on the text itself.
|
|
28
|
+
*/
|
|
29
|
+
color?: string;
|
|
30
|
+
/** R12 — the child element becomes the text node, keeping this variant's style. */
|
|
31
|
+
asChild?: boolean;
|
|
32
|
+
style?: StyleProp<TextStyle>;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* R14 — the role's own vocabulary, then every `TextStyle` key it does not already claim.
|
|
37
|
+
* `color` is the component's, so it keeps its R7 meaning here rather than becoming the
|
|
38
|
+
* style key of the same name; `fontSize` and `fontWeight` stay available, which is how a
|
|
39
|
+
* one-off deviation is written without inventing a prop for it.
|
|
40
|
+
*/
|
|
41
|
+
type TypographyProps = Omit<TextProps, 'style'> & TypographyOwnProps & Omit<TextStyleProps, keyof TypographyOwnProps | keyof TextProps>;
|
|
42
|
+
type TextSpanOwnProps = {
|
|
43
|
+
/** R12 — the child element becomes the span. */
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
style?: StyleProp<TextStyle>;
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
};
|
|
48
|
+
type TextSpanProps = Omit<TextProps, 'style'> & TextSpanOwnProps & Omit<TextStyleProps, keyof TextSpanOwnProps | keyof TextProps>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Text, by the role it plays.
|
|
52
|
+
*
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <Typography variant="heading-lg">Projets</Typography>
|
|
55
|
+
* <Typography>Trois en cours, un archivé.</Typography>
|
|
56
|
+
* <Typography variant="caption">Mis à jour il y a deux minutes</Typography>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* **One node, and no slots.** A paragraph is a `Text`; there is nothing inside it for the
|
|
60
|
+
* component to publish. Styling a fragment of it is `TextSpan`'s job, not a slot of this
|
|
61
|
+
* one — React Native already makes a nested `Text` inherit from its parent, so a span
|
|
62
|
+
* needs no context, no resolved style and nothing from here. This component would only be
|
|
63
|
+
* duplicating a mechanism the platform ships.
|
|
64
|
+
*
|
|
65
|
+
* **The role fixes size, line height, weight and family together**, which is why there is
|
|
66
|
+
* no `size` and no `weight` prop: those axes are not free to combine. A one-off deviation
|
|
67
|
+
* is a style prop — `fontSize={17}` — said plainly rather than dressed as vocabulary.
|
|
68
|
+
*
|
|
69
|
+
* Alignment likewise has no prop of its own: `textAlign` is a `TextStyle` key, so R14
|
|
70
|
+
* already exposes it, and the caller writes the value React Native understands instead of
|
|
71
|
+
* a translation layer this component would have to keep honest.
|
|
72
|
+
*/
|
|
73
|
+
declare const Typography: react.ForwardRefExoticComponent<Omit<react_native.TextProps, "style"> & {
|
|
74
|
+
variant?: TypographyVariant;
|
|
75
|
+
color?: string;
|
|
76
|
+
asChild?: boolean;
|
|
77
|
+
style?: react_native.StyleProp<react_native.TextStyle>;
|
|
78
|
+
children?: react.ReactNode;
|
|
79
|
+
} & Omit<TextStyleProps, "color" | "pointerEvents" | "disabled" | "style" | "children" | "id" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "pressRetentionOffset" | "asChild" | "variant" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onTextLayout" | "maxFontSizeMultiplier" | "minimumFontScale" | "adjustsFontSizeToFit" | "dynamicTypeRamp" | "suppressHighlighting" | "lineBreakStrategyIOS" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency"> & react.RefAttributes<Text>>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A fragment of text, styled apart from the text around it.
|
|
83
|
+
*
|
|
84
|
+
* ```tsx
|
|
85
|
+
* <Typography>
|
|
86
|
+
* Supprimer <TextSpan fontWeight="600">trois projets</TextSpan> définitivement.
|
|
87
|
+
* </Typography>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* **It is a bare React Native `Text`, and that is the whole design.** Nesting a `Text`
|
|
91
|
+
* inside a `Text` already inherits the parent's font, size, weight and colour on both
|
|
92
|
+
* platforms — so a span needs no context to read, no role to resolve and no provider
|
|
93
|
+
* above it. The legacy component published a `TextSpanContext` to carry that inheritance
|
|
94
|
+
* by hand; it was reimplementing the platform, and it is gone.
|
|
95
|
+
*
|
|
96
|
+
* What is left is R14 and nothing else: every `TextStyle` key as a prop, and `style` after
|
|
97
|
+
* them. There is no `variant` here on purpose — a span that names a role would be a
|
|
98
|
+
* `Typography`, and nesting one of those is how you change role mid-sentence.
|
|
99
|
+
*/
|
|
100
|
+
declare const TextSpan: react.ForwardRefExoticComponent<Omit<react_native.TextProps, "style"> & {
|
|
101
|
+
asChild?: boolean;
|
|
102
|
+
style?: react_native.StyleProp<react_native.TextStyle>;
|
|
103
|
+
children?: react.ReactNode;
|
|
104
|
+
} & Omit<TextStyleProps, "pointerEvents" | "disabled" | "style" | "children" | "id" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "pressRetentionOffset" | "asChild" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onTextLayout" | "maxFontSizeMultiplier" | "minimumFontScale" | "adjustsFontSizeToFit" | "dynamicTypeRamp" | "suppressHighlighting" | "lineBreakStrategyIOS" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency"> & react.RefAttributes<Text>>;
|
|
105
|
+
|
|
106
|
+
/** Every role produces the same one slot, so the recipe's style functions share a shape. */
|
|
107
|
+
type StyleFn = (theme: XAUITheme) => Record<TypographySlot, TextStyle>;
|
|
108
|
+
/**
|
|
109
|
+
* There is no `base`. A text node's defaults are React Native's own, and restating them
|
|
110
|
+
* here would only give them a second place to drift from.
|
|
111
|
+
*/
|
|
112
|
+
declare const typographyRecipe: Recipe<"root", TypographyVariant, {
|
|
113
|
+
readonly variant: Record<TypographyVariant, StyleFn>;
|
|
114
|
+
}>;
|
|
115
|
+
|
|
116
|
+
export { TextSpan, type TextSpanProps, Typography, type TypographyProps, type TypographySlot, type TypographyVariant, typographyRecipe };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_native from 'react-native';
|
|
4
|
+
import { TextProps, StyleProp, TextStyle, Text } from 'react-native';
|
|
5
|
+
import { T as TextStyleProps } from '../../style-props.type-CfnoGEP7.js';
|
|
6
|
+
import { R as Recipe } from '../../create-recipe-BdVd2ffi.js';
|
|
7
|
+
import { X as XAUITheme } from '../../theme.type-C2gNHpEx.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The ten roles, aligned with HeroUI Native's `text` — six headings, three body steps and
|
|
11
|
+
* inline code. Each one fixes **size, line height, weight and family together**, which is
|
|
12
|
+
* what removes the separate `size` and `weight` props the legacy component carried, and
|
|
13
|
+
* with them the illegal combinations they allowed: a heading in `weight="light"`, a
|
|
14
|
+
* caption in `lg`.
|
|
15
|
+
*
|
|
16
|
+
* `h1`–`h6` name a level, not an HTML tag — React Native has no document outline, so the
|
|
17
|
+
* number is the step on the scale and nothing more. Announcing a heading to a screen
|
|
18
|
+
* reader stays explicit: `accessibilityRole="header"`.
|
|
19
|
+
*/
|
|
20
|
+
type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body' | 'body-sm' | 'body-xs' | 'code';
|
|
21
|
+
type TypographySlot = 'root';
|
|
22
|
+
type TypographyOwnProps = {
|
|
23
|
+
/** The role. It fixes size, line height, weight and family at once. */
|
|
24
|
+
variant?: TypographyVariant;
|
|
25
|
+
/**
|
|
26
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). In a text component there is only one
|
|
27
|
+
* thing to tint, so it lands on the text itself.
|
|
28
|
+
*/
|
|
29
|
+
color?: string;
|
|
30
|
+
/** R12 — the child element becomes the text node, keeping this variant's style. */
|
|
31
|
+
asChild?: boolean;
|
|
32
|
+
style?: StyleProp<TextStyle>;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* R14 — the role's own vocabulary, then every `TextStyle` key it does not already claim.
|
|
37
|
+
* `color` is the component's, so it keeps its R7 meaning here rather than becoming the
|
|
38
|
+
* style key of the same name; `fontSize` and `fontWeight` stay available, which is how a
|
|
39
|
+
* one-off deviation is written without inventing a prop for it.
|
|
40
|
+
*/
|
|
41
|
+
type TypographyProps = Omit<TextProps, 'style'> & TypographyOwnProps & Omit<TextStyleProps, keyof TypographyOwnProps | keyof TextProps>;
|
|
42
|
+
type TextSpanOwnProps = {
|
|
43
|
+
/** R12 — the child element becomes the span. */
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
style?: StyleProp<TextStyle>;
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
};
|
|
48
|
+
type TextSpanProps = Omit<TextProps, 'style'> & TextSpanOwnProps & Omit<TextStyleProps, keyof TextSpanOwnProps | keyof TextProps>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Text, by the role it plays.
|
|
52
|
+
*
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <Typography variant="heading-lg">Projets</Typography>
|
|
55
|
+
* <Typography>Trois en cours, un archivé.</Typography>
|
|
56
|
+
* <Typography variant="caption">Mis à jour il y a deux minutes</Typography>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* **One node, and no slots.** A paragraph is a `Text`; there is nothing inside it for the
|
|
60
|
+
* component to publish. Styling a fragment of it is `TextSpan`'s job, not a slot of this
|
|
61
|
+
* one — React Native already makes a nested `Text` inherit from its parent, so a span
|
|
62
|
+
* needs no context, no resolved style and nothing from here. This component would only be
|
|
63
|
+
* duplicating a mechanism the platform ships.
|
|
64
|
+
*
|
|
65
|
+
* **The role fixes size, line height, weight and family together**, which is why there is
|
|
66
|
+
* no `size` and no `weight` prop: those axes are not free to combine. A one-off deviation
|
|
67
|
+
* is a style prop — `fontSize={17}` — said plainly rather than dressed as vocabulary.
|
|
68
|
+
*
|
|
69
|
+
* Alignment likewise has no prop of its own: `textAlign` is a `TextStyle` key, so R14
|
|
70
|
+
* already exposes it, and the caller writes the value React Native understands instead of
|
|
71
|
+
* a translation layer this component would have to keep honest.
|
|
72
|
+
*/
|
|
73
|
+
declare const Typography: react.ForwardRefExoticComponent<Omit<react_native.TextProps, "style"> & {
|
|
74
|
+
variant?: TypographyVariant;
|
|
75
|
+
color?: string;
|
|
76
|
+
asChild?: boolean;
|
|
77
|
+
style?: react_native.StyleProp<react_native.TextStyle>;
|
|
78
|
+
children?: react.ReactNode;
|
|
79
|
+
} & Omit<TextStyleProps, "color" | "pointerEvents" | "disabled" | "style" | "children" | "id" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "pressRetentionOffset" | "asChild" | "variant" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onTextLayout" | "maxFontSizeMultiplier" | "minimumFontScale" | "adjustsFontSizeToFit" | "dynamicTypeRamp" | "suppressHighlighting" | "lineBreakStrategyIOS" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency"> & react.RefAttributes<Text>>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A fragment of text, styled apart from the text around it.
|
|
83
|
+
*
|
|
84
|
+
* ```tsx
|
|
85
|
+
* <Typography>
|
|
86
|
+
* Supprimer <TextSpan fontWeight="600">trois projets</TextSpan> définitivement.
|
|
87
|
+
* </Typography>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* **It is a bare React Native `Text`, and that is the whole design.** Nesting a `Text`
|
|
91
|
+
* inside a `Text` already inherits the parent's font, size, weight and colour on both
|
|
92
|
+
* platforms — so a span needs no context to read, no role to resolve and no provider
|
|
93
|
+
* above it. The legacy component published a `TextSpanContext` to carry that inheritance
|
|
94
|
+
* by hand; it was reimplementing the platform, and it is gone.
|
|
95
|
+
*
|
|
96
|
+
* What is left is R14 and nothing else: every `TextStyle` key as a prop, and `style` after
|
|
97
|
+
* them. There is no `variant` here on purpose — a span that names a role would be a
|
|
98
|
+
* `Typography`, and nesting one of those is how you change role mid-sentence.
|
|
99
|
+
*/
|
|
100
|
+
declare const TextSpan: react.ForwardRefExoticComponent<Omit<react_native.TextProps, "style"> & {
|
|
101
|
+
asChild?: boolean;
|
|
102
|
+
style?: react_native.StyleProp<react_native.TextStyle>;
|
|
103
|
+
children?: react.ReactNode;
|
|
104
|
+
} & Omit<TextStyleProps, "pointerEvents" | "disabled" | "style" | "children" | "id" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "pressRetentionOffset" | "asChild" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onTextLayout" | "maxFontSizeMultiplier" | "minimumFontScale" | "adjustsFontSizeToFit" | "dynamicTypeRamp" | "suppressHighlighting" | "lineBreakStrategyIOS" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency"> & react.RefAttributes<Text>>;
|
|
105
|
+
|
|
106
|
+
/** Every role produces the same one slot, so the recipe's style functions share a shape. */
|
|
107
|
+
type StyleFn = (theme: XAUITheme) => Record<TypographySlot, TextStyle>;
|
|
108
|
+
/**
|
|
109
|
+
* There is no `base`. A text node's defaults are React Native's own, and restating them
|
|
110
|
+
* here would only give them a second place to drift from.
|
|
111
|
+
*/
|
|
112
|
+
declare const typographyRecipe: Recipe<"root", TypographyVariant, {
|
|
113
|
+
readonly variant: Record<TypographyVariant, StyleFn>;
|
|
114
|
+
}>;
|
|
115
|
+
|
|
116
|
+
export { TextSpan, type TextSpanProps, Typography, type TypographyProps, type TypographySlot, type TypographyVariant, typographyRecipe };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TextSpan,
|
|
3
|
+
Typography,
|
|
4
|
+
typographyRecipe
|
|
5
|
+
} from "../../chunk-NYRXUGVL.js";
|
|
6
|
+
import "../../chunk-4GTAZM2C.js";
|
|
7
|
+
import "../../chunk-A3EGFI6T.js";
|
|
8
|
+
import "../../chunk-E2CWBQTV.js";
|
|
9
|
+
import "../../chunk-URSKA2VR.js";
|
|
10
|
+
import "../../chunk-GGW42MY4.js";
|
|
11
|
+
export {
|
|
12
|
+
TextSpan,
|
|
13
|
+
Typography,
|
|
14
|
+
typographyRecipe
|
|
15
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkXFSW3ZNIcjs = require('../../chunk-XFSW3ZNI.cjs');
|
|
8
|
+
require('../../chunk-ZP2E2H2G.cjs');
|
|
9
|
+
require('../../chunk-GLGU2WFL.cjs');
|
|
10
|
+
require('../../chunk-MC7SY2QH.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
exports.Column = _chunkXFSW3ZNIcjs.Column; exports.Grid = _chunkXFSW3ZNIcjs.Grid; exports.Row = _chunkXFSW3ZNIcjs.Row; exports.Stack = _chunkXFSW3ZNIcjs.Stack; exports.useGrid = _chunkXFSW3ZNIcjs.useGrid;
|