@carbon-labs/react-ui-shell 0.86.0 → 0.88.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/HeaderContainer.js +2 -2
- package/es/components/HeaderDivider.js +2 -2
- package/es/components/HeaderOverflowPanel.js +5 -5
- package/es/components/HeaderPopover.js +6 -6
- package/es/components/Link.js +2 -2
- package/es/components/Profile.js +17 -17
- package/es/components/SharkFinIcon.js +6 -6
- package/es/components/SideNav.js +10 -10
- package/es/components/SideNavFlyoutMenu.js +9 -9
- package/es/components/SideNavItems.js +5 -5
- package/es/components/SideNavLink.js +7 -7
- package/es/components/SideNavLinkPopover.js +2 -2
- package/es/components/SideNavMenu.js +24 -24
- package/es/components/SideNavMenuItem.js +7 -7
- package/es/components/SideNavSlot.js +4 -4
- package/es/components/SideNavTitle.js +3 -3
- package/es/components/SideNavToggle.js +7 -7
- package/es/components/TrialCountdown.js +3 -3
- package/es/internal/useId.js +2 -2
- package/es/internal/useIdPrefix.js +3 -3
- package/es/internal/usePrefix.js +3 -3
- package/lib/components/HeaderContainer.js +10 -10
- package/lib/components/HeaderDivider.js +2 -2
- package/lib/components/HeaderOverflowPanel.js +5 -5
- package/lib/components/HeaderPopover.js +9 -9
- package/lib/components/Link.js +3 -3
- package/lib/components/Profile.js +17 -17
- package/lib/components/SharkFinIcon.js +6 -6
- package/lib/components/SideNav.js +23 -23
- package/lib/components/SideNavFlyoutMenu.js +22 -22
- package/lib/components/SideNavItems.js +8 -8
- package/lib/components/SideNavLink.js +9 -9
- package/lib/components/SideNavLinkPopover.js +2 -2
- package/lib/components/SideNavMenu.js +42 -42
- package/lib/components/SideNavMenuItem.js +8 -8
- package/lib/components/SideNavSlot.js +4 -4
- package/lib/components/SideNavTitle.js +3 -3
- package/lib/components/SideNavToggle.js +9 -9
- package/lib/components/TrialCountdown.js +3 -3
- package/lib/es/components/HeaderContainer.d.ts +2 -2
- package/lib/es/components/HeaderDivider.d.ts +2 -2
- package/lib/es/components/HeaderOverflowPanel.d.ts +2 -2
- package/lib/es/components/HeaderPopover.d.ts +4 -4
- package/lib/es/components/Link.d.ts +3 -3
- package/lib/es/components/Profile.d.ts +7 -7
- package/lib/es/components/SharkFinIcon.d.ts +2 -2
- package/lib/es/components/SideNav.d.ts +4 -4
- package/lib/es/components/SideNavFlyoutMenu.d.ts +2 -2
- package/lib/es/components/SideNavItems.d.ts +2 -2
- package/lib/es/components/SideNavLink.d.ts +2 -2
- package/lib/es/components/SideNavLinkPopover.d.ts +2 -2
- package/lib/es/components/SideNavMenu.d.ts +2 -2
- package/lib/es/components/SideNavMenuItem.d.ts +2 -2
- package/lib/es/components/SideNavSlot.d.ts +2 -2
- package/lib/es/components/SideNavTitle.d.ts +3 -3
- package/lib/es/components/SideNavToggle.d.ts +2 -2
- package/lib/es/components/TrialCountdown.d.ts +2 -2
- package/lib/es/internal/useIdPrefix.d.ts +2 -2
- package/lib/es/internal/usePrefix.d.ts +2 -2
- package/lib/internal/useDelayedState.js +5 -5
- package/lib/internal/useEvent.js +4 -4
- package/lib/internal/useId.js +5 -5
- package/lib/internal/useIdPrefix.js +3 -3
- package/lib/internal/useMatchMedia.js +3 -3
- package/lib/internal/useMergedRefs.js +2 -2
- package/lib/internal/usePrefix.js +3 -3
- package/package.json +4 -6
- package/scss/styles/_header-divider.scss +1 -0
- package/scss/styles/_header.scss +13 -1
- package/scss/styles/_profile.scss +4 -1
- package/LICENSE +0 -201
- package/es/node_modules/@carbon/ibm-products/es/_virtual/_commonjsHelpers.js +0 -12
- package/es/node_modules/@carbon/ibm-products/es/_virtual/_rollupPluginBabelHelpers.js +0 -18
- package/es/node_modules/@carbon/ibm-products/es/_virtual/index.js +0 -14
- package/es/node_modules/@carbon/ibm-products/es/_virtual/index2.js +0 -12
- package/es/node_modules/@carbon/ibm-products/es/components/TooltipTrigger/TooltipTrigger.js +0 -62
- package/es/node_modules/@carbon/ibm-products/es/components/UserAvatar/UserAvatar.js +0 -161
- package/es/node_modules/@carbon/ibm-products/es/components/_Canary/Canary.js +0 -49
- package/es/node_modules/@carbon/ibm-products/es/global/js/package-settings.js +0 -246
- package/es/node_modules/@carbon/ibm-products/es/global/js/utils/devtools.js +0 -16
- package/es/node_modules/@carbon/ibm-products/es/global/js/utils/pconsole.js +0 -35
- package/es/node_modules/@carbon/ibm-products/es/node_modules/object-assign/index.js +0 -89
- package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/checkPropTypes.js +0 -95
- package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/factoryWithThrowingShims.js +0 -64
- package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/factoryWithTypeCheckers.js +0 -561
- package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/index.js +0 -32
- package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -18
- package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/lib/has.js +0 -17
- package/es/node_modules/@carbon/ibm-products/es/settings.js +0 -84
- package/lib/node_modules/@carbon/ibm-products/es/_virtual/_commonjsHelpers.js +0 -14
- package/lib/node_modules/@carbon/ibm-products/es/_virtual/_rollupPluginBabelHelpers.js +0 -20
- package/lib/node_modules/@carbon/ibm-products/es/_virtual/index.js +0 -19
- package/lib/node_modules/@carbon/ibm-products/es/_virtual/index2.js +0 -14
- package/lib/node_modules/@carbon/ibm-products/es/components/TooltipTrigger/TooltipTrigger.js +0 -64
- package/lib/node_modules/@carbon/ibm-products/es/components/UserAvatar/UserAvatar.js +0 -163
- package/lib/node_modules/@carbon/ibm-products/es/components/_Canary/Canary.js +0 -51
- package/lib/node_modules/@carbon/ibm-products/es/global/js/package-settings.js +0 -252
- package/lib/node_modules/@carbon/ibm-products/es/global/js/utils/devtools.js +0 -20
- package/lib/node_modules/@carbon/ibm-products/es/global/js/utils/pconsole.js +0 -45
- package/lib/node_modules/@carbon/ibm-products/es/node_modules/object-assign/index.js +0 -91
- package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/checkPropTypes.js +0 -97
- package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/factoryWithThrowingShims.js +0 -66
- package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/factoryWithTypeCheckers.js +0 -563
- package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/index.js +0 -34
- package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -20
- package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/lib/has.js +0 -19
- package/lib/node_modules/@carbon/ibm-products/es/settings.js +0 -86
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var React = require('react');
|
|
11
11
|
|
|
12
12
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
13
13
|
/**
|
|
@@ -17,7 +17,7 @@ var React__default = require('react');
|
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
const PrefixContext = /*#__PURE__*/
|
|
20
|
+
const PrefixContext = /*#__PURE__*/React.createContext('cds');
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* An internal function to return the prefix used in components and styles.
|
|
@@ -25,7 +25,7 @@ const PrefixContext = /*#__PURE__*/React__default.createContext('cds');
|
|
|
25
25
|
* @returns a react context including the prefix
|
|
26
26
|
*/
|
|
27
27
|
function usePrefix() {
|
|
28
|
-
return
|
|
28
|
+
return React.useContext(PrefixContext);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
exports.PrefixContext = PrefixContext;
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon-labs/react-ui-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.0",
|
|
4
4
|
"publishConfig": {
|
|
5
|
-
"access": "public"
|
|
6
|
-
"provenance": true
|
|
5
|
+
"access": "public"
|
|
7
6
|
},
|
|
8
7
|
"type": "module",
|
|
9
8
|
"description": "Carbon Labs - Ui Shell",
|
|
@@ -36,11 +35,10 @@
|
|
|
36
35
|
"telemetry:config": "npx -y @ibm/telemetry-js-config-generator generate --id 5b9dce15-eeda-4b53-8683-3e3aeb599fd1 --endpoint https://www-api.ibm.com/ibm-telemetry/v1/metrics --files ./components/**/*.(tsx|js|jsx)"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@carbon-labs/utilities": "
|
|
38
|
+
"@carbon-labs/utilities": "0.20.0",
|
|
40
39
|
"@carbon/ibm-products": "^2.76.0"
|
|
41
40
|
},
|
|
42
41
|
"dependencies": {
|
|
43
42
|
"@ibm/telemetry-js": "^1.10.2"
|
|
44
|
-
}
|
|
45
|
-
"gitHead": "3624115c249ad05d1717bfdbba6a64ad5ccae2d8"
|
|
43
|
+
}
|
|
46
44
|
}
|
package/scss/styles/_header.scss
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
@use '@carbon/react/scss/motion' as *;
|
|
11
11
|
@use '@carbon/react/scss/utilities/convert' as convert;
|
|
12
12
|
@use '@carbon/react/scss/utilities/custom-property' as custom-property;
|
|
13
|
+
@use '@carbon/react/scss/utilities/z-index' as *;
|
|
13
14
|
@use '@carbon/react/scss/breakpoint' as *;
|
|
14
15
|
|
|
15
16
|
$prefix: 'cds' !default;
|
|
@@ -48,7 +49,18 @@ $prefix: 'cds' !default;
|
|
|
48
49
|
|
|
49
50
|
.#{$prefix}--header-action.#{$prefix}--popover--open
|
|
50
51
|
.#{$prefix}--header-action__button {
|
|
51
|
-
|
|
52
|
+
z-index: z('header') + 2;
|
|
53
|
+
background-color: $background;
|
|
54
|
+
border-inline-end: 1px solid $border-subtle;
|
|
55
|
+
border-inline-start: 1px solid $border-subtle;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.#{$prefix}--header-action.#{$prefix}--popover--border
|
|
59
|
+
> .#{$prefix}--popover
|
|
60
|
+
> .#{$prefix}--popover-content {
|
|
61
|
+
border: 1px solid $border-subtle;
|
|
62
|
+
border-block-start: none;
|
|
63
|
+
outline: none;
|
|
52
64
|
}
|
|
53
65
|
|
|
54
66
|
.#{$prefix}--popover--border.#{$prefix}--header-action
|
|
@@ -32,7 +32,10 @@ $prefix: 'cds' !default;
|
|
|
32
32
|
.clabs--theme-settings {
|
|
33
33
|
padding: $spacing-05;
|
|
34
34
|
border-block-end: convert.to-rem(0.5px) solid $border-subtle;
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
&:not(:first-child) {
|
|
37
|
+
border-block-start: convert.to-rem(0.5px) solid $border-subtle;
|
|
38
|
+
}
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2023 IBM Corp.
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
@@ -1,12 +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
|
-
function getDefaultExportFromCjs(x) {
|
|
9
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { getDefaultExportFromCjs };
|
|
@@ -1,18 +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
|
-
function _extends() {
|
|
9
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
10
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
11
|
-
var t = arguments[e];
|
|
12
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
13
|
-
}
|
|
14
|
-
return n;
|
|
15
|
-
}, _extends.apply(null, arguments);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { _extends as extends };
|
|
@@ -1,14 +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 { getDefaultExportFromCjs } from './_commonjsHelpers.js';
|
|
9
|
-
import { __require as requirePropTypes } from '../node_modules/prop-types/index.js';
|
|
10
|
-
|
|
11
|
-
var propTypesExports = /*@__PURE__*/requirePropTypes();
|
|
12
|
-
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
13
|
-
|
|
14
|
-
export { PropTypes as default, propTypesExports as p };
|
|
@@ -1,12 +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
|
-
var propTypes = {
|
|
9
|
-
exports: {}
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { propTypes as __module };
|
|
@@ -1,62 +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 { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import React__default from 'react';
|
|
10
|
-
import PropTypes from '../../_virtual/index.js';
|
|
11
|
-
import cx from 'classnames';
|
|
12
|
-
import { pkg } from '../../settings.js';
|
|
13
|
-
|
|
14
|
-
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
15
|
-
const blockClass = `${pkg.prefix}--tooltip-trigger`;
|
|
16
|
-
const componentName = 'TooltipTrigger';
|
|
17
|
-
|
|
18
|
-
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* This is an tooltip trigger as Carbon Tooltip requires an active element to work but provides
|
|
22
|
-
* no blanked button.
|
|
23
|
-
*/
|
|
24
|
-
const TooltipTrigger = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
25
|
-
let {
|
|
26
|
-
children,
|
|
27
|
-
className,
|
|
28
|
-
// Collect any other property values passed in.
|
|
29
|
-
...rest
|
|
30
|
-
} = _ref;
|
|
31
|
-
return /*#__PURE__*/React__default.createElement("button", _extends({
|
|
32
|
-
type: "button",
|
|
33
|
-
ref: ref
|
|
34
|
-
}, rest, {
|
|
35
|
-
className: cx(blockClass,
|
|
36
|
-
// Apply the block class to the main HTML element
|
|
37
|
-
className // Apply any supplied class names to the main HTML element.
|
|
38
|
-
)
|
|
39
|
-
}), children);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// Return a placeholder if not released and not enabled by feature flag.
|
|
43
|
-
|
|
44
|
-
// The display name of the component, used by React. Note that displayName
|
|
45
|
-
// is used in preference to relying on function.name.
|
|
46
|
-
TooltipTrigger.displayName = componentName;
|
|
47
|
-
|
|
48
|
-
// The types and DocGen commentary for the component props,
|
|
49
|
-
// in alphabetical order (for consistency).
|
|
50
|
-
// See https://www.npmjs.com/package/prop-types#usage.
|
|
51
|
-
TooltipTrigger.propTypes = {
|
|
52
|
-
/**
|
|
53
|
-
* Child content of tooltip trigger
|
|
54
|
-
*/
|
|
55
|
-
children: PropTypes.node,
|
|
56
|
-
/**
|
|
57
|
-
* Provide an optional class to be applied to the containing node.
|
|
58
|
-
*/
|
|
59
|
-
className: PropTypes.string
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export { TooltipTrigger };
|
|
@@ -1,161 +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 { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import React__default from 'react';
|
|
10
|
-
import PropTypes from '../../_virtual/index.js';
|
|
11
|
-
import cx from 'classnames';
|
|
12
|
-
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
|
13
|
-
import { pkg } from '../../settings.js';
|
|
14
|
-
import { usePrefix, Tooltip } from '@carbon/react';
|
|
15
|
-
import { User } from '@carbon/react/icons';
|
|
16
|
-
import { TooltipTrigger } from '../TooltipTrigger/TooltipTrigger.js';
|
|
17
|
-
|
|
18
|
-
// Carbon and package components we use.
|
|
19
|
-
/* TODO: @import(s) of carbon components and other package components. */
|
|
20
|
-
|
|
21
|
-
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
22
|
-
const blockClass = `${pkg.prefix}--user-avatar`;
|
|
23
|
-
const componentName = 'UserAvatar';
|
|
24
|
-
|
|
25
|
-
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* TODO: A description of the component.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
const UserAvatar = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
32
|
-
const {
|
|
33
|
-
backgroundColor = 'order-1-cyan',
|
|
34
|
-
className,
|
|
35
|
-
image,
|
|
36
|
-
imageDescription,
|
|
37
|
-
name,
|
|
38
|
-
/* TODO: add other props for UserAvatar, with default values if needed */
|
|
39
|
-
renderIcon: RenderIcon,
|
|
40
|
-
size = 'md',
|
|
41
|
-
tooltipText,
|
|
42
|
-
tooltipAlignment = 'bottom',
|
|
43
|
-
...rest
|
|
44
|
-
} = props;
|
|
45
|
-
const carbonPrefix = usePrefix();
|
|
46
|
-
const iconSize = {
|
|
47
|
-
sm: 16,
|
|
48
|
-
md: 20,
|
|
49
|
-
lg: 24,
|
|
50
|
-
xl: 32
|
|
51
|
-
};
|
|
52
|
-
const formatInitials = () => {
|
|
53
|
-
const parts = name?.split(' ') || [];
|
|
54
|
-
const firstChar = parts[0].charAt(0).toUpperCase();
|
|
55
|
-
const secondChar = parts[0].charAt(1).toUpperCase();
|
|
56
|
-
if (parts.length === 1) {
|
|
57
|
-
return firstChar + secondChar;
|
|
58
|
-
}
|
|
59
|
-
const lastChar = parts[parts.length - 1].charAt(0).toUpperCase();
|
|
60
|
-
const initials = [firstChar];
|
|
61
|
-
if (lastChar) {
|
|
62
|
-
initials.push(lastChar);
|
|
63
|
-
}
|
|
64
|
-
return ''.concat(...initials);
|
|
65
|
-
};
|
|
66
|
-
const getItem = () => {
|
|
67
|
-
const iconProps = {
|
|
68
|
-
size: iconSize[size]
|
|
69
|
-
};
|
|
70
|
-
if (image) {
|
|
71
|
-
return /*#__PURE__*/React__default.createElement("img", {
|
|
72
|
-
alt: imageDescription,
|
|
73
|
-
src: image,
|
|
74
|
-
className: `${blockClass}__photo ${blockClass}__photo--${size}`
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
if (RenderIcon) {
|
|
78
|
-
return /*#__PURE__*/React__default.createElement(RenderIcon, iconProps);
|
|
79
|
-
}
|
|
80
|
-
if (name) {
|
|
81
|
-
return formatInitials();
|
|
82
|
-
}
|
|
83
|
-
return /*#__PURE__*/React__default.createElement(User, iconProps);
|
|
84
|
-
};
|
|
85
|
-
const Avatar = () => /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
86
|
-
className: cx(blockClass,
|
|
87
|
-
// Apply the block class to the main HTML element
|
|
88
|
-
className,
|
|
89
|
-
// Apply any supplied class names to the main HTML element.
|
|
90
|
-
`${blockClass}--${backgroundColor}`, `${blockClass}--${size}`,
|
|
91
|
-
// example: `${blockClass}__template-string-class-${kind}-n-${size}`,
|
|
92
|
-
{
|
|
93
|
-
// switched classes dependant on props or state
|
|
94
|
-
// example: [`${blockClass}__here-if-small`]: size === 'sm',
|
|
95
|
-
}),
|
|
96
|
-
ref: ref
|
|
97
|
-
}, getDevtoolsProps(componentName)), getItem());
|
|
98
|
-
if (tooltipText) {
|
|
99
|
-
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
100
|
-
align: tooltipAlignment,
|
|
101
|
-
label: tooltipText,
|
|
102
|
-
className: `${blockClass}__tooltip ${carbonPrefix}--icon-tooltip`
|
|
103
|
-
}, /*#__PURE__*/React__default.createElement(TooltipTrigger, null, /*#__PURE__*/React__default.createElement(Avatar, null)));
|
|
104
|
-
}
|
|
105
|
-
return /*#__PURE__*/React__default.createElement(Avatar, null);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// Return a placeholder if not released and not enabled by feature flag
|
|
109
|
-
|
|
110
|
-
// The display name of the component, used by React. Note that displayName
|
|
111
|
-
// is used in preference to relying on function.name.
|
|
112
|
-
UserAvatar.displayName = componentName;
|
|
113
|
-
|
|
114
|
-
// The types and DocGen commentary for the component props,
|
|
115
|
-
// in alphabetical order (for consistency).
|
|
116
|
-
// See https://www.npmjs.com/package/prop-types#usage.
|
|
117
|
-
UserAvatar.propTypes = {
|
|
118
|
-
/**
|
|
119
|
-
* Provide the background color need to be set for UserAvatar. Background color will be set based on lighter or darker theme.
|
|
120
|
-
* For example: if you select order-5-purple, it will take $purple-60 for lighter theme and $purple-50 for darker theme.
|
|
121
|
-
*/
|
|
122
|
-
backgroundColor: PropTypes.oneOf(['order-1-cyan', 'order-2-gray', 'order-3-green', 'order-4-magenta', 'order-5-purple', 'order-6-teal', 'order-7-cyan', 'order-8-gray', 'order-9-green', 'order-10-magenta', 'order-11-purple', 'order-12-teal']),
|
|
123
|
-
/**
|
|
124
|
-
* Provide an optional class to be applied to the containing node.
|
|
125
|
-
*/
|
|
126
|
-
className: PropTypes.string,
|
|
127
|
-
/**
|
|
128
|
-
* When passing the image prop, supply a full path to the image to be displayed.
|
|
129
|
-
*/
|
|
130
|
-
/**@ts-ignore */
|
|
131
|
-
image: PropTypes.string,
|
|
132
|
-
/**
|
|
133
|
-
* When passing the image prop use the imageDescription prop to describe the image for screen reader.
|
|
134
|
-
*/
|
|
135
|
-
/**@ts-ignore */
|
|
136
|
-
imageDescription: PropTypes.string,
|
|
137
|
-
/**
|
|
138
|
-
* 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.
|
|
139
|
-
*/
|
|
140
|
-
name: PropTypes.string,
|
|
141
|
-
/**
|
|
142
|
-
* Provide a custom icon to use if you need to use an icon other than the default one
|
|
143
|
-
*/
|
|
144
|
-
/**@ts-ignore */
|
|
145
|
-
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),
|
|
146
|
-
/**
|
|
147
|
-
* Set the size of the avatar circle
|
|
148
|
-
*/
|
|
149
|
-
size: PropTypes.oneOf(['xl', 'lg', 'md', 'sm']),
|
|
150
|
-
/**
|
|
151
|
-
* Specify how the trigger should align with the tooltip
|
|
152
|
-
*/
|
|
153
|
-
tooltipAlignment: PropTypes.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
|
|
154
|
-
/**
|
|
155
|
-
* Pass in the display name to have it shown on hover
|
|
156
|
-
*/
|
|
157
|
-
tooltipText: PropTypes.string
|
|
158
|
-
/* TODO: add types and DocGen for all props. */
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export { UserAvatar };
|
|
@@ -1,49 +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 { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import React__default from 'react';
|
|
10
|
-
import PropTypes from '../../_virtual/index.js';
|
|
11
|
-
import cx from 'classnames';
|
|
12
|
-
import pkg from '../../global/js/package-settings.js';
|
|
13
|
-
import { CodeSnippet } from '@carbon/react';
|
|
14
|
-
|
|
15
|
-
var _p, _br, _p2, _br2, _p3;
|
|
16
|
-
|
|
17
|
-
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
18
|
-
const blockClass = `${pkg.prefix}--canary`;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Canary component used when the component requested is not yet production
|
|
22
|
-
*/
|
|
23
|
-
const Canary = (_ref /*, originalArgs*/) => {
|
|
24
|
-
let {
|
|
25
|
-
className,
|
|
26
|
-
componentName,
|
|
27
|
-
...rest
|
|
28
|
-
} = _ref;
|
|
29
|
-
const instructions = `
|
|
30
|
-
import { pkg } from '@carbon/ibm-products';
|
|
31
|
-
// NOTE: must happen before component is first used
|
|
32
|
-
pkg.component.${componentName} = true;
|
|
33
|
-
`;
|
|
34
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
35
|
-
className: cx(blockClass, className)
|
|
36
|
-
}), /*#__PURE__*/React__default.createElement("h2", null, "This component ", /*#__PURE__*/React__default.createElement("strong", null, componentName), " is not ready yet."), _p || (_p = /*#__PURE__*/React__default.createElement("p", null, "To enable it, initialize package flags before the component is first used.")), _br || (_br = /*#__PURE__*/React__default.createElement("br", null)), _p2 || (_p2 = /*#__PURE__*/React__default.createElement("p", null, "e.g. in main.js")), /*#__PURE__*/React__default.createElement(CodeSnippet, {
|
|
37
|
-
type: "multi"
|
|
38
|
-
}, instructions), _br2 || (_br2 = /*#__PURE__*/React__default.createElement("br", null)), _p3 || (_p3 = /*#__PURE__*/React__default.createElement("p", null, "View a live example on", ' ', /*#__PURE__*/React__default.createElement("a", {
|
|
39
|
-
href: "https://codesandbox.io/s/example-component-olif5?file=/src/config.js"
|
|
40
|
-
}, "codesandbox"), ".")));
|
|
41
|
-
};
|
|
42
|
-
Canary.propTypes = {
|
|
43
|
-
/** Provide an optional class to be applied to the containing node */
|
|
44
|
-
className: PropTypes.string,
|
|
45
|
-
/** Name of the component that is not ready yet */
|
|
46
|
-
componentName: PropTypes.string.isRequired
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export { Canary };
|