@boostdev/design-system-components 0.1.3 → 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.
Files changed (55) hide show
  1. package/dist/client.cjs +185 -104
  2. package/dist/client.css +444 -427
  3. package/dist/client.d.cts +15 -13
  4. package/dist/client.d.ts +15 -13
  5. package/dist/client.js +189 -107
  6. package/dist/index.cjs +185 -104
  7. package/dist/index.css +444 -427
  8. package/dist/index.d.cts +15 -13
  9. package/dist/index.d.ts +15 -13
  10. package/dist/index.js +189 -107
  11. package/package.json +3 -3
  12. package/src/components/interaction/Button/Button.tsx +35 -8
  13. package/src/components/interaction/Dialog/Dialog.spec.tsx +10 -10
  14. package/src/components/interaction/Dialog/Dialog.tsx +21 -7
  15. package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +1 -1
  16. package/src/components/interaction/DropdownMenu/index.ts +1 -0
  17. package/src/components/interaction/Toast/Toast.module.css +28 -0
  18. package/src/components/interaction/Toast/Toast.tsx +10 -1
  19. package/src/components/interaction/form/Checkbox/Checkbox.module.css +1 -1
  20. package/src/components/interaction/form/Checkbox/Checkbox.tsx +2 -1
  21. package/src/components/interaction/form/Combobox/Combobox.tsx +11 -3
  22. package/src/components/interaction/form/Combobox/index.ts +1 -0
  23. package/src/components/interaction/form/FileInput/FileInput.tsx +15 -2
  24. package/src/components/interaction/form/FormInput/FormInput.tsx +4 -3
  25. package/src/components/interaction/form/NumberInput/NumberInput.tsx +21 -17
  26. package/src/components/interaction/form/Radio/Radio.module.css +1 -1
  27. package/src/components/interaction/form/Radio/Radio.tsx +2 -1
  28. package/src/components/interaction/form/Select/Select.spec.tsx +2 -1
  29. package/src/components/interaction/form/Select/Select.tsx +3 -3
  30. package/src/components/interaction/form/Select/index.ts +1 -0
  31. package/src/components/interaction/form/Slider/Slider.tsx +5 -4
  32. package/src/components/interaction/form/Switch/Switch.tsx +1 -1
  33. package/src/components/interaction/form/Textarea/Textarea.tsx +1 -1
  34. package/src/components/interaction/form/atoms/Message.tsx +2 -2
  35. package/src/components/layout/ButtonGroup/ButtonGroup.tsx +1 -1
  36. package/src/components/layout/Card/Card.module.css +1 -1
  37. package/src/components/layout/Card/Card.tsx +3 -0
  38. package/src/components/layout/IconWrapper/IconWrapper.module.css +3 -6
  39. package/src/components/layout/SectionHeader/SectionHeader.module.css +2 -5
  40. package/src/components/layout/SectionHeader/SectionHeader.tsx +2 -3
  41. package/src/components/ui/Accordion/Accordion.tsx +1 -1
  42. package/src/components/ui/Accordion/index.ts +1 -0
  43. package/src/components/ui/Breadcrumb/Breadcrumb.tsx +2 -2
  44. package/src/components/ui/Breadcrumb/index.ts +1 -0
  45. package/src/components/ui/Calendar/Calendar.tsx +8 -3
  46. package/src/components/ui/DescriptionList/DescriptionList.tsx +1 -1
  47. package/src/components/ui/DescriptionList/index.ts +1 -0
  48. package/src/components/ui/Link/Link.tsx +3 -1
  49. package/src/components/ui/Separator/Separator.module.css +3 -6
  50. package/src/components/ui/Table/Table.tsx +1 -1
  51. package/src/components/ui/Table/index.ts +1 -0
  52. package/src/components/ui/Tabs/Tabs.tsx +1 -1
  53. package/src/components/ui/Tabs/index.ts +1 -0
  54. package/src/components/ui/Typography/Typography.module.css +1 -4
  55. package/src/index.ts +8 -0
@@ -1,8 +1,5 @@
1
1
  @layer component {
2
2
  .wrapper {
3
- --icon-wrapper-color: var(--color_bg);
4
- --color_on-icon-wrapper-color: var(--color_on-bg);
5
-
6
3
  width: 2em;
7
4
  height: 2em;
8
5
  font-size: 3em;
@@ -11,9 +8,9 @@
11
8
  align-items: center;
12
9
  justify-content: center;
13
10
  margin: var(--space_l) auto var(--space_m);
14
- background: var(--icon-wrapper-color);
15
- color: var(--color_on-icon-wrapper-color);
16
- fill: var(--color_on-icon-wrapper-color);
11
+ background: var(--icon-wrapper-color, var(--color_bg));
12
+ color: var(--color_on-icon-wrapper-color, var(--color_on-bg));
13
+ fill: var(--color_on-icon-wrapper-color, var(--color_on-bg));
17
14
  position: relative;
18
15
  transition: var(--animation_transition);
19
16
  }
@@ -1,8 +1,5 @@
1
1
  @layer component {
2
2
  .sectionHeader {
3
- --sectionHeader-title-color: var(--color_on-bg);
4
- --sectionHeader_subtitle-color: var(--color_grey--strong);
5
-
6
3
  display: flex;
7
4
  flex-direction: column;
8
5
  gap: var(--space_m);
@@ -11,13 +8,13 @@
11
8
  }
12
9
 
13
10
  .title {
14
- color: var(--sectionHeader-title-color);
11
+ color: var(--sectionHeader-title-color, var(--color_on-bg));
15
12
  margin: 0;
16
13
  font-family: var(--font_family--body);
17
14
  }
18
15
 
19
16
  .subtitle {
20
- color: var(--sectionHeader_subtitle-color);
17
+ color: var(--sectionHeader_subtitle-color, var(--color_grey--strong));
21
18
  margin: 0;
22
19
  font-family: var(--font_family--body);
23
20
  font-weight: var(--font_weight--medium);
@@ -1,9 +1,8 @@
1
+ import type { JSX } from 'react';
1
2
  import css from './SectionHeader.module.css';
2
3
  import { cn } from '@boostdev/design-system-foundation';
3
- import {JSX} from "react/jsx-runtime";
4
- type IntrinsicElements = JSX.IntrinsicElements;
5
4
 
6
- type IntrinsicElement = keyof IntrinsicElements
5
+ type IntrinsicElement = keyof JSX.IntrinsicElements;
7
6
 
8
7
  type SectionHeaderProps = {
9
8
  title: string;
@@ -2,7 +2,7 @@ import { ReactNode, useId, useState } from 'react';
2
2
  import css from './Accordion.module.css';
3
3
  import { cn } from '@boostdev/design-system-foundation';
4
4
 
5
- interface AccordionItem {
5
+ export interface AccordionItem {
6
6
  id: string;
7
7
  title: ReactNode;
8
8
  content: ReactNode;
@@ -1 +1,2 @@
1
1
  export { Accordion } from './Accordion';
2
+ export type { AccordionItem } from './Accordion';
@@ -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={item.label} className={css.item}>
22
+ <li key={index} className={css.item}>
23
23
  {isLast ? (
24
24
  <span aria-current="page" className={css.current}>
25
25
  {item.label}
@@ -1 +1,2 @@
1
1
  export { Breadcrumb } from './Breadcrumb';
2
+ export type { BreadcrumbItem } from './Breadcrumb';
@@ -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
- if (min && date < min) return true;
28
- if (max && date > max) return true;
29
- return false;
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
  }
@@ -1 +1,2 @@
1
1
  export { DescriptionList } from './DescriptionList';
2
+ export type { DescriptionItem } from './DescriptionList';
@@ -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}> (opens in new tab)</span>
40
+ <span className={css.externalLabel}>{externalLabel}</span>
39
41
  )}
40
42
  </Component>
41
43
  );
@@ -1,22 +1,19 @@
1
1
  @layer component {
2
2
  .separator {
3
- --separator_color: var(--color_border);
4
- --separator_thickness: 1px;
5
-
6
3
  border: none;
7
- background-color: var(--separator_color);
4
+ background-color: var(--separator_color, var(--color_on-bg));
8
5
  }
9
6
 
10
7
  .separator.--horizontal {
11
8
  display: block;
12
9
  width: 100%;
13
- height: var(--separator_thickness);
10
+ height: var(--separator_thickness, 1px);
14
11
  margin-block: var(--space_m);
15
12
  }
16
13
 
17
14
  .separator.--vertical {
18
15
  display: inline-block;
19
- width: var(--separator_thickness);
16
+ width: var(--separator_thickness, 1px);
20
17
  align-self: stretch;
21
18
  margin-inline: var(--space_m);
22
19
  }
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  import css from './Table.module.css';
3
3
  import { cn } from '@boostdev/design-system-foundation';
4
4
 
5
- interface TableColumn<Row> {
5
+ export interface TableColumn<Row> {
6
6
  key: string;
7
7
  header: ReactNode;
8
8
  sortable?: boolean;
@@ -1 +1,2 @@
1
1
  export { Table } from './Table';
2
+ export type { TableColumn } from './Table';
@@ -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;
@@ -1 +1,2 @@
1
1
  export { Tabs } from './Tabs';
2
+ export type { TabItem } from './Tabs';
@@ -1,11 +1,8 @@
1
1
  @layer component {
2
2
  .typography {
3
- /* Component token — override from a parent context or inline style */
4
- --typography_color: var(--color_on-bg);
5
-
6
3
  margin: 0;
7
4
  font-family: var(--font_family--body);
8
- color: var(--typography_color);
5
+ color: var(--typography_color, var(--color_on-bg));
9
6
  }
10
7
 
11
8
  .--h1 {
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';