@carbon-labs/react-ui-shell 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/TrialCountdown.d.ts +26 -0
- package/es/components/TrialCountdown.js +49 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/lib/components/TrialCountdown.d.ts +26 -0
- package/lib/components/TrialCountdown.js +51 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/package.json +2 -2
- package/scss/styles/_header.scss +23 -12
- package/scss/styles/_trial-countdown.scss +59 -0
- package/scss/ui-shell.scss +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
export interface TrialCountdownProps {
|
|
9
|
+
/**
|
|
10
|
+
* Provide an optional class to be applied to the containing node
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Provide the number of days remaining
|
|
15
|
+
*/
|
|
16
|
+
count: number;
|
|
17
|
+
/**
|
|
18
|
+
* Provide label text displayed next to the count. Defaults to "Trial days left"
|
|
19
|
+
*/
|
|
20
|
+
text?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Provide a warning style (red border). defaults to `false`
|
|
23
|
+
*/
|
|
24
|
+
warning?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const TrialCountdown: React.FC<TrialCountdownProps>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2024
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import cx from '../_virtual/index.js';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { usePrefix } from '../internal/usePrefix.js';
|
|
12
|
+
|
|
13
|
+
const TrialCountdown = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
className,
|
|
16
|
+
count,
|
|
17
|
+
text = 'Trial days left',
|
|
18
|
+
warning = false
|
|
19
|
+
} = _ref;
|
|
20
|
+
const prefix = usePrefix();
|
|
21
|
+
const classNames = cx(`${prefix}--trial-countdown`, className, {
|
|
22
|
+
[`${prefix}--trial-countdown--warning`]: warning
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/React.createElement("p", {
|
|
25
|
+
className: classNames
|
|
26
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
27
|
+
className: `${prefix}--trial-countdown__count`
|
|
28
|
+
}, count), ' ', text);
|
|
29
|
+
};
|
|
30
|
+
TrialCountdown.propTypes = {
|
|
31
|
+
/**
|
|
32
|
+
* Provide an optional class to be applied to the containing node
|
|
33
|
+
*/
|
|
34
|
+
className: PropTypes.string,
|
|
35
|
+
/**
|
|
36
|
+
* Provide the number of days remaining
|
|
37
|
+
*/
|
|
38
|
+
count: PropTypes.number.isRequired,
|
|
39
|
+
/**
|
|
40
|
+
* Provide label text displayed next to the count. Defaults to "Trial days left"
|
|
41
|
+
*/
|
|
42
|
+
text: PropTypes.string,
|
|
43
|
+
/**
|
|
44
|
+
* Provide a warning style (red border). defaults to `false`
|
|
45
|
+
*/
|
|
46
|
+
warning: PropTypes.bool
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { TrialCountdown };
|
package/es/index.d.ts
CHANGED
|
@@ -17,3 +17,4 @@ export { HeaderPopover, HeaderPopoverActions, HeaderPopoverButton, HeaderPopover
|
|
|
17
17
|
export { HeaderPanel } from './components/HeaderPanel';
|
|
18
18
|
export { SharkFinIcon } from './components/SharkFinIcon';
|
|
19
19
|
export { HeaderDivider } from './components/HeaderDivider';
|
|
20
|
+
export { TrialCountdown } from './components/TrialCountdown';
|
package/es/index.js
CHANGED
|
@@ -16,3 +16,4 @@ export { HeaderPopover, HeaderPopoverActions, HeaderPopoverButton, HeaderPopover
|
|
|
16
16
|
export { HeaderPanel } from './components/HeaderPanel.js';
|
|
17
17
|
export { SharkFinIcon } from './components/SharkFinIcon.js';
|
|
18
18
|
export { HeaderDivider } from './components/HeaderDivider.js';
|
|
19
|
+
export { TrialCountdown } from './components/TrialCountdown.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
export interface TrialCountdownProps {
|
|
9
|
+
/**
|
|
10
|
+
* Provide an optional class to be applied to the containing node
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Provide the number of days remaining
|
|
15
|
+
*/
|
|
16
|
+
count: number;
|
|
17
|
+
/**
|
|
18
|
+
* Provide label text displayed next to the count. Defaults to "Trial days left"
|
|
19
|
+
*/
|
|
20
|
+
text?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Provide a warning style (red border). defaults to `false`
|
|
23
|
+
*/
|
|
24
|
+
warning?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const TrialCountdown: React.FC<TrialCountdownProps>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2024
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
var index = require('../_virtual/index.js');
|
|
11
|
+
var PropTypes = require('prop-types');
|
|
12
|
+
var React = require('react');
|
|
13
|
+
var usePrefix = require('../internal/usePrefix.js');
|
|
14
|
+
|
|
15
|
+
const TrialCountdown = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
count,
|
|
19
|
+
text = 'Trial days left',
|
|
20
|
+
warning = false
|
|
21
|
+
} = _ref;
|
|
22
|
+
const prefix = usePrefix.usePrefix();
|
|
23
|
+
const classNames = index.default(`${prefix}--trial-countdown`, className, {
|
|
24
|
+
[`${prefix}--trial-countdown--warning`]: warning
|
|
25
|
+
});
|
|
26
|
+
return /*#__PURE__*/React.createElement("p", {
|
|
27
|
+
className: classNames
|
|
28
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
29
|
+
className: `${prefix}--trial-countdown__count`
|
|
30
|
+
}, count), ' ', text);
|
|
31
|
+
};
|
|
32
|
+
TrialCountdown.propTypes = {
|
|
33
|
+
/**
|
|
34
|
+
* Provide an optional class to be applied to the containing node
|
|
35
|
+
*/
|
|
36
|
+
className: PropTypes.string,
|
|
37
|
+
/**
|
|
38
|
+
* Provide the number of days remaining
|
|
39
|
+
*/
|
|
40
|
+
count: PropTypes.number.isRequired,
|
|
41
|
+
/**
|
|
42
|
+
* Provide label text displayed next to the count. Defaults to "Trial days left"
|
|
43
|
+
*/
|
|
44
|
+
text: PropTypes.string,
|
|
45
|
+
/**
|
|
46
|
+
* Provide a warning style (red border). defaults to `false`
|
|
47
|
+
*/
|
|
48
|
+
warning: PropTypes.bool
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.TrialCountdown = TrialCountdown;
|
package/lib/index.d.ts
CHANGED
|
@@ -17,3 +17,4 @@ export { HeaderPopover, HeaderPopoverActions, HeaderPopoverButton, HeaderPopover
|
|
|
17
17
|
export { HeaderPanel } from './components/HeaderPanel';
|
|
18
18
|
export { SharkFinIcon } from './components/SharkFinIcon';
|
|
19
19
|
export { HeaderDivider } from './components/HeaderDivider';
|
|
20
|
+
export { TrialCountdown } from './components/TrialCountdown';
|
package/lib/index.js
CHANGED
|
@@ -18,6 +18,7 @@ var HeaderPopover = require('./components/HeaderPopover.js');
|
|
|
18
18
|
var HeaderPanel = require('./components/HeaderPanel.js');
|
|
19
19
|
var SharkFinIcon = require('./components/SharkFinIcon.js');
|
|
20
20
|
var HeaderDivider = require('./components/HeaderDivider.js');
|
|
21
|
+
var TrialCountdown = require('./components/TrialCountdown.js');
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
|
|
@@ -36,3 +37,4 @@ exports.HeaderPopoverContent = HeaderPopover.HeaderPopoverContent;
|
|
|
36
37
|
exports.HeaderPanel = HeaderPanel.HeaderPanel;
|
|
37
38
|
exports.SharkFinIcon = SharkFinIcon.SharkFinIcon;
|
|
38
39
|
exports.HeaderDivider = HeaderDivider.HeaderDivider;
|
|
40
|
+
exports.TrialCountdown = TrialCountdown.TrialCountdown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon-labs/react-ui-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ibm/telemetry-js": "^1.9.1"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "291236b22a3fc3e65bdcf38a27b4b4f05f036df1"
|
|
37
37
|
}
|
package/scss/styles/_header.scss
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
@use '@carbon/styles/scss/theme' as *;
|
|
8
7
|
|
|
9
8
|
@use '@carbon/styles/scss/theme' as *;
|
|
10
9
|
@use '@carbon/styles/scss/motion' as *;
|
|
10
|
+
@use '@carbon/react/scss/utilities/convert' as convert;
|
|
11
11
|
@use '@carbon/styles/scss/utilities/custom-property' as custom-property;
|
|
12
12
|
|
|
13
13
|
$prefix: 'cds' !default;
|
|
@@ -21,26 +21,21 @@ $prefix: 'cds' !default;
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.#{$prefix}--header__action:focus {
|
|
24
|
-
|
|
24
|
+
box-shadow: inset 0 0 0 1px $focus, inset 0 0 0 2px $background;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
//----------------------------------------------------------------------------
|
|
30
|
-
|
|
31
|
-
.#{$prefix}--header
|
|
32
|
-
.#{$prefix}--menu-button__trigger.#{$prefix}--btn--ghost:not([disabled]) {
|
|
33
|
-
color: $text-secondary;
|
|
27
|
+
.#{$prefix}--header-action__button {
|
|
28
|
+
block-size: convert.rem(48px);
|
|
34
29
|
}
|
|
35
30
|
|
|
36
31
|
.#{$prefix}--header-action__button.#{$prefix}--btn--ghost:not([disabled]) svg {
|
|
37
32
|
fill: $icon-secondary;
|
|
38
33
|
}
|
|
39
34
|
|
|
35
|
+
.#{$prefix}--header-action__button.#{$prefix}--btn--ghost:not([disabled]):hover
|
|
36
|
+
svg,
|
|
40
37
|
.#{$prefix}--header-action.#{$prefix}--popover--open
|
|
41
|
-
.#{$prefix}--header-action__button.#{$prefix}--btn--ghost:not(
|
|
42
|
-
[disabled]
|
|
43
|
-
):hover
|
|
38
|
+
.#{$prefix}--header-action__button.#{$prefix}--btn--ghost:not([disabled])
|
|
44
39
|
svg {
|
|
45
40
|
fill: $icon-primary;
|
|
46
41
|
}
|
|
@@ -68,3 +63,19 @@ $prefix: 'cds' !default;
|
|
|
68
63
|
);
|
|
69
64
|
@include custom-property.declaration('link-focus-text-color', $focus);
|
|
70
65
|
}
|
|
66
|
+
|
|
67
|
+
//----------------------------------------------------------------------------
|
|
68
|
+
// Menu button inside Header
|
|
69
|
+
//----------------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
.#{$prefix}--header
|
|
72
|
+
.#{$prefix}--menu-button__trigger.#{$prefix}--btn--ghost:not([disabled]) {
|
|
73
|
+
color: $text-secondary;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.#{$prefix}--header
|
|
77
|
+
.#{$prefix}--menu-button__trigger.#{$prefix}--btn--ghost:not(
|
|
78
|
+
[disabled]
|
|
79
|
+
):hover {
|
|
80
|
+
color: $text-primary;
|
|
81
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
@use '@carbon/styles/scss/theme' as *;
|
|
9
|
+
@use '@carbon/styles/scss/type' as *;
|
|
10
|
+
@use '@carbon/styles/scss/colors' as *;
|
|
11
|
+
@use '@carbon/styles/scss/spacing' as *;
|
|
12
|
+
|
|
13
|
+
$prefix: 'cds' !default;
|
|
14
|
+
|
|
15
|
+
:root {
|
|
16
|
+
// these should be set up as component tokens if/when moved to @carbon/styles
|
|
17
|
+
--trial-countdown-start: #{$blue-60};
|
|
18
|
+
--trial-countdown-end: #{$purple-50};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.cds--g100,
|
|
22
|
+
.cds--g90,
|
|
23
|
+
[data-carbon-theme='g100'],
|
|
24
|
+
[data-carbon-theme='g90'] {
|
|
25
|
+
--trial-countdown-start: #{$blue-50};
|
|
26
|
+
--trial-countdown-end: #{$purple-40};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
$trial-countdown-gradient: linear-gradient(135deg, $background, $background),
|
|
30
|
+
linear-gradient(
|
|
31
|
+
135deg,
|
|
32
|
+
var(--trial-countdown-start),
|
|
33
|
+
var(--trial-countdown-end)
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
.#{$prefix}--trial-countdown {
|
|
37
|
+
@include type-style('label-01');
|
|
38
|
+
|
|
39
|
+
color: $text-primary;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.#{$prefix}--trial-countdown__count {
|
|
43
|
+
@include type-style('label-02');
|
|
44
|
+
|
|
45
|
+
display: inline-block;
|
|
46
|
+
border: 1px solid rgba(0, 0, 0, 0);
|
|
47
|
+
border-radius: 0.125rem;
|
|
48
|
+
background-clip: padding-box, border-box;
|
|
49
|
+
background-image: $trial-countdown-gradient;
|
|
50
|
+
background-origin: padding-box, border-box;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
min-inline-size: 1rem;
|
|
53
|
+
text-align: center;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.#{$prefix}--trial-countdown--warning .#{$prefix}--trial-countdown__count {
|
|
57
|
+
border: 1px solid $support-error;
|
|
58
|
+
background-image: none;
|
|
59
|
+
}
|
package/scss/ui-shell.scss
CHANGED