@sesamehr/react-design-system 3.3.1 → 3.4.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/Button/ButtonGroup/ButtonGroup.d.ts +11 -0
- package/dist/Button/ButtonGroup/index.d.ts +1 -0
- package/dist/Button/Fab/Fab.d.ts +24 -0
- package/dist/Button/Fab/index.d.ts +9 -0
- package/dist/Button/IconButton/IconButton.d.ts +2 -1
- package/dist/Button/IconButton/index.d.ts +5 -4
- package/dist/Button/SplitButton/SplitButton.d.ts +48 -0
- package/dist/Button/SplitButton/index.d.ts +1 -0
- package/dist/Button/index.d.ts +1 -1
- package/dist/Data/Table/hooks/useTableVirtual/useTableVirtual.types.d.ts +1 -1
- package/dist/Display/Badge/Badge.d.ts +3 -1
- package/dist/Display/Badge/index.d.ts +7 -5
- package/dist/Display/Mention/Mention.d.ts +28 -0
- package/dist/Display/Mention/index.d.ts +6 -0
- package/dist/Display/PlayerPill/PlayerPill.d.ts +11 -0
- package/dist/Display/PlayerPill/PlayerPillAction.d.ts +10 -0
- package/dist/Display/PlayerPill/PlayerPillStatus.d.ts +11 -0
- package/dist/Display/PlayerPill/PlayerPillTime.d.ts +18 -0
- package/dist/Display/PlayerPill/index.d.ts +15 -0
- package/dist/Display/PlayerPill/playerPillContext.d.ts +16 -0
- package/dist/Display/PlayerPill/useElapsedSeconds.d.ts +18 -0
- package/dist/Display/Tag/Tag.d.ts +17 -0
- package/dist/Display/Tag/index.d.ts +14 -0
- package/dist/Feedback/Alert/AlertDescription.d.ts +1 -1
- package/dist/Feedback/Alert/alert-context.d.ts +1 -1
- package/dist/Feedback/Bullet/index.d.ts +1 -1
- package/dist/Feedback/Dialog/DialogFullScreenContent.d.ts +33 -0
- package/dist/Feedback/Dialog/index.d.ts +1 -0
- package/dist/Feedback/EmptyState/EmptyState.d.ts +26 -0
- package/dist/Feedback/EmptyState/EmptyStateOption/EmptyStateOption.d.ts +16 -0
- package/dist/Feedback/EmptyState/EmptyStateOption/index.d.ts +1 -0
- package/dist/Feedback/EmptyState/index.d.ts +10 -0
- package/dist/Feedback/Toast/Toast.d.ts +15 -0
- package/dist/Feedback/Toast/ToastAction.d.ts +12 -0
- package/dist/Feedback/Toast/ToastClose.d.ts +12 -0
- package/dist/Feedback/Toast/ToastDescription.d.ts +4 -0
- package/dist/Feedback/Toast/ToastIcon.d.ts +5 -0
- package/dist/Feedback/Toast/ToastTitle.d.ts +4 -0
- package/dist/Feedback/Toast/Toaster.d.ts +24 -0
- package/dist/Feedback/Toast/index.d.ts +26 -0
- package/dist/Feedback/Toast/toast-context.d.ts +6 -0
- package/dist/Feedback/Toast/useToast.d.ts +51 -0
- package/dist/Forms/Field/useFieldGroup.d.ts +1 -1
- package/dist/Forms/Inputs/ColorPicker/ColorPicker.d.ts +15 -0
- package/dist/Forms/Inputs/ColorPicker/ColorPickerContent.d.ts +14 -0
- package/dist/Forms/Inputs/ColorPicker/ColorPickerSwatch.d.ts +11 -0
- package/dist/Forms/Inputs/ColorPicker/ColorPickerTrigger.d.ts +17 -0
- package/dist/Forms/Inputs/ColorPicker/index.d.ts +5 -0
- package/dist/Forms/Inputs/ColorPicker/useColorPicker.d.ts +21 -0
- package/dist/Forms/Inputs/DatePicker/DatePickerTrigger.d.ts +1 -1
- package/dist/Forms/Inputs/IconPicker/IconPicker.d.ts +42 -0
- package/dist/Forms/Inputs/IconPicker/IconPickerContent.d.ts +26 -0
- package/dist/Forms/Inputs/IconPicker/IconPickerItem.d.ts +31 -0
- package/dist/Forms/Inputs/IconPicker/IconPickerTrigger.d.ts +19 -0
- package/dist/Forms/Inputs/IconPicker/index.d.ts +5 -0
- package/dist/Forms/Inputs/IconPicker/useIconPicker.d.ts +44 -0
- package/dist/Forms/Inputs/InputOtp/InputOtpGroup/InputOtpGroup.d.ts +5 -1
- package/dist/Forms/Inputs/InputOtp/types.d.ts +1 -1
- package/dist/Forms/Inputs/Select/SelectTrigger.d.ts +1 -1
- package/dist/Forms/Inputs/Textarea/Textarea.d.ts +48 -3
- package/dist/Forms/Inputs/Textarea/index.d.ts +3 -2
- package/dist/Forms/Inputs/Toggle/Switch/Switch.d.ts +11 -0
- package/dist/Forms/Inputs/index.d.ts +2 -0
- package/dist/Forms/Inputs/inputSize.d.ts +1 -1
- package/dist/Layout/Scrollbar/Scrollbar.d.ts +2 -2
- package/dist/Navigation/Stepper/Stepper.d.ts +23 -0
- package/dist/Navigation/Stepper/StepperItem.d.ts +13 -0
- package/dist/Navigation/Stepper/StepperSubsteps.d.ts +12 -0
- package/dist/Navigation/Stepper/index.d.ts +4 -0
- package/dist/Navigation/Stepper/useStepper.d.ts +25 -0
- package/dist/Navigation/Stepper/useStepperPill.d.ts +28 -0
- package/dist/Navigation/ToggleTabs/useToggleTabsPill.d.ts +1 -1
- package/dist/Transitions/TransitionBase.d.ts +5 -1
- package/dist/hooks/useAutoGrow/useAutoGrow.d.ts +7 -0
- package/dist/main.d.ts +12 -2
- package/dist/react-design-system.css +1 -1
- package/dist/react-design-system.js +21787 -18689
- package/dist/react-design-system.umd.cjs +118 -87
- package/package.json +3 -1
- package/src/assets/styles/theme-v2.css +14 -22
- package/src/assets/styles/theme-v3.css +161 -23
- package/src/assets/styles/theme-v3.test.ts +242 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
dataTestid?: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* ButtonGroup — mirrors `@sesame/orxata-core` ButtonGroup.
|
|
6
|
+
*
|
|
7
|
+
* Welds two or more buttons into one control. The children are whatever the
|
|
8
|
+
* caller nests, and nothing here knows how many there are or what size they
|
|
9
|
+
* came in — see the stylesheet for why that last part is the whole design.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ButtonGroup: import('react').ForwardRefExoticComponent<ButtonGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ButtonGroup, type ButtonGroupProps } from './ButtonGroup.tsx';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface FabProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
2
|
+
/**
|
|
3
|
+
* The text beside the glyph, which is what makes the FAB extended. Leave it
|
|
4
|
+
* out and the button is a circle.
|
|
5
|
+
*/
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Hide the label and go back to a circle.
|
|
9
|
+
*
|
|
10
|
+
* The label stays in the accessibility tree — `sr-only`, not
|
|
11
|
+
* `display: none` — so a FAB that reads "Fichar" extended still reads
|
|
12
|
+
* "Fichar" collapsed. That is why `label` is wrapped rather than passed
|
|
13
|
+
* through.
|
|
14
|
+
*/
|
|
15
|
+
collapsed?: boolean;
|
|
16
|
+
dataTestid: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Fab — mirrors `@sesame/orxata-core` Fab.
|
|
20
|
+
*
|
|
21
|
+
* The one floating action of a view: a circle holding an icon, optionally
|
|
22
|
+
* extended with a label beside it.
|
|
23
|
+
*/
|
|
24
|
+
export declare const Fab: import('react').ForwardRefExoticComponent<FabProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { Fab, type FabProps } from './Fab.tsx';
|
|
3
|
+
/**
|
|
4
|
+
* `extended` is not a prop: `Fab.tsx` derives it from `label` and `collapsed`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const fabVariants: (props?: ({
|
|
7
|
+
extended?: boolean | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
export type FabVariants = VariantProps<typeof fabVariants>;
|
|
@@ -24,7 +24,8 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEl
|
|
|
24
24
|
/**
|
|
25
25
|
* IconButton — mirrors `@sesame/orxata-core` IconButton.
|
|
26
26
|
*
|
|
27
|
-
* A button whose entire content is an icon,
|
|
27
|
+
* A button whose entire content is an icon, a rounded square at every size
|
|
28
|
+
* with the corner growing alongside the box. The icon
|
|
28
29
|
* comes from the caller as `children`; this sizes it and never picks it.
|
|
29
30
|
* `asChild` renders the child element instead of a `<button>`, via
|
|
30
31
|
* `@radix-ui/react-slot`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
export { IconButton, type IconButtonProps } from './IconButton.tsx';
|
|
3
3
|
/**
|
|
4
|
-
* The shape half only — the
|
|
4
|
+
* The shape half only — the five square boxes and their corners. That is all this
|
|
5
5
|
* component adds.
|
|
6
6
|
*
|
|
7
7
|
* The colours are `Button`'s, and not a copy of them: `IconButton.tsx` calls
|
|
@@ -14,14 +14,15 @@ export { IconButton, type IconButtonProps } from './IconButton.tsx';
|
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* `size: null` is cva's opt-out, and it is load-bearing: `buttonVariants`
|
|
17
|
-
* defaults to `md`, which would bring `px-5
|
|
18
|
-
* and
|
|
17
|
+
* defaults to `md`, which would bring `px-5` and `h-12` along and stop the box
|
|
18
|
+
* being square. Its radius would come too, and that is the quieter half of the
|
|
19
|
+
* same bug: right at `md` by coincidence and wrong at the other three steps.
|
|
19
20
|
*
|
|
20
21
|
* Class names, not utilities — see the long note in `../index.ts` for why a
|
|
21
22
|
* utility in a variant forces the package to publish `.size-12` into the
|
|
22
23
|
* consumer's cascade.
|
|
23
24
|
*/
|
|
24
25
|
export declare const iconButtonVariants: (props?: ({
|
|
25
|
-
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
26
|
+
size?: "2xs" | "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
26
27
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
27
28
|
export type IconButtonVariants = VariantProps<typeof iconButtonVariants>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface SplitButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
|
+
/** `default` is the board's Primary. Those two are the only styles drawn. */
|
|
3
|
+
variant?: 'default' | 'outline';
|
|
4
|
+
/**
|
|
5
|
+
* The full `OxButton` scale, which the board (`1449:294`) draws in all five
|
|
6
|
+
* sizes. Every measurement comes from `OxButton` — the segment's height, its
|
|
7
|
+
* padding and its corner — so there is nothing per step in this file.
|
|
8
|
+
*/
|
|
9
|
+
size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* What a screen reader hears on the chevron. It has no text of its own, so
|
|
13
|
+
* without a name it announces as "button" and nothing else.
|
|
14
|
+
*
|
|
15
|
+
* Left alone it is the design system's own translated "More options", so this
|
|
16
|
+
* is for a caller who wants different wording — "More export formats" — not
|
|
17
|
+
* for one who wants any wording.
|
|
18
|
+
*/
|
|
19
|
+
menuLabel?: string;
|
|
20
|
+
/** The rows of the dropdown. The Vue port's `menu` slot. */
|
|
21
|
+
menu?: React.ReactNode;
|
|
22
|
+
dataTestid?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* SplitButton — mirrors `@sesame/orxata-core` SplitButton.
|
|
26
|
+
*
|
|
27
|
+
* One main action with its variants behind a chevron: "Create absence" plus
|
|
28
|
+
* "Create for several people", "Export Excel" plus PDF and CSV.
|
|
29
|
+
*
|
|
30
|
+
* Two independent buttons, which is what the design's accessibility note asks
|
|
31
|
+
* for and what the composition already gives: clicking the label runs the
|
|
32
|
+
* action, clicking the chevron opens the menu, and each is its own tab stop.
|
|
33
|
+
* `OxButtonGroup` welds them; `OxDropdownMenu` brings `aria-haspopup`,
|
|
34
|
+
* `aria-expanded`, the arrow keys and the Esc that returns focus to the
|
|
35
|
+
* chevron. Nothing here reimplements any of that.
|
|
36
|
+
*
|
|
37
|
+
* Every other prop lands on the **action**, not on the group — the Vue port
|
|
38
|
+
* does the same with `inheritAttrs: false`, so `onClick` and `type="submit"`
|
|
39
|
+
* reach the left segment in both. `className` is the exception and goes to the
|
|
40
|
+
* whole control, because a caller sizing a split button means the control and
|
|
41
|
+
* not its left half.
|
|
42
|
+
*
|
|
43
|
+
* Open is held here rather than exposed, for the same reason as in Vue: the
|
|
44
|
+
* board's `Open` state paints *both* segments with the hover fill, and the left
|
|
45
|
+
* one is a sibling of the trigger — no selector reaches it from there. A
|
|
46
|
+
* controlled path would be a sixth prop and nothing asks for one.
|
|
47
|
+
*/
|
|
48
|
+
export declare const SplitButton: import('react').ForwardRefExoticComponent<SplitButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SplitButton, type SplitButtonProps } from './SplitButton.tsx';
|
package/dist/Button/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
export { Button, type ButtonProps } from './Button.tsx';
|
|
3
3
|
export declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "default" | "destructive" | "success" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
-
size?: "icon" | "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
5
|
+
size?: "icon" | "2xs" | "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
@@ -26,7 +26,7 @@ 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
|
-
* 52px, is `--table-row-height` on `.oxTableRoot` — the minimum a row's cells
|
|
29
|
+
* 52px, is `--ox-table-row-height` on `.oxTableRoot` — the minimum a row's cells
|
|
30
30
|
* give it with plain text in them. (Not `TableRow`'s own CSS: `height` on a
|
|
31
31
|
* `<tr>` is ignored by the table layout algorithm.) Rows with an avatar or two
|
|
32
32
|
* lines of text are taller, and those tables should say so here.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BadgeVariants } from './index.ts';
|
|
2
|
-
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
2
|
+
export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'> {
|
|
3
3
|
/** How big the counter is. `sm` is the bare dot and takes no content. */
|
|
4
4
|
size?: BadgeVariants['size'];
|
|
5
|
+
/** Which fill it takes. Only the colour changes; the shape does not. */
|
|
6
|
+
color?: BadgeVariants['color'];
|
|
5
7
|
dataTestid: string;
|
|
6
8
|
}
|
|
7
9
|
/** Badge — mirrors `@sesame/orxata-core` Badge: a count, or a bare dot. */
|
|
@@ -3,13 +3,15 @@ export { Badge, type BadgeProps } from './Badge.tsx';
|
|
|
3
3
|
/**
|
|
4
4
|
* A count, or a bare dot. Not a labelled pill.
|
|
5
5
|
*
|
|
6
|
-
* Figma's `
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
* or `StatusBadge`, both of which
|
|
6
|
+
* Figma's `Badge` set is two axes and no states. Size: `sm` is a 6px dot with
|
|
7
|
+
* no content, `md` a 16px circle and `lg` a 22px one. Colour: `error` for
|
|
8
|
+
* notifications, `brand` for what is new, `neutral` for an informational
|
|
9
|
+
* count — a fill and nothing else, since shape, type and padding are identical
|
|
10
|
+
* across the three. A labelled pill is `Chip` or `StatusBadge`, both of which
|
|
11
|
+
* Figma draws as components of their own.
|
|
11
12
|
*/
|
|
12
13
|
export declare const badgeVariants: (props?: ({
|
|
13
14
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
15
|
+
color?: "error" | "neutral" | "brand" | null | undefined;
|
|
14
16
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
15
17
|
export type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface MentionProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
2
|
+
/** Whether the person mentioned is the reader, which repaints it amber */
|
|
3
|
+
personal?: boolean;
|
|
4
|
+
/** Render as the child element instead of a `<button>` (Radix Slot). */
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Mention — mirrors `@sesame/orxata-core` Mention.
|
|
9
|
+
*
|
|
10
|
+
* There is deliberately no `href` prop and no `onClick`-or-`href` pair. The
|
|
11
|
+
* brief was "a link and an event", but those are two different elements and only
|
|
12
|
+
* the caller knows which one they are after: an `<a href>` gets cmd-click,
|
|
13
|
+
* middle-click, "copy link address" and the status bar, none of which a handler
|
|
14
|
+
* reproduces, while a `<button>` is right when there is no address to go to.
|
|
15
|
+
* `asChild` is that choice made once — it is what the Vue side spells `as` /
|
|
16
|
+
* `as-child`, and the `as` prop is not ported.
|
|
17
|
+
*
|
|
18
|
+
* <Mention asChild><a href={`/people/${id}`}>@{name}</a></Mention>
|
|
19
|
+
* <Mention onClick={openProfile}>@{name}</Mention>
|
|
20
|
+
* <Mention asChild><span>@{name}</span></Mention>
|
|
21
|
+
*
|
|
22
|
+
* A `<button>` is the default because every state the board draws — hover and
|
|
23
|
+
* focus included — is an interactive one, and of the two wrong defaults, a
|
|
24
|
+
* `<span>` a caller hangs `onClick` on is the one that ships a control the
|
|
25
|
+
* keyboard cannot reach. The last form above is static highlighted text, and the
|
|
26
|
+
* stylesheet drops its pointer cursor and hover fill to say so.
|
|
27
|
+
*/
|
|
28
|
+
export declare const Mention: import('react').ForwardRefExoticComponent<MentionProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { Mention, type MentionProps } from './Mention.tsx';
|
|
3
|
+
export declare const mentionVariants: (props?: ({
|
|
4
|
+
personal?: boolean | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export type MentionVariants = VariantProps<typeof mentionVariants>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PlayerPillState } from './playerPillContext.ts';
|
|
2
|
+
export interface PlayerPillProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
|
+
state?: PlayerPillState;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
dataTestid: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The clock-in pill — mirrors `@sesame/orxata-core` PlayerPill: the day's
|
|
9
|
+
* elapsed time and the controls to move it on.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PlayerPill: import('react').ForwardRefExoticComponent<PlayerPillProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IconButtonProps } from '../../Button/IconButton/index.ts';
|
|
2
|
+
import { PlayerPillActionName } from './playerPillContext.ts';
|
|
3
|
+
export interface PlayerPillActionProps extends Omit<IconButtonProps, 'aria-label' | 'variant' | 'size' | 'children' | 'asChild'> {
|
|
4
|
+
action: PlayerPillActionName;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* One of the four round controls on the right of the pill — mirrors
|
|
8
|
+
* `@sesame/orxata-core` PlayerPillAction.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PlayerPillAction: import('react').ForwardRefExoticComponent<PlayerPillActionProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type PlayerPillStatusProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
2
|
+
/**
|
|
3
|
+
* The glyph at the head of the pill — mirrors `@sesame/orxata-core`
|
|
4
|
+
* PlayerPillStatus: a dot while the day is counting, a clock face once it is
|
|
5
|
+
* not.
|
|
6
|
+
*
|
|
7
|
+
* The dot carries the state as its accessible name: running and paused differ
|
|
8
|
+
* only in colour. The clock is `aria-hidden` instead — the readout beside it
|
|
9
|
+
* already says "Not clocked in".
|
|
10
|
+
*/
|
|
11
|
+
export declare const PlayerPillStatus: import('react').ForwardRefExoticComponent<PlayerPillStatusProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface PlayerPillTimeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
2
|
+
/** Seconds banked before the current run. The whole total when paused. */
|
|
3
|
+
seconds?: number;
|
|
4
|
+
/** When the current run began. Ignored unless the pill is running. */
|
|
5
|
+
startedAt?: Date | number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The readout — mirrors `@sesame/orxata-core` PlayerPillTime: `02:34:12` while
|
|
9
|
+
* there is a day to count, the words for "no day yet" when there is not.
|
|
10
|
+
*
|
|
11
|
+
* `startedAt` is read only while running: on pause a tracker folds the open
|
|
12
|
+
* stretch into `seconds` and forgets when it began, so a `startedAt` left
|
|
13
|
+
* behind must not keep adding to it.
|
|
14
|
+
*
|
|
15
|
+
* `aria-live="off"` is spelled out rather than left implicit — a live region
|
|
16
|
+
* here would read the whole day out once a second for eight hours.
|
|
17
|
+
*/
|
|
18
|
+
export declare const PlayerPillTime: import('react').ForwardRefExoticComponent<PlayerPillTimeProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { PlayerPill, type PlayerPillProps } from './PlayerPill.tsx';
|
|
3
|
+
export { PlayerPillAction, type PlayerPillActionProps, } from './PlayerPillAction.tsx';
|
|
4
|
+
export { PlayerPillStatus, type PlayerPillStatusProps, } from './PlayerPillStatus.tsx';
|
|
5
|
+
export { PlayerPillTime, type PlayerPillTimeProps } from './PlayerPillTime.tsx';
|
|
6
|
+
export { MISSING_PLAYER_PILL, PlayerPillContext, usePlayerPill, type PlayerPillActionName, type PlayerPillContextValue, type PlayerPillState, } from './playerPillContext.ts';
|
|
7
|
+
export { formatElapsed, useElapsedSeconds, type UseElapsedSecondsOptions, } from './useElapsedSeconds.ts';
|
|
8
|
+
/**
|
|
9
|
+
* The state classes carry the pill's fill and its text colour, and they sit on
|
|
10
|
+
* the root so the dot, the clock glyph and the readout inherit that colour.
|
|
11
|
+
*/
|
|
12
|
+
export declare const playerPillVariants: (props?: ({
|
|
13
|
+
state?: "paused" | "running" | "stopped" | null | undefined;
|
|
14
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
15
|
+
export type PlayerPillVariants = VariantProps<typeof playerPillVariants>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Which of the three the pill is in. The application owns the transitions. */
|
|
2
|
+
export type PlayerPillState = 'running' | 'paused' | 'stopped';
|
|
3
|
+
/** The four controls. Here, as in the Vue package, rather than on the component. */
|
|
4
|
+
export type PlayerPillActionName = 'start' | 'pause' | 'resume' | 'stop';
|
|
5
|
+
export interface PlayerPillContextValue {
|
|
6
|
+
state: PlayerPillState;
|
|
7
|
+
/** The root's `dataTestid`, so every part derives its own from it. */
|
|
8
|
+
dataTestid: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const PlayerPillContext: import('react').Context<PlayerPillContextValue | null>;
|
|
11
|
+
export declare const MISSING_PLAYER_PILL = "A PlayerPill part has to be rendered inside OxPlayerPill.";
|
|
12
|
+
/**
|
|
13
|
+
* Throws rather than defaulting: every part reads the state to decide whether it
|
|
14
|
+
* renders, so a silent default would put a clock-in button on a running pill.
|
|
15
|
+
*/
|
|
16
|
+
export declare const usePlayerPill: () => PlayerPillContextValue;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface UseElapsedSecondsOptions {
|
|
2
|
+
/** Everything banked before the current run. The whole total when paused. */
|
|
3
|
+
seconds: number;
|
|
4
|
+
/** When the current run began. Only read while `running`. */
|
|
5
|
+
startedAt: Date | number | undefined;
|
|
6
|
+
running: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** `02:34:12`. Hours are not wrapped — a 100-hour total renders three digits. */
|
|
9
|
+
export declare const formatElapsed: (seconds: number) => string;
|
|
10
|
+
/**
|
|
11
|
+
* A running total of seconds — mirrors `@sesame/orxata-core` useElapsedSeconds.
|
|
12
|
+
* Recomputed from `Date.now()` on every tick rather than counted up: timers
|
|
13
|
+
* fire late under load and a background tab is throttled to roughly one wake a
|
|
14
|
+
* minute, so an incremented counter comes back minutes behind while a derived
|
|
15
|
+
* one lands on the right number. The timeout targets the next whole second of
|
|
16
|
+
* the displayed value, not a flat 1000ms.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useElapsedSeconds: ({ seconds, startedAt, running, }: UseElapsedSecondsOptions) => number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TagVariants } from './index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* `color` has to be omitted before it is redeclared: React's `HTMLAttributes`
|
|
4
|
+
* carries HTML's deprecated presentational `color` attribute as `string`, and
|
|
5
|
+
* the variant union will not widen to it.
|
|
6
|
+
*/
|
|
7
|
+
export interface TagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'> {
|
|
8
|
+
/** Which category this is. The hue is the category's identity. */
|
|
9
|
+
color?: TagVariants['color'];
|
|
10
|
+
/** How loudly it is painted: a tint behind dark text, or the full hue. */
|
|
11
|
+
variant?: TagVariants['variant'];
|
|
12
|
+
/** How tall it is. Both sizes set the same 12px type. */
|
|
13
|
+
size?: TagVariants['size'];
|
|
14
|
+
dataTestid: string;
|
|
15
|
+
}
|
|
16
|
+
/** A category a thing belongs to, told apart by its hue. */
|
|
17
|
+
export declare const Tag: import('react').ForwardRefExoticComponent<TagProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { Tag, type TagProps } from './Tag.tsx';
|
|
3
|
+
/**
|
|
4
|
+
* A category a thing belongs to, told apart by its hue.
|
|
5
|
+
*
|
|
6
|
+
* The design calls the second axis `Style`; it is `variant` here because a prop
|
|
7
|
+
* named `style` would eat the caller's inline styles.
|
|
8
|
+
*/
|
|
9
|
+
export declare const tagVariants: (props?: ({
|
|
10
|
+
color?: "blue" | "fuchsia" | "green" | "indigo" | "lime" | "orange" | "pink" | "purple" | "red" | "teal" | "violet" | "yellow" | "brand" | "zinc" | "amber" | "sky" | null | undefined;
|
|
11
|
+
variant?: "solid" | "soft" | null | undefined;
|
|
12
|
+
size?: "sm" | "md" | null | undefined;
|
|
13
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
14
|
+
export type TagVariants = VariantProps<typeof tagVariants>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type AlertDescriptionProps = React.HTMLAttributes<HTMLDivElement>;
|
|
2
|
-
/** AlertDescription —
|
|
2
|
+
/** AlertDescription — folds away when a collapsible Alert is closed. */
|
|
3
3
|
export declare const AlertDescription: import('react').ForwardRefExoticComponent<AlertDescriptionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -2,6 +2,6 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
export { Bullet, type BulletProps } from './Bullet.tsx';
|
|
3
3
|
export declare const bulletVariants: (props?: ({
|
|
4
4
|
size?: "24" | "16" | "12" | "8" | null | undefined;
|
|
5
|
-
color?: "active" | "info" | "warning" | "neutral" | null | undefined;
|
|
5
|
+
color?: "active" | "error" | "info" | "warning" | "neutral" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export type BulletVariants = VariantProps<typeof bulletVariants>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
export interface DialogFullScreenContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
3
|
+
showCloseButton?: boolean;
|
|
4
|
+
/** Content of the top bar, beside the close button — usually a DialogTitle. */
|
|
5
|
+
header?: React.ReactNode;
|
|
6
|
+
/** Content of the left sidebar; the sidebar is dropped when it is absent. */
|
|
7
|
+
sidebarLeft?: React.ReactNode;
|
|
8
|
+
/** Content of the right sidebar; the sidebar is dropped when it is absent. */
|
|
9
|
+
sidebarRight?: React.ReactNode;
|
|
10
|
+
/** Content of the footer bar; the footer is dropped when it is absent. */
|
|
11
|
+
footer?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* DialogFullScreenContent — mirrors `@sesame/orxata-core`
|
|
15
|
+
* DialogFullScreenContent. The third panel shape of `Dialog`, beside
|
|
16
|
+
* `DialogContent` and `DialogTwoPanelContent`: a surface that takes the whole
|
|
17
|
+
* viewport for a long flow — a wizard, an editor with a preview, a settings
|
|
18
|
+
* screen.
|
|
19
|
+
*
|
|
20
|
+
* It is a content shape and not a component of its own because everything
|
|
21
|
+
* outside the panel is unchanged: the same `Dialog.Root`, the same portal,
|
|
22
|
+
* overlay, title, description, close button and `orxata.dialog.close`. What
|
|
23
|
+
* differs is geometry, and geometry is exactly the axis the two existing
|
|
24
|
+
* shapes already differ on.
|
|
25
|
+
*
|
|
26
|
+
* Unlike them it owns its regions rather than styling whatever the caller
|
|
27
|
+
* drops in `children`, because the top bar is a fixed 56px strip with the
|
|
28
|
+
* close button *inside* it and the body is a three-column row. A region is
|
|
29
|
+
* rendered only when its prop is filled, which is how the board's
|
|
30
|
+
* `Show left sidebar` / `Show right sidebar` / `Show stepper` toggles are
|
|
31
|
+
* expressed without a prop for each.
|
|
32
|
+
*/
|
|
33
|
+
export declare const DialogFullScreenContent: import('react').ForwardRefExoticComponent<DialogFullScreenContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -5,4 +5,5 @@ export { DialogTitle, type DialogTitleProps } from './DialogTitle.tsx';
|
|
|
5
5
|
export { DialogDescription, type DialogDescriptionProps, } from './DialogDescription.tsx';
|
|
6
6
|
export { DialogOverlay, type DialogOverlayProps } from './DialogOverlay.tsx';
|
|
7
7
|
export { DialogTwoPanelContent, type DialogTwoPanelContentProps, } from './DialogTwoPanelContent.tsx';
|
|
8
|
+
export { DialogFullScreenContent, type DialogFullScreenContentProps, } from './DialogFullScreenContent.tsx';
|
|
8
9
|
export { Trigger as DialogTrigger, Close as DialogClose, } from '@radix-ui/react-dialog';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EmptyStateVariants } from './index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* What a view says when it has nothing to show. Mirrors `@sesame/orxata-core`
|
|
4
|
+
* EmptyState.
|
|
5
|
+
*/
|
|
6
|
+
export interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
7
|
+
/** `page` fills the view; `inline` shrinks the stack for a card or a table. */
|
|
8
|
+
variant?: EmptyStateVariants['variant'];
|
|
9
|
+
/**
|
|
10
|
+
* The glyph in the circle. Defaults to a generic inbox; pass `null` to drop
|
|
11
|
+
* the circle along with it.
|
|
12
|
+
*/
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
/** The heading. Bring your own level — only the page knows which one fits. */
|
|
15
|
+
title?: React.ReactNode;
|
|
16
|
+
/** One line explaining what would be here. */
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
/** Whatever gets the user out of the empty state. */
|
|
19
|
+
actions?: React.ReactNode;
|
|
20
|
+
/** The ways to get started, as `OxEmptyStateOption` cards. */
|
|
21
|
+
options?: React.ReactNode;
|
|
22
|
+
/** A quieter way out: help, documentation, who to ask. */
|
|
23
|
+
link?: React.ReactNode;
|
|
24
|
+
dataTestid: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const EmptyState: import('react').ForwardRefExoticComponent<EmptyStateProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One of the ways to get started, for the onboarding empty state. Mirrors
|
|
3
|
+
* `@sesame/orxata-core` EmptyStateOption.
|
|
4
|
+
*/
|
|
5
|
+
export interface EmptyStateOptionProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {
|
|
6
|
+
/** Paints the brand border and announces the card as pressed. */
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
/** The glyph above the text. Defaults to a generic "new folder". */
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
/** What this option is. */
|
|
11
|
+
title?: React.ReactNode;
|
|
12
|
+
/** One line about what choosing it does. */
|
|
13
|
+
description?: React.ReactNode;
|
|
14
|
+
dataTestid: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const EmptyStateOption: import('react').ForwardRefExoticComponent<EmptyStateOptionProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EmptyStateOption, type EmptyStateOptionProps, } from './EmptyStateOption.tsx';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { EmptyState, type EmptyStateProps } from './EmptyState.tsx';
|
|
3
|
+
/**
|
|
4
|
+
* Class names, not utilities: a utility in here would be published into the
|
|
5
|
+
* consumer's cascade.
|
|
6
|
+
*/
|
|
7
|
+
export declare const emptyStateVariants: (props?: ({
|
|
8
|
+
variant?: "page" | "inline" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
export type EmptyStateVariants = VariantProps<typeof emptyStateVariants>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ToastType } from './useToast.ts';
|
|
2
|
+
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
3
|
+
export interface ToastProps extends Omit<React.ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, 'type'> {
|
|
4
|
+
type?: ToastType;
|
|
5
|
+
dataTestid?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Toast — mirrors `orxata-core` Toast.
|
|
9
|
+
*
|
|
10
|
+
* Not `role="alert"` on an error: Radix announces from a *separate* live
|
|
11
|
+
* region whose politeness `type` picks, so overriding `role` here would leave
|
|
12
|
+
* the real announcer on the wrong setting and change nothing a screen reader
|
|
13
|
+
* hears.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Toast: import('react').ForwardRefExoticComponent<ToastProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
2
|
+
export interface ToastActionProps extends React.ComponentPropsWithoutRef<typeof ToastPrimitive.Action> {
|
|
3
|
+
dataTestid?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* ToastAction — mirrors `orxata-core` ToastAction.
|
|
7
|
+
*
|
|
8
|
+
* `altText` is what a screen reader is told instead of the button, which is
|
|
9
|
+
* gone before anyone can reach it — so it must describe a route that outlives
|
|
10
|
+
* the toast.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ToastAction: import('react').ForwardRefExoticComponent<ToastActionProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
2
|
+
export interface ToastCloseProps extends React.ComponentPropsWithoutRef<typeof ToastPrimitive.Close> {
|
|
3
|
+
dataTestid?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* ToastClose — mirrors `orxata-core` ToastClose.
|
|
7
|
+
*
|
|
8
|
+
* `orxata.dialog.close` and not `orxata.toast.close`: the catalogue comes from
|
|
9
|
+
* Lokalise, so a key this repository invents renders as the key itself in
|
|
10
|
+
* every language until someone adds it there. Swap it when it lands.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ToastClose: import('react').ForwardRefExoticComponent<ToastCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
2
|
+
export type ToastDescriptionProps = React.ComponentPropsWithoutRef<typeof ToastPrimitive.Description>;
|
|
3
|
+
/** ToastDescription — mirrors `orxata-core` ToastDescription. */
|
|
4
|
+
export declare const ToastDescription: import('react').ForwardRefExoticComponent<Omit<ToastPrimitive.ToastDescriptionProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface ToastIconProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
dataTestid?: string;
|
|
3
|
+
}
|
|
4
|
+
/** ToastIcon — renders the type's default icon, or `children` if provided. */
|
|
5
|
+
export declare const ToastIcon: import('react').ForwardRefExoticComponent<ToastIconProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
2
|
+
export type ToastTitleProps = React.ComponentPropsWithoutRef<typeof ToastPrimitive.Title>;
|
|
3
|
+
/** ToastTitle — mirrors `orxata-core` ToastTitle. */
|
|
4
|
+
export declare const ToastTitle: import('react').ForwardRefExoticComponent<Omit<ToastPrimitive.ToastTitleProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ToastPosition } from './index.ts';
|
|
2
|
+
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
3
|
+
export interface ToasterProps extends React.ComponentPropsWithoutRef<typeof ToastPrimitive.Viewport> {
|
|
4
|
+
/** Which corner the stack is anchored to. */
|
|
5
|
+
position?: ToastPosition;
|
|
6
|
+
/** Milliseconds a toast stays up unless it asks for its own. */
|
|
7
|
+
duration?: number;
|
|
8
|
+
/** How many may be on screen at once; a newer one closes the oldest. */
|
|
9
|
+
max?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Where the viewport is portalled. `body` is the default and should stay
|
|
12
|
+
* that way; the escape hatch is for a native `<dialog>`, whose top layer
|
|
13
|
+
* paints over everything in `body`.
|
|
14
|
+
*/
|
|
15
|
+
to?: string | Element;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Toaster — mirrors `orxata-core` Toaster.
|
|
19
|
+
*
|
|
20
|
+
* Radix has no `Portal` part, so the portal is `react-dom`'s `createPortal`
|
|
21
|
+
* and it has to stay *inside* `Toast.Provider` for the viewport to read the
|
|
22
|
+
* provider's context across the boundary.
|
|
23
|
+
*/
|
|
24
|
+
export declare const Toaster: import('react').ForwardRefExoticComponent<ToasterProps & import('react').RefAttributes<HTMLOListElement>>;
|