@tui-cruises/mein-schiff-web-react-component-library 2.2.5 → 2.2.7
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,6 +2,20 @@
|
|
|
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.7](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v2.2.6...v2.2.7) (2025-08-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **Accordion:** Always enforce multiple type ([a387d1d](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/a387d1db9513c34d1f62114da3a8db3a3a81c9bf))
|
|
11
|
+
|
|
12
|
+
### [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)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **Accordion:** add on background property ([a99009d](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/a99009d4adb955f06a6ebea139a7e89bc567713f))
|
|
18
|
+
|
|
5
19
|
### [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)
|
|
6
20
|
|
|
7
21
|
|
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.7",
|
|
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
|
|
|
@@ -88,6 +89,9 @@ const Accordion: Root = propsArg => {
|
|
|
88
89
|
const renderAccordion = (props: AccordionProps) => {
|
|
89
90
|
let { fallback, children: childrenArg, items, headlineAs, ...attrs } = props;
|
|
90
91
|
|
|
92
|
+
// Always enforce multiple type
|
|
93
|
+
attrs.type = 'multiple';
|
|
94
|
+
|
|
91
95
|
let { children, type } = getChildren(
|
|
92
96
|
items,
|
|
93
97
|
childrenArg,
|
|
@@ -95,10 +99,6 @@ const renderAccordion = (props: AccordionProps) => {
|
|
|
95
99
|
headlineAs,
|
|
96
100
|
);
|
|
97
101
|
|
|
98
|
-
if (attrs.type === 'single' && typeof attrs.collapsible === 'undefined') {
|
|
99
|
-
attrs.collapsible = true;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
102
|
if (type !== 'tabs') {
|
|
103
103
|
return (
|
|
104
104
|
<Radix.Root {...attrs} asChild data-track-module="accordion">
|
|
@@ -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';
|