@delightui/components 0.1.24 → 0.1.26

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.
@@ -7,4 +7,4 @@ import { ListItemProps, ListItemType } from "../List.types";
7
7
  * @param {ListItemProps<T>} props - The properties for the list item.
8
8
  * @returns {JSX.Element} The rendered list item.
9
9
  */
10
- export declare const ListItem: <T extends ListItemType>(props: ListItemProps<T>) => React.JSX.Element;
10
+ export declare const RootListItem: <T extends ListItemType>(props: ListItemProps<T>) => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ListItemProps } from "./ListItem.types";
3
+ declare const ListItem: (props: ListItemProps) => React.JSX.Element;
4
+ export default ListItem;
@@ -0,0 +1,23 @@
1
+ import type { HTMLAttributes, MouseEvent, ReactNode } from 'react';
2
+ export type ListItemProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
3
+ /**
4
+ * Icon to be displayed before the button's content.
5
+ */
6
+ leadingIcon?: ReactNode;
7
+ /**
8
+ * Icon to be displayed after the button's content.
9
+ */
10
+ trailingIcon?: ReactNode;
11
+ /**
12
+ * Whether the list item is disabled.
13
+ */
14
+ disabled?: boolean;
15
+ /**
16
+ * Click event handler for the list item.
17
+ */
18
+ onClick?: (event?: MouseEvent<HTMLElement>) => void;
19
+ /**
20
+ * Additional class for styling.
21
+ */
22
+ className?: string;
23
+ };
@@ -0,0 +1,4 @@
1
+ import ListItem from './ListItem';
2
+ import type { ListItemProps } from './ListItem.types';
3
+ export type { ListItemProps };
4
+ export default ListItem;
@@ -12,6 +12,7 @@ export { default as Spinner } from './Spinner';
12
12
  export { default as Text } from './Text';
13
13
  export { default as TextArea } from './TextArea';
14
14
  export { default as ResponsiveComponent } from './ResponsiveComponent';
15
+ export { default as ListItem } from './ListItem';
15
16
  export * from './ActionCard';
16
17
  export * from './ActionImage';
17
18
  export * from './Button';
@@ -26,3 +27,4 @@ export * from './Spinner';
26
27
  export * from './Text';
27
28
  export * from './TextArea';
28
29
  export * from './ResponsiveComponent';
30
+ export * from './ListItem';
@@ -16,7 +16,7 @@ export declare const filterDropdownOptions: (dropdown: HTMLDivElement, query: st
16
16
  * @param dropdown - The dropdown element to position.
17
17
  * @param inputElement - The input element to base the dropdown positioning on.
18
18
  */
19
- export declare const positionDropdownRelativeToInput: (dropdown: HTMLDivElement, inputElement: HTMLInputElement) => void;
19
+ export declare const positionDropdownRelativeToInput: (dropdown: HTMLDivElement, inputElement: HTMLInputElement, wrapperElement?: HTMLElement) => void;
20
20
  /**
21
21
  * Formats a Date object into a time string (HH:MM AM/PM).
22
22
  * @param date - The Date object to format.
@@ -1482,12 +1482,15 @@ span.flatpickr-weekday {
1482
1482
  height: auto;
1483
1483
  gap: var(--spacing-medium);
1484
1484
  border-radius: var(--corner-radius-extra-small);
1485
- border: 1px solid var(--border-primary);
1485
+ outline: 1px solid var(--colours-grey-450);
1486
1486
  background: var(--interactive-surface-secondary-default);
1487
1487
  align-items: center;
1488
1488
  padding-left: var(--spacing-medium);
1489
1489
  color: var(--text-primary);
1490
1490
  }
1491
+ .custom-time-input-wrapper:focus-within {
1492
+ outline: 1px solid var(--border-primary);
1493
+ }
1491
1494
  .custom-time-input-wrapper .custom-time-input {
1492
1495
  width: 100%;
1493
1496
  font-family: var(--font-family-body);
@@ -1506,9 +1509,9 @@ span.flatpickr-weekday {
1506
1509
  z-index: 99999;
1507
1510
  gap: var(--spacing-extra-small);
1508
1511
  color: #fff;
1509
- font-size: var(--font-size-body-small);
1510
- font-family: var(--font-family-body-small);
1511
- line-height: var(--line-height-body-small);
1512
+ font-size: 13px;
1513
+ font-family: var(--font-family-body);
1514
+ line-height: 16px;
1512
1515
  background: var(--surface-background-4);
1513
1516
  outline: 1px solid var(--border-border-grey-3);
1514
1517
  width: 250px;
@@ -1516,6 +1519,7 @@ span.flatpickr-weekday {
1516
1519
  overflow: auto;
1517
1520
  padding: var(--spacing-medium);
1518
1521
  border-radius: var(--corner-radius-extra-small);
1522
+ margin-top: 1px;
1519
1523
  }
1520
1524
  .time-dropdown .dropdown-option {
1521
1525
  align-items: center;
@@ -2390,6 +2394,58 @@ span.flatpickr-weekday {
2390
2394
  line-height: var(--text-area-placeholder-line-height);
2391
2395
  color: var(--text-area-placeholder-color);
2392
2396
  }
2397
+ .ListItem-module_button__yiYWw {
2398
+ display: flex;
2399
+ align-items: center;
2400
+ justify-content: center;
2401
+ position: relative;
2402
+ height: var(--list-item-height);
2403
+ min-height: var(--list-item-min-height);
2404
+ max-height: var(--list-item-max-height);
2405
+ width: var(--list-item-width);
2406
+ min-width: var(--list-item-min-width);
2407
+ max-width: var(--list-item-max-width);
2408
+ padding-top: calc(var(--list-item-padding-top) - var(--list-item-border-top-width));
2409
+ padding-bottom: calc(var(--list-item-padding-bottom) - var(--list-item-border-bottom-width));
2410
+ padding-left: calc(var(--list-item-padding-left) - var(--list-item-border-left-width));
2411
+ padding-right: calc(var(--list-item-padding-right) - var(--list-item-border-right-width));
2412
+ row-gap: var(--list-item-row-gap);
2413
+ -moz-column-gap: var(--list-item-column-gap);
2414
+ column-gap: var(--list-item-column-gap);
2415
+ border-bottom-width: var(--list-item-border-bottom-width);
2416
+ border-left-width: var(--list-item-border-left-width);
2417
+ border-right-width: var(--list-item-border-right-width);
2418
+ border-top-width: var(--list-item-border-top-width);
2419
+ border-style: var(--list-item-border-style);
2420
+ border-color: var(--list-item-border-color);
2421
+ border-top-left-radius: var(--list-item-border-top-left-radius);
2422
+ border-top-right-radius: var(--list-item-border-top-right-radius);
2423
+ border-bottom-right-radius: var(--list-item-border-bottom-right-radius);
2424
+ border-bottom-left-radius: var(--list-item-border-bottom-left-radius);
2425
+ outline-width: var(--list-item-outline-width);
2426
+ outline-style: var(--list-item-outline-style);
2427
+ outline-color: var(--list-item-outline-color);
2428
+ background-color: var(--list-item-background-color);
2429
+ font-family: var(--list-item-font-family);
2430
+ font-size: var(--list-item-font-size);
2431
+ font-weight: var(--list-item-font-weight);
2432
+ line-height: var(--list-item-line-height);
2433
+ color: var(--list-item-color);
2434
+ }
2435
+ .ListItem-module_button__yiYWw .ListItem-module_content__I-1o- {
2436
+ flex: 1;
2437
+ display: flex;
2438
+ justify-content: center;
2439
+ justify-content: var(--list-item-content-justify-content, center);
2440
+ }
2441
+ .ListItem-module_button__yiYWw .ListItem-module_content__I-1o- > *,
2442
+ .ListItem-module_button__yiYWw .ListItem-module_leadingIcon__BvSjG > *,
2443
+ .ListItem-module_button__yiYWw .ListItem-module_trailingIcon__qgDgt > * {
2444
+ color: var(--list-item-color);
2445
+ }
2446
+ .ListItem-module_button__yiYWw:disabled {
2447
+ cursor: not-allowed;
2448
+ }
2393
2449
  .Form-module_form__9JYdv {
2394
2450
  display: flex;
2395
2451
  flex-direction: column;