@cdx-ui/components 0.0.1-beta.65 → 0.0.1-beta.67
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/lib/commonjs/components/AlertDialog/index.js +12 -10
- package/lib/commonjs/components/AlertDialog/index.js.map +1 -1
- package/lib/commonjs/components/Avatar/index.js +125 -25
- package/lib/commonjs/components/Avatar/index.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +127 -28
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +9 -3
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/CLAUDE.md +115 -11
- package/lib/commonjs/components/Checkbox/index.js +69 -22
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/styles.js +1 -1
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
- package/lib/commonjs/components/Chip/index.js +44 -36
- package/lib/commonjs/components/Chip/index.js.map +1 -1
- package/lib/commonjs/components/Chip/styles.js +6 -35
- package/lib/commonjs/components/Chip/styles.js.map +1 -1
- package/lib/commonjs/components/Dialog/index.js +92 -72
- package/lib/commonjs/components/Dialog/index.js.map +1 -1
- package/lib/commonjs/components/Field/index.js +70 -26
- package/lib/commonjs/components/Field/index.js.map +1 -1
- package/lib/commonjs/components/Form/index.js +5 -12
- package/lib/commonjs/components/Form/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/index.js +5 -33
- package/lib/commonjs/components/IconButton/index.js.map +1 -1
- package/lib/commonjs/components/Input/index.js +50 -20
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/components/Link/index.js +14 -7
- package/lib/commonjs/components/Link/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/index.js +129 -54
- package/lib/commonjs/components/ListItem/index.js.map +1 -1
- package/lib/commonjs/components/OtpInput/index.js +94 -28
- package/lib/commonjs/components/OtpInput/index.js.map +1 -1
- package/lib/commonjs/components/ProgressBar/index.js +8 -13
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -1
- package/lib/commonjs/components/Radio/index.js +51 -53
- package/lib/commonjs/components/Radio/index.js.map +1 -1
- package/lib/commonjs/components/Select/index.js +112 -46
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Select/styles.js +2 -2
- package/lib/commonjs/components/Select/styles.js.map +1 -1
- package/lib/commonjs/components/Switch/BaseSwitch.js +23 -13
- package/lib/commonjs/components/Switch/BaseSwitch.js.map +1 -1
- package/lib/commonjs/components/Switch/BaseSwitch.web.js +25 -21
- package/lib/commonjs/components/Switch/BaseSwitch.web.js.map +1 -1
- package/lib/commonjs/components/Switch/index.js +34 -3
- package/lib/commonjs/components/Switch/index.js.map +1 -1
- package/lib/commonjs/components/Tile/index.js +150 -77
- package/lib/commonjs/components/Tile/index.js.map +1 -1
- package/lib/commonjs/figma/Chip.figma.js +2 -2
- package/lib/commonjs/figma/Chip.figma.js.map +1 -1
- package/lib/commonjs/utils/positionToDataIcon.js +41 -0
- package/lib/commonjs/utils/positionToDataIcon.js.map +1 -0
- package/lib/module/components/AlertDialog/index.js +13 -11
- package/lib/module/components/AlertDialog/index.js.map +1 -1
- package/lib/module/components/Avatar/index.js +128 -28
- package/lib/module/components/Avatar/index.js.map +1 -1
- package/lib/module/components/Button/index.js +130 -32
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +8 -2
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/CLAUDE.md +115 -11
- package/lib/module/components/Checkbox/index.js +72 -25
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Checkbox/styles.js +1 -1
- package/lib/module/components/Checkbox/styles.js.map +1 -1
- package/lib/module/components/Chip/index.js +47 -39
- package/lib/module/components/Chip/index.js.map +1 -1
- package/lib/module/components/Chip/styles.js +6 -35
- package/lib/module/components/Chip/styles.js.map +1 -1
- package/lib/module/components/Dialog/index.js +96 -76
- package/lib/module/components/Dialog/index.js.map +1 -1
- package/lib/module/components/Field/index.js +74 -31
- package/lib/module/components/Field/index.js.map +1 -1
- package/lib/module/components/Form/index.js +7 -14
- package/lib/module/components/Form/index.js.map +1 -1
- package/lib/module/components/IconButton/index.js +6 -34
- package/lib/module/components/IconButton/index.js.map +1 -1
- package/lib/module/components/Input/index.js +53 -23
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/Link/index.js +16 -8
- package/lib/module/components/Link/index.js.map +1 -1
- package/lib/module/components/ListItem/index.js +134 -59
- package/lib/module/components/ListItem/index.js.map +1 -1
- package/lib/module/components/OtpInput/index.js +94 -28
- package/lib/module/components/OtpInput/index.js.map +1 -1
- package/lib/module/components/ProgressBar/index.js +9 -14
- package/lib/module/components/ProgressBar/index.js.map +1 -1
- package/lib/module/components/Radio/index.js +54 -57
- package/lib/module/components/Radio/index.js.map +1 -1
- package/lib/module/components/Select/index.js +118 -52
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Select/styles.js +2 -2
- package/lib/module/components/Select/styles.js.map +1 -1
- package/lib/module/components/Switch/BaseSwitch.js +24 -14
- package/lib/module/components/Switch/BaseSwitch.js.map +1 -1
- package/lib/module/components/Switch/BaseSwitch.web.js +26 -22
- package/lib/module/components/Switch/BaseSwitch.web.js.map +1 -1
- package/lib/module/components/Switch/index.js +35 -4
- package/lib/module/components/Switch/index.js.map +1 -1
- package/lib/module/components/Tile/index.js +155 -83
- package/lib/module/components/Tile/index.js.map +1 -1
- package/lib/module/figma/Chip.figma.js +2 -2
- package/lib/module/figma/Chip.figma.js.map +1 -1
- package/lib/module/utils/positionToDataIcon.js +38 -0
- package/lib/module/utils/positionToDataIcon.js.map +1 -0
- package/lib/typescript/components/AlertDialog/index.d.ts.map +1 -1
- package/lib/typescript/components/Avatar/index.d.ts +6 -2
- package/lib/typescript/components/Avatar/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/index.d.ts +31 -8
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +2 -1
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts +3 -1
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/index.d.ts +19 -9
- package/lib/typescript/components/Chip/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/styles.d.ts +0 -1
- package/lib/typescript/components/Chip/styles.d.ts.map +1 -1
- package/lib/typescript/components/Dialog/index.d.ts +12 -6
- package/lib/typescript/components/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/components/Dialog/styles.d.ts +1 -1
- package/lib/typescript/components/Field/index.d.ts +14 -7
- package/lib/typescript/components/Field/index.d.ts.map +1 -1
- package/lib/typescript/components/Form/index.d.ts +4 -4
- package/lib/typescript/components/Form/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
- package/lib/typescript/components/Input/index.d.ts +11 -3
- package/lib/typescript/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +2 -0
- package/lib/typescript/components/Link/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +28 -6
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -1
- package/lib/typescript/components/OtpInput/index.d.ts +1 -1
- package/lib/typescript/components/OtpInput/index.d.ts.map +1 -1
- package/lib/typescript/components/ProgressBar/index.d.ts +4 -4
- package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -1
- package/lib/typescript/components/Radio/index.d.ts +4 -0
- package/lib/typescript/components/Radio/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/index.d.ts +35 -2
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/styles.d.ts.map +1 -1
- package/lib/typescript/components/Switch/BaseSwitch.d.ts +12 -5
- package/lib/typescript/components/Switch/BaseSwitch.d.ts.map +1 -1
- package/lib/typescript/components/Switch/BaseSwitch.web.d.ts +11 -5
- package/lib/typescript/components/Switch/BaseSwitch.web.d.ts.map +1 -1
- package/lib/typescript/components/Switch/index.d.ts +5 -1
- package/lib/typescript/components/Switch/index.d.ts.map +1 -1
- package/lib/typescript/components/Tile/index.d.ts +8 -2
- package/lib/typescript/components/Tile/index.d.ts.map +1 -1
- package/lib/typescript/utils/positionToDataIcon.d.ts +29 -0
- package/lib/typescript/utils/positionToDataIcon.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/components/AlertDialog/index.tsx +13 -14
- package/src/components/Avatar/index.tsx +134 -44
- package/src/components/Button/index.tsx +216 -44
- package/src/components/Button/styles.ts +50 -38
- package/src/components/CLAUDE.md +115 -11
- package/src/components/Checkbox/index.tsx +93 -32
- package/src/components/Checkbox/styles.ts +1 -1
- package/src/components/Chip/index.tsx +88 -61
- package/src/components/Chip/styles.ts +6 -18
- package/src/components/Dialog/index.tsx +139 -99
- package/src/components/Field/index.tsx +113 -49
- package/src/components/Form/index.tsx +18 -14
- package/src/components/IconButton/index.tsx +7 -31
- package/src/components/Input/index.tsx +75 -32
- package/src/components/Link/index.tsx +38 -12
- package/src/components/ListItem/index.tsx +158 -73
- package/src/components/OtpInput/index.tsx +126 -43
- package/src/components/ProgressBar/index.tsx +11 -16
- package/src/components/Radio/index.tsx +76 -54
- package/src/components/Select/index.tsx +174 -59
- package/src/components/Select/styles.ts +1 -2
- package/src/components/Switch/BaseSwitch.tsx +38 -16
- package/src/components/Switch/BaseSwitch.web.tsx +28 -35
- package/src/components/Switch/index.tsx +51 -4
- package/src/components/Tile/index.tsx +145 -94
- package/src/utils/positionToDataIcon.ts +34 -0
- package/lib/commonjs/components/Field/FieldLabel.js +0 -33
- package/lib/commonjs/components/Field/FieldLabel.js.map +0 -1
- package/lib/commonjs/components/Field/FieldLabel.web.js +0 -22
- package/lib/commonjs/components/Field/FieldLabel.web.js.map +0 -1
- package/lib/commonjs/components/Form/FormRoot.js +0 -25
- package/lib/commonjs/components/Form/FormRoot.js.map +0 -1
- package/lib/commonjs/components/Form/FormRoot.web.js +0 -17
- package/lib/commonjs/components/Form/FormRoot.web.js.map +0 -1
- package/lib/commonjs/components/Input/BaseInput.android.js +0 -20
- package/lib/commonjs/components/Input/BaseInput.android.js.map +0 -1
- package/lib/commonjs/components/Input/BaseInput.js +0 -13
- package/lib/commonjs/components/Input/BaseInput.js.map +0 -1
- package/lib/commonjs/components/Input/BaseInput.web.js +0 -50
- package/lib/commonjs/components/Input/BaseInput.web.js.map +0 -1
- package/lib/commonjs/components/Select/SelectTriggerHost.js +0 -10
- package/lib/commonjs/components/Select/SelectTriggerHost.js.map +0 -1
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js +0 -102
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +0 -1
- package/lib/module/components/Field/FieldLabel.js +0 -29
- package/lib/module/components/Field/FieldLabel.js.map +0 -1
- package/lib/module/components/Field/FieldLabel.web.js +0 -17
- package/lib/module/components/Field/FieldLabel.web.js.map +0 -1
- package/lib/module/components/Form/FormRoot.js +0 -21
- package/lib/module/components/Form/FormRoot.js.map +0 -1
- package/lib/module/components/Form/FormRoot.web.js +0 -12
- package/lib/module/components/Form/FormRoot.web.js.map +0 -1
- package/lib/module/components/Input/BaseInput.android.js +0 -16
- package/lib/module/components/Input/BaseInput.android.js.map +0 -1
- package/lib/module/components/Input/BaseInput.js +0 -4
- package/lib/module/components/Input/BaseInput.js.map +0 -1
- package/lib/module/components/Input/BaseInput.web.js +0 -45
- package/lib/module/components/Input/BaseInput.web.js.map +0 -1
- package/lib/module/components/Select/SelectTriggerHost.js +0 -7
- package/lib/module/components/Select/SelectTriggerHost.js.map +0 -1
- package/lib/module/components/Select/SelectTriggerHost.web.js +0 -97
- package/lib/module/components/Select/SelectTriggerHost.web.js.map +0 -1
- package/lib/typescript/components/Field/FieldLabel.d.ts +0 -18
- package/lib/typescript/components/Field/FieldLabel.d.ts.map +0 -1
- package/lib/typescript/components/Field/FieldLabel.web.d.ts +0 -16
- package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +0 -1
- package/lib/typescript/components/Form/FormRoot.d.ts +0 -14
- package/lib/typescript/components/Form/FormRoot.d.ts.map +0 -1
- package/lib/typescript/components/Form/FormRoot.web.d.ts +0 -10
- package/lib/typescript/components/Form/FormRoot.web.d.ts.map +0 -1
- package/lib/typescript/components/Input/BaseInput.android.d.ts +0 -3
- package/lib/typescript/components/Input/BaseInput.android.d.ts.map +0 -1
- package/lib/typescript/components/Input/BaseInput.d.ts +0 -2
- package/lib/typescript/components/Input/BaseInput.d.ts.map +0 -1
- package/lib/typescript/components/Input/BaseInput.web.d.ts +0 -3
- package/lib/typescript/components/Input/BaseInput.web.d.ts.map +0 -1
- package/lib/typescript/components/Select/SelectTriggerHost.d.ts +0 -3
- package/lib/typescript/components/Select/SelectTriggerHost.d.ts.map +0 -1
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +0 -16
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +0 -1
- package/src/components/Field/FieldLabel.tsx +0 -33
- package/src/components/Field/FieldLabel.web.tsx +0 -25
- package/src/components/Form/FormRoot.tsx +0 -20
- package/src/components/Form/FormRoot.web.tsx +0 -12
- package/src/components/Input/BaseInput.android.tsx +0 -13
- package/src/components/Input/BaseInput.tsx +0 -1
- package/src/components/Input/BaseInput.web.tsx +0 -41
- package/src/components/Select/SelectTriggerHost.tsx +0 -4
- package/src/components/Select/SelectTriggerHost.web.tsx +0 -143
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import { Pressable, View } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { mergeDataAttributes, type IUseSwitchReturn } from '@cdx-ui/primitives';
|
|
4
|
+
import { cn, composeEventHandlers } from '@cdx-ui/utils';
|
|
4
5
|
import {
|
|
5
6
|
switchThumbVariants,
|
|
6
7
|
switchTrackVariants,
|
|
@@ -9,58 +10,50 @@ import {
|
|
|
9
10
|
} from './styles';
|
|
10
11
|
|
|
11
12
|
export interface BaseSwitchProps {
|
|
12
|
-
|
|
13
|
-
onValueChange?: (value: boolean) => void;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
states?: Record<string, boolean | undefined>;
|
|
16
|
-
dataSet?: Record<string, string>;
|
|
13
|
+
switchState: IUseSwitchReturn;
|
|
17
14
|
className?: string;
|
|
18
15
|
size?: SwitchVariantProps['size'];
|
|
16
|
+
accessibilityLabel?: string;
|
|
19
17
|
onFocus?: () => void;
|
|
20
18
|
onBlur?: () => void;
|
|
21
19
|
}
|
|
22
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Web host for `Switch`. Renders a custom `Pressable` + `View` toggle (preserving
|
|
23
|
+
* the existing visual contract) wired to the resolved state in `switchState`.
|
|
24
|
+
*
|
|
25
|
+
* `role="switch"` + `aria-checked` + keyboard semantics satisfy the same a11y
|
|
26
|
+
* contract that an `<input type="checkbox" role="switch">` would provide, without
|
|
27
|
+
* the visual rework an input swap would require (see spike notes in PR).
|
|
28
|
+
*/
|
|
23
29
|
export const BaseSwitch = forwardRef<View, BaseSwitchProps>(
|
|
24
|
-
(
|
|
25
|
-
{
|
|
26
|
-
value,
|
|
27
|
-
onValueChange,
|
|
28
|
-
disabled,
|
|
29
|
-
states,
|
|
30
|
-
dataSet,
|
|
31
|
-
className,
|
|
32
|
-
size = 'md',
|
|
33
|
-
onFocus,
|
|
34
|
-
onBlur,
|
|
35
|
-
...props
|
|
36
|
-
},
|
|
37
|
-
ref,
|
|
38
|
-
) => {
|
|
39
|
-
const isChecked = value ?? states?.checked ?? false;
|
|
40
|
-
const isDisabled = disabled ?? states?.disabled ?? false;
|
|
41
|
-
const isInvalid = states?.invalid ?? false;
|
|
42
|
-
|
|
30
|
+
({ switchState, className, size = 'md', accessibilityLabel, onFocus, onBlur, ...props }, ref) => {
|
|
43
31
|
return (
|
|
44
32
|
<Pressable
|
|
45
33
|
ref={ref}
|
|
46
34
|
role="switch"
|
|
47
|
-
aria-checked={
|
|
48
|
-
aria-disabled={isDisabled}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
aria-checked={switchState.checked}
|
|
36
|
+
aria-disabled={switchState.isDisabled}
|
|
37
|
+
accessibilityLabel={accessibilityLabel}
|
|
38
|
+
disabled={switchState.isDisabled}
|
|
39
|
+
onPress={() => switchState.setChecked(!switchState.checked)}
|
|
40
|
+
onFocus={composeEventHandlers(onFocus, switchState.focusProps.onFocus as () => void)}
|
|
41
|
+
onBlur={composeEventHandlers(onBlur, switchState.focusProps.onBlur as () => void)}
|
|
42
|
+
onHoverIn={switchState.hoverProps.onHoverIn as () => void}
|
|
43
|
+
onHoverOut={switchState.hoverProps.onHoverOut as () => void}
|
|
53
44
|
tabIndex={0}
|
|
54
45
|
className={cn(
|
|
55
46
|
switchTrackVariants({ size }),
|
|
56
|
-
switchWebTrackColorVariants({
|
|
47
|
+
switchWebTrackColorVariants({
|
|
48
|
+
isChecked: switchState.checked,
|
|
49
|
+
isInvalid: switchState.isInvalid,
|
|
50
|
+
}),
|
|
57
51
|
className,
|
|
58
52
|
)}
|
|
59
|
-
// @ts-expect-error dataSet is a RNW/Uniwind prop not in Pressable types
|
|
60
|
-
dataSet={dataSet}
|
|
61
53
|
{...props}
|
|
54
|
+
{...mergeDataAttributes(props, switchState.dataAttrs)}
|
|
62
55
|
>
|
|
63
|
-
<View className={cn(switchThumbVariants({ size, isChecked }))} />
|
|
56
|
+
<View className={cn(switchThumbVariants({ size, isChecked: switchState.checked }))} />
|
|
64
57
|
</Pressable>
|
|
65
58
|
);
|
|
66
59
|
},
|
|
@@ -1,11 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import type { Switch as RNSwitch, View } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
dataAttributes,
|
|
5
|
+
mergeDataAttributes,
|
|
6
|
+
useSwitch,
|
|
7
|
+
type ISwitchProps,
|
|
8
|
+
} from '@cdx-ui/primitives';
|
|
2
9
|
import { BaseSwitch } from './BaseSwitch';
|
|
3
10
|
import type { SwitchVariantProps } from './styles';
|
|
4
11
|
|
|
5
|
-
const SwitchPrimitive = createSwitch({ Root: BaseSwitch });
|
|
6
|
-
|
|
7
12
|
export interface SwitchProps extends ISwitchProps, SwitchVariantProps {
|
|
8
13
|
className?: string;
|
|
14
|
+
accessibilityLabel?: string;
|
|
15
|
+
onFocus?: () => void;
|
|
16
|
+
onBlur?: () => void;
|
|
9
17
|
}
|
|
10
18
|
|
|
11
|
-
export const Switch =
|
|
19
|
+
export const Switch = forwardRef<RNSwitch | View, SwitchProps>(
|
|
20
|
+
(
|
|
21
|
+
{
|
|
22
|
+
className,
|
|
23
|
+
size,
|
|
24
|
+
value,
|
|
25
|
+
isChecked,
|
|
26
|
+
defaultValue,
|
|
27
|
+
disabled,
|
|
28
|
+
isDisabled,
|
|
29
|
+
isInvalid,
|
|
30
|
+
onValueChange,
|
|
31
|
+
...props
|
|
32
|
+
},
|
|
33
|
+
ref,
|
|
34
|
+
) => {
|
|
35
|
+
const switchState = useSwitch({
|
|
36
|
+
value,
|
|
37
|
+
isChecked,
|
|
38
|
+
defaultValue,
|
|
39
|
+
disabled,
|
|
40
|
+
isDisabled,
|
|
41
|
+
isInvalid,
|
|
42
|
+
onValueChange,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<BaseSwitch
|
|
47
|
+
ref={ref as never}
|
|
48
|
+
switchState={switchState}
|
|
49
|
+
className={className}
|
|
50
|
+
size={size}
|
|
51
|
+
{...props}
|
|
52
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'switch' }))}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
Switch.displayName = 'Switch';
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { forwardRef, type ReactNode } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { forwardRef, useMemo, type ReactNode } from 'react';
|
|
2
|
+
import { Text, View, type TextProps, type ViewProps } from 'react-native';
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
Slot,
|
|
5
|
+
TileGroup as TileGroupPrimitive,
|
|
6
|
+
TileRoot as TileRootPrimitive,
|
|
7
|
+
dataAttributes,
|
|
8
|
+
mergeDataAttributes,
|
|
9
|
+
useTileContext,
|
|
5
10
|
type ITileGroupMultipleProps,
|
|
6
11
|
type ITileGroupSingleProps,
|
|
7
12
|
type ITileIndicatorProps,
|
|
8
13
|
type ITileLeadingSlotProps,
|
|
9
14
|
type ITileProps,
|
|
10
15
|
type ITileTrailingSlotProps,
|
|
11
|
-
useTileContext,
|
|
12
16
|
} from '@cdx-ui/primitives';
|
|
13
17
|
import { Check } from '@cdx-ui/icons';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { checkboxIndicatorVariants, checkboxIconVariants } from '../Checkbox/styles';
|
|
18
|
+
import { cn, ParentContext, useParentContext, useStyleContext } from '@cdx-ui/utils';
|
|
19
|
+
import { checkboxIconVariants, checkboxIndicatorVariants } from '../Checkbox/styles';
|
|
17
20
|
import { Icon } from '../Icon';
|
|
18
21
|
import { radioIndicatorVariants, radioInnerDotVariants } from '../Radio/styles';
|
|
19
22
|
import {
|
|
@@ -32,9 +35,6 @@ import {
|
|
|
32
35
|
const TILE_SCOPE = 'TILE';
|
|
33
36
|
const TILE_GROUP_SCOPE = 'TILE_GROUP';
|
|
34
37
|
|
|
35
|
-
const RootPressable = withStyleContext(Pressable, TILE_SCOPE);
|
|
36
|
-
const GroupView = withStyleContext(View, TILE_GROUP_SCOPE);
|
|
37
|
-
|
|
38
38
|
interface TileGroupStyleContext {
|
|
39
39
|
shape?: TileVariantProps['shape'];
|
|
40
40
|
}
|
|
@@ -47,17 +47,6 @@ const useTileGroupStyleContext = (): TileGroupStyleContext => {
|
|
|
47
47
|
return ctx ?? {};
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
const TilePrimitive = createTile({
|
|
51
|
-
Pressable: RootPressable,
|
|
52
|
-
Group: GroupView,
|
|
53
|
-
LeadingSlot: View,
|
|
54
|
-
Content: View,
|
|
55
|
-
Title: Text,
|
|
56
|
-
Description: Text,
|
|
57
|
-
Indicator: View,
|
|
58
|
-
TrailingSlot: View,
|
|
59
|
-
});
|
|
60
|
-
|
|
61
50
|
// =============================================================================
|
|
62
51
|
// TILE GROUP
|
|
63
52
|
// =============================================================================
|
|
@@ -72,7 +61,7 @@ const TilePrimitive = createTile({
|
|
|
72
61
|
* - `direction="column"` + `spacing="none"` — tight vertical stack (rows touch).
|
|
73
62
|
* - `direction="row"` + `spacing="default"` — side-by-side horizontal layout.
|
|
74
63
|
*
|
|
75
|
-
* `shape` (when set) is propagated to child `Tile`s via `
|
|
64
|
+
* `shape` (when set) is propagated to child `Tile`s via `ParentContext`, matching the
|
|
76
65
|
* Avatar size-propagation pattern. A per-tile `shape` prop overrides the inherited value.
|
|
77
66
|
*/
|
|
78
67
|
export interface TileGroupSingleProps extends ITileGroupSingleProps, TileGroupVariantProps {
|
|
@@ -88,17 +77,24 @@ export interface TileGroupMultipleProps extends ITileGroupMultipleProps, TileGro
|
|
|
88
77
|
export type TileGroupProps = TileGroupSingleProps | TileGroupMultipleProps;
|
|
89
78
|
|
|
90
79
|
const TileGroup = forwardRef<View, TileGroupProps>(
|
|
91
|
-
({ className, style, children, direction, spacing, shape, ...props }, ref) =>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
80
|
+
({ className, style, children, direction, spacing, shape, ...props }, ref) => {
|
|
81
|
+
const parent = useParentContext();
|
|
82
|
+
const ctx = useMemo(() => ({ ...parent, [TILE_GROUP_SCOPE]: { shape } }), [parent, shape]);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<ParentContext.Provider value={ctx}>
|
|
86
|
+
<TileGroupPrimitive
|
|
87
|
+
ref={ref}
|
|
88
|
+
className={cn(tileGroupVariants({ direction, spacing }), className)}
|
|
89
|
+
style={style}
|
|
90
|
+
{...(props as TileGroupProps)}
|
|
91
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'tile-group' }))}
|
|
92
|
+
>
|
|
93
|
+
{children}
|
|
94
|
+
</TileGroupPrimitive>
|
|
95
|
+
</ParentContext.Provider>
|
|
96
|
+
);
|
|
97
|
+
},
|
|
102
98
|
);
|
|
103
99
|
|
|
104
100
|
TileGroup.displayName = 'Tile.Group';
|
|
@@ -112,19 +108,24 @@ export interface TileProps extends ITileProps, TileVariantProps {
|
|
|
112
108
|
}
|
|
113
109
|
|
|
114
110
|
const TileRoot = forwardRef<View, TileProps>(
|
|
115
|
-
({ shape: shapeProp, showSeparator, className, style,
|
|
111
|
+
({ shape: shapeProp, showSeparator, className, style, ...props }, ref) => {
|
|
116
112
|
const { shape: inheritedShape } = useTileGroupStyleContext();
|
|
117
113
|
const shape = shapeProp ?? inheritedShape ?? 'card';
|
|
118
114
|
const computedClassName = cn(tileRootVariants({ shape, showSeparator }), className);
|
|
119
115
|
|
|
116
|
+
const parent = useParentContext();
|
|
117
|
+
const ctx = useMemo(() => ({ ...parent, [TILE_SCOPE]: { shape } }), [parent, shape]);
|
|
118
|
+
|
|
120
119
|
return (
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
120
|
+
<ParentContext.Provider value={ctx}>
|
|
121
|
+
<TileRootPrimitive
|
|
122
|
+
ref={ref}
|
|
123
|
+
className={computedClassName}
|
|
124
|
+
style={style}
|
|
125
|
+
{...props}
|
|
126
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'tile' }))}
|
|
127
|
+
/>
|
|
128
|
+
</ParentContext.Provider>
|
|
128
129
|
);
|
|
129
130
|
},
|
|
130
131
|
);
|
|
@@ -135,69 +136,104 @@ TileRoot.displayName = 'Tile';
|
|
|
135
136
|
// SLOTS
|
|
136
137
|
// =============================================================================
|
|
137
138
|
|
|
139
|
+
const leadingSlotStyle = { flexShrink: 0 as const };
|
|
140
|
+
|
|
138
141
|
export interface TileLeadingSlotProps extends ITileLeadingSlotProps {
|
|
142
|
+
asChild?: boolean;
|
|
139
143
|
className?: string;
|
|
140
144
|
}
|
|
141
145
|
|
|
142
146
|
const TileLeadingSlot = forwardRef<View, TileLeadingSlotProps>(
|
|
143
|
-
({ className, style, ...props }, ref) =>
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
({ asChild, className, style, 'aria-hidden': ariaHidden, ...props }, ref) => {
|
|
148
|
+
const accessibilityElementsHidden = ariaHidden !== false;
|
|
149
|
+
const Comp = asChild ? Slot : View;
|
|
150
|
+
return (
|
|
151
|
+
<Comp
|
|
152
|
+
ref={ref}
|
|
153
|
+
accessibilityElementsHidden={accessibilityElementsHidden}
|
|
154
|
+
aria-hidden={ariaHidden ?? true}
|
|
155
|
+
className={cn(tileLeadingSlotVariants(), className)}
|
|
156
|
+
style={[leadingSlotStyle, style]}
|
|
157
|
+
{...props}
|
|
158
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'tile-leading' }))}
|
|
159
|
+
/>
|
|
160
|
+
);
|
|
161
|
+
},
|
|
151
162
|
);
|
|
152
163
|
|
|
153
164
|
TileLeadingSlot.displayName = 'Tile.LeadingSlot';
|
|
154
165
|
|
|
166
|
+
const contentStyle = {
|
|
167
|
+
flex: 1,
|
|
168
|
+
flexDirection: 'column' as const,
|
|
169
|
+
minWidth: 0,
|
|
170
|
+
};
|
|
171
|
+
|
|
155
172
|
export interface TileContentProps extends ViewProps {
|
|
173
|
+
asChild?: boolean;
|
|
156
174
|
className?: string;
|
|
157
175
|
}
|
|
158
176
|
|
|
159
|
-
const TileContent = forwardRef<View, TileContentProps>(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
177
|
+
const TileContent = forwardRef<View, TileContentProps>(
|
|
178
|
+
({ asChild, className, style, ...props }, ref) => {
|
|
179
|
+
const Comp = asChild ? Slot : View;
|
|
180
|
+
return (
|
|
181
|
+
<Comp
|
|
182
|
+
ref={ref}
|
|
183
|
+
className={cn(tileContentVariants(), className)}
|
|
184
|
+
style={[contentStyle, style]}
|
|
185
|
+
{...props}
|
|
186
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'tile-content' }))}
|
|
187
|
+
/>
|
|
188
|
+
);
|
|
189
|
+
},
|
|
190
|
+
);
|
|
167
191
|
|
|
168
192
|
TileContent.displayName = 'Tile.Content';
|
|
169
193
|
|
|
194
|
+
const noUnderlineStyle = { textDecorationLine: 'none' as const };
|
|
195
|
+
|
|
170
196
|
export interface TileTitleProps extends TextProps {
|
|
197
|
+
asChild?: boolean;
|
|
171
198
|
className?: string;
|
|
172
199
|
}
|
|
173
200
|
|
|
174
201
|
const TileTitle = forwardRef<Text, TileTitleProps>(
|
|
175
|
-
({ className, style, numberOfLines = 1, ...props }, ref) =>
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
202
|
+
({ asChild, className, style, numberOfLines = 1, ...props }, ref) => {
|
|
203
|
+
const Comp = asChild ? Slot : Text;
|
|
204
|
+
return (
|
|
205
|
+
<Comp
|
|
206
|
+
ref={ref}
|
|
207
|
+
className={cn(tileTitleVariants(), className)}
|
|
208
|
+
style={[noUnderlineStyle, style]}
|
|
209
|
+
numberOfLines={numberOfLines}
|
|
210
|
+
{...props}
|
|
211
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'tile-title' }))}
|
|
212
|
+
/>
|
|
213
|
+
);
|
|
214
|
+
},
|
|
184
215
|
);
|
|
185
216
|
|
|
186
217
|
TileTitle.displayName = 'Tile.Title';
|
|
187
218
|
|
|
188
219
|
export interface TileDescriptionProps extends TextProps {
|
|
220
|
+
asChild?: boolean;
|
|
189
221
|
className?: string;
|
|
190
222
|
}
|
|
191
223
|
|
|
192
224
|
const TileDescription = forwardRef<Text, TileDescriptionProps>(
|
|
193
|
-
({ className, style, ...props }, ref) =>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
225
|
+
({ asChild, className, style, ...props }, ref) => {
|
|
226
|
+
const Comp = asChild ? Slot : Text;
|
|
227
|
+
return (
|
|
228
|
+
<Comp
|
|
229
|
+
ref={ref}
|
|
230
|
+
className={cn(tileDescriptionVariants(), className)}
|
|
231
|
+
style={[noUnderlineStyle, style]}
|
|
232
|
+
{...props}
|
|
233
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'tile-description' }))}
|
|
234
|
+
/>
|
|
235
|
+
);
|
|
236
|
+
},
|
|
201
237
|
);
|
|
202
238
|
|
|
203
239
|
TileDescription.displayName = 'Tile.Description';
|
|
@@ -205,7 +241,7 @@ TileDescription.displayName = 'Tile.Description';
|
|
|
205
241
|
/**
|
|
206
242
|
* Decorative selection affordance. Renders pure CVA-styled Views — no interactive hooks,
|
|
207
243
|
* no nested Pressable, zero runtime overhead. The Tile root owns the press target and
|
|
208
|
-
* ARIA role; this subtree is `aria-hidden
|
|
244
|
+
* ARIA role; this subtree is `aria-hidden`.
|
|
209
245
|
*
|
|
210
246
|
* The visual is inferred from the tile context: `single` (radio semantics) → radio ring,
|
|
211
247
|
* `multiple` (checkbox semantics) → checkbox square. An explicit `indicatorType` prop
|
|
@@ -235,40 +271,55 @@ function TileIndicatorVisual({ indicatorType }: { indicatorType?: 'radio' | 'che
|
|
|
235
271
|
);
|
|
236
272
|
}
|
|
237
273
|
|
|
274
|
+
const indicatorStyle = { flexShrink: 0 as const, pointerEvents: 'none' as const };
|
|
275
|
+
|
|
238
276
|
export interface TileIndicatorProps extends ITileIndicatorProps {
|
|
277
|
+
asChild?: boolean;
|
|
239
278
|
className?: string;
|
|
240
279
|
children?: ReactNode;
|
|
241
280
|
}
|
|
242
281
|
|
|
243
282
|
const TileIndicator = forwardRef<View, TileIndicatorProps>(
|
|
244
|
-
({ className, children, style, indicatorType, ...props }, ref) =>
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
283
|
+
({ asChild, className, children, style, indicatorType, ...props }, ref) => {
|
|
284
|
+
const Comp = asChild ? Slot : View;
|
|
285
|
+
return (
|
|
286
|
+
<Comp
|
|
287
|
+
ref={ref}
|
|
288
|
+
accessibilityElementsHidden
|
|
289
|
+
aria-hidden
|
|
290
|
+
className={cn(tileIndicatorVariants(), className)}
|
|
291
|
+
style={[indicatorStyle, style]}
|
|
292
|
+
{...props}
|
|
293
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'tile-indicator' }))}
|
|
294
|
+
>
|
|
295
|
+
{children ?? <TileIndicatorVisual indicatorType={indicatorType} />}
|
|
296
|
+
</Comp>
|
|
297
|
+
);
|
|
298
|
+
},
|
|
255
299
|
);
|
|
256
300
|
|
|
257
301
|
TileIndicator.displayName = 'Tile.Indicator';
|
|
258
302
|
|
|
303
|
+
const trailingSlotStyle = { flexShrink: 0 as const };
|
|
304
|
+
|
|
259
305
|
export interface TileTrailingSlotProps extends ITileTrailingSlotProps {
|
|
306
|
+
asChild?: boolean;
|
|
260
307
|
className?: string;
|
|
261
308
|
}
|
|
262
309
|
|
|
263
310
|
const TileTrailingSlot = forwardRef<View, TileTrailingSlotProps>(
|
|
264
|
-
({ className, style, ...props }, ref) =>
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
311
|
+
({ asChild, className, style, ...props }, ref) => {
|
|
312
|
+
const Comp = asChild ? Slot : View;
|
|
313
|
+
return (
|
|
314
|
+
<Comp
|
|
315
|
+
ref={ref}
|
|
316
|
+
className={cn(tileTrailingSlotVariants(), className)}
|
|
317
|
+
style={[trailingSlotStyle, style]}
|
|
318
|
+
{...props}
|
|
319
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'tile-trailing' }))}
|
|
320
|
+
/>
|
|
321
|
+
);
|
|
322
|
+
},
|
|
272
323
|
);
|
|
273
324
|
|
|
274
325
|
TileTrailingSlot.displayName = 'Tile.TrailingSlot';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { dataAttributes } from '@cdx-ui/primitives';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Position hint accepted by icon/spinner-bearing styled slots
|
|
5
|
+
* (`Button.Icon`, `Button.Spinner`, `Chip.Icon`, etc.). Maps to a logical
|
|
6
|
+
* `data-icon` attribute that CVA targets for leading/trailing padding.
|
|
7
|
+
*
|
|
8
|
+
* `'leading'` → `data-icon="inline-start"`
|
|
9
|
+
* `'trailing'` → `data-icon="inline-end"`
|
|
10
|
+
*/
|
|
11
|
+
export type IconSlotPosition = 'leading' | 'trailing';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Returns the data-attribute spread props for the requested position, or
|
|
15
|
+
* `undefined` when no position is set (so the attribute is omitted entirely
|
|
16
|
+
* and baseline spacing applies).
|
|
17
|
+
*
|
|
18
|
+
* Spread the result onto the rendered element:
|
|
19
|
+
*
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <Icon {...positionToDataIcon(position)} />
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* Spacing rules live in CVA variant strings, targeting the attribute via
|
|
25
|
+
* logical-property utilities so RTL flips automatically:
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* cva(['data-[icon=inline-start]:me-1.5 data-[icon=inline-end]:ms-1.5'], { ... });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export function positionToDataIcon(position?: IconSlotPosition) {
|
|
32
|
+
if (!position) return undefined;
|
|
33
|
+
return dataAttributes({ icon: position === 'leading' ? 'inline-start' : 'inline-end' });
|
|
34
|
+
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BaseFieldLabel = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _utils = require("@cdx-ui/utils");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
/**
|
|
12
|
-
* Native: `Text` label row — tap focuses the field input via form context
|
|
13
|
-
* (parity with `<label htmlFor>` on web).
|
|
14
|
-
*/
|
|
15
|
-
const BaseFieldLabel = exports.BaseFieldLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
16
|
-
htmlFor: _omitHtmlFor,
|
|
17
|
-
onPress,
|
|
18
|
-
...props
|
|
19
|
-
}, ref) => {
|
|
20
|
-
void _omitHtmlFor;
|
|
21
|
-
const {
|
|
22
|
-
focusInput,
|
|
23
|
-
isDisabled
|
|
24
|
-
} = (0, _utils.useFormControlContext)();
|
|
25
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
26
|
-
ref: ref,
|
|
27
|
-
...props,
|
|
28
|
-
disabled: Boolean(isDisabled),
|
|
29
|
-
onPress: (0, _utils.composeEventHandlers)(onPress, () => focusInput?.())
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
BaseFieldLabel.displayName = 'BaseFieldLabel';
|
|
33
|
-
//# sourceMappingURL=FieldLabel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_utils","_jsxRuntime","BaseFieldLabel","exports","forwardRef","htmlFor","_omitHtmlFor","onPress","props","ref","focusInput","isDisabled","useFormControlContext","jsx","Text","disabled","Boolean","composeEventHandlers","displayName"],"sourceRoot":"../../../../src","sources":["components/Field/FieldLabel.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAA4E,IAAAG,WAAA,GAAAH,OAAA;AAS5E;AACA;AACA;AACA;AACO,MAAMI,cAAc,GAAAC,OAAA,CAAAD,cAAA,gBAAG,IAAAE,iBAAU,EACtC,CAAC;EAAEC,OAAO,EAAEC,YAAY;EAAEC,OAAO;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACrD,KAAKH,YAAY;EAEjB,MAAM;IAAEI,UAAU;IAAEC;EAAW,CAAC,GAAG,IAAAC,4BAAqB,EAAC,CAAC;EAE1D,oBACE,IAAAX,WAAA,CAAAY,GAAA,EAACd,YAAA,CAAAe,IAAI;IACHL,GAAG,EAAEA,GAAI;IAAA,GACLD,KAAK;IACTO,QAAQ,EAAEC,OAAO,CAACL,UAAU,CAAE;IAC9BJ,OAAO,EAAE,IAAAU,2BAAoB,EAACV,OAAO,EAAE,MAAMG,UAAU,GAAG,CAAC;EAAE,CAC9D,CAAC;AAEN,CACF,CAAC;AAEDR,cAAc,CAACgB,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BaseFieldLabel = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
|
-
// TODO: Why does dataSet need to be decomposed into individual data attributes?
|
|
11
|
-
|
|
12
|
-
/** Real `<label>` so clicking the label focuses the associated control (`htmlFor` → input `id`). */
|
|
13
|
-
const BaseFieldLabel = exports.BaseFieldLabel = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
14
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
15
|
-
ref: ref,
|
|
16
|
-
...props,
|
|
17
|
-
"data-invalid": props.dataSet?.invalid,
|
|
18
|
-
"data-required": props.dataSet?.required
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
BaseFieldLabel.displayName = 'BaseFieldLabel';
|
|
22
|
-
//# sourceMappingURL=FieldLabel.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BaseFieldLabel","exports","forwardRef","props","ref","jsx","dataSet","invalid","required","displayName"],"sourceRoot":"../../../../src","sources":["components/Field/FieldLabel.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0D,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAG1D;;AASA;AACO,MAAMkB,cAAc,GAAAC,OAAA,CAAAD,cAAA,gBAAG,IAAAE,iBAAU,EAAwC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC9F,oBACE,IAAAxB,WAAA,CAAAyB,GAAA;IACED,GAAG,EAAEA,GAAI;IAAA,GACJD,KAAK;IACV,gBAAcA,KAAK,CAACG,OAAO,EAAEC,OAAQ;IACrC,iBAAeJ,KAAK,CAACG,OAAO,EAAEE;EAAS,CACxC,CAAC;AAEN,CAAC,CAAC;AAEFR,cAAc,CAACS,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BaseFormRoot = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
const BaseFormRoot = exports.BaseFormRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
11
|
-
onSubmit: _onSubmit,
|
|
12
|
-
action: _action,
|
|
13
|
-
method: _method,
|
|
14
|
-
...props
|
|
15
|
-
}, ref) => {
|
|
16
|
-
void _onSubmit;
|
|
17
|
-
void _action;
|
|
18
|
-
void _method;
|
|
19
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
20
|
-
ref: ref,
|
|
21
|
-
...props
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
BaseFormRoot.displayName = 'BaseFormRoot';
|
|
25
|
-
//# sourceMappingURL=FormRoot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_jsxRuntime","BaseFormRoot","exports","forwardRef","onSubmit","_onSubmit","action","_action","method","_method","props","ref","jsx","View","displayName"],"sourceRoot":"../../../../src","sources":["components/Form/FormRoot.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAoD,IAAAE,WAAA,GAAAF,OAAA;AAS7C,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,gBAAG,IAAAE,iBAAU,EACpC,CAAC;EAAEC,QAAQ,EAAEC,SAAS;EAAEC,MAAM,EAAEC,OAAO;EAAEC,MAAM,EAAEC,OAAO;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC5E,KAAKN,SAAS;EACd,KAAKE,OAAO;EACZ,KAAKE,OAAO;EACZ,oBAAO,IAAAT,WAAA,CAAAY,GAAA,EAACb,YAAA,CAAAc,IAAI;IAACF,GAAG,EAAEA,GAAI;IAAA,GAAKD;EAAK,CAAG,CAAC;AACtC,CACF,CAAC;AAEDT,YAAY,CAACa,WAAW,GAAG,cAAc","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BaseFormRoot = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
|
-
const BaseFormRoot = exports.BaseFormRoot = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
11
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
|
|
12
|
-
ref: ref,
|
|
13
|
-
...props
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
BaseFormRoot.displayName = 'BaseFormRoot';
|
|
17
|
-
//# sourceMappingURL=FormRoot.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BaseFormRoot","exports","forwardRef","props","ref","jsx","displayName"],"sourceRoot":"../../../../src","sources":["components/Form/FormRoot.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0C,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAOnC,MAAMkB,YAAY,GAAAC,OAAA,CAAAD,YAAA,gBAAG,IAAAE,iBAAU,EAAqC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACzF,oBAAO,IAAAxB,WAAA,CAAAyB,GAAA;IAAMD,GAAG,EAAEA,GAAI;IAAA,GAAKD;EAAK,CAAG,CAAC;AACtC,CAAC,CAAC;AAEFH,YAAY,CAACM,WAAW,GAAG,cAAc","ignoreList":[]}
|