@tui-cruises/mein-schiff-web-react-component-library 2.1.0 → 2.2.1

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/CHANGELOG.md CHANGED
@@ -2,14 +2,29 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## [2.1.0](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.0.5...v2.1.0) (2025-06-19)
5
+ ### [2.2.1](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.2.0...v2.2.1) (2025-07-18)
6
6
 
7
- ### [2.0.4](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.0.3...v2.0.4) (2025-06-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ * set IconButton as 'use client' to fix import problems ([6a1c421](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/6a1c42100b9f38fd3b6ed7c9b8d931afe4774b7c))
11
+
12
+ ## [2.2.0](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.1.0...v2.2.0) (2025-07-15)
13
+
14
+
15
+ ### Features
16
+
17
+ * **Tabs:** add `on` prop to control background context ([127dd83](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/127dd8319d205d6ec84c85c89e3b1959f3bfa9d7))
8
18
 
9
19
 
10
20
  ### Bug Fixes
11
21
 
12
- * **release:** replace local file dependencies with versions for npm pack ([eac75a6](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/eac75a6d83efec0906037fbc536f8bcca8ab2336))
22
+ * form label with error style for data-invalid attribute ([285587c](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/285587cee026b4dc5c9d9ca5efa8fc87080244c8))
23
+
24
+ ### [2.1.0](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.0.5...v2.1.0) (2025-06-19)
25
+
26
+ * **Release:** replace local file dependencies with versions for npm pack ([eac75a6](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/eac75a6d83efec0906037fbc536f8bcca8ab2336))
27
+
13
28
 
14
29
  ### [2.0.3](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.0.2...v2.0.3) (2025-06-05)
15
30
 
@@ -46,4 +61,6 @@ All notable changes to this project will be documented in this file. See [standa
46
61
  * **PasswordField:** focus border radius update ([1694e4b](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/1694e4b9f74aed973ef4e0315dcfc9bf428486bb))
47
62
  * **pictograms:** remove yellow from badge pictograms per brand guidelines ([62f8655](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/62f8655f021fb7a47ed7d9881c89820c63605548))
48
63
 
49
- ### [2.0.0-rc.1](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.0.0...v2.0.0-rc.1) (2025-04-29)
64
+ ### [2.0.0-rc.1](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.0.0...v2.0.0-rc.1) (2025-04-29)
65
+
66
+ * **Release:** initial release candidate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tui-cruises/mein-schiff-web-react-component-library",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "main": "./index.tsx",
5
5
  "types": "./index.tsx",
6
6
  "type": "module",
@@ -2,19 +2,23 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import { useEffect, useState } from 'react';
5
- import { DayPicker, Matcher } from 'react-day-picker';
5
+ import {
6
+ DayPicker,
7
+ DayPickerBase,
8
+ DayPickerMultipleProps,
9
+ DayPickerRangeProps,
10
+ DayPickerSingleProps,
11
+ Matcher,
12
+ } from 'react-day-picker';
6
13
  import { de, enGB } from 'date-fns/locale';
7
14
 
8
15
  import { twJoin } from 'tailwind-merge';
9
- import { Icon } from '../../core/Icon';
16
+ import { Icon } from '../Icon';
10
17
  import { Locale as I18nLocale } from '@tuic/i18n';
11
- import { TextButton } from '../../core/TextButton';
18
+ import { TextButton } from '../TextButton';
12
19
  import { differenceInMonths } from 'date-fns';
13
20
 
14
- export type CalendarProps = Omit<
15
- React.ComponentProps<typeof DayPicker>,
16
- 'locale' | 'fromDate'
17
- > & {
21
+ type BaseProps = Omit<DayPickerBase, 'locale' | 'fromDate'> & {
18
22
  localeCode?: I18nLocale;
19
23
  useShowMoreButtonOnMobile?: boolean;
20
24
  showPrevMonthsButtonLabel?: string;
@@ -23,6 +27,11 @@ export type CalendarProps = Omit<
23
27
  pastIsPickable?: boolean;
24
28
  };
25
29
 
30
+ export type CalendarProps =
31
+ | (BaseProps & DayPickerSingleProps)
32
+ | (BaseProps & DayPickerMultipleProps)
33
+ | (BaseProps & DayPickerRangeProps);
34
+
26
35
  const DEFAULT_LOCALE: I18nLocale = 'de';
27
36
 
28
37
  /**
@@ -243,7 +252,7 @@ function Calendar({
243
252
  cell: twJoin(
244
253
  'relative w-1/7 p-0 text-center text-xs focus-within:relative focus-within:z-20' +
245
254
  '[&:has([aria-selected].day-range-end)]:rounded-r-lg [&:has([aria-selected])]:bg-surface-secondary-7 [&:has([aria-selected].day-outside)]:bg-surface-secondary-7',
246
- props.mode === 'range'
255
+ (props.mode as string) === 'range'
247
256
  ? '[&:has(>.day-range-end)]:rounded-r-lg [&:has(>.day-range-start)]:rounded-l-lg first:[&:has([aria-selected])]:rounded-l-lg last:[&:has([aria-selected])]:rounded-r-lg'
248
257
  : '[&:has([aria-selected])]:rounded-sm',
249
258
  ),
@@ -10,6 +10,7 @@ export type FormLabelProps = LabelHTMLAttributes<HTMLLabelElement> & {
10
10
  asChild?: boolean;
11
11
  /** Indicates if the associated field is required. */
12
12
  required?: boolean;
13
+ 'data-invalid'?: boolean;
13
14
  };
14
15
 
15
16
  const FormLabelImplementation: ForwardRefRenderFunction<
@@ -25,7 +26,7 @@ const FormLabelImplementation: ForwardRefRenderFunction<
25
26
  {...args}
26
27
  ref={ref}
27
28
  className={twJoin(
28
- 'block cursor-pointer text-base font-semibold text-marine-high-emphasis',
29
+ 'block cursor-pointer text-base font-semibold text-marine-high-emphasis data-[invalid]:text-error-100',
29
30
  className,
30
31
  )}
31
32
  >
@@ -1,4 +1,6 @@
1
- import { Icon, IconName } from '../../core/Icon';
1
+ 'use client'
2
+
3
+ import { Icon, IconName } from '../Icon';
2
4
  import {
3
5
  ButtonHTMLAttributes,
4
6
  forwardRef,
@@ -1,7 +1,13 @@
1
1
  'use client';
2
2
 
3
3
  import * as TabsPrimitive from '@radix-ui/react-tabs';
4
- import { ComponentProps, FC, forwardRef } from 'react';
4
+ import {
5
+ ComponentProps,
6
+ createContext,
7
+ FC,
8
+ forwardRef,
9
+ useContext,
10
+ } from 'react';
5
11
  import { IconButton } from '../IconButton';
6
12
  import {
7
13
  CarouselInterface,
@@ -11,7 +17,24 @@ import {
11
17
  import { twJoin } from 'tailwind-merge';
12
18
  import { Pictogram, PictogramName } from '../Pictogram';
13
19
 
14
- const Tabs = TabsPrimitive.Root;
20
+ type TabsContextType = {
21
+ on?: 'white' | 'gray';
22
+ };
23
+
24
+ const TabsContext = createContext<TabsContextType>({});
25
+
26
+ type TabsProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {
27
+ on?: 'white' | 'gray';
28
+ };
29
+
30
+ const Tabs = forwardRef<React.ElementRef<typeof TabsPrimitive.Root>, TabsProps>(
31
+ ({ on = 'white', ...props }, ref) => (
32
+ <TabsContext.Provider value={{ on }}>
33
+ <TabsPrimitive.Root {...props} ref={ref} />
34
+ </TabsContext.Provider>
35
+ ),
36
+ );
37
+ Tabs.displayName = TabsPrimitive.Root.displayName;
15
38
 
16
39
  const TabsContent = TabsPrimitive.Content;
17
40
 
@@ -21,6 +44,7 @@ type Props = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {
21
44
 
22
45
  const TabsList = forwardRef<React.ElementRef<typeof TabsPrimitive.List>, Props>(
23
46
  ({ className, centerTabItems, ...props }, ref) => {
47
+ const { on } = useContext(TabsContext);
24
48
  return (
25
49
  <TabsPrimitive.List
26
50
  className="relative flex items-center justify-between gap-1"
@@ -47,7 +71,9 @@ const TabsList = forwardRef<React.ElementRef<typeof TabsPrimitive.List>, Props>(
47
71
  <>
48
72
  <div
49
73
  className={twJoin(
50
- 'pointer-events-none absolute left-0 top-1/2 flex h-full -translate-y-1/2 items-center bg-gradient-to-r from-white from-50% pr-4',
74
+ `pointer-events-none absolute left-0 top-1/2 flex h-full -translate-y-1/2 items-center bg-gradient-to-r from-50% pr-4`,
75
+ on === 'white' && 'from-white',
76
+ on === 'gray' && 'from-gray',
51
77
  visibleIndexes[0] === 0 && 'hidden',
52
78
  )}
53
79
  >
@@ -64,7 +90,9 @@ const TabsList = forwardRef<React.ElementRef<typeof TabsPrimitive.List>, Props>(
64
90
 
65
91
  <div
66
92
  className={twJoin(
67
- 'pointer-events-none absolute right-0 top-1/2 flex h-full -translate-y-1/2 items-center bg-gradient-to-l from-white from-50% pl-4',
93
+ `pointer-events-none absolute right-0 top-1/2 flex h-full -translate-y-1/2 items-center bg-gradient-to-l from-50% pl-4`,
94
+ on === 'white' && 'from-white',
95
+ on === 'gray' && 'from-gray',
68
96
  visibleIndexes.includes(lastIndex) && 'hidden',
69
97
  )}
70
98
  >
Binary file