@oxy.so/bloom 7.24.2 → 7.26.1
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/README.md +9 -3
- package/docs/adoption-matrix.mdx +4 -4
- package/docs/overlay.mdx +5 -0
- package/docs/radio.mdx +32 -0
- package/docs/theme.mdx +65 -12
- package/lib/commonjs/ai-chat/AiChatShell.js +2 -0
- package/lib/commonjs/ai-chat/AiChatShell.js.map +1 -1
- package/lib/commonjs/ai-chat/use-panel-interaction.js +6 -1
- package/lib/commonjs/ai-chat/use-panel-interaction.js.map +1 -1
- package/lib/commonjs/overlay/modal-keyboard.js +10 -2
- package/lib/commonjs/overlay/modal-keyboard.js.map +1 -1
- package/lib/commonjs/radio/Radio.js +63 -16
- package/lib/commonjs/radio/Radio.js.map +1 -1
- package/lib/commonjs/radio/RadioCard.js +14 -5
- package/lib/commonjs/radio/RadioCard.js.map +1 -1
- package/lib/commonjs/radio/RadioChip.js +169 -0
- package/lib/commonjs/radio/RadioChip.js.map +1 -0
- package/lib/commonjs/radio/RadioHost.js +153 -0
- package/lib/commonjs/radio/RadioHost.js.map +1 -0
- package/lib/commonjs/radio/index.js +7 -0
- package/lib/commonjs/radio/index.js.map +1 -1
- package/lib/module/ai-chat/AiChatShell.js +2 -0
- package/lib/module/ai-chat/AiChatShell.js.map +1 -1
- package/lib/module/ai-chat/use-panel-interaction.js +6 -1
- package/lib/module/ai-chat/use-panel-interaction.js.map +1 -1
- package/lib/module/overlay/modal-keyboard.js +10 -2
- package/lib/module/overlay/modal-keyboard.js.map +1 -1
- package/lib/module/radio/Radio.js +65 -18
- package/lib/module/radio/Radio.js.map +1 -1
- package/lib/module/radio/RadioCard.js +15 -6
- package/lib/module/radio/RadioCard.js.map +1 -1
- package/lib/module/radio/RadioChip.js +164 -0
- package/lib/module/radio/RadioChip.js.map +1 -0
- package/lib/module/radio/RadioHost.js +147 -0
- package/lib/module/radio/RadioHost.js.map +1 -0
- package/lib/module/radio/index.js +1 -0
- package/lib/module/radio/index.js.map +1 -1
- package/lib/typescript/commonjs/ai-chat/AiChatShell.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/use-panel-interaction.d.ts.map +1 -1
- package/lib/typescript/commonjs/overlay/modal-keyboard.d.ts +2 -1
- package/lib/typescript/commonjs/overlay/modal-keyboard.d.ts.map +1 -1
- package/lib/typescript/commonjs/radio/Radio.d.ts +1 -1
- package/lib/typescript/commonjs/radio/Radio.d.ts.map +1 -1
- package/lib/typescript/commonjs/radio/RadioCard.d.ts +1 -1
- package/lib/typescript/commonjs/radio/RadioCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/radio/RadioChip.d.ts +5 -0
- package/lib/typescript/commonjs/radio/RadioChip.d.ts.map +1 -0
- package/lib/typescript/commonjs/radio/RadioHost.d.ts +59 -0
- package/lib/typescript/commonjs/radio/RadioHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/radio/index.d.ts +2 -1
- package/lib/typescript/commonjs/radio/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/radio/types.d.ts +22 -4
- package/lib/typescript/commonjs/radio/types.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/AiChatShell.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/use-panel-interaction.d.ts.map +1 -1
- package/lib/typescript/module/overlay/modal-keyboard.d.ts +2 -1
- package/lib/typescript/module/overlay/modal-keyboard.d.ts.map +1 -1
- package/lib/typescript/module/radio/Radio.d.ts +1 -1
- package/lib/typescript/module/radio/Radio.d.ts.map +1 -1
- package/lib/typescript/module/radio/RadioCard.d.ts +1 -1
- package/lib/typescript/module/radio/RadioCard.d.ts.map +1 -1
- package/lib/typescript/module/radio/RadioChip.d.ts +5 -0
- package/lib/typescript/module/radio/RadioChip.d.ts.map +1 -0
- package/lib/typescript/module/radio/RadioHost.d.ts +59 -0
- package/lib/typescript/module/radio/RadioHost.d.ts.map +1 -0
- package/lib/typescript/module/radio/index.d.ts +2 -1
- package/lib/typescript/module/radio/index.d.ts.map +1 -1
- package/lib/typescript/module/radio/types.d.ts +22 -4
- package/lib/typescript/module/radio/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ai-chat/AiChatShell.tsx +2 -0
- package/src/ai-chat/use-panel-interaction.ts +5 -1
- package/src/overlay/modal-keyboard.ts +8 -2
- package/src/radio/Radio.tsx +45 -15
- package/src/radio/RadioCard.tsx +11 -6
- package/src/radio/RadioChip.tsx +84 -0
- package/src/radio/RadioHost.tsx +94 -0
- package/src/radio/index.ts +2 -1
- package/src/radio/types.ts +23 -4
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { type KeyboardEvent, type ReactNode } from 'react';
|
|
2
|
+
import { type View, type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
|
|
3
|
+
import { type TypeScaleVariant } from '../typography/scale';
|
|
4
|
+
interface HostProps {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
accessibilityRole?: 'radio';
|
|
10
|
+
accessibilityLabel?: string;
|
|
11
|
+
accessibilityHint?: string;
|
|
12
|
+
nativeID?: string;
|
|
13
|
+
testID?: string;
|
|
14
|
+
hitSlop?: number | {
|
|
15
|
+
top: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
left: number;
|
|
18
|
+
right: number;
|
|
19
|
+
};
|
|
20
|
+
dataSet?: Record<string, string>;
|
|
21
|
+
'aria-checked'?: boolean;
|
|
22
|
+
'aria-disabled'?: boolean;
|
|
23
|
+
'aria-invalid'?: boolean;
|
|
24
|
+
'aria-describedby'?: string;
|
|
25
|
+
tabIndex?: 0 | -1;
|
|
26
|
+
onPress: () => void;
|
|
27
|
+
onPressIn?: () => void;
|
|
28
|
+
onPressOut?: () => void;
|
|
29
|
+
onHoverIn?: () => void;
|
|
30
|
+
onHoverOut?: () => void;
|
|
31
|
+
onBlur?: () => void;
|
|
32
|
+
onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
33
|
+
onKeyUp?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const RadioHost: React.ForwardRefExoticComponent<HostProps & React.RefAttributes<View>>;
|
|
36
|
+
interface LayoutProps {
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
className?: string;
|
|
39
|
+
style?: StyleProp<ViewStyle>;
|
|
40
|
+
dir?: 'rtl';
|
|
41
|
+
accessibilityRole?: 'radiogroup';
|
|
42
|
+
accessibilityLabel?: string;
|
|
43
|
+
testID?: string;
|
|
44
|
+
'aria-label'?: string;
|
|
45
|
+
'aria-describedby'?: string;
|
|
46
|
+
'aria-invalid'?: boolean;
|
|
47
|
+
'aria-disabled'?: boolean;
|
|
48
|
+
'aria-required'?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare function RadioGroupHost(props: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare function RadioLabel({ className, style, variant, children, numberOfLines }: {
|
|
52
|
+
className?: string;
|
|
53
|
+
style?: StyleProp<TextStyle>;
|
|
54
|
+
variant: TypeScaleVariant;
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
numberOfLines?: number;
|
|
57
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=RadioHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioHost.d.ts","sourceRoot":"","sources":["../../../../src/radio/RadioHost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAY,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKnG,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,C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AAC;CACvD;AACD,eAAO,MAAM,SAAS,wEA6BpB,CAAC;AAEH,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IACpF,iBAAiB,CAAC,EAAE,YAAY,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC7E,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACtD;AACD,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,2CAMhD;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CAC3H,2CAIA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Radio, RadioGroup } from './Radio';
|
|
2
|
+
export { RadioChip } from './RadioChip';
|
|
2
3
|
export { RadioCard } from './RadioCard';
|
|
3
|
-
export type { RadioProps, RadioGroupProps, RadioOption, RadioOptionState, RadioSize, RadioCardProps } from './types';
|
|
4
|
+
export type { RadioProps, RadioGroupProps, RadioOption, RadioOptionState, RadioSize, RadioCardProps, RadioChipProps } from './types';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/radio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/radio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode, ReactElement, RefObject } from 'react';
|
|
2
|
-
import type { BloomSize } from '../appearance';
|
|
2
|
+
import type { BloomAppearance, BloomSize } from '../appearance';
|
|
3
3
|
import type { BloomTone } from '../appearance';
|
|
4
4
|
import type { StyleProp, ViewStyle, TextStyle, View } from 'react-native';
|
|
5
5
|
export type RadioSize = BloomSize;
|
|
@@ -31,6 +31,8 @@ export interface RadioProps<Value extends string = string> {
|
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
/** Colour of the checked indicator. Uses the theme primary by default. */
|
|
33
33
|
tone?: BloomTone;
|
|
34
|
+
className?: string;
|
|
35
|
+
labelClassName?: string;
|
|
34
36
|
style?: StyleProp<ViewStyle>;
|
|
35
37
|
labelStyle?: StyleProp<TextStyle>;
|
|
36
38
|
accessibilityLabel?: string;
|
|
@@ -41,6 +43,11 @@ export interface RadioProps<Value extends string = string> {
|
|
|
41
43
|
nativeID?: string;
|
|
42
44
|
testID?: string;
|
|
43
45
|
}
|
|
46
|
+
/** A pill-shaped radio with no separate indicator. */
|
|
47
|
+
export interface RadioChipProps<Value extends string = string> extends RadioProps<Value> {
|
|
48
|
+
/** Paint of the selected option. Unselected chips retain a neutral outline. */
|
|
49
|
+
appearance?: BloomAppearance;
|
|
50
|
+
}
|
|
44
51
|
/** One option, as data, for {@link RadioGroupProps}. */
|
|
45
52
|
export interface RadioOption<Value extends string = string> {
|
|
46
53
|
value: Value;
|
|
@@ -86,14 +93,22 @@ export interface RadioGroupProps<Value extends string = string> {
|
|
|
86
93
|
tone?: BloomTone;
|
|
87
94
|
style?: StyleProp<ViewStyle>;
|
|
88
95
|
labelStyle?: StyleProp<TextStyle>;
|
|
89
|
-
/**
|
|
96
|
+
/** Class recipe on the group layout; replaces its default layout. */
|
|
97
|
+
className?: string;
|
|
98
|
+
/** Class recipes for owned options and their built-in string labels. */
|
|
99
|
+
optionClassName?: string | ((state: Readonly<RadioOptionState>) => string | undefined);
|
|
100
|
+
optionLabelClassName?: string | ((state: Readonly<RadioOptionState>) => string | undefined);
|
|
101
|
+
/** Selected chip paint; used with variant="chip". Defaults to outline. */
|
|
102
|
+
appearance?: BloomAppearance;
|
|
103
|
+
/** Layout/style on each owned Radio, RadioCard or RadioChip. */
|
|
90
104
|
optionStyle?: StyleProp<ViewStyle>;
|
|
91
105
|
/**
|
|
92
106
|
* `default` renders each option as a `Radio` row; `card` as a `RadioCard`
|
|
93
107
|
* (title + description left, the dot right, the whole
|
|
94
|
-
* card selectable).
|
|
108
|
+
* card selectable). `chip` renders a wrapping row of pill-shaped radios
|
|
109
|
+
* without an indicator. A card's title is the option's `label`.
|
|
95
110
|
*/
|
|
96
|
-
variant?: 'default' | 'card';
|
|
111
|
+
variant?: 'default' | 'card' | 'chip';
|
|
97
112
|
testID?: string;
|
|
98
113
|
}
|
|
99
114
|
export interface RadioCardProps<Value extends string = string> {
|
|
@@ -113,6 +128,9 @@ export interface RadioCardProps<Value extends string = string> {
|
|
|
113
128
|
disabled?: boolean;
|
|
114
129
|
/** Accent for the checked dot. Uses the theme primary by default. */
|
|
115
130
|
tone?: BloomTone;
|
|
131
|
+
className?: string;
|
|
132
|
+
labelClassName?: string;
|
|
133
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
116
134
|
style?: StyleProp<ViewStyle>;
|
|
117
135
|
accessibilityLabel?: string;
|
|
118
136
|
testID?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/radio/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/radio/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,WAAW,UAAU,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM;IACvD,wCAAwC;IACxC,KAAK,EAAE,KAAK,CAAC;IACb,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;8EAC0E;IAC1E,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,2BAA2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ACH,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,uBAAuB,kDAoCnF;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,YAAY,EACZ,gBAAwB,EACxB,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,KAAK,EACL,UAAU,EAAE,cAAc,EAC1B,SAAuB,EACvB,iBAAuB,EACvB,aAAmB,EACnB,aAAmB,EACnB,OAAO,EAAE,WAAW,EACpB,eAAe,EACf,eAAsB,EACtB,SAAS,EAAE,aAAa,EACxB,iBAAiB,EACjB,UAAU,EACV,OAAc,EACd,QAAgB,EAChB,MAAoB,EACpB,MAAM,EACN,KAAK,EACL,MAAM,GACP,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"AiChatShell.d.ts","sourceRoot":"","sources":["../../../../src/ai-chat/AiChatShell.tsx"],"names":[],"mappings":"AAGA,OAAO,EAML,KAAK,qBAAqB,EAG3B,MAAM,cAAc,CAAC;AAiCtB,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAwDzE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,uBAAuB,kDAoCnF;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,YAAY,EACZ,gBAAwB,EACxB,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,KAAK,EACL,UAAU,EAAE,cAAc,EAC1B,SAAuB,EACvB,iBAAuB,EACvB,aAAmB,EACnB,aAAmB,EACnB,OAAO,EAAE,WAAW,EACpB,eAAe,EACf,eAAsB,EACtB,SAAS,EAAE,aAAa,EACxB,iBAAiB,EACjB,UAAU,EACV,OAAc,EACd,QAAgB,EAChB,MAAoB,EACpB,MAAM,EACN,KAAK,EACL,MAAM,GACP,EAAE,gBAAgB,2CAmclB;AAED,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-panel-interaction.d.ts","sourceRoot":"","sources":["../../../../src/ai-chat/use-panel-interaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAK1E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"use-panel-interaction.d.ts","sourceRoot":"","sources":["../../../../src/ai-chat/use-panel-interaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAK1E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,0CA6CnF"}
|
|
@@ -5,7 +5,8 @@ export declare function initialFocusWithin(node: HTMLElement): HTMLElement;
|
|
|
5
5
|
/**
|
|
6
6
|
* Keep Tab inside `node`: from the last tabbable (or from outside) forward to
|
|
7
7
|
* the first, from the first (or from outside) backward to the last. Returns
|
|
8
|
-
* whether it moved focus.
|
|
8
|
+
* whether it moved focus. With no available controls, the focusable panel is
|
|
9
|
+
* the fallback until its actions become available again.
|
|
9
10
|
*/
|
|
10
11
|
export declare function wrapTab(event: KeyboardEvent, node: HTMLElement | null): boolean;
|
|
11
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-keyboard.d.ts","sourceRoot":"","sources":["../../../../src/overlay/modal-keyboard.ts"],"names":[],"mappings":"AAiDA,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,WAAW,EAAE,CASvE;AAED,0GAA0G;AAC1G,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAMjE;AAED
|
|
1
|
+
{"version":3,"file":"modal-keyboard.d.ts","sourceRoot":"","sources":["../../../../src/overlay/modal-keyboard.ts"],"names":[],"mappings":"AAiDA,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,WAAW,EAAE,CASvE;AAED,0GAA0G;AAC1G,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAMjE;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAkB/E;AAYD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAkCrF;AAED,qEAAqE;AACrE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,MAAM,IAAI,CA2BpG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RadioGroupProps, RadioProps } from './types';
|
|
2
|
-
declare const RadioComponent: <Value extends string = string>({ value, checked: checkedProp, onValueChange, label, labelContent, description, size: sizeProp, disabled, tone: toneProp, style, labelStyle, accessibilityLabel, nativeID, testID, }: RadioProps<Value>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const RadioComponent: <Value extends string = string>({ value, checked: checkedProp, onValueChange, label, labelContent, description, size: sizeProp, disabled, tone: toneProp, style, labelStyle, className, labelClassName, accessibilityLabel, nativeID, testID, }: RadioProps<Value>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const Radio: typeof RadioComponent;
|
|
4
4
|
/**
|
|
5
5
|
* A set of radios that own one value between them.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../src/radio/Radio.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../src/radio/Radio.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAwE3D,QAAA,MAAM,cAAc,GAAkB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,iNAiBlE,UAAU,CAAC,KAAK,CAAC,4CAmGnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAA2B,OAAO,cAAc,CAAC;AAEnE;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,GAAuB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,OAAO,eAAe,CAAC,KAAK,CAAC,4CA8I3G,CAAC;AAEF,eAAO,MAAM,UAAU,EAAgC,OAAO,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RadioCardProps } from './types';
|
|
2
|
-
declare const RadioCardComponent: <Value extends string = string>({ value, checked: checkedProp, onValueChange, title, labelContent, description, disabled: disabledProp, tone: toneProp, style, accessibilityLabel, testID, }: RadioCardProps<Value>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const RadioCardComponent: <Value extends string = string>({ value, checked: checkedProp, onValueChange, title, labelContent, description, disabled: disabledProp, tone: toneProp, style, className, labelClassName, labelStyle, accessibilityLabel, testID, }: RadioCardProps<Value>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const RadioCard: typeof RadioCardComponent;
|
|
4
4
|
export {};
|
|
5
5
|
//# sourceMappingURL=RadioCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCard.d.ts","sourceRoot":"","sources":["../../../../src/radio/RadioCard.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioCard.d.ts","sourceRoot":"","sources":["../../../../src/radio/RadioCard.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAiD9C,QAAA,MAAM,kBAAkB,GAAsB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,qMAe1E,cAAc,CAAC,KAAK,CAAC,4CAqGvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAA+B,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RadioChipProps } from './types';
|
|
2
|
+
declare function RadioChipComponent<Value extends string = string>({ value, checked, onValueChange, label, labelContent, description, accessibilityLabel, nativeID, disabled: disabledProp, size: sizeProp, tone: toneProp, appearance, className, labelClassName, style, labelStyle, testID, }: RadioChipProps<Value>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const RadioChip: typeof RadioChipComponent;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=RadioChip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioChip.d.ts","sourceRoot":"","sources":["../../../../src/radio/RadioChip.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AAUzD,iBAAS,kBAAkB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,EACzD,KAAK,EAAE,OAAe,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EACvE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAoB,EAAE,IAAI,EAAE,QAAQ,EAC5E,IAAI,EAAE,QAAQ,EAAE,UAAsB,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EACxE,UAAU,EAAE,MAAM,GACnB,EAAE,cAAc,CAAC,KAAK,CAAC,2CAmDvB;AAED,eAAO,MAAM,SAAS,EAA+B,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { type KeyboardEvent, type ReactNode } from 'react';
|
|
2
|
+
import { type View, type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
|
|
3
|
+
import { type TypeScaleVariant } from '../typography/scale';
|
|
4
|
+
interface HostProps {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
accessibilityRole?: 'radio';
|
|
10
|
+
accessibilityLabel?: string;
|
|
11
|
+
accessibilityHint?: string;
|
|
12
|
+
nativeID?: string;
|
|
13
|
+
testID?: string;
|
|
14
|
+
hitSlop?: number | {
|
|
15
|
+
top: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
left: number;
|
|
18
|
+
right: number;
|
|
19
|
+
};
|
|
20
|
+
dataSet?: Record<string, string>;
|
|
21
|
+
'aria-checked'?: boolean;
|
|
22
|
+
'aria-disabled'?: boolean;
|
|
23
|
+
'aria-invalid'?: boolean;
|
|
24
|
+
'aria-describedby'?: string;
|
|
25
|
+
tabIndex?: 0 | -1;
|
|
26
|
+
onPress: () => void;
|
|
27
|
+
onPressIn?: () => void;
|
|
28
|
+
onPressOut?: () => void;
|
|
29
|
+
onHoverIn?: () => void;
|
|
30
|
+
onHoverOut?: () => void;
|
|
31
|
+
onBlur?: () => void;
|
|
32
|
+
onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
33
|
+
onKeyUp?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const RadioHost: React.ForwardRefExoticComponent<HostProps & React.RefAttributes<View>>;
|
|
36
|
+
interface LayoutProps {
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
className?: string;
|
|
39
|
+
style?: StyleProp<ViewStyle>;
|
|
40
|
+
dir?: 'rtl';
|
|
41
|
+
accessibilityRole?: 'radiogroup';
|
|
42
|
+
accessibilityLabel?: string;
|
|
43
|
+
testID?: string;
|
|
44
|
+
'aria-label'?: string;
|
|
45
|
+
'aria-describedby'?: string;
|
|
46
|
+
'aria-invalid'?: boolean;
|
|
47
|
+
'aria-disabled'?: boolean;
|
|
48
|
+
'aria-required'?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare function RadioGroupHost(props: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare function RadioLabel({ className, style, variant, children, numberOfLines }: {
|
|
52
|
+
className?: string;
|
|
53
|
+
style?: StyleProp<TextStyle>;
|
|
54
|
+
variant: TypeScaleVariant;
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
numberOfLines?: number;
|
|
57
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=RadioHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioHost.d.ts","sourceRoot":"","sources":["../../../../src/radio/RadioHost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAY,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKnG,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAUxE,UAAU,SAAS;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QA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M,CAAC,EAAE,MAAM,CAAC;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC7E,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACtD;AACD,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,2CAMhD;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CAC3H,2CAIA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Radio, RadioGroup } from './Radio';
|
|
2
|
+
export { RadioChip } from './RadioChip';
|
|
2
3
|
export { RadioCard } from './RadioCard';
|
|
3
|
-
export type { RadioProps, RadioGroupProps, RadioOption, RadioOptionState, RadioSize, RadioCardProps } from './types';
|
|
4
|
+
export type { RadioProps, RadioGroupProps, RadioOption, RadioOptionState, RadioSize, RadioCardProps, RadioChipProps } from './types';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/radio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/radio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode, ReactElement, RefObject } from 'react';
|
|
2
|
-
import type { BloomSize } from '../appearance';
|
|
2
|
+
import type { BloomAppearance, BloomSize } from '../appearance';
|
|
3
3
|
import type { BloomTone } from '../appearance';
|
|
4
4
|
import type { StyleProp, ViewStyle, TextStyle, View } from 'react-native';
|
|
5
5
|
export type RadioSize = BloomSize;
|
|
@@ -31,6 +31,8 @@ export interface RadioProps<Value extends string = string> {
|
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
/** Colour of the checked indicator. Uses the theme primary by default. */
|
|
33
33
|
tone?: BloomTone;
|
|
34
|
+
className?: string;
|
|
35
|
+
labelClassName?: string;
|
|
34
36
|
style?: StyleProp<ViewStyle>;
|
|
35
37
|
labelStyle?: StyleProp<TextStyle>;
|
|
36
38
|
accessibilityLabel?: string;
|
|
@@ -41,6 +43,11 @@ export interface RadioProps<Value extends string = string> {
|
|
|
41
43
|
nativeID?: string;
|
|
42
44
|
testID?: string;
|
|
43
45
|
}
|
|
46
|
+
/** A pill-shaped radio with no separate indicator. */
|
|
47
|
+
export interface RadioChipProps<Value extends string = string> extends RadioProps<Value> {
|
|
48
|
+
/** Paint of the selected option. Unselected chips retain a neutral outline. */
|
|
49
|
+
appearance?: BloomAppearance;
|
|
50
|
+
}
|
|
44
51
|
/** One option, as data, for {@link RadioGroupProps}. */
|
|
45
52
|
export interface RadioOption<Value extends string = string> {
|
|
46
53
|
value: Value;
|
|
@@ -86,14 +93,22 @@ export interface RadioGroupProps<Value extends string = string> {
|
|
|
86
93
|
tone?: BloomTone;
|
|
87
94
|
style?: StyleProp<ViewStyle>;
|
|
88
95
|
labelStyle?: StyleProp<TextStyle>;
|
|
89
|
-
/**
|
|
96
|
+
/** Class recipe on the group layout; replaces its default layout. */
|
|
97
|
+
className?: string;
|
|
98
|
+
/** Class recipes for owned options and their built-in string labels. */
|
|
99
|
+
optionClassName?: string | ((state: Readonly<RadioOptionState>) => string | undefined);
|
|
100
|
+
optionLabelClassName?: string | ((state: Readonly<RadioOptionState>) => string | undefined);
|
|
101
|
+
/** Selected chip paint; used with variant="chip". Defaults to outline. */
|
|
102
|
+
appearance?: BloomAppearance;
|
|
103
|
+
/** Layout/style on each owned Radio, RadioCard or RadioChip. */
|
|
90
104
|
optionStyle?: StyleProp<ViewStyle>;
|
|
91
105
|
/**
|
|
92
106
|
* `default` renders each option as a `Radio` row; `card` as a `RadioCard`
|
|
93
107
|
* (title + description left, the dot right, the whole
|
|
94
|
-
* card selectable).
|
|
108
|
+
* card selectable). `chip` renders a wrapping row of pill-shaped radios
|
|
109
|
+
* without an indicator. A card's title is the option's `label`.
|
|
95
110
|
*/
|
|
96
|
-
variant?: 'default' | 'card';
|
|
111
|
+
variant?: 'default' | 'card' | 'chip';
|
|
97
112
|
testID?: string;
|
|
98
113
|
}
|
|
99
114
|
export interface RadioCardProps<Value extends string = string> {
|
|
@@ -113,6 +128,9 @@ export interface RadioCardProps<Value extends string = string> {
|
|
|
113
128
|
disabled?: boolean;
|
|
114
129
|
/** Accent for the checked dot. Uses the theme primary by default. */
|
|
115
130
|
tone?: BloomTone;
|
|
131
|
+
className?: string;
|
|
132
|
+
labelClassName?: string;
|
|
133
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
116
134
|
style?: StyleProp<ViewStyle>;
|
|
117
135
|
accessibilityLabel?: string;
|
|
118
136
|
testID?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/radio/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/radio/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,WAAW,UAAU,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM;IACvD,wCAAwC;IACxC,KAAK,EAAE,KAAK,CAAC;IACb,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;8EAC0E;IAC1E,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;wFACoF;IACpF,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,M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ACb,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -497,6 +497,7 @@ export function AiChatShell({
|
|
|
497
497
|
{!navInFlow && mobileSidebar ? (
|
|
498
498
|
<View
|
|
499
499
|
ref={navRef}
|
|
500
|
+
tabIndex={Platform.OS === 'web' ? -1 : undefined}
|
|
500
501
|
{...(navOpen ? null : CLOSED_LAYER)}
|
|
501
502
|
pointerEvents={navOpen ? 'box-none' : 'none'}
|
|
502
503
|
style={{ position: overlayPosition, top: 0, bottom: 0, left: safeInsets.left, zIndex: 10, width: 272, paddingTop: 12 + safeInsets.top, paddingBottom: 12 + safeInsets.bottom, paddingLeft: 6 }}>
|
|
@@ -606,6 +607,7 @@ export function AiChatShell({
|
|
|
606
607
|
<SurfaceLevelProvider level={backing.level} fill={palette.full}>
|
|
607
608
|
<Animated.View
|
|
608
609
|
ref={panelRef}
|
|
610
|
+
tabIndex={Platform.OS === 'web' ? -1 : undefined}
|
|
609
611
|
role="dialog"
|
|
610
612
|
aria-modal={panelOpen}
|
|
611
613
|
accessibilityLabel={panelLabel}
|
|
@@ -38,7 +38,11 @@ export function usePanelInteraction(open: boolean, modal: boolean, close: () =>
|
|
|
38
38
|
// This ref is a native View on native, a DOM host on web.
|
|
39
39
|
const node = ref.current as unknown as HTMLElement | null;
|
|
40
40
|
const opener = document.activeElement as HTMLElement | null;
|
|
41
|
-
const focusFirst = () =>
|
|
41
|
+
const focusFirst = () => {
|
|
42
|
+
const first = tabbablesWithin(node)[0];
|
|
43
|
+
if (first) first.focus();
|
|
44
|
+
else node?.focus({ preventScroll: true });
|
|
45
|
+
};
|
|
42
46
|
if (modal) focusFirst();
|
|
43
47
|
const onFocus = (event: FocusEvent) => {
|
|
44
48
|
if (modal && !hasActiveOverlays() && node && !node.contains(event.target as Node)) focusFirst();
|
|
@@ -71,15 +71,21 @@ export function initialFocusWithin(node: HTMLElement): HTMLElement {
|
|
|
71
71
|
/**
|
|
72
72
|
* Keep Tab inside `node`: from the last tabbable (or from outside) forward to
|
|
73
73
|
* the first, from the first (or from outside) backward to the last. Returns
|
|
74
|
-
* whether it moved focus.
|
|
74
|
+
* whether it moved focus. With no available controls, the focusable panel is
|
|
75
|
+
* the fallback until its actions become available again.
|
|
75
76
|
*/
|
|
76
77
|
export function wrapTab(event: KeyboardEvent, node: HTMLElement | null): boolean {
|
|
77
78
|
if (event.key !== 'Tab' || !node) return false;
|
|
78
79
|
const items = tabbablesWithin(node);
|
|
80
|
+
if (items.length === 0) {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
node.focus({ preventScroll: true });
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
79
85
|
const first = items[0];
|
|
80
86
|
const last = items[items.length - 1];
|
|
81
87
|
const active = document.activeElement;
|
|
82
|
-
const outside = !node.contains(active);
|
|
88
|
+
const outside = active === node || !node.contains(active);
|
|
83
89
|
if (event.shiftKey ? outside || active === first : outside || active === last) {
|
|
84
90
|
event.preventDefault();
|
|
85
91
|
(event.shiftKey ? last : first)?.focus();
|
package/src/radio/Radio.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useRadioGroupItem } from './use-radio-group-item';
|
|
2
2
|
import { RadioGroupContext } from './context';
|
|
3
|
-
import { useIsRtl } from '../hooks/use-is-rtl';
|
|
3
|
+
import { useDirectionProps, useIsRtl } from '../hooks/use-is-rtl';
|
|
4
4
|
import { useControllableState } from '../hooks/use-controllable-state';
|
|
5
5
|
import { useBloomAppearance } from '../appearance';
|
|
6
6
|
import { resolveBloomColors } from '../appearance/colors';
|
|
7
7
|
import React, { memo, useCallback, useMemo, useRef, type KeyboardEvent } from 'react';
|
|
8
|
-
import { View, Platform
|
|
8
|
+
import { View, Platform } from 'react-native';
|
|
9
9
|
|
|
10
10
|
import { useTheme } from '../theme/use-theme';
|
|
11
11
|
import { Text } from '../typography';
|
|
@@ -20,6 +20,8 @@ import type { WebCssStyle } from '../styles/web-view-style';
|
|
|
20
20
|
import { RadioIndicator } from '../radio-indicator';
|
|
21
21
|
import { useFieldMembership } from '../field/membership';
|
|
22
22
|
import { RadioCard } from './RadioCard';
|
|
23
|
+
import { RadioChip } from './RadioChip';
|
|
24
|
+
import { RadioHost, RadioGroupHost, RadioLabel } from './RadioHost';
|
|
23
25
|
import type { RadioGroupProps, RadioProps } from './types';
|
|
24
26
|
|
|
25
27
|
/**
|
|
@@ -66,7 +68,7 @@ const STYLE_ID = 'bloom-radio-web-css';
|
|
|
66
68
|
const ROW = '[data-bloom-radio]';
|
|
67
69
|
const DOT = '[data-bloom-radio-dot]';
|
|
68
70
|
|
|
69
|
-
const BLOOM_RADIO_CSS = interactiveWebCss({
|
|
71
|
+
const BLOOM_RADIO_CSS = `@layer base {${interactiveWebCss({
|
|
70
72
|
selector: ROW,
|
|
71
73
|
varPrefix: 'bloom-radio',
|
|
72
74
|
base: `
|
|
@@ -88,7 +90,7 @@ ${ROW}:focus-visible {
|
|
|
88
90
|
${ROW}:focus-visible ${DOT} {
|
|
89
91
|
box-shadow: ${focusRingShadow('--bloom-radio-ring')};
|
|
90
92
|
}`,
|
|
91
|
-
})
|
|
93
|
+
})}}`;
|
|
92
94
|
|
|
93
95
|
const IS_WEB = Platform.OS === 'web';
|
|
94
96
|
|
|
@@ -104,6 +106,8 @@ const RadioComponent = function Radio<Value extends string = string>({
|
|
|
104
106
|
tone: toneProp,
|
|
105
107
|
style,
|
|
106
108
|
labelStyle,
|
|
109
|
+
className,
|
|
110
|
+
labelClassName,
|
|
107
111
|
accessibilityLabel,
|
|
108
112
|
nativeID,
|
|
109
113
|
testID,
|
|
@@ -152,10 +156,11 @@ const RadioComponent = function Radio<Value extends string = string>({
|
|
|
152
156
|
const spaceKey = useRadioGroupItem(value, isDisabled, handlePress);
|
|
153
157
|
|
|
154
158
|
return (
|
|
155
|
-
<
|
|
159
|
+
<RadioHost
|
|
160
|
+
className={className}
|
|
156
161
|
{...spaceKey}
|
|
157
162
|
{...(IS_WEB ? ({ dataSet: { bloomRadio: '' } } as Record<string, unknown>) : {})}
|
|
158
|
-
style={[rowStyle, style]}
|
|
163
|
+
style={[className ? { '--bloom-radio-ring': rowStyle['--bloom-radio-ring'], ...ringOffset } : rowStyle, style]}
|
|
159
164
|
onPress={handlePress}
|
|
160
165
|
disabled={isDisabled}
|
|
161
166
|
nativeID={field.nativeID}
|
|
@@ -189,9 +194,9 @@ const RadioComponent = function Radio<Value extends string = string>({
|
|
|
189
194
|
{labelContent}
|
|
190
195
|
</View>
|
|
191
196
|
) : label && (
|
|
192
|
-
<
|
|
197
|
+
<RadioLabel className={labelClassName} variant={sizeConfig.label} style={[!labelClassName && { color: theme.colors.text }, labelStyle]}>
|
|
193
198
|
{label}
|
|
194
|
-
</
|
|
199
|
+
</RadioLabel>
|
|
195
200
|
)}
|
|
196
201
|
{description && (
|
|
197
202
|
<Text
|
|
@@ -203,7 +208,7 @@ const RadioComponent = function Radio<Value extends string = string>({
|
|
|
203
208
|
)}
|
|
204
209
|
</View>
|
|
205
210
|
)}
|
|
206
|
-
</
|
|
211
|
+
</RadioHost>
|
|
207
212
|
);
|
|
208
213
|
};
|
|
209
214
|
|
|
@@ -230,6 +235,10 @@ const RadioGroupComponent = function RadioGroup<Value extends string = string>(p
|
|
|
230
235
|
style,
|
|
231
236
|
labelStyle,
|
|
232
237
|
optionStyle,
|
|
238
|
+
className,
|
|
239
|
+
optionClassName,
|
|
240
|
+
optionLabelClassName,
|
|
241
|
+
appearance,
|
|
233
242
|
renderOption,
|
|
234
243
|
variant = 'default',
|
|
235
244
|
testID,
|
|
@@ -243,9 +252,10 @@ const RadioGroupComponent = function RadioGroup<Value extends string = string>(p
|
|
|
243
252
|
// own — so it goes in as the caller's name and outranks the field's.
|
|
244
253
|
const field = useFieldMembership({ accessibilityLabel: label, disabled });
|
|
245
254
|
const isDisabled = field.disabled;
|
|
246
|
-
const { size: scopedSize, tone } = useBloomAppearance({size: sizeProp, tone: toneProp}, {size: 'md', tone: 'accent'});
|
|
255
|
+
const { size: scopedSize, tone } = useBloomAppearance({size: sizeProp, tone: toneProp}, {size: 'md', tone: variant === 'chip' ? 'neutral' : 'accent'});
|
|
247
256
|
const size = scopedSize;
|
|
248
257
|
const rtl = useIsRtl();
|
|
258
|
+
const direction = useDirectionProps();
|
|
249
259
|
const nodes = useRef(new Map<string, React.RefObject<View | null>>());
|
|
250
260
|
const controlRef = useCallback((option: string) => {
|
|
251
261
|
let ref = nodes.current.get(option);
|
|
@@ -282,19 +292,34 @@ const RadioGroupComponent = function RadioGroup<Value extends string = string>(p
|
|
|
282
292
|
};
|
|
283
293
|
return (
|
|
284
294
|
<RadioGroupContext.Provider value={{ tabValue, register, onKeyDown }}>
|
|
285
|
-
<
|
|
286
|
-
|
|
295
|
+
<RadioGroupHost
|
|
296
|
+
{...direction}
|
|
297
|
+
className={className}
|
|
298
|
+
style={[!className && { gap: space.sm, ...(variant === 'chip' ? { flexDirection: 'row' as const, flexWrap: 'wrap' as const } : {}) }, style]}
|
|
287
299
|
accessibilityRole="radiogroup"
|
|
288
300
|
accessibilityLabel={field.accessibilityLabel}
|
|
289
301
|
aria-label={field.accessibilityLabel}
|
|
290
302
|
aria-describedby={field.describedBy}
|
|
291
303
|
aria-invalid={field.invalid || undefined}
|
|
304
|
+
aria-disabled={isDisabled || undefined}
|
|
305
|
+
aria-required={field.required || undefined}
|
|
292
306
|
testID={testID}
|
|
293
307
|
>
|
|
294
308
|
{options.map((option) => {
|
|
295
309
|
const checked = option.value === value;
|
|
296
310
|
const optionDisabled = isDisabled || option.disabled === true;
|
|
297
|
-
const
|
|
311
|
+
const state = { checked, disabled: optionDisabled, controlRef: controlRef(option.value) };
|
|
312
|
+
const optionClasses = typeof optionClassName === 'function' ? optionClassName(state) : optionClassName;
|
|
313
|
+
const labelClasses = typeof optionLabelClassName === 'function' ? optionLabelClassName(state) : optionLabelClassName;
|
|
314
|
+
const ownedControl = variant === 'chip' ? (
|
|
315
|
+
<RadioChip
|
|
316
|
+
key={option.value} value={option.value} checked={checked} onValueChange={onValueChange}
|
|
317
|
+
label={option.label} labelContent={option.labelContent} accessibilityLabel={option.accessibilityLabel}
|
|
318
|
+
description={option.description} disabled={optionDisabled} size={size} tone={tone} appearance={appearance}
|
|
319
|
+
style={optionStyle} labelStyle={labelStyle} className={optionClasses} labelClassName={labelClasses}
|
|
320
|
+
testID={option.testID}
|
|
321
|
+
/>
|
|
322
|
+
) : variant === 'card' ? (
|
|
298
323
|
<RadioCard
|
|
299
324
|
key={option.value}
|
|
300
325
|
value={option.value}
|
|
@@ -307,6 +332,9 @@ const RadioGroupComponent = function RadioGroup<Value extends string = string>(p
|
|
|
307
332
|
disabled={optionDisabled}
|
|
308
333
|
tone={tone}
|
|
309
334
|
style={optionStyle}
|
|
335
|
+
labelStyle={labelStyle}
|
|
336
|
+
className={optionClasses}
|
|
337
|
+
labelClassName={labelClasses}
|
|
310
338
|
testID={option.testID}
|
|
311
339
|
/>
|
|
312
340
|
) : (
|
|
@@ -324,14 +352,16 @@ const RadioGroupComponent = function RadioGroup<Value extends string = string>(p
|
|
|
324
352
|
tone={tone}
|
|
325
353
|
labelStyle={labelStyle}
|
|
326
354
|
style={optionStyle}
|
|
355
|
+
className={optionClasses}
|
|
356
|
+
labelClassName={labelClasses}
|
|
327
357
|
testID={option.testID}
|
|
328
358
|
/>
|
|
329
359
|
);
|
|
330
360
|
return <React.Fragment key={option.value}>{renderOption
|
|
331
|
-
? renderOption(option, ownedControl,
|
|
361
|
+
? renderOption(option, ownedControl, state)
|
|
332
362
|
: ownedControl}</React.Fragment>;
|
|
333
363
|
})}
|
|
334
|
-
</
|
|
364
|
+
</RadioGroupHost>
|
|
335
365
|
</RadioGroupContext.Provider>
|
|
336
366
|
);
|
|
337
367
|
};
|