@carbon-labs/react-ui-shell 0.33.0 → 0.35.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.
@@ -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.33.0",
3
+ "version": "0.35.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": "e9f954d5959765777247a1a9c49eeb28231243f9"
36
+ "gitHead": "14fd00d1120ca39a27ad3fae2f58d58c505ae2a4"
37
37
  }
@@ -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,27 +21,21 @@ $prefix: 'cds' !default;
21
21
  }
22
22
 
23
23
  .#{$prefix}--header__action:focus {
24
- border-width: 2px;
25
- box-shadow: none;
24
+ box-shadow: inset 0 0 0 1px $focus, inset 0 0 0 2px $background;
26
25
  }
27
26
 
28
- //----------------------------------------------------------------------------
29
- // Menu button inside Header
30
- //----------------------------------------------------------------------------
31
-
32
- .#{$prefix}--header
33
- .#{$prefix}--menu-button__trigger.#{$prefix}--btn--ghost:not([disabled]) {
34
- color: $text-secondary;
27
+ .#{$prefix}--header-action__button {
28
+ block-size: convert.rem(48px);
35
29
  }
36
30
 
37
31
  .#{$prefix}--header-action__button.#{$prefix}--btn--ghost:not([disabled]) svg {
38
32
  fill: $icon-secondary;
39
33
  }
40
34
 
35
+ .#{$prefix}--header-action__button.#{$prefix}--btn--ghost:not([disabled]):hover
36
+ svg,
41
37
  .#{$prefix}--header-action.#{$prefix}--popover--open
42
- .#{$prefix}--header-action__button.#{$prefix}--btn--ghost:not(
43
- [disabled]
44
- ):hover
38
+ .#{$prefix}--header-action__button.#{$prefix}--btn--ghost:not([disabled])
45
39
  svg {
46
40
  fill: $icon-primary;
47
41
  }
@@ -69,3 +63,19 @@ $prefix: 'cds' !default;
69
63
  );
70
64
  @include custom-property.declaration('link-focus-text-color', $focus);
71
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
+ }
@@ -10,3 +10,4 @@
10
10
  @use 'styles/content';
11
11
  @use 'styles/shark-fin-icon.scss';
12
12
  @use 'styles/header-divider.scss';
13
+ @use 'styles/trial-countdown.scss';