@carbon-labs/react-ui-shell 0.80.0 → 0.81.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.
@@ -9,7 +9,7 @@ import { extends as _extends } from '../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
11
  import React__default, { useRef, useState, useContext } from 'react';
12
- import { Popover, ToggletipContent, ToggletipActions, IconButton } from '@carbon/react';
12
+ import { Popover, IconButton, ToggletipContent, ToggletipActions } from '@carbon/react';
13
13
  import { Escape } from '../internal/keyboard/keys.js';
14
14
  import { match } from '../internal/keyboard/match.js';
15
15
  import { useWindowEvent } from '../internal/useEvent.js';
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- import React, { type ElementType, type Ref } from 'react';
8
+ import { type ElementType, type WeakValidationMap, type Ref } from 'react';
9
9
  import { type PolymorphicProps } from '../types/common';
10
10
  type LinkBaseProps<E extends ElementType> = {
11
11
  /**
@@ -21,9 +21,9 @@ export type LinkProps<E extends ElementType> = PolymorphicProps<E, LinkBaseProps
21
21
  * in their own components to support use-cases like `react-router` or
22
22
  * `@reach/router`
23
23
  */
24
- declare const Link: (<E extends React.ElementType = "a">(props: LinkProps<E>) => JSX.Element) & {
25
- displayName?: string | undefined;
26
- propTypes?: React.WeakValidationMap<LinkProps<any>> | undefined;
24
+ declare const Link: (<E extends ElementType = "a">(props: LinkProps<E>) => JSX.Element) & {
25
+ displayName?: string;
26
+ propTypes?: WeakValidationMap<LinkProps<any>>;
27
27
  };
28
28
  declare const LinkPropTypes: {
29
29
  /**
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { ChevronRight, ChevronDown, ArrowLeft } from '@carbon/icons-react';
8
+ import { ArrowLeft, ChevronRight, ChevronDown } from '@carbon/icons-react';
9
9
  import { SideNavIcon, Layer, Button } from '@carbon/react';
10
10
  import { breakpoints } from '../node_modules/@carbon/layout/es/index.js';
11
11
  import cx from 'classnames';
@@ -27,5 +27,5 @@ export type GlobalEventCallback<E extends keyof GlobalEventHandlersEventMap> = (
27
27
  /**
28
28
  * <T>
29
29
  */
30
- export type MutableRefObject<T> = import('react').MutableRefObject<T>;
30
+ export type MutableRefObject<T> = import("react").MutableRefObject<T>;
31
31
  export type WindowEventCallback<E extends keyof WindowEventMap> = (event: WindowEventMap[E]) => void;
@@ -4,7 +4,7 @@
4
4
  * @param {string} [prefix] the optional prefix id
5
5
  * @returns {string}
6
6
  */
7
- export function useCompatibleId(prefix?: string | undefined): string;
7
+ export function useCompatibleId(prefix?: string): string;
8
8
  /**
9
9
  * Generate a unique id if a given `id` is not provided
10
10
  * This is an internal utility, not intended for public usage.
@@ -18,4 +18,4 @@ export function useFallbackId(id: string | undefined): string;
18
18
  * @param {string} [prefix] the optional prefix id
19
19
  * @returns {string}
20
20
  */
21
- export function useId(prefix?: string | undefined): string;
21
+ export function useId(prefix?: string): string;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import React__default, { useState, useEffect, useLayoutEffect } from 'react';
8
+ import React__default, { useState, useLayoutEffect, useEffect } from 'react';
9
9
  import setupGetInstanceId from './setupGetInstanceId.js';
10
10
  import { useIdPrefix } from './useIdPrefix.js';
11
11
  import { canUseDOM } from './environment.js';
@@ -13,7 +13,6 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
13
13
  import { pkg } from '../../settings.js';
14
14
  import { usePrefix, Tooltip } from '@carbon/react';
15
15
  import { User } from '@carbon/react/icons';
16
- import '../../global/js/utils/props-helper.js';
17
16
  import { TooltipTrigger } from '../TooltipTrigger/TooltipTrigger.js';
18
17
 
19
18
  // Carbon and package components we use.
@@ -135,12 +134,7 @@ UserAvatar.propTypes = {
135
134
  * When passing the image prop use the imageDescription prop to describe the image for screen reader.
136
135
  */
137
136
  /**@ts-ignore */
138
- imageDescription: PropTypes.string.isRequired.if(_ref => {
139
- let {
140
- image
141
- } = _ref;
142
- return !!image;
143
- }),
137
+ imageDescription: PropTypes.string,
144
138
  /**
145
139
  * When passing the name prop, either send the initials to be used or the user's full name. The first two capital letters of the user's name will be used as the name.
146
140
  */
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { devtoolsAttribute, getDevtoolsId } from '../package-settings.js';
8
+ import { getDevtoolsId, devtoolsAttribute } from '../package-settings.js';
9
9
 
10
10
  function getDevtoolsProps(componentName) {
11
11
  return {
@@ -29,30 +29,10 @@ function rem(px) {
29
29
  // Initial map of our breakpoints and their values
30
30
  var breakpoints = {
31
31
  sm: {
32
- width: rem(320),
33
- columns: 4,
34
- margin: '0'
35
- },
32
+ width: rem(320)},
36
33
  md: {
37
- width: rem(672),
38
- columns: 8,
39
- margin: rem(16)
40
- },
34
+ width: rem(672)},
41
35
  lg: {
42
- width: rem(1056),
43
- columns: 16,
44
- margin: rem(16)
45
- },
46
- xlg: {
47
- width: rem(1312),
48
- columns: 16,
49
- margin: rem(16)
50
- },
51
- max: {
52
- width: rem(1584),
53
- columns: 16,
54
- margin: rem(24)
55
- }
56
- };
36
+ width: rem(1056)}};
57
37
 
58
38
  export { baseFontSize, breakpoints, rem };
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- import React, { type ElementType, type Ref } from 'react';
8
+ import { type ElementType, type WeakValidationMap, type Ref } from 'react';
9
9
  import { type PolymorphicProps } from '../types/common';
10
10
  type LinkBaseProps<E extends ElementType> = {
11
11
  /**
@@ -21,9 +21,9 @@ export type LinkProps<E extends ElementType> = PolymorphicProps<E, LinkBaseProps
21
21
  * in their own components to support use-cases like `react-router` or
22
22
  * `@reach/router`
23
23
  */
24
- declare const Link: (<E extends React.ElementType = "a">(props: LinkProps<E>) => JSX.Element) & {
25
- displayName?: string | undefined;
26
- propTypes?: React.WeakValidationMap<LinkProps<any>> | undefined;
24
+ declare const Link: (<E extends ElementType = "a">(props: LinkProps<E>) => JSX.Element) & {
25
+ displayName?: string;
26
+ propTypes?: WeakValidationMap<LinkProps<any>>;
27
27
  };
28
28
  declare const LinkPropTypes: {
29
29
  /**
@@ -27,5 +27,5 @@ export type GlobalEventCallback<E extends keyof GlobalEventHandlersEventMap> = (
27
27
  /**
28
28
  * <T>
29
29
  */
30
- export type MutableRefObject<T> = import('react').MutableRefObject<T>;
30
+ export type MutableRefObject<T> = import("react").MutableRefObject<T>;
31
31
  export type WindowEventCallback<E extends keyof WindowEventMap> = (event: WindowEventMap[E]) => void;
@@ -4,7 +4,7 @@
4
4
  * @param {string} [prefix] the optional prefix id
5
5
  * @returns {string}
6
6
  */
7
- export function useCompatibleId(prefix?: string | undefined): string;
7
+ export function useCompatibleId(prefix?: string): string;
8
8
  /**
9
9
  * Generate a unique id if a given `id` is not provided
10
10
  * This is an internal utility, not intended for public usage.
@@ -18,4 +18,4 @@ export function useFallbackId(id: string | undefined): string;
18
18
  * @param {string} [prefix] the optional prefix id
19
19
  * @returns {string}
20
20
  */
21
- export function useId(prefix?: string | undefined): string;
21
+ export function useId(prefix?: string): string;
@@ -15,7 +15,6 @@ var devtools = require('../../global/js/utils/devtools.js');
15
15
  var settings = require('../../settings.js');
16
16
  var react = require('@carbon/react');
17
17
  var icons = require('@carbon/react/icons');
18
- require('../../global/js/utils/props-helper.js');
19
18
  var TooltipTrigger = require('../TooltipTrigger/TooltipTrigger.js');
20
19
 
21
20
  // Carbon and package components we use.
@@ -137,12 +136,7 @@ exports.UserAvatar.propTypes = {
137
136
  * When passing the image prop use the imageDescription prop to describe the image for screen reader.
138
137
  */
139
138
  /**@ts-ignore */
140
- imageDescription: index.default.string.isRequired.if(_ref => {
141
- let {
142
- image
143
- } = _ref;
144
- return !!image;
145
- }),
139
+ imageDescription: index.default.string,
146
140
  /**
147
141
  * When passing the name prop, either send the initials to be used or the user's full name. The first two capital letters of the user's name will be used as the name.
148
142
  */
@@ -31,31 +31,11 @@ function rem(px) {
31
31
  // Initial map of our breakpoints and their values
32
32
  var breakpoints = {
33
33
  sm: {
34
- width: rem(320),
35
- columns: 4,
36
- margin: '0'
37
- },
34
+ width: rem(320)},
38
35
  md: {
39
- width: rem(672),
40
- columns: 8,
41
- margin: rem(16)
42
- },
36
+ width: rem(672)},
43
37
  lg: {
44
- width: rem(1056),
45
- columns: 16,
46
- margin: rem(16)
47
- },
48
- xlg: {
49
- width: rem(1312),
50
- columns: 16,
51
- margin: rem(16)
52
- },
53
- max: {
54
- width: rem(1584),
55
- columns: 16,
56
- margin: rem(24)
57
- }
58
- };
38
+ width: rem(1056)}};
59
39
 
60
40
  exports.baseFontSize = baseFontSize;
61
41
  exports.breakpoints = breakpoints;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon-labs/react-ui-shell",
3
- "version": "0.80.0",
3
+ "version": "0.81.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -42,5 +42,5 @@
42
42
  "dependencies": {
43
43
  "@ibm/telemetry-js": "^1.10.2"
44
44
  },
45
- "gitHead": "b40ae3cdabef52e30ed4e74819325ca5c0e36877"
45
+ "gitHead": "d0f49a8c73733aa2a17bfbbbd90f8c7a62f8aa5a"
46
46
  }
@@ -10,6 +10,7 @@
10
10
  @use '@carbon/styles/scss/motion' as *;
11
11
  @use '@carbon/react/scss/utilities/convert' as convert;
12
12
  @use '@carbon/styles/scss/utilities/custom-property' as custom-property;
13
+ @use '@carbon/styles/scss/breakpoint' as *;
13
14
 
14
15
  $prefix: 'cds' !default;
15
16
 
@@ -79,3 +80,14 @@ $prefix: 'cds' !default;
79
80
  ):hover {
80
81
  color: $text-primary;
81
82
  }
83
+
84
+ //----------------------------------------------------------------------------
85
+ // Search expanded inside Header
86
+ //----------------------------------------------------------------------------
87
+ @include breakpoint-down(lg) {
88
+ .#{$prefix}--header .#{$prefix}--search--expanded {
89
+ position: absolute;
90
+ z-index: 1;
91
+ inset-inline-start: 0;
92
+ }
93
+ }
@@ -1,46 +0,0 @@
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 'react';
9
- import PropTypes from '../../../_virtual/index.js';
10
- import pconsole from './pconsole.js';
11
-
12
- /**
13
- * A prop-types validation function that takes a type checkers and a condition
14
- * function and invokes either the type checker or the isRequired variant of
15
- * the type checker according to whether the condition function returns false
16
- * or true when called with the full set of props. This can be useful to make
17
- * a prop conditionally required. The function also has a decorate function
18
- * which can be used to add isRequiredIf to any existing type which already has
19
- * an isRequired variant, and this is automatically applied to the simple type
20
- * checkers in PropTypes when this props-helper module is imported. The second
21
- * example produces better results with DocGen and Storybook.
22
- *
23
- * Examples:
24
- *
25
- * MyComponent1.propTypes = {
26
- * showFoo: PropTypes.bool,
27
- * fooLabel: isRequiredIf(PropTypes.string, ({ showFoo }) => showFoo),
28
- * }
29
- *
30
- * MyComponent2.propTypes = {
31
- * showBar: PropTypes.bool,
32
- * barLabel: PropTypes.string.isRequired.if(({ showBar }) => showBar),
33
- * }
34
- *
35
- */
36
- const isRequiredIf = (checker, conditionFn) => (props, propName, componentName, location, propFullName, secret) => (conditionFn(props) ? checker.isRequired : checker)(props, propName, componentName, location, propFullName, secret);
37
- isRequiredIf.decorate = checker => {
38
- checker.isRequired.if = pconsole.isProduction ? pconsole.noop : isRequiredIf.bind(null, checker);
39
- };
40
- for (const checker in PropTypes) {
41
- if (PropTypes[checker].isRequired) {
42
- isRequiredIf.decorate(PropTypes[checker]);
43
- }
44
- }
45
-
46
- export { isRequiredIf };
@@ -1,48 +0,0 @@
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
- require('react');
11
- var index = require('../../../_virtual/index.js');
12
- var pconsole = require('./pconsole.js');
13
-
14
- /**
15
- * A prop-types validation function that takes a type checkers and a condition
16
- * function and invokes either the type checker or the isRequired variant of
17
- * the type checker according to whether the condition function returns false
18
- * or true when called with the full set of props. This can be useful to make
19
- * a prop conditionally required. The function also has a decorate function
20
- * which can be used to add isRequiredIf to any existing type which already has
21
- * an isRequired variant, and this is automatically applied to the simple type
22
- * checkers in PropTypes when this props-helper module is imported. The second
23
- * example produces better results with DocGen and Storybook.
24
- *
25
- * Examples:
26
- *
27
- * MyComponent1.propTypes = {
28
- * showFoo: PropTypes.bool,
29
- * fooLabel: isRequiredIf(PropTypes.string, ({ showFoo }) => showFoo),
30
- * }
31
- *
32
- * MyComponent2.propTypes = {
33
- * showBar: PropTypes.bool,
34
- * barLabel: PropTypes.string.isRequired.if(({ showBar }) => showBar),
35
- * }
36
- *
37
- */
38
- const isRequiredIf = (checker, conditionFn) => (props, propName, componentName, location, propFullName, secret) => (conditionFn(props) ? checker.isRequired : checker)(props, propName, componentName, location, propFullName, secret);
39
- isRequiredIf.decorate = checker => {
40
- checker.isRequired.if = pconsole.default.isProduction ? pconsole.default.noop : isRequiredIf.bind(null, checker);
41
- };
42
- for (const checker in index.default) {
43
- if (index.default[checker].isRequired) {
44
- isRequiredIf.decorate(index.default[checker]);
45
- }
46
- }
47
-
48
- exports.isRequiredIf = isRequiredIf;