@porsche-design-system/components-react 3.34.0 → 3.35.0-rc.0
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 +12 -0
- package/cjs/lib/components/ai-tag.wrapper.cjs +26 -0
- package/cjs/public-api.cjs +2 -0
- package/esm/lib/components/ai-tag.wrapper.d.ts +30 -0
- package/esm/lib/components/ai-tag.wrapper.mjs +24 -0
- package/esm/lib/components/index.d.ts +1 -0
- package/esm/lib/types.d.ts +219 -0
- package/esm/public-api.mjs +1 -0
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +64 -7
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +159 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/ai-tag.wrapper.cjs +36 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/ai-tag.cjs +18 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/public-api.cjs +2 -0
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +63 -7
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +158 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/ai-tag.wrapper.mjs +34 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/ai-tag.mjs +16 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/public-api.mjs +1 -0
- package/ssr/esm/lib/components/ai-tag.wrapper.d.ts +30 -0
- package/ssr/esm/lib/components/index.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/ai-tag.d.ts +5 -0
- package/ssr/esm/lib/types.d.ts +219 -0
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/ai-tag.wrapper.cjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var hooks = require('../../hooks.cjs');
|
|
7
|
+
var utils = require('../../utils.cjs');
|
|
8
|
+
var aiTag = require('../dsr-components/ai-tag.cjs');
|
|
9
|
+
|
|
10
|
+
const PAiTag = /*#__PURE__*/ react.forwardRef(({ locale = 'en_US', theme, variant = 'generated', className, ...rest }, ref) => {
|
|
11
|
+
const elementRef = react.useRef(undefined);
|
|
12
|
+
const WebComponentTag = hooks.usePrefix('p-ai-tag');
|
|
13
|
+
const propsToSync = [locale, theme || hooks.useTheme(), variant];
|
|
14
|
+
hooks.useBrowserLayoutEffect(() => {
|
|
15
|
+
const { current } = elementRef;
|
|
16
|
+
['locale', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
|
+
}, propsToSync);
|
|
18
|
+
const props = {
|
|
19
|
+
...rest,
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
...(!process.browser
|
|
22
|
+
? {
|
|
23
|
+
children: (jsxRuntime.jsx(aiTag.DSRAiTag, { locale, theme: theme || hooks.useTheme(), variant })),
|
|
24
|
+
}
|
|
25
|
+
: {
|
|
26
|
+
suppressHydrationWarning: true,
|
|
27
|
+
}),
|
|
28
|
+
'data-ssr': '',
|
|
29
|
+
class: hooks.useMergedClass(elementRef, className),
|
|
30
|
+
ref: utils.syncRef(elementRef, ref)
|
|
31
|
+
};
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
return jsxRuntime.jsx(WebComponentTag, { ...props });
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
exports.PAiTag = PAiTag;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var minifyCss = require('../../minifyCss.cjs');
|
|
6
|
+
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
|
|
7
|
+
var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
|
|
8
|
+
|
|
9
|
+
class DSRAiTag extends react.Component {
|
|
10
|
+
host;
|
|
11
|
+
render() {
|
|
12
|
+
const { short, long, generated, modified } = utilsEntry.getAiTagTranslation(this.props.locale);
|
|
13
|
+
const style = minifyCss.minifyCss(stylesEntry.getAiTagCss(this.props.theme));
|
|
14
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("div", { children: this.props.variant !== 'abbreviation' ? (this.props.variant === 'modified' ? (modified) : (generated)) : (jsxRuntime.jsx("abbr", { title: long, children: short })) })] }) }));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.DSRAiTag = DSRAiTag;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var componentsJs = require('@porsche-design-system/components-js');
|
|
4
4
|
var accordion_wrapper = require('./lib/components/accordion.wrapper.cjs');
|
|
5
|
+
var aiTag_wrapper = require('./lib/components/ai-tag.wrapper.cjs');
|
|
5
6
|
var banner_wrapper = require('./lib/components/banner.wrapper.cjs');
|
|
6
7
|
var button_wrapper = require('./lib/components/button.wrapper.cjs');
|
|
7
8
|
var buttonGroup_wrapper = require('./lib/components/button-group.wrapper.cjs');
|
|
@@ -101,6 +102,7 @@ Object.defineProperty(exports, "componentsReady", {
|
|
|
101
102
|
get: function () { return componentsJs.componentsReady; }
|
|
102
103
|
});
|
|
103
104
|
exports.PAccordion = accordion_wrapper.PAccordion;
|
|
105
|
+
exports.PAiTag = aiTag_wrapper.PAiTag;
|
|
104
106
|
exports.PBanner = banner_wrapper.PBanner;
|
|
105
107
|
exports.PButton = button_wrapper.PButton;
|
|
106
108
|
exports.PButtonGroup = buttonGroup_wrapper.PButtonGroup;
|
|
@@ -3641,7 +3641,7 @@ const hasShowPickerSupport = () => (hasDocument &&
|
|
|
3641
3641
|
'showPicker' in HTMLInputElement.prototype &&
|
|
3642
3642
|
CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
|
|
3643
3643
|
|
|
3644
|
-
const prefix = `[Porsche Design System v${"3.
|
|
3644
|
+
const prefix = `[Porsche Design System v${"3.35.0-rc.0"}]` // this part isn't covered by unit tests
|
|
3645
3645
|
;
|
|
3646
3646
|
const consoleError = (...messages) => {
|
|
3647
3647
|
console.error(prefix, ...messages); // eslint-disable-line no-console
|
|
@@ -4037,7 +4037,7 @@ const forcedColorsMediaQuery = (style) => {
|
|
|
4037
4037
|
/**
|
|
4038
4038
|
* @css-variable {"name": "--p-hyphens", "description": "Sets the CSS `hyphens` property for text elements, controlling whether words can break and hyphenate automatically.", "defaultValue": "auto"}
|
|
4039
4039
|
*/
|
|
4040
|
-
const getComponentCss$
|
|
4040
|
+
const getComponentCss$1q = (size, compact, open, theme, sticky) => {
|
|
4041
4041
|
const { primaryColor, hoverColor, contrastLowColor, backgroundColor } = getThemedColors(theme);
|
|
4042
4042
|
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, contrastLowColor: contrastLowColorDark, backgroundColor: backgroundColorDark, } = getThemedColors('dark');
|
|
4043
4043
|
const cssVariablePositionStickyTop = '--p-accordion-position-sticky-top';
|
|
@@ -4183,6 +4183,66 @@ const getComponentCss$1p = (size, compact, open, theme, sticky) => {
|
|
|
4183
4183
|
});
|
|
4184
4184
|
};
|
|
4185
4185
|
|
|
4186
|
+
const getInlineSVGBackgroundImage = (path) => {
|
|
4187
|
+
return `url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${path}</svg>')`;
|
|
4188
|
+
};
|
|
4189
|
+
|
|
4190
|
+
// SVG path data extracted from packages/assets/projects/icons/dist/icons/ai-spark-filled.svg (optimized)
|
|
4191
|
+
const AI_TAG_ICON_PATH = '<path d="M10.85 6.39c.54 2.84.8 4.26 1.65 5.1s2.27 1.12 5.11 1.66c.52.18.52.52 0 .7-2.82.53-4.24.8-5.09 1.63-.86.85-1.13 2.27-1.67 5.13-.18.52-.52.52-.7 0-.54-2.84-.8-4.26-1.65-5.1s-2.27-1.12-5.11-1.66c-.52-.18-.52-.52 0-.7 2.84-.54 4.26-.8 5.1-1.65s1.12-2.27 1.66-5.11c.18-.52.52-.52.7 0m6.81-3.2c.25 1.32.38 1.98.77 2.38s1.06.52 2.39.77c.24.08.24.24 0 .32-1.3.25-1.97.38-2.36.75-.41.4-.54 1.06-.8 2.4-.08.25-.24.25-.32 0-.24-1.25-.37-1.91-.72-2.31-.39-.45-1.05-.57-2.44-.84-.24-.08-.24-.24 0-.32 1.33-.25 1.99-.38 2.38-.77s.53-1.06.78-2.39c.08-.24.24-.24.32 0"/>';
|
|
4192
|
+
|
|
4193
|
+
const getComponentCss$1p = (theme) => {
|
|
4194
|
+
const { backgroundFrostedColor, contrastHighColor } = getThemedColors(theme);
|
|
4195
|
+
const { backgroundFrostedColor: backgroundFrostedColorDark, contrastHighColor: contrastHighColorDark } = getThemedColors('dark');
|
|
4196
|
+
const iconMask = `${getInlineSVGBackgroundImage(AI_TAG_ICON_PATH)} center/contain no-repeat`;
|
|
4197
|
+
return getCss({
|
|
4198
|
+
'@global': {
|
|
4199
|
+
':host': {
|
|
4200
|
+
display: 'inline-flex',
|
|
4201
|
+
verticalAlign: 'top',
|
|
4202
|
+
whiteSpace: 'nowrap',
|
|
4203
|
+
...addImportantToEachRule({
|
|
4204
|
+
...colorSchemeStyles,
|
|
4205
|
+
...hostHiddenStyles,
|
|
4206
|
+
}),
|
|
4207
|
+
},
|
|
4208
|
+
abbr: {
|
|
4209
|
+
all: 'unset',
|
|
4210
|
+
},
|
|
4211
|
+
div: {
|
|
4212
|
+
display: 'flex',
|
|
4213
|
+
alignItems: 'center',
|
|
4214
|
+
gap: '2px',
|
|
4215
|
+
padding: '1px 6px 1px 4px',
|
|
4216
|
+
borderRadius: borderRadiusSmall,
|
|
4217
|
+
font: textXXSmallStyle.font,
|
|
4218
|
+
color: contrastHighColor,
|
|
4219
|
+
background: backgroundFrostedColor,
|
|
4220
|
+
...frostedGlassStyle,
|
|
4221
|
+
...(isHighContrastMode && {
|
|
4222
|
+
outline: '1px solid transparent',
|
|
4223
|
+
}),
|
|
4224
|
+
transition: `${getTransition('color')}, ${getTransition('background-color')}, ${getTransition('backdrop-filter')}`,
|
|
4225
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4226
|
+
color: contrastHighColorDark,
|
|
4227
|
+
background: backgroundFrostedColorDark,
|
|
4228
|
+
}),
|
|
4229
|
+
'&::before': {
|
|
4230
|
+
content: '""',
|
|
4231
|
+
width: '1rem',
|
|
4232
|
+
height: '1rem',
|
|
4233
|
+
backgroundColor: contrastHighColor,
|
|
4234
|
+
mask: iconMask,
|
|
4235
|
+
WebkitMask: iconMask,
|
|
4236
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4237
|
+
backgroundColor: contrastHighColorDark,
|
|
4238
|
+
}),
|
|
4239
|
+
...(isHighContrastMode && { backgroundColor: 'CanvasText' }),
|
|
4240
|
+
},
|
|
4241
|
+
},
|
|
4242
|
+
},
|
|
4243
|
+
});
|
|
4244
|
+
};
|
|
4245
|
+
|
|
4186
4246
|
const TOAST_Z_INDEX = 999999;
|
|
4187
4247
|
const BANNER_Z_INDEX = 99;
|
|
4188
4248
|
|
|
@@ -5642,10 +5702,6 @@ const escapeHashCharacter = (colorString) => {
|
|
|
5642
5702
|
return colorString.replace('#', '%23');
|
|
5643
5703
|
};
|
|
5644
5704
|
|
|
5645
|
-
const getInlineSVGBackgroundImage = (path) => {
|
|
5646
|
-
return `url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${path}</svg>')`;
|
|
5647
|
-
};
|
|
5648
|
-
|
|
5649
5705
|
const getFunctionalComponentRequiredStyles = () => {
|
|
5650
5706
|
return {
|
|
5651
5707
|
required: {
|
|
@@ -12291,4 +12347,4 @@ const getComponentCss = (size, theme) => {
|
|
|
12291
12347
|
});
|
|
12292
12348
|
};
|
|
12293
12349
|
|
|
12294
|
-
export { cssVarButtonPureMargin, cssVarButtonPurePadding, cssVarInternalInputBaseScaling, getComponentCss$
|
|
12350
|
+
export { cssVarButtonPureMargin, cssVarButtonPurePadding, cssVarInternalInputBaseScaling, getComponentCss$1q as getAccordionCss, getComponentCss$1p as getAiTagCss, getComponentCss$1o as getBannerCss, getComponentCss$1k as getButtonCss, getComponentCss$1n as getButtonGroupCss, getComponentCss$1m as getButtonPureCss, getComponentCss$1l as getButtonTileCss, getComponentCss$1j as getCanvasCss, getComponentCss$1i as getCarouselCss, getComponentCss$1g as getCheckboxCss, getComponentCss$1h as getCheckboxWrapperCss, getComponentCss$1f as getContentWrapperCss, getComponentCss$1e as getCrestCss, getComponentCss$1d as getDisplayCss, getComponentCss$1c as getDividerCss, getComponentCss$1b as getDrilldownCss, getComponentCss$1a as getDrilldownItemCss, getComponentCss$19 as getDrilldownLinkCss, getComponentCss$17 as getFieldsetCss, getComponentCss$18 as getFieldsetWrapperCss, getComponentCss$16 as getFlagCss, getComponentCss$14 as getFlexCss, getComponentCss$15 as getFlexItemCss, getComponentCss$13 as getFlyoutCss, getFunctionalComponentInputBaseStyles, getFunctionalComponentLabelAfterStyles, getFunctionalComponentLabelStyles, getFunctionalComponentLoadingMessageStyles, getFunctionalComponentNoResultsOptionStyles, getFunctionalComponentRequiredStyles, getFunctionalComponentStateMessageStyles, getComponentCss$11 as getGridCss, getComponentCss$12 as getGridItemCss, getComponentCss$10 as getHeadingCss, getComponentCss$$ as getHeadlineCss, getComponentCss$_ as getIconCss, getComponentCss$Z as getInlineNotificationCss, getComponentCss$Y as getInputDateCss, getComponentCss$X as getInputEmailCss, getComponentCss$W as getInputMonthCss, getComponentCss$V as getInputNumberCss, getComponentCss$U as getInputPasswordCss, getComponentCss$T as getInputSearchCss, getComponentCss$S as getInputTelCss, getComponentCss$R as getInputTextCss, getComponentCss$Q as getInputTimeCss, getComponentCss$P as getInputUrlCss, getComponentCss$O as getInputWeekCss, getComponentCss$M as getLinkCss, getComponentCss$N as getLinkPureCss, getComponentCss$M as getLinkSocialCss, getComponentCss$J as getLinkTileCss, getComponentCss$L as getLinkTileModelSignatureCss, getComponentCss$K as getLinkTileProductCss, getComponentCss$I as getMarqueCss, getComponentCss$H as getModalCss, getComponentCss$G as getModelSignatureCss, getComponentCss$D as getMultiSelectCss, getComponentCss$F as getMultiSelectOptionCss, getComponentCss$E as getOptgroupCss, getComponentCss$C as getPaginationCss, getComponentCss$B as getPinCodeCss, getComponentCss$A as getPopoverCss, getComponentCss$z as getRadioButtonWrapperCss, getComponentCss$x as getRadioGroupCss, getComponentCss$y as getRadioGroupOptionCss, getScalingVar$4 as getScalingVar, getComponentCss$w as getScrollerCss, getComponentCss$u as getSegmentedControlCss, getComponentCss$v as getSegmentedControlItemCss, getComponentCss$q as getSelectCss, getComponentCss$r as getSelectOptionCss, getComponentCss$s as getSelectWrapperCss, getComponentCss$t as getSelectWrapperDropdownCss, getComponentCss$p as getSheetCss, getComponentCss$o as getSpinnerCss, getComponentCss$m as getStepperHorizontalCss, getComponentCss$n as getStepperHorizontalItemCss, getComponentCss$l as getSwitchCss, getComponentCss$k as getTableBodyCss, getComponentCss$i as getTableCellCss, getComponentCss$j as getTableCss, getComponentCss$h as getTableHeadCellCss, getComponentCss$f as getTableHeadCss, getComponentCss$g as getTableHeadRowCss, getComponentCss$e as getTableRowCss, getComponentCss$d as getTabsBarCss, getComponentCss$b as getTabsCss, getComponentCss$c as getTabsItemCss, getComponentCss$9 as getTagCss, getComponentCss$a as getTagDismissibleCss, getComponentCss$5 as getTextCss, getComponentCss$8 as getTextFieldWrapperCss, getComponentCss$7 as getTextListCss, getComponentCss$6 as getTextListItemCss, getComponentCss$3 as getTextareaCss, getComponentCss$4 as getTextareaWrapperCss, getComponentCss$1 as getToastCss, getComponentCss as getWordmarkCss };
|
|
@@ -3444,7 +3444,7 @@ const hasShowPickerSupport = () => (hasDocument &&
|
|
|
3444
3444
|
'showPicker' in HTMLInputElement.prototype &&
|
|
3445
3445
|
CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
|
|
3446
3446
|
|
|
3447
|
-
const prefix = `[Porsche Design System v${"3.
|
|
3447
|
+
const prefix = `[Porsche Design System v${"3.35.0-rc.0"}]` // this part isn't covered by unit tests
|
|
3448
3448
|
;
|
|
3449
3449
|
const consoleError$1 = (...messages) => {
|
|
3450
3450
|
console.error(prefix, ...messages); // eslint-disable-line no-console
|
|
@@ -3631,6 +3631,162 @@ const internalValidateProps = {
|
|
|
3631
3631
|
const breakpointCustomizableTemplate = `value, ${internalValidateProps
|
|
3632
3632
|
.formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {}))
|
|
3633
3633
|
.replace(/"/g, '')}`;
|
|
3634
|
+
// ISO locale code to AI text mapping
|
|
3635
|
+
const AI_TAG_TRANSLATIONS = {
|
|
3636
|
+
bg_BG: {
|
|
3637
|
+
short: 'ИИ',
|
|
3638
|
+
long: 'изкуствен интелект',
|
|
3639
|
+
generated: 'генериран от изкуствен интелект',
|
|
3640
|
+
modified: 'модифициран от изкуствен интелект',
|
|
3641
|
+
},
|
|
3642
|
+
bs_BA: { short: 'AI', long: 'vještačka inteligencija', generated: 'AI-generisano', modified: 'AI-modifikovano' },
|
|
3643
|
+
cs_CZ: { short: 'AI', long: 'umělá inteligence', generated: 'Vytvořeno AI', modified: 'Upraveno AI' },
|
|
3644
|
+
da_DK: { short: 'KI', long: 'kunstig intelligens', generated: 'AI-genereret', modified: 'AI-modificeret' },
|
|
3645
|
+
de_DE: {
|
|
3646
|
+
short: 'KI',
|
|
3647
|
+
long: 'künstliche Intelligenz',
|
|
3648
|
+
generated: 'KI-generiert',
|
|
3649
|
+
modified: 'KI-modifiziert',
|
|
3650
|
+
},
|
|
3651
|
+
el_GR: {
|
|
3652
|
+
short: 'ΤΝ',
|
|
3653
|
+
long: 'τεχνητή νοημοσύνη',
|
|
3654
|
+
generated: 'Δημιουργημένο από ΤΝ',
|
|
3655
|
+
modified: 'Τροποποιημένο από ΤΝ',
|
|
3656
|
+
},
|
|
3657
|
+
en_CY: { short: 'AI', long: 'artificial intelligence', generated: 'AI-generated', modified: 'AI-modified' },
|
|
3658
|
+
en_GB: { short: 'AI', long: 'artificial intelligence', generated: 'AI-generated', modified: 'AI-modified' },
|
|
3659
|
+
en_US: { short: 'AI', long: 'artificial intelligence', generated: 'AI-generated', modified: 'AI-modified' },
|
|
3660
|
+
es_ES: {
|
|
3661
|
+
short: 'IA',
|
|
3662
|
+
long: 'inteligencia artificial',
|
|
3663
|
+
generated: 'Generado por IA',
|
|
3664
|
+
modified: 'Modificado por IA',
|
|
3665
|
+
},
|
|
3666
|
+
et_EE: { short: 'TI', long: 'tehisintellekt', generated: 'TI abil loodud', modified: 'TI abil muudetud' },
|
|
3667
|
+
fi_FI: {
|
|
3668
|
+
short: 'AI',
|
|
3669
|
+
long: 'tekoäly',
|
|
3670
|
+
generated: 'Tekoälyn tuottama',
|
|
3671
|
+
modified: 'Tekoälyn muokkaama',
|
|
3672
|
+
},
|
|
3673
|
+
fr_FR: {
|
|
3674
|
+
short: 'IA',
|
|
3675
|
+
long: 'intelligence artificielle',
|
|
3676
|
+
generated: 'Généré par une IA',
|
|
3677
|
+
modified: 'Modifié par une IA',
|
|
3678
|
+
},
|
|
3679
|
+
he_IL: {
|
|
3680
|
+
short: 'AI',
|
|
3681
|
+
long: 'בינה מלאכותית',
|
|
3682
|
+
generated: 'נוצר על ידי בינה מלאכותית',
|
|
3683
|
+
modified: 'נערך באמצעות בינה מלאכותית',
|
|
3684
|
+
},
|
|
3685
|
+
hr_HR: {
|
|
3686
|
+
short: 'UI',
|
|
3687
|
+
long: 'umjetna inteligencija',
|
|
3688
|
+
generated: 'Generirano uz pomoć UI',
|
|
3689
|
+
modified: 'Izmijenjeno uz pomoć UI',
|
|
3690
|
+
},
|
|
3691
|
+
hu_HU: {
|
|
3692
|
+
short: 'MI',
|
|
3693
|
+
long: 'mesterséges intelligencia',
|
|
3694
|
+
generated: 'MI-generált',
|
|
3695
|
+
modified: 'MI-módosított',
|
|
3696
|
+
},
|
|
3697
|
+
is_IS: {
|
|
3698
|
+
short: 'AI',
|
|
3699
|
+
long: 'gervigreind',
|
|
3700
|
+
generated: 'Búið til af gervigreind',
|
|
3701
|
+
modified: 'Breytt af gervigreind',
|
|
3702
|
+
},
|
|
3703
|
+
it_IT: {
|
|
3704
|
+
short: 'IA',
|
|
3705
|
+
long: 'intelligenza artificiale',
|
|
3706
|
+
generated: "Generato dall'IA",
|
|
3707
|
+
modified: "Modificato dall'IA",
|
|
3708
|
+
},
|
|
3709
|
+
lt_LT: {
|
|
3710
|
+
short: 'DI',
|
|
3711
|
+
long: 'dirbtinis intelektas',
|
|
3712
|
+
generated: 'DI sugeneruotas',
|
|
3713
|
+
modified: 'DI modifikuotas',
|
|
3714
|
+
},
|
|
3715
|
+
lv_LV: {
|
|
3716
|
+
short: 'MI',
|
|
3717
|
+
long: 'mākslīgais intelekts',
|
|
3718
|
+
generated: 'MI ģenerēts',
|
|
3719
|
+
modified: 'MI pārveidots',
|
|
3720
|
+
},
|
|
3721
|
+
me_ME: { short: 'AI', long: 'veštačka inteligencija', generated: 'AI-generisano', modified: 'AI-modifikovano' },
|
|
3722
|
+
mk_MK: {
|
|
3723
|
+
short: 'ВИ',
|
|
3724
|
+
long: 'вештачка интелигенција',
|
|
3725
|
+
generated: 'Создадено од ВИ',
|
|
3726
|
+
modified: 'Изменето со ВИ',
|
|
3727
|
+
},
|
|
3728
|
+
mt_MT: { short: 'AI', long: 'artificial intelligence', generated: 'AI-generated', modified: 'AI-modified' },
|
|
3729
|
+
nb_NO: {
|
|
3730
|
+
short: 'KI',
|
|
3731
|
+
long: 'kunstig intelligens',
|
|
3732
|
+
generated: 'KI-generert',
|
|
3733
|
+
modified: 'KI-modifisert',
|
|
3734
|
+
},
|
|
3735
|
+
nl_NL: {
|
|
3736
|
+
short: 'AI',
|
|
3737
|
+
long: 'kunstmatige intelligentie',
|
|
3738
|
+
generated: 'Door AI gegenereerd',
|
|
3739
|
+
modified: 'Door AI gewijzigd',
|
|
3740
|
+
},
|
|
3741
|
+
pl_PL: {
|
|
3742
|
+
short: 'SI',
|
|
3743
|
+
long: 'sztuczna inteligencja',
|
|
3744
|
+
generated: 'Wygenerowane przez SI',
|
|
3745
|
+
modified: 'Zmodyfikowane przez SI',
|
|
3746
|
+
},
|
|
3747
|
+
pt_PT: {
|
|
3748
|
+
short: 'IA',
|
|
3749
|
+
long: 'inteligência artificial',
|
|
3750
|
+
generated: 'Gerado por IA',
|
|
3751
|
+
modified: 'Modificado por IA',
|
|
3752
|
+
},
|
|
3753
|
+
ro_RO: {
|
|
3754
|
+
short: 'IA',
|
|
3755
|
+
long: 'inteligență artificială',
|
|
3756
|
+
generated: 'Generat cu ajutorul IA',
|
|
3757
|
+
modified: 'Modificat cu ajutorul IA',
|
|
3758
|
+
},
|
|
3759
|
+
ru_RU: {
|
|
3760
|
+
short: 'ИИ',
|
|
3761
|
+
long: 'искусственный интеллект',
|
|
3762
|
+
generated: 'Сгенерировано ИИ',
|
|
3763
|
+
modified: 'Изменено ИИ',
|
|
3764
|
+
},
|
|
3765
|
+
sk_SK: { short: 'AI', long: 'umelá inteligencia', generated: 'Vytvorené AI', modified: 'Upravené AI' },
|
|
3766
|
+
sl_SI: { short: 'UI', long: 'umetna inteligenca', generated: 'Ustvarjeno z UI', modified: 'Spremenjeno z UI' },
|
|
3767
|
+
sr_RS: { short: 'AI', long: 'veštačka inteligencija', generated: 'AI-generisano', modified: 'AI-modifikovano' },
|
|
3768
|
+
sv_SE: {
|
|
3769
|
+
short: 'AI',
|
|
3770
|
+
long: 'artificiell intelligens',
|
|
3771
|
+
generated: 'AI-genererad',
|
|
3772
|
+
modified: 'AI-modifierad',
|
|
3773
|
+
},
|
|
3774
|
+
tr_TR: {
|
|
3775
|
+
short: 'AI',
|
|
3776
|
+
long: 'yapay zeka',
|
|
3777
|
+
generated: 'Yapay zeka tarafından üretilmiş',
|
|
3778
|
+
modified: 'Yapay zeka tarafından değiştirilmiş',
|
|
3779
|
+
},
|
|
3780
|
+
uk_UA: {
|
|
3781
|
+
short: 'ШІ',
|
|
3782
|
+
long: 'штучний інтелект',
|
|
3783
|
+
generated: 'Згенеровано ШІ',
|
|
3784
|
+
modified: 'Змінено ШІ',
|
|
3785
|
+
},
|
|
3786
|
+
};
|
|
3787
|
+
const getAiTagTranslation = (locale) => {
|
|
3788
|
+
return AI_TAG_TRANSLATIONS[locale] ?? AI_TAG_TRANSLATIONS['en_US'];
|
|
3789
|
+
};
|
|
3634
3790
|
const getButtonPureAriaAttributes = (isDisabled, isLoading, aria) => {
|
|
3635
3791
|
return {
|
|
3636
3792
|
...parseAndGetAriaAttributes(aria),
|
|
@@ -3995,4 +4151,4 @@ const getTextTagType = (host, tag) => {
|
|
|
3995
4151
|
return tag;
|
|
3996
4152
|
};
|
|
3997
4153
|
|
|
3998
|
-
export { DISPLAY_TAGS, HEADING_TAGS, HEADLINE_TAGS, ItemType, TEXT_TAGS, VARIANT_TO_COLOR_MAP, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildFlagUrl, buildIconUrl, buildImgSrc, buildSrcSet, consoleError$1 as consoleError, createPaginationItems, createRange, crestSize, descriptionId, displaySizeToTagMap, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getClosestHTMLElement, getComboboxAriaAttributes, getContentAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFieldsetAriaAttributes, getHTMLElement, getHasNativePopoverSupport, getHeadingTagType, getHeadlineTagType, getIconColor, getInlineNotificationIconName, getInnerManifest, getSegmentedControlItemAriaAttributes, getSelectedOptionMap, getStepperHorizontalIconName, getSvgUrl, getSwitchButtonAriaAttributes, getTagName, getTagNameWithoutPrefix, getTextTagType, getTotalPages, hasDocument, hasLocateAction, hasShowPickerSupport, hasSpecificDirectChildTag, hasVisibleIcon, hasWindow$1 as hasWindow, headerSlot, internalDrilldown, isCurrentInput, isCustomDropdown, isDisabledOrLoading, isElementOfKind, isInfinitePagination, isListTypeOrdered, isScrollable, isSortable, isStateCompleteOrWarning, isTouchDevice, isType, isUrl, isWithinForm, labelId, observedNodesMap, parseAndGetAriaAttributes, parseJSONAttribute, scrollAreaClass, showCustomCalendarOrTimeIndicator, supportsConstructableStylesheets, supportsNativePopover, tempDiv, tempIcon, tempLabel, traverseTreeAndUpdateState, updateDrilldownItemState };
|
|
4154
|
+
export { AI_TAG_TRANSLATIONS, DISPLAY_TAGS, HEADING_TAGS, HEADLINE_TAGS, ItemType, TEXT_TAGS, VARIANT_TO_COLOR_MAP, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildFlagUrl, buildIconUrl, buildImgSrc, buildSrcSet, consoleError$1 as consoleError, createPaginationItems, createRange, crestSize, descriptionId, displaySizeToTagMap, getAiTagTranslation, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getClosestHTMLElement, getComboboxAriaAttributes, getContentAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFieldsetAriaAttributes, getHTMLElement, getHasNativePopoverSupport, getHeadingTagType, getHeadlineTagType, getIconColor, getInlineNotificationIconName, getInnerManifest, getSegmentedControlItemAriaAttributes, getSelectedOptionMap, getStepperHorizontalIconName, getSvgUrl, getSwitchButtonAriaAttributes, getTagName, getTagNameWithoutPrefix, getTextTagType, getTotalPages, hasDocument, hasLocateAction, hasShowPickerSupport, hasSpecificDirectChildTag, hasVisibleIcon, hasWindow$1 as hasWindow, headerSlot, internalDrilldown, isCurrentInput, isCustomDropdown, isDisabledOrLoading, isElementOfKind, isInfinitePagination, isListTypeOrdered, isScrollable, isSortable, isStateCompleteOrWarning, isTouchDevice, isType, isUrl, isWithinForm, labelId, observedNodesMap, parseAndGetAriaAttributes, parseJSONAttribute, scrollAreaClass, showCustomCalendarOrTimeIndicator, supportsConstructableStylesheets, supportsNativePopover, tempDiv, tempIcon, tempLabel, traverseTreeAndUpdateState, updateDrilldownItemState };
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/ai-tag.wrapper.mjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, useRef } from 'react';
|
|
4
|
+
import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
|
+
import { syncRef } from '../../utils.mjs';
|
|
6
|
+
import { DSRAiTag } from '../dsr-components/ai-tag.mjs';
|
|
7
|
+
|
|
8
|
+
const PAiTag = /*#__PURE__*/ forwardRef(({ locale = 'en_US', theme, variant = 'generated', className, ...rest }, ref) => {
|
|
9
|
+
const elementRef = useRef(undefined);
|
|
10
|
+
const WebComponentTag = usePrefix('p-ai-tag');
|
|
11
|
+
const propsToSync = [locale, theme || useTheme(), variant];
|
|
12
|
+
useBrowserLayoutEffect(() => {
|
|
13
|
+
const { current } = elementRef;
|
|
14
|
+
['locale', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
}, propsToSync);
|
|
16
|
+
const props = {
|
|
17
|
+
...rest,
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
...(!process.browser
|
|
20
|
+
? {
|
|
21
|
+
children: (jsx(DSRAiTag, { locale, theme: theme || useTheme(), variant })),
|
|
22
|
+
}
|
|
23
|
+
: {
|
|
24
|
+
suppressHydrationWarning: true,
|
|
25
|
+
}),
|
|
26
|
+
'data-ssr': '',
|
|
27
|
+
class: useMergedClass(elementRef, className),
|
|
28
|
+
ref: syncRef(elementRef, ref)
|
|
29
|
+
};
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
return jsx(WebComponentTag, { ...props });
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export { PAiTag };
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { Component } from 'react';
|
|
|
3
3
|
import '../../provider.mjs';
|
|
4
4
|
import { splitChildren } from '../../splitChildren.mjs';
|
|
5
5
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
6
|
-
import { getAccordionCss as getComponentCss$
|
|
6
|
+
import { getAccordionCss as getComponentCss$1q } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
7
7
|
import { PIcon } from '../components/icon.wrapper.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -19,7 +19,7 @@ class DSRAccordion extends Component {
|
|
|
19
19
|
const buttonId = 'accordion-control';
|
|
20
20
|
const contentId = 'accordion-panel';
|
|
21
21
|
const Heading = this.props.tag || this.props.headingTag;
|
|
22
|
-
const style = minifyCss(getComponentCss$
|
|
22
|
+
const style = minifyCss(getComponentCss$1q(this.props.size, this.props.compact, this.props.open, this.props.theme, this.props.sticky));
|
|
23
23
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx(Heading, { className: "heading", children: jsxs("button", { id: buttonId, type: "button", "aria-expanded": this.props.open ? 'true' : 'false', "aria-controls": contentId, children: [this.props.heading || jsx("slot", { name: "heading" }), jsx("span", { className: "icon-container", children: jsx(PIcon, { className: "icon", name: this.props.open ? 'minus' : 'plus', theme: this.props.theme, size: "xx-small", "aria-hidden": "true" }) })] }) }), jsx("div", { id: contentId, className: "collapsible", role: "region", "aria-labelledby": buttonId, children: jsx("div", { children: jsx("slot", {}) }) })] })] }), this.props.children] }));
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Component } from 'react';
|
|
3
|
+
import { minifyCss } from '../../minifyCss.mjs';
|
|
4
|
+
import { getAiTagCss as getComponentCss$1p } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
5
|
+
import { getAiTagTranslation } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
6
|
+
|
|
7
|
+
class DSRAiTag extends Component {
|
|
8
|
+
host;
|
|
9
|
+
render() {
|
|
10
|
+
const { short, long, generated, modified } = getAiTagTranslation(this.props.locale);
|
|
11
|
+
const style = minifyCss(getComponentCss$1p(this.props.theme));
|
|
12
|
+
return (jsx(Fragment, { children: jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx("div", { children: this.props.variant !== 'abbreviation' ? (this.props.variant === 'modified' ? (modified) : (generated)) : (jsx("abbr", { title: long, children: short })) })] }) }));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { DSRAiTag };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { componentsReady } from '@porsche-design-system/components-js';
|
|
2
2
|
export { PAccordion } from './lib/components/accordion.wrapper.mjs';
|
|
3
|
+
export { PAiTag } from './lib/components/ai-tag.wrapper.mjs';
|
|
3
4
|
export { PBanner } from './lib/components/banner.wrapper.mjs';
|
|
4
5
|
export { PButton } from './lib/components/button.wrapper.mjs';
|
|
5
6
|
export { PButtonGroup } from './lib/components/button-group.wrapper.mjs';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BaseProps } from '../../BaseProps';
|
|
2
|
+
import type { AiTagLocale, Theme, AiTagVariant } from '../types';
|
|
3
|
+
export type PAiTagProps = BaseProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Locale for the AI text (ISO format, e.g. "de_DE").
|
|
6
|
+
*/
|
|
7
|
+
locale?: AiTagLocale;
|
|
8
|
+
/**
|
|
9
|
+
* Adapts the tag color depending on the theme.
|
|
10
|
+
*/
|
|
11
|
+
theme?: Theme;
|
|
12
|
+
/**
|
|
13
|
+
* Variant to display: 'abbreviation' (e.g. "AI"), 'generated' (e.g. "AI-generated"), or 'modified' (e.g. "AI-modified").
|
|
14
|
+
*/
|
|
15
|
+
variant?: AiTagVariant;
|
|
16
|
+
};
|
|
17
|
+
export declare const PAiTag: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
|
|
18
|
+
/**
|
|
19
|
+
* Locale for the AI text (ISO format, e.g. "de_DE").
|
|
20
|
+
*/
|
|
21
|
+
locale?: AiTagLocale;
|
|
22
|
+
/**
|
|
23
|
+
* Adapts the tag color depending on the theme.
|
|
24
|
+
*/
|
|
25
|
+
theme?: Theme;
|
|
26
|
+
/**
|
|
27
|
+
* Variant to display: 'abbreviation' (e.g. "AI"), 'generated' (e.g. "AI-generated"), or 'modified' (e.g. "AI-modified").
|
|
28
|
+
*/
|
|
29
|
+
variant?: AiTagVariant;
|
|
30
|
+
} & import("react").RefAttributes<HTMLElement>>;
|