@porsche-design-system/components-react 3.28.0-rc.3 → 3.28.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/cjs/lib/components/input-number.wrapper.cjs +29 -0
  3. package/cjs/public-api.cjs +2 -0
  4. package/esm/lib/components/index.d.ts +1 -0
  5. package/esm/lib/components/input-number.wrapper.d.ts +184 -0
  6. package/esm/lib/components/input-number.wrapper.mjs +27 -0
  7. package/esm/lib/types.d.ts +12 -2
  8. package/esm/public-api.mjs +1 -0
  9. package/package.json +3 -3
  10. package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +324 -268
  11. package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +0 -9
  12. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.cjs +40 -0
  13. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.cjs +1 -1
  14. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs +22 -0
  15. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.cjs +42 -0
  16. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.cjs +8 -9
  17. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.cjs +10 -3
  18. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +1 -3
  19. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.cjs +6 -5
  20. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +2 -4
  21. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/public-api.cjs +2 -0
  22. package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +291 -241
  23. package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +1 -8
  24. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.mjs +38 -0
  25. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.mjs +1 -1
  26. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs +2 -2
  27. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +2 -2
  28. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.mjs +2 -2
  29. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs +2 -2
  30. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.mjs +2 -2
  31. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +2 -2
  32. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs +2 -2
  33. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.mjs +2 -2
  34. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.mjs +2 -2
  35. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +2 -2
  36. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.mjs +2 -2
  37. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/crest.mjs +2 -2
  38. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/display.mjs +2 -2
  39. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/divider.mjs +2 -2
  40. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-item.mjs +2 -2
  41. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-link.mjs +2 -2
  42. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown.mjs +2 -2
  43. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.mjs +2 -2
  44. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset.mjs +2 -2
  45. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.mjs +2 -2
  46. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.mjs +2 -2
  47. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs +2 -2
  48. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.mjs +2 -2
  49. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.mjs +2 -2
  50. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/heading.mjs +2 -2
  51. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.mjs +2 -2
  52. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/icon.mjs +2 -2
  53. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.mjs +2 -2
  54. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.mjs +20 -0
  55. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.mjs +40 -0
  56. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.mjs +8 -9
  57. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.mjs +11 -4
  58. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +2 -4
  59. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.mjs +6 -5
  60. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +2 -4
  61. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/public-api.mjs +1 -0
  62. package/ssr/esm/lib/components/index.d.ts +1 -0
  63. package/ssr/esm/lib/components/input-number.wrapper.d.ts +184 -0
  64. package/ssr/esm/lib/dsr-components/input-base.d.ts +31 -0
  65. package/ssr/esm/lib/dsr-components/input-number.d.ts +18 -0
  66. package/ssr/esm/lib/dsr-components/input-password.d.ts +5 -3
  67. package/ssr/esm/lib/dsr-components/multi-select.d.ts +0 -1
  68. package/ssr/esm/lib/dsr-components/select.d.ts +0 -1
  69. package/ssr/esm/lib/types.d.ts +12 -2
  70. package/{tailwind → tailwindcss}/index.css +194 -133
@@ -3290,12 +3290,6 @@ const getListAriaAttributes = (label, isRequired, hasFilter, isOpen, multiple =
3290
3290
  }),
3291
3291
  };
3292
3292
  };
3293
- const getOptionAriaAttributes = (isSelected, isDisabled, isHidden, hasValue) => ({
3294
- ...(!isHidden && { 'aria-selected': isSelected ? 'true' : 'false' }),
3295
- 'aria-disabled': isDisabled ? 'true' : null,
3296
- 'aria-hidden': isHidden ? 'true' : null,
3297
- 'aria-label': hasValue ? null : 'Empty value',
3298
- });
3299
3293
 
3300
3294
  const borderWidthBase = '2px';
3301
3295
 
@@ -3716,7 +3710,6 @@ const buildImgSrc = (innerManifest) => `${getCDNBaseURL()}/marque/${innerManifes
3716
3710
  const getSvgUrl = (model) => {
3717
3711
  return `${getCDNBaseURL()}/model-signatures/${MODEL_SIGNATURES_MANIFEST[model].src}`;
3718
3712
  };
3719
- const getSelectedOptions = (options) => options.filter((option) => option.selected);
3720
3713
  const getSelectedOptionValues = (options) => options.filter((option) => option.selected).map((option) => option.value);
3721
3714
  exports.ItemType = void 0;
3722
3715
  (function (ItemType) {
@@ -3950,12 +3943,10 @@ exports.getIconColor = getIconColor;
3950
3943
  exports.getInlineNotificationIconName = getInlineNotificationIconName;
3951
3944
  exports.getInnerManifest = getInnerManifest;
3952
3945
  exports.getListAriaAttributes = getListAriaAttributes;
3953
- exports.getOptionAriaAttributes = getOptionAriaAttributes;
3954
3946
  exports.getSegmentedControlItemAriaAttributes = getSegmentedControlItemAriaAttributes;
3955
3947
  exports.getSelectedOptionMap = getSelectedOptionMap;
3956
3948
  exports.getSelectedOptionString = getSelectedOptionString;
3957
3949
  exports.getSelectedOptionValues = getSelectedOptionValues;
3958
- exports.getSelectedOptions = getSelectedOptions;
3959
3950
  exports.getStepperHorizontalIconName = getStepperHorizontalIconName;
3960
3951
  exports.getSvgUrl = getSvgUrl;
3961
3952
  exports.getSwitchButtonAriaAttributes = getSwitchButtonAriaAttributes;
@@ -0,0 +1,40 @@
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 inputNumber = require('../dsr-components/input-number.cjs');
9
+
10
+ const PInputNumber = /*#__PURE__*/ react.forwardRef(({ autoComplete = '', compact = false, controls = false, description = '', disabled = false, form, hideLabel = false, label = '', max, message = '', min, name, onBlur, onChange, onInput, placeholder = '', readOnly = false, required = false, state = 'none', step = 1, theme, value = '', className, children, ...rest }, ref) => {
11
+ const elementRef = react.useRef(undefined);
12
+ hooks.useEventCallback(elementRef, 'blur', onBlur);
13
+ hooks.useEventCallback(elementRef, 'change', onChange);
14
+ hooks.useEventCallback(elementRef, 'input', onInput);
15
+ const WebComponentTag = hooks.usePrefix('p-input-number');
16
+ const propsToSync = [autoComplete, compact, controls, description, disabled, form, hideLabel, label, max, message, min, name, placeholder, readOnly, required, state, step, theme || hooks.useTheme(), value];
17
+ hooks.useBrowserLayoutEffect(() => {
18
+ const { current } = elementRef;
19
+ ['autoComplete', 'compact', 'controls', 'description', 'disabled', 'form', 'hideLabel', 'label', 'max', 'message', 'min', 'name', 'placeholder', 'readOnly', 'required', 'state', 'step', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
20
+ }, propsToSync);
21
+ const props = {
22
+ ...rest,
23
+ // @ts-ignore
24
+ ...(!process.browser
25
+ ? {
26
+ children: (jsxRuntime.jsx(inputNumber.DSRInputNumber, { autoComplete, compact, controls, description, disabled, form, hideLabel, label, max, message, min, name, placeholder, readOnly, required, state, step, theme: theme || hooks.useTheme(), value, children })),
27
+ }
28
+ : {
29
+ children,
30
+ suppressHydrationWarning: true,
31
+ }),
32
+ 'data-ssr': '',
33
+ class: hooks.useMergedClass(elementRef, className),
34
+ ref: utils.syncRef(elementRef, ref)
35
+ };
36
+ // @ts-ignore
37
+ return jsxRuntime.jsx(WebComponentTag, { ...props });
38
+ });
39
+
40
+ exports.PInputNumber = PInputNumber;
@@ -19,7 +19,7 @@ const PToast = /*#__PURE__*/ react.forwardRef(({ theme, className, ...rest }, re
19
19
  // @ts-ignore
20
20
  ...(!process.browser
21
21
  ? {
22
- ...{ "role": "status", "aria-live": "polite" },
22
+ ...{ "role": "status" },
23
23
  children: (jsxRuntime.jsx(toast.DSRToast, { theme: theme || hooks.useTheme() })),
24
24
  }
25
25
  : {
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.cjs');
5
+ var label = require('./label.cjs');
6
+ var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
7
+ var stateMessage = require('./state-message.cjs');
8
+
9
+ const InputBase = ({ children,
10
+ // host,
11
+ id, label: label$1, description, required, disabled, state, message, theme, readOnly, type, form, placeholder, maxLength, minLength, max, min, value, step, autoComplete, name,
12
+ // onInput,
13
+ onWheel,
14
+ // onChange,
15
+ // onBlur,
16
+ // refElement,
17
+ start, end, }) => {
18
+ const { namedSlotChildren } = splitChildren.splitChildren(children);
19
+ return (jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.Label, { hasLabel: !!label$1 || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: !!description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: label$1, description: description, htmlFor: id, isRequired: required, isDisabled: disabled }), jsxRuntime.jsxs("div", { className: "wrapper", children: [jsxRuntime.jsx("slot", { name: "start" }), start, jsxRuntime.jsx("input", { "aria-describedby": `${utilsEntry.descriptionId} ${stateMessage.messageId}`, "aria-invalid": state === 'error' ? 'true' : null, id: id, onWheel: onWheel, name: name, form: form, type: type, required: required, placeholder: placeholder, maxLength: maxLength, minLength: minLength, max: max, min: min, step: step, value: value, readOnly: readOnly, autoComplete: autoComplete, disabled: disabled }), end, jsxRuntime.jsx("slot", { name: "end" })] }), jsxRuntime.jsx(stateMessage.StateMessage, { hasMessage: (message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(state), state: state, message: message, theme: theme, host: null })] }));
20
+ };
21
+
22
+ exports.InputBase = InputBase;
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ require('../../provider.cjs');
6
+ var splitChildren = require('../../splitChildren.cjs');
7
+ var minifyCss = require('../../minifyCss.cjs');
8
+ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
9
+ var buttonPure_wrapper = require('../components/button-pure.wrapper.cjs');
10
+ var inputBase = require('./input-base.cjs');
11
+
12
+ /**
13
+ * @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."}
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."}
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."}
16
+ * @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
17
+ * @slot {"name": "end", "description": "Shows content at the end of the input (e.g. toggle button, unit suffix)."}
18
+ */
19
+ class DSRInputNumber extends react.Component {
20
+ host;
21
+ // The "name" property is reflected as an attribute to ensure compatibility with native form submission.
22
+ // In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
23
+ internals;
24
+ inputElement;
25
+ defaultValue;
26
+ formResetCallback() {
27
+ this.props.internals?.setFormValue(this.props.defaultValue);
28
+ }
29
+ formDisabledCallback() {
30
+ }
31
+ formStateRestoreCallback() {
32
+ }
33
+ render() {
34
+ splitChildren.splitChildren(this.props.children);
35
+ const style = minifyCss.minifyCss(stylesEntry.getInputNumberCss(this.props.disabled, this.props.hideLabel, this.props.state, this.props.compact, this.props.readOnly, this.props.theme, this.props.controls));
36
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(inputBase.InputBase, { children: this.props.children, host: null, label: this.props.label, description: this.props.description, id: "input-number", onWheel: (e) => (e.target).blur(), name: this.props.name, form: this.props.form, type: "number", required: this.props.required, placeholder: this.props.placeholder, max: this.props.max, min: this.props.min, value: this.props.value, readOnly: this.props.readOnly, autoComplete: this.props.autoComplete, disabled: this.props.disabled, state: this.props.state, message: this.props.message, theme: this.props.theme, step: this.props.step, ...(this.props.controls && {
37
+ end: (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(buttonPure_wrapper.PButtonPure, { tabIndex: -1, hideLabel: true, theme: this.props.theme, className: "button", type: "button", icon: "minus", disabled: this.props.disabled || this.props.readOnly, children: ["Decrement value by ", this.props.step] }), jsxRuntime.jsxs(buttonPure_wrapper.PButtonPure, { tabIndex: -1, hideLabel: true, theme: this.props.theme, className: "button", type: "button", icon: "plus", disabled: this.props.disabled || this.props.readOnly, children: ["Increment value by ", this.props.step] })] })),
38
+ }) })] }), this.props.children] }));
39
+ }
40
+ }
41
+
42
+ exports.DSRInputNumber = DSRInputNumber;
@@ -6,15 +6,15 @@ require('../../provider.cjs');
6
6
  var splitChildren = require('../../splitChildren.cjs');
7
7
  var minifyCss = require('../../minifyCss.cjs');
8
8
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
9
- var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
10
9
  var buttonPure_wrapper = require('../components/button-pure.wrapper.cjs');
11
- var label = require('./label.cjs');
12
- var stateMessage = require('./state-message.cjs');
10
+ var inputBase = require('./input-base.cjs');
13
11
 
14
12
  /**
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": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed." }
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." }
13
+ * @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."}
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."}
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."}
16
+ * @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
17
+ * @slot {"name": "end", "description": "Shows content at the end of the input (e.g. toggle button, unit suffix)."}
18
18
  */
19
19
  class DSRInputPassword extends react.Component {
20
20
  host;
@@ -32,10 +32,9 @@ class DSRInputPassword extends react.Component {
32
32
  formStateRestoreCallback() {
33
33
  }
34
34
  render() {
35
- const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
36
- const id = 'input-password';
35
+ splitChildren.splitChildren(this.props.children);
37
36
  const style = minifyCss.minifyCss(stylesEntry.getInputPasswordCss(this.props.disabled, this.props.hideLabel, this.props.state, this.props.toggle, this.props.compact, this.props.readOnly, this.props.theme));
38
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.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: id, isRequired: this.props.required, isDisabled: this.props.disabled }), jsxRuntime.jsxs("div", { className: "wrapper", children: [jsxRuntime.jsx("input", { "aria-describedby": `${utilsEntry.descriptionId} ${stateMessage.messageId}`, "aria-invalid": this.props.state === 'error' ? 'true' : null, id: id, onBlur: this.props.onBlur, name: this.props.name, form: this.props.form, type: this.props.showPassword ? 'text' : 'password', required: this.props.required, placeholder: this.props.placeholder, maxLength: this.props.maxLength, minLength: this.props.minLength, value: this.props.value, readOnly: this.props.readOnly, autoComplete: this.props.autoComplete, disabled: this.props.disabled }), this.props.toggle && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { hideLabel: true, theme: this.props.theme, className: "button", type: "button", icon: this.props.showPassword ? 'view-off' : 'view', disabled: this.props.disabled, aria: { 'aria-pressed': this.props.showPassword ? 'true' : 'false' }, children: "Toggle password visibility" }))] }), jsxRuntime.jsx(stateMessage.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, theme: this.props.theme, host: null })] })] }), this.props.children] }));
37
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(inputBase.InputBase, { children: this.props.children, host: null, label: this.props.label, description: this.props.description, id: "input-password", name: this.props.name, form: this.props.form, type: this.props.showPassword ? 'text' : 'password', required: this.props.required, placeholder: this.props.placeholder, maxLength: this.props.maxLength, minLength: this.props.minLength, value: this.props.value, readOnly: this.props.readOnly, autoComplete: this.props.autoComplete, disabled: this.props.disabled, state: this.props.state, message: this.props.message, theme: this.props.theme, end: this.props.toggle && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { hideLabel: true, theme: this.props.theme, className: "button", type: "button", icon: this.props.showPassword ? 'view-off' : 'view', disabled: this.props.disabled, aria: { 'aria-pressed': this.props.showPassword ? 'true' : 'false' }, children: "Toggle password visibility" })) })] }), this.props.children] }));
39
38
  }
40
39
  }
41
40
 
@@ -13,10 +13,17 @@ class DSRMultiSelectOption extends react.Component {
13
13
  host;
14
14
  render() {
15
15
  splitChildren.splitChildren(this.props.children);
16
- const { theme = 'light', selected: isSelected, highlighted } = this.props;
16
+ const { theme = 'light', selected: isSelected, highlighted, hidden } = this.props;
17
17
  const isDisabled = this.props.disabled || this.props.disabledParent;
18
- minifyCss.minifyCss(stylesEntry.getMultiSelectOptionCss(theme, isDisabled, isSelected));
19
- return (jsxRuntime.jsx(jsxRuntime.Fragment, {}));
18
+ const style = minifyCss.minifyCss(stylesEntry.getMultiSelectOptionCss(theme, isDisabled, isSelected));
19
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } })
20
+ // TODO: get rid of ARIA sprouting and use `elementInternals` API when AXE-CORE supports it: https://github.com/dequelabs/axe-core/issues/4259
21
+ , "// TODO: get rid of ARIA sprouting and use `elementInternals` API when AXE-CORE supports it: https://github.com/dequelabs/axe-core/issues/4259", jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: Object.entries({
22
+ option: true,
23
+ 'option--selected': isSelected,
24
+ 'option--highlighted': highlighted,
25
+ 'option--disabled': isDisabled,
26
+ }).map(([key, value]) => value && key).filter(Boolean).join(' '), children: [jsxRuntime.jsx("span", { className: "checkbox", "aria-hidden": "true" }), jsxRuntime.jsx("slot", { slot: "label" })] }) })] }), this.props.children] }));
20
27
  }
21
28
  }
22
29
 
@@ -25,7 +25,6 @@ class DSRMultiSelect extends react.Component {
25
25
  // The "name" property is reflected as an attribute to ensure compatibility with native form submission.
26
26
  // In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
27
27
  isOpen = false;
28
- srHighlightedOptionText = '';
29
28
  hasFilterResults = true;
30
29
  internals;
31
30
  defaultValue;
@@ -58,9 +57,8 @@ class DSRMultiSelect extends react.Component {
58
57
  const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
59
58
  const inputId = 'filter';
60
59
  const popoverId = 'list';
61
- const optionsSelectedId = 'options-selected';
62
60
  const style = minifyCss.minifyCss(stylesEntry.getMultiSelectCss(this.props.isOpen, this.props.disabled, this.props.hideLabel, this.props.state, this.props.theme));
63
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.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: inputId, isRequired: this.props.required, isDisabled: this.props.disabled }), this.props.currentValue && (jsxRuntime.jsxs("span", { id: optionsSelectedId, className: "sr-only", children: [utilsEntry.getSelectedOptions(this.props.multiSelectOptions).length, " options selected"] })), jsxRuntime.jsxs("div", { className: `wrapper${this.props.disabled ? ' disabled' : ''}`, children: [jsxRuntime.jsx("input", { id: inputId, role: "combobox", autoComplete: "off", disabled: this.props.disabled, required: this.props.required, "aria-invalid": this.props.state === 'error' ? 'true' : null }), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "arrow-head-down", theme: this.props.theme, "aria-hidden": "true" }), this.props.currentValue && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { type: "button", className: "button", icon: "close", hideLabel: true, theme: this.props.theme, disabled: this.props.disabled, children: "Reset selection" })), jsxRuntime.jsxs("div", { id: popoverId, popover: "manual", tabIndex: -1, children: [!this.props.hasFilterResults && (jsxRuntime.jsxs("div", { className: "no-results", role: "option", children: [jsxRuntime.jsx("span", { "aria-hidden": "true", children: "---" }), jsxRuntime.jsx("span", { className: "sr-only", children: "No results found" })] })), jsxRuntime.jsx("slot", {})] })] }), jsxRuntime.jsx(stateMessage.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, theme: this.props.theme, host: null }), jsxRuntime.jsx("span", { className: "sr-only", role: "status", "aria-live": "assertive", "aria-relevant": "additions text", children: this.props.hasFilterResults ? this.props.srHighlightedOptionText : 'No results found' })] })] }), this.props.children] }));
61
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.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: inputId, isRequired: this.props.required, isDisabled: this.props.disabled }), jsxRuntime.jsxs("div", { className: `wrapper${this.props.disabled ? ' disabled' : ''}`, children: [jsxRuntime.jsx("input", { id: inputId, role: "combobox", autoComplete: "off", disabled: this.props.disabled, required: this.props.required, "aria-invalid": this.props.state === 'error' ? 'true' : null }), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "arrow-head-down", theme: this.props.theme, "aria-hidden": "true" }), this.props.currentValue && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { type: "button", className: "button", icon: "close", hideLabel: true, theme: this.props.theme, disabled: this.props.disabled, children: "Reset selection" })), jsxRuntime.jsxs("div", { id: popoverId, popover: "manual", tabIndex: -1, children: [!this.props.hasFilterResults && (jsxRuntime.jsxs("div", { className: "no-results", role: "option", children: [jsxRuntime.jsx("span", { "aria-hidden": "true", children: "---" }), jsxRuntime.jsx("span", { className: "sr-only", children: "No results found" })] })), jsxRuntime.jsx("slot", {})] })] }), jsxRuntime.jsx(stateMessage.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, theme: this.props.theme, host: null })] })] }), this.props.children] }));
64
62
  }
65
63
  }
66
64
 
@@ -6,7 +6,6 @@ require('../../provider.cjs');
6
6
  var splitChildren = require('../../splitChildren.cjs');
7
7
  var minifyCss = require('../../minifyCss.cjs');
8
8
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
9
- var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
10
9
  var icon_wrapper = require('../components/icon.wrapper.cjs');
11
10
 
12
11
  /**
@@ -16,15 +15,17 @@ class DSRSelectOption extends react.Component {
16
15
  host;
17
16
  render() {
18
17
  splitChildren.splitChildren(this.props.children);
19
- const { theme = 'light', selected, highlighted, hidden } = this.props;
18
+ const { theme = 'light', selected: isSelected, highlighted, hidden } = this.props;
20
19
  const isDisabled = this.props.disabled || this.props.disabledParent;
21
20
  const style = minifyCss.minifyCss(stylesEntry.getSelectOptionCss(theme));
22
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { role: "option", className: {
21
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } })
22
+ // TODO: get rid of ARIA sprouting and use `elementInternals` API when AXE-CORE supports it: https://github.com/dequelabs/axe-core/issues/4259
23
+ , "// TODO: get rid of ARIA sprouting and use `elementInternals` API when AXE-CORE supports it: https://github.com/dequelabs/axe-core/issues/4259", jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: Object.entries({
23
24
  option: true,
24
- 'option--selected': selected,
25
+ 'option--selected': isSelected,
25
26
  'option--highlighted': highlighted,
26
27
  'option--disabled': isDisabled,
27
- }, ...utilsEntry.getOptionAriaAttributes(selected, isDisabled, hidden, !!this.props.value), children: [jsxRuntime.jsx("slot", {}), selected && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", "aria-hidden": "true", name: "check", color: isDisabled ? 'state-disabled' : 'primary', theme: theme }))] }) })] }), this.props.children] }));
28
+ }).map(([key, value]) => value && key).filter(Boolean).join(' '), children: [jsxRuntime.jsx("slot", {}), isSelected && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", "aria-hidden": "true", name: "check", color: isDisabled ? 'state-disabled' : 'primary', theme: theme }))] }) })] }), this.props.children] }));
28
29
  }
29
30
  }
30
31
 
@@ -24,7 +24,6 @@ class DSRSelect extends react.Component {
24
24
  // The "name" property is reflected as an attribute to ensure compatibility with native form submission.
25
25
  // In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
26
26
  isOpen = false;
27
- srHighlightedOptionText = '';
28
27
  internals;
29
28
  defaultValue;
30
29
  buttonElement;
@@ -50,11 +49,10 @@ class DSRSelect extends react.Component {
50
49
  const popoverId = 'list';
51
50
  const descriptionId = this.props.description ? 'description' : undefined;
52
51
  const selectMessageId = (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) ? stateMessage.messageId : undefined;
53
- const initialStatusId = 'initial-status';
54
- const ariaDescribedBy = [descriptionId, selectMessageId, initialStatusId].filter(Boolean).join(' ');
52
+ const ariaDescribedBy = [descriptionId, selectMessageId].filter(Boolean).join(' ');
55
53
  const selectedOption = utilsEntry.getSelectedOptionString(otherChildren);
56
54
  const style = minifyCss.minifyCss(stylesEntry.getSelectCss(this.props.isOpen, this.props.disabled, this.props.hideLabel, this.props.state, this.props.compact, this.props.theme, !!this.props.slottedImagePath));
57
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.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 }), jsxRuntime.jsxs("button", { "aria-invalid": this.props.state === 'error' ? 'true' : null, type: "button", role: "combobox", id: buttonId, ...utilsEntry.getComboboxAriaAttributes(this.props.isOpen, this.props.required, utilsEntry.labelId, ariaDescribedBy, popoverId), disabled: this.props.disabled, children: [this.props.slottedImagePath && jsxRuntime.jsx("img", { src: this.props.slottedImagePath, alt: "" }), jsxRuntime.jsx("span", { children: selectedOption }), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "arrow-head-down", theme: this.props.theme, color: this.props.disabled ? 'state-disabled' : 'primary', "aria-hidden": "true" })] }), jsxRuntime.jsx("div", { id: popoverId, popover: "manual", tabIndex: -1, ...utilsEntry.getListAriaAttributes(this.props.label, this.props.required, false, this.props.isOpen), children: jsxRuntime.jsx("slot", {}) }), jsxRuntime.jsx(stateMessage.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, theme: this.props.theme, host: null }), jsxRuntime.jsx("span", { className: "sr-only", role: "status", "aria-live": "assertive", "aria-relevant": "additions text", children: this.props.srHighlightedOptionText })] })] }), this.props.children] }));
55
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.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 }), jsxRuntime.jsxs("button", { "aria-invalid": this.props.state === 'error' ? 'true' : null, type: "button", role: "combobox", id: buttonId, ...utilsEntry.getComboboxAriaAttributes(this.props.isOpen, this.props.required, utilsEntry.labelId, ariaDescribedBy, popoverId), disabled: this.props.disabled, children: [this.props.slottedImagePath && jsxRuntime.jsx("img", { src: this.props.slottedImagePath, alt: "" }), jsxRuntime.jsx("span", { children: selectedOption }), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "arrow-head-down", theme: this.props.theme, color: this.props.disabled ? 'state-disabled' : 'primary', "aria-hidden": "true" })] }), jsxRuntime.jsx("div", { id: popoverId, popover: "manual", tabIndex: -1, ...utilsEntry.getListAriaAttributes(this.props.label, this.props.required, false, this.props.isOpen), children: jsxRuntime.jsx("slot", {}) }), jsxRuntime.jsx(stateMessage.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, theme: this.props.theme, host: null })] })] }), this.props.children] }));
58
56
  }
59
57
  getSelectedOptionImagePath = (options) => {
60
58
  return (options
@@ -29,6 +29,7 @@ var heading_wrapper = require('./lib/components/heading.wrapper.cjs');
29
29
  var headline_wrapper = require('./lib/components/headline.wrapper.cjs');
30
30
  var icon_wrapper = require('./lib/components/icon.wrapper.cjs');
31
31
  var inlineNotification_wrapper = require('./lib/components/inline-notification.wrapper.cjs');
32
+ var inputNumber_wrapper = require('./lib/components/input-number.wrapper.cjs');
32
33
  var inputPassword_wrapper = require('./lib/components/input-password.wrapper.cjs');
33
34
  var link_wrapper = require('./lib/components/link.wrapper.cjs');
34
35
  var linkPure_wrapper = require('./lib/components/link-pure.wrapper.cjs');
@@ -115,6 +116,7 @@ exports.PHeading = heading_wrapper.PHeading;
115
116
  exports.PHeadline = headline_wrapper.PHeadline;
116
117
  exports.PIcon = icon_wrapper.PIcon;
117
118
  exports.PInlineNotification = inlineNotification_wrapper.PInlineNotification;
119
+ exports.PInputNumber = inputNumber_wrapper.PInputNumber;
118
120
  exports.PInputPassword = inputPassword_wrapper.PInputPassword;
119
121
  exports.PLink = link_wrapper.PLink;
120
122
  exports.PLinkPure = linkPure_wrapper.PLinkPure;