@porsche-design-system/components-react 3.17.0-rc.0 → 3.17.0-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 +17 -3
- package/cjs/lib/components/button.wrapper.cjs +3 -3
- package/cjs/lib/components/link-social.wrapper.cjs +3 -3
- package/cjs/lib/components/link.wrapper.cjs +3 -3
- package/esm/lib/components/button.wrapper.d.ts +8 -0
- package/esm/lib/components/button.wrapper.mjs +3 -3
- package/esm/lib/components/link-social.wrapper.d.ts +8 -0
- package/esm/lib/components/link-social.wrapper.mjs +3 -3
- package/esm/lib/components/link.wrapper.d.ts +8 -0
- package/esm/lib/components/link.wrapper.mjs +3 -3
- package/esm/lib/types.d.ts +2 -1
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +30 -17
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/button.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/link-social.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/link.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.cjs +1 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +30 -17
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/button.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link-social.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.mjs +1 -1
- package/ssr/esm/lib/components/button.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/link-social.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/link.wrapper.d.ts +8 -0
- package/ssr/esm/lib/types.d.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
|
|
|
14
14
|
|
|
15
15
|
### [Unreleased]
|
|
16
16
|
|
|
17
|
+
### [3.17.0-rc.1] - 2024-07-31
|
|
18
|
+
|
|
19
|
+
#### Added
|
|
20
|
+
|
|
21
|
+
- `Button`, `Link`:
|
|
22
|
+
- Prop `variant` extended by value `ghost`
|
|
23
|
+
([#3423](https://github.com/porsche-design-system/porsche-design-system/pull/3423))
|
|
24
|
+
- Prop `compact` ([#3423](https://github.com/porsche-design-system/porsche-design-system/pull/3423))
|
|
25
|
+
|
|
26
|
+
#### Fixed
|
|
27
|
+
|
|
28
|
+
- `Tabs Bar`: fixed tabindex issue when `Tabs Bar` is rendered with the `Scroller` component
|
|
29
|
+
([#3421](https://github.com/porsche-design-system/porsche-design-system/pull/3421))
|
|
30
|
+
|
|
17
31
|
### [3.17.0-rc.0] - 2024-07-29
|
|
18
32
|
|
|
19
33
|
#### Added
|
|
@@ -75,12 +89,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
|
|
|
75
89
|
|
|
76
90
|
- `Link Pure`: Broken with `alignLabel="start"`, hidden label & nested anchor
|
|
77
91
|
([#3379](https://github.com/porsche-design-system/porsche-design-system/pull/3379))
|
|
78
|
-
- `
|
|
92
|
+
- `Textfield Wrapper`, `Textarea Wrapper`: Conditionally rendered component throws
|
|
79
93
|
`TypeError: Cannot read properties of undefined (reading 'type')`
|
|
80
94
|
([#3383](https://github.com/porsche-design-system/porsche-design-system/pull/3383))
|
|
81
|
-
- `
|
|
95
|
+
- `Link Tile`: Broken word-break & hyphens Safari
|
|
82
96
|
([#3397](https://github.com/porsche-design-system/porsche-design-system/pull/3397))
|
|
83
|
-
- `Select
|
|
97
|
+
- `Select Wrapper`: `optgroup` styling and behavior
|
|
84
98
|
([#3410](https://github.com/porsche-design-system/porsche-design-system/pull/3410))
|
|
85
99
|
|
|
86
100
|
### [3.16.0] - 2024-07-02
|
|
@@ -6,13 +6,13 @@ var react = require('react');
|
|
|
6
6
|
var hooks = require('../../hooks.cjs');
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
|
|
9
|
-
const PButton = react.forwardRef(({ aria, disabled = false, hideLabel = false, icon = 'none', iconSource, loading = false, name, theme, type = 'submit', value, variant = 'primary', className, ...rest }, ref) => {
|
|
9
|
+
const PButton = react.forwardRef(({ aria, compact = false, disabled = false, hideLabel = false, icon = 'none', iconSource, loading = false, name, theme, type = 'submit', value, variant = 'primary', className, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
const WebComponentTag = hooks.usePrefix('p-button');
|
|
12
|
-
const propsToSync = [aria, disabled, hideLabel, icon, iconSource, loading, name, theme || hooks.useTheme(), type, value, variant];
|
|
12
|
+
const propsToSync = [aria, compact, disabled, hideLabel, icon, iconSource, loading, name, theme || hooks.useTheme(), type, value, variant];
|
|
13
13
|
hooks.useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['aria', 'disabled', 'hideLabel', 'icon', 'iconSource', 'loading', 'name', 'theme', 'type', 'value', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['aria', 'compact', 'disabled', 'hideLabel', 'icon', 'iconSource', 'loading', 'name', 'theme', 'type', 'value', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
const props = {
|
|
18
18
|
...rest,
|
|
@@ -6,13 +6,13 @@ var react = require('react');
|
|
|
6
6
|
var hooks = require('../../hooks.cjs');
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
|
|
9
|
-
const PLinkSocial = react.forwardRef(({ hideLabel = false, href, icon, iconSource, rel, target = '_self', theme, className, ...rest }, ref) => {
|
|
9
|
+
const PLinkSocial = react.forwardRef(({ compact = false, hideLabel = false, href, icon, iconSource, rel, target = '_self', theme, className, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
const WebComponentTag = hooks.usePrefix('p-link-social');
|
|
12
|
-
const propsToSync = [hideLabel, href, icon, iconSource, rel, target, theme || hooks.useTheme()];
|
|
12
|
+
const propsToSync = [compact, hideLabel, href, icon, iconSource, rel, target, theme || hooks.useTheme()];
|
|
13
13
|
hooks.useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['compact', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
const props = {
|
|
18
18
|
...rest,
|
|
@@ -6,13 +6,13 @@ var react = require('react');
|
|
|
6
6
|
var hooks = require('../../hooks.cjs');
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
|
|
9
|
-
const PLink = react.forwardRef(({ aria, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', theme, variant = 'primary', className, ...rest }, ref) => {
|
|
9
|
+
const PLink = react.forwardRef(({ aria, compact = false, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', theme, variant = 'primary', className, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
const WebComponentTag = hooks.usePrefix('p-link');
|
|
12
|
-
const propsToSync = [aria, download, hideLabel, href, icon, iconSource, rel, target, theme || hooks.useTheme(), variant];
|
|
12
|
+
const propsToSync = [aria, compact, download, hideLabel, href, icon, iconSource, rel, target, theme || hooks.useTheme(), variant];
|
|
13
13
|
hooks.useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['aria', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['aria', 'compact', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
const props = {
|
|
18
18
|
...rest,
|
|
@@ -5,6 +5,10 @@ export type PButtonProps = BaseProps & {
|
|
|
5
5
|
* Add ARIA attributes.
|
|
6
6
|
*/
|
|
7
7
|
aria?: SelectedAriaAttributes<ButtonAriaAttribute>;
|
|
8
|
+
/**
|
|
9
|
+
* Displays as compact version.
|
|
10
|
+
*/
|
|
11
|
+
compact?: boolean;
|
|
8
12
|
/**
|
|
9
13
|
* Disables the button. No events will be triggered while disabled state is active.
|
|
10
14
|
*/
|
|
@@ -51,6 +55,10 @@ export declare const PButton: import("react").ForwardRefExoticComponent<import("
|
|
|
51
55
|
* Add ARIA attributes.
|
|
52
56
|
*/
|
|
53
57
|
aria?: SelectedAriaAttributes<ButtonAriaAttribute>;
|
|
58
|
+
/**
|
|
59
|
+
* Displays as compact version.
|
|
60
|
+
*/
|
|
61
|
+
compact?: boolean;
|
|
54
62
|
/**
|
|
55
63
|
* Disables the button. No events will be triggered while disabled state is active.
|
|
56
64
|
*/
|
|
@@ -4,13 +4,13 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
|
|
7
|
-
const PButton = forwardRef(({ aria, disabled = false, hideLabel = false, icon = 'none', iconSource, loading = false, name, theme, type = 'submit', value, variant = 'primary', className, ...rest }, ref) => {
|
|
7
|
+
const PButton = forwardRef(({ aria, compact = false, disabled = false, hideLabel = false, icon = 'none', iconSource, loading = false, name, theme, type = 'submit', value, variant = 'primary', className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef();
|
|
9
9
|
const WebComponentTag = usePrefix('p-button');
|
|
10
|
-
const propsToSync = [aria, disabled, hideLabel, icon, iconSource, loading, name, theme || useTheme(), type, value, variant];
|
|
10
|
+
const propsToSync = [aria, compact, disabled, hideLabel, icon, iconSource, loading, name, theme || useTheme(), type, value, variant];
|
|
11
11
|
useBrowserLayoutEffect(() => {
|
|
12
12
|
const { current } = elementRef;
|
|
13
|
-
['aria', 'disabled', 'hideLabel', 'icon', 'iconSource', 'loading', 'name', 'theme', 'type', 'value', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
13
|
+
['aria', 'compact', 'disabled', 'hideLabel', 'icon', 'iconSource', 'loading', 'name', 'theme', 'type', 'value', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
14
|
}, propsToSync);
|
|
15
15
|
const props = {
|
|
16
16
|
...rest,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { BaseProps } from '../../BaseProps';
|
|
2
2
|
import type { BreakpointCustomizable, LinkSocialIcon, LinkSocialTarget, Theme } from '../types';
|
|
3
3
|
export type PLinkSocialProps = BaseProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Displays as compact version.
|
|
6
|
+
*/
|
|
7
|
+
compact?: boolean;
|
|
4
8
|
/**
|
|
5
9
|
* Show or hide label.
|
|
6
10
|
*/
|
|
@@ -31,6 +35,10 @@ export type PLinkSocialProps = BaseProps & {
|
|
|
31
35
|
theme?: Theme;
|
|
32
36
|
};
|
|
33
37
|
export declare const PLinkSocial: import("react").ForwardRefExoticComponent<import("react").DOMAttributes<{}> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
|
|
38
|
+
/**
|
|
39
|
+
* Displays as compact version.
|
|
40
|
+
*/
|
|
41
|
+
compact?: boolean;
|
|
34
42
|
/**
|
|
35
43
|
* Show or hide label.
|
|
36
44
|
*/
|
|
@@ -4,13 +4,13 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
|
|
7
|
-
const PLinkSocial = forwardRef(({ hideLabel = false, href, icon, iconSource, rel, target = '_self', theme, className, ...rest }, ref) => {
|
|
7
|
+
const PLinkSocial = forwardRef(({ compact = false, hideLabel = false, href, icon, iconSource, rel, target = '_self', theme, className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef();
|
|
9
9
|
const WebComponentTag = usePrefix('p-link-social');
|
|
10
|
-
const propsToSync = [hideLabel, href, icon, iconSource, rel, target, theme || useTheme()];
|
|
10
|
+
const propsToSync = [compact, hideLabel, href, icon, iconSource, rel, target, theme || useTheme()];
|
|
11
11
|
useBrowserLayoutEffect(() => {
|
|
12
12
|
const { current } = elementRef;
|
|
13
|
-
['hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
13
|
+
['compact', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
14
|
}, propsToSync);
|
|
15
15
|
const props = {
|
|
16
16
|
...rest,
|
|
@@ -5,6 +5,10 @@ export type PLinkProps = BaseProps & {
|
|
|
5
5
|
* Add ARIA attributes.
|
|
6
6
|
*/
|
|
7
7
|
aria?: SelectedAriaAttributes<LinkAriaAttribute>;
|
|
8
|
+
/**
|
|
9
|
+
* Displays as compact version.
|
|
10
|
+
*/
|
|
11
|
+
compact?: boolean;
|
|
8
12
|
/**
|
|
9
13
|
* Special download attribute to open native browser download dialog if target url points to a downloadable file.
|
|
10
14
|
*/
|
|
@@ -47,6 +51,10 @@ export declare const PLink: import("react").ForwardRefExoticComponent<import("re
|
|
|
47
51
|
* Add ARIA attributes.
|
|
48
52
|
*/
|
|
49
53
|
aria?: SelectedAriaAttributes<LinkAriaAttribute>;
|
|
54
|
+
/**
|
|
55
|
+
* Displays as compact version.
|
|
56
|
+
*/
|
|
57
|
+
compact?: boolean;
|
|
50
58
|
/**
|
|
51
59
|
* Special download attribute to open native browser download dialog if target url points to a downloadable file.
|
|
52
60
|
*/
|
|
@@ -4,13 +4,13 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
|
|
7
|
-
const PLink = forwardRef(({ aria, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', theme, variant = 'primary', className, ...rest }, ref) => {
|
|
7
|
+
const PLink = forwardRef(({ aria, compact = false, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', theme, variant = 'primary', className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef();
|
|
9
9
|
const WebComponentTag = usePrefix('p-link');
|
|
10
|
-
const propsToSync = [aria, download, hideLabel, href, icon, iconSource, rel, target, theme || useTheme(), variant];
|
|
10
|
+
const propsToSync = [aria, compact, download, hideLabel, href, icon, iconSource, rel, target, theme || useTheme(), variant];
|
|
11
11
|
useBrowserLayoutEffect(() => {
|
|
12
12
|
const { current } = elementRef;
|
|
13
|
-
['aria', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
13
|
+
['aria', 'compact', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
14
|
}, propsToSync);
|
|
15
15
|
const props = {
|
|
16
16
|
...rest,
|
package/esm/lib/types.d.ts
CHANGED
|
@@ -606,9 +606,10 @@ export type ButtonType = typeof BUTTON_TYPES[number];
|
|
|
606
606
|
declare const LINK_BUTTON_VARIANTS: readonly [
|
|
607
607
|
"primary",
|
|
608
608
|
"secondary",
|
|
609
|
+
"ghost",
|
|
609
610
|
"tertiary"
|
|
610
611
|
];
|
|
611
|
-
export type LinkButtonVariant = typeof LINK_BUTTON_VARIANTS[number];
|
|
612
|
+
export type LinkButtonVariant = (typeof LINK_BUTTON_VARIANTS)[number];
|
|
612
613
|
export type LinkButtonIconName = IconName | "none";
|
|
613
614
|
export type ButtonVariant = LinkButtonVariant;
|
|
614
615
|
export type LinkVariant = LinkButtonVariant;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porsche-design-system/components-react",
|
|
3
|
-
"version": "3.17.0-rc.
|
|
3
|
+
"version": "3.17.0-rc.1",
|
|
4
4
|
"description": "Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"porsche",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"license": "SEE LICENSE IN LICENSE",
|
|
18
18
|
"homepage": "https://designsystem.porsche.com",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@porsche-design-system/components-js": "3.17.0-rc.
|
|
20
|
+
"@porsche-design-system/components-js": "3.17.0-rc.1"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=18.0.0 <19.0.0",
|
|
@@ -3161,10 +3161,10 @@ const hasWindow = typeof window !== 'undefined';
|
|
|
3161
3161
|
const isHighContrastMode = hasWindow && window.matchMedia?.('(forced-colors: active)').matches;
|
|
3162
3162
|
|
|
3163
3163
|
const lighten = (hsl) => {
|
|
3164
|
-
return changeColor(hsl,
|
|
3164
|
+
return changeColor(hsl, 15);
|
|
3165
3165
|
};
|
|
3166
3166
|
const darken = (hsl) => {
|
|
3167
|
-
return changeColor(hsl, -
|
|
3167
|
+
return changeColor(hsl, -15);
|
|
3168
3168
|
};
|
|
3169
3169
|
const changeColor = (hsl, lightness) => {
|
|
3170
3170
|
return hsl.replace(/\s(\d+)(%?)\//, (_, p1, p2) => {
|
|
@@ -4494,7 +4494,7 @@ const getComponentCss$13 = (isDisabledOrLoading, aspectRatio, size, weight, back
|
|
|
4494
4494
|
const { primaryColor: darkThemePrimaryColor } = getThemedColors('dark');
|
|
4495
4495
|
const { primaryColor: lightThemePrimaryColor } = getThemedColors('light');
|
|
4496
4496
|
const getVariantColors = (variant, theme) => {
|
|
4497
|
-
const { primaryColor, contrastHighColor, contrastMediumColor, hoverColor } = getThemedColors(theme);
|
|
4497
|
+
const { primaryColor, contrastHighColor, contrastMediumColor, hoverColor, backgroundFrostedColor } = getThemedColors(theme);
|
|
4498
4498
|
const { canvasColor } = getHighContrastColors();
|
|
4499
4499
|
const colors = {
|
|
4500
4500
|
primary: {
|
|
@@ -4511,15 +4511,24 @@ const getVariantColors = (variant, theme) => {
|
|
|
4511
4511
|
backgroundColor: isHighContrastMode ? canvasColor : 'transparent',
|
|
4512
4512
|
backgroundColorHover: hoverColor,
|
|
4513
4513
|
},
|
|
4514
|
+
ghost: {
|
|
4515
|
+
textColor: primaryColor,
|
|
4516
|
+
borderColor: backgroundFrostedColor,
|
|
4517
|
+
borderColorHover: theme === 'dark' ? lighten(backgroundFrostedColor) : darken(backgroundFrostedColor),
|
|
4518
|
+
backgroundColor: backgroundFrostedColor,
|
|
4519
|
+
backgroundColorHover: theme === 'dark' ? lighten(backgroundFrostedColor) : darken(backgroundFrostedColor),
|
|
4520
|
+
},
|
|
4514
4521
|
};
|
|
4515
4522
|
return colors[variant === 'tertiary' ? 'secondary' : variant];
|
|
4516
4523
|
};
|
|
4517
|
-
const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrLoading, hasSlottedAnchor, theme) => {
|
|
4524
|
+
const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrLoading, hasSlottedAnchor, compact, theme) => {
|
|
4518
4525
|
const isPrimary = variant === 'primary';
|
|
4519
4526
|
const { textColor, borderColor, borderColorHover, backgroundColor, backgroundColorHover } = getVariantColors(variant, theme);
|
|
4520
4527
|
const { textColor: textColorDark, borderColor: borderColorDark, borderColorHover: borderColorHoverDark, backgroundColor: backgroundColorDark, backgroundColorHover: backgroundColorHoverDark, } = getVariantColors(variant, 'dark');
|
|
4521
4528
|
const { focusColor } = getThemedColors(theme);
|
|
4522
4529
|
const hasIcon = hasVisibleIcon(icon, iconSource) || hideLabel;
|
|
4530
|
+
const paddingBlock = compact ? '4px' : '13px';
|
|
4531
|
+
const paddingInline = compact ? '12px' : '26px';
|
|
4523
4532
|
return {
|
|
4524
4533
|
'@global': {
|
|
4525
4534
|
':host': {
|
|
@@ -4537,23 +4546,22 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4537
4546
|
alignItems: 'flex-start',
|
|
4538
4547
|
justifyContent: 'center',
|
|
4539
4548
|
width: '100%',
|
|
4540
|
-
minWidth: '54px', // ensure space is already reserved until icon component is loaded (ssr)
|
|
4541
|
-
minHeight: '54px', // ensure space is already reserved until icon component is loaded (ssr)
|
|
4542
4549
|
boxSizing: 'border-box',
|
|
4543
4550
|
textAlign: 'start',
|
|
4544
4551
|
WebkitAppearance: 'none', // iOS safari
|
|
4545
4552
|
appearance: 'none',
|
|
4546
4553
|
textDecoration: 'none',
|
|
4547
|
-
border:
|
|
4554
|
+
border: `${borderWidthBase} solid ${borderColor}`,
|
|
4548
4555
|
borderRadius: borderRadiusSmall,
|
|
4549
4556
|
transform: 'translate3d(0,0,0)', // creates new stacking context (for slotted anchor + focus)
|
|
4550
4557
|
backgroundColor,
|
|
4558
|
+
...(variant === 'ghost' && { ...frostedGlassStyle, backgroundClip: 'padding-box' }), // background color overlays border-color otherwise
|
|
4551
4559
|
color: textColor,
|
|
4552
4560
|
...textSmallStyle,
|
|
4553
4561
|
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
4554
4562
|
...buildResponsiveStyles(hideLabel, (hideLabelValue) => ({
|
|
4555
|
-
padding: hideLabelValue ?
|
|
4556
|
-
gap: hideLabelValue ? 0 : spacingStaticSmall,
|
|
4563
|
+
padding: hideLabelValue ? paddingBlock : `${paddingBlock} ${paddingInline}`,
|
|
4564
|
+
gap: hideLabelValue ? 0 : compact ? '6px' : spacingStaticSmall,
|
|
4557
4565
|
})),
|
|
4558
4566
|
...(!hasSlottedAnchor && getFocusJssStyle(theme)),
|
|
4559
4567
|
...(!isDisabledOrLoading &&
|
|
@@ -4577,10 +4585,10 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4577
4585
|
label: buildResponsiveStyles(hideLabel, getHiddenTextJssStyle),
|
|
4578
4586
|
...(hasIcon && {
|
|
4579
4587
|
icon: {
|
|
4580
|
-
width: fontLineHeight,
|
|
4581
|
-
height: fontLineHeight,
|
|
4588
|
+
width: fontLineHeight, // ensure space is already reserved until icon component is loaded (ssr)
|
|
4589
|
+
height: fontLineHeight, // ensure space is already reserved until icon component is loaded (ssr)
|
|
4582
4590
|
...buildResponsiveStyles(hideLabel, (hideLabelValue) => ({
|
|
4583
|
-
marginInlineStart: hideLabelValue ? 0 : '-8px', // compensate white space of svg icon and optimize visual alignment
|
|
4591
|
+
marginInlineStart: hideLabelValue ? 0 : compact ? '-6px' : '-8px', // compensate white space of svg icon and optimize visual alignment
|
|
4584
4592
|
})),
|
|
4585
4593
|
},
|
|
4586
4594
|
}),
|
|
@@ -4588,7 +4596,7 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4588
4596
|
};
|
|
4589
4597
|
|
|
4590
4598
|
const getDisabledColors = (variant, loading, theme) => {
|
|
4591
|
-
const { contrastMediumColor, contrastHighColor, disabledColor, hoverColor } = getThemedColors(theme);
|
|
4599
|
+
const { contrastMediumColor, contrastHighColor, disabledColor, hoverColor, backgroundFrostedColor } = getThemedColors(theme);
|
|
4592
4600
|
const { canvasColor } = getHighContrastColors();
|
|
4593
4601
|
const colors = {
|
|
4594
4602
|
primary: {
|
|
@@ -4601,15 +4609,20 @@ const getDisabledColors = (variant, loading, theme) => {
|
|
|
4601
4609
|
borderColor: isHighContrastMode ? disabledColor : loading ? contrastMediumColor : disabledColor,
|
|
4602
4610
|
backgroundColor: isHighContrastMode ? canvasColor : loading ? hoverColor : 'transparent',
|
|
4603
4611
|
},
|
|
4612
|
+
ghost: {
|
|
4613
|
+
textColor: disabledColor,
|
|
4614
|
+
borderColor: isHighContrastMode ? disabledColor : loading ? backgroundFrostedColor : backgroundFrostedColor,
|
|
4615
|
+
backgroundColor: isHighContrastMode ? canvasColor : loading ? backgroundFrostedColor : backgroundFrostedColor,
|
|
4616
|
+
},
|
|
4604
4617
|
};
|
|
4605
4618
|
return colors[variant === 'tertiary' ? 'secondary' : variant];
|
|
4606
4619
|
};
|
|
4607
|
-
const getComponentCss$12 = (icon, iconSource, variant, hideLabel, disabled, loading, theme) => {
|
|
4620
|
+
const getComponentCss$12 = (icon, iconSource, variant, hideLabel, disabled, loading, compact, theme) => {
|
|
4608
4621
|
const disabledOrLoading = isDisabledOrLoading(disabled, loading);
|
|
4609
4622
|
const { textColor, borderColor, backgroundColor } = getDisabledColors(variant, loading, theme);
|
|
4610
4623
|
const { textColor: textColorDark, borderColor: borderColorDark, backgroundColor: backgroundColorDark, } = getDisabledColors(variant, loading, 'dark');
|
|
4611
4624
|
const isPrimary = variant === 'primary';
|
|
4612
|
-
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, disabledOrLoading, false, theme), {
|
|
4625
|
+
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, disabledOrLoading, false, compact, theme), {
|
|
4613
4626
|
root: {
|
|
4614
4627
|
cursor: disabledOrLoading ? 'not-allowed' : 'pointer',
|
|
4615
4628
|
...(disabledOrLoading && {
|
|
@@ -6613,10 +6626,10 @@ const getComponentCss$J = (icon, iconSource, active, stretch, size, hideLabel, a
|
|
|
6613
6626
|
}));
|
|
6614
6627
|
};
|
|
6615
6628
|
|
|
6616
|
-
const getComponentCss$I = (icon, iconSource, variant, hideLabel, hasSlottedAnchor, theme) => {
|
|
6629
|
+
const getComponentCss$I = (icon, iconSource, variant, hideLabel, hasSlottedAnchor, compact, theme) => {
|
|
6617
6630
|
const { linkColor } = getHighContrastColors();
|
|
6618
6631
|
const isPrimary = variant === 'primary';
|
|
6619
|
-
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, false, hasSlottedAnchor, theme), {
|
|
6632
|
+
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, false, hasSlottedAnchor, compact, theme), {
|
|
6620
6633
|
label: {
|
|
6621
6634
|
clip: addImportantToRule('unset'), // to overrule breakpoint customizable hide-label style
|
|
6622
6635
|
},
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/button.wrapper.cjs
CHANGED
|
@@ -7,13 +7,13 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var button = require('../dsr-components/button.cjs');
|
|
9
9
|
|
|
10
|
-
const PButton = react.forwardRef(({ aria, disabled = false, hideLabel = false, icon = 'none', iconSource, loading = false, name, theme, type = 'submit', value, variant = 'primary', className, children, ...rest }, ref) => {
|
|
10
|
+
const PButton = react.forwardRef(({ aria, compact = false, disabled = false, hideLabel = false, icon = 'none', iconSource, loading = false, name, theme, type = 'submit', value, variant = 'primary', className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
const WebComponentTag = hooks.usePrefix('p-button');
|
|
13
|
-
const propsToSync = [aria, disabled, hideLabel, icon, iconSource, loading, name, theme || hooks.useTheme(), type, value, variant];
|
|
13
|
+
const propsToSync = [aria, compact, disabled, hideLabel, icon, iconSource, loading, name, theme || hooks.useTheme(), type, value, variant];
|
|
14
14
|
hooks.useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['aria', 'disabled', 'hideLabel', 'icon', 'iconSource', 'loading', 'name', 'theme', 'type', 'value', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['aria', 'compact', 'disabled', 'hideLabel', 'icon', 'iconSource', 'loading', 'name', 'theme', 'type', 'value', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
if (!process.browser) {
|
|
@@ -24,7 +24,7 @@ const PButton = react.forwardRef(({ aria, disabled = false, hideLabel = false, i
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
...(!process.browser
|
|
26
26
|
? {
|
|
27
|
-
children: (jsxRuntime.jsx(button.DSRButton, { aria, disabled, hideLabel, icon, iconSource, loading, name, theme: theme || hooks.useTheme(), type, value, variant, children })),
|
|
27
|
+
children: (jsxRuntime.jsx(button.DSRButton, { aria, compact, disabled, hideLabel, icon, iconSource, loading, name, theme: theme || hooks.useTheme(), type, value, variant, children })),
|
|
28
28
|
}
|
|
29
29
|
: {
|
|
30
30
|
children,
|
|
@@ -7,13 +7,13 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var linkSocial = require('../dsr-components/link-social.cjs');
|
|
9
9
|
|
|
10
|
-
const PLinkSocial = react.forwardRef(({ hideLabel = false, href, icon, iconSource, rel, target = '_self', theme, className, children, ...rest }, ref) => {
|
|
10
|
+
const PLinkSocial = react.forwardRef(({ compact = false, hideLabel = false, href, icon, iconSource, rel, target = '_self', theme, className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
const WebComponentTag = hooks.usePrefix('p-link-social');
|
|
13
|
-
const propsToSync = [hideLabel, href, icon, iconSource, rel, target, theme || hooks.useTheme()];
|
|
13
|
+
const propsToSync = [compact, hideLabel, href, icon, iconSource, rel, target, theme || hooks.useTheme()];
|
|
14
14
|
hooks.useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['compact', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
if (!process.browser) {
|
|
@@ -24,7 +24,7 @@ const PLinkSocial = react.forwardRef(({ hideLabel = false, href, icon, iconSourc
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
...(!process.browser
|
|
26
26
|
? {
|
|
27
|
-
children: (jsxRuntime.jsx(linkSocial.DSRLinkSocial, { hideLabel, href, icon, iconSource, rel, target, theme: theme || hooks.useTheme(), children })),
|
|
27
|
+
children: (jsxRuntime.jsx(linkSocial.DSRLinkSocial, { compact, hideLabel, href, icon, iconSource, rel, target, theme: theme || hooks.useTheme(), children })),
|
|
28
28
|
}
|
|
29
29
|
: {
|
|
30
30
|
children,
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/link.wrapper.cjs
CHANGED
|
@@ -7,13 +7,13 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var link = require('../dsr-components/link.cjs');
|
|
9
9
|
|
|
10
|
-
const PLink = react.forwardRef(({ aria, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', theme, variant = 'primary', className, children, ...rest }, ref) => {
|
|
10
|
+
const PLink = react.forwardRef(({ aria, compact = false, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', theme, variant = 'primary', className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
const WebComponentTag = hooks.usePrefix('p-link');
|
|
13
|
-
const propsToSync = [aria, download, hideLabel, href, icon, iconSource, rel, target, theme || hooks.useTheme(), variant];
|
|
13
|
+
const propsToSync = [aria, compact, download, hideLabel, href, icon, iconSource, rel, target, theme || hooks.useTheme(), variant];
|
|
14
14
|
hooks.useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['aria', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['aria', 'compact', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
if (!process.browser) {
|
|
@@ -24,7 +24,7 @@ const PLink = react.forwardRef(({ aria, download, hideLabel = false, href, icon
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
...(!process.browser
|
|
26
26
|
? {
|
|
27
|
-
children: (jsxRuntime.jsx(link.DSRLink, { aria, download, hideLabel, href, icon, iconSource, rel, target, theme: theme || hooks.useTheme(), variant, children })),
|
|
27
|
+
children: (jsxRuntime.jsx(link.DSRLink, { aria, compact, download, hideLabel, href, icon, iconSource, rel, target, theme: theme || hooks.useTheme(), variant, children })),
|
|
28
28
|
}
|
|
29
29
|
: {
|
|
30
30
|
children,
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.cjs
CHANGED
|
@@ -87,7 +87,7 @@ class DSRButton extends react.Component {
|
|
|
87
87
|
host;
|
|
88
88
|
render() {
|
|
89
89
|
splitChildren.splitChildren(this.props.children);
|
|
90
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getButtonCss(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, this.props.disabled, this.props.loading, this.props.theme)));
|
|
90
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getButtonCss(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, this.props.disabled, this.props.loading, this.props.compact, this.props.theme)));
|
|
91
91
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("button", { ...utilsEntry.getButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.aria), className: "root", type: this.props.type, name: this.props.name, value: this.props.value, "aria-describedby": this.props.loading ? loadingMessage.loadingId : undefined, children: [this.props.loading && (jsxRuntime.jsx(spinner_wrapper.PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" })), utilsEntry.hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", size: "inherit", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: this.props.disabled ? (this.props.variant === 'primary' ? 'contrast-high' : 'state-disabled') : 'primary', theme: this.props.theme, "aria-hidden": "true" })), jsxRuntime.jsx("span", { className: "label", children: jsxRuntime.jsx("slot", {}) })] }), jsxRuntime.jsx(loadingMessage.LoadingMessage, { loading: this.props.loading, initialLoading: false })] })] }), this.props.children] }));
|
|
92
92
|
}
|
|
93
93
|
}
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.cjs
CHANGED
|
@@ -88,7 +88,7 @@ class DSRLinkSocial extends react.Component {
|
|
|
88
88
|
render() {
|
|
89
89
|
splitChildren.splitChildren(this.props.children);
|
|
90
90
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
91
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkCss(this.props.icon, this.props.iconSource, 'primary', this.props.hideLabel, !this.props.href, this.props.theme)));
|
|
91
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkCss(this.props.icon, this.props.iconSource, 'primary', this.props.hideLabel, !this.props.href, this.props.compact, this.props.theme)));
|
|
92
92
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
93
93
|
href: this.props.href,
|
|
94
94
|
target: this.props.target,
|
|
@@ -87,7 +87,7 @@ class DSRLink extends react.Component {
|
|
|
87
87
|
render() {
|
|
88
88
|
splitChildren.splitChildren(this.props.children);
|
|
89
89
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
90
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkCss(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, !this.props.href, this.props.theme)));
|
|
90
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkCss(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, !this.props.href, this.props.compact, this.props.theme)));
|
|
91
91
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
92
92
|
href: this.props.href,
|
|
93
93
|
target: this.props.target,
|
|
@@ -3159,10 +3159,10 @@ const hasWindow = typeof window !== 'undefined';
|
|
|
3159
3159
|
const isHighContrastMode = hasWindow && window.matchMedia?.('(forced-colors: active)').matches;
|
|
3160
3160
|
|
|
3161
3161
|
const lighten = (hsl) => {
|
|
3162
|
-
return changeColor(hsl,
|
|
3162
|
+
return changeColor(hsl, 15);
|
|
3163
3163
|
};
|
|
3164
3164
|
const darken = (hsl) => {
|
|
3165
|
-
return changeColor(hsl, -
|
|
3165
|
+
return changeColor(hsl, -15);
|
|
3166
3166
|
};
|
|
3167
3167
|
const changeColor = (hsl, lightness) => {
|
|
3168
3168
|
return hsl.replace(/\s(\d+)(%?)\//, (_, p1, p2) => {
|
|
@@ -4492,7 +4492,7 @@ const getComponentCss$13 = (isDisabledOrLoading, aspectRatio, size, weight, back
|
|
|
4492
4492
|
const { primaryColor: darkThemePrimaryColor } = getThemedColors('dark');
|
|
4493
4493
|
const { primaryColor: lightThemePrimaryColor } = getThemedColors('light');
|
|
4494
4494
|
const getVariantColors = (variant, theme) => {
|
|
4495
|
-
const { primaryColor, contrastHighColor, contrastMediumColor, hoverColor } = getThemedColors(theme);
|
|
4495
|
+
const { primaryColor, contrastHighColor, contrastMediumColor, hoverColor, backgroundFrostedColor } = getThemedColors(theme);
|
|
4496
4496
|
const { canvasColor } = getHighContrastColors();
|
|
4497
4497
|
const colors = {
|
|
4498
4498
|
primary: {
|
|
@@ -4509,15 +4509,24 @@ const getVariantColors = (variant, theme) => {
|
|
|
4509
4509
|
backgroundColor: isHighContrastMode ? canvasColor : 'transparent',
|
|
4510
4510
|
backgroundColorHover: hoverColor,
|
|
4511
4511
|
},
|
|
4512
|
+
ghost: {
|
|
4513
|
+
textColor: primaryColor,
|
|
4514
|
+
borderColor: backgroundFrostedColor,
|
|
4515
|
+
borderColorHover: theme === 'dark' ? lighten(backgroundFrostedColor) : darken(backgroundFrostedColor),
|
|
4516
|
+
backgroundColor: backgroundFrostedColor,
|
|
4517
|
+
backgroundColorHover: theme === 'dark' ? lighten(backgroundFrostedColor) : darken(backgroundFrostedColor),
|
|
4518
|
+
},
|
|
4512
4519
|
};
|
|
4513
4520
|
return colors[variant === 'tertiary' ? 'secondary' : variant];
|
|
4514
4521
|
};
|
|
4515
|
-
const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrLoading, hasSlottedAnchor, theme) => {
|
|
4522
|
+
const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrLoading, hasSlottedAnchor, compact, theme) => {
|
|
4516
4523
|
const isPrimary = variant === 'primary';
|
|
4517
4524
|
const { textColor, borderColor, borderColorHover, backgroundColor, backgroundColorHover } = getVariantColors(variant, theme);
|
|
4518
4525
|
const { textColor: textColorDark, borderColor: borderColorDark, borderColorHover: borderColorHoverDark, backgroundColor: backgroundColorDark, backgroundColorHover: backgroundColorHoverDark, } = getVariantColors(variant, 'dark');
|
|
4519
4526
|
const { focusColor } = getThemedColors(theme);
|
|
4520
4527
|
const hasIcon = hasVisibleIcon(icon, iconSource) || hideLabel;
|
|
4528
|
+
const paddingBlock = compact ? '4px' : '13px';
|
|
4529
|
+
const paddingInline = compact ? '12px' : '26px';
|
|
4521
4530
|
return {
|
|
4522
4531
|
'@global': {
|
|
4523
4532
|
':host': {
|
|
@@ -4535,23 +4544,22 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4535
4544
|
alignItems: 'flex-start',
|
|
4536
4545
|
justifyContent: 'center',
|
|
4537
4546
|
width: '100%',
|
|
4538
|
-
minWidth: '54px', // ensure space is already reserved until icon component is loaded (ssr)
|
|
4539
|
-
minHeight: '54px', // ensure space is already reserved until icon component is loaded (ssr)
|
|
4540
4547
|
boxSizing: 'border-box',
|
|
4541
4548
|
textAlign: 'start',
|
|
4542
4549
|
WebkitAppearance: 'none', // iOS safari
|
|
4543
4550
|
appearance: 'none',
|
|
4544
4551
|
textDecoration: 'none',
|
|
4545
|
-
border:
|
|
4552
|
+
border: `${borderWidthBase} solid ${borderColor}`,
|
|
4546
4553
|
borderRadius: borderRadiusSmall,
|
|
4547
4554
|
transform: 'translate3d(0,0,0)', // creates new stacking context (for slotted anchor + focus)
|
|
4548
4555
|
backgroundColor,
|
|
4556
|
+
...(variant === 'ghost' && { ...frostedGlassStyle, backgroundClip: 'padding-box' }), // background color overlays border-color otherwise
|
|
4549
4557
|
color: textColor,
|
|
4550
4558
|
...textSmallStyle,
|
|
4551
4559
|
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
4552
4560
|
...buildResponsiveStyles(hideLabel, (hideLabelValue) => ({
|
|
4553
|
-
padding: hideLabelValue ?
|
|
4554
|
-
gap: hideLabelValue ? 0 : spacingStaticSmall,
|
|
4561
|
+
padding: hideLabelValue ? paddingBlock : `${paddingBlock} ${paddingInline}`,
|
|
4562
|
+
gap: hideLabelValue ? 0 : compact ? '6px' : spacingStaticSmall,
|
|
4555
4563
|
})),
|
|
4556
4564
|
...(!hasSlottedAnchor && getFocusJssStyle(theme)),
|
|
4557
4565
|
...(!isDisabledOrLoading &&
|
|
@@ -4575,10 +4583,10 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4575
4583
|
label: buildResponsiveStyles(hideLabel, getHiddenTextJssStyle),
|
|
4576
4584
|
...(hasIcon && {
|
|
4577
4585
|
icon: {
|
|
4578
|
-
width: fontLineHeight,
|
|
4579
|
-
height: fontLineHeight,
|
|
4586
|
+
width: fontLineHeight, // ensure space is already reserved until icon component is loaded (ssr)
|
|
4587
|
+
height: fontLineHeight, // ensure space is already reserved until icon component is loaded (ssr)
|
|
4580
4588
|
...buildResponsiveStyles(hideLabel, (hideLabelValue) => ({
|
|
4581
|
-
marginInlineStart: hideLabelValue ? 0 : '-8px', // compensate white space of svg icon and optimize visual alignment
|
|
4589
|
+
marginInlineStart: hideLabelValue ? 0 : compact ? '-6px' : '-8px', // compensate white space of svg icon and optimize visual alignment
|
|
4582
4590
|
})),
|
|
4583
4591
|
},
|
|
4584
4592
|
}),
|
|
@@ -4586,7 +4594,7 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4586
4594
|
};
|
|
4587
4595
|
|
|
4588
4596
|
const getDisabledColors = (variant, loading, theme) => {
|
|
4589
|
-
const { contrastMediumColor, contrastHighColor, disabledColor, hoverColor } = getThemedColors(theme);
|
|
4597
|
+
const { contrastMediumColor, contrastHighColor, disabledColor, hoverColor, backgroundFrostedColor } = getThemedColors(theme);
|
|
4590
4598
|
const { canvasColor } = getHighContrastColors();
|
|
4591
4599
|
const colors = {
|
|
4592
4600
|
primary: {
|
|
@@ -4599,15 +4607,20 @@ const getDisabledColors = (variant, loading, theme) => {
|
|
|
4599
4607
|
borderColor: isHighContrastMode ? disabledColor : loading ? contrastMediumColor : disabledColor,
|
|
4600
4608
|
backgroundColor: isHighContrastMode ? canvasColor : loading ? hoverColor : 'transparent',
|
|
4601
4609
|
},
|
|
4610
|
+
ghost: {
|
|
4611
|
+
textColor: disabledColor,
|
|
4612
|
+
borderColor: isHighContrastMode ? disabledColor : loading ? backgroundFrostedColor : backgroundFrostedColor,
|
|
4613
|
+
backgroundColor: isHighContrastMode ? canvasColor : loading ? backgroundFrostedColor : backgroundFrostedColor,
|
|
4614
|
+
},
|
|
4602
4615
|
};
|
|
4603
4616
|
return colors[variant === 'tertiary' ? 'secondary' : variant];
|
|
4604
4617
|
};
|
|
4605
|
-
const getComponentCss$12 = (icon, iconSource, variant, hideLabel, disabled, loading, theme) => {
|
|
4618
|
+
const getComponentCss$12 = (icon, iconSource, variant, hideLabel, disabled, loading, compact, theme) => {
|
|
4606
4619
|
const disabledOrLoading = isDisabledOrLoading(disabled, loading);
|
|
4607
4620
|
const { textColor, borderColor, backgroundColor } = getDisabledColors(variant, loading, theme);
|
|
4608
4621
|
const { textColor: textColorDark, borderColor: borderColorDark, backgroundColor: backgroundColorDark, } = getDisabledColors(variant, loading, 'dark');
|
|
4609
4622
|
const isPrimary = variant === 'primary';
|
|
4610
|
-
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, disabledOrLoading, false, theme), {
|
|
4623
|
+
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, disabledOrLoading, false, compact, theme), {
|
|
4611
4624
|
root: {
|
|
4612
4625
|
cursor: disabledOrLoading ? 'not-allowed' : 'pointer',
|
|
4613
4626
|
...(disabledOrLoading && {
|
|
@@ -6611,10 +6624,10 @@ const getComponentCss$J = (icon, iconSource, active, stretch, size, hideLabel, a
|
|
|
6611
6624
|
}));
|
|
6612
6625
|
};
|
|
6613
6626
|
|
|
6614
|
-
const getComponentCss$I = (icon, iconSource, variant, hideLabel, hasSlottedAnchor, theme) => {
|
|
6627
|
+
const getComponentCss$I = (icon, iconSource, variant, hideLabel, hasSlottedAnchor, compact, theme) => {
|
|
6615
6628
|
const { linkColor } = getHighContrastColors();
|
|
6616
6629
|
const isPrimary = variant === 'primary';
|
|
6617
|
-
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, false, hasSlottedAnchor, theme), {
|
|
6630
|
+
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, false, hasSlottedAnchor, compact, theme), {
|
|
6618
6631
|
label: {
|
|
6619
6632
|
clip: addImportantToRule('unset'), // to overrule breakpoint customizable hide-label style
|
|
6620
6633
|
},
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/button.wrapper.mjs
CHANGED
|
@@ -5,13 +5,13 @@ import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRButton } from '../dsr-components/button.mjs';
|
|
7
7
|
|
|
8
|
-
const PButton = forwardRef(({ aria, disabled = false, hideLabel = false, icon = 'none', iconSource, loading = false, name, theme, type = 'submit', value, variant = 'primary', className, children, ...rest }, ref) => {
|
|
8
|
+
const PButton = forwardRef(({ aria, compact = false, disabled = false, hideLabel = false, icon = 'none', iconSource, loading = false, name, theme, type = 'submit', value, variant = 'primary', className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
const WebComponentTag = usePrefix('p-button');
|
|
11
|
-
const propsToSync = [aria, disabled, hideLabel, icon, iconSource, loading, name, theme || useTheme(), type, value, variant];
|
|
11
|
+
const propsToSync = [aria, compact, disabled, hideLabel, icon, iconSource, loading, name, theme || useTheme(), type, value, variant];
|
|
12
12
|
useBrowserLayoutEffect(() => {
|
|
13
13
|
const { current } = elementRef;
|
|
14
|
-
['aria', 'disabled', 'hideLabel', 'icon', 'iconSource', 'loading', 'name', 'theme', 'type', 'value', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
|
+
['aria', 'compact', 'disabled', 'hideLabel', 'icon', 'iconSource', 'loading', 'name', 'theme', 'type', 'value', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
15
|
}, propsToSync);
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
if (!process.browser) {
|
|
@@ -22,7 +22,7 @@ const PButton = forwardRef(({ aria, disabled = false, hideLabel = false, icon =
|
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
...(!process.browser
|
|
24
24
|
? {
|
|
25
|
-
children: (jsx(DSRButton, { aria, disabled, hideLabel, icon, iconSource, loading, name, theme: theme || useTheme(), type, value, variant, children })),
|
|
25
|
+
children: (jsx(DSRButton, { aria, compact, disabled, hideLabel, icon, iconSource, loading, name, theme: theme || useTheme(), type, value, variant, children })),
|
|
26
26
|
}
|
|
27
27
|
: {
|
|
28
28
|
children,
|
|
@@ -5,13 +5,13 @@ import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRLinkSocial } from '../dsr-components/link-social.mjs';
|
|
7
7
|
|
|
8
|
-
const PLinkSocial = forwardRef(({ hideLabel = false, href, icon, iconSource, rel, target = '_self', theme, className, children, ...rest }, ref) => {
|
|
8
|
+
const PLinkSocial = forwardRef(({ compact = false, hideLabel = false, href, icon, iconSource, rel, target = '_self', theme, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
const WebComponentTag = usePrefix('p-link-social');
|
|
11
|
-
const propsToSync = [hideLabel, href, icon, iconSource, rel, target, theme || useTheme()];
|
|
11
|
+
const propsToSync = [compact, hideLabel, href, icon, iconSource, rel, target, theme || useTheme()];
|
|
12
12
|
useBrowserLayoutEffect(() => {
|
|
13
13
|
const { current } = elementRef;
|
|
14
|
-
['hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
|
+
['compact', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
15
|
}, propsToSync);
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
if (!process.browser) {
|
|
@@ -22,7 +22,7 @@ const PLinkSocial = forwardRef(({ hideLabel = false, href, icon, iconSource, rel
|
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
...(!process.browser
|
|
24
24
|
? {
|
|
25
|
-
children: (jsx(DSRLinkSocial, { hideLabel, href, icon, iconSource, rel, target, theme: theme || useTheme(), children })),
|
|
25
|
+
children: (jsx(DSRLinkSocial, { compact, hideLabel, href, icon, iconSource, rel, target, theme: theme || useTheme(), children })),
|
|
26
26
|
}
|
|
27
27
|
: {
|
|
28
28
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link.wrapper.mjs
CHANGED
|
@@ -5,13 +5,13 @@ import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRLink } from '../dsr-components/link.mjs';
|
|
7
7
|
|
|
8
|
-
const PLink = forwardRef(({ aria, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', theme, variant = 'primary', className, children, ...rest }, ref) => {
|
|
8
|
+
const PLink = forwardRef(({ aria, compact = false, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', theme, variant = 'primary', className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
const WebComponentTag = usePrefix('p-link');
|
|
11
|
-
const propsToSync = [aria, download, hideLabel, href, icon, iconSource, rel, target, theme || useTheme(), variant];
|
|
11
|
+
const propsToSync = [aria, compact, download, hideLabel, href, icon, iconSource, rel, target, theme || useTheme(), variant];
|
|
12
12
|
useBrowserLayoutEffect(() => {
|
|
13
13
|
const { current } = elementRef;
|
|
14
|
-
['aria', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
|
+
['aria', 'compact', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
15
|
}, propsToSync);
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
if (!process.browser) {
|
|
@@ -22,7 +22,7 @@ const PLink = forwardRef(({ aria, download, hideLabel = false, href, icon = 'non
|
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
...(!process.browser
|
|
24
24
|
? {
|
|
25
|
-
children: (jsx(DSRLink, { aria, download, hideLabel, href, icon, iconSource, rel, target, theme: theme || useTheme(), variant, children })),
|
|
25
|
+
children: (jsx(DSRLink, { aria, compact, download, hideLabel, href, icon, iconSource, rel, target, theme: theme || useTheme(), variant, children })),
|
|
26
26
|
}
|
|
27
27
|
: {
|
|
28
28
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs
CHANGED
|
@@ -85,7 +85,7 @@ class DSRButton extends Component {
|
|
|
85
85
|
host;
|
|
86
86
|
render() {
|
|
87
87
|
splitChildren(this.props.children);
|
|
88
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$12(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, this.props.disabled, this.props.loading, this.props.theme)));
|
|
88
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$12(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, this.props.disabled, this.props.loading, this.props.compact, this.props.theme)));
|
|
89
89
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("button", { ...getButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.aria), className: "root", type: this.props.type, name: this.props.name, value: this.props.value, "aria-describedby": this.props.loading ? loadingId : undefined, children: [this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" })), hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsx(PIcon, { className: "icon", size: "inherit", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: this.props.disabled ? (this.props.variant === 'primary' ? 'contrast-high' : 'state-disabled') : 'primary', theme: this.props.theme, "aria-hidden": "true" })), jsx("span", { className: "label", children: jsx("slot", {}) })] }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: false })] })] }), this.props.children] }));
|
|
90
90
|
}
|
|
91
91
|
}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.mjs
CHANGED
|
@@ -86,7 +86,7 @@ class DSRLinkSocial extends Component {
|
|
|
86
86
|
render() {
|
|
87
87
|
splitChildren(this.props.children);
|
|
88
88
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
89
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$I(this.props.icon, this.props.iconSource, 'primary', this.props.hideLabel, !this.props.href, this.props.theme)));
|
|
89
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$I(this.props.icon, this.props.iconSource, 'primary', this.props.hideLabel, !this.props.href, this.props.compact, this.props.theme)));
|
|
90
90
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
91
91
|
href: this.props.href,
|
|
92
92
|
target: this.props.target,
|
|
@@ -85,7 +85,7 @@ class DSRLink extends Component {
|
|
|
85
85
|
render() {
|
|
86
86
|
splitChildren(this.props.children);
|
|
87
87
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
88
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$I(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, !this.props.href, this.props.theme)));
|
|
88
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$I(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, !this.props.href, this.props.compact, this.props.theme)));
|
|
89
89
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
90
90
|
href: this.props.href,
|
|
91
91
|
target: this.props.target,
|
|
@@ -5,6 +5,10 @@ export type PButtonProps = BaseProps & {
|
|
|
5
5
|
* Add ARIA attributes.
|
|
6
6
|
*/
|
|
7
7
|
aria?: SelectedAriaAttributes<ButtonAriaAttribute>;
|
|
8
|
+
/**
|
|
9
|
+
* Displays as compact version.
|
|
10
|
+
*/
|
|
11
|
+
compact?: boolean;
|
|
8
12
|
/**
|
|
9
13
|
* Disables the button. No events will be triggered while disabled state is active.
|
|
10
14
|
*/
|
|
@@ -51,6 +55,10 @@ export declare const PButton: import("react").ForwardRefExoticComponent<import("
|
|
|
51
55
|
* Add ARIA attributes.
|
|
52
56
|
*/
|
|
53
57
|
aria?: SelectedAriaAttributes<ButtonAriaAttribute>;
|
|
58
|
+
/**
|
|
59
|
+
* Displays as compact version.
|
|
60
|
+
*/
|
|
61
|
+
compact?: boolean;
|
|
54
62
|
/**
|
|
55
63
|
* Disables the button. No events will be triggered while disabled state is active.
|
|
56
64
|
*/
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { BaseProps } from '../../BaseProps';
|
|
2
2
|
import type { BreakpointCustomizable, LinkSocialIcon, LinkSocialTarget, Theme } from '../types';
|
|
3
3
|
export type PLinkSocialProps = BaseProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Displays as compact version.
|
|
6
|
+
*/
|
|
7
|
+
compact?: boolean;
|
|
4
8
|
/**
|
|
5
9
|
* Show or hide label.
|
|
6
10
|
*/
|
|
@@ -31,6 +35,10 @@ export type PLinkSocialProps = BaseProps & {
|
|
|
31
35
|
theme?: Theme;
|
|
32
36
|
};
|
|
33
37
|
export declare const PLinkSocial: import("react").ForwardRefExoticComponent<import("react").DOMAttributes<{}> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
|
|
38
|
+
/**
|
|
39
|
+
* Displays as compact version.
|
|
40
|
+
*/
|
|
41
|
+
compact?: boolean;
|
|
34
42
|
/**
|
|
35
43
|
* Show or hide label.
|
|
36
44
|
*/
|
|
@@ -5,6 +5,10 @@ export type PLinkProps = BaseProps & {
|
|
|
5
5
|
* Add ARIA attributes.
|
|
6
6
|
*/
|
|
7
7
|
aria?: SelectedAriaAttributes<LinkAriaAttribute>;
|
|
8
|
+
/**
|
|
9
|
+
* Displays as compact version.
|
|
10
|
+
*/
|
|
11
|
+
compact?: boolean;
|
|
8
12
|
/**
|
|
9
13
|
* Special download attribute to open native browser download dialog if target url points to a downloadable file.
|
|
10
14
|
*/
|
|
@@ -47,6 +51,10 @@ export declare const PLink: import("react").ForwardRefExoticComponent<import("re
|
|
|
47
51
|
* Add ARIA attributes.
|
|
48
52
|
*/
|
|
49
53
|
aria?: SelectedAriaAttributes<LinkAriaAttribute>;
|
|
54
|
+
/**
|
|
55
|
+
* Displays as compact version.
|
|
56
|
+
*/
|
|
57
|
+
compact?: boolean;
|
|
50
58
|
/**
|
|
51
59
|
* Special download attribute to open native browser download dialog if target url points to a downloadable file.
|
|
52
60
|
*/
|
package/ssr/esm/lib/types.d.ts
CHANGED
|
@@ -606,9 +606,10 @@ export type ButtonType = typeof BUTTON_TYPES[number];
|
|
|
606
606
|
declare const LINK_BUTTON_VARIANTS: readonly [
|
|
607
607
|
"primary",
|
|
608
608
|
"secondary",
|
|
609
|
+
"ghost",
|
|
609
610
|
"tertiary"
|
|
610
611
|
];
|
|
611
|
-
export type LinkButtonVariant = typeof LINK_BUTTON_VARIANTS[number];
|
|
612
|
+
export type LinkButtonVariant = (typeof LINK_BUTTON_VARIANTS)[number];
|
|
612
613
|
export type LinkButtonIconName = IconName | "none";
|
|
613
614
|
export type ButtonVariant = LinkButtonVariant;
|
|
614
615
|
export type LinkVariant = LinkButtonVariant;
|