@ankhorage/zora 1.4.9 → 1.4.11

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +103 -0
  3. package/dist/components/card/meta.d.ts +1 -1
  4. package/dist/foundation/meta.d.ts +4 -4
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/layout/auth-layout/meta.d.ts +1 -1
  10. package/dist/layout/page/meta.d.ts +1 -1
  11. package/dist/layout/page-section/meta.d.ts +1 -1
  12. package/dist/metadata/allowedChildren.d.ts +3 -3
  13. package/dist/metadata/allowedChildren.d.ts.map +1 -1
  14. package/dist/metadata/allowedChildren.js +1 -0
  15. package/dist/metadata/allowedChildren.js.map +1 -1
  16. package/dist/metadata/componentMeta.d.ts.map +1 -1
  17. package/dist/metadata/componentMeta.js +2 -0
  18. package/dist/metadata/componentMeta.js.map +1 -1
  19. package/dist/patterns/message-bubble/MessageBubble.d.ts +4 -0
  20. package/dist/patterns/message-bubble/MessageBubble.d.ts.map +1 -0
  21. package/dist/patterns/message-bubble/MessageBubble.js +126 -0
  22. package/dist/patterns/message-bubble/MessageBubble.js.map +1 -0
  23. package/dist/patterns/message-bubble/index.d.ts +3 -0
  24. package/dist/patterns/message-bubble/index.d.ts.map +1 -0
  25. package/dist/patterns/message-bubble/index.js +2 -0
  26. package/dist/patterns/message-bubble/index.js.map +1 -0
  27. package/dist/patterns/message-bubble/meta.d.ts +67 -0
  28. package/dist/patterns/message-bubble/meta.d.ts.map +1 -0
  29. package/dist/patterns/message-bubble/meta.js +66 -0
  30. package/dist/patterns/message-bubble/meta.js.map +1 -0
  31. package/dist/patterns/message-bubble/types.d.ts +40 -0
  32. package/dist/patterns/message-bubble/types.d.ts.map +1 -0
  33. package/dist/patterns/message-bubble/types.js +2 -0
  34. package/dist/patterns/message-bubble/types.js.map +1 -0
  35. package/dist/patterns/notice/meta.d.ts +1 -1
  36. package/dist/patterns/panel/meta.d.ts +1 -1
  37. package/dist/patterns/post-card/meta.d.ts +1 -1
  38. package/package.json +5 -5
  39. package/src/index.ts +8 -0
  40. package/src/metadata/allowedChildren.ts +1 -0
  41. package/src/metadata/componentMeta.test.ts +1 -0
  42. package/src/metadata/componentMeta.ts +2 -0
  43. package/src/patterns/message-bubble/MessageBubble.tsx +261 -0
  44. package/src/patterns/message-bubble/index.ts +8 -0
  45. package/src/patterns/message-bubble/meta.ts +68 -0
  46. package/src/patterns/message-bubble/types.ts +43 -0
@@ -0,0 +1,68 @@
1
+ import type { ZoraComponentMeta } from '../../metadata';
2
+ import { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';
3
+
4
+ export const messageBubbleMeta = {
5
+ name: 'MessageBubble',
6
+ category: 'pattern',
7
+ description:
8
+ 'Chat/message bubble with direction, author, text, meta, and delivery status presentation.',
9
+ directManifestNode: true,
10
+ allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
11
+ blueprint: {
12
+ label: 'Message bubble',
13
+ icon: { name: 'chatbubble-outline' },
14
+ defaultProps: {
15
+ direction: 'incoming',
16
+ text: 'Can you review the latest message pattern?',
17
+ timestamp: '10:41',
18
+ },
19
+ },
20
+ props: {
21
+ direction: {
22
+ type: 'enum',
23
+ category: 'Content',
24
+ label: 'Direction',
25
+ enum: ['incoming', 'outgoing', 'system'],
26
+ default: 'incoming',
27
+ },
28
+ text: {
29
+ type: 'string',
30
+ category: 'Content',
31
+ label: 'Text',
32
+ },
33
+ timestamp: {
34
+ type: 'string',
35
+ category: 'Content',
36
+ label: 'Timestamp',
37
+ },
38
+ meta: {
39
+ type: 'string',
40
+ category: 'Content',
41
+ label: 'Meta',
42
+ },
43
+ status: {
44
+ type: 'enum',
45
+ category: 'Content',
46
+ label: 'Status',
47
+ enum: ['sending', 'sent', 'delivered', 'read', 'failed'],
48
+ },
49
+ selected: {
50
+ type: 'boolean',
51
+ category: 'State',
52
+ label: 'Selected',
53
+ default: false,
54
+ },
55
+ disabled: {
56
+ type: 'boolean',
57
+ category: 'State',
58
+ label: 'Disabled',
59
+ default: false,
60
+ },
61
+ compact: {
62
+ type: 'boolean',
63
+ category: 'Layout',
64
+ label: 'Compact',
65
+ default: false,
66
+ },
67
+ },
68
+ } as const satisfies ZoraComponentMeta;
@@ -0,0 +1,43 @@
1
+ import type React from 'react';
2
+ import type { ImageSourcePropType } from 'react-native';
3
+
4
+ import type { AvatarShape, AvatarSize } from '../../components/avatar';
5
+ import type { ZoraTone } from '../../internal/recipes';
6
+ import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
7
+
8
+ export type MessageBubbleDirection = 'incoming' | 'outgoing' | 'system';
9
+ export type MessageBubbleStatus = 'sending' | 'sent' | 'delivered' | 'read' | 'failed';
10
+ type MessageBubbleStatusContent = MessageBubbleStatus | Exclude<React.ReactNode, string>;
11
+
12
+ export interface MessageBubbleAvatar {
13
+ source?: ImageSourcePropType;
14
+ name?: string;
15
+ initials?: string;
16
+ label?: string;
17
+ size?: AvatarSize;
18
+ shape?: AvatarShape;
19
+ tone?: ZoraTone;
20
+ }
21
+
22
+ export interface MessageBubbleAuthor {
23
+ name?: React.ReactNode;
24
+ avatar?: MessageBubbleAvatar;
25
+ }
26
+
27
+ export interface MessageBubbleProps extends ZoraBaseProps {
28
+ direction?: MessageBubbleDirection;
29
+ text?: React.ReactNode;
30
+ children?: React.ReactNode;
31
+ author?: MessageBubbleAuthor;
32
+ timestamp?: React.ReactNode;
33
+ meta?: React.ReactNode;
34
+ status?: MessageBubbleStatusContent;
35
+ leading?: React.ReactNode;
36
+ trailing?: React.ReactNode;
37
+ footer?: React.ReactNode;
38
+ selected?: boolean;
39
+ disabled?: boolean;
40
+ compact?: boolean;
41
+ accessibilityLabel?: string;
42
+ onPress?: () => void;
43
+ }