@jobber/components-native 0.105.4 → 0.106.0
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/docs/ActionItem/ActionItem.md +1 -1
- package/dist/docs/ButtonGroup/ButtonGroup.md +2 -2
- package/dist/docs/Chip/Chip.md +4 -4
- package/dist/docs/EmptyState/EmptyState.md +1 -1
- package/dist/docs/Icon/Icon.md +1 -1
- package/dist/docs/IconButton/IconButton.md +1 -1
- package/dist/docs/usage-guidelines/usage-guidelines.md +5 -5
- package/dist/package.json +5 -3
- package/dist/src/primitives/Portal/index.js +5 -0
- package/dist/src/primitives/Select/SelectPrimitive.js +173 -0
- package/dist/src/primitives/Select/SelectPrimitive.style.js +112 -0
- package/dist/src/primitives/Select/SelectPrimitive.test.js +243 -0
- package/dist/src/primitives/Select/index.js +1 -0
- package/dist/src/primitives/Select/types.js +1 -0
- package/dist/src/primitives/index.js +2 -0
- package/dist/src/utils/test/PortalHostWrapper.js +11 -0
- package/dist/src/utils/test/index.js +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/src/primitives/Portal/index.d.ts +1 -0
- package/dist/types/src/primitives/Select/SelectPrimitive.d.ts +67 -0
- package/dist/types/src/primitives/Select/SelectPrimitive.style.d.ts +105 -0
- package/dist/types/src/primitives/Select/SelectPrimitive.test.d.ts +1 -0
- package/dist/types/src/primitives/Select/index.d.ts +2 -0
- package/dist/types/src/primitives/Select/types.d.ts +41 -0
- package/dist/types/src/primitives/index.d.ts +2 -0
- package/dist/types/src/utils/test/PortalHostWrapper.d.ts +10 -0
- package/dist/types/src/utils/test/index.d.ts +1 -0
- package/package.json +5 -3
- package/src/primitives/Portal/index.ts +5 -0
- package/src/primitives/Select/SelectPrimitive.stories.tsx +221 -0
- package/src/primitives/Select/SelectPrimitive.style.ts +141 -0
- package/src/primitives/Select/SelectPrimitive.test.tsx +372 -0
- package/src/primitives/Select/SelectPrimitive.tsx +292 -0
- package/src/primitives/Select/index.ts +17 -0
- package/src/primitives/Select/types.ts +96 -0
- package/src/primitives/index.ts +2 -0
- package/src/utils/test/PortalHostWrapper.tsx +19 -0
- package/src/utils/test/index.ts +1 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import type {
|
|
4
|
+
ContentProps,
|
|
5
|
+
ContentRef,
|
|
6
|
+
GroupProps,
|
|
7
|
+
GroupRef,
|
|
8
|
+
ItemIndicatorProps,
|
|
9
|
+
ItemIndicatorRef,
|
|
10
|
+
ItemProps,
|
|
11
|
+
ItemRef,
|
|
12
|
+
ItemTextProps,
|
|
13
|
+
ItemTextRef,
|
|
14
|
+
LabelProps,
|
|
15
|
+
LabelRef,
|
|
16
|
+
Option,
|
|
17
|
+
OverlayProps,
|
|
18
|
+
OverlayRef,
|
|
19
|
+
PortalProps,
|
|
20
|
+
RootProps,
|
|
21
|
+
SeparatorProps,
|
|
22
|
+
SeparatorRef,
|
|
23
|
+
TriggerProps,
|
|
24
|
+
TriggerRef,
|
|
25
|
+
ValueProps,
|
|
26
|
+
ViewportProps,
|
|
27
|
+
} from "@rn-primitives/select";
|
|
28
|
+
|
|
29
|
+
export type { Option as SelectPrimitiveOption };
|
|
30
|
+
|
|
31
|
+
export type SelectPrimitiveRootProps = RootProps;
|
|
32
|
+
|
|
33
|
+
export interface SelectPrimitiveTriggerProps
|
|
34
|
+
extends Omit<TriggerProps, "style" | "children" | "disabled" | "asChild">,
|
|
35
|
+
React.RefAttributes<TriggerRef> {
|
|
36
|
+
/** Renders as `ATL-<testID>-Select-Trigger`, or `ATL-Select-Trigger` when omitted. */
|
|
37
|
+
readonly testID?: string;
|
|
38
|
+
|
|
39
|
+
/** Critical (error) border styling. Style-only — no field/validation logic. */
|
|
40
|
+
readonly invalid?: boolean;
|
|
41
|
+
|
|
42
|
+
/** Callback styles are not supported; state styling is composed internally. */
|
|
43
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
44
|
+
|
|
45
|
+
readonly children?: React.ReactNode;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type SelectPrimitiveValueProps = ValueProps;
|
|
49
|
+
|
|
50
|
+
export type SelectPrimitivePortalProps = PortalProps;
|
|
51
|
+
|
|
52
|
+
export interface SelectPrimitiveOverlayProps
|
|
53
|
+
extends Omit<OverlayProps, "style" | "asChild">,
|
|
54
|
+
React.RefAttributes<OverlayRef> {
|
|
55
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface SelectPrimitiveContentProps
|
|
59
|
+
extends ContentProps,
|
|
60
|
+
React.RefAttributes<ContentRef> {}
|
|
61
|
+
|
|
62
|
+
export type SelectPrimitiveViewportProps = ViewportProps;
|
|
63
|
+
|
|
64
|
+
export interface SelectPrimitiveItemProps
|
|
65
|
+
extends Omit<ItemProps, "style" | "asChild">,
|
|
66
|
+
React.RefAttributes<ItemRef> {
|
|
67
|
+
/** Callback styles are not supported; pressed styling is composed internally. */
|
|
68
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
69
|
+
|
|
70
|
+
/** Compose `ItemText` / `ItemIndicator` (and any other content) as children. */
|
|
71
|
+
readonly children?: React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface SelectPrimitiveItemTextProps
|
|
75
|
+
extends Omit<ItemTextProps, "asChild">,
|
|
76
|
+
React.RefAttributes<ItemTextRef> {
|
|
77
|
+
/** Greys the label; the composing layer forwards the row's disabled state. */
|
|
78
|
+
readonly disabled?: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The default selected-item checkmark; overridable via `children`. */
|
|
82
|
+
export interface SelectPrimitiveItemIndicatorProps
|
|
83
|
+
extends ItemIndicatorProps,
|
|
84
|
+
React.RefAttributes<ItemIndicatorRef> {}
|
|
85
|
+
|
|
86
|
+
export interface SelectPrimitiveGroupProps
|
|
87
|
+
extends GroupProps,
|
|
88
|
+
React.RefAttributes<GroupRef> {}
|
|
89
|
+
|
|
90
|
+
export interface SelectPrimitiveLabelProps
|
|
91
|
+
extends LabelProps,
|
|
92
|
+
React.RefAttributes<LabelRef> {}
|
|
93
|
+
|
|
94
|
+
export interface SelectPrimitiveSeparatorProps
|
|
95
|
+
extends SeparatorProps,
|
|
96
|
+
React.RefAttributes<SeparatorRef> {}
|
package/src/primitives/index.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PortalHost } from "@rn-primitives/portal";
|
|
3
|
+
|
|
4
|
+
interface PortalHostWrapperProps {
|
|
5
|
+
readonly children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Test wrapper that mounts a `PortalHost` so portal-based overlays (e.g. the
|
|
10
|
+
* Select dropdown) render: `render(ui, { wrapper: PortalHostWrapper })`.
|
|
11
|
+
*/
|
|
12
|
+
export function PortalHostWrapper({ children }: PortalHostWrapperProps) {
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
{children}
|
|
16
|
+
<PortalHost />
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
}
|
package/src/utils/test/index.ts
CHANGED