@tui-cruises/mein-schiff-web-react-component-library 2.2.4 → 2.2.6
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 +19 -0
- package/package.json +2 -2
- package/src/components/core/Accordion/Accordion.tsx +2 -1
- package/src/components/core/Accordion/AccordionItem.tsx +1 -1
- package/src/components/core/AlertDialog/AlertDialog.tsx +0 -11
- package/src/components/core/IconButton/IconButton.tsx +1 -1
- package/src/components/core/Pictogram/Pictogram.tsx +55 -55
- package/src/components/core/TextButton/TextButton.tsx +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
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.2.6](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.2.5...v2.2.6) (2025-08-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **Accordion:** add on background property ([a99009d](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/a99009d4adb955f06a6ebea139a7e89bc567713f))
|
|
11
|
+
|
|
12
|
+
### [2.2.5](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.2.4...v2.2.5) (2025-08-05)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **TextButton:** add large text size property ([d873d25](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/d873d2566d95c27b07f28dc4517d8b443bed00ef))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **Accordion:** allow horizontal scrolling for overflowing content via overflow-x auto ([ecbdbf9](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/ecbdbf9d771cf85a5dbdd3217293ce4bf715daf6))
|
|
23
|
+
|
|
5
24
|
### [2.2.4](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.3.0...v2.2.4) (2025-07-23)
|
|
6
25
|
|
|
7
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tui-cruises/mein-schiff-web-react-component-library",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"main": "./index.tsx",
|
|
5
5
|
"types": "./index.tsx",
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"prettier": "prettier --write ./src",
|
|
11
11
|
"dev": "storybook dev -p 6006",
|
|
12
12
|
"build-storybook": "storybook build",
|
|
13
|
-
"release": "standard-version
|
|
13
|
+
"release": "standard-version",
|
|
14
14
|
"pack:public": "node scripts/prepare-pack.mjs",
|
|
15
15
|
"prepack": "npm run pack:public",
|
|
16
16
|
"generate-icon-components": "node icons-import-svgs/generate-icons.cjs && prettier --write icons"
|
|
@@ -31,6 +31,7 @@ type CustomAccordionProps = {
|
|
|
31
31
|
items?: AccordionMixedItem[];
|
|
32
32
|
loadMoreButton?: TextButtonProps;
|
|
33
33
|
headlineAs?: AccordionItemProps['headlineAs'];
|
|
34
|
+
on?: 'white' | 'gray';
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
export type AccordionSingleProps = HTMLAttributes<HTMLUListElement> &
|
|
@@ -48,7 +49,7 @@ type Root = FC<AccordionProps> & {
|
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
const Accordion: Root = propsArg => {
|
|
51
|
-
let { loadMoreButton, ...props } = propsArg;
|
|
52
|
+
let { loadMoreButton, on = 'white', ...props } = propsArg;
|
|
52
53
|
|
|
53
54
|
let [pending, setPending] = useState(false);
|
|
54
55
|
|
|
@@ -57,7 +57,7 @@ export const AccordionItem: FC<AccordionItemProps> = ({
|
|
|
57
57
|
|
|
58
58
|
{children && (
|
|
59
59
|
<Radix.AccordionContent asChild>
|
|
60
|
-
<div className="overflow-hidden transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down">
|
|
60
|
+
<div className="overflow-x-auto overflow-y-hidden transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down">
|
|
61
61
|
<div className="px-2 pt-4 text-marine-high-emphasis md:pt-3">
|
|
62
62
|
{children}
|
|
63
63
|
</div>
|
|
@@ -47,11 +47,6 @@ type Props = PropsWithChildren<{
|
|
|
47
47
|
*/
|
|
48
48
|
open?: boolean;
|
|
49
49
|
|
|
50
|
-
/**
|
|
51
|
-
* A React node that will be rendered as the trigger for the modal.
|
|
52
|
-
*/
|
|
53
|
-
trigger?: ReactNode;
|
|
54
|
-
|
|
55
50
|
/**
|
|
56
51
|
* Callback fired when the modal's open state changes.
|
|
57
52
|
*/
|
|
@@ -259,15 +254,9 @@ export const AlertDialog: FC<Props> = ({
|
|
|
259
254
|
container,
|
|
260
255
|
centerItems = true,
|
|
261
256
|
containerClassName,
|
|
262
|
-
trigger,
|
|
263
257
|
}) => {
|
|
264
258
|
return (
|
|
265
259
|
<AlertDialogPrimitive.Root open={open} onOpenChange={onOpenChange}>
|
|
266
|
-
{trigger && (
|
|
267
|
-
<AlertDialogPrimitive.Trigger asChild>
|
|
268
|
-
{trigger}
|
|
269
|
-
</AlertDialogPrimitive.Trigger>
|
|
270
|
-
)}
|
|
271
260
|
<AlertDialogPrimitive.Portal container={container || undefined}>
|
|
272
261
|
<AlertDialogPrimitive.Overlay
|
|
273
262
|
className={twJoin(
|
|
@@ -2,9 +2,9 @@ import type { FC } from 'react';
|
|
|
2
2
|
import { dynamicComponents as dynamicComponentsPictograms } from '../../../../icons/pictograms';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
getClassNamesFromMap,
|
|
6
|
+
ResponsiveValue,
|
|
7
|
+
ResponsiveValueClassMap,
|
|
8
8
|
} from '../../../helpers/responsive-property';
|
|
9
9
|
|
|
10
10
|
type CollectionPictograms = typeof dynamicComponentsPictograms;
|
|
@@ -23,77 +23,77 @@ type IconComponent = CollectionPictograms[PictogramName];
|
|
|
23
23
|
type PictogramSize = 'sm' | 'md';
|
|
24
24
|
|
|
25
25
|
export type PictogramProps = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
className?: string;
|
|
27
|
+
name: PictogramName;
|
|
28
|
+
size?: ResponsiveValue<PictogramSize>;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Renders the icon.
|
|
33
33
|
*/
|
|
34
34
|
const renderIcon = (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
Element: IconComponent,
|
|
36
|
+
size: PictogramProps['size'],
|
|
37
|
+
wrapperAttrs: Record<string, string>,
|
|
38
38
|
) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
let classNameContainsSize = ['size-', 'h-', 'w-'].some(prefix =>
|
|
40
|
+
wrapperAttrs.className?.includes(prefix),
|
|
41
|
+
);
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
const className = twMerge(
|
|
44
|
+
'inline-block',
|
|
45
|
+
!classNameContainsSize && getClassNamesFromMap(sizeCssMap, size, 'sm'),
|
|
46
|
+
wrapperAttrs.className,
|
|
47
|
+
);
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
return (
|
|
50
|
+
<div {...wrapperAttrs} className={className}>
|
|
51
|
+
<Element className="block size-full" viewBox="0 0 40 40" />
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Renders a pictogram with the specified size and icon.
|
|
58
58
|
*/
|
|
59
59
|
const Pictogram: FC<PictogramProps> = ({ size, name, ...rest }) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
const Element = dynamicComponentsPictograms[name];
|
|
61
|
+
if (!Element) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
return renderIcon(Element, size, rest);
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
const sizeCssMap: ResponsiveValueClassMap<PictogramSize> = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
69
|
+
initial: {
|
|
70
|
+
sm: 'size-[40px]',
|
|
71
|
+
md: 'size-[60px]',
|
|
72
|
+
},
|
|
73
|
+
xs: {
|
|
74
|
+
sm: 'xs:size-[40px]',
|
|
75
|
+
md: 'xs:size-[60px]',
|
|
76
|
+
},
|
|
77
|
+
sm: {
|
|
78
|
+
sm: 'sm:size-[40px]',
|
|
79
|
+
md: 'sm:size-[60px]',
|
|
80
|
+
},
|
|
81
|
+
md: {
|
|
82
|
+
sm: 'md:size-[40px]',
|
|
83
|
+
md: 'md:size-[60px]',
|
|
84
|
+
},
|
|
85
|
+
lg: {
|
|
86
|
+
sm: 'lg:size-[40px]',
|
|
87
|
+
md: 'lg:size-[60px]',
|
|
88
|
+
},
|
|
89
|
+
xl: {
|
|
90
|
+
sm: 'xl:size-[40px]',
|
|
91
|
+
md: 'xl:size-[60px]',
|
|
92
|
+
},
|
|
93
|
+
xxl: {
|
|
94
|
+
sm: '2xl:size-[40px]',
|
|
95
|
+
md: '2xl:size-[60px]',
|
|
96
|
+
},
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
Pictogram.displayName = 'Pictogram';
|
|
@@ -16,7 +16,7 @@ type CommonProps = ButtonHTMLAttributes<HTMLButtonElement> &
|
|
|
16
16
|
iconLeft?: IconName;
|
|
17
17
|
iconRight?: IconName;
|
|
18
18
|
iconSize?: 'xs' | 'sm' | 'md' | 'lg';
|
|
19
|
-
size?: 'sm' | 'md';
|
|
19
|
+
size?: 'sm' | 'md' | 'lg';
|
|
20
20
|
on?: 'white' | 'gray' | 'ocean' | 'image';
|
|
21
21
|
}>;
|
|
22
22
|
|
|
@@ -53,6 +53,7 @@ const TextButtonRenderFunction: ForwardRefRenderFunction<
|
|
|
53
53
|
'focus:outline-none focus-visible:shadow-focus-state',
|
|
54
54
|
'disabled:pointer-events-none disabled:text-secondary-marine-48',
|
|
55
55
|
size === 'sm' && 'text-sm',
|
|
56
|
+
size === 'lg' && 'text-lg',
|
|
56
57
|
|
|
57
58
|
// On white (default)
|
|
58
59
|
on === 'white' && 'text-marine-high-emphasis',
|