@sesamehr/react-design-system 2.0.0-beta.7 → 2.0.0-beta.8

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.
@@ -26,9 +26,10 @@ export interface UseTableVirtualOptions {
26
26
  * This is what turns a scroll position into a row index, so it is worth
27
27
  * getting right: the error is paid on every row crossed, which is nothing at
28
28
  * one click of the wheel and hundreds of rows after a flick. The default,
29
- * 48px, is the height `TableRow` gives itself with plain text in it. Rows
30
- * with an avatar or two lines of text are taller, and those tables should say
31
- * so here.
29
+ * 52px, is `--table-row-height` on `.oxTableRoot` — the minimum a row's cells
30
+ * give it with plain text in them. (Not `TableRow`'s own CSS: `height` on a
31
+ * `<tr>` is ignored by the table layout algorithm.) Rows with an avatar or two
32
+ * lines of text are taller, and those tables should say so here.
32
33
  *
33
34
  * It is deliberately a number you give rather than one measured from the
34
35
  * page. Measuring as you scroll means the total height changes as you scroll,
@@ -1,10 +1,27 @@
1
1
  import { ReactNode } from 'react';
2
- import { ChatBubbleVariants } from './index.ts';
2
+ import { ChatBubbleDelivery, ChatBubbleVariants } from './index.ts';
3
3
  export interface ChatBubbleProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  /** Who said it: the reader, or someone else */
5
5
  author?: ChatBubbleVariants['author'];
6
- /** The line under the message — the timestamp, and a receipt if there is one */
7
- meta?: ReactNode;
6
+ /**
7
+ * When the message went and whether it arrived, drawn as the footer line.
8
+ *
9
+ * Each key stands alone, so `{ time }`, `{ status }`, both or neither all
10
+ * work and an omitted key renders nothing — there is no flag to set and no
11
+ * line to assemble. Anything this cannot express (a delivery error, an
12
+ * "edited" marker, an avatar) goes in `footer` instead, which replaces this
13
+ * line wholesale when both are given.
14
+ */
15
+ delivery?: ChatBubbleDelivery;
16
+ /**
17
+ * The line under the message, drawn by hand. Ports the Vue `#footer` slot,
18
+ * and wins over `delivery` when both are supplied.
19
+ *
20
+ * Spelled `ReactNode` inline rather than behind an alias because
21
+ * `orxata/max-props` discounts a slot by reading the type *text*, and an alias
22
+ * hides it.
23
+ */
24
+ footer?: ReactNode;
8
25
  dataTestid: string;
9
26
  }
10
27
  /** ChatBubble — mirrors `@sesame/orxata-core` ChatBubble. */
@@ -1,5 +1,36 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
+ import { ChatBubbleStatusVariants } from './ChatBubbleStatus/index.ts';
2
3
  export { ChatBubble, type ChatBubbleProps } from './ChatBubble.tsx';
4
+ /**
5
+ * When the message went and whether it arrived — the bubble's footer, as data
6
+ * rather than as markup.
7
+ *
8
+ * One object rather than a prop each, for the same reason `ChatInput` takes one
9
+ * `actionLabels`: the parts belong together, they are all optional, and spending
10
+ * a prop per part would put a two-field component against the five-prop cap for
11
+ * no gain. Every key is independent — a time with no receipt, a receipt with no
12
+ * time, both, or neither — and an omitted key renders nothing at all, so the
13
+ * four combinations need no flags to select between them.
14
+ *
15
+ * Nothing here is prose the design system invents. `time` is a string the caller
16
+ * has already formatted, because formatting a date needs a locale, a timezone
17
+ * and a house style, and this package ships no strings and knows none of those.
18
+ * `status` is not text at all — it is an enum the bubble draws as an icon.
19
+ */
20
+ export interface ChatBubbleDelivery {
21
+ /**
22
+ * The timestamp, already formatted — `'13 mar'`, `'09:41'`, whatever the
23
+ * product shows. Omit it for a bubble that carries only a receipt.
24
+ */
25
+ time?: string;
26
+ /**
27
+ * How far along the message is, drawn as a receipt.
28
+ *
29
+ * Only your own messages have one: there is no receipt for what somebody else
30
+ * said, so a bubble with `author: 'other'` normally omits this.
31
+ */
32
+ status?: NonNullable<ChatBubbleStatusVariants['status']>;
33
+ }
3
34
  /**
4
35
  * Who said it, which is the only thing that varies.
5
36
  *
package/dist/main.d.ts CHANGED
@@ -25,7 +25,7 @@ export { NumberFlow as OxNumberFlow, resolveNumberFlowPreset, NUMBER_FLOW_PRESET
25
25
  export { PaymentCard as OxPaymentCard, paymentCardVariants, type PaymentCardVariants, type BadgeType, type CardData, } from './Display/PaymentCard/index.ts';
26
26
  export { FileCard as OxFileCard } from './Display/FileCard/index.ts';
27
27
  export { FilePreviewCard as OxFilePreviewCard } from './Display/FilePreviewCard/index.ts';
28
- export { ChatBubble as OxChatBubble, chatBubbleVariants, type ChatBubbleVariants, } from './Display/ChatBubble/index.ts';
28
+ export { ChatBubble as OxChatBubble, chatBubbleVariants, type ChatBubbleDelivery, type ChatBubbleVariants, } from './Display/ChatBubble/index.ts';
29
29
  export { ChatBubbleStatus as OxChatBubbleStatus, chatBubbleStatusVariants, type ChatBubbleStatusVariants, } from './Display/ChatBubble/ChatBubbleStatus/index.ts';
30
30
  export { Chip as OxChip, chipVariants, type ChipVariants, } from './Display/Chip/index.ts';
31
31
  export { PointMarker as OxPointMarker, pointMarkerVariants, type PointMarkerVariants, } from './Display/PointMarker/index.ts';