@companycam/slab-web 1.16.2-beta.3 → 1.16.2-beta.4

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 CHANGED
@@ -576,7 +576,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[oo]+=1);const wv=W.span`
576
576
  flex-direction: column;
577
577
  gap: var(--cc_size_spacing_s);
578
578
  margin-block-start: var(--cc_size_spacing_m);
579
- `,Up=({image:e,ccMargin:n,color:t="info",iconName:r,message:i="",primaryAction:o,secondaryAction:a,title:c,...d})=>{var p,m,v,y;return E.jsxs(g1,{$ccMargin:n,...d,children:[e!=null&&e.src?E.jsx(v1,{style:e.imageContainerStyle,children:E.jsx(_1,{src:e.src,alt:e.alt})}):null,r?E.jsx(y1,{className:`mdi mdi-${r}`,$iconColor:t,"aria-hidden":"true"}):null,E.jsxs(m1,{children:[c?E.jsx(Mt,{as:"h3",family:"heading",size:"xl",weight:"800",ccMargin:"none none xs",children:c}):null,i?E.jsx(Mt,{as:"p",color:"subtle",children:i}):null]}),o||a?E.jsxs(b1,{children:[o?E.jsx(Ni,{...o,"data-testid":o["data-testid"],color:t==="destroy"?"destroy":"primary",icon:{name:(p=o.icon)==null?void 0:p.name,position:(m=o.icon)==null?void 0:m.position},children:o.label}):null,a?E.jsx(Ni,{...a,"data-testid":a["data-testid"],color:"subtle",icon:{name:(v=a.icon)==null?void 0:v.name,position:(y=a.icon)==null?void 0:y.position},children:a.label}):null]}):null]})},w1=W(Ni)`
579
+ `;function Up({image:e,ccMargin:n,color:t="info",iconName:r,message:i="",primaryAction:o,secondaryAction:a,title:c,...d}){var p,m,v,y;return E.jsxs(g1,{$ccMargin:n,...d,children:[e!=null&&e.src?E.jsx(v1,{style:e.imageContainerStyle,children:E.jsx(_1,{src:e.src,alt:e.alt})}):null,r?E.jsx(y1,{className:`mdi mdi-${r}`,$iconColor:t,"aria-hidden":"true"}):null,E.jsxs(m1,{children:[c?E.jsx(Mt,{as:"h3",family:"heading",size:"xl",weight:"800",ccMargin:"none none xs",children:c}):null,i?E.jsx(Mt,{as:"p",color:"subtle",children:i}):null]}),o||a?E.jsxs(b1,{children:[o?E.jsx(Ni,{...o,"data-testid":o["data-testid"],color:t==="destroy"?"destroy":"primary",icon:{name:(p=o.icon)==null?void 0:p.name,position:(m=o.icon)==null?void 0:m.position},children:o.label}):null,a?E.jsx(Ni,{...a,"data-testid":a["data-testid"],color:"subtle",icon:{name:(v=a.icon)==null?void 0:v.name,position:(y=a.icon)==null?void 0:y.position},children:a.label}):null]}):null]})}const w1=W(Ni)`
580
580
  padding: 0 0.25ch; /* If you change this value, update TableColumnSortButton to match */
581
581
  border: none;
582
582
  height: auto;
package/index.mjs CHANGED
@@ -5198,7 +5198,8 @@ const Os = Wn(dh), E1 = {
5198
5198
  flex-direction: column;
5199
5199
  gap: var(--cc_size_spacing_s);
5200
5200
  margin-block-start: var(--cc_size_spacing_m);
5201
- `, A1 = ({
5201
+ `;
5202
+ function A1({
5202
5203
  image: e,
5203
5204
  ccMargin: n,
5204
5205
  color: t = "info",
@@ -5208,7 +5209,7 @@ const Os = Wn(dh), E1 = {
5208
5209
  secondaryAction: a,
5209
5210
  title: c,
5210
5211
  ...d
5211
- }) => {
5212
+ }) {
5212
5213
  var p, m, v, y;
5213
5214
  return /* @__PURE__ */ he($1, { $ccMargin: n, ...d, children: [
5214
5215
  e != null && e.src ? /* @__PURE__ */ O(P1, { style: e.imageContainerStyle, children: /* @__PURE__ */ O(T1, { src: e.src, alt: e.alt }) }) : null,
@@ -5263,7 +5264,8 @@ const Os = Wn(dh), E1 = {
5263
5264
  ) : null
5264
5265
  ] }) : null
5265
5266
  ] });
5266
- }, F1 = W(Os)`
5267
+ }
5268
+ const F1 = W(Os)`
5267
5269
  padding: 0 0.25ch; /* If you change this value, update TableColumnSortButton to match */
5268
5270
  border: none;
5269
5271
  height: auto;
@@ -6,12 +6,13 @@ export type BillboardImage = {
6
6
  alt: string;
7
7
  imageContainerStyle?: CSSProperties;
8
8
  };
9
- type Action = Omit<ButtonProps, 'children'> & {
9
+ type Action<C extends React.ElementType = 'button'> = ButtonProps<C> & {
10
10
  label: string;
11
11
  'data-testid'?: string;
12
+ children?: 'never';
12
13
  };
13
14
  type HTMLDivProps = ComponentPropsWithRef<'div'>;
14
- export type BillboardProps = HTMLDivProps & {
15
+ export type BillboardProps<PrimaryActionButtonComponent extends React.ElementType = 'button', SecondaryActionButtonComponent extends React.ElementType = 'button'> = HTMLDivProps & {
15
16
  color?: BillboardIconColor;
16
17
  /** Add margin with spacing design tokens: `ccMargin="none xl l s"` */
17
18
  ccMargin?: string;
@@ -20,9 +21,9 @@ export type BillboardProps = HTMLDivProps & {
20
21
  /** Body text below the title */
21
22
  message?: string;
22
23
  /** Top button. [Button](../?path=/docs/button--docs) props. */
23
- primaryAction?: Action;
24
+ primaryAction?: Action<PrimaryActionButtonComponent>;
24
25
  /** Bottom button - always `subtle`. [Button](../?path=/docs/button--docs) props. */
25
- secondaryAction?: Action;
26
+ secondaryAction?: Action<SecondaryActionButtonComponent>;
26
27
  /** Heading text */
27
28
  title?: string;
28
29
  /** Image source, alt text, image container style */
@@ -35,5 +36,5 @@ export type BillboardProps = HTMLDivProps & {
35
36
  * - If the `message` is long enough, set a `max-width` by extending Billboard as a `styled-component`: `const StyledBillboard = styled(Billboard)({ maxWidth: '400px'; margin: 0 auto; });`
36
37
  * - Target the `image.imageContainerStyle` prop to style the image container to best accommodate your image's aspect ratio.
37
38
  */
38
- export declare const Billboard: ({ image, ccMargin, color, iconName, message, primaryAction, secondaryAction, title, ...props }: BillboardProps) => import("react/jsx-runtime").JSX.Element;
39
+ export declare function Billboard<PrimaryActionButtonComponent extends React.ElementType = 'button', SecondaryActionButtonComponent extends React.ElementType = 'button'>({ image, ccMargin, color, iconName, message, primaryAction, secondaryAction, title, ...props }: BillboardProps<PrimaryActionButtonComponent, SecondaryActionButtonComponent>): import("react/jsx-runtime").JSX.Element;
39
40
  export default Billboard;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companycam/slab-web",
3
- "version": "1.16.2-beta.3",
3
+ "version": "1.16.2-beta.4",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {