@sesamehr/react-design-system 2.0.0-beta.7 → 2.0.0-beta.9
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/Data/Table/hooks/useTableVirtual/useTableVirtual.types.d.ts +4 -3
- package/dist/Display/ChatBubble/ChatBubble.d.ts +20 -3
- package/dist/Display/ChatBubble/index.d.ts +31 -0
- package/dist/Feedback/Popover/PopoverContent.d.ts +0 -7
- package/dist/Feedback/Tooltip/TooltipContent.d.ts +0 -1
- package/dist/Forms/Inputs/Combobox/ComboboxContent.d.ts +0 -11
- package/dist/Forms/Inputs/SearchPanel/SearchPanelList.d.ts +0 -31
- package/dist/Forms/Inputs/Select/SelectContent.d.ts +0 -10
- package/dist/main.d.ts +1 -1
- package/dist/react-design-system.css +1 -1
- package/dist/react-design-system.js +3496 -3449
- package/dist/react-design-system.umd.cjs +38 -38
- package/package.json +1 -1
|
@@ -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
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
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
|
-
/**
|
|
7
|
-
|
|
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
|
*
|
|
@@ -3,11 +3,4 @@ export interface PopoverContentProps extends React.ComponentPropsWithoutRef<type
|
|
|
3
3
|
showArrow?: boolean;
|
|
4
4
|
dataTestid: string;
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
* PopoverContent — portalled Radix popover content with optional arrow.
|
|
8
|
-
*
|
|
9
|
-
* `asChild` draws it on the shared `Surface`, which is what keeps a popover
|
|
10
|
-
* and a select open on the same screen from having different corners. Only the
|
|
11
|
-
* padding is a popover's own.
|
|
12
|
-
*/
|
|
13
6
|
export declare const PopoverContent: import('react').ForwardRefExoticComponent<PopoverContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -3,5 +3,4 @@ export interface TooltipContentProps extends React.ComponentPropsWithoutRef<type
|
|
|
3
3
|
showArrow?: boolean;
|
|
4
4
|
dataTestid: string;
|
|
5
5
|
}
|
|
6
|
-
/** TooltipContent — portalled Radix tooltip content with optional arrow. */
|
|
7
6
|
export declare const TooltipContent: import('react').ForwardRefExoticComponent<TooltipContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -4,15 +4,4 @@ export interface ComboboxContentProps extends Omit<React.ComponentPropsWithoutRe
|
|
|
4
4
|
sideOffset?: number;
|
|
5
5
|
align?: 'start' | 'center' | 'end';
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* ComboboxContent — the popover surface and the scrollable list in one.
|
|
9
|
-
* `@radix-ui/react-popover` provides the portal + positioning; `cmdk`'s `Command`
|
|
10
|
-
* provides item filtering. A visually-hidden `CommandInput` receives the shared
|
|
11
|
-
* search string so typing in the anchored input filters the list.
|
|
12
|
-
*
|
|
13
|
-
* `asChild` puts the shared `Surface` where the popover content element would
|
|
14
|
-
* be, and the shared viewport where cmdk's list would be, so a combobox and a
|
|
15
|
-
* select are the same card with the same padding by construction rather than
|
|
16
|
-
* by two stylesheets agreeing.
|
|
17
|
-
*/
|
|
18
7
|
export declare const ComboboxContent: import('react').ForwardRefExoticComponent<ComboboxContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
import { CommandList } from 'cmdk';
|
|
2
2
|
export type SearchPanelListProps = React.ComponentPropsWithoutRef<typeof CommandList>;
|
|
3
|
-
/**
|
|
4
|
-
* The scrolling list of groups and rows — `role="listbox"` and the rows in it —
|
|
5
|
-
* on a card that floats over the page.
|
|
6
|
-
*
|
|
7
|
-
* **It floats, and that is the point.** In the flow it pushed everything below
|
|
8
|
-
* the panel down the moment an answer landed, which is not what a dropdown does
|
|
9
|
-
* and is disqualifying for a search that lives in a header. The card is
|
|
10
|
-
* positioned by Radix's popper against the anchor `SearchPanel` wraps around
|
|
11
|
-
* itself, so it is exactly the field's width, it flips above the field when
|
|
12
|
-
* there is no room below, and it is `position: fixed` — no ancestor's
|
|
13
|
-
* `overflow` can clip it.
|
|
14
|
-
*
|
|
15
|
-
* **No portal, and that is also the point.** Everything the keyboard is made of
|
|
16
|
-
* is a relationship between this list and the field above it: cmdk gathers the
|
|
17
|
-
* rows by querying the `Command` element they sit inside, `aria-activedescendant`
|
|
18
|
-
* on the field points at a row's `id`, and the panel's custom properties reach
|
|
19
|
-
* the rows by inheriting down the tree. A `Popover.Portal` would move the rows
|
|
20
|
-
* out of `Command` entirely, and the arrows would stop finding them.
|
|
21
|
-
* Popper-positioned content does not need a portal to escape the flow —
|
|
22
|
-
* `position: fixed` already does — so it does not get one.
|
|
23
|
-
*
|
|
24
|
-
* The two auto-focus events are prevented for the same reason. A popover
|
|
25
|
-
* focuses its content when it opens and hands focus back when it closes; both
|
|
26
|
-
* would take focus off the search field, which is the one thing the arrow keys
|
|
27
|
-
* depend on. `role="presentation"` and the blanked `aria-labelledby` finish the
|
|
28
|
-
* job: the primitive believes it is a dialog, a screen reader must not, and the
|
|
29
|
-
* name it points at belongs to a trigger this panel does not have. Radix
|
|
30
|
-
* spreads the caller's props *after* its own `role`, so saying so here is
|
|
31
|
-
* enough — the Vue port has to write the same two attributes one level further
|
|
32
|
-
* down, where reka merges last.
|
|
33
|
-
*/
|
|
34
3
|
export declare const SearchPanelList: import('react').ForwardRefExoticComponent<Omit<{
|
|
35
4
|
children?: React.ReactNode;
|
|
36
5
|
} & Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
|
|
@@ -4,14 +4,4 @@ export interface SelectContentProps extends Omit<React.ComponentPropsWithoutRef<
|
|
|
4
4
|
sideOffset?: number;
|
|
5
5
|
align?: 'start' | 'center' | 'end';
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* The floating list. Always positioned against the trigger rather than over it,
|
|
9
|
-
* so the popup matches the trigger's width and never covers it.
|
|
10
|
-
*
|
|
11
|
-
* `asChild` hands the primitive's positioning, `data-state` and `data-side` to
|
|
12
|
-
* the shared `Surface`, which is the one element `Popover`, `Select`,
|
|
13
|
-
* `Combobox` and `SearchPanel` may have in common. Exactly one child sits at
|
|
14
|
-
* each slot position — Radix's `Slot` throws on a second, which is the whole
|
|
15
|
-
* reason the arrangement is safe to read at a glance.
|
|
16
|
-
*/
|
|
17
7
|
export declare const SelectContent: import('react').ForwardRefExoticComponent<SelectContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
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';
|