@wallarm-org/design-system 0.77.6 → 0.78.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.
@@ -4,6 +4,8 @@ import type { TestableProps } from '../../utils/testId';
4
4
  import { numericBadgeVariants } from './classes';
5
5
  type NumericBadgeNativeProps = HTMLAttributes<HTMLDivElement>;
6
6
  type NumericBadgeVariantsProps = Omit<VariantProps<typeof numericBadgeVariants>, 'clickable'>;
7
- export type NumericBadgeProps = NumericBadgeNativeProps & NumericBadgeVariantsProps & TestableProps;
7
+ export type NumericBadgeProps = NumericBadgeNativeProps & NumericBadgeVariantsProps & TestableProps & {
8
+ 'data-slot'?: string;
9
+ };
8
10
  export declare const NumericBadge: FC<NumericBadgeProps>;
9
11
  export {};
@@ -1,12 +1,12 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { cn } from "../../utils/cn.js";
3
3
  import { numericBadgeVariants } from "./classes.js";
4
- const NumericBadge = ({ type = 'primary', size = 'default', onClick, ...props })=>{
4
+ const NumericBadge = ({ type = 'primary', size = 'default', onClick, 'data-slot': dataSlot, ...props })=>{
5
5
  const isClickable = !!onClick;
6
6
  return /*#__PURE__*/ jsx("div", {
7
7
  ...props,
8
8
  tabIndex: isClickable ? 0 : void 0,
9
- "data-slot": "numeric-badge",
9
+ "data-slot": dataSlot ?? 'numeric-badge',
10
10
  "data-type": type,
11
11
  onClick: onClick,
12
12
  className: cn(numericBadgeVariants({
@@ -0,0 +1,7 @@
1
+ import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
2
+ import { type TestableProps } from '../../utils/testId';
3
+ export interface TimelineProps extends HTMLAttributes<HTMLOListElement>, TestableProps {
4
+ ref?: Ref<HTMLOListElement>;
5
+ children: ReactNode;
6
+ }
7
+ export declare const Timeline: FC<TimelineProps>;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { TestIdProvider } from "../../utils/testId.js";
4
+ import { timelineVariants } from "./classes.js";
5
+ const Timeline = ({ ref, className, children, 'data-testid': testId, ...props })=>/*#__PURE__*/ jsx("ol", {
6
+ ...props,
7
+ ref: ref,
8
+ "data-slot": "timeline",
9
+ "data-testid": testId,
10
+ role: "list",
11
+ className: cn(timelineVariants(), className),
12
+ children: /*#__PURE__*/ jsx(TestIdProvider, {
13
+ value: testId,
14
+ children: children
15
+ })
16
+ });
17
+ Timeline.displayName = 'Timeline';
18
+ export { Timeline };
@@ -0,0 +1,6 @@
1
+ import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface TimelineConnectorProps extends HTMLAttributes<HTMLDivElement> {
3
+ ref?: Ref<HTMLDivElement>;
4
+ children: ReactNode;
5
+ }
6
+ export declare const TimelineConnector: FC<TimelineConnectorProps>;
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { useTestId } from "../../utils/testId.js";
4
+ import { timelineConnectorVariants } from "./classes.js";
5
+ const TimelineConnector = ({ ref, className, children, ...props })=>{
6
+ const testId = useTestId('connector');
7
+ return /*#__PURE__*/ jsx("div", {
8
+ ...props,
9
+ ref: ref,
10
+ "data-slot": "timeline-connector",
11
+ "data-testid": testId,
12
+ className: cn(timelineConnectorVariants(), className),
13
+ children: children
14
+ });
15
+ };
16
+ TimelineConnector.displayName = 'TimelineConnector';
17
+ export { TimelineConnector };
@@ -0,0 +1,6 @@
1
+ import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface TimelineContentProps extends HTMLAttributes<HTMLDivElement> {
3
+ ref?: Ref<HTMLDivElement>;
4
+ children: ReactNode;
5
+ }
6
+ export declare const TimelineContent: FC<TimelineContentProps>;
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { useTestId } from "../../utils/testId.js";
4
+ import { timelineContentVariants } from "./classes.js";
5
+ const TimelineContent = ({ ref, className, children, ...props })=>{
6
+ const testId = useTestId('content');
7
+ return /*#__PURE__*/ jsx("div", {
8
+ ...props,
9
+ ref: ref,
10
+ "data-slot": "timeline-content",
11
+ "data-testid": testId,
12
+ className: cn(timelineContentVariants(), className),
13
+ children: children
14
+ });
15
+ };
16
+ TimelineContent.displayName = 'TimelineContent';
17
+ export { TimelineContent };
@@ -0,0 +1,6 @@
1
+ import type { FC, ReactNode } from 'react';
2
+ import { type TextProps } from '../Text';
3
+ export interface TimelineDescriptionProps extends Omit<TextProps, 'size' | 'weight' | 'color'> {
4
+ children: ReactNode;
5
+ }
6
+ export declare const TimelineDescription: FC<TimelineDescriptionProps>;
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTestId } from "../../utils/testId.js";
3
+ import { Text } from "../Text/index.js";
4
+ const TimelineDescription = ({ children, ...props })=>{
5
+ const testId = useTestId("description");
6
+ return /*#__PURE__*/ jsx(Text, {
7
+ ...props,
8
+ "data-slot": "timeline-description",
9
+ "data-testid": testId,
10
+ size: "sm",
11
+ color: "secondary",
12
+ children: children
13
+ });
14
+ };
15
+ TimelineDescription.displayName = "TimelineDescription";
16
+ export { TimelineDescription };
@@ -0,0 +1,5 @@
1
+ import type { FC } from 'react';
2
+ import { type NumericBadgeProps } from '../NumericBadge';
3
+ export interface TimelineIndicatorProps extends Omit<NumericBadgeProps, 'type' | 'size' | 'data-slot'> {
4
+ }
5
+ export declare const TimelineIndicator: FC<TimelineIndicatorProps>;
@@ -0,0 +1,14 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTestId } from "../../utils/testId.js";
3
+ import { NumericBadge } from "../NumericBadge/index.js";
4
+ const TimelineIndicator = (props)=>{
5
+ const testId = useTestId('indicator');
6
+ return /*#__PURE__*/ jsx(NumericBadge, {
7
+ ...props,
8
+ type: "outline",
9
+ "data-slot": "timeline-indicator",
10
+ "data-testid": testId
11
+ });
12
+ };
13
+ TimelineIndicator.displayName = 'TimelineIndicator';
14
+ export { TimelineIndicator };
@@ -0,0 +1,6 @@
1
+ import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface TimelineItemProps extends HTMLAttributes<HTMLLIElement> {
3
+ ref?: Ref<HTMLLIElement>;
4
+ children: ReactNode;
5
+ }
6
+ export declare const TimelineItem: FC<TimelineItemProps>;
@@ -0,0 +1,20 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { TestIdProvider, useTestId } from "../../utils/testId.js";
4
+ import { timelineItemVariants } from "./classes.js";
5
+ const TimelineItem = ({ ref, className, children, ...props })=>{
6
+ const testId = useTestId('item');
7
+ return /*#__PURE__*/ jsx("li", {
8
+ ...props,
9
+ ref: ref,
10
+ "data-slot": "timeline-item",
11
+ "data-testid": testId,
12
+ className: cn(timelineItemVariants(), className),
13
+ children: /*#__PURE__*/ jsx(TestIdProvider, {
14
+ value: testId,
15
+ children: children
16
+ })
17
+ });
18
+ };
19
+ TimelineItem.displayName = 'TimelineItem';
20
+ export { TimelineItem };
@@ -0,0 +1,5 @@
1
+ import type { FC } from 'react';
2
+ import { type SeparatorProps } from '../Separator';
3
+ export interface TimelineSeparatorProps extends Omit<SeparatorProps, 'orientation'> {
4
+ }
5
+ export declare const TimelineSeparator: FC<TimelineSeparatorProps>;
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { useTestId } from "../../utils/testId.js";
4
+ import { Separator } from "../Separator/index.js";
5
+ import { timelineSeparatorVariants } from "./classes.js";
6
+ const TimelineSeparator = ({ className, ...props })=>{
7
+ const testId = useTestId('separator');
8
+ return /*#__PURE__*/ jsx(Separator, {
9
+ ...props,
10
+ orientation: "vertical",
11
+ "data-slot": "timeline-separator",
12
+ "data-testid": testId,
13
+ className: cn(timelineSeparatorVariants(), className)
14
+ });
15
+ };
16
+ TimelineSeparator.displayName = 'TimelineSeparator';
17
+ export { TimelineSeparator };
@@ -0,0 +1,6 @@
1
+ import type { FC, ReactNode } from 'react';
2
+ import { type TextProps } from '../Text';
3
+ export interface TimelineTitleProps extends Omit<TextProps, 'size' | 'weight' | 'color'> {
4
+ children: ReactNode;
5
+ }
6
+ export declare const TimelineTitle: FC<TimelineTitleProps>;
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTestId } from "../../utils/testId.js";
3
+ import { Text } from "../Text/index.js";
4
+ const TimelineTitle = ({ children, ...props })=>{
5
+ const testId = useTestId('title');
6
+ return /*#__PURE__*/ jsx(Text, {
7
+ ...props,
8
+ "data-slot": "timeline-title",
9
+ "data-testid": testId,
10
+ size: "sm",
11
+ weight: "medium",
12
+ color: "primary",
13
+ children: children
14
+ });
15
+ };
16
+ TimelineTitle.displayName = 'TimelineTitle';
17
+ export { TimelineTitle };
@@ -0,0 +1,5 @@
1
+ export declare const timelineVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
2
+ export declare const timelineItemVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
3
+ export declare const timelineConnectorVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
4
+ export declare const timelineSeparatorVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
5
+ export declare const timelineContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -0,0 +1,8 @@
1
+ import { cva } from "class-variance-authority";
2
+ import { cn } from "../../utils/cn.js";
3
+ const timelineVariants = cva('list-none flex flex-col');
4
+ const timelineItemVariants = cva(cn('grid grid-cols-[auto_1fr] gap-x-8', '[&:last-child_[data-slot=timeline-separator]]:hidden', '[&:last-child_[data-slot=timeline-content]]:pb-0'));
5
+ const timelineConnectorVariants = cva('col-start-1 flex flex-col items-center h-full');
6
+ const timelineSeparatorVariants = cva('flex-1 min-h-16 self-center');
7
+ const timelineContentVariants = cva('col-start-2 flex flex-col gap-4 min-w-0 pb-16');
8
+ export { timelineConnectorVariants, timelineContentVariants, timelineItemVariants, timelineSeparatorVariants, timelineVariants };
@@ -0,0 +1,8 @@
1
+ export { Timeline, type TimelineProps } from './Timeline';
2
+ export { TimelineConnector, type TimelineConnectorProps } from './TimelineConnector';
3
+ export { TimelineContent, type TimelineContentProps } from './TimelineContent';
4
+ export { TimelineDescription, type TimelineDescriptionProps } from './TimelineDescription';
5
+ export { TimelineIndicator, type TimelineIndicatorProps } from './TimelineIndicator';
6
+ export { TimelineItem, type TimelineItemProps } from './TimelineItem';
7
+ export { TimelineSeparator, type TimelineSeparatorProps } from './TimelineSeparator';
8
+ export { TimelineTitle, type TimelineTitleProps } from './TimelineTitle';
@@ -0,0 +1,8 @@
1
+ export { Timeline } from "./Timeline.js";
2
+ export { TimelineConnector } from "./TimelineConnector.js";
3
+ export { TimelineContent } from "./TimelineContent.js";
4
+ export { TimelineDescription } from "./TimelineDescription.js";
5
+ export { TimelineIndicator } from "./TimelineIndicator.js";
6
+ export { TimelineItem } from "./TimelineItem.js";
7
+ export { TimelineSeparator } from "./TimelineSeparator.js";
8
+ export { TimelineTitle } from "./TimelineTitle.js";
package/dist/index.d.ts CHANGED
@@ -78,6 +78,7 @@ export { Text, type TextProps } from './components/Text';
78
78
  export { Textarea, type TextareaProps } from './components/Textarea';
79
79
  export { type Theme, ThemeProvider, useTheme, } from './components/ThemeProvider';
80
80
  export { TimeInput, type TimeInputProps } from './components/TimeInput';
81
+ export { Timeline, TimelineConnector, type TimelineConnectorProps, TimelineContent, type TimelineContentProps, TimelineDescription, type TimelineDescriptionProps, TimelineIndicator, type TimelineIndicatorProps, TimelineItem, type TimelineItemProps, type TimelineProps, TimelineSeparator, type TimelineSeparatorProps, TimelineTitle, type TimelineTitleProps, } from './components/Timeline';
81
82
  export { Toast, ToastActions, Toaster, toaster } from './components/Toast';
82
83
  export { ToggleButton, type ToggleButtonProps, } from './components/ToggleButton';
83
84
  export { Tooltip, TooltipContent, type TooltipProps, TooltipTrigger, } from './components/Tooltip';
package/dist/index.js CHANGED
@@ -67,6 +67,7 @@ export { Text } from "./components/Text/index.js";
67
67
  export { Textarea } from "./components/Textarea/index.js";
68
68
  export { ThemeProvider, useTheme } from "./components/ThemeProvider/index.js";
69
69
  export { TimeInput } from "./components/TimeInput/index.js";
70
+ export { Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTitle } from "./components/Timeline/index.js";
70
71
  export { Toast, ToastActions, Toaster, toaster } from "./components/Toast/index.js";
71
72
  export { ToggleButton } from "./components/ToggleButton/index.js";
72
73
  export { Tooltip, TooltipContent, TooltipTrigger } from "./components/Tooltip/index.js";