@khanacademy/wonder-blocks-cell 6.3.0 → 6.4.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @khanacademy/wonder-blocks-cell@6.3.0 build:css /home/runner/work/wonder-blocks/wonder-blocks/packages/wonder-blocks-cell
2
+ > @khanacademy/wonder-blocks-cell@6.4.0 build:css /home/runner/work/wonder-blocks/wonder-blocks/packages/wonder-blocks-cell
3
3
  > pnpm exec wonder-blocks-tokens .
4
4
 
5
5
  CSS variables generated successfully in: /home/runner/work/wonder-blocks/wonder-blocks/packages/wonder-blocks-cell/dist/css
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @khanacademy/wonder-blocks-cell
2
2
 
3
+ ## 6.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4e011ea: `DetailCell` and `CompactCell` now forward their `ref` to the root DOM element: the `<button>` (with `onClick`) or `<a>` (with `href`) when the cell is pressable, otherwise the wrapping `<div>`.
8
+
3
9
  ## 6.3.0
4
10
 
5
11
  ### Minor Changes
@@ -20,5 +20,5 @@ import type { CellProps } from "../util/types";
20
20
  * />
21
21
  * ```
22
22
  */
23
- declare const CompactCell: (props: CellProps) => React.ReactElement;
23
+ declare const CompactCell: React.ForwardRefExoticComponent<CellProps & React.RefAttributes<HTMLElement>>;
24
24
  export default CompactCell;
@@ -1,19 +1,5 @@
1
1
  import * as React from "react";
2
2
  import type { CellProps, TypographyText } from "../util/types";
3
- type DetailCellProps = CellProps & {
4
- /**
5
- * You can either provide a string or a custom node Typography element (or
6
- * nothing at all). Both a string or a custom node Typography element will
7
- * occupy the “Subtitle1” area of the Cell.
8
- */
9
- subtitle1?: TypographyText;
10
- /**
11
- * You can either provide a string or a custom node Typography element (or
12
- * nothing at all). Both a string or a custom node Typography element will
13
- * occupy the “Subtitle2” area of the Cell.
14
- */
15
- subtitle2?: TypographyText;
16
- };
17
3
  /**
18
4
  * This is a variant of CompactCell that allows adding subtitles, before and
19
5
  * after the cell title. They typically represent an item that can be
@@ -36,5 +22,18 @@ type DetailCellProps = CellProps & {
36
22
  * />
37
23
  * ```
38
24
  */
39
- declare const DetailCell: (props: DetailCellProps) => React.ReactElement;
25
+ declare const DetailCell: React.ForwardRefExoticComponent<CellProps & {
26
+ /**
27
+ * You can either provide a string or a custom node Typography element (or
28
+ * nothing at all). Both a string or a custom node Typography element will
29
+ * occupy the “Subtitle1” area of the Cell.
30
+ */
31
+ subtitle1?: TypographyText;
32
+ /**
33
+ * You can either provide a string or a custom node Typography element (or
34
+ * nothing at all). Both a string or a custom node Typography element will
35
+ * occupy the “Subtitle2” area of the Cell.
36
+ */
37
+ subtitle2?: TypographyText;
38
+ } & React.RefAttributes<HTMLElement>>;
40
39
  export default DetailCell;
@@ -1,7 +1,15 @@
1
1
  import * as React from "react";
2
2
  import type { StyleType } from "@khanacademy/wonder-blocks-core";
3
3
  import type { CellProps } from "../../util/types";
4
- type CellCoreProps = Partial<Omit<CellProps, "title">> & {
4
+ /**
5
+ * CellCore is the base cell wrapper. It's used as the skeleton/layout that is
6
+ * used by CompactCell and DetailCell (and any other variants).
7
+ *
8
+ * Both variants share how they render their accessories, and the main
9
+ * responsibility of this component is to render the contents that are passed in
10
+ * (using the `children` prop).
11
+ */
12
+ declare const CellCore: React.ForwardRefExoticComponent<Partial<Omit<CellProps, "title">> & {
5
13
  /**
6
14
  * The content of the cell.
7
15
  */
@@ -18,14 +26,5 @@ type CellCoreProps = Partial<Omit<CellProps, "title">> & {
18
26
  * within the package scope.
19
27
  */
20
28
  innerStyle?: StyleType;
21
- };
22
- /**
23
- * CellCore is the base cell wrapper. It's used as the skeleton/layout that is
24
- * used by CompactCell and DetailCell (and any other variants).
25
- *
26
- * Both variants share how they render their accessories, and the main
27
- * responsibility of this component is to render the contents that are passed in
28
- * (using the `children` prop).
29
- */
30
- declare const CellCore: (props: CellCoreProps) => React.ReactElement;
29
+ } & React.RefAttributes<HTMLElement>>;
31
30
  export default CellCore;
package/dist/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import 'react';
2
+ import * as React from 'react';
3
3
  import { BodyText } from '@khanacademy/wonder-blocks-typography';
4
4
  import { StyleSheet } from 'aphrodite';
5
5
  import Clickable from '@khanacademy/wonder-blocks-clickable';
@@ -13,10 +13,10 @@ var theme = mapValuesToCssVars(themeDefault,"--wb-c-cell-");
13
13
 
14
14
  const getHorizontalRuleStyles=horizontalRule=>{switch(horizontalRule){case"inset":return [styles$2.horizontalRule,styles$2.horizontalRuleInset];case"full-width":return styles$2.horizontalRule;case"none":return {}}};const styles$2=StyleSheet.create({horizontalRule:{position:"relative",":after":{width:"100%",content:"''",position:"absolute",insetBlockEnd:0,insetInlineEnd:0,height:theme.rule.sizing.height,boxShadow:theme.rule.shadow}},horizontalRuleInset:{":after":{width:`calc(100% - ${theme.root.layout.padding.inline.default})`}}});
15
15
 
16
- const LeftAccessory=({leftAccessory,style,disabled})=>{if(!leftAccessory){return null}return jsx(View,{style:[styles$1.accessory,styles$1.accessoryLeft,disabled&&styles$1.accessoryDisabled,{...style}],children:leftAccessory})};const RightAccessory=({rightAccessory,style,active,disabled})=>{if(!rightAccessory){return null}return jsx(View,{style:[styles$1.accessory,styles$1.accessoryRight,disabled&&styles$1.accessoryDisabled,{...style},active&&styles$1.accessoryActive],children:rightAccessory})};function CellInner(props){const{active,children,disabled,contentStyle=undefined,leftAccessory=undefined,rightAccessory=undefined,styles:stylesProp,testId}=props;return jsxs(Fragment,{children:[jsx(LeftAccessory,{leftAccessory:leftAccessory,style:stylesProp?.leftAccessory,disabled:disabled}),jsx(View,{style:[styles$1.content,contentStyle,stylesProp?.content],testId:testId,children:children}),jsx(RightAccessory,{rightAccessory:rightAccessory,style:stylesProp?.rightAccessory,active:active,disabled:disabled})]})}const CellCore=props=>{const{active,disabled,href,onClick,"aria-label":ariaLabel,"aria-selected":ariaSelected,"aria-checked":ariaChecked,"aria-haspopup":ariaHasPopup,target,role,tabIndex,id,horizontalRule="inset",styles:stylesProp,innerStyle}=props;const horizontalRuleStyles=getHorizontalRuleStyles(horizontalRule);const sharedStyles=[styles$1.wrapper,innerStyle,active&&styles$1.active,horizontalRuleStyles];if(onClick||href){return jsx(Clickable,{disabled:disabled,onClick:onClick,href:href,hideDefaultFocusRing:true,disableMinTargetSize:true,"aria-label":ariaLabel?ariaLabel:undefined,"aria-selected":ariaSelected?ariaSelected:undefined,"aria-checked":ariaChecked,"aria-haspopup":ariaHasPopup,role:role,target:target,style:[sharedStyles,styles$1.clickable,disabled&&styles$1.disabled,stylesProp?.root],"aria-current":active?"true":undefined,tabIndex:tabIndex,id:id,children:()=>jsx(CellInner,{...props})})}return jsx(View,{style:[sharedStyles,stylesProp?.root],"aria-current":active?"true":undefined,role:role,id:id,children:jsx(CellInner,{...props})})};const styles$1=StyleSheet.create({wrapper:{background:semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default,color:semanticColor.core.foreground.neutral.strong,minBlockSize:theme.root.sizing.minHeight,overflow:"hidden",textAlign:"start",width:"100%",display:"flex",flex:1,flexDirection:"row",gap:theme.root.layout.gap.default,paddingBlock:theme.root.layout.padding.block.default,paddingInline:theme.root.layout.padding.inline.default},content:{alignSelf:"center",flex:1,overflowWrap:"break-word"},accessory:{minInlineSize:"auto",alignItems:"center",alignSelf:"center"},accessoryLeft:{color:theme.accessoryLeft.color.default.foreground},accessoryRight:{color:theme.accessoryRight.color.default.foreground},clickable:{":hover":{background:semanticColor.core.background.instructive.subtle},":active":{background:semanticColor.core.background.instructive.subtle,borderRadius:theme.root.border.radius.press},":focus-visible":{borderRadius:theme.root.border.radius.focus,outline:focusStyles.focus[":focus-visible"].outline,outlineOffset:`calc(${theme.root.border.width.default} * -1)`,boxShadow:`inset 0 0 0 calc(${border.width.medium}*2) ${semanticColor.focus.inner}`,overflow:"hidden",position:"relative",[":after"]:{content:"unset"}},[":focus-visible:active"]:{borderRadius:theme.root.border.radius.focusPress},[":active[aria-disabled=false]:not([aria-current=true])"]:{position:"relative",":before":{content:"''",position:"absolute",insetBlockStart:0,insetInlineStart:0,insetBlockEnd:0,width:theme.root.border.width.default,backgroundColor:theme.root.color.press.border}}},active:{background:semanticColor.core.background.instructive.subtle,color:theme.root.color.selected.foreground,cursor:"default",position:"relative",":before":{content:"''",position:"absolute",insetBlockStart:0,insetInlineStart:0,insetBlockEnd:0,width:theme.root.border.width.selected,backgroundColor:theme.root.color.selected.border}},disabled:{background:semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default,color:theme.root.color.disabled.foreground,":hover":{background:semanticColor.core.background.base.default,cursor:"not-allowed"},":active":{background:semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default},[":focus-visible:active"]:{borderRadius:theme.root.border.radius.default}},accessoryActive:{color:semanticColor.core.foreground.instructive.default},accessoryDisabled:{color:theme.accessoryRight.color.disabled.foreground,opacity:.32}});
16
+ const LeftAccessory=({leftAccessory,style,disabled})=>{if(!leftAccessory){return null}return jsx(View,{style:[styles$1.accessory,styles$1.accessoryLeft,disabled&&styles$1.accessoryDisabled,{...style}],children:leftAccessory})};const RightAccessory=({rightAccessory,style,active,disabled})=>{if(!rightAccessory){return null}return jsx(View,{style:[styles$1.accessory,styles$1.accessoryRight,disabled&&styles$1.accessoryDisabled,{...style},active&&styles$1.accessoryActive],children:rightAccessory})};function CellInner(props){const{active,children,disabled,contentStyle=undefined,leftAccessory=undefined,rightAccessory=undefined,styles:stylesProp,testId}=props;return jsxs(Fragment,{children:[jsx(LeftAccessory,{leftAccessory:leftAccessory,style:stylesProp?.leftAccessory,disabled:disabled}),jsx(View,{style:[styles$1.content,contentStyle,stylesProp?.content],testId:testId,children:children}),jsx(RightAccessory,{rightAccessory:rightAccessory,style:stylesProp?.rightAccessory,active:active,disabled:disabled})]})}const CellCore=React.forwardRef(function CellCore(props,ref){const{active,disabled,href,onClick,"aria-label":ariaLabel,"aria-selected":ariaSelected,"aria-checked":ariaChecked,"aria-haspopup":ariaHasPopup,target,role,tabIndex,id,horizontalRule="inset",styles:stylesProp,innerStyle}=props;const horizontalRuleStyles=getHorizontalRuleStyles(horizontalRule);const sharedStyles=[styles$1.wrapper,innerStyle,active&&styles$1.active,horizontalRuleStyles];if(onClick||href){return jsx(Clickable,{disabled:disabled,onClick:onClick,href:href,hideDefaultFocusRing:true,disableMinTargetSize:true,"aria-label":ariaLabel?ariaLabel:undefined,"aria-selected":ariaSelected?ariaSelected:undefined,"aria-checked":ariaChecked,"aria-haspopup":ariaHasPopup,role:role,target:target,style:[sharedStyles,styles$1.clickable,disabled&&styles$1.disabled,stylesProp?.root],"aria-current":active?"true":undefined,tabIndex:tabIndex,id:id,ref:ref,children:()=>jsx(CellInner,{...props})})}return jsx(View,{style:[sharedStyles,stylesProp?.root],"aria-current":active?"true":undefined,role:role,id:id,ref:ref,children:jsx(CellInner,{...props})})});const styles$1=StyleSheet.create({wrapper:{background:semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default,color:semanticColor.core.foreground.neutral.strong,minBlockSize:theme.root.sizing.minHeight,overflow:"hidden",textAlign:"start",width:"100%",display:"flex",flex:1,flexDirection:"row",gap:theme.root.layout.gap.default,paddingBlock:theme.root.layout.padding.block.default,paddingInline:theme.root.layout.padding.inline.default},content:{alignSelf:"center",flex:1,overflowWrap:"break-word"},accessory:{minInlineSize:"auto",alignItems:"center",alignSelf:"center"},accessoryLeft:{color:theme.accessoryLeft.color.default.foreground},accessoryRight:{color:theme.accessoryRight.color.default.foreground},clickable:{":hover":{background:semanticColor.core.background.instructive.subtle},":active":{background:semanticColor.core.background.instructive.subtle,borderRadius:theme.root.border.radius.press},":focus-visible":{borderRadius:theme.root.border.radius.focus,outline:focusStyles.focus[":focus-visible"].outline,outlineOffset:`calc(${theme.root.border.width.default} * -1)`,boxShadow:`inset 0 0 0 calc(${border.width.medium}*2) ${semanticColor.focus.inner}`,overflow:"hidden",position:"relative",[":after"]:{content:"unset"}},[":focus-visible:active"]:{borderRadius:theme.root.border.radius.focusPress},[":active[aria-disabled=false]:not([aria-current=true])"]:{position:"relative",":before":{content:"''",position:"absolute",insetBlockStart:0,insetInlineStart:0,insetBlockEnd:0,width:theme.root.border.width.default,backgroundColor:theme.root.color.press.border}}},active:{background:semanticColor.core.background.instructive.subtle,color:theme.root.color.selected.foreground,cursor:"default",position:"relative",":before":{content:"''",position:"absolute",insetBlockStart:0,insetInlineStart:0,insetBlockEnd:0,width:theme.root.border.width.selected,backgroundColor:theme.root.color.selected.border}},disabled:{background:semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default,color:theme.root.color.disabled.foreground,":hover":{background:semanticColor.core.background.base.default,cursor:"not-allowed"},":active":{background:semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default},[":focus-visible:active"]:{borderRadius:theme.root.border.radius.default}},accessoryActive:{color:semanticColor.core.foreground.instructive.default},accessoryDisabled:{color:theme.accessoryRight.color.disabled.foreground,opacity:.32}});
17
17
 
18
- const CompactCell=function(props){const{title,...coreProps}=props;return jsx(CellCore,{...coreProps,children:typeof title==="string"?jsx(BodyText,{weight:"semi",style:{lineHeight:theme.title.font.lineHeight},children:title}):title})};
18
+ const CompactCell=React.forwardRef(function CompactCell(props,ref){const{title,...coreProps}=props;return jsx(CellCore,{...coreProps,ref:ref,children:typeof title==="string"?jsx(BodyText,{weight:"semi",style:{lineHeight:theme.title.font.lineHeight},children:title}):title})});
19
19
 
20
- const Subtitle=({subtitle,disabled})=>{if(!subtitle){return null}if(typeof subtitle==="string"){return jsx(BodyText,{size:"small",tag:"span",style:[!disabled&&styles.subtitle,{fontSize:theme.subtitle.font.size,lineHeight:theme.subtitle.font.lineHeight}],children:subtitle})}return subtitle};const DetailCell=function(props){const{title,subtitle1,subtitle2,...coreProps}=props;return jsxs(CellCore,{...coreProps,innerStyle:styles.innerWrapper,contentStyle:{gap:theme.root.layout.gap.detail},children:[jsx(Subtitle,{subtitle:subtitle1,disabled:coreProps.disabled}),typeof title==="string"?jsx(BodyText,{weight:"semi",style:{lineHeight:theme.title.font.lineHeight},children:title}):title,jsx(Subtitle,{subtitle:subtitle2,disabled:coreProps.disabled})]})};const styles=StyleSheet.create({subtitle:{color:semanticColor.core.foreground.neutral.default},innerWrapper:{paddingBlock:theme.root.layout.padding.block.detail,paddingInline:theme.root.layout.padding.inline.detail}});
20
+ const Subtitle=({subtitle,disabled})=>{if(!subtitle){return null}if(typeof subtitle==="string"){return jsx(BodyText,{size:"small",tag:"span",style:[!disabled&&styles.subtitle,{fontSize:theme.subtitle.font.size,lineHeight:theme.subtitle.font.lineHeight}],children:subtitle})}return subtitle};const DetailCell=React.forwardRef(function DetailCell(props,ref){const{title,subtitle1,subtitle2,...coreProps}=props;return jsxs(CellCore,{...coreProps,ref:ref,innerStyle:styles.innerWrapper,contentStyle:{gap:theme.root.layout.gap.detail},children:[jsx(Subtitle,{subtitle:subtitle1,disabled:coreProps.disabled}),typeof title==="string"?jsx(BodyText,{weight:"semi",style:{lineHeight:theme.title.font.lineHeight},children:title}):title,jsx(Subtitle,{subtitle:subtitle2,disabled:coreProps.disabled})]})});const styles=StyleSheet.create({subtitle:{color:semanticColor.core.foreground.neutral.default},innerWrapper:{paddingBlock:theme.root.layout.padding.block.detail,paddingInline:theme.root.layout.padding.inline.detail}});
21
21
 
22
22
  export { CompactCell, DetailCell };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
- require('react');
6
+ var React = require('react');
7
7
  var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
8
8
  var aphrodite = require('aphrodite');
9
9
  var Clickable = require('@khanacademy/wonder-blocks-clickable');
@@ -13,6 +13,25 @@ var wonderBlocksStyles = require('@khanacademy/wonder-blocks-styles');
13
13
 
14
14
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
15
 
16
+ function _interopNamespace(e) {
17
+ if (e && e.__esModule) return e;
18
+ var n = Object.create(null);
19
+ if (e) {
20
+ Object.keys(e).forEach(function (k) {
21
+ if (k !== 'default') {
22
+ var d = Object.getOwnPropertyDescriptor(e, k);
23
+ Object.defineProperty(n, k, d.get ? d : {
24
+ enumerable: true,
25
+ get: function () { return e[k]; }
26
+ });
27
+ }
28
+ });
29
+ }
30
+ n["default"] = e;
31
+ return Object.freeze(n);
32
+ }
33
+
34
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
16
35
  var Clickable__default = /*#__PURE__*/_interopDefaultLegacy(Clickable);
17
36
 
18
37
  var themeDefault = {root:{border:{width:{default:wonderBlocksTokens.border.width.medium,selected:wonderBlocksTokens.border.width.thick},radius:{default:wonderBlocksTokens.border.radius.radius_0,focus:wonderBlocksTokens.border.radius.radius_040,press:wonderBlocksTokens.border.radius.radius_0,focusPress:wonderBlocksTokens.border.radius.radius_040}},color:{press:{border:wonderBlocksTokens.semanticColor.core.border.instructive.default},selected:{foreground:wonderBlocksTokens.semanticColor.core.foreground.instructive.strong,border:wonderBlocksTokens.semanticColor.core.border.instructive.default},disabled:{foreground:wonderBlocksTokens.semanticColor.core.foreground.disabled.default}},layout:{gap:{default:wonderBlocksTokens.sizing.size_160,detail:wonderBlocksTokens.sizing.size_020},padding:{block:{default:wonderBlocksTokens.sizing.size_120,detail:wonderBlocksTokens.sizing.size_160},inline:{default:wonderBlocksTokens.sizing.size_160,detail:wonderBlocksTokens.sizing.size_160}}},sizing:{minHeight:wonderBlocksTokens.sizing.size_480}},accessoryLeft:{color:{default:{foreground:"inherit"}}},accessoryRight:{color:{default:{foreground:wonderBlocksTokens.semanticColor.core.foreground.neutral.default},disabled:{foreground:wonderBlocksTokens.semanticColor.core.foreground.neutral.strong}}},rule:{sizing:{height:wonderBlocksTokens.sizing.size_020},shadow:`inset 0px -1px 0px ${wonderBlocksTokens.semanticColor.core.border.neutral.subtle}`},title:{font:{lineHeight:wonderBlocksTokens.font.body.lineHeight.medium}},subtitle:{font:{size:wonderBlocksTokens.font.body.size.small,lineHeight:wonderBlocksTokens.font.body.lineHeight.small}}};
@@ -21,11 +40,11 @@ var theme = wonderBlocksTokens.mapValuesToCssVars(themeDefault,"--wb-c-cell-");
21
40
 
22
41
  const getHorizontalRuleStyles=horizontalRule=>{switch(horizontalRule){case"inset":return [styles$2.horizontalRule,styles$2.horizontalRuleInset];case"full-width":return styles$2.horizontalRule;case"none":return {}}};const styles$2=aphrodite.StyleSheet.create({horizontalRule:{position:"relative",":after":{width:"100%",content:"''",position:"absolute",insetBlockEnd:0,insetInlineEnd:0,height:theme.rule.sizing.height,boxShadow:theme.rule.shadow}},horizontalRuleInset:{":after":{width:`calc(100% - ${theme.root.layout.padding.inline.default})`}}});
23
42
 
24
- const LeftAccessory=({leftAccessory,style,disabled})=>{if(!leftAccessory){return null}return jsxRuntime.jsx(wonderBlocksCore.View,{style:[styles$1.accessory,styles$1.accessoryLeft,disabled&&styles$1.accessoryDisabled,{...style}],children:leftAccessory})};const RightAccessory=({rightAccessory,style,active,disabled})=>{if(!rightAccessory){return null}return jsxRuntime.jsx(wonderBlocksCore.View,{style:[styles$1.accessory,styles$1.accessoryRight,disabled&&styles$1.accessoryDisabled,{...style},active&&styles$1.accessoryActive],children:rightAccessory})};function CellInner(props){const{active,children,disabled,contentStyle=undefined,leftAccessory=undefined,rightAccessory=undefined,styles:stylesProp,testId}=props;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LeftAccessory,{leftAccessory:leftAccessory,style:stylesProp?.leftAccessory,disabled:disabled}),jsxRuntime.jsx(wonderBlocksCore.View,{style:[styles$1.content,contentStyle,stylesProp?.content],testId:testId,children:children}),jsxRuntime.jsx(RightAccessory,{rightAccessory:rightAccessory,style:stylesProp?.rightAccessory,active:active,disabled:disabled})]})}const CellCore=props=>{const{active,disabled,href,onClick,"aria-label":ariaLabel,"aria-selected":ariaSelected,"aria-checked":ariaChecked,"aria-haspopup":ariaHasPopup,target,role,tabIndex,id,horizontalRule="inset",styles:stylesProp,innerStyle}=props;const horizontalRuleStyles=getHorizontalRuleStyles(horizontalRule);const sharedStyles=[styles$1.wrapper,innerStyle,active&&styles$1.active,horizontalRuleStyles];if(onClick||href){return jsxRuntime.jsx(Clickable__default["default"],{disabled:disabled,onClick:onClick,href:href,hideDefaultFocusRing:true,disableMinTargetSize:true,"aria-label":ariaLabel?ariaLabel:undefined,"aria-selected":ariaSelected?ariaSelected:undefined,"aria-checked":ariaChecked,"aria-haspopup":ariaHasPopup,role:role,target:target,style:[sharedStyles,styles$1.clickable,disabled&&styles$1.disabled,stylesProp?.root],"aria-current":active?"true":undefined,tabIndex:tabIndex,id:id,children:()=>jsxRuntime.jsx(CellInner,{...props})})}return jsxRuntime.jsx(wonderBlocksCore.View,{style:[sharedStyles,stylesProp?.root],"aria-current":active?"true":undefined,role:role,id:id,children:jsxRuntime.jsx(CellInner,{...props})})};const styles$1=aphrodite.StyleSheet.create({wrapper:{background:wonderBlocksTokens.semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default,color:wonderBlocksTokens.semanticColor.core.foreground.neutral.strong,minBlockSize:theme.root.sizing.minHeight,overflow:"hidden",textAlign:"start",width:"100%",display:"flex",flex:1,flexDirection:"row",gap:theme.root.layout.gap.default,paddingBlock:theme.root.layout.padding.block.default,paddingInline:theme.root.layout.padding.inline.default},content:{alignSelf:"center",flex:1,overflowWrap:"break-word"},accessory:{minInlineSize:"auto",alignItems:"center",alignSelf:"center"},accessoryLeft:{color:theme.accessoryLeft.color.default.foreground},accessoryRight:{color:theme.accessoryRight.color.default.foreground},clickable:{":hover":{background:wonderBlocksTokens.semanticColor.core.background.instructive.subtle},":active":{background:wonderBlocksTokens.semanticColor.core.background.instructive.subtle,borderRadius:theme.root.border.radius.press},":focus-visible":{borderRadius:theme.root.border.radius.focus,outline:wonderBlocksStyles.focusStyles.focus[":focus-visible"].outline,outlineOffset:`calc(${theme.root.border.width.default} * -1)`,boxShadow:`inset 0 0 0 calc(${wonderBlocksTokens.border.width.medium}*2) ${wonderBlocksTokens.semanticColor.focus.inner}`,overflow:"hidden",position:"relative",[":after"]:{content:"unset"}},[":focus-visible:active"]:{borderRadius:theme.root.border.radius.focusPress},[":active[aria-disabled=false]:not([aria-current=true])"]:{position:"relative",":before":{content:"''",position:"absolute",insetBlockStart:0,insetInlineStart:0,insetBlockEnd:0,width:theme.root.border.width.default,backgroundColor:theme.root.color.press.border}}},active:{background:wonderBlocksTokens.semanticColor.core.background.instructive.subtle,color:theme.root.color.selected.foreground,cursor:"default",position:"relative",":before":{content:"''",position:"absolute",insetBlockStart:0,insetInlineStart:0,insetBlockEnd:0,width:theme.root.border.width.selected,backgroundColor:theme.root.color.selected.border}},disabled:{background:wonderBlocksTokens.semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default,color:theme.root.color.disabled.foreground,":hover":{background:wonderBlocksTokens.semanticColor.core.background.base.default,cursor:"not-allowed"},":active":{background:wonderBlocksTokens.semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default},[":focus-visible:active"]:{borderRadius:theme.root.border.radius.default}},accessoryActive:{color:wonderBlocksTokens.semanticColor.core.foreground.instructive.default},accessoryDisabled:{color:theme.accessoryRight.color.disabled.foreground,opacity:.32}});
43
+ const LeftAccessory=({leftAccessory,style,disabled})=>{if(!leftAccessory){return null}return jsxRuntime.jsx(wonderBlocksCore.View,{style:[styles$1.accessory,styles$1.accessoryLeft,disabled&&styles$1.accessoryDisabled,{...style}],children:leftAccessory})};const RightAccessory=({rightAccessory,style,active,disabled})=>{if(!rightAccessory){return null}return jsxRuntime.jsx(wonderBlocksCore.View,{style:[styles$1.accessory,styles$1.accessoryRight,disabled&&styles$1.accessoryDisabled,{...style},active&&styles$1.accessoryActive],children:rightAccessory})};function CellInner(props){const{active,children,disabled,contentStyle=undefined,leftAccessory=undefined,rightAccessory=undefined,styles:stylesProp,testId}=props;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LeftAccessory,{leftAccessory:leftAccessory,style:stylesProp?.leftAccessory,disabled:disabled}),jsxRuntime.jsx(wonderBlocksCore.View,{style:[styles$1.content,contentStyle,stylesProp?.content],testId:testId,children:children}),jsxRuntime.jsx(RightAccessory,{rightAccessory:rightAccessory,style:stylesProp?.rightAccessory,active:active,disabled:disabled})]})}const CellCore=React__namespace.forwardRef(function CellCore(props,ref){const{active,disabled,href,onClick,"aria-label":ariaLabel,"aria-selected":ariaSelected,"aria-checked":ariaChecked,"aria-haspopup":ariaHasPopup,target,role,tabIndex,id,horizontalRule="inset",styles:stylesProp,innerStyle}=props;const horizontalRuleStyles=getHorizontalRuleStyles(horizontalRule);const sharedStyles=[styles$1.wrapper,innerStyle,active&&styles$1.active,horizontalRuleStyles];if(onClick||href){return jsxRuntime.jsx(Clickable__default["default"],{disabled:disabled,onClick:onClick,href:href,hideDefaultFocusRing:true,disableMinTargetSize:true,"aria-label":ariaLabel?ariaLabel:undefined,"aria-selected":ariaSelected?ariaSelected:undefined,"aria-checked":ariaChecked,"aria-haspopup":ariaHasPopup,role:role,target:target,style:[sharedStyles,styles$1.clickable,disabled&&styles$1.disabled,stylesProp?.root],"aria-current":active?"true":undefined,tabIndex:tabIndex,id:id,ref:ref,children:()=>jsxRuntime.jsx(CellInner,{...props})})}return jsxRuntime.jsx(wonderBlocksCore.View,{style:[sharedStyles,stylesProp?.root],"aria-current":active?"true":undefined,role:role,id:id,ref:ref,children:jsxRuntime.jsx(CellInner,{...props})})});const styles$1=aphrodite.StyleSheet.create({wrapper:{background:wonderBlocksTokens.semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default,color:wonderBlocksTokens.semanticColor.core.foreground.neutral.strong,minBlockSize:theme.root.sizing.minHeight,overflow:"hidden",textAlign:"start",width:"100%",display:"flex",flex:1,flexDirection:"row",gap:theme.root.layout.gap.default,paddingBlock:theme.root.layout.padding.block.default,paddingInline:theme.root.layout.padding.inline.default},content:{alignSelf:"center",flex:1,overflowWrap:"break-word"},accessory:{minInlineSize:"auto",alignItems:"center",alignSelf:"center"},accessoryLeft:{color:theme.accessoryLeft.color.default.foreground},accessoryRight:{color:theme.accessoryRight.color.default.foreground},clickable:{":hover":{background:wonderBlocksTokens.semanticColor.core.background.instructive.subtle},":active":{background:wonderBlocksTokens.semanticColor.core.background.instructive.subtle,borderRadius:theme.root.border.radius.press},":focus-visible":{borderRadius:theme.root.border.radius.focus,outline:wonderBlocksStyles.focusStyles.focus[":focus-visible"].outline,outlineOffset:`calc(${theme.root.border.width.default} * -1)`,boxShadow:`inset 0 0 0 calc(${wonderBlocksTokens.border.width.medium}*2) ${wonderBlocksTokens.semanticColor.focus.inner}`,overflow:"hidden",position:"relative",[":after"]:{content:"unset"}},[":focus-visible:active"]:{borderRadius:theme.root.border.radius.focusPress},[":active[aria-disabled=false]:not([aria-current=true])"]:{position:"relative",":before":{content:"''",position:"absolute",insetBlockStart:0,insetInlineStart:0,insetBlockEnd:0,width:theme.root.border.width.default,backgroundColor:theme.root.color.press.border}}},active:{background:wonderBlocksTokens.semanticColor.core.background.instructive.subtle,color:theme.root.color.selected.foreground,cursor:"default",position:"relative",":before":{content:"''",position:"absolute",insetBlockStart:0,insetInlineStart:0,insetBlockEnd:0,width:theme.root.border.width.selected,backgroundColor:theme.root.color.selected.border}},disabled:{background:wonderBlocksTokens.semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default,color:theme.root.color.disabled.foreground,":hover":{background:wonderBlocksTokens.semanticColor.core.background.base.default,cursor:"not-allowed"},":active":{background:wonderBlocksTokens.semanticColor.core.background.base.default,borderRadius:theme.root.border.radius.default},[":focus-visible:active"]:{borderRadius:theme.root.border.radius.default}},accessoryActive:{color:wonderBlocksTokens.semanticColor.core.foreground.instructive.default},accessoryDisabled:{color:theme.accessoryRight.color.disabled.foreground,opacity:.32}});
25
44
 
26
- const CompactCell=function(props){const{title,...coreProps}=props;return jsxRuntime.jsx(CellCore,{...coreProps,children:typeof title==="string"?jsxRuntime.jsx(wonderBlocksTypography.BodyText,{weight:"semi",style:{lineHeight:theme.title.font.lineHeight},children:title}):title})};
45
+ const CompactCell=React__namespace.forwardRef(function CompactCell(props,ref){const{title,...coreProps}=props;return jsxRuntime.jsx(CellCore,{...coreProps,ref:ref,children:typeof title==="string"?jsxRuntime.jsx(wonderBlocksTypography.BodyText,{weight:"semi",style:{lineHeight:theme.title.font.lineHeight},children:title}):title})});
27
46
 
28
- const Subtitle=({subtitle,disabled})=>{if(!subtitle){return null}if(typeof subtitle==="string"){return jsxRuntime.jsx(wonderBlocksTypography.BodyText,{size:"small",tag:"span",style:[!disabled&&styles.subtitle,{fontSize:theme.subtitle.font.size,lineHeight:theme.subtitle.font.lineHeight}],children:subtitle})}return subtitle};const DetailCell=function(props){const{title,subtitle1,subtitle2,...coreProps}=props;return jsxRuntime.jsxs(CellCore,{...coreProps,innerStyle:styles.innerWrapper,contentStyle:{gap:theme.root.layout.gap.detail},children:[jsxRuntime.jsx(Subtitle,{subtitle:subtitle1,disabled:coreProps.disabled}),typeof title==="string"?jsxRuntime.jsx(wonderBlocksTypography.BodyText,{weight:"semi",style:{lineHeight:theme.title.font.lineHeight},children:title}):title,jsxRuntime.jsx(Subtitle,{subtitle:subtitle2,disabled:coreProps.disabled})]})};const styles=aphrodite.StyleSheet.create({subtitle:{color:wonderBlocksTokens.semanticColor.core.foreground.neutral.default},innerWrapper:{paddingBlock:theme.root.layout.padding.block.detail,paddingInline:theme.root.layout.padding.inline.detail}});
47
+ const Subtitle=({subtitle,disabled})=>{if(!subtitle){return null}if(typeof subtitle==="string"){return jsxRuntime.jsx(wonderBlocksTypography.BodyText,{size:"small",tag:"span",style:[!disabled&&styles.subtitle,{fontSize:theme.subtitle.font.size,lineHeight:theme.subtitle.font.lineHeight}],children:subtitle})}return subtitle};const DetailCell=React__namespace.forwardRef(function DetailCell(props,ref){const{title,subtitle1,subtitle2,...coreProps}=props;return jsxRuntime.jsxs(CellCore,{...coreProps,ref:ref,innerStyle:styles.innerWrapper,contentStyle:{gap:theme.root.layout.gap.detail},children:[jsxRuntime.jsx(Subtitle,{subtitle:subtitle1,disabled:coreProps.disabled}),typeof title==="string"?jsxRuntime.jsx(wonderBlocksTypography.BodyText,{weight:"semi",style:{lineHeight:theme.title.font.lineHeight},children:title}):title,jsxRuntime.jsx(Subtitle,{subtitle:subtitle2,disabled:coreProps.disabled})]})});const styles=aphrodite.StyleSheet.create({subtitle:{color:wonderBlocksTokens.semanticColor.core.foreground.neutral.default},innerWrapper:{paddingBlock:theme.root.layout.padding.block.detail,paddingInline:theme.root.layout.padding.inline.detail}});
29
48
 
30
49
  exports.CompactCell = CompactCell;
31
50
  exports.DetailCell = DetailCell;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "6.3.0",
6
+ "version": "6.4.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@khanacademy/wonder-blocks-clickable": "8.3.2",
32
- "@khanacademy/wonder-blocks-core": "12.5.0",
33
32
  "@khanacademy/wonder-blocks-styles": "0.4.1",
34
33
  "@khanacademy/wonder-blocks-tokens": "18.1.0",
34
+ "@khanacademy/wonder-blocks-core": "12.5.0",
35
35
  "@khanacademy/wonder-blocks-typography": "5.0.6"
36
36
  },
37
37
  "peerDependencies": {