@gogitcms/design-system 0.16.0-next.4 → 0.16.0-next.6
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/package.json +1 -1
- package/src/__tests__/ContentBrowser.history.test.tsx +209 -3
- package/src/__tests__/ContentBrowser.historycollab.test.tsx +433 -0
- package/src/components/ChangeDetail.tsx +84 -10
- package/src/components/CollabField.tsx +71 -0
- package/src/components/ContentBrowser.tsx +144 -38
- package/src/components/DocumentHistory.tsx +118 -2
- package/src/components/Notifications.tsx +146 -28
- package/src/components/primitives.tsx +46 -1
- package/src/icons.ts +1 -0
- package/src/index.ts +3 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { View, StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import { View, Pressable, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import { useTheme } from "../ThemeProvider";
|
|
4
4
|
import { Text } from "./Text";
|
|
5
|
+
import { Icon } from "./Icon";
|
|
5
6
|
|
|
6
7
|
/** Bordered surface card — defined by a hairline border, never a shadow. */
|
|
7
8
|
export function Card({
|
|
@@ -141,3 +142,47 @@ export function SectionLabel({ children, style }: { children: React.ReactNode; s
|
|
|
141
142
|
</View>
|
|
142
143
|
);
|
|
143
144
|
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* A square check box: filled and ticked when on, an empty hairline box when
|
|
148
|
+
* off.
|
|
149
|
+
*
|
|
150
|
+
* Lives here rather than beside its first caller because two surfaces select
|
|
151
|
+
* things now — entry rows in the browser, and the fields of a past version in
|
|
152
|
+
* the history diff — and they have to look like the same control. The press
|
|
153
|
+
* stops propagating: every current caller puts this inside a larger Pressable
|
|
154
|
+
* (a list row, a field block), and a tick that also opened the row would be
|
|
155
|
+
* unusable.
|
|
156
|
+
*/
|
|
157
|
+
export function CheckBox({
|
|
158
|
+
value,
|
|
159
|
+
onToggle,
|
|
160
|
+
testID = "check-box",
|
|
161
|
+
}: {
|
|
162
|
+
value: boolean;
|
|
163
|
+
onToggle: () => void;
|
|
164
|
+
testID?: string;
|
|
165
|
+
}) {
|
|
166
|
+
const t = useTheme();
|
|
167
|
+
return (
|
|
168
|
+
<Pressable
|
|
169
|
+
onPress={(e?: { stopPropagation?: () => void }) => {
|
|
170
|
+
e?.stopPropagation?.();
|
|
171
|
+
onToggle();
|
|
172
|
+
}}
|
|
173
|
+
testID={testID}
|
|
174
|
+
style={{
|
|
175
|
+
width: 18,
|
|
176
|
+
height: 18,
|
|
177
|
+
borderRadius: t.radius.sm,
|
|
178
|
+
borderWidth: 1,
|
|
179
|
+
borderColor: value ? t.color.borderStrong : t.color.borderDefault,
|
|
180
|
+
backgroundColor: value ? t.color.surfaceInverted : t.color.surfaceRaised,
|
|
181
|
+
alignItems: "center",
|
|
182
|
+
justifyContent: "center",
|
|
183
|
+
}}
|
|
184
|
+
>
|
|
185
|
+
{value ? <Icon name="check" size={12} color={t.color.textInverted} /> : null}
|
|
186
|
+
</Pressable>
|
|
187
|
+
);
|
|
188
|
+
}
|
package/src/icons.ts
CHANGED
|
@@ -28,6 +28,7 @@ export const icons = {
|
|
|
28
28
|
chevronDown: ["m6 9 6 6 6-6"],
|
|
29
29
|
chevronUp: ["m18 15-6-6-6 6"],
|
|
30
30
|
folder: ["M3 6a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"],
|
|
31
|
+
user: ["M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", "M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"],
|
|
31
32
|
building: ["M3 21h18", "M6 21V7l7-4v18", "M18 21V11l-5-3"],
|
|
32
33
|
menu: ["M3 6h18", "M3 12h18", "M3 18h18"],
|
|
33
34
|
plus: ["M5 12h14", "M12 5v14"],
|
package/src/index.ts
CHANGED
|
@@ -65,7 +65,7 @@ export type {
|
|
|
65
65
|
} from "./components/ChangeRequestSummary";
|
|
66
66
|
|
|
67
67
|
// Changes surface: one document's diff between a branch and its base
|
|
68
|
-
export { ChangeDetail } from "./components/ChangeDetail";
|
|
68
|
+
export { ChangeDetail, BODY_FIELD } from "./components/ChangeDetail";
|
|
69
69
|
export { DocumentHistory } from "./components/DocumentHistory";
|
|
70
70
|
export type { DocumentHistoryProps } from "./components/DocumentHistory";
|
|
71
71
|
export { firstLine, relativeTime } from "./history";
|
|
@@ -115,9 +115,10 @@ export { Spinner } from "./components/Spinner";
|
|
|
115
115
|
export type { SpinnerProps } from "./components/Spinner";
|
|
116
116
|
|
|
117
117
|
// Notifications
|
|
118
|
-
export { NotificationBell, NotificationList } from "./components/Notifications";
|
|
118
|
+
export { NotificationBell, NotificationList, InlineCode, notificationKindIcon } from "./components/Notifications";
|
|
119
119
|
export type {
|
|
120
120
|
NotificationItem,
|
|
121
|
+
NotificationKind,
|
|
121
122
|
NotificationBellProps,
|
|
122
123
|
NotificationListProps,
|
|
123
124
|
} from "./components/Notifications";
|