sy-ui-lib 1.0.51 → 1.0.53

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.
@@ -1,45 +1,3 @@
1
1
  import { UserBetSlipProps } from './UserBetSlip.types';
2
- /**
3
- * UserBetSlip component renders a list of user bet slips with support for
4
- * toggling between a compact view and a detailed view using a checkbox.
5
- *
6
- * - Compact view (default): Shows bet type, subtitle, result, and odds.
7
- * - Detailed view (when checkbox is enabled): Expands each bet slip to show reference, date & time, and a breakdown of odds.
8
- * - On mobile screens: This component is typically rendered inside a `Modal` for better UX on limited screen space.
9
- * - Supports i18n/localization via `titles` prop (all labels in one place).
10
- *
11
- * @param {UserBetSlipProps} props - Contains bet slip data and UI labels.
12
- * @returns {JSX.Element} Structured layout of bet slips.
13
- *
14
- * @example
15
- * const bets = [
16
- * {
17
- * id: "1",
18
- * type: "Back",
19
- * subTitle: "Tseng, Chun Hsin",
20
- * result: "Winner",
21
- * reference: "386560789",
22
- * time: "02-07-2025 11:33",
23
- * oddsDetails: [
24
- * { title: "Odds", value: 13.5 },
25
- * { title: "Stake", value: 10.001 },
26
- * { title: "P&L", value: 125.0 },
27
- * ],
28
- * },
29
- * ];
30
- * @example
31
- * <UserBetSlip
32
- * titles={{
33
- * slipTitle: "Open Bets",
34
- * betFor: "Bet For",
35
- * betAgainst: "Bet Against",
36
- * betInfo: "Bet Info",
37
- * reference: "Ref:",
38
- * time: "Time:",
39
- * nullMessage: "No bets available at the moment.",
40
- * }}
41
- * bets={bets}
42
- * />
43
- */
44
2
  declare const UserBetSlip: React.FC<UserBetSlipProps>;
45
3
  export default UserBetSlip;
@@ -3,7 +3,14 @@ import { default as UserBetSlip } from './UserBetSlip.component';
3
3
  declare const meta: Meta<typeof UserBetSlip>;
4
4
  /** Type alias for the story object of AdminBetSlip */
5
5
  type Story = StoryObj<typeof UserBetSlip>;
6
- /** Default story configuration for AdminBetSlip */
6
+ /** Default story: header shown, accordion open by default */
7
7
  export declare const Default: Story;
8
+ /** Accordion starts collapsed; click the header to expand */
9
+ export declare const CollapsedByDefault: Story;
10
+ /** Header shown but the toggle is disabled, so the slip stays open */
11
+ export declare const NotCollapsible: Story;
12
+ /** Empty state inside the accordion (shows the null message) */
13
+ export declare const EmptyState: Story;
14
+ /** Mobile: rendered inside a Modal, no header so no accordion */
8
15
  export declare const ForMobile: Story;
9
16
  export default meta;
@@ -45,6 +45,8 @@ export interface UserBetSlipProps {
45
45
  bets: UserBetSlipDetails[];
46
46
  /** Controls visibility of the header section. */
47
47
  showHeader?: boolean;
48
+ collapsible?: boolean;
49
+ defaultOpen?: boolean;
48
50
  }
49
51
  /** Props for OddsDetails component */
50
52
  export interface OddsDetailsProps {