@boostdev/design-system-components 0.1.4 → 0.1.5
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/client.cjs +185 -104
- package/dist/client.css +435 -411
- package/dist/client.d.cts +15 -13
- package/dist/client.d.ts +15 -13
- package/dist/client.js +189 -107
- package/dist/index.cjs +185 -104
- package/dist/index.css +435 -411
- package/dist/index.d.cts +15 -13
- package/dist/index.d.ts +15 -13
- package/dist/index.js +189 -107
- package/package.json +1 -1
- package/src/components/interaction/Button/Button.tsx +35 -8
- package/src/components/interaction/Dialog/Dialog.spec.tsx +10 -10
- package/src/components/interaction/Dialog/Dialog.tsx +21 -7
- package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +1 -1
- package/src/components/interaction/DropdownMenu/index.ts +1 -0
- package/src/components/interaction/Toast/Toast.module.css +28 -0
- package/src/components/interaction/Toast/Toast.tsx +10 -1
- package/src/components/interaction/form/Checkbox/Checkbox.module.css +1 -1
- package/src/components/interaction/form/Checkbox/Checkbox.tsx +2 -1
- package/src/components/interaction/form/Combobox/Combobox.tsx +11 -3
- package/src/components/interaction/form/Combobox/index.ts +1 -0
- package/src/components/interaction/form/FileInput/FileInput.tsx +15 -2
- package/src/components/interaction/form/FormInput/FormInput.tsx +4 -3
- package/src/components/interaction/form/NumberInput/NumberInput.tsx +21 -17
- package/src/components/interaction/form/Radio/Radio.module.css +1 -1
- package/src/components/interaction/form/Radio/Radio.tsx +2 -1
- package/src/components/interaction/form/Select/Select.spec.tsx +2 -1
- package/src/components/interaction/form/Select/Select.tsx +3 -3
- package/src/components/interaction/form/Select/index.ts +1 -0
- package/src/components/interaction/form/Slider/Slider.tsx +5 -4
- package/src/components/interaction/form/Switch/Switch.tsx +1 -1
- package/src/components/interaction/form/Textarea/Textarea.tsx +1 -1
- package/src/components/interaction/form/atoms/Message.tsx +2 -2
- package/src/components/layout/ButtonGroup/ButtonGroup.tsx +1 -1
- package/src/components/layout/Card/Card.tsx +3 -0
- package/src/components/layout/SectionHeader/SectionHeader.tsx +2 -3
- package/src/components/ui/Accordion/Accordion.tsx +1 -1
- package/src/components/ui/Accordion/index.ts +1 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +2 -2
- package/src/components/ui/Breadcrumb/index.ts +1 -0
- package/src/components/ui/Calendar/Calendar.tsx +8 -3
- package/src/components/ui/DescriptionList/DescriptionList.tsx +1 -1
- package/src/components/ui/DescriptionList/index.ts +1 -0
- package/src/components/ui/Link/Link.tsx +3 -1
- package/src/components/ui/Separator/Separator.module.css +1 -1
- package/src/components/ui/Table/Table.tsx +1 -1
- package/src/components/ui/Table/index.ts +1 -0
- package/src/components/ui/Tabs/Tabs.tsx +1 -1
- package/src/components/ui/Tabs/index.ts +1 -0
- package/src/index.ts +8 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import css from './Breadcrumb.module.css';
|
|
2
2
|
import { cn } from '@boostdev/design-system-foundation';
|
|
3
3
|
|
|
4
|
-
interface BreadcrumbItem {
|
|
4
|
+
export interface BreadcrumbItem {
|
|
5
5
|
label: string;
|
|
6
6
|
href?: string;
|
|
7
7
|
}
|
|
@@ -19,7 +19,7 @@ export function Breadcrumb({ items, className }: Readonly<BreadcrumbProps>) {
|
|
|
19
19
|
const isLast = index === items.length - 1;
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
<li key={
|
|
22
|
+
<li key={index} className={css.item}>
|
|
23
23
|
{isLast ? (
|
|
24
24
|
<span aria-current="page" className={css.current}>
|
|
25
25
|
{item.label}
|
|
@@ -23,10 +23,15 @@ function isSameDay(a: Date, b: Date): boolean {
|
|
|
23
23
|
a.getDate() === b.getDate();
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
function toMidnight(date: Date): Date {
|
|
27
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
function isOutOfRange(date: Date, min?: Date, max?: Date): boolean {
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
return
|
|
31
|
+
const d = toMidnight(date);
|
|
32
|
+
if (min && d < toMidnight(min)) return true;
|
|
33
|
+
return !!(max && d > toMidnight(max));
|
|
34
|
+
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
function getDaysInMonth(year: number, month: number): number {
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import css from './DescriptionList.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
4
|
|
|
5
|
-
interface DescriptionItem {
|
|
5
|
+
export interface DescriptionItem {
|
|
6
6
|
term: ReactNode;
|
|
7
7
|
details: ReactNode | ReactNode[];
|
|
8
8
|
}
|
|
@@ -7,6 +7,7 @@ type LinkOwnProps<T extends ElementType> = {
|
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
variant?: 'default' | 'subtle' | 'standalone';
|
|
9
9
|
external?: boolean;
|
|
10
|
+
externalLabel?: string;
|
|
10
11
|
className?: string;
|
|
11
12
|
};
|
|
12
13
|
|
|
@@ -18,6 +19,7 @@ export function Link<T extends ElementType = 'a'>({
|
|
|
18
19
|
children,
|
|
19
20
|
variant = 'default',
|
|
20
21
|
external = false,
|
|
22
|
+
externalLabel = '(opens in new tab)',
|
|
21
23
|
className,
|
|
22
24
|
...props
|
|
23
25
|
}: LinkProps<T>) {
|
|
@@ -35,7 +37,7 @@ export function Link<T extends ElementType = 'a'>({
|
|
|
35
37
|
>
|
|
36
38
|
{children}
|
|
37
39
|
{external && (
|
|
38
|
-
<span className={css.externalLabel}>
|
|
40
|
+
<span className={css.externalLabel}>{externalLabel}</span>
|
|
39
41
|
)}
|
|
40
42
|
</Component>
|
|
41
43
|
);
|
|
@@ -2,7 +2,7 @@ import { KeyboardEvent, ReactNode, useId, useRef, useState } from 'react';
|
|
|
2
2
|
import css from './Tabs.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
4
|
|
|
5
|
-
interface TabItem {
|
|
5
|
+
export interface TabItem {
|
|
6
6
|
id: string;
|
|
7
7
|
label: ReactNode;
|
|
8
8
|
content: ReactNode;
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// UI
|
|
2
2
|
export { Accordion } from './components/ui/Accordion';
|
|
3
|
+
export type { AccordionItem } from './components/ui/Accordion';
|
|
3
4
|
export { Alert } from './components/ui/Alert';
|
|
4
5
|
export { Avatar } from './components/ui/Avatar';
|
|
5
6
|
export { Badge } from './components/ui/Badge';
|
|
6
7
|
export { Breadcrumb } from './components/ui/Breadcrumb';
|
|
8
|
+
export type { BreadcrumbItem } from './components/ui/Breadcrumb';
|
|
7
9
|
export { Calendar } from './components/ui/Calendar';
|
|
8
10
|
export { Carousel } from './components/ui/Carousel';
|
|
9
11
|
export { DescriptionList } from './components/ui/DescriptionList';
|
|
12
|
+
export type { DescriptionItem } from './components/ui/DescriptionList';
|
|
10
13
|
export { Link } from './components/ui/Link';
|
|
11
14
|
export { Loading } from './components/ui/Loading';
|
|
12
15
|
export { NotificationBanner } from './components/ui/NotificationBanner';
|
|
@@ -17,7 +20,9 @@ export { Separator } from './components/ui/Separator';
|
|
|
17
20
|
export { Skeleton } from './components/ui/Skeleton';
|
|
18
21
|
export { SkipLink } from './components/ui/SkipLink';
|
|
19
22
|
export { Table } from './components/ui/Table';
|
|
23
|
+
export type { TableColumn } from './components/ui/Table';
|
|
20
24
|
export { Tabs } from './components/ui/Tabs';
|
|
25
|
+
export type { TabItem } from './components/ui/Tabs';
|
|
21
26
|
export { Tooltip } from './components/ui/Tooltip';
|
|
22
27
|
export { Typography } from './components/ui/Typography';
|
|
23
28
|
|
|
@@ -28,6 +33,7 @@ export type { CommandItem } from './components/interaction/Command';
|
|
|
28
33
|
export { Dialog } from './components/interaction/Dialog';
|
|
29
34
|
export { Drawer } from './components/interaction/Drawer';
|
|
30
35
|
export { DropdownMenu } from './components/interaction/DropdownMenu';
|
|
36
|
+
export type { DropdownMenuItem } from './components/interaction/DropdownMenu';
|
|
31
37
|
export { Popover } from './components/interaction/Popover';
|
|
32
38
|
export { Rating } from './components/interaction/Rating';
|
|
33
39
|
export { ToastProvider, useToast } from './components/interaction/Toast';
|
|
@@ -35,11 +41,13 @@ export { ToastProvider, useToast } from './components/interaction/Toast';
|
|
|
35
41
|
// Form
|
|
36
42
|
export { Checkbox } from './components/interaction/form/Checkbox';
|
|
37
43
|
export { Combobox } from './components/interaction/form/Combobox';
|
|
44
|
+
export type { ComboboxOption } from './components/interaction/form/Combobox';
|
|
38
45
|
export { FileInput } from './components/interaction/form/FileInput';
|
|
39
46
|
export { FormInput } from './components/interaction/form/FormInput';
|
|
40
47
|
export { NumberInput } from './components/interaction/form/NumberInput';
|
|
41
48
|
export { Radio } from './components/interaction/form/Radio';
|
|
42
49
|
export { Select } from './components/interaction/form/Select';
|
|
50
|
+
export type { SelectOption } from './components/interaction/form/Select';
|
|
43
51
|
export { Slider } from './components/interaction/form/Slider';
|
|
44
52
|
export { Switch } from './components/interaction/form/Switch';
|
|
45
53
|
export { Textarea } from './components/interaction/form/Textarea';
|