@porsche-design-system/components-react 2.19.0 → 2.19.1-rc.1
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 +31 -3
- package/jsdom-polyfill/index.js +12 -1
- package/jsdom-polyfill.d.ts +1 -0
- package/lib/components/button-group.wrapper.d.ts +3 -3
- package/lib/components/button-pure.wrapper.d.ts +3 -3
- package/lib/components/divider.wrapper.d.ts +3 -3
- package/lib/components/flex-item.wrapper.d.ts +13 -13
- package/lib/components/flex.wrapper.d.ts +13 -13
- package/lib/components/grid-item.wrapper.d.ts +5 -5
- package/lib/components/grid.wrapper.d.ts +7 -7
- package/lib/components/icon.wrapper.d.ts +3 -3
- package/lib/components/link-pure.wrapper.d.ts +5 -5
- package/lib/components/link-tile.wrapper.d.ts +3 -3
- package/lib/components/link.wrapper.d.ts +3 -3
- package/lib/components/marque.wrapper.d.ts +3 -3
- package/lib/components/modal.wrapper.d.ts +3 -3
- package/lib/components/spinner.wrapper.d.ts +5 -5
- package/lib/components/switch.wrapper.d.ts +3 -3
- package/lib/types.d.ts +26 -47
- package/package.json +2 -2
- package/ssr/components/dist/styles/esm/styles-entry.js +46 -23
- package/ssr/components/dist/utils/esm/utils-entry.js +46 -23
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.js +5 -10
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-pure.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-body.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-cell.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-cell.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-row.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-row.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag-dismissible.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.js +7 -12
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea-wrapper.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/splitChildren.js +28 -0
- package/ssr/esm/components/dist/styles/esm/styles-entry.js +46 -23
- package/ssr/esm/components/dist/utils/esm/utils-entry.js +46 -23
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.js +5 -10
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-pure.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-body.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-cell.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-cell.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-row.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-row.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag-dismissible.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.js +7 -12
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea-wrapper.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/splitChildren.js +26 -0
- package/ssr/lib/components/button-group.wrapper.d.ts +3 -3
- package/ssr/lib/components/button-pure.wrapper.d.ts +3 -3
- package/ssr/lib/components/divider.wrapper.d.ts +3 -3
- package/ssr/lib/components/flex-item.wrapper.d.ts +13 -13
- package/ssr/lib/components/flex.wrapper.d.ts +13 -13
- package/ssr/lib/components/grid-item.wrapper.d.ts +5 -5
- package/ssr/lib/components/grid.wrapper.d.ts +7 -7
- package/ssr/lib/components/icon.wrapper.d.ts +3 -3
- package/ssr/lib/components/link-pure.wrapper.d.ts +5 -5
- package/ssr/lib/components/link-tile.wrapper.d.ts +3 -3
- package/ssr/lib/components/link.wrapper.d.ts +3 -3
- package/ssr/lib/components/marque.wrapper.d.ts +3 -3
- package/ssr/lib/components/modal.wrapper.d.ts +3 -3
- package/ssr/lib/components/spinner.wrapper.d.ts +5 -5
- package/ssr/lib/components/switch.wrapper.d.ts +3 -3
- package/ssr/lib/types.d.ts +26 -47
- package/ssr/splitChildren.d.ts +17 -0
- package/testing/index.js +8 -42
- package/testing.d.ts +1 -9
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getTabsBarCss as getComponentCss$b } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -13,13 +14,7 @@ class DSRTabsBar extends Component {
|
|
|
13
14
|
this.direction = 'next';
|
|
14
15
|
}
|
|
15
16
|
render() {
|
|
16
|
-
|
|
17
|
-
? this.props.children
|
|
18
|
-
: this.props.children
|
|
19
|
-
? [this.props.children]
|
|
20
|
-
: [];
|
|
21
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
22
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
17
|
+
splitChildren(this.props.children);
|
|
23
18
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$b(this.props.size, this.props.weight, this.props.theme)));
|
|
24
19
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(PScroller, { className: "scroller", role: "tablist", theme: this.props.theme, gradientColorScheme: this.props.gradientColorScheme, scrollIndicatorPosition: "top", children: [jsx("slot", {}), jsx("span", { className: "bar" })] })] }), this.props.children] }));
|
|
25
20
|
}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-item.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -6,13 +7,7 @@ import { getTabsItemCss as getComponentCss$a } from '../../../../../../component
|
|
|
6
7
|
|
|
7
8
|
class DSRTabsItem extends Component {
|
|
8
9
|
render() {
|
|
9
|
-
|
|
10
|
-
? this.props.children
|
|
11
|
-
: this.props.children
|
|
12
|
-
? [this.props.children]
|
|
13
|
-
: [];
|
|
14
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
15
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
10
|
+
splitChildren(this.props.children);
|
|
16
11
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$a(this.props.theme || 'light' // default as fallback
|
|
17
12
|
)));
|
|
18
13
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx("slot", {})] }), this.props.children] }));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getTabsCss as getComponentCss$9 } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -12,18 +13,12 @@ class DSRTabs extends Component {
|
|
|
12
13
|
this.tabsItemElements = [];
|
|
13
14
|
}
|
|
14
15
|
render() {
|
|
15
|
-
const children =
|
|
16
|
-
|
|
17
|
-
: this.props.children
|
|
18
|
-
? [this.props.children]
|
|
19
|
-
: [];
|
|
20
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
21
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
22
|
-
const manipulatedChildren = children.map((child, i) => typeof child === 'object' && defaultChildren.includes(child)
|
|
16
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
17
|
+
const manipulatedChildren = children.map((child, i) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
|
23
18
|
? { ...child, props: { ...child.props, theme: this.props.theme, hidden: this.props.activeTabIndex !== i ? true : null } }
|
|
24
19
|
: child);
|
|
25
20
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$9()));
|
|
26
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx(PTabsBar, { className: "root", size: this.props.size, weight: this.props.weight, theme: this.props.theme, gradientColorScheme: this.props.gradientColorScheme, activeTabIndex: this.props.activeTabIndex, children:
|
|
21
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx(PTabsBar, { className: "root", size: this.props.size, weight: this.props.weight, theme: this.props.theme, gradientColorScheme: this.props.gradientColorScheme, activeTabIndex: this.props.activeTabIndex, children: otherChildren.map((tab, index) => (jsx("button", { type: "button", children: typeof tab === 'object' && 'props' in tab && tab.props.label }, index))) }), jsx("slot", {})] })] }), manipulatedChildren] }));
|
|
27
22
|
}
|
|
28
23
|
}
|
|
29
24
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getTagDismissibleCss as getComponentCss$7 } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -9,13 +10,7 @@ import { PIcon } from '../components/icon.wrapper.js';
|
|
|
9
10
|
|
|
10
11
|
class DSRTagDismissible extends Component {
|
|
11
12
|
render() {
|
|
12
|
-
|
|
13
|
-
? this.props.children
|
|
14
|
-
: this.props.children
|
|
15
|
-
? [this.props.children]
|
|
16
|
-
: [];
|
|
17
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
18
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
13
|
+
splitChildren(this.props.children);
|
|
19
14
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$7(this.props.color, !!this.props.label)));
|
|
20
15
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("button", { type: "button", ...parseAndGetAriaAttributes(this.props.aria), children: [jsx("span", { className: "sr-only", children: "Remove:" }), this.props.label && jsx("span", { className: "label", children: this.props.label }), jsx("slot", {}), jsx(PIcon, { className: "icon", name: "close", color: "inherit", "aria-hidden": "true" })] })] }), this.props.children] }));
|
|
21
16
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getTagCss as getComponentCss$8 } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -9,13 +10,7 @@ import { PIcon } from '../components/icon.wrapper.js';
|
|
|
9
10
|
|
|
10
11
|
class DSRTag extends Component {
|
|
11
12
|
render() {
|
|
12
|
-
|
|
13
|
-
? this.props.children
|
|
14
|
-
: this.props.children
|
|
15
|
-
? [this.props.children]
|
|
16
|
-
: [];
|
|
17
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
18
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
13
|
+
splitChildren(this.props.children);
|
|
19
14
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$8(this.props.color, !!getDirectChildHTMLElement(null, 'a,button'), this.props.theme)));
|
|
20
15
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("span", { children: [(this.props.icon || this.props.iconSource) && (jsx(PIcon, { className: "icon", name: this.props.icon, source: this.props.iconSource, color: "inherit", theme: this.props.theme, "aria-hidden": "true" })), jsx("div", { children: jsx("slot", {}) })] })] }), this.props.children] }));
|
|
21
16
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getTextFieldWrapperCss as getComponentCss$6 } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -17,14 +18,8 @@ class DSRTextFieldWrapper extends Component {
|
|
|
17
18
|
}
|
|
18
19
|
render() {
|
|
19
20
|
var _a, _b;
|
|
20
|
-
const children =
|
|
21
|
-
|
|
22
|
-
: this.props.children
|
|
23
|
-
? [this.props.children]
|
|
24
|
-
: [];
|
|
25
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
26
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
27
|
-
const { readOnly, disabled, type } = ((_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props) || {};
|
|
21
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
22
|
+
const { readOnly, disabled, type } = typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props) || {};
|
|
28
23
|
const disabledOrReadOnly = disabled || readOnly;
|
|
29
24
|
const labelProps = {};
|
|
30
25
|
const iconProps = {
|
|
@@ -35,17 +30,17 @@ class DSRTextFieldWrapper extends Component {
|
|
|
35
30
|
const isPassword = isType(type, 'password');
|
|
36
31
|
isWithinForm(this.props.host);
|
|
37
32
|
const hasAction = hasLocateAction(this.props.actionIcon);
|
|
38
|
-
const hasCounter = false; // hasCounterAndIsTypeText(
|
|
33
|
+
const hasCounter = false; // hasCounterAndIsTypeText(otherChildren[0]?.props);
|
|
39
34
|
const isCounterVisible = this.props.showCharacterCount && hasCounter;
|
|
40
|
-
const isClearable = !!((_b =
|
|
35
|
+
const isClearable = typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && !!((_b = otherChildren[0]) === null || _b === void 0 ? void 0 : _b.props.value);
|
|
41
36
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$6(disabled, this.props.hideLabel, this.props.state, isCounterVisible, isCounterVisible ? 'suffix' : this.props.unitPosition, isPassword ? 'password' : type, this.props.isWithinForm, hasAction, hasAction && this.props.actionLoading)));
|
|
42
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("div", { className: "root", children: [jsxs("label", { className: "label", children: [(this.props.label ||
|
|
37
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("div", { className: "root", children: [jsxs("label", { className: "label", children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsx("span", { className: "label__text", ...labelProps, children: this.props.label || jsx("slot", { name: "label" }) })), (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) && (jsx("span", { className: "label__text label__text--description", ...labelProps, children: this.props.description || jsx("slot", { name: "description" }) })), (isCounterVisible) && (jsx("span", { className: "unit", ...labelProps, "aria-hidden": "true", children: this.props.unit })), jsx("slot", {}), hasCounter ] }), isPassword ? (jsxs("button", { type: "button", disabled: disabled, "aria-pressed": this.props.showPassword ? 'true' : 'false', children: [jsx("span", { className: "sr-only", children: "Toggle password visibility" }), jsx(PIcon, { name: this.props.showPassword ? 'view-off' : 'view', ...iconProps })] })) : (isSearch && [
|
|
43
38
|
jsx("button", { type: "button", tabIndex: -1, hidden: !isClearable, disabled: disabledOrReadOnly, children: jsx(PIcon, { name: "close", ...iconProps }) }, "btn-clear"),
|
|
44
39
|
hasAction && (jsxs("button", { type: "button", hidden: isClearable, disabled: disabledOrReadOnly, children: [jsx("span", { className: "sr-only", children: "Locate me" }), this.props.actionLoading ? (jsx(PSpinner, { size: "inherit" })) : (
|
|
45
40
|
// hardcoded locate icon
|
|
46
41
|
jsx(PIcon, { name: "locate", ...iconProps }))] }, "btn-action")),
|
|
47
42
|
this.props.isWithinForm ? (jsxs("button", { type: "submit", disabled: disabledOrReadOnly, children: [jsx("span", { className: "sr-only", children: "Search" }), jsx(PIcon, { name: "search", ...iconProps })] }, "btn-submit")) : (jsx(PIcon, { className: "icon", name: "search", ...iconProps }, "icon")),
|
|
48
|
-
])] }), (this.props.message ||
|
|
43
|
+
])] }), (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsx(StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
|
|
49
44
|
}
|
|
50
45
|
}
|
|
51
46
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list-item.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -6,13 +7,7 @@ import { getTextListItemCss as getComponentCss$5 } from '../../../../../../compo
|
|
|
6
7
|
|
|
7
8
|
class DSRTextListItem extends Component {
|
|
8
9
|
render() {
|
|
9
|
-
|
|
10
|
-
? this.props.children
|
|
11
|
-
: this.props.children
|
|
12
|
-
? [this.props.children]
|
|
13
|
-
: [];
|
|
14
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
15
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
10
|
+
splitChildren(this.props.children);
|
|
16
11
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$5(this.props.listType || 'unordered', // default as fallback
|
|
17
12
|
this.props.orderType || 'numbered' // default as fallback
|
|
18
13
|
)));
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -6,14 +7,8 @@ import { getTextListCss as getComponentCss$4 } from '../../../../../../component
|
|
|
6
7
|
|
|
7
8
|
class DSRTextList extends Component {
|
|
8
9
|
render() {
|
|
9
|
-
const children =
|
|
10
|
-
|
|
11
|
-
: this.props.children
|
|
12
|
-
? [this.props.children]
|
|
13
|
-
: [];
|
|
14
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
15
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
16
|
-
const manipulatedChildren = children.map((child, i) => typeof child === 'object' && defaultChildren.includes(child)
|
|
10
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
11
|
+
const manipulatedChildren = children.map((child, i) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
|
17
12
|
? { ...child, props: { ...child.props, listType: this.props.listType, orderType: this.props.orderType } }
|
|
18
13
|
: child);
|
|
19
14
|
const TagType = this.props.listType === 'unordered' ? 'ul' : 'ol';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -7,13 +8,7 @@ import { getHTMLElement } from '../../../../../../components/dist/utils/esm/util
|
|
|
7
8
|
|
|
8
9
|
class DSRText extends Component {
|
|
9
10
|
render() {
|
|
10
|
-
|
|
11
|
-
? this.props.children
|
|
12
|
-
: this.props.children
|
|
13
|
-
? [this.props.children]
|
|
14
|
-
: [];
|
|
15
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
16
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
11
|
+
splitChildren(this.props.children);
|
|
17
12
|
const firstChild = getHTMLElement(null, ':first-child');
|
|
18
13
|
const hasSlottedTextTag = firstChild === null || firstChild === void 0 ? void 0 : firstChild.matches('p,span,div,address,blockquote,figcaption,cite,time,legend');
|
|
19
14
|
const TagType = hasSlottedTextTag ? 'div' : this.props.tag;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -8,16 +9,10 @@ import { StateMessage } from './state-message.js';
|
|
|
8
9
|
class DSRTextareaWrapper extends Component {
|
|
9
10
|
render() {
|
|
10
11
|
var _a;
|
|
11
|
-
const children =
|
|
12
|
-
? this.props.children
|
|
13
|
-
: this.props.children
|
|
14
|
-
? [this.props.children]
|
|
15
|
-
: [];
|
|
16
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
17
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
12
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
18
13
|
const labelProps = {};
|
|
19
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$2((_a =
|
|
20
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("label", { className: "label", children: [(this.props.label ||
|
|
14
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$2(typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled), this.props.hideLabel, this.props.state, this.props.isCounterVisible, this.props.hasCounter)));
|
|
15
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("label", { className: "label", children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsx("span", { className: "label__text", ...labelProps, children: this.props.label || jsx("slot", { name: "label" }) })), (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) && (jsx("span", { className: "label__text label__text--description", ...labelProps, children: this.props.description || jsx("slot", { name: "description" }) })), this.props.isCounterVisible && (jsx("span", { className: "counter", ...labelProps, "aria-hidden": "true" })), jsx("slot", {}), this.props.hasCounter && jsx("span", { className: "sr-only", "aria-live": "polite" })] }), (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsx(StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
|
|
21
16
|
}
|
|
22
17
|
}
|
|
23
18
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param children derived from PropsWithChildren
|
|
5
|
+
*
|
|
6
|
+
* type PropsWithChildren<P = unknown> = P & { children?: ReactNode | undefined };
|
|
7
|
+
* type ReactNode = ReactElement | string | number | ReactFragment | ReactPortal | boolean | null | undefined;
|
|
8
|
+
* interface ReactElement<P = any, T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>> {
|
|
9
|
+
* type: T;
|
|
10
|
+
* props: P;
|
|
11
|
+
* key: Key | null;
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
const splitChildren = (children) => {
|
|
15
|
+
children =
|
|
16
|
+
typeof children === 'object' && 'type' in children && children.type === Fragment
|
|
17
|
+
? children.props.children // Unpack children of React.Fragment
|
|
18
|
+
: children;
|
|
19
|
+
const childrenArray = (Array.isArray(children) ? children : children ? [children] : []).filter((x) => x !== undefined && x !== null // children are filtered due to cases where conditionally rendered children can be undefined.
|
|
20
|
+
);
|
|
21
|
+
const otherChildren = childrenArray.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
22
|
+
const namedSlotChildren = childrenArray.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
23
|
+
return { children: childrenArray, namedSlotChildren, otherChildren };
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { splitChildren };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import type { ButtonGroupDirection } from '../types';
|
|
2
|
+
import type { BreakpointCustomizable, ButtonGroupDirection } from '../types';
|
|
3
3
|
export type PButtonGroupProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Defines the direction of the main and cross axis. The default is ’{base: ‘column’, xs: ‘row’}' showing buttons vertically stacked on mobile viewports and side-by-side in a horizontal row from breakpoint ‘xs’. You always need to provide a base value when using breakpoints.
|
|
6
6
|
*/
|
|
7
|
-
direction?: ButtonGroupDirection
|
|
7
|
+
direction?: BreakpointCustomizable<ButtonGroupDirection>;
|
|
8
8
|
};
|
|
9
9
|
export declare const PButtonGroup: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<{}>, "color"> & {
|
|
10
10
|
/**
|
|
11
11
|
* Defines the direction of the main and cross axis. The default is ’{base: ‘column’, xs: ‘row’}' showing buttons vertically stacked on mobile viewports and side-by-side in a horizontal row from breakpoint ‘xs’. You always need to provide a base value when using breakpoints.
|
|
12
12
|
*/
|
|
13
|
-
direction?: ButtonGroupDirection
|
|
13
|
+
direction?: BreakpointCustomizable<ButtonGroupDirection>;
|
|
14
14
|
} & {
|
|
15
15
|
children?: import("react").ReactNode;
|
|
16
16
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import type { AlignLabel, SelectedAriaAttributes, ButtonAriaAttributes,
|
|
2
|
+
import type { BreakpointCustomizable, AlignLabel, SelectedAriaAttributes, ButtonAriaAttributes, LinkButtonPureIconName, TextSize, ThemeExtendedElectricDark, ButtonType, TextWeight } from '../types';
|
|
3
3
|
export type PButtonPureProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Display button in active state.
|
|
@@ -8,7 +8,7 @@ export type PButtonPureProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
8
8
|
/**
|
|
9
9
|
* Aligns the label.
|
|
10
10
|
*/
|
|
11
|
-
alignLabel?: AlignLabel
|
|
11
|
+
alignLabel?: BreakpointCustomizable<AlignLabel>;
|
|
12
12
|
/**
|
|
13
13
|
* Add ARIA attributes.
|
|
14
14
|
*/
|
|
@@ -67,7 +67,7 @@ export declare const PButtonPure: import("react").ForwardRefExoticComponent<Omit
|
|
|
67
67
|
/**
|
|
68
68
|
* Aligns the label.
|
|
69
69
|
*/
|
|
70
|
-
alignLabel?: AlignLabel
|
|
70
|
+
alignLabel?: BreakpointCustomizable<AlignLabel>;
|
|
71
71
|
/**
|
|
72
72
|
* Add ARIA attributes.
|
|
73
73
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import type { DividerColor, DividerOrientation, Theme } from '../types';
|
|
2
|
+
import type { DividerColor, BreakpointCustomizable, DividerOrientation, Theme } from '../types';
|
|
3
3
|
export type PDividerProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Defines color depending on theme.
|
|
@@ -8,7 +8,7 @@ export type PDividerProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
8
8
|
/**
|
|
9
9
|
* Defines orientation.
|
|
10
10
|
*/
|
|
11
|
-
orientation?: DividerOrientation
|
|
11
|
+
orientation?: BreakpointCustomizable<DividerOrientation>;
|
|
12
12
|
/**
|
|
13
13
|
* Adapts color depending on theme.
|
|
14
14
|
*/
|
|
@@ -22,7 +22,7 @@ export declare const PDivider: import("react").ForwardRefExoticComponent<Omit<HT
|
|
|
22
22
|
/**
|
|
23
23
|
* Defines orientation.
|
|
24
24
|
*/
|
|
25
|
-
orientation?: DividerOrientation
|
|
25
|
+
orientation?: BreakpointCustomizable<DividerOrientation>;
|
|
26
26
|
/**
|
|
27
27
|
* Adapts color depending on theme.
|
|
28
28
|
*/
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import type { FlexItemAlignSelf, FlexItemFlex, FlexItemGrow, FlexItemOffset, FlexItemShrink, FlexItemWidth } from '../types';
|
|
2
|
+
import type { BreakpointCustomizable, FlexItemAlignSelf, FlexItemFlex, FlexItemGrow, FlexItemOffset, FlexItemShrink, FlexItemWidth } from '../types';
|
|
3
3
|
export type PFlexItemProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Defines how this flex item is aligned along the cross axis. This overwrites the cross axis alignment set by the container. Corresponds to the "alignSelf" css property.
|
|
6
6
|
*/
|
|
7
|
-
alignSelf?: FlexItemAlignSelf
|
|
7
|
+
alignSelf?: BreakpointCustomizable<FlexItemAlignSelf>;
|
|
8
8
|
/**
|
|
9
9
|
* The shorthand property for the combined definition of "shrink", "grow" and "basis"
|
|
10
10
|
*/
|
|
11
|
-
flex?: FlexItemFlex
|
|
11
|
+
flex?: BreakpointCustomizable<FlexItemFlex>;
|
|
12
12
|
/**
|
|
13
13
|
* The ability to allow/disallow the flex child to grow.
|
|
14
14
|
*/
|
|
15
|
-
grow?: FlexItemGrow
|
|
15
|
+
grow?: BreakpointCustomizable<FlexItemGrow>;
|
|
16
16
|
/**
|
|
17
17
|
* The offset of the column. You can also supply values for specific breakpoints, like {base: "none", l: "one-quarter"}. You always need to provide a base value when doing this.
|
|
18
18
|
*/
|
|
19
|
-
offset?: FlexItemOffset
|
|
19
|
+
offset?: BreakpointCustomizable<FlexItemOffset>;
|
|
20
20
|
/**
|
|
21
21
|
* The ability to allow/disallow the flex child to shrink.
|
|
22
22
|
*/
|
|
23
|
-
shrink?: FlexItemShrink
|
|
23
|
+
shrink?: BreakpointCustomizable<FlexItemShrink>;
|
|
24
24
|
/**
|
|
25
25
|
* The width of the flex item. You can also supply values for specific breakpoints, like {base: "full", l: "one-quarter"}. You always need to provide a base value when doing this.
|
|
26
26
|
*/
|
|
27
|
-
width?: FlexItemWidth
|
|
27
|
+
width?: BreakpointCustomizable<FlexItemWidth>;
|
|
28
28
|
};
|
|
29
29
|
export declare const PFlexItem: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<{}>, "color"> & {
|
|
30
30
|
/**
|
|
31
31
|
* Defines how this flex item is aligned along the cross axis. This overwrites the cross axis alignment set by the container. Corresponds to the "alignSelf" css property.
|
|
32
32
|
*/
|
|
33
|
-
alignSelf?: FlexItemAlignSelf
|
|
33
|
+
alignSelf?: BreakpointCustomizable<FlexItemAlignSelf>;
|
|
34
34
|
/**
|
|
35
35
|
* The shorthand property for the combined definition of "shrink", "grow" and "basis"
|
|
36
36
|
*/
|
|
37
|
-
flex?: FlexItemFlex
|
|
37
|
+
flex?: BreakpointCustomizable<FlexItemFlex>;
|
|
38
38
|
/**
|
|
39
39
|
* The ability to allow/disallow the flex child to grow.
|
|
40
40
|
*/
|
|
41
|
-
grow?: FlexItemGrow
|
|
41
|
+
grow?: BreakpointCustomizable<FlexItemGrow>;
|
|
42
42
|
/**
|
|
43
43
|
* The offset of the column. You can also supply values for specific breakpoints, like {base: "none", l: "one-quarter"}. You always need to provide a base value when doing this.
|
|
44
44
|
*/
|
|
45
|
-
offset?: FlexItemOffset
|
|
45
|
+
offset?: BreakpointCustomizable<FlexItemOffset>;
|
|
46
46
|
/**
|
|
47
47
|
* The ability to allow/disallow the flex child to shrink.
|
|
48
48
|
*/
|
|
49
|
-
shrink?: FlexItemShrink
|
|
49
|
+
shrink?: BreakpointCustomizable<FlexItemShrink>;
|
|
50
50
|
/**
|
|
51
51
|
* The width of the flex item. You can also supply values for specific breakpoints, like {base: "full", l: "one-quarter"}. You always need to provide a base value when doing this.
|
|
52
52
|
*/
|
|
53
|
-
width?: FlexItemWidth
|
|
53
|
+
width?: BreakpointCustomizable<FlexItemWidth>;
|
|
54
54
|
} & {
|
|
55
55
|
children?: import("react").ReactNode;
|
|
56
56
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import type { FlexAlignContent, FlexAlignItems, FlexDirection, FlexInline, FlexJustifyContent, FlexWrap } from '../types';
|
|
2
|
+
import type { BreakpointCustomizable, FlexAlignContent, FlexAlignItems, FlexDirection, FlexInline, FlexJustifyContent, FlexWrap } from '../types';
|
|
3
3
|
export type PFlexProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* This aligns a flex container's individual lines when there is extra space in the cross-axis, similar to how "justifyContent" aligns individual items along the main axis.
|
|
6
6
|
*/
|
|
7
|
-
alignContent?: FlexAlignContent
|
|
7
|
+
alignContent?: BreakpointCustomizable<FlexAlignContent>;
|
|
8
8
|
/**
|
|
9
9
|
* Defines how the flex items are aligned along the cross axis.
|
|
10
10
|
*/
|
|
11
|
-
alignItems?: FlexAlignItems
|
|
11
|
+
alignItems?: BreakpointCustomizable<FlexAlignItems>;
|
|
12
12
|
/**
|
|
13
13
|
* Defines the direction of the main and cross axis. The default "row" defines the main axis as horizontal left to right.
|
|
14
14
|
*/
|
|
15
|
-
direction?: FlexDirection
|
|
15
|
+
direction?: BreakpointCustomizable<FlexDirection>;
|
|
16
16
|
/**
|
|
17
17
|
* Defines the flex containers content flow if 2 or more containers are siblings of each other.
|
|
18
18
|
*/
|
|
19
|
-
inline?: FlexInline
|
|
19
|
+
inline?: BreakpointCustomizable<FlexInline>;
|
|
20
20
|
/**
|
|
21
21
|
* Defines how the flex items are aligned along the main axis.
|
|
22
22
|
*/
|
|
23
|
-
justifyContent?: FlexJustifyContent
|
|
23
|
+
justifyContent?: BreakpointCustomizable<FlexJustifyContent>;
|
|
24
24
|
/**
|
|
25
25
|
* Handles wrapping behaviour of elements.
|
|
26
26
|
*/
|
|
27
|
-
wrap?: FlexWrap
|
|
27
|
+
wrap?: BreakpointCustomizable<FlexWrap>;
|
|
28
28
|
};
|
|
29
29
|
export declare const PFlex: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<{}>, "color"> & {
|
|
30
30
|
/**
|
|
31
31
|
* This aligns a flex container's individual lines when there is extra space in the cross-axis, similar to how "justifyContent" aligns individual items along the main axis.
|
|
32
32
|
*/
|
|
33
|
-
alignContent?: FlexAlignContent
|
|
33
|
+
alignContent?: BreakpointCustomizable<FlexAlignContent>;
|
|
34
34
|
/**
|
|
35
35
|
* Defines how the flex items are aligned along the cross axis.
|
|
36
36
|
*/
|
|
37
|
-
alignItems?: FlexAlignItems
|
|
37
|
+
alignItems?: BreakpointCustomizable<FlexAlignItems>;
|
|
38
38
|
/**
|
|
39
39
|
* Defines the direction of the main and cross axis. The default "row" defines the main axis as horizontal left to right.
|
|
40
40
|
*/
|
|
41
|
-
direction?: FlexDirection
|
|
41
|
+
direction?: BreakpointCustomizable<FlexDirection>;
|
|
42
42
|
/**
|
|
43
43
|
* Defines the flex containers content flow if 2 or more containers are siblings of each other.
|
|
44
44
|
*/
|
|
45
|
-
inline?: FlexInline
|
|
45
|
+
inline?: BreakpointCustomizable<FlexInline>;
|
|
46
46
|
/**
|
|
47
47
|
* Defines how the flex items are aligned along the main axis.
|
|
48
48
|
*/
|
|
49
|
-
justifyContent?: FlexJustifyContent
|
|
49
|
+
justifyContent?: BreakpointCustomizable<FlexJustifyContent>;
|
|
50
50
|
/**
|
|
51
51
|
* Handles wrapping behaviour of elements.
|
|
52
52
|
*/
|
|
53
|
-
wrap?: FlexWrap
|
|
53
|
+
wrap?: BreakpointCustomizable<FlexWrap>;
|
|
54
54
|
} & {
|
|
55
55
|
children?: import("react").ReactNode;
|
|
56
56
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import type { GridItemOffset, GridItemSize } from '../types';
|
|
2
|
+
import type { BreakpointCustomizable, GridItemOffset, GridItemSize } from '../types';
|
|
3
3
|
export type PGridItemProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* The offset of the column. Can be between 0 and 11. Also defines the offset of the column for specific breakpoints, like {base: 6, l: 3}. You always need to provide a base value when doing this.
|
|
6
6
|
*/
|
|
7
|
-
offset?: GridItemOffset
|
|
7
|
+
offset?: BreakpointCustomizable<GridItemOffset>;
|
|
8
8
|
/**
|
|
9
9
|
* The size of the column. Can be between 1 and 12. Also defines the size of the column for specific breakpoints, like {base: 6, l: 3}. You always need to provide a base value when doing this.
|
|
10
10
|
*/
|
|
11
|
-
size?: GridItemSize
|
|
11
|
+
size?: BreakpointCustomizable<GridItemSize>;
|
|
12
12
|
};
|
|
13
13
|
export declare const PGridItem: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<{}>, "color"> & {
|
|
14
14
|
/**
|
|
15
15
|
* The offset of the column. Can be between 0 and 11. Also defines the offset of the column for specific breakpoints, like {base: 6, l: 3}. You always need to provide a base value when doing this.
|
|
16
16
|
*/
|
|
17
|
-
offset?: GridItemOffset
|
|
17
|
+
offset?: BreakpointCustomizable<GridItemOffset>;
|
|
18
18
|
/**
|
|
19
19
|
* The size of the column. Can be between 1 and 12. Also defines the size of the column for specific breakpoints, like {base: 6, l: 3}. You always need to provide a base value when doing this.
|
|
20
20
|
*/
|
|
21
|
-
size?: GridItemSize
|
|
21
|
+
size?: BreakpointCustomizable<GridItemSize>;
|
|
22
22
|
} & {
|
|
23
23
|
children?: import("react").ReactNode;
|
|
24
24
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import type { GridDirection, GridGutter, GridWrap } from '../types';
|
|
2
|
+
import type { BreakpointCustomizable, GridDirection, GridGutter, GridWrap } from '../types';
|
|
3
3
|
export type PGridProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Defines the direction of the main and cross axis. The default "row" defines the main axis as horizontal left to right. Also defines the direction for specific breakpoints, like {base: "column", l: "row"}. You always need to provide a base value when doing this.
|
|
6
6
|
*/
|
|
7
|
-
direction?: GridDirection
|
|
7
|
+
direction?: BreakpointCustomizable<GridDirection>;
|
|
8
8
|
/**
|
|
9
9
|
* Defines the gutter size for specific breakpoints. You always need to provide a base value when doing this.
|
|
10
10
|
*/
|
|
11
|
-
gutter?: GridGutter
|
|
11
|
+
gutter?: BreakpointCustomizable<GridGutter>;
|
|
12
12
|
/**
|
|
13
13
|
* Handles wrapping behaviour of elements.
|
|
14
14
|
*/
|
|
15
|
-
wrap?: GridWrap
|
|
15
|
+
wrap?: BreakpointCustomizable<GridWrap>;
|
|
16
16
|
};
|
|
17
17
|
export declare const PGrid: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<{}>, "color"> & {
|
|
18
18
|
/**
|
|
19
19
|
* Defines the direction of the main and cross axis. The default "row" defines the main axis as horizontal left to right. Also defines the direction for specific breakpoints, like {base: "column", l: "row"}. You always need to provide a base value when doing this.
|
|
20
20
|
*/
|
|
21
|
-
direction?: GridDirection
|
|
21
|
+
direction?: BreakpointCustomizable<GridDirection>;
|
|
22
22
|
/**
|
|
23
23
|
* Defines the gutter size for specific breakpoints. You always need to provide a base value when doing this.
|
|
24
24
|
*/
|
|
25
|
-
gutter?: GridGutter
|
|
25
|
+
gutter?: BreakpointCustomizable<GridGutter>;
|
|
26
26
|
/**
|
|
27
27
|
* Handles wrapping behaviour of elements.
|
|
28
28
|
*/
|
|
29
|
-
wrap?: GridWrap
|
|
29
|
+
wrap?: BreakpointCustomizable<GridWrap>;
|
|
30
30
|
} & {
|
|
31
31
|
children?: import("react").ReactNode;
|
|
32
32
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import type { SelectedAriaAttributes,
|
|
2
|
+
import type { SelectedAriaAttributes, IconAriaAttribute, TextColor, IconName, IconSize, ThemeExtendedElectricDark } from '../types';
|
|
3
3
|
export type PIconProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Add ARIA attributes.
|
|
6
6
|
*/
|
|
7
|
-
aria?: SelectedAriaAttributes<
|
|
7
|
+
aria?: SelectedAriaAttributes<IconAriaAttribute>;
|
|
8
8
|
/**
|
|
9
9
|
* Basic color variations depending on theme property.
|
|
10
10
|
*/
|
|
@@ -34,7 +34,7 @@ export declare const PIcon: import("react").ForwardRefExoticComponent<Omit<HTMLA
|
|
|
34
34
|
/**
|
|
35
35
|
* Add ARIA attributes.
|
|
36
36
|
*/
|
|
37
|
-
aria?: SelectedAriaAttributes<
|
|
37
|
+
aria?: SelectedAriaAttributes<IconAriaAttribute>;
|
|
38
38
|
/**
|
|
39
39
|
* Basic color variations depending on theme property.
|
|
40
40
|
*/
|