@sesamehr/react-design-system 1.3.0 → 1.5.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/Display/Avatar/AvatarRounded/AvatarRounded.d.ts +23 -0
- package/dist/Display/Avatar/AvatarSquare/AvatarSquare.d.ts +23 -0
- package/dist/Display/Avatar/hooks/useAvatarBullet.d.ts +6 -13
- package/dist/Display/Avatar/index.d.ts +32 -6
- package/dist/Display/PointMarker/PointMarker.d.ts +8 -0
- package/dist/Display/PointMarker/index.d.ts +18 -0
- package/dist/main.d.ts +2 -1
- package/dist/react-design-system.css +1 -1
- package/dist/react-design-system.js +4031 -3959
- package/dist/react-design-system.umd.cjs +37 -37
- package/package.json +1 -1
- package/src/assets/styles/primitives-v3.css +9 -5
- package/src/assets/styles/theme-v3.css +42 -0
- package/dist/Display/Avatar/Avatar.d.ts +0 -24
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BulletVariants } from '../../../Feedback/Bullet/index.ts';
|
|
2
|
+
import { AvatarRoundedVariants } from '../index.ts';
|
|
3
|
+
export interface AvatarRoundedProps extends React.HTMLAttributes<HTMLSpanElement>, Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'alt'> {
|
|
4
|
+
/** Image source URL. When set it replaces the children. */
|
|
5
|
+
src?: string;
|
|
6
|
+
/** Avatar size */
|
|
7
|
+
size?: AvatarRoundedVariants['size'];
|
|
8
|
+
/** Colour pair used when there is no image */
|
|
9
|
+
tone?: AvatarRoundedVariants['tone'];
|
|
10
|
+
/** Dimmed appearance, layered over whatever the avatar shows */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Status indicator colour — sits on the circle's edge */
|
|
13
|
+
status?: BulletVariants['color'];
|
|
14
|
+
/** Rendered on the top-right edge, over the avatar */
|
|
15
|
+
action?: React.ReactNode;
|
|
16
|
+
/** Rendered centred on the bottom edge */
|
|
17
|
+
label?: React.ReactNode;
|
|
18
|
+
dataTestid: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* AvatarRounded — mirrors `@sesame/orxata-core` AvatarRounded.
|
|
22
|
+
*/
|
|
23
|
+
export declare const AvatarRounded: import('react').ForwardRefExoticComponent<AvatarRoundedProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BulletVariants } from '../../../Feedback/Bullet/index.ts';
|
|
2
|
+
import { AvatarSquareVariants } from '../index.ts';
|
|
3
|
+
export interface AvatarSquareProps extends React.HTMLAttributes<HTMLSpanElement>, Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'alt'> {
|
|
4
|
+
/** Image source URL. When set it replaces the children. */
|
|
5
|
+
src?: string;
|
|
6
|
+
/** Avatar size */
|
|
7
|
+
size?: AvatarSquareVariants['size'];
|
|
8
|
+
/** Colour pair used when there is no image */
|
|
9
|
+
tone?: AvatarSquareVariants['tone'];
|
|
10
|
+
/** Dimmed appearance, layered over whatever the avatar shows */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Status indicator colour — sits on the shape's corner */
|
|
13
|
+
status?: BulletVariants['color'];
|
|
14
|
+
/** Rendered on the top-right corner, over the avatar */
|
|
15
|
+
action?: React.ReactNode;
|
|
16
|
+
/** Rendered centred on the bottom edge */
|
|
17
|
+
label?: React.ReactNode;
|
|
18
|
+
dataTestid: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* AvatarSquare — mirrors `@sesame/orxata-core` AvatarSquare.
|
|
22
|
+
*/
|
|
23
|
+
export declare const AvatarSquare: import('react').ForwardRefExoticComponent<AvatarSquareProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interface BulletBottomStyle {
|
|
8
|
-
bottom: string;
|
|
9
|
-
left: string;
|
|
10
|
-
}
|
|
11
|
-
export type BulletStyle = BulletTopStyle | BulletBottomStyle;
|
|
1
|
+
import { AvatarSize } from '../index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Picks the status bullet's size for a given avatar size. Where the bullet sits
|
|
4
|
+
* is not here: both shapes hang it off their own 45° point, which is a corner
|
|
5
|
+
* offset each component states once in CSS rather than a per-size map.
|
|
6
|
+
*/
|
|
12
7
|
export declare function useAvatarBullet(size: AvatarSize): {
|
|
13
8
|
bulletSize: "24" | "16" | "12" | "8" | null | undefined;
|
|
14
|
-
bulletStyle: BulletStyle;
|
|
15
9
|
};
|
|
16
|
-
export {};
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
4
|
-
|
|
2
|
+
export { AvatarRounded } from './AvatarRounded/AvatarRounded.tsx';
|
|
3
|
+
export type { AvatarRoundedProps } from './AvatarRounded/AvatarRounded.tsx';
|
|
4
|
+
export { AvatarSquare } from './AvatarSquare/AvatarSquare.tsx';
|
|
5
|
+
export type { AvatarSquareProps } from './AvatarSquare/AvatarSquare.tsx';
|
|
6
|
+
export { useAvatarBullet } from './hooks/useAvatarBullet.ts';
|
|
7
|
+
/**
|
|
8
|
+
* The two shapes differ by their corner radius and nothing else, so everything
|
|
9
|
+
* below is deliberately written out twice rather than spread from a constant:
|
|
10
|
+
* `parity-variants` diffs these objects as source text against the Vue package,
|
|
11
|
+
* and a variant it cannot see is a variant it stops checking.
|
|
12
|
+
*
|
|
13
|
+
* Sizes are the five the design draws — 24, 32, 48, 64 and 80px. The type scale
|
|
14
|
+
* rides along with the box because the design pairs them one to one, and every
|
|
15
|
+
* pair lands on a Tailwind step exactly (24/32, 30/36, 36/40).
|
|
16
|
+
*
|
|
17
|
+
* `tone` only shows through when there is no image: `brand` is the design's
|
|
18
|
+
* `type=text`, `neutral` its `type=counter`. Nothing here reads the children, so
|
|
19
|
+
* a counter in brand or initials in grey are both reachable — the design couples
|
|
20
|
+
* content to colour, the component has no reason to.
|
|
21
|
+
*/
|
|
22
|
+
export declare const avatarSquareVariants: (props?: ({
|
|
23
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
24
|
+
tone?: "neutral" | "brand" | null | undefined;
|
|
25
|
+
disabled?: boolean | null | undefined;
|
|
5
26
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
-
export declare const
|
|
7
|
-
size?: "xs" | "sm" | "md" | "lg" | "
|
|
27
|
+
export declare const avatarRoundedVariants: (props?: ({
|
|
28
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
29
|
+
tone?: "neutral" | "brand" | null | undefined;
|
|
30
|
+
disabled?: boolean | null | undefined;
|
|
8
31
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
-
export type
|
|
32
|
+
export type AvatarSquareVariants = VariantProps<typeof avatarSquareVariants>;
|
|
33
|
+
export type AvatarRoundedVariants = VariantProps<typeof avatarRoundedVariants>;
|
|
34
|
+
export type AvatarSize = NonNullable<AvatarSquareVariants['size']>;
|
|
35
|
+
export type AvatarTone = NonNullable<AvatarSquareVariants['tone']>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PointMarkerVariants } from './index.ts';
|
|
2
|
+
export interface PointMarkerProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'> {
|
|
3
|
+
/** Colour of the centre dot */
|
|
4
|
+
color?: PointMarkerVariants['color'];
|
|
5
|
+
dataTestid: string;
|
|
6
|
+
}
|
|
7
|
+
/** PointMarker — mirrors `@sesame/orxata-core` PointMarker. */
|
|
8
|
+
export declare const PointMarker: import('react').ForwardRefExoticComponent<PointMarkerProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { PointMarker } from './PointMarker.tsx';
|
|
3
|
+
export type { PointMarkerProps } from './PointMarker.tsx';
|
|
4
|
+
/**
|
|
5
|
+
* A marker is a fixed 32px ring with an 8px dot inside it, and the dot's colour
|
|
6
|
+
* is the only thing the design varies. The values are category slots, not hue
|
|
7
|
+
* names: a caller marking "offices" picks a category and keeps meaning the same
|
|
8
|
+
* thing if the palette is re-pointed, which naming them `teal` or `amber` would
|
|
9
|
+
* not survive. The hue behind each slot lives in `--category-*` in the theme —
|
|
10
|
+
* the comments below say what it is today, and are the only thing that changes
|
|
11
|
+
* when design moves one.
|
|
12
|
+
*
|
|
13
|
+
* The ring never varies, so it lives in the component's own styles.
|
|
14
|
+
*/
|
|
15
|
+
export declare const pointMarkerVariants: (props?: ({
|
|
16
|
+
color?: "category-1" | "category-2" | "category-3" | "category-4" | "category-5" | "category-6" | "category-7" | "category-8" | "category-9" | "category-10" | "category-11" | "category-12" | "category-13" | "category-14" | "category-15" | "category-16" | "category-17" | "category-18" | "category-19" | null | undefined;
|
|
17
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
18
|
+
export type PointMarkerVariants = VariantProps<typeof pointMarkerVariants>;
|
package/dist/main.d.ts
CHANGED
|
@@ -9,10 +9,11 @@ export { Button as OxButton, buttonVariants, type ButtonVariants, } from './Butt
|
|
|
9
9
|
export { Card as OxCard } from './Layout/Card/index.ts';
|
|
10
10
|
export { Divider as OxDivider, type DividerProps, } from './Layout/Divider/index.ts';
|
|
11
11
|
export { Resizable as OxResizable, ResizablePanel as OxResizablePanel, ResizableHandle as OxResizableHandle, } from './Layout/Resizable/index.ts';
|
|
12
|
-
export {
|
|
12
|
+
export { AvatarRounded as OxAvatarRounded, AvatarSquare as OxAvatarSquare, avatarRoundedVariants, avatarSquareVariants, type AvatarRoundedVariants, type AvatarSize, type AvatarSquareVariants, type AvatarTone, } from './Display/Avatar/index.ts';
|
|
13
13
|
export { AvatarGroup as OxAvatarGroup, type AvatarItem, } from './Display/AvatarGroup/index.ts';
|
|
14
14
|
export { Badge as OxBadge, badgeVariants, type BadgeVariants, } from './Display/Badge/index.ts';
|
|
15
15
|
export { PaymentCard as OxPaymentCard, paymentCardVariants, type PaymentCardVariants, type BadgeType, type CardData, } from './Display/PaymentCard/index.ts';
|
|
16
|
+
export { PointMarker as OxPointMarker, pointMarkerVariants, type PointMarkerVariants, } from './Display/PointMarker/index.ts';
|
|
16
17
|
export { StatusBadge as OxStatusBadge, statusBadgeVariants, indicatorVariants, type StatusBadgeVariants, } from './Feedback/StatusBadge/index.ts';
|
|
17
18
|
export { Bullet as OxBullet, bulletVariants, type BulletVariants, } from './Feedback/Bullet/index.ts';
|
|
18
19
|
export { Alert as OxAlert, AlertClose as OxAlertClose, AlertDescription as OxAlertDescription, AlertIcon as OxAlertIcon, AlertTitle as OxAlertTitle, AlertToggle as OxAlertToggle, } from './Feedback/Alert/index.ts';
|