@companycam/slab-web 1.16.2-beta.6 → 1.16.2-beta.7
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/index.js +2 -2
- package/index.mjs +47 -39
- package/lib/Toast/Toast.d.ts +9 -7
- package/lib/shared/types.d.ts +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2349,7 +2349,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2349
2349
|
position: relative;
|
|
2350
2350
|
padding: var(--cc_size_spacing_m);
|
|
2351
2351
|
display: flex;
|
|
2352
|
-
align-items: ${e=>e.$
|
|
2352
|
+
align-items: ${e=>e.$hasAction||e.$hasTitle?"start":"center"};
|
|
2353
2353
|
gap: var(--cc_size_spacing_m);
|
|
2354
2354
|
background: var(--cc_color_background_3);
|
|
2355
2355
|
border-radius: var(--cc_size_border_radius_l);
|
|
@@ -2380,4 +2380,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2380
2380
|
top: 6px; /* magic number to account for icon padding */
|
|
2381
2381
|
right: 6px;
|
|
2382
2382
|
display: block;
|
|
2383
|
-
`;function mT({action:e,closeAction:n,color:t=xn.success,iconName:r="",message:i,title:o,testId:a}){var c,d;return E.jsx(cT,{"data-testId":a,children:E.jsxs(uT,{$
|
|
2383
|
+
`;function mT({action:e,closeAction:n,color:t=xn.success,iconName:r="",message:i,title:o,testId:a}){var c,d;return E.jsx(cT,{"data-testId":a,children:E.jsxs(uT,{$hasAction:!!e,$hasTitle:!!o,className:"dark-environment",children:[E.jsx(fT,{color:t,children:E.jsx(pT,{color:t,className:`mdi mdi-${oT(r,t)}`})}),E.jsxs(dT,{children:[o?E.jsx(Mt,{as:"h4",family:"heading",size:"m",weight:600,children:o}):null,E.jsx(Mt,{as:"p",children:i}),e?E.jsx(hT,{...e,"data-testid":e["data-testid"],color:"secondary",design:"outline",size:"small",icon:{name:(c=e.icon)==null?void 0:c.name,position:(d=e.icon)==null?void 0:d.position},children:e.label}):null]}),n?E.jsx(gT,{...n,"data-testid":n["data-testid"],accessibilityLabel:n.accessibilityLabel,iconName:"close",color:"subtle"}):null]})})}exports.AssetThumbnail=u0;exports.Avatar=ka;exports.AvatarGroup=t1;exports.Badge=a1;exports.Billboard=Qp;exports.Button=ui;exports.ButtonCondensed=Wc;exports.ButtonFilter=F1;exports.ButtonIcon=Ea;exports.ButtonIconCondensed=zi;exports.Card=q1;exports.ChipFilter=J1;exports.ChipToggle=tw;exports.Comment=ow;exports.Drawer=fw;exports.Fieldset=dh;exports.Grid=mw;exports.HorizontalRule=_w;exports.InputCheckbox=uh;exports.InputCheckboxGroup=Mw;exports.InputDate=wC;exports.InputFile=DC;exports.InputPassword=FC;exports.InputRadio=Bh;exports.InputRadioGroup=NC;exports.InputRange=BC;exports.InputSelectHTML=KC;exports.InputText=zh;exports.InputTextArea=XC;exports.Label=eE;exports.Link=nE;exports.Lottie=uE;exports.Menu=gD;exports.MenuHeading=vD;exports.MenuItem=SD;exports.Metric=ID;exports.Modal=KD;exports.ModalBase=XD;exports.Notice=cP;exports.PageHeader=mP;exports.Popover=bP;exports.ProgressBar=kP;exports.ProgressCircle=FP;exports.Rating=qP;exports.ScreenReaderContent=Lr;exports.Spinner=Ca;exports.Switch=JP;exports.Table=eT;exports.Text=Mt;exports.TimeStamp=sT;exports.Toast=mT;exports.Tooltip=Hc;
|
package/index.mjs
CHANGED
|
@@ -23608,7 +23608,7 @@ const Mn = {
|
|
|
23608
23608
|
position: relative;
|
|
23609
23609
|
padding: var(--cc_size_spacing_m);
|
|
23610
23610
|
display: flex;
|
|
23611
|
-
align-items: ${(e) => e.$
|
|
23611
|
+
align-items: ${(e) => e.$hasAction || e.$hasTitle ? "start" : "center"};
|
|
23612
23612
|
gap: var(--cc_size_spacing_m);
|
|
23613
23613
|
background: var(--cc_color_background_3);
|
|
23614
23614
|
border-radius: var(--cc_size_border_radius_l);
|
|
@@ -23650,44 +23650,52 @@ function HT({
|
|
|
23650
23650
|
testId: a
|
|
23651
23651
|
}) {
|
|
23652
23652
|
var c, d;
|
|
23653
|
-
return /* @__PURE__ */ O(KP, { "data-testId": a, children: /* @__PURE__ */ he(
|
|
23654
|
-
|
|
23655
|
-
|
|
23656
|
-
|
|
23657
|
-
|
|
23658
|
-
|
|
23659
|
-
|
|
23660
|
-
|
|
23661
|
-
|
|
23662
|
-
|
|
23663
|
-
|
|
23664
|
-
|
|
23665
|
-
|
|
23666
|
-
|
|
23667
|
-
|
|
23668
|
-
"
|
|
23669
|
-
|
|
23670
|
-
|
|
23671
|
-
|
|
23672
|
-
|
|
23673
|
-
|
|
23674
|
-
|
|
23675
|
-
|
|
23676
|
-
|
|
23677
|
-
|
|
23678
|
-
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
|
|
23683
|
-
|
|
23684
|
-
|
|
23685
|
-
|
|
23686
|
-
|
|
23687
|
-
|
|
23688
|
-
|
|
23689
|
-
|
|
23690
|
-
|
|
23653
|
+
return /* @__PURE__ */ O(KP, { "data-testId": a, children: /* @__PURE__ */ he(
|
|
23654
|
+
UP,
|
|
23655
|
+
{
|
|
23656
|
+
$hasAction: !!e,
|
|
23657
|
+
$hasTitle: !!o,
|
|
23658
|
+
className: "dark-environment",
|
|
23659
|
+
children: [
|
|
23660
|
+
/* @__PURE__ */ O(XP, { color: t, children: /* @__PURE__ */ O(
|
|
23661
|
+
ZP,
|
|
23662
|
+
{
|
|
23663
|
+
color: t,
|
|
23664
|
+
className: `mdi mdi-${jP(r, t)}`
|
|
23665
|
+
}
|
|
23666
|
+
) }),
|
|
23667
|
+
/* @__PURE__ */ he(QP, { children: [
|
|
23668
|
+
o ? /* @__PURE__ */ O(Nt, { as: "h4", family: "heading", size: "m", weight: 600, children: o }) : null,
|
|
23669
|
+
/* @__PURE__ */ O(Nt, { as: "p", children: i }),
|
|
23670
|
+
e ? /* @__PURE__ */ O(
|
|
23671
|
+
JP,
|
|
23672
|
+
{
|
|
23673
|
+
...e,
|
|
23674
|
+
"data-testid": e["data-testid"],
|
|
23675
|
+
color: "secondary",
|
|
23676
|
+
design: "outline",
|
|
23677
|
+
size: "small",
|
|
23678
|
+
icon: {
|
|
23679
|
+
name: (c = e.icon) == null ? void 0 : c.name,
|
|
23680
|
+
position: (d = e.icon) == null ? void 0 : d.position
|
|
23681
|
+
},
|
|
23682
|
+
children: e.label
|
|
23683
|
+
}
|
|
23684
|
+
) : null
|
|
23685
|
+
] }),
|
|
23686
|
+
n ? /* @__PURE__ */ O(
|
|
23687
|
+
eT,
|
|
23688
|
+
{
|
|
23689
|
+
...n,
|
|
23690
|
+
"data-testid": n["data-testid"],
|
|
23691
|
+
accessibilityLabel: n.accessibilityLabel,
|
|
23692
|
+
iconName: "close",
|
|
23693
|
+
color: "subtle"
|
|
23694
|
+
}
|
|
23695
|
+
) : null
|
|
23696
|
+
]
|
|
23697
|
+
}
|
|
23698
|
+
) });
|
|
23691
23699
|
}
|
|
23692
23700
|
export {
|
|
23693
23701
|
sT as AssetThumbnail,
|
package/lib/Toast/Toast.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps } from '../Button/Button';
|
|
3
3
|
import { ButtonIconCondensedProps } from '../ButtonIconCondensed/ButtonIconCondensed';
|
|
4
4
|
declare const ToastColor: {
|
|
@@ -8,17 +8,19 @@ declare const ToastColor: {
|
|
|
8
8
|
readonly success: "success";
|
|
9
9
|
};
|
|
10
10
|
type Color = (typeof ToastColor)[keyof typeof ToastColor];
|
|
11
|
-
type Action =
|
|
11
|
+
type Action<C extends React.ElementType> = ButtonProps<C> & {
|
|
12
12
|
label: string;
|
|
13
13
|
'data-testid'?: string;
|
|
14
|
+
children?: 'never';
|
|
14
15
|
};
|
|
15
|
-
type CloseAction =
|
|
16
|
+
type CloseAction<C extends React.ElementType> = ButtonIconCondensedProps<C> & {
|
|
16
17
|
accessibilityLabel: string;
|
|
17
18
|
'data-testid'?: string;
|
|
19
|
+
iconName?: never;
|
|
18
20
|
};
|
|
19
|
-
export type ToastProps = {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
export type ToastProps<ActionComponent extends React.ElementType = 'button', CloseActionComponent extends React.ElementType = 'button'> = {
|
|
22
|
+
action?: Action<ActionComponent>;
|
|
23
|
+
closeAction: CloseAction<CloseActionComponent>;
|
|
22
24
|
color?: Color;
|
|
23
25
|
iconName?: string;
|
|
24
26
|
message: ReactNode;
|
|
@@ -30,5 +32,5 @@ export type ToastProps = {
|
|
|
30
32
|
- If it helps the content to be understood faster, include an optional `title` prop. Use title case.
|
|
31
33
|
- The `action` prop renders a button at the end of the toast. This is typically used for an "Undo" action, but can be used for any action you want to give the user a quick option to take.
|
|
32
34
|
*/
|
|
33
|
-
export declare function Toast({ action, closeAction, color, iconName, message, title, testId, }: ToastProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function Toast<ActionComponent extends React.ElementType = 'button', CloseActionComponent extends React.ElementType = 'button'>({ action, closeAction, color, iconName, message, title, testId, }: ToastProps<ActionComponent, CloseActionComponent>): import("react/jsx-runtime").JSX.Element;
|
|
34
36
|
export default Toast;
|
package/lib/shared/types.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type BasePolymorphicComponentProps<C extends React.ElementType> = {
|
|
|
39
39
|
* size: "small" | "medium" | "large"
|
|
40
40
|
* }
|
|
41
41
|
* type BaseButtonPropKeys<C extends React.Element> = PolyMorphicComponentPropNames<C, BaseButtonProps>
|
|
42
|
-
* // BaseButtonPropKeys = "
|
|
42
|
+
* // BaseButtonPropKeys = "component" | size"
|
|
43
43
|
* ```
|
|
44
44
|
* */
|
|
45
45
|
export type PolyMorphicComponentPropNames<C extends React.ElementType, P> = keyof (BasePolymorphicComponentProps<C> & P);
|