@porsche-design-system/components-react 4.0.0-alpha.0 → 4.0.0-beta.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 +187 -1
- package/bin/patchRemixRunProcessBrowserGlobalIdentifier.js +0 -0
- package/cjs/lib/components/canvas.wrapper.cjs +3 -3
- package/{styles → emotion}/cjs/index.cjs +3 -3
- package/emotion/esm/index.d.ts +1 -0
- package/emotion/esm/index.mjs +1 -0
- package/{styles → emotion}/package.json +0 -5
- package/esm/lib/components/canvas.wrapper.d.ts +9 -1
- package/esm/lib/components/canvas.wrapper.mjs +3 -3
- package/esm/lib/components/display.wrapper.d.ts +2 -2
- package/esm/lib/components/divider.wrapper.d.ts +2 -2
- package/esm/lib/components/heading.wrapper.d.ts +2 -2
- package/esm/lib/components/icon.wrapper.d.ts +2 -2
- package/esm/lib/components/radio-group-option.wrapper.d.ts +2 -0
- package/esm/lib/components/text.wrapper.d.ts +2 -2
- package/esm/lib/components/textarea.wrapper.d.ts +2 -2
- package/esm/lib/types.d.ts +8 -1
- package/global-styles/cn/font-face.css +1 -1
- package/global-styles/cn/index.css +264 -115
- package/global-styles/color-scheme.css +135 -0
- package/global-styles/font-face.css +1 -1
- package/global-styles/index.css +264 -115
- package/global-styles/variables.css +158 -144
- package/package.json +16 -14
- package/scss/_index.scss +1 -0
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +671 -600
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +37 -29
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/canvas.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/radio-group-option.wrapper.cjs +3 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.cjs +5 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.cjs +2 -13
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.cjs +5 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-date.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-email.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-month.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-search.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-tel.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-text.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-time.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-url.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-week.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/label.cjs +4 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.cjs +5 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +3 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.cjs +3 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-group-option.cjs +11 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-group.cjs +3 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.cjs +4 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea.cjs +1 -0
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +671 -601
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +37 -29
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/canvas.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/radio-group-option.wrapper.mjs +3 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.mjs +5 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs +2 -13
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +5 -3
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-date.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-email.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-month.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-search.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-tel.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-text.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-time.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-url.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-week.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/label.mjs +4 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.mjs +5 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +3 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs +5 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-group-option.mjs +12 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-group.mjs +4 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.mjs +4 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea.mjs +1 -0
- package/ssr/esm/lib/components/canvas.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/display.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/divider.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/heading.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/icon.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/radio-group-option.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/text.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/textarea.wrapper.d.ts +2 -2
- package/ssr/esm/lib/dsr-components/canvas.d.ts +0 -3
- package/ssr/esm/lib/dsr-components/checkbox.d.ts +4 -2
- package/ssr/esm/lib/dsr-components/input-date.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-email.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-month.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-number.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-password.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-search.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-tel.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-text.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-time.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-url.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-week.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/label.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/multi-select.d.ts +2 -1
- package/ssr/esm/lib/dsr-components/pin-code.d.ts +2 -1
- package/ssr/esm/lib/dsr-components/radio-group-option.d.ts +4 -0
- package/ssr/esm/lib/dsr-components/radio-group.d.ts +2 -1
- package/ssr/esm/lib/dsr-components/segmented-control.d.ts +2 -1
- package/ssr/esm/lib/dsr-components/select.d.ts +2 -1
- package/ssr/esm/lib/dsr-components/textarea.d.ts +1 -0
- package/ssr/esm/lib/types.d.ts +8 -1
- package/tailwindcss/index.css +223 -135
- package/{styles/vanilla-extract → vanilla-extract}/cjs/index.cjs +1 -1
- package/vanilla-extract/esm/index.d.ts +1 -0
- package/vanilla-extract/esm/index.mjs +1 -0
- package/vanilla-extract/package.json +13 -0
- package/ssr/esm/lib/dsr-components/legacy-label.d.ts +0 -14
- package/styles/_index.scss +0 -1
- package/styles/esm/index.d.ts +0 -1
- package/styles/esm/index.mjs +0 -1
- package/styles/vanilla-extract/esm/index.d.ts +0 -1
- package/styles/vanilla-extract/esm/index.mjs +0 -1
|
@@ -3271,62 +3271,68 @@ const getComboboxAriaAttributes = (isOpen, isRequired, labelId, descriptionId, d
|
|
|
3271
3271
|
};
|
|
3272
3272
|
};
|
|
3273
3273
|
|
|
3274
|
-
|
|
3274
|
+
/** @deprecated since v4.0.0, will be removed with next major release. Use 2px instead. */
|
|
3275
|
+
const borderWidthBase = '2px';
|
|
3275
3276
|
|
|
3276
|
-
const
|
|
3277
|
+
const fontPorscheNext = "'Porsche Next','Arial Narrow',Arial,'Heiti SC',SimHei,sans-serif";
|
|
3277
3278
|
|
|
3278
|
-
|
|
3279
|
+
/** @deprecated since v4.0.0, will be removed with next major release. Use fontPorscheNext instead. */
|
|
3280
|
+
const fontFamily = fontPorscheNext;
|
|
3279
3281
|
|
|
3280
|
-
const
|
|
3282
|
+
const leadingNormal = 'calc(6px + 2.125ex)';
|
|
3281
3283
|
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
// @ts-ignore
|
|
3285
|
-
hyphens: 'var(--p-hyphens, auto)',
|
|
3286
|
-
};
|
|
3287
|
-
|
|
3288
|
-
const fontLineHeight$1 = 'calc(6px + 2.125ex)';
|
|
3289
|
-
|
|
3290
|
-
const fontLineHeight = fontLineHeight$1;
|
|
3291
|
-
|
|
3292
|
-
const fontSizeXs = 'clamp(0.81rem, 0.23vw + 0.77rem, 0.88rem)';
|
|
3284
|
+
/** @deprecated since v4.0.0, will be removed with next major release. Use leadingNormal instead */
|
|
3285
|
+
const fontLineHeight = leadingNormal;
|
|
3293
3286
|
|
|
3294
|
-
const
|
|
3287
|
+
const typescaleSm = '1rem';
|
|
3295
3288
|
|
|
3296
|
-
|
|
3289
|
+
/** @deprecated since v4.0.0, will be removed with next major release. Use typescaleSm instead. */
|
|
3290
|
+
const fontSizeTextSmall = typescaleSm;
|
|
3297
3291
|
|
|
3298
|
-
const
|
|
3292
|
+
const typescaleXs = 'clamp(0.81rem, 0.23vw + 0.77rem, 0.88rem)';
|
|
3299
3293
|
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
const fontWeightRegular = fontWeightRegular$1;
|
|
3294
|
+
/** @deprecated since v4.0.0, will be removed with next major release. Use typescaleXs instead. */
|
|
3295
|
+
const fontSizeTextXSmall = typescaleXs;
|
|
3303
3296
|
|
|
3297
|
+
/** @deprecated since v4.0.0, will be removed with next major release. Use 'normal' instead. */
|
|
3304
3298
|
const fontStyleNormal = 'normal';
|
|
3305
3299
|
|
|
3300
|
+
/** @deprecated since v4.0.0, will be removed with next major release. Use 'normal' instead. */
|
|
3306
3301
|
const fontVariant = 'normal';
|
|
3307
3302
|
|
|
3308
|
-
const
|
|
3303
|
+
const fontWeightNormal = 400;
|
|
3309
3304
|
|
|
3310
|
-
|
|
3305
|
+
/** @deprecated since v4.0.0, will be removed with next major release. Use fontWeightNormal instead. */
|
|
3306
|
+
const fontWeightRegular = fontWeightNormal;
|
|
3311
3307
|
|
|
3312
|
-
const
|
|
3308
|
+
const fontHyphenationStyle = {
|
|
3309
|
+
overflowWrap: 'break-word',
|
|
3310
|
+
// @ts-ignore
|
|
3311
|
+
hyphens: 'var(--p-hyphens, auto)',
|
|
3312
|
+
};
|
|
3313
3313
|
|
|
3314
|
-
const
|
|
3314
|
+
const breakpointBase = 0;
|
|
3315
3315
|
|
|
3316
|
-
const
|
|
3316
|
+
const breakpointLg = 1300;
|
|
3317
|
+
|
|
3318
|
+
const breakpointL = breakpointLg;
|
|
3317
3319
|
|
|
3318
3320
|
const breakpointMd = 1000;
|
|
3319
3321
|
|
|
3320
3322
|
const breakpointM = breakpointMd;
|
|
3321
3323
|
|
|
3322
|
-
const
|
|
3324
|
+
const breakpointSm = 760;
|
|
3323
3325
|
|
|
3324
|
-
const
|
|
3326
|
+
const breakpointS = breakpointSm;
|
|
3325
3327
|
|
|
3326
3328
|
const breakpointXl = 1760;
|
|
3327
3329
|
|
|
3328
3330
|
const breakpointXL = breakpointXl;
|
|
3329
3331
|
|
|
3332
|
+
const breakpointXs = 480;
|
|
3333
|
+
|
|
3334
|
+
const breakpointXS = breakpointXs;
|
|
3335
|
+
|
|
3330
3336
|
const breakpoint2Xl = 1920;
|
|
3331
3337
|
|
|
3332
3338
|
const breakpointXXL = breakpoint2Xl;
|
|
@@ -3350,11 +3356,13 @@ const breakpoints = ['base', 'xs', 's', 'm', 'l', 'xl', 'xxl'];
|
|
|
3350
3356
|
const _textFontPartA = `${fontStyleNormal} ${fontVariant} ${fontWeightRegular} `;
|
|
3351
3357
|
const _textFontPartB = `/${fontLineHeight} ${fontFamily}`;
|
|
3352
3358
|
|
|
3359
|
+
/** @deprecated since v4.0.0, will be removed with next major release. Use proseTextXs instead. */
|
|
3353
3360
|
const textXSmallStyle = {
|
|
3354
3361
|
font: `${_textFontPartA}${fontSizeTextXSmall}${_textFontPartB}`,
|
|
3355
3362
|
...fontHyphenationStyle,
|
|
3356
3363
|
};
|
|
3357
3364
|
|
|
3365
|
+
/** @deprecated since v4.0.0, will be removed with next major release. Use proseTextSm instead. */
|
|
3358
3366
|
const textSmallStyle = {
|
|
3359
3367
|
font: `${_textFontPartA}${fontSizeTextSmall}${_textFontPartB}`,
|
|
3360
3368
|
...fontHyphenationStyle,
|
|
@@ -3439,7 +3447,7 @@ const hasShowPickerSupport = () => (hasDocument &&
|
|
|
3439
3447
|
'showPicker' in HTMLInputElement.prototype &&
|
|
3440
3448
|
CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
|
|
3441
3449
|
|
|
3442
|
-
const prefix = `[Porsche Design System v${"4.0.0-
|
|
3450
|
+
const prefix = `[Porsche Design System v${"4.0.0-beta.0"}]` // this part isn't covered by unit tests
|
|
3443
3451
|
;
|
|
3444
3452
|
const consoleError$1 = (...messages) => {
|
|
3445
3453
|
console.error(prefix, ...messages);
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/canvas.wrapper.mjs
CHANGED
|
@@ -5,22 +5,22 @@ import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } f
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRCanvas } from '../dsr-components/canvas.mjs';
|
|
7
7
|
|
|
8
|
-
const PCanvas = /*#__PURE__*/ forwardRef(({ onSidebarEndDismiss, onSidebarStartUpdate, sidebarEndOpen = false, sidebarStartOpen = false, className, children, ...rest }, ref) => {
|
|
8
|
+
const PCanvas = /*#__PURE__*/ forwardRef(({ background = 'canvas', onSidebarEndDismiss, onSidebarStartUpdate, sidebarEndOpen = false, sidebarStartOpen = false, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef(undefined);
|
|
10
10
|
useEventCallback(elementRef, 'sidebarEndDismiss', onSidebarEndDismiss);
|
|
11
11
|
useEventCallback(elementRef, 'sidebarStartUpdate', onSidebarStartUpdate);
|
|
12
12
|
const WebComponentTag = usePrefix('p-canvas');
|
|
13
|
-
const propsToSync = [sidebarEndOpen, sidebarStartOpen];
|
|
13
|
+
const propsToSync = [background, sidebarEndOpen, sidebarStartOpen];
|
|
14
14
|
useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['sidebarEndOpen', 'sidebarStartOpen'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['background', 'sidebarEndOpen', 'sidebarStartOpen'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
const props = {
|
|
19
19
|
...rest,
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
...(!process.browser
|
|
22
22
|
? {
|
|
23
|
-
children: (jsx(DSRCanvas, { sidebarEndOpen, sidebarStartOpen, children })),
|
|
23
|
+
children: (jsx(DSRCanvas, { background, sidebarEndOpen, sidebarStartOpen, children })),
|
|
24
24
|
}
|
|
25
25
|
: {
|
|
26
26
|
children,
|
|
@@ -5,7 +5,7 @@ import { usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.m
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRRadioGroupOption } from '../dsr-components/radio-group-option.mjs';
|
|
7
7
|
|
|
8
|
-
const PRadioGroupOption = /*#__PURE__*/ forwardRef(({ disabled = false, label, loading = false, value, className, ...rest }, ref) => {
|
|
8
|
+
const PRadioGroupOption = /*#__PURE__*/ forwardRef(({ disabled = false, label, loading = false, value, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef(undefined);
|
|
10
10
|
const WebComponentTag = usePrefix('p-radio-group-option');
|
|
11
11
|
const propsToSync = [disabled, label, loading, value];
|
|
@@ -18,9 +18,10 @@ const PRadioGroupOption = /*#__PURE__*/ forwardRef(({ disabled = false, label, l
|
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
...(!process.browser
|
|
20
20
|
? {
|
|
21
|
-
children: (jsx(DSRRadioGroupOption, { disabled, label, loading, value })),
|
|
21
|
+
children: (jsx(DSRRadioGroupOption, { disabled, label, loading, value, children })),
|
|
22
22
|
}
|
|
23
23
|
: {
|
|
24
|
+
children,
|
|
24
25
|
suppressHydrationWarning: true,
|
|
25
26
|
}),
|
|
26
27
|
'data-ssr': '',
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.mjs
CHANGED
|
@@ -6,7 +6,6 @@ import { minifyCss } from '../../minifyCss.mjs';
|
|
|
6
6
|
import { getButtonTileCss as getComponentCss$16 } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
7
7
|
import { isDisabledOrLoading } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
8
8
|
import { PButton } from '../components/button.wrapper.mjs';
|
|
9
|
-
import { PButtonPure } from '../components/button-pure.wrapper.mjs';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* @slot {"name": "header", "description": "Renders a header section above the content area." }
|
|
@@ -18,6 +17,8 @@ class DSRButtonTile extends Component {
|
|
|
18
17
|
hasFooterSlot = false;
|
|
19
18
|
render() {
|
|
20
19
|
splitChildren(this.props.children);
|
|
20
|
+
// TODO: BreakpointCustomizable breaks stencils boolean conversion from string to boolean
|
|
21
|
+
const parsedCompact = this.props.compact === 'true' ? true : this.props.compact === 'false' ? false : this.props.compact;
|
|
21
22
|
const buttonProps = {
|
|
22
23
|
variant: 'secondary',
|
|
23
24
|
iconSource: this.props.iconSource,
|
|
@@ -27,9 +28,9 @@ class DSRButtonTile extends Component {
|
|
|
27
28
|
aria: this.props.aria,
|
|
28
29
|
};
|
|
29
30
|
const button = (createElement(PButton, { ...buttonProps, icon: this.props.icon, key: "link-or-button", className: "link-or-button" }, this.props.label));
|
|
30
|
-
const
|
|
31
|
-
const style = minifyCss(getComponentCss$16(isDisabledOrLoading(this.props.disabled, this.props.loading), this.props.aspectRatio, this.props.size, this.props.weight, this.props.align,
|
|
32
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx("slot", { name: "header" }), jsx("div", { className: "media", children: jsx("slot", {}) }), jsxs("div", { className: "footer", children: [jsx("p", { children: this.props.description }), jsx("slot", { name: "footer" }), typeof
|
|
31
|
+
const buttonCompact = (createElement(PButton, { ...buttonProps, key: "link-or-button-pure", className: "link-or-button-pure", hideLabel: true, compact: true, icon: this.props.icon === 'none' ? 'arrow-right' : this.props.icon }, this.props.label));
|
|
32
|
+
const style = minifyCss(getComponentCss$16(isDisabledOrLoading(this.props.disabled, this.props.loading), this.props.aspectRatio, this.props.size, this.props.weight, this.props.align, parsedCompact, this.props.gradient, this.props.hasFooterSlot, this.props.disabled));
|
|
33
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx("slot", { name: "header" }), jsx("div", { className: "media", children: jsx("slot", {}) }), jsxs("div", { className: "footer", children: [jsx("p", { children: this.props.description }), jsx("slot", { name: "footer" }), typeof parsedCompact === 'boolean' ? (parsedCompact ? buttonCompact : button) : [buttonCompact, button]] })] })] }), this.props.children] }));
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs
CHANGED
|
@@ -6,7 +6,6 @@ import { minifyCss } from '../../minifyCss.mjs';
|
|
|
6
6
|
import { getCanvasCss as getComponentCss$14 } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
7
7
|
import { PButton } from '../components/button.wrapper.mjs';
|
|
8
8
|
import { PCrest } from '../components/crest.wrapper.mjs';
|
|
9
|
-
import { PFlyout } from '../components/flyout.wrapper.mjs';
|
|
10
9
|
import { PWordmark } from '../components/wordmark.wrapper.mjs';
|
|
11
10
|
|
|
12
11
|
/**
|
|
@@ -24,28 +23,18 @@ import { PWordmark } from '../components/wordmark.wrapper.mjs';
|
|
|
24
23
|
*/
|
|
25
24
|
class DSRCanvas extends Component {
|
|
26
25
|
host;
|
|
27
|
-
isMediaQueryS = false;
|
|
28
|
-
isMediaQueryM = false;
|
|
29
26
|
hasTitle;
|
|
30
27
|
hasSidebarEnd;
|
|
31
|
-
hasSidebarEndHeader;
|
|
32
28
|
hasFooter;
|
|
33
29
|
hasBackground;
|
|
34
|
-
// TODO: Produces bug when using text-field-wrapper which looses focus
|
|
35
|
-
// private sidebarStart: any;
|
|
36
|
-
// private sidebarEnd: any;
|
|
37
|
-
// private root: any;
|
|
38
|
-
// private header: any;
|
|
39
|
-
//
|
|
40
30
|
render() {
|
|
41
31
|
const { namedSlotChildren} = splitChildren(this.props.children);
|
|
42
32
|
const hasTitle = namedSlotChildren.filter(({ props: { slot } }) => slot === 'title').length > 0;
|
|
43
33
|
const hasSidebarEnd = namedSlotChildren.filter(({ props: { slot } }) => slot === 'sidebar-end').length > 0;
|
|
44
|
-
const hasSidebarEndHeader = namedSlotChildren.filter(({ props: { slot } }) => slot === 'sidebar-end-header').length > 0;
|
|
45
34
|
const hasFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'footer').length > 0;
|
|
46
35
|
const hasBackground = namedSlotChildren.filter(({ props: { slot } }) => slot === 'background').length > 0;
|
|
47
|
-
const style = minifyCss(getComponentCss$14(this.props.sidebarStartOpen, this.props.sidebarEndOpen));
|
|
48
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(
|
|
36
|
+
const style = minifyCss(getComponentCss$14(this.props.sidebarStartOpen, this.props.sidebarEndOpen, this.props.background));
|
|
37
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsxs("header", { className: "header", tabIndex: -1, children: [jsxs("div", { className: "blur", children: [jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {})] }), jsxs("div", { className: "header__area header__area--start", children: [!this.props.sidebarStartOpen && (jsxs(PButton, { icon: "sidebar", variant: "secondary", compact: true, "hide-label": "true", aria: { 'aria-expanded': this.props.sidebarStartOpen }, children: [this.props.sidebarStartOpen ? 'Close' : 'Open', " navigation sidebar"] })), jsx("slot", { name: "header-start" })] }), jsx(PCrest, { className: "header__crest" }), jsx(PWordmark, { className: "header__wordmark", size: "inherit" }), jsx("div", { className: "header__area header__area--end", children: jsx("slot", { name: "header-end" }) })] }), jsxs("aside", { className: "sidebar sidebar--start", inert: !this.props.sidebarStartOpen, "aria-label": `Navigation sidebar ${this.props.sidebarStartOpen ? 'open' : 'closed'}`, tabIndex: -1, children: [jsxs("div", { className: "sidebar__header sidebar__header--start", children: [jsxs(PButton, { icon: "sidebar", variant: "secondary", compact: true, "hide-label": "true", aria: { 'aria-expanded': this.props.sidebarStartOpen }, children: [this.props.sidebarStartOpen ? 'Close' : 'Open', " navigation sidebar"] }), hasTitle && (jsx("h2", { children: jsx("slot", { name: "title" }) }))] }), jsx("slot", { name: "sidebar-start" })] }), jsx("main", { className: "main", children: jsx("slot", {}) }), hasSidebarEnd && (jsxs("aside", { className: "sidebar sidebar--end", inert: !this.props.sidebarEndOpen, "aria-label": `Settings sidebar ${this.props.sidebarEndOpen ? 'open' : 'closed'}`, tabIndex: -1, children: [jsxs("div", { className: "sidebar__header sidebar__header--end", children: [jsx("slot", { name: "sidebar-end-header" }), jsxs(PButton, { icon: "close", variant: "secondary", compact: true, "hide-label": "true", aria: { 'aria-expanded': this.props.sidebarEndOpen }, children: [this.props.sidebarEndOpen ? 'Close' : 'Open', " settings sidebar"] })] }), jsx("slot", { name: "sidebar-end" })] })), hasFooter && (jsx("footer", { className: "footer", children: jsx("slot", { name: "footer" }) })), hasBackground && jsx("slot", { name: "background" })] })] }), this.props.children] }));
|
|
49
38
|
}
|
|
50
39
|
}
|
|
51
40
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs
CHANGED
|
@@ -11,8 +11,9 @@ import { messageId, StateMessage } from './state-message.mjs';
|
|
|
11
11
|
import { PSpinner } from '../components/spinner.wrapper.mjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."
|
|
15
|
-
* @slot {"name": "
|
|
14
|
+
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
15
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
16
|
+
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
16
17
|
*/
|
|
17
18
|
class DSRCheckbox extends Component {
|
|
18
19
|
host;
|
|
@@ -22,6 +23,7 @@ class DSRCheckbox extends Component {
|
|
|
22
23
|
initialLoading = false;
|
|
23
24
|
defaultChecked;
|
|
24
25
|
checkboxInputElement;
|
|
26
|
+
externalLabel = null;
|
|
25
27
|
formResetCallback() {
|
|
26
28
|
this.props.internals?.setFormValue(this.props.defaultChecked ? this.props.value : undefined);
|
|
27
29
|
}
|
|
@@ -34,7 +36,7 @@ class DSRCheckbox extends Component {
|
|
|
34
36
|
const { namedSlotChildren} = splitChildren(this.props.children);
|
|
35
37
|
const id = 'x';
|
|
36
38
|
const style = minifyCss(getComponentCss$12(this.props.hideLabel, this.props.state, this.props.disabled, this.props.loading, this.props.compact));
|
|
37
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [
|
|
39
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsxs("div", { className: "wrapper", children: [jsxs("div", { className: "input-wrapper", children: [jsx("input", { type: "checkbox", id: id, "aria-describedby": `${descriptionId} ${messageId}`, "aria-invalid": this.props.state === 'error' ? 'true' : null, "aria-disabled": this.props.loading || this.props.disabled ? 'true' : null, checked: this.props.checked, form: this.props.form, value: this.props.value, name: this.props.name, onBlur: this.props.onBlur, required: this.props.required, disabled: this.props.disabled }), this.props.loading && jsx(PSpinner, { className: "spinner", size: "inherit", "aria-hidden": "true" })] }), jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, htmlFor: id, label: this.props.label, isLoading: this.props.loading, isDisabled: this.props.disabled, isRequired: this.props.required })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-date.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
13
14
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
15
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
15
16
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-email.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
12
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
12
13
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
14
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
15
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-month.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
13
14
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
15
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
15
16
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
12
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
12
13
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
14
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
15
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
|
@@ -9,6 +9,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
12
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
12
13
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
14
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
15
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-search.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
13
14
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
15
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
15
16
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. icon)."}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-tel.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
12
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
12
13
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
14
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
15
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-text.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
10
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
10
11
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
11
12
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
12
13
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-time.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
13
14
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
15
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
15
16
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-url.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
12
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
12
13
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
14
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
15
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-week.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { InputBase } from './input-base.mjs';
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
13
14
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
15
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
15
16
|
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/label.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.mjs';
|
|
2
3
|
import { labelId, descriptionId } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
3
4
|
import { Required } from './required.mjs';
|
|
4
5
|
|
|
5
|
-
const Label = ({ hasLabel, hasDescription,
|
|
6
|
+
const Label = ({ hasLabel, hasDescription, children,
|
|
6
7
|
// host,
|
|
7
8
|
label, tag, description, htmlFor, isRequired, isLoading, isDisabled, stopClickPropagation, }) => {
|
|
9
|
+
splitChildren(children);
|
|
8
10
|
const TagType = tag || 'label';
|
|
9
|
-
return (jsxs(Fragment, { children: [hasLabel && (jsx(TagType, { className: "label", id: labelId, "aria-disabled": isLoading || isDisabled ? 'true' : null, htmlFor: htmlFor, children: jsxs(Fragment, { children: [label || jsx("slot", { name: "label" }), isRequired /* && !isParentFieldsetRequired(host) */ && jsx(Required, {})] }) })), hasDescription && (jsx("span", { className: "label", id: descriptionId, "aria-disabled": isLoading || isDisabled ? 'true' : null, children: description || jsx("slot", { name: "description" }) }))] }));
|
|
11
|
+
return (jsxs(Fragment, { children: [hasLabel && (jsxs("div", { className: "label-wrapper", children: [jsx(TagType, { className: "label", id: labelId, "aria-disabled": isLoading || isDisabled ? 'true' : null, htmlFor: htmlFor, children: jsxs(Fragment, { children: [label || jsx("slot", { name: "label" }), isRequired /* && !isParentFieldsetRequired(host) */ && jsx(Required, {})] }) }), jsx("slot", { name: "label-after" })] })), hasDescription && (jsx("span", { className: "label", id: descriptionId, "aria-disabled": isLoading || isDisabled ? 'true' : null, children: description || jsx("slot", { name: "description" }) }))] }));
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
export { Label };
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.mjs
CHANGED
|
@@ -5,7 +5,6 @@ import { splitChildren } from '../../splitChildren.mjs';
|
|
|
5
5
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
6
6
|
import { getLinkTileCss as getComponentCss$E } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
7
7
|
import { PLink } from '../components/link.wrapper.mjs';
|
|
8
|
-
import { PLinkPure } from '../components/link-pure.wrapper.mjs';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @slot {"name": "header", "description": "Renders a header section above the content area." }
|
|
@@ -17,6 +16,8 @@ class DSRLinkTile extends Component {
|
|
|
17
16
|
hasFooterSlot = false;
|
|
18
17
|
render() {
|
|
19
18
|
splitChildren(this.props.children);
|
|
19
|
+
// TODO: BreakpointCustomizable breaks stencils boolean conversion from string to boolean
|
|
20
|
+
const parsedCompact = this.props.compact === 'true' ? true : this.props.compact === 'false' ? false : this.props.compact;
|
|
20
21
|
const linkProps = {
|
|
21
22
|
variant: 'secondary',
|
|
22
23
|
aria: this.props.aria,
|
|
@@ -28,9 +29,9 @@ class DSRLinkTile extends Component {
|
|
|
28
29
|
rel: this.props.rel,
|
|
29
30
|
};
|
|
30
31
|
const link = (createElement(PLink, { ...sharedLinkProps, ...linkProps, key: "link-or-button", className: "link-or-button" }, this.props.label));
|
|
31
|
-
const
|
|
32
|
-
const style = minifyCss(getComponentCss$E(this.props.aspectRatio, this.props.size, this.props.weight, this.props.align,
|
|
33
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx("a", { ...sharedLinkProps, tabIndex: -1, "aria-hidden": "true" }), jsx("slot", { name: "header" }), jsx("div", { className: "media", children: jsx("slot", {}) }), jsxs("div", { className: "footer", children: [jsx("p", { children: this.props.description }), jsx("slot", { name: "footer" }), typeof
|
|
32
|
+
const linkCompact = (createElement(PLink, { ...sharedLinkProps, ...linkProps, hideLabel: true, icon: "arrow-right", key: "link-or-button-pure", compact: true, className: "link-or-button-pure" }, this.props.label));
|
|
33
|
+
const style = minifyCss(getComponentCss$E(this.props.aspectRatio, this.props.size, this.props.weight, this.props.align, parsedCompact, this.props.gradient, this.props.hasFooterSlot));
|
|
34
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx("a", { ...sharedLinkProps, tabIndex: -1, "aria-hidden": "true" }), jsx("slot", { name: "header" }), jsx("div", { className: "media", children: jsx("slot", {}) }), jsxs("div", { className: "footer", children: [jsx("p", { children: this.props.description }), jsx("slot", { name: "footer" }), typeof parsedCompact === 'boolean' ? (parsedCompact ? linkCompact : link) : [linkCompact, link]] })] })] }), this.props.children] }));
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import { NoResultsOption } from './no-results-option.mjs';
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed." }
|
|
17
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
17
18
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed." }
|
|
18
19
|
* @slot {"name": "selected", "description": "Use this slot to provide custom markup for the selected options display in the button area." }
|
|
19
20
|
* @slot {"name": "", "description": "Default slot for the p-multi-select-option tags." }
|
|
@@ -21,7 +22,7 @@ import { NoResultsOption } from './no-results-option.mjs';
|
|
|
21
22
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed." }
|
|
22
23
|
* @slot {"name": "filter", "description": "Optional slot for providing a custom `p-input-search` input. When used, the default filter input is replaced and the built-in filter logic is disabled, giving full control over filtering behavior." }
|
|
23
24
|
*
|
|
24
|
-
* @controlled { "props": ["value"], "event": "
|
|
25
|
+
* @controlled { "props": ["value"], "event": "change", "isInternallyMutated": true }
|
|
25
26
|
*/
|
|
26
27
|
class DSRMultiSelect extends Component {
|
|
27
28
|
host;
|
|
@@ -69,7 +70,7 @@ class DSRMultiSelect extends Component {
|
|
|
69
70
|
const selectMessageId = (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) ? messageId : undefined;
|
|
70
71
|
const ariaDescribedBy = [descriptionId, selectMessageId].filter(Boolean).join(' ');
|
|
71
72
|
const style = minifyCss(getComponentCss$y(this.props.isOpen, this.props.disabled, this.props.hideLabel, this.props.state, this.props.compact));
|
|
72
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: buttonId, isRequired: this.props.required, isDisabled: this.props.disabled }), jsxs("button", { "aria-invalid": this.props.state === 'error' ? 'true' : null, type: "button", role: "combobox", id: buttonId, ...getComboboxAriaAttributes(this.props.isOpen, this.props.required, labelId, ariaDescribedBy, popoverId), disabled: this.props.disabled, onBlur: this.props.onComboBlur, children: [hasCustomSelectedSlot ? (jsx("slot", { name: "selected" })) : (jsx("span", { children: this.selectedOptions.map((option) => option.textContent).join(', ') })), this.props.value.length > 0 && (jsx(PButtonPure, { type: "button", className: "button", icon: "close", hideLabel: true, disabled: this.props.disabled, children: "Reset selection" })), jsx(PIcon, { className: "icon", name: "arrow-head-down", color: "primary", "aria-hidden": "true" })] }), jsxs("div", { id: popoverId, popover: "manual", tabIndex: -1, onBlur: (e) => e.stopPropagation(), role: "dialog", "aria-label": this.props.label, "aria-hidden": this.props.isOpen ? null : 'true', children: [hasCustomFilterSlot ? (jsx("slot", { name: "filter" })) : (jsx(PInputSearch, { className: "filter", name: "filter", label: "Filter options", hideLabel: true, autoComplete: "off", clear: true, indicator: true, compact: true, onBlur: (e) => e.stopPropagation() })), jsxs("div", { className: "options", role: "listbox", "aria-label": this.props.label, "aria-multiselectable": "true", onPointerMove: this.props.onPointerMove, children: [!this.props.hasFilterResults && jsx(NoResultsOption, {}), jsx("slot", { name: "options-status" }), jsx("slot", {})] })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null })] })] }), this.props.children] }));
|
|
73
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: buttonId, isRequired: this.props.required, isDisabled: this.props.disabled }), jsxs("button", { "aria-invalid": this.props.state === 'error' ? 'true' : null, type: "button", role: "combobox", id: buttonId, ...getComboboxAriaAttributes(this.props.isOpen, this.props.required, labelId, ariaDescribedBy, popoverId), disabled: this.props.disabled, onBlur: this.props.onComboBlur, children: [hasCustomSelectedSlot ? (jsx("slot", { name: "selected" })) : (jsx("span", { children: this.selectedOptions.map((option) => (option.textContent ?? '').toString().trim()).join(', ') })), this.props.value.length > 0 && (jsx(PButtonPure, { type: "button", className: "button", icon: "close", hideLabel: true, disabled: this.props.disabled, children: "Reset selection" })), jsx(PIcon, { className: "icon", name: "arrow-head-down", color: "primary", "aria-hidden": "true" })] }), jsxs("div", { id: popoverId, popover: "manual", tabIndex: -1, onBlur: (e) => e.stopPropagation(), role: "dialog", "aria-label": this.props.label, "aria-hidden": this.props.isOpen ? null : 'true', children: [hasCustomFilterSlot ? (jsx("slot", { name: "filter" })) : (jsx(PInputSearch, { className: "filter", name: "filter", label: "Filter options", hideLabel: true, autoComplete: "off", clear: true, indicator: true, compact: true, onBlur: (e) => e.stopPropagation() })), jsxs("div", { className: "options", role: "listbox", "aria-label": this.props.label, "aria-multiselectable": "true", onPointerMove: this.props.onPointerMove, children: [!this.props.hasFilterResults && jsx(NoResultsOption, {}), jsx("slot", { name: "options-status" }), jsx("slot", {})] })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null })] })] }), this.props.children] }));
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs
CHANGED
|
@@ -4,18 +4,19 @@ import '../../provider.mjs';
|
|
|
4
4
|
import { splitChildren } from '../../splitChildren.mjs';
|
|
5
5
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
6
6
|
import { getPinCodeCss as getComponentCss$w } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
7
|
-
import { labelId, descriptionId, isCurrentInput } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
8
|
-
import { LoadingMessage } from './loading-message.mjs';
|
|
7
|
+
import { labelId, descriptionId, getFieldsetAriaAttributes, isCurrentInput } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
8
|
+
import { loadingId, LoadingMessage } from './loading-message.mjs';
|
|
9
9
|
import { Label } from './label.mjs';
|
|
10
10
|
import { messageId, StateMessage } from './state-message.mjs';
|
|
11
11
|
import { PSpinner } from '../components/spinner.wrapper.mjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed." }
|
|
15
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)."}
|
|
15
16
|
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed." }
|
|
16
17
|
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed." }
|
|
17
18
|
*
|
|
18
|
-
* @controlled { "props": ["value"], "event": "
|
|
19
|
+
* @controlled { "props": ["value"], "event": "change", "isInternallyMutated": true }
|
|
19
20
|
*/
|
|
20
21
|
class DSRPinCode extends Component {
|
|
21
22
|
host;
|
|
@@ -39,7 +40,7 @@ class DSRPinCode extends Component {
|
|
|
39
40
|
this.inputElements = [];
|
|
40
41
|
const currentInputId = 'current-input';
|
|
41
42
|
const style = minifyCss(getComponentCss$w(this.props.hideLabel, this.props.state, this.props.disabled, this.props.loading, this.props.length, this.props.compact));
|
|
42
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("
|
|
43
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("fieldset", { className: "root", disabled: this.props.disabled, ...getFieldsetAriaAttributes(this.props.required, this.props.state === 'error'), "aria-describedby": this.props.loading ? loadingId : `${descriptionId} ${messageId}`, "aria-labelledby": labelId, children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: currentInputId, isRequired: this.props.required, isLoading: this.props.loading, isDisabled: this.props.disabled }), jsxs("div", { className: "wrapper", children: [Array.from(new Array(this.props.length), (_, index) => (jsx("input", { name: this.props.name, form: this.props.form, ...(isCurrentInput(index, this.props.value, this.props.length) && { id: currentInputId }), type: this.props.type === 'number' ? 'text' : this.props.type, "aria-label": `${index + 1}-${this.props.length}`, "aria-describedby": `${labelId} ${descriptionId} ${messageId}`, "aria-invalid": this.props.state === 'error' ? 'true' : null, "aria-disabled": this.props.loading ? 'true' : null, autoComplete: "one-time-code", pattern: "\\d*", inputMode: "numeric" // get numeric keyboard on mobile
|
|
43
44
|
, defaultValue: this.props.value[index] === ' ' ? null : this.props.value[index], disabled: this.props.disabled, required: this.props.required, onBlur: this.props.onInputBlur }, index))), this.props.loading && jsx(PSpinner, { className: "spinner", size: "inherit", "aria-hidden": "true" })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.mjs';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.mjs';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
5
6
|
import { getRadioGroupOptionCss as getComponentCss$u } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
6
7
|
import { loadingId, LoadingMessage } from './loading-message.mjs';
|
|
@@ -8,20 +9,27 @@ import { Label } from './label.mjs';
|
|
|
8
9
|
import { messageId } from './state-message.mjs';
|
|
9
10
|
import { PSpinner } from '../components/spinner.wrapper.mjs';
|
|
10
11
|
|
|
12
|
+
// Though "description" and "message" slots are technically available (provided by the "label" component),
|
|
13
|
+
// they are not documented here to avoid confusion since they are not intended for use within radio group options.
|
|
14
|
+
/**
|
|
15
|
+
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
16
|
+
* @slot {"name": "label-after", "description": "Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`)." }
|
|
17
|
+
*/
|
|
11
18
|
class DSRRadioGroupOption extends Component {
|
|
12
19
|
host;
|
|
13
20
|
initialLoading = false;
|
|
14
21
|
inputElement;
|
|
15
22
|
render() {
|
|
23
|
+
splitChildren(this.props.children);
|
|
16
24
|
const { selected: isSelected, name, state } = this.props;
|
|
17
25
|
const isDisabled = this.props.disabled || this.props.disabledParent;
|
|
18
26
|
const isOptionLoading = this.props.loading && !isSelected;
|
|
19
27
|
const isLoading = isOptionLoading || this.props.loadingParent;
|
|
20
28
|
const id = 'radio-group-option';
|
|
21
29
|
const style = minifyCss(getComponentCss$u(isDisabled, isLoading, state));
|
|
22
|
-
return (
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsxs("div", { className: "root", children: [jsxs("div", { className: "wrapper", children: [jsx("input", { id: id, type: "radio", name: name, checked: isSelected, disabled: isDisabled || isLoading, value: this.props.value, onClick: (e) => {
|
|
31
|
+
e.stopPropagation();
|
|
32
|
+
}, onBlur: this.props.onBlur, "aria-describedby": isLoading ? loadingId : `${messageId}`, "aria-invalid": state === 'error' ? 'true' : null, "aria-disabled": isDisabled || isLoading ? 'true' : null }), isOptionLoading && !this.props.loadingParent && (jsx(PSpinner, { className: "spinner", size: "inherit", "aria-hidden": "true" }))] }), jsx(Label, { hasLabel: this.props.label, hasDescription: false, host: null, label: this.props.label, htmlFor: id, isDisabled: isDisabled, isLoading: isLoading, stopClickPropagation: true }), !this.props.loadingParent && (jsx(LoadingMessage, { loading: isOptionLoading, initialLoading: this.props.initialLoading }))] }) })] }), this.props.children] }));
|
|
25
33
|
}
|
|
26
34
|
}
|
|
27
35
|
|