@kanso-labs/kanso-ui 0.45.25 → 0.45.27
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.
|
@@ -69,11 +69,11 @@ const INNER = {
|
|
|
69
69
|
xxl: "20px"
|
|
70
70
|
};
|
|
71
71
|
const ROUND = {
|
|
72
|
-
lg: `calc(${sizing.controlLg} / 2)`,
|
|
73
|
-
md: `calc(${sizing.controlSm} / 2)`,
|
|
74
|
-
xl: `calc(${sizing.controlXl} / 2)`,
|
|
75
|
-
xs: `calc(${sizing.controlXs} / 2)`,
|
|
76
|
-
xxl: `calc(${sizing.controlXxl} / 2)`
|
|
72
|
+
lg: `min(${radii.pill}, calc(${sizing.controlLg} / 2))`,
|
|
73
|
+
md: `min(${radii.pill}, calc(${sizing.controlSm} / 2))`,
|
|
74
|
+
xl: `min(${radii.pill}, calc(${sizing.controlXl} / 2))`,
|
|
75
|
+
xs: `min(${radii.pill}, calc(${sizing.controlXs} / 2))`,
|
|
76
|
+
xxl: `min(${radii.pill}, calc(${sizing.controlXxl} / 2))`
|
|
77
77
|
};
|
|
78
78
|
const INNER_PRESSED = {
|
|
79
79
|
lg: radii.xs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","Children","isValidElement","useState","mergeStyles","radii","sizing","EXPANDED_RATIO","DISABLED","isDisabled","styles","group","kGNEyG","kB7OPa","k1xSpc","kwnvtZ","$$css","minimum","k7Eaqz","gaps","connected","kOIVth","lg","md","xl","xs","xxl","corners","shape","start","end","kT0f0o","kVL7Gh","kfmiAY","krdFHd","val","undefined","INNER","sm","ROUND","controlLg","controlSm","controlXl","controlXs","controlXxl","INNER_PRESSED","children","className","selectionMode","size","style","variant","delta","index","ButtonGroup","t0","$","props","ref","t1","t2","press","setPress","groupProps","t3","items","toArray","filter","sized","t4","t5","Symbol","for","endPress","map","child","key","itemFor","count","length","content","t6","t7","connectedStyles","state","outer","inner","isPressed","isSelected","shift","onPressEnd","onPressStart","width","shiftFor","Math","abs","RACToggleButtonGroup","RACGroup"],"sources":["../../../src/components/button-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, ReactNode, RefAttributes } from 'react';\nimport type { ToggleButtonGroupProps as RACToggleButtonGroupProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Children, isValidElement, useCallback, useState } from 'react';\nimport { ButtonContext, Group as RACGroup, ToggleButtonGroup as RACToggleButtonGroup } from 'react-aria-components';\nimport type { ButtonState } from '../../button';\nimport type { ButtonGroupItem, GroupSize } from '../../button/context';\nimport type { ButtonShape, ButtonSize } from '../button';\nimport { ButtonGroupItemContext } from '../../button/context';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { radii, sizing, spacing } from '../../tokens/design.tokens.stylex';\n\n// The button groups page's two groups, around Buttons and IconButtons placed\n// inside: the standard group, buttons set apart by the page's 18dp, 12dp, 8dp,\n// 8dp and 8dp across the sizes, and the connected group, buttons 2dp apart\n// whose inner corners square off — 4dp, 8dp, 8dp, 16dp and 20dp — while the\n// group's two ends keep the buttons' own round. A square connected group\n// takes the same corner at its ends. The group draws nothing itself; it\n// hands each button its size, its corners and its part in the press\n// interaction through src/button/context.ts.\n//\n// **A press is felt across a standard group.** The pressed button widens by\n// 15% of its width — the share Material Design's own group widens it by —\n// and its neighbours narrow to make the room, so the group's width holds:\n// both neighbours by half the gain each, or the one neighbour of a button at\n// the group's end by all of it. Button takes the change as inline padding\n// and IconButton as width, and both ease it over the motion tokens' short\n// duration.\n//\n// **A connected group answers a press and a selection in the corner\n// instead.** Its buttons stay where they are; a pressed one's inner corners\n// tighten, and a selected one's round off entirely. The page gives the\n// pressed corner for its small group alone, 4dp against the 8dp it rests at;\n// the other sizes press to half their resting corner the same way. The page\n// also gives XS and S buttons in a connected group a 48dp minimum width,\n// which is their touch target.\n//\n// Given `selectionMode` the group is React Aria's `ToggleButtonGroup`, which\n// makes every button in it a toggle and reports the selection by the\n// buttons' `id`s: a radio group for `single`, a toolbar for `multiple`.\n// Without it the group is React Aria's plain `Group`.\n\n// The press interaction's share, from Material Design's own button group.\nconst EXPANDED_RATIO = 0.15;\nconst DISABLED = {\n isDisabled: true\n};\nconst styles = {\n group: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kwnvtZ: \"xozqiw3\",\n $$css: true\n },\n minimum: {\n k7Eaqz: \"x900493\",\n $$css: true\n }\n};\n\n// The space between buttons, by variant and size. The standard group's 18dp\n// at XS falls between two steps of the spacing scale and is written out.\nconst gaps = {\n connected: {\n kOIVth: \"x14qo01y\",\n $$css: true\n },\n lg: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n md: {\n kOIVth: \"x1gka490\",\n $$css: true\n },\n xl: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n xs: {\n kOIVth: \"xaobbuh\",\n $$css: true\n },\n xxl: {\n kOIVth: \"x126z3so\",\n $$css: true\n }\n};\n\n// A connected button's corners on each side, set from the button's place in\n// the group and its state.\nconst corners = {\n shape: (start: string, end: string) => [{\n kT0f0o: end != null ? \"x1wsjk4f\" : end,\n kVL7Gh: start != null ? \"x1oq9ryg\" : start,\n kfmiAY: end != null ? \"xbsomw4\" : end,\n krdFHd: start != null ? \"x6pmj1i\" : start,\n $$css: true\n }, {\n \"--x-borderEndEndRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-borderEndStartRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start),\n \"--x-borderStartEndRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-borderStartStartRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start)\n }]\n};\n\n// The inner corner each size rests at, and the corner it presses to. The 20dp\n// at XL falls between two steps of the radius scale, and the two halves that\n// are not steps of it are written out too.\nconst INNER = {\n lg: radii.sm,\n md: radii.sm,\n xl: radii.lg,\n xs: radii.xs,\n xxl: '20px'\n};\n\n// The round end at each size: half the button's height. Not the pill's\n// 9999px: CSS scales every corner of a box down together when two on one\n// side add up to more than the side is long, so a 9999px end beside an 8px\n// inner corner shrank the inner one to nothing. Half the height fits as\n// written. A label that wraps makes a button taller than this, and its ends\n// a little less than round.\nconst ROUND = {\n lg: `calc(${sizing.controlLg} / 2)`,\n md: `calc(${sizing.controlSm} / 2)`,\n xl: `calc(${sizing.controlXl} / 2)`,\n xs: `calc(${sizing.controlXs} / 2)`,\n xxl: `calc(${sizing.controlXxl} / 2)`\n};\nconst INNER_PRESSED = {\n lg: radii.xs,\n md: radii.xs,\n xl: radii.sm,\n xs: '2px',\n xxl: '10px'\n};\ntype ButtonGroupProps = Omit<RACToggleButtonGroupProps, 'children' | 'className' | 'selectionMode' | 'style'> & RefAttributes<HTMLDivElement> & {\n /** The buttons: Buttons and IconButtons, each with an `id` in a group that selects. */\n children?: ReactNode;\n /** The class for the group's own element. */\n className?: string;\n /**\n * Makes the group select, as React Aria's `ToggleButtonGroup`: `single`\n * for one at a time, `multiple` for any number. Left out, the group's\n * buttons are plain buttons.\n */\n selectionMode?: RACToggleButtonGroupProps['selectionMode'];\n /**\n * The shape a connected group gives its two ends: `round`, the pill, or\n * `square`, the size's corner, which its inner corners take as well.\n * @default 'round'\n */\n shape?: ButtonShape;\n /**\n * The size every button in the group takes, unless it names its own, and\n * the size the group spaces and shapes them for.\n * @default 'md'\n */\n size?: ButtonSize;\n /** The style for the group's own element. */\n style?: CSSProperties;\n /**\n * `standard` sets the buttons apart and widens a pressed one; `connected`\n * sets them 2dp apart with square inner corners.\n * @default 'standard'\n */\n variant?: ButtonGroupVariant;\n};\ntype ButtonGroupVariant = 'connected' | 'standard';\ntype Press = {\n delta: number;\n index: number;\n};\n\n/**\n * A row of Buttons and IconButtons drawn as the button groups page's\n * standard or connected group. Given `selectionMode`, its buttons are\n * toggles whose selection the group keeps, by their `id`s.\n *\n * ```tsx\n * <ButtonGroup aria-label=\"Label\" selectionMode=\"single\" variant=\"connected\">\n * <Button id=\"first\">First item</Button>\n * <Button id=\"second\">Second item</Button>\n * <Button id=\"third\">Third item</Button>\n * </ButtonGroup>\n * ```\n */\nfunction ButtonGroup({\n children,\n className,\n ref,\n selectionMode,\n shape = 'round',\n size,\n style,\n variant = 'standard',\n ...props\n}: ButtonGroupProps) {\n const [press, setPress] = useState<null | Press>(null);\n const items = Children.toArray(children).filter(isValidElement);\n const sized = size ?? 'md';\n const groupProps = mergeStyles(stylex.props(styles.group, variant === 'connected' ? gaps.connected : gaps[sized]), {\n className,\n style\n });\n const endPress = useCallback(() => {\n setPress(null);\n }, []);\n const content = items.map((child, index) => <ButtonGroupItemContext key={child.key ?? index} value={itemFor({\n count: items.length,\n endPress,\n index,\n press,\n setPress,\n shape,\n size,\n variant\n })}>\n {child}\n </ButtonGroupItemContext>);\n if (selectionMode !== undefined) {\n return <RACToggleButtonGroup ref={ref} selectionMode={selectionMode} {...props} {...groupProps}>\n {content}\n </RACToggleButtonGroup>;\n }\n\n // A plain group disables its buttons through React Aria's own context,\n // which Button and IconButton read; a selecting one does it itself.\n return <RACGroup aria-label={props['aria-label']} aria-labelledby={props['aria-labelledby']} ref={ref} {...groupProps}>\n {props.isDisabled === true ? <ButtonContext value={DISABLED}>{content}</ButtonContext> : content}\n </RACGroup>;\n}\n\n// A connected button's corners: the group's ends keep the outer shape, and\n// every edge it shares with a neighbour takes the inner corner, tighter while\n// pressed and round once selected — a press wins over a selection.\nfunction connectedStyles(index: number, count: number, size: GroupSize, shape: ButtonShape, state: ButtonState) {\n const outer = shape === 'square' ? INNER[size] : ROUND[size];\n const inner = state.isPressed ? INNER_PRESSED[size] : state.isSelected === true ? ROUND[size] : INNER[size];\n const start = index === 0 ? outer : inner;\n const end = index === count - 1 ? outer : inner;\n return [corners.shape(start, end), (size === 'xs' || size === 'md') && styles.minimum];\n}\n\n// One button's part in the group: its size, its corners in a connected\n// group, and its share of a press in a standard one.\nfunction itemFor({\n count,\n endPress,\n index,\n press,\n setPress,\n shape,\n size,\n variant\n}: {\n count: number;\n endPress: () => void;\n index: number;\n press: null | Press;\n setPress: (press: Press) => void;\n shape: ButtonShape;\n size: GroupSize | undefined;\n variant: ButtonGroupVariant;\n}): ButtonGroupItem {\n const sized = size ?? 'md';\n if (variant === 'connected') {\n return {\n shift: 0,\n size,\n styles: (state: ButtonState) => connectedStyles(index, count, sized, shape, state)\n };\n }\n return {\n onPressEnd: endPress,\n onPressStart: (width: number) => {\n setPress({\n delta: width * EXPANDED_RATIO,\n index\n });\n },\n shift: shiftFor(index, count, press),\n size\n };\n}\n\n// How far a standard group moves one button's width while a press is held:\n// the pressed button gains the whole share, and its neighbours give it up —\n// half each, or all of it from the one neighbour of a button at an end.\nfunction shiftFor(index: number, count: number, press: null | Press) {\n if (press === null) {\n return 0;\n }\n if (index === press.index) {\n return press.delta;\n }\n if (Math.abs(index - press.index) !== 1) {\n return 0;\n }\n const atEnd = press.index === 0 || press.index === count - 1;\n return -(atEnd ? press.delta : press.delta / 2);\n}\nexport type { ButtonGroupProps, ButtonGroupVariant };\nexport default ButtonGroup;"],"mappings":";;;;;;;;;;AA8CA,MAAMQ,iBAAiB;AACvB,MAAMC,WAAW,EACfC,YAAY,KACd;AACA,MAAMC,SAAS;CACbC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRF,OAAO;CACT;AACF;AAIA,MAAMG,OAAO;CACXC,WAAW;EACTC,QAAQ;EACRL,OAAO;CACT;CACAM,IAAI;EACFD,QAAQ;EACRL,OAAO;CACT;CACAO,IAAI;EACFF,QAAQ;EACRL,OAAO;CACT;CACAQ,IAAI;EACFH,QAAQ;EACRL,OAAO;CACT;CACAS,IAAI;EACFJ,QAAQ;EACRL,OAAO;CACT;CACAU,KAAK;EACHL,QAAQ;EACRL,OAAO;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AAMC,OAAOC,GAAG,IAAImB,SAAS,QAAQA,SAAS,SAASvC,OAAOO,OAAO;AACvF;AAIA,SAAS4D,QAAQ,EACfC,OACAL,UACApB,OACAQ,OACAC,UACAlC,OACAqB,MACAE,WAUkB;CAClB,MAAMiB,QAAQnB,QAAQ;CACtB,IAAIE,YAAY,aACd,OAAO;EACLsC,OAAO;EACPxC;EACAvC,SAAS0E,UAAuBD,gBAAgB9B,OAAOyB,OAAOV,OAAOxC,OAAOwD,KAAK;CACnF;CAEF,OAAO;EACLM,YAAYjB;EACZkB,eAAeC,UAAkB;GAC/B9B,SAAS;IACPV,OAAOwC,QAAQrF;IACf8C;GACF,CAAC;EACH;EACAoC,OAAOI,SAASxC,OAAOyB,OAAOjB,KAAK;EACnCZ;CACF;AACF;AAKA,SAAS4C,SAASxC,OAAeyB,OAAejB,OAAqB;CACnE,IAAIA,UAAU,MACZ,OAAO;CAET,IAAIR,UAAUQ,MAAMR,OAClB,OAAOQ,MAAMT;CAEf,IAAI0C,KAAKC,IAAI1C,QAAQQ,MAAMR,KAAK,MAAM,GACpC,OAAO;CAGT,OAAO,EADOQ,MAAMR,UAAU,KAAKQ,MAAMR,UAAUyB,QAAQ,IAC1CjB,MAAMT,QAAQS,MAAMT,QAAQ;AAC/C"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","Children","isValidElement","useState","mergeStyles","radii","sizing","EXPANDED_RATIO","DISABLED","isDisabled","styles","group","kGNEyG","kB7OPa","k1xSpc","kwnvtZ","$$css","minimum","k7Eaqz","gaps","connected","kOIVth","lg","md","xl","xs","xxl","corners","shape","start","end","kT0f0o","kVL7Gh","kfmiAY","krdFHd","val","undefined","INNER","sm","ROUND","pill","controlLg","controlSm","controlXl","controlXs","controlXxl","INNER_PRESSED","children","className","selectionMode","size","style","variant","delta","index","ButtonGroup","t0","$","props","ref","t1","t2","press","setPress","groupProps","t3","items","toArray","filter","sized","t4","t5","Symbol","for","endPress","map","child","key","itemFor","count","length","content","t6","t7","connectedStyles","state","outer","inner","isPressed","isSelected","shift","onPressEnd","onPressStart","width","shiftFor","Math","abs","RACToggleButtonGroup","RACGroup"],"sources":["../../../src/components/button-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, ReactNode, RefAttributes } from 'react';\nimport type { ToggleButtonGroupProps as RACToggleButtonGroupProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Children, isValidElement, useCallback, useState } from 'react';\nimport { ButtonContext, Group as RACGroup, ToggleButtonGroup as RACToggleButtonGroup } from 'react-aria-components';\nimport type { ButtonState } from '../../button';\nimport type { ButtonGroupItem, GroupSize } from '../../button/context';\nimport type { ButtonShape, ButtonSize } from '../button';\nimport { ButtonGroupItemContext } from '../../button/context';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { radii, sizing, spacing } from '../../tokens/design.tokens.stylex';\n\n// The button groups page's two groups, around Buttons and IconButtons placed\n// inside: the standard group, buttons set apart by the page's 18dp, 12dp, 8dp,\n// 8dp and 8dp across the sizes, and the connected group, buttons 2dp apart\n// whose inner corners square off — 4dp, 8dp, 8dp, 16dp and 20dp — while the\n// group's two ends keep the buttons' own round. A square connected group\n// takes the same corner at its ends. The group draws nothing itself; it\n// hands each button its size, its corners and its part in the press\n// interaction through src/button/context.ts.\n//\n// **A press is felt across a standard group.** The pressed button widens by\n// 15% of its width — the share Material Design's own group widens it by —\n// and its neighbours narrow to make the room, so the group's width holds:\n// both neighbours by half the gain each, or the one neighbour of a button at\n// the group's end by all of it. Button takes the change as inline padding\n// and IconButton as width, and both ease it over the motion tokens' short\n// duration.\n//\n// **A connected group answers a press and a selection in the corner\n// instead.** Its buttons stay where they are; a pressed one's inner corners\n// tighten, and a selected one's round off entirely. The page gives the\n// pressed corner for its small group alone, 4dp against the 8dp it rests at;\n// the other sizes press to half their resting corner the same way. The page\n// also gives XS and S buttons in a connected group a 48dp minimum width,\n// which is their touch target.\n//\n// Given `selectionMode` the group is React Aria's `ToggleButtonGroup`, which\n// makes every button in it a toggle and reports the selection by the\n// buttons' `id`s: a radio group for `single`, a toolbar for `multiple`.\n// Without it the group is React Aria's plain `Group`.\n\n// The press interaction's share, from Material Design's own button group.\nconst EXPANDED_RATIO = 0.15;\nconst DISABLED = {\n isDisabled: true\n};\nconst styles = {\n group: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kwnvtZ: \"xozqiw3\",\n $$css: true\n },\n minimum: {\n k7Eaqz: \"x900493\",\n $$css: true\n }\n};\n\n// The space between buttons, by variant and size. The standard group's 18dp\n// at XS falls between two steps of the spacing scale and is written out.\nconst gaps = {\n connected: {\n kOIVth: \"x14qo01y\",\n $$css: true\n },\n lg: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n md: {\n kOIVth: \"x1gka490\",\n $$css: true\n },\n xl: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n xs: {\n kOIVth: \"xaobbuh\",\n $$css: true\n },\n xxl: {\n kOIVth: \"x126z3so\",\n $$css: true\n }\n};\n\n// A connected button's corners on each side, set from the button's place in\n// the group and its state.\nconst corners = {\n shape: (start: string, end: string) => [{\n kT0f0o: end != null ? \"x1wsjk4f\" : end,\n kVL7Gh: start != null ? \"x1oq9ryg\" : start,\n kfmiAY: end != null ? \"xbsomw4\" : end,\n krdFHd: start != null ? \"x6pmj1i\" : start,\n $$css: true\n }, {\n \"--x-borderEndEndRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-borderEndStartRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start),\n \"--x-borderStartEndRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-borderStartStartRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start)\n }]\n};\n\n// The inner corner each size rests at, and the corner it presses to. The 20dp\n// at XL falls between two steps of the radius scale, and the two halves that\n// are not steps of it are written out too.\nconst INNER = {\n lg: radii.sm,\n md: radii.sm,\n xl: radii.lg,\n xs: radii.xs,\n xxl: '20px'\n};\n\n// The round end at each size: half the button's height, or the pill where\n// that is smaller, as Button's own round corner is. Not the pill's 9999px\n// alone: CSS scales every corner of a box down together when two on one side\n// add up to more than the side is long, so a 9999px end beside an 8px inner\n// corner shrank the inner one to nothing. Half the height fits as written.\n// `min()` leaves the pill in charge below that, so a scheme that squares its\n// pill squares the group's ends with its Buttons. A label that wraps makes a\n// button taller than this, and its ends a little less than round.\nconst ROUND = {\n lg: `min(${radii.pill}, calc(${sizing.controlLg} / 2))`,\n md: `min(${radii.pill}, calc(${sizing.controlSm} / 2))`,\n xl: `min(${radii.pill}, calc(${sizing.controlXl} / 2))`,\n xs: `min(${radii.pill}, calc(${sizing.controlXs} / 2))`,\n xxl: `min(${radii.pill}, calc(${sizing.controlXxl} / 2))`\n};\nconst INNER_PRESSED = {\n lg: radii.xs,\n md: radii.xs,\n xl: radii.sm,\n xs: '2px',\n xxl: '10px'\n};\ntype ButtonGroupProps = Omit<RACToggleButtonGroupProps, 'children' | 'className' | 'selectionMode' | 'style'> & RefAttributes<HTMLDivElement> & {\n /** The buttons: Buttons and IconButtons, each with an `id` in a group that selects. */\n children?: ReactNode;\n /** The class for the group's own element. */\n className?: string;\n /**\n * Makes the group select, as React Aria's `ToggleButtonGroup`: `single`\n * for one at a time, `multiple` for any number. Left out, the group's\n * buttons are plain buttons.\n */\n selectionMode?: RACToggleButtonGroupProps['selectionMode'];\n /**\n * The shape a connected group gives its two ends: `round`, the pill, or\n * `square`, the size's corner, which its inner corners take as well.\n * @default 'round'\n */\n shape?: ButtonShape;\n /**\n * The size every button in the group takes, unless it names its own, and\n * the size the group spaces and shapes them for.\n * @default 'md'\n */\n size?: ButtonSize;\n /** The style for the group's own element. */\n style?: CSSProperties;\n /**\n * `standard` sets the buttons apart and widens a pressed one; `connected`\n * sets them 2dp apart with square inner corners.\n * @default 'standard'\n */\n variant?: ButtonGroupVariant;\n};\ntype ButtonGroupVariant = 'connected' | 'standard';\ntype Press = {\n delta: number;\n index: number;\n};\n\n/**\n * A row of Buttons and IconButtons drawn as the button groups page's\n * standard or connected group. Given `selectionMode`, its buttons are\n * toggles whose selection the group keeps, by their `id`s.\n *\n * ```tsx\n * <ButtonGroup aria-label=\"Label\" selectionMode=\"single\" variant=\"connected\">\n * <Button id=\"first\">First item</Button>\n * <Button id=\"second\">Second item</Button>\n * <Button id=\"third\">Third item</Button>\n * </ButtonGroup>\n * ```\n */\nfunction ButtonGroup({\n children,\n className,\n ref,\n selectionMode,\n shape = 'round',\n size,\n style,\n variant = 'standard',\n ...props\n}: ButtonGroupProps) {\n const [press, setPress] = useState<null | Press>(null);\n const items = Children.toArray(children).filter(isValidElement);\n const sized = size ?? 'md';\n const groupProps = mergeStyles(stylex.props(styles.group, variant === 'connected' ? gaps.connected : gaps[sized]), {\n className,\n style\n });\n const endPress = useCallback(() => {\n setPress(null);\n }, []);\n const content = items.map((child, index) => <ButtonGroupItemContext key={child.key ?? index} value={itemFor({\n count: items.length,\n endPress,\n index,\n press,\n setPress,\n shape,\n size,\n variant\n })}>\n {child}\n </ButtonGroupItemContext>);\n if (selectionMode !== undefined) {\n return <RACToggleButtonGroup ref={ref} selectionMode={selectionMode} {...props} {...groupProps}>\n {content}\n </RACToggleButtonGroup>;\n }\n\n // A plain group disables its buttons through React Aria's own context,\n // which Button and IconButton read; a selecting one does it itself.\n return <RACGroup aria-label={props['aria-label']} aria-labelledby={props['aria-labelledby']} ref={ref} {...groupProps}>\n {props.isDisabled === true ? <ButtonContext value={DISABLED}>{content}</ButtonContext> : content}\n </RACGroup>;\n}\n\n// A connected button's corners: the group's ends keep the outer shape, and\n// every edge it shares with a neighbour takes the inner corner, tighter while\n// pressed and round once selected — a press wins over a selection.\nfunction connectedStyles(index: number, count: number, size: GroupSize, shape: ButtonShape, state: ButtonState) {\n const outer = shape === 'square' ? INNER[size] : ROUND[size];\n const inner = state.isPressed ? INNER_PRESSED[size] : state.isSelected === true ? ROUND[size] : INNER[size];\n const start = index === 0 ? outer : inner;\n const end = index === count - 1 ? outer : inner;\n return [corners.shape(start, end), (size === 'xs' || size === 'md') && styles.minimum];\n}\n\n// One button's part in the group: its size, its corners in a connected\n// group, and its share of a press in a standard one.\nfunction itemFor({\n count,\n endPress,\n index,\n press,\n setPress,\n shape,\n size,\n variant\n}: {\n count: number;\n endPress: () => void;\n index: number;\n press: null | Press;\n setPress: (press: Press) => void;\n shape: ButtonShape;\n size: GroupSize | undefined;\n variant: ButtonGroupVariant;\n}): ButtonGroupItem {\n const sized = size ?? 'md';\n if (variant === 'connected') {\n return {\n shift: 0,\n size,\n styles: (state: ButtonState) => connectedStyles(index, count, sized, shape, state)\n };\n }\n return {\n onPressEnd: endPress,\n onPressStart: (width: number) => {\n setPress({\n delta: width * EXPANDED_RATIO,\n index\n });\n },\n shift: shiftFor(index, count, press),\n size\n };\n}\n\n// How far a standard group moves one button's width while a press is held:\n// the pressed button gains the whole share, and its neighbours give it up —\n// half each, or all of it from the one neighbour of a button at an end.\nfunction shiftFor(index: number, count: number, press: null | Press) {\n if (press === null) {\n return 0;\n }\n if (index === press.index) {\n return press.delta;\n }\n if (Math.abs(index - press.index) !== 1) {\n return 0;\n }\n const atEnd = press.index === 0 || press.index === count - 1;\n return -(atEnd ? press.delta : press.delta / 2);\n}\nexport type { ButtonGroupProps, ButtonGroupVariant };\nexport default ButtonGroup;"],"mappings":";;;;;;;;;;AA8CA,MAAMQ,iBAAiB;AACvB,MAAMC,WAAW,EACfC,YAAY,KACd;AACA,MAAMC,SAAS;CACbC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRF,OAAO;CACT;AACF;AAIA,MAAMG,OAAO;CACXC,WAAW;EACTC,QAAQ;EACRL,OAAO;CACT;CACAM,IAAI;EACFD,QAAQ;EACRL,OAA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AoB;CAC9G,MAAMC,QAAQ1D,UAAU,WAAWS,MAAMa,QAAQX,MAAMW;CACvD,MAAMqC,QAAQF,MAAMG,YAAY1C,cAAcI,QAAQmC,MAAMI,eAAe,OAAOlD,MAAMW,QAAQb,MAAMa;CACtG,MAAMrB,QAAQyB,UAAU,IAAIgC,QAAQC;CACpC,MAAMzD,MAAMwB,UAAUyB,QAAQ,IAAIO,QAAQC;CAC1C,OAAO,CAAC5D,QAAQC,MAAMC,OAAOC,GAAG,IAAIoB,SAAS,QAAQA,SAAS,SAASxC,OAAOO,OAAO;AACvF;AAIA,SAAS6D,QAAQ,EACfC,OACAL,UACApB,OACAQ,OACAC,UACAnC,OACAsB,MACAE,WAUkB;CAClB,MAAMiB,QAAQnB,QAAQ;CACtB,IAAIE,YAAY,aACd,OAAO;EACLsC,OAAO;EACPxC;EACAxC,SAAS2E,UAAuBD,gBAAgB9B,OAAOyB,OAAOV,OAAOzC,OAAOyD,KAAK;CACnF;CAEF,OAAO;EACLM,YAAYjB;EACZkB,eAAeC,UAAkB;GAC/B9B,SAAS;IACPV,OAAOwC,QAAQtF;IACf+C;GACF,CAAC;EACH;EACAoC,OAAOI,SAASxC,OAAOyB,OAAOjB,KAAK;EACnCZ;CACF;AACF;AAKA,SAAS4C,SAASxC,OAAeyB,OAAejB,OAAqB;CACnE,IAAIA,UAAU,MACZ,OAAO;CAET,IAAIR,UAAUQ,MAAMR,OAClB,OAAOQ,MAAMT;CAEf,IAAI0C,KAAKC,IAAI1C,QAAQQ,MAAMR,KAAK,MAAM,GACpC,OAAO;CAGT,OAAO,EADOQ,MAAMR,UAAU,KAAKQ,MAAMR,UAAUyB,QAAQ,IAC1CjB,MAAMT,QAAQS,MAAMT,QAAQ;AAC/C"}
|
|
@@ -158,7 +158,8 @@ declare namespace Table$1 {
|
|
|
158
158
|
declare function TableBody$1<T extends object = object>({ renderEmptyState, ...props }: RefAttributes<HTMLTableSectionElement> & TableBodyProps$1<T>): import("react").JSX.Element;
|
|
159
159
|
/**
|
|
160
160
|
* One cell. `selection` draws this row's checkbox in place of whatever else
|
|
161
|
-
* the cell would hold.
|
|
161
|
+
* the cell would hold. On a disabled row the cell fades as a whole, so what
|
|
162
|
+
* it holds fades with its text.
|
|
162
163
|
*/
|
|
163
164
|
declare function TableCell({ children, selection, ...props }: RefAttributes<HTMLTableCellElement> & TableCellProps): import("react").JSX.Element;
|
|
164
165
|
/**
|
|
@@ -22,6 +22,10 @@ const styles = {
|
|
|
22
22
|
kXLuUW: "xxymvpz",
|
|
23
23
|
$$css: true
|
|
24
24
|
},
|
|
25
|
+
cellDisabled: {
|
|
26
|
+
kSiTet: "x1ppv7y9",
|
|
27
|
+
$$css: true
|
|
28
|
+
},
|
|
25
29
|
focus: {
|
|
26
30
|
kjBf7l: "xrgy624 x1v8yhc2",
|
|
27
31
|
kInvED: "x2ssjo2",
|
|
@@ -63,7 +67,7 @@ const styles = {
|
|
|
63
67
|
},
|
|
64
68
|
rowDisabled: {
|
|
65
69
|
kWkggS: "xjbqb8w",
|
|
66
|
-
kMwMTN: "
|
|
70
|
+
kMwMTN: "x139gbkf",
|
|
67
71
|
kkrTdU: "x1h6gzvc",
|
|
68
72
|
kAXs8y: "xr5dkdi",
|
|
69
73
|
$$css: true
|
|
@@ -115,10 +119,7 @@ function cellContent(children, selection, label) {
|
|
|
115
119
|
});
|
|
116
120
|
}
|
|
117
121
|
function cellStyles(selection) {
|
|
118
|
-
return
|
|
119
|
-
0: { className: "x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn" },
|
|
120
|
-
1: { className: "x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft" }
|
|
121
|
-
}[!!selection << 0];
|
|
122
|
+
return (state) => props(styles.cell, styles.focus, selection ? styles.selection : state.isDisabled && styles.cellDisabled);
|
|
122
123
|
}
|
|
123
124
|
function columnContent(children, selection, label, resizable, resizeLabel) {
|
|
124
125
|
if (selection) return /* @__PURE__ */ jsx(Checkbox, {
|
|
@@ -392,7 +393,8 @@ function TableBody$1(t0) {
|
|
|
392
393
|
}
|
|
393
394
|
/**
|
|
394
395
|
* One cell. `selection` draws this row's checkbox in place of whatever else
|
|
395
|
-
* the cell would hold.
|
|
396
|
+
* the cell would hold. On a disabled row the cell fades as a whole, so what
|
|
397
|
+
* it holds fades with its text.
|
|
396
398
|
*/
|
|
397
399
|
function TableCell(t0) {
|
|
398
400
|
const $ = c(9);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","createContext","useContext","useLayoutEffect","useState","Cell","RACCell","Column","Row","Table","TableBody","TableFooter","TableHeader","RACTableLoadMoreItem","collectionStyles","mergeRefs","rowStyles","rowLayers","mergeStatefulStyles","mergeStyles","SelectAllLabelContext","undefined","SelectLabelContext","styles","cell","kB7OPa","kg3NbH","k9WMMc","kXLuUW","$$css","focus","kjBf7l","kInvED","k3XXqK","kMeerF","header","kZKoxP","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kVQacm","kVAEAm","headerHovered","kWkggS","headerPressed","headerSortable","kkrTdU","row","kLZC3w","kPef9Z","kEafiO","rowDisabled","kAXs8y","rowSelected","selection","kzqmXN","khDVqt","sticky","kGVxlE","k87sOh","kY2c9j","table","kLvRdT","className","renderEmptyState","style","children","resizable","label","onResize","onResizeEnd","resizeLabel","selectAllLabel","selectLabel","stickyHeader","ResizeLabelContext","ResizableContext","StickyHeaderContext","NO_MIN_WIDTHS","Map","ColumnMinWidthsContext","REACT_ARIA_MIN_WIDTH","cellContent","cellStyles","columnContent","state","sortArrowFor","sortDirection","resizerRule","columnStyles","props","allowsSorting","isHovered","isPressed","dropAriaLevel","node","removeAttribute","emptyContent","measureColumns","headers","tHead","rows","push","cells","held","map","element","cssText","tableLayout","width","widths","Math","ceil","getBoundingClientRect","css","resizableContainerClassName","isResizing","isFocusVisible","isDragging","dragging","isSelected","hovered","pressed","isDropTarget","dropTarget","isDisabled","direction","t0","$","t1","t2","setElement","t3","ref","minWidths","useColumnMinWidths","t4","tableClasses","t5","t6","t7","t8","t9","t10","t11","t12","TableCell","T0","TableColumn","resizableTable","get","measured","minWidth","max","0","1","TableLoadMore","TableRow","setWidths","measure","next","current","size","every","changes","MutationObserver","observe","characterData","childList","subtree","document","fonts","addEventListener","disconnect","removeEventListener","Body","Footer","Header","LoadMore","RACColumnResizer","RACTable","RACResizableTableContainer","RACTableBody","RACColumn","RACTableFooter","RACTableHeader","RACRow"],"sources":["../../../src/components/table/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ColumnRenderProps, ColumnResizerRenderProps, CellProps as RACCellProps, ColumnProps as RACColumnProps, RowProps as RACRowProps, TableBodyProps as RACTableBodyProps, TableFooterProps as RACTableFooterProps, TableHeaderProps as RACTableHeaderProps, TableLoadMoreItemProps as RACTableLoadMoreItemProps, TableProps as RACTableProps, ResizableTableContainerProps, RowRenderProps, TableBodyRenderProps, TableRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext, useLayoutEffect, useMemo, useState } from 'react';\nimport { Cell as RACCell, Column as RACColumn, ColumnResizer as RACColumnResizer, ResizableTableContainer as RACResizableTableContainer, Row as RACRow, Table as RACTable, TableBody as RACTableBody, TableFooter as RACTableFooter, TableHeader as RACTableHeader, TableLoadMoreItem as RACTableLoadMoreItem } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles } from '../../collection/styles';\nimport { ArrowDownwardGlyph, ArrowUpwardGlyph } from '../../glyphs';\nimport { mergeRefs } from '../../render/ref';\nimport { rowStyles as rowLayers } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Checkbox from '../checkbox';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// A grid of rows and columns, with sorting and selection. The design system\n// carries no data table page — it was dropped after Material Design 2 — so\n// the geometry comes from the archived one at\n// <https://m2.material.io/components/data-tables>, which is the page this\n// component is drawn from: a 56dp header row, 52dp body rows, 16dp of\n// padding on each side of a cell, a medium-weight header to set it apart\n// from the rows, and an arrow beside the name of the column being sorted.\n//\n// Its colour roles are the current system's rather than that page's, since\n// a table sits beside lists, cards and menus that all draw from the tokens\n// here. That means the row's state layers are the ones `src/row` uses — the\n// same hover, pressed and selected treatment a list row takes — so a\n// selected table row and a selected list row on one page cannot disagree.\n//\n// The row is not `src/row`, and that is the one place this departs from the\n// library's other collections. That module's row is a headline with a\n// supporting line and a slot at each end; a table row is a run of cells with\n// no such shape, and forcing one into the other would give every cell the\n// row's 56dp floor and body-large headline. The state layers are shared by\n// being written from the same tokens rather than by sharing the module.\n//\n// Four things are this component's own.\n//\n// **The rule between rows is drawn on the row, not on its cells.** A cell\n// cannot see whether its row is the first one, so a rule per cell either\n// doubles under the header or needs the row's position passed down. The\n// table collapses its borders, which is what lets a `<tr>` carry one.\n//\n// **A selecting table draws its checkbox where the call site puts it.**\n// `selection` on a column and on a cell renders the library's Checkbox in\n// React Aria's selection slot — the column's is select-all, the cell's is\n// that row's. It is a prop rather than an injected column because the header\n// and every row have to agree on how many columns there are, and only the\n// call site can keep that true.\n//\n// **A sortable column is the press target itself.** React Aria puts no\n// button inside the header cell; it makes the cell pressable and sets\n// `aria-sort` on it. So the arrow is content next to the name, and the\n// hover and pressed layers belong to the cell.\n//\n// **The header sticks only when asked.** A sticky header needs an opaque\n// background to scroll rows under, and that colour is only right when the\n// table is in something that scrolls. `stickyHeader` is what says so.\n//\n// **Resizing is asked for twice, and both are needed.** React Aria puts the\n// resize state on a container around the table and the handle inside a\n// column, so `resizable` on the table is what brings the container and\n// `resizable` on a column is what draws its handle. The archived page has no\n// resizer to take a treatment from — it predates the feature — so the handle\n// draws the divider's own rule, thickening and taking the primary role while\n// it is dragged, over a target far wider than the rule.\n//\n// **A resizable table stops filling its width.** The container sets\n// `table-layout: fixed` and `width: min-content` on the table as inline\n// styles, which no rule here can outrank; the container fills the width\n// instead and scrolls when the columns together are wider than it.\n//\n// **And no column of it is narrower than its longest word.** A fixed layout\n// sizes columns without reading what is in them, so a column given less than\n// a word took the word apart, \"Waitin\" over \"g\", wherever a parent such as a\n// `Card` lets words break. So the container keeps words whole, and the table\n// measures what each column holds and hands React Aria that as the column's\n// `minWidth` — see `useColumnMinWidths`. Columns that stop fitting then\n// scroll in the container, as a wide table already does, and a handle stops\n// at the word rather than breaking it. A column given a `minWidth` of its own\n// keeps it.\n//\n// One thing about React Aria's collection is worth knowing before writing a\n// call site. **A column's `id` and a row's `id` share one namespace**, and a\n// value used by both silently drops every column — the table then throws\n// \"Cell count must match column count\", naming the cells rather than the\n// duplicate key that caused it. Nothing here can catch it, since both ids\n// are the call site's to choose; the docstrings below say to keep them\n// apart, and the stories and tests use `col`-prefixed column ids so the two\n// sets cannot meet.\n\n// What the selection checkboxes are called. A context rather than a prop on\n// every column and cell, since it is the table's decision and repeating it\n// per row is how the two drift. Undefined unless the table is given one,\n// which leaves the names React Aria gives in the reader's locale.\nconst SelectAllLabelContext = createContext<string | undefined>(undefined);\nconst SelectLabelContext = createContext<string | undefined>(undefined);\nconst styles = {\n cell: {\n kB7OPa: \"x9f619\",\n kg3NbH: \"x790zyz\",\n k9WMMc: \"x1yc453h\",\n kXLuUW: \"xxymvpz\",\n $$css: true\n },\n focus: {\n kjBf7l: \"xrgy624 x1v8yhc2\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n header: {\n kZKoxP: \"x1ded5cy\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kVQacm: \"x9h1dke\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n headerHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n headerPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n headerSortable: {\n kWkggS: \"xjbqb8w\",\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n row: {\n kZKoxP: \"xdd8jsf\",\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x1g31smg x178xt8z\",\n $$css: true\n },\n rowDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n rowSelected: {\n kWkggS: \"xp89om9 x1jzqe4\",\n kMwMTN: \"xscdzaa x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selection: {\n kzqmXN: \"x19ddzpn\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n sticky: {\n kWkggS: \"x14s9m32\",\n kGVxlE: \"x1ixd52e\",\n k87sOh: \"x13vifvy\",\n kVAEAm: \"x7wzq59\",\n kY2c9j: \"x1vjfegm\",\n $$css: true\n },\n table: {\n kLvRdT: \"x1mwwwfo\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kzqmXN: \"xh8yej3\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n }\n};\ntype TableBodyProps<T extends object = object> = Omit<RACTableBodyProps<T>, 'className' | 'renderEmptyState' | 'style'> & {\n /** A function may compute the class from the body's render state. */\n className?: RACTableBodyProps<T>['className'];\n /**\n * What the table shows in place of rows when it has none: React Aria's own\n * render function, under React Aria's own name, as List, ListBox, Tree and\n * ChipGroup take it. What it returns is drawn in a row of its own spanning\n * every column, inside the muted, padded box the table draws there.\n */\n renderEmptyState?: RACTableBodyProps<T>['renderEmptyState'];\n /** A function may compute the style from the body's render state. */\n style?: RACTableBodyProps<T>['style'];\n};\ntype TableCellProps = Omit<RACCellProps, 'children' | 'className' | 'style'> & {\n /** What the cell holds. */\n children?: ReactNode;\n /** A function may compute the class from the cell's render state. */\n className?: RACCellProps['className'];\n /**\n * Draws this row's selection checkbox instead of `children`. The row's own\n * text is what names the row; the box inside it takes the table's\n * `selectLabel`.\n */\n selection?: boolean;\n /** A function may compute the style from the cell's render state. */\n style?: RACCellProps['style'];\n};\ntype TableColumnProps = {\n /** The column's name. */\n children?: ReactNode;\n /** A function may compute the class from the column's render state. */\n className?: RACColumnProps['className'];\n /**\n * Draws a handle at the column's trailing edge that drags its width. Needs\n * the table's own `resizable` as well — React Aria keeps the resize state\n * on a container around the table, and without it there is nothing for a\n * handle to change. `defaultWidth`, `minWidth` and `maxWidth` are React\n * Aria's and apply only inside that container.\n */\n resizable?: boolean;\n /**\n * Draws the select-all checkbox instead of `children`, for the column the\n * rows put their own checkboxes in.\n */\n selection?: boolean;\n /** A function may compute the style from the column's render state. */\n style?: RACColumnProps['style'];\n} & Omit<RACColumnProps, 'children' | 'className' | 'style'>;\ntype TableFooterProps<T extends object = object> = RACTableFooterProps<T>;\ntype TableHeaderProps<T extends object = object> = RACTableHeaderProps<T>;\ntype TableLoadMoreProps = Omit<RACTableLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\ntype TableProps = {\n /** A function may compute the class from the table's render state. */\n className?: RACTableProps['className'];\n /** Called as a column is dragged, with every column's width. */\n onResize?: ResizableTableContainerProps['onResize'];\n /** Called once a drag ends, with every column's width. */\n onResizeEnd?: ResizableTableContainerProps['onResizeEnd'];\n /**\n * Lets columns marked `resizable` be dragged, by putting the table in the\n * container React Aria keeps the resize state on. A resizable table sizes\n * to its columns rather than to its parent, and that container is what\n * fills the width and scrolls instead.\n */\n resizable?: boolean;\n /**\n * What the resize handle is called, for a screen reader. React Aria\n * composes it with the column's own name. Left out, React Aria names it in\n * the reader's locale — \"Resizer\" in English.\n */\n resizeLabel?: string;\n /**\n * What the select-all checkbox is called, for a screen reader. Left out,\n * React Aria names it in the reader's locale — \"Select All\" in English.\n */\n selectAllLabel?: string;\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * Left out, React Aria names it in the reader's locale — \"Select\" in\n * English.\n */\n selectLabel?: string;\n /**\n * Holds the header row in place while the rows scroll under it. Needs the\n * table inside something that scrolls; on a table that does not, it draws\n * the same as without it.\n */\n stickyHeader?: boolean;\n /** A function may compute the style from the table's render state. */\n style?: RACTableProps['style'];\n} & Omit<RACTableProps, 'className' | 'style'>;\ntype TableRowProps<T extends object = object> = Omit<RACRowProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the row's render state. */\n className?: RACRowProps<T>['className'];\n /** A function may compute the style from the row's render state. */\n style?: RACRowProps<T>['style'];\n};\n\n// What the resize handles are called, for the same reason the selection\n// labels travel this way: it is the table's decision, and repeating it per\n// column is how the two drift. Undefined by default, as they are.\nconst ResizeLabelContext = createContext<string | undefined>(undefined);\n\n// Whether the table brought the container. React Aria's resizer throws\n// outright without one — \"Wrap your <Table> in a <ResizableTableContainer>\",\n// naming a component a consumer of this library never writes — so a column\n// asking to resize inside a table that does not would take the whole page\n// down. It draws no handle instead.\nconst ResizableContext = createContext(false);\n\n// Whether the header sticks, so a column reaches it without every call site\n// repeating the table's own decision on each one.\nconst StickyHeaderContext = createContext(false);\n\n// The narrowest each column of a resizable table can be with its words whole,\n// by the column's header cell. Empty for a table that does not resize, whose\n// columns size to what they hold anyway.\nconst NO_MIN_WIDTHS: ReadonlyMap<Element, number> = new Map();\nconst ColumnMinWidthsContext = createContext(NO_MIN_WIDTHS);\n\n// React Aria's own minimum for a column, which a measured one below it would\n// otherwise lower.\nconst REACT_ARIA_MIN_WIDTH = 75;\n\n// What a body cell draws, and the classes it draws with. Written as calls\n// rather than inline at the props, which is what react-perf's\n// no-new-function-as-prop and jsx-no-jsx-as-prop are after; the React\n// Compiler memoises the results on their inputs.\n// The return type is written out rather than inferred, here and in the two\n// below: `ReactNode` is a union that includes a promise, and a function\n// inferred as returning one has to be `async`.\nfunction cellContent(children: ReactNode, selection: boolean, label: string | undefined): ReactNode {\n if (!selection) {\n return children;\n }\n return <Checkbox aria-label={label} slot=\"selection\" />;\n}\nfunction cellStyles(selection: boolean) {\n return {\n 0: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn\"\n },\n 1: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft\"\n }\n }[!!selection << 0];\n}\nfunction columnContent(children: ReactNode, selection: boolean, label: string | undefined, resizable: boolean, resizeLabel: string | undefined): RACColumnProps['children'] {\n if (selection) {\n return <Checkbox aria-label={label} slot=\"selection\" />;\n }\n // The handle is a sibling of the name rather than part of it: React Aria\n // renders it as its own element, positioned against the cell's trailing\n // edge, which the name's own box does not reach.\n return (state: ColumnRenderProps): ReactNode => <>\n <span className=\"x6s0dn4 x78zum5 x126z3so\">\n {children}\n {sortArrowFor(state.sortDirection)}\n </span>\n {resizable ? <RACColumnResizer aria-label={resizeLabel} className=\"x5yr21d x9f619 xicojor xvy4d1p x13vifvy x18zu7yx x10l6tqk x5ve5x3 x1vjfegm\">\n {resizerRule}\n </RACColumnResizer> : null}\n </>;\n}\nfunction columnStyles(selection: boolean, sticky: boolean) {\n return (state: ColumnRenderProps) => stylex.props(styles.cell, styles.header, styles.focus, sticky && styles.sticky, selection && styles.selection, state.allowsSorting && styles.headerSortable, state.allowsSorting && state.isHovered && styles.headerHovered, state.allowsSorting && state.isPressed && styles.headerPressed);\n}\n\n// React Aria puts `aria-level` on the load-more row, and `aria-level` is only\n// valid on a row inside a `treegrid` — a grid's rows have no level. axe flags\n// it as `aria-conditional-attr`, and this library's stories run axe as an\n// error, so a table with a load-more row would fail on an attribute nothing\n// here asks for.\n//\n// It cannot be turned off through props: React Aria writes it after spreading\n// what the call site passed, so `aria-level={undefined}` is overwritten. The\n// attribute is taken off the element instead. React writes an attribute only\n// when its prop changes between renders, and this one is always 1, so the\n// removal holds rather than being undone by the next render. `load more` in\n// index.test.tsx pins that it is gone, which is what would notice if React\n// Aria stopped setting it or started varying it.\nfunction dropAriaLevel(node: HTMLTableRowElement | null) {\n node?.removeAttribute('aria-level');\n}\n\n// What the body draws in place of rows: whatever the call site's function\n// returns, inside the box that pads and centres it. A call rather than a\n// function written at the prop, for the same reason the others are.\n//\n// The box is the one thing this adds to React Aria's prop, and the one way\n// the table differs from its siblings, which pass theirs straight through and\n// draw nothing around it. A table's empty state goes in a spanning cell that\n// is not this component's and carries no padding, so without the box the\n// content would sit against the table's edge with no room around it.\nfunction emptyContent(renderEmptyState: (state: TableBodyRenderProps) => ReactNode) {\n // The return type is written out rather than inferred: `ReactNode` is a\n // union that includes a promise, and a function inferred as returning one\n // has to be `async`.\n return (state: TableBodyRenderProps): ReactNode => <span className=\"x9f619 x1w5n3ug x1lliihq xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh x1lrxzt4 x790zyz x2b8uid\">{renderEmptyState(state)}</span>;\n}\n\n/**\n * Each header cell's width with the table laid out to its content. A fixed\n * layout never reads a cell's content, so the table is laid out the other\n * way for the length of the measurement: automatically, at no width, and\n * with the widths React Aria put on the header cells lifted, which leaves\n * every column at the width of the longest word it holds, its padding\n * included. The styles are put back before returning, so nothing is painted\n * in between.\n */\nfunction measureColumns(table: HTMLTableElement): Map<Element, number> {\n const headers: HTMLTableCellElement[] = [];\n for (const row of table.tHead?.rows ?? []) {\n headers.push(...row.cells);\n }\n const held = [table, ...headers].map(element => [element, element.style.cssText] as const);\n table.style.tableLayout = 'auto';\n table.style.width = '0px';\n for (const header of headers) {\n header.style.width = '';\n }\n const widths = new Map(headers.map(header => [header, Math.ceil(header.getBoundingClientRect().width)]));\n for (const [element, css] of held) {\n element.style.cssText = css;\n }\n return widths;\n}\n\n// The container's class. React Aria takes a plain string here rather than a\n// function of render state, since the container reports none — so this is a\n// call rather than the function form the other parts pass.\nfunction resizableContainerClassName() {\n return {\n className: \"x9f619 xh8yej3 x1h4wwuj xw2csxc\"\n }.className ?? '';\n}\n\n// The rule a handle draws, from React Aria's own render state — it reports\n// the drag and the keyboard focus separately, and the two get one treatment.\nfunction resizerRule(state: ColumnResizerRenderProps): ReactNode {\n return <span {...{\n 0: {\n className: \"x1l12bh x5yr21d x1x0u81l xf1j0q2 xmzn1mo x9f619 x1g12otp x1i1rx1s x13vifvy x9q68il x47corl x10l6tqk\"\n },\n 1: {\n className: \"x5yr21d xf1j0q2 x9f619 x1g12otp x13vifvy x9q68il x47corl x10l6tqk xnety89 x1ksdfms x12inkfj xfo62xy\"\n }\n }[!!(state.isResizing || state.isFocusVisible) << 0]} />;\n}\nfunction rowStyles(state: RowRenderProps) {\n return stylex.props(styles.row,\n // The same ring a cell and a column header draw, and for the same\n // reason: React Aria moves focus to the row itself, so the row is where\n // it has to show. Unconditional, as it is on those two — `focus` carries\n // its own `:focus-visible`, and the browser's default ring is what shows\n // through without it: a colour and an offset the rest of the table does\n // not use, and one no forced-colours mode is obliged to keep.\n styles.focus,\n // The lists page's dragged row and the drop target a row draws, from\n // `src/row` as every other collection's row takes them — the dragged one\n // before the selected container, so a selected row keeps it while it\n // moves.\n state.isDragging && rowLayers.dragging, state.isSelected && styles.rowSelected,\n // The state layers come from the render state, which is what makes a\n // row that only runs an action — `onRowAction`, a row's `onAction` or\n // `href` — take them as a selectable one does: React Aria reports a row\n // hovered or pressed only when a press does something to it, whether\n // that is selecting it, running its action or dragging it.\n state.isHovered && rowLayers.hovered, state.isPressed && rowLayers.pressed, state.isDropTarget && rowLayers.dropTarget, state.isDisabled && styles.rowDisabled);\n}\n\n// The arrow beside a sorted column's name. Nothing is drawn on a column that\n// is sortable but not currently sorted: the page puts the arrow next to the\n// column being sorted, and an arrow on every sortable column would say every\n// one of them was.\nfunction sortArrowFor(direction: 'ascending' | 'descending' | undefined) {\n if (direction === undefined) {\n return null;\n }\n return direction === 'ascending' ? <ArrowUpwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" /> : <ArrowDownwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" />;\n}\n\n/**\n * A grid of rows and columns. Sorting and selection are React Aria's: pass\n * `sortDescriptor` with `onSortChange` and mark the sortable columns\n * `allowsSorting`, and set `selectionMode` to `single` or `multiple` with\n * `selectedKeys` and `onSelectionChange`, or `defaultSelectedKeys`.\n *\n * ```tsx\n * <Table aria-label=\"Label\" selectionMode=\"multiple\">\n * <Table.Header>\n * <Table.Column selection />\n * <Table.Column id=\"name\" isRowHeader>Label</Table.Column>\n * </Table.Header>\n * <Table.Body>\n * <Table.Row id=\"first\">\n * <Table.Cell selection />\n * <Table.Cell>First item</Table.Cell>\n * </Table.Row>\n * </Table.Body>\n * </Table>\n * ```\n *\n * Composed from parts, since a cell takes arbitrary content: `Table.Header`,\n * `Table.Column`, `Table.Body`, `Table.Row`, `Table.Cell` and\n * `Table.Footer`. Name the table with `aria-label` or `aria-labelledby`, and\n * mark one column `isRowHeader` so a screen reader has something to read a\n * row by.\n *\n * The call site's `className` and `style` land on the table, which is the\n * element a layout positions.\n */\nfunction Table({\n onResize,\n onResizeEnd,\n resizable = false,\n resizeLabel,\n selectAllLabel,\n selectLabel,\n stickyHeader = false,\n ...props\n}: RefAttributes<HTMLTableElement> & TableProps) {\n // Held as state rather than in a ref object, since the columns are\n // measured from an effect that has to run again when it changes, and only\n // for a table that resizes, so no other table renders twice for it. The\n // call site's ref lands on the same element, read off `props` for the\n // reason NavigationBar gives.\n const [element, setElement] = useState<HTMLTableElement | null>(null);\n const ref = useMemo(() => resizable ? mergeRefs<HTMLTableElement>(setElement, props.ref ?? undefined) : props.ref, [props.ref, resizable]);\n const minWidths = useColumnMinWidths(resizable ? element : null);\n const table = <RACTable {...props} {...mergeStatefulStyles(tableClasses, props)} ref={ref} />;\n return <SelectAllLabelContext value={selectAllLabel}>\n <SelectLabelContext value={selectLabel}>\n <ResizeLabelContext value={resizeLabel}>\n <ResizableContext value={resizable}>\n <StickyHeaderContext value={stickyHeader}>\n <ColumnMinWidthsContext value={minWidths}>\n {resizable ? <RACResizableTableContainer className={resizableContainerClassName()} onResize={onResize} onResizeEnd={onResizeEnd}>\n {table}\n </RACResizableTableContainer> : table}\n </ColumnMinWidthsContext>\n </StickyHeaderContext>\n </ResizableContext>\n </ResizeLabelContext>\n </SelectLabelContext>\n </SelectAllLabelContext>;\n}\n\n/**\n * The rows. `renderEmptyState` is what it shows when there are none — a table\n * with no rows and nothing to say in their place is a blank area with a\n * header over it.\n *\n * It carries no styles of its own, since every rule a body needs is drawn by\n * the rows inside it, so a `className` here lands on the `<tbody>` through\n * React Aria rather than through a merge.\n */\nfunction TableBody<T extends object = object>({\n renderEmptyState,\n ...props\n}: RefAttributes<HTMLTableSectionElement> & TableBodyProps<T>) {\n return <RACTableBody<T> {...props} renderEmptyState={renderEmptyState === undefined ? undefined : emptyContent(renderEmptyState)} />;\n}\n\n/**\n * One cell. `selection` draws this row's checkbox in place of whatever else\n * the cell would hold.\n */\nfunction TableCell({\n children,\n selection = false,\n ...props\n}: RefAttributes<HTMLTableCellElement> & TableCellProps) {\n const label = useContext(SelectLabelContext);\n return <RACCell {...props} {...mergeStatefulStyles(cellStyles(selection), props)}>\n {cellContent(children, selection, label)}\n </RACCell>;\n}\n\n// The table's own classes, with the drop target the other collections'\n// boxes draw while a drop would land on the table as a whole.\nfunction tableClasses(state: TableRenderProps) {\n return stylex.props(styles.table, state.isDropTarget && collectionStyles.dropTarget);\n}\n\n/**\n * One column. `allowsSorting` is React Aria's and makes the header cell\n * itself the control that sorts; the arrow appears on the column the\n * `sortDescriptor` names. `isRowHeader` marks the column a screen reader\n * reads a row by.\n *\n * Its `id` shares a namespace with the rows', so give the two sets values\n * that cannot collide — a column and a row with one id between them leaves\n * the table with no columns at all.\n */\nfunction TableColumn({\n children,\n resizable = false,\n selection = false,\n ...props\n}: RefAttributes<HTMLTableCellElement> & TableColumnProps) {\n const label = useContext(SelectAllLabelContext);\n const resizeLabel = useContext(ResizeLabelContext);\n const resizableTable = useContext(ResizableContext);\n const sticky = useContext(StickyHeaderContext);\n // The header cell, which is what the table's measurements are keyed by,\n // held only in a table that measures them.\n const [element, setElement] = useState<HTMLTableCellElement | null>(null);\n const ref = useMemo(() => resizableTable ? mergeRefs<HTMLTableCellElement>(setElement, props.ref ?? undefined) : props.ref, [props.ref, resizableTable]);\n const minWidths = useContext(ColumnMinWidthsContext);\n const measured = element === null ? undefined : minWidths.get(element);\n return <RACColumn {...props} {...mergeStatefulStyles(columnStyles(selection, sticky), props)} minWidth={props.minWidth ?? (measured === undefined ? undefined : Math.max(measured, REACT_ARIA_MIN_WIDTH))} ref={ref}>\n {columnContent(children, selection, label, resizable && resizableTable, resizeLabel)}\n </RACColumn>;\n}\n\n/**\n * A row under the body, for totals and the like. It is not part of the\n * selection or the keyboard navigation — React Aria keeps it out of both.\n */\nfunction TableFooter<T extends object = object>(props: RefAttributes<HTMLTableSectionElement> & TableFooterProps<T>) {\n return <RACTableFooter<T> {...props} {...mergeStyles({\n className: \"x12smttz x13fuv20 x178xt8z x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4\"\n }, props)} />;\n}\n\n/**\n * The header row, holding the columns, and the rule drawn under it — which\n * moves to the cells when the header sticks, since a row group's border does\n * not travel with cells `position: sticky` has lifted out of it.\n */\nfunction TableHeader<T extends object = object>(props: RefAttributes<HTMLTableSectionElement> & TableHeaderProps<T>) {\n const sticky = useContext(StickyHeaderContext);\n return <RACTableHeader<T> {...props} {...mergeStatefulStyles({\n 0: {\n className: \"x1j6faob x1q0q8m5 xso031l\"\n },\n 1: {}\n }[!!sticky << 0], props)} />;\n}\n\n/**\n * The row the table shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`. It goes inside `Table.Body`, after the rows.\n */\nfunction TableLoadMore({\n label,\n ref,\n ...props\n}: RefAttributes<HTMLTableRowElement> & TableLoadMoreProps) {\n return <RACTableLoadMoreItem {...props} {...mergeStyles({\n className: \"xdd8jsf\"\n }, props)} ref={mergeRefs(dropAriaLevel, ref ?? undefined)}>\n <span className=\"x6s0dn4 x9f619 x78zum5 xl56j7k\">\n <CollectionLoadMore diameter=\"24px\" label={label} />\n </span>\n </RACTableLoadMoreItem>;\n}\n\n/**\n * One row. Give every row an `id` — that is the key selection is reported\n * by, and it has to differ from every column's. `onAction` runs when the\n * row is pressed.\n */\nfunction TableRow<T extends object = object>(props: RefAttributes<HTMLTableRowElement> & TableRowProps<T>) {\n return <RACRow<T> {...props} {...mergeStatefulStyles(rowStyles, props)} />;\n}\n\n/**\n * The narrowest each column of a resizable table can be with none of its\n * words broken, by the column's header cell, for the columns to take as\n * their minimum — see the header.\n *\n * Measured again when a row, a cell or its text changes, and when a font\n * finishes loading, which is when a word's width changes; never when the\n * table is resized, since what a column holds does not change with it.\n */\nfunction useColumnMinWidths(table: HTMLTableElement | null) {\n const [widths, setWidths] = useState(NO_MIN_WIDTHS);\n useLayoutEffect(() => {\n if (table === null) {\n return undefined;\n }\n const measure = () => {\n const next = measureColumns(table);\n setWidths(current => current.size === next.size && [...next].every(([header, width]) => current.get(header) === width) ? current : next);\n };\n measure();\n const changes = new MutationObserver(measure);\n changes.observe(table, {\n characterData: true,\n childList: true,\n subtree: true\n });\n document.fonts.addEventListener('loadingdone', measure);\n return () => {\n changes.disconnect();\n document.fonts.removeEventListener('loadingdone', measure);\n };\n }, [table]);\n return widths;\n}\nTable.Body = TableBody;\nTable.Cell = TableCell;\nTable.Column = TableColumn;\nTable.Footer = TableFooter;\nTable.Header = TableHeader;\nTable.LoadMore = TableLoadMore;\nTable.Row = TableRow;\nexport type { TableBodyProps, TableCellProps, TableColumnProps, TableFooterProps, TableHeaderProps, TableLoadMoreProps, TableProps, TableRowProps };\nexport { TableBody, TableCell, TableColumn, TableFooter, TableHeader, TableLoadMore, TableRow };\nexport default Table;"],"mappings":";;;;;;;;;;;;;;AAuGA,MAAMqB,wBAAwBnB,cAAkCoB,KAAAA,CAAS;AACzE,MAAMC,qBAAqBrB,cAAkCoB,KAAAA,CAAS;AACtE,MAAME,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRf,OAAO;CACT;CACAgB,eAAe;EACbC,QAAQ;EACRjB,OAAO;CACT;CACAkB,eAAe;EACbD,QAAQ;EACRjB,OAAO;CACT;CACAmB,gBAAgB;EACdF,QAAQ;EACRG,QAAQ;EACRpB,OAAO;CACT;CACAqB,KAAK;EACHd,QAAQ;EACRe,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRxB,OAAO;CACT;CACAyB,aAAa;EACXR,QAAQ;EACRT,QAAQ;EACRY,QAAQ;EACRM,QAAQ;EACR1B,OAAO;CACT;CACA2B,aAAa;EACXV,QAAQ;EACRT,QAAQ;EACRkB,QAAQ;EACR1B,OAAO;CACT;CACA4B,WAAW;EACTC,QA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EACA9B,KAAA,CAACpE,KAAK;EAACmE,EAAA,KAAAnE;EAAAmE,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAA;EAAAF,KAAAC,EAAA;EAAAC,KAAAD,EAAA;CAAA;CApBVhI,gBAAgB+H,IAoBbE,EAAO;CAAC,OACJnB;AAAM;AAEfxG,QAAMyK,OAAOxK;AACbD,QAAMJ,OAAOgJ;AACb5I,QAAMF,SAASgJ;AACf9I,QAAM0K,SAASxK;AACfF,QAAM2K,SAASxK;AACfH,QAAM4K,WAAWtB;AACjBtJ,QAAMD,MAAMwJ"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","createContext","useContext","useLayoutEffect","useState","Cell","RACCell","Column","Row","Table","TableBody","TableFooter","TableHeader","RACTableLoadMoreItem","collectionStyles","mergeRefs","rowStyles","rowLayers","mergeStatefulStyles","mergeStyles","SelectAllLabelContext","undefined","SelectLabelContext","styles","cell","kB7OPa","kg3NbH","k9WMMc","kXLuUW","$$css","cellDisabled","kSiTet","focus","kjBf7l","kInvED","k3XXqK","kMeerF","header","kZKoxP","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kVQacm","kVAEAm","headerHovered","kWkggS","headerPressed","headerSortable","kkrTdU","row","kLZC3w","kPef9Z","kEafiO","rowDisabled","kAXs8y","rowSelected","selection","kzqmXN","khDVqt","sticky","kGVxlE","k87sOh","kY2c9j","table","kLvRdT","className","renderEmptyState","style","children","resizable","label","onResize","onResizeEnd","resizeLabel","selectAllLabel","selectLabel","stickyHeader","ResizeLabelContext","ResizableContext","StickyHeaderContext","NO_MIN_WIDTHS","Map","ColumnMinWidthsContext","REACT_ARIA_MIN_WIDTH","cellContent","cellStyles","state","props","isDisabled","columnContent","sortArrowFor","sortDirection","resizerRule","columnStyles","allowsSorting","isHovered","isPressed","dropAriaLevel","node","removeAttribute","emptyContent","measureColumns","headers","tHead","rows","push","cells","held","map","element","cssText","tableLayout","width","widths","Math","ceil","getBoundingClientRect","css","resizableContainerClassName","isResizing","isFocusVisible","isDragging","dragging","isSelected","hovered","pressed","isDropTarget","dropTarget","direction","t0","$","t1","t2","setElement","t3","ref","minWidths","useColumnMinWidths","t4","tableClasses","t5","t6","t7","t8","t9","t10","t11","t12","TableCell","T0","TableColumn","resizableTable","get","measured","minWidth","max","0","1","TableLoadMore","TableRow","setWidths","measure","next","current","size","every","changes","MutationObserver","observe","characterData","childList","subtree","document","fonts","addEventListener","disconnect","removeEventListener","Body","Footer","Header","LoadMore","RACColumnResizer","RACTable","RACResizableTableContainer","RACTableBody","RACColumn","RACTableFooter","RACTableHeader","RACRow"],"sources":["../../../src/components/table/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { CellRenderProps, ColumnRenderProps, ColumnResizerRenderProps, CellProps as RACCellProps, ColumnProps as RACColumnProps, RowProps as RACRowProps, TableBodyProps as RACTableBodyProps, TableFooterProps as RACTableFooterProps, TableHeaderProps as RACTableHeaderProps, TableLoadMoreItemProps as RACTableLoadMoreItemProps, TableProps as RACTableProps, ResizableTableContainerProps, RowRenderProps, TableBodyRenderProps, TableRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext, useLayoutEffect, useMemo, useState } from 'react';\nimport { Cell as RACCell, Column as RACColumn, ColumnResizer as RACColumnResizer, ResizableTableContainer as RACResizableTableContainer, Row as RACRow, Table as RACTable, TableBody as RACTableBody, TableFooter as RACTableFooter, TableHeader as RACTableHeader, TableLoadMoreItem as RACTableLoadMoreItem } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles } from '../../collection/styles';\nimport { ArrowDownwardGlyph, ArrowUpwardGlyph } from '../../glyphs';\nimport { mergeRefs } from '../../render/ref';\nimport { rowStyles as rowLayers } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Checkbox from '../checkbox';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// A grid of rows and columns, with sorting and selection. The design system\n// carries no data table page — it was dropped after Material Design 2 — so\n// the geometry comes from the archived one at\n// <https://m2.material.io/components/data-tables>, which is the page this\n// component is drawn from: a 56dp header row, 52dp body rows, 16dp of\n// padding on each side of a cell, a medium-weight header to set it apart\n// from the rows, and an arrow beside the name of the column being sorted.\n//\n// Its colour roles are the current system's rather than that page's, since\n// a table sits beside lists, cards and menus that all draw from the tokens\n// here. That means the row's state layers are the ones `src/row` uses — the\n// same hover, pressed and selected treatment a list row takes — so a\n// selected table row and a selected list row on one page cannot disagree.\n//\n// The row is not `src/row`, and that is the one place this departs from the\n// library's other collections. That module's row is a headline with a\n// supporting line and a slot at each end; a table row is a run of cells with\n// no such shape, and forcing one into the other would give every cell the\n// row's 56dp floor and body-large headline. The state layers are shared by\n// being written from the same tokens rather than by sharing the module.\n//\n// Four things are this component's own.\n//\n// **The rule between rows is drawn on the row, not on its cells.** A cell\n// cannot see whether its row is the first one, so a rule per cell either\n// doubles under the header or needs the row's position passed down. The\n// table collapses its borders, which is what lets a `<tr>` carry one.\n//\n// **A selecting table draws its checkbox where the call site puts it.**\n// `selection` on a column and on a cell renders the library's Checkbox in\n// React Aria's selection slot — the column's is select-all, the cell's is\n// that row's. It is a prop rather than an injected column because the header\n// and every row have to agree on how many columns there are, and only the\n// call site can keep that true.\n//\n// **A sortable column is the press target itself.** React Aria puts no\n// button inside the header cell; it makes the cell pressable and sets\n// `aria-sort` on it. So the arrow is content next to the name, and the\n// hover and pressed layers belong to the cell.\n//\n// **The header sticks only when asked.** A sticky header needs an opaque\n// background to scroll rows under, and that colour is only right when the\n// table is in something that scrolls. `stickyHeader` is what says so.\n//\n// **Resizing is asked for twice, and both are needed.** React Aria puts the\n// resize state on a container around the table and the handle inside a\n// column, so `resizable` on the table is what brings the container and\n// `resizable` on a column is what draws its handle. The archived page has no\n// resizer to take a treatment from — it predates the feature — so the handle\n// draws the divider's own rule, thickening and taking the primary role while\n// it is dragged, over a target far wider than the rule.\n//\n// **A resizable table stops filling its width.** The container sets\n// `table-layout: fixed` and `width: min-content` on the table as inline\n// styles, which no rule here can outrank; the container fills the width\n// instead and scrolls when the columns together are wider than it.\n//\n// **And no column of it is narrower than its longest word.** A fixed layout\n// sizes columns without reading what is in them, so a column given less than\n// a word took the word apart, \"Waitin\" over \"g\", wherever a parent such as a\n// `Card` lets words break. So the container keeps words whole, and the table\n// measures what each column holds and hands React Aria that as the column's\n// `minWidth` — see `useColumnMinWidths`. Columns that stop fitting then\n// scroll in the container, as a wide table already does, and a handle stops\n// at the word rather than breaking it. A column given a `minWidth` of its own\n// keeps it.\n//\n// One thing about React Aria's collection is worth knowing before writing a\n// call site. **A column's `id` and a row's `id` share one namespace**, and a\n// value used by both silently drops every column — the table then throws\n// \"Cell count must match column count\", naming the cells rather than the\n// duplicate key that caused it. Nothing here can catch it, since both ids\n// are the call site's to choose; the docstrings below say to keep them\n// apart, and the stories and tests use `col`-prefixed column ids so the two\n// sets cannot meet.\n\n// What the selection checkboxes are called. A context rather than a prop on\n// every column and cell, since it is the table's decision and repeating it\n// per row is how the two drift. Undefined unless the table is given one,\n// which leaves the names React Aria gives in the reader's locale.\nconst SelectAllLabelContext = createContext<string | undefined>(undefined);\nconst SelectLabelContext = createContext<string | undefined>(undefined);\nconst styles = {\n cell: {\n kB7OPa: \"x9f619\",\n kg3NbH: \"x790zyz\",\n k9WMMc: \"x1yc453h\",\n kXLuUW: \"xxymvpz\",\n $$css: true\n },\n cellDisabled: {\n kSiTet: \"x1ppv7y9\",\n $$css: true\n },\n focus: {\n kjBf7l: \"xrgy624 x1v8yhc2\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n header: {\n kZKoxP: \"x1ded5cy\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kVQacm: \"x9h1dke\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n headerHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n headerPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n headerSortable: {\n kWkggS: \"xjbqb8w\",\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n row: {\n kZKoxP: \"xdd8jsf\",\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x1g31smg x178xt8z\",\n $$css: true\n },\n rowDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n rowSelected: {\n kWkggS: \"xp89om9 x1jzqe4\",\n kMwMTN: \"xscdzaa x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selection: {\n kzqmXN: \"x19ddzpn\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n sticky: {\n kWkggS: \"x14s9m32\",\n kGVxlE: \"x1ixd52e\",\n k87sOh: \"x13vifvy\",\n kVAEAm: \"x7wzq59\",\n kY2c9j: \"x1vjfegm\",\n $$css: true\n },\n table: {\n kLvRdT: \"x1mwwwfo\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kzqmXN: \"xh8yej3\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n }\n};\ntype TableBodyProps<T extends object = object> = Omit<RACTableBodyProps<T>, 'className' | 'renderEmptyState' | 'style'> & {\n /** A function may compute the class from the body's render state. */\n className?: RACTableBodyProps<T>['className'];\n /**\n * What the table shows in place of rows when it has none: React Aria's own\n * render function, under React Aria's own name, as List, ListBox, Tree and\n * ChipGroup take it. What it returns is drawn in a row of its own spanning\n * every column, inside the muted, padded box the table draws there.\n */\n renderEmptyState?: RACTableBodyProps<T>['renderEmptyState'];\n /** A function may compute the style from the body's render state. */\n style?: RACTableBodyProps<T>['style'];\n};\ntype TableCellProps = Omit<RACCellProps, 'children' | 'className' | 'style'> & {\n /** What the cell holds. */\n children?: ReactNode;\n /** A function may compute the class from the cell's render state. */\n className?: RACCellProps['className'];\n /**\n * Draws this row's selection checkbox instead of `children`. The row's own\n * text is what names the row; the box inside it takes the table's\n * `selectLabel`.\n */\n selection?: boolean;\n /** A function may compute the style from the cell's render state. */\n style?: RACCellProps['style'];\n};\ntype TableColumnProps = {\n /** The column's name. */\n children?: ReactNode;\n /** A function may compute the class from the column's render state. */\n className?: RACColumnProps['className'];\n /**\n * Draws a handle at the column's trailing edge that drags its width. Needs\n * the table's own `resizable` as well — React Aria keeps the resize state\n * on a container around the table, and without it there is nothing for a\n * handle to change. `defaultWidth`, `minWidth` and `maxWidth` are React\n * Aria's and apply only inside that container.\n */\n resizable?: boolean;\n /**\n * Draws the select-all checkbox instead of `children`, for the column the\n * rows put their own checkboxes in.\n */\n selection?: boolean;\n /** A function may compute the style from the column's render state. */\n style?: RACColumnProps['style'];\n} & Omit<RACColumnProps, 'children' | 'className' | 'style'>;\ntype TableFooterProps<T extends object = object> = RACTableFooterProps<T>;\ntype TableHeaderProps<T extends object = object> = RACTableHeaderProps<T>;\ntype TableLoadMoreProps = Omit<RACTableLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\ntype TableProps = {\n /** A function may compute the class from the table's render state. */\n className?: RACTableProps['className'];\n /** Called as a column is dragged, with every column's width. */\n onResize?: ResizableTableContainerProps['onResize'];\n /** Called once a drag ends, with every column's width. */\n onResizeEnd?: ResizableTableContainerProps['onResizeEnd'];\n /**\n * Lets columns marked `resizable` be dragged, by putting the table in the\n * container React Aria keeps the resize state on. A resizable table sizes\n * to its columns rather than to its parent, and that container is what\n * fills the width and scrolls instead.\n */\n resizable?: boolean;\n /**\n * What the resize handle is called, for a screen reader. React Aria\n * composes it with the column's own name. Left out, React Aria names it in\n * the reader's locale — \"Resizer\" in English.\n */\n resizeLabel?: string;\n /**\n * What the select-all checkbox is called, for a screen reader. Left out,\n * React Aria names it in the reader's locale — \"Select All\" in English.\n */\n selectAllLabel?: string;\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * Left out, React Aria names it in the reader's locale — \"Select\" in\n * English.\n */\n selectLabel?: string;\n /**\n * Holds the header row in place while the rows scroll under it. Needs the\n * table inside something that scrolls; on a table that does not, it draws\n * the same as without it.\n */\n stickyHeader?: boolean;\n /** A function may compute the style from the table's render state. */\n style?: RACTableProps['style'];\n} & Omit<RACTableProps, 'className' | 'style'>;\ntype TableRowProps<T extends object = object> = Omit<RACRowProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the row's render state. */\n className?: RACRowProps<T>['className'];\n /** A function may compute the style from the row's render state. */\n style?: RACRowProps<T>['style'];\n};\n\n// What the resize handles are called, for the same reason the selection\n// labels travel this way: it is the table's decision, and repeating it per\n// column is how the two drift. Undefined by default, as they are.\nconst ResizeLabelContext = createContext<string | undefined>(undefined);\n\n// Whether the table brought the container. React Aria's resizer throws\n// outright without one — \"Wrap your <Table> in a <ResizableTableContainer>\",\n// naming a component a consumer of this library never writes — so a column\n// asking to resize inside a table that does not would take the whole page\n// down. It draws no handle instead.\nconst ResizableContext = createContext(false);\n\n// Whether the header sticks, so a column reaches it without every call site\n// repeating the table's own decision on each one.\nconst StickyHeaderContext = createContext(false);\n\n// The narrowest each column of a resizable table can be with its words whole,\n// by the column's header cell. Empty for a table that does not resize, whose\n// columns size to what they hold anyway.\nconst NO_MIN_WIDTHS: ReadonlyMap<Element, number> = new Map();\nconst ColumnMinWidthsContext = createContext(NO_MIN_WIDTHS);\n\n// React Aria's own minimum for a column, which a measured one below it would\n// otherwise lower.\nconst REACT_ARIA_MIN_WIDTH = 75;\n\n// What a body cell draws, and the classes it draws with. Written as calls\n// rather than inline at the props, which is what react-perf's\n// no-new-function-as-prop and jsx-no-jsx-as-prop are after; the React\n// Compiler memoises the results on their inputs.\n// The return type is written out rather than inferred, here and in the two\n// below: `ReactNode` is a union that includes a promise, and a function\n// inferred as returning one has to be `async`.\nfunction cellContent(children: ReactNode, selection: boolean, label: string | undefined): ReactNode {\n if (!selection) {\n return children;\n }\n return <Checkbox aria-label={label} slot=\"selection\" />;\n}\n\n// A cell's classes, faded on a disabled row unless it holds the checkbox,\n// which draws its own disabled state.\nfunction cellStyles(selection: boolean) {\n return (state: CellRenderProps) => stylex.props(styles.cell, styles.focus, selection ? styles.selection : state.isDisabled && styles.cellDisabled);\n}\nfunction columnContent(children: ReactNode, selection: boolean, label: string | undefined, resizable: boolean, resizeLabel: string | undefined): RACColumnProps['children'] {\n if (selection) {\n return <Checkbox aria-label={label} slot=\"selection\" />;\n }\n // The handle is a sibling of the name rather than part of it: React Aria\n // renders it as its own element, positioned against the cell's trailing\n // edge, which the name's own box does not reach.\n return (state: ColumnRenderProps): ReactNode => <>\n <span className=\"x6s0dn4 x78zum5 x126z3so\">\n {children}\n {sortArrowFor(state.sortDirection)}\n </span>\n {resizable ? <RACColumnResizer aria-label={resizeLabel} className=\"x5yr21d x9f619 xicojor xvy4d1p x13vifvy x18zu7yx x10l6tqk x5ve5x3 x1vjfegm\">\n {resizerRule}\n </RACColumnResizer> : null}\n </>;\n}\nfunction columnStyles(selection: boolean, sticky: boolean) {\n return (state: ColumnRenderProps) => stylex.props(styles.cell, styles.header, styles.focus, sticky && styles.sticky, selection && styles.selection, state.allowsSorting && styles.headerSortable, state.allowsSorting && state.isHovered && styles.headerHovered, state.allowsSorting && state.isPressed && styles.headerPressed);\n}\n\n// React Aria puts `aria-level` on the load-more row, and `aria-level` is only\n// valid on a row inside a `treegrid` — a grid's rows have no level. axe flags\n// it as `aria-conditional-attr`, and this library's stories run axe as an\n// error, so a table with a load-more row would fail on an attribute nothing\n// here asks for.\n//\n// It cannot be turned off through props: React Aria writes it after spreading\n// what the call site passed, so `aria-level={undefined}` is overwritten. The\n// attribute is taken off the element instead. React writes an attribute only\n// when its prop changes between renders, and this one is always 1, so the\n// removal holds rather than being undone by the next render. `load more` in\n// index.test.tsx pins that it is gone, which is what would notice if React\n// Aria stopped setting it or started varying it.\nfunction dropAriaLevel(node: HTMLTableRowElement | null) {\n node?.removeAttribute('aria-level');\n}\n\n// What the body draws in place of rows: whatever the call site's function\n// returns, inside the box that pads and centres it. A call rather than a\n// function written at the prop, for the same reason the others are.\n//\n// The box is the one thing this adds to React Aria's prop, and the one way\n// the table differs from its siblings, which pass theirs straight through and\n// draw nothing around it. A table's empty state goes in a spanning cell that\n// is not this component's and carries no padding, so without the box the\n// content would sit against the table's edge with no room around it.\nfunction emptyContent(renderEmptyState: (state: TableBodyRenderProps) => ReactNode) {\n // The return type is written out rather than inferred: `ReactNode` is a\n // union that includes a promise, and a function inferred as returning one\n // has to be `async`.\n return (state: TableBodyRenderProps): ReactNode => <span className=\"x9f619 x1w5n3ug x1lliihq xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh x1lrxzt4 x790zyz x2b8uid\">{renderEmptyState(state)}</span>;\n}\n\n/**\n * Each header cell's width with the table laid out to its content. A fixed\n * layout never reads a cell's content, so the table is laid out the other\n * way for the length of the measurement: automatically, at no width, and\n * with the widths React Aria put on the header cells lifted, which leaves\n * every column at the width of the longest word it holds, its padding\n * included. The styles are put back before returning, so nothing is painted\n * in between.\n */\nfunction measureColumns(table: HTMLTableElement): Map<Element, number> {\n const headers: HTMLTableCellElement[] = [];\n for (const row of table.tHead?.rows ?? []) {\n headers.push(...row.cells);\n }\n const held = [table, ...headers].map(element => [element, element.style.cssText] as const);\n table.style.tableLayout = 'auto';\n table.style.width = '0px';\n for (const header of headers) {\n header.style.width = '';\n }\n const widths = new Map(headers.map(header => [header, Math.ceil(header.getBoundingClientRect().width)]));\n for (const [element, css] of held) {\n element.style.cssText = css;\n }\n return widths;\n}\n\n// The container's class. React Aria takes a plain string here rather than a\n// function of render state, since the container reports none — so this is a\n// call rather than the function form the other parts pass.\nfunction resizableContainerClassName() {\n return {\n className: \"x9f619 xh8yej3 x1h4wwuj xw2csxc\"\n }.className ?? '';\n}\n\n// The rule a handle draws, from React Aria's own render state — it reports\n// the drag and the keyboard focus separately, and the two get one treatment.\nfunction resizerRule(state: ColumnResizerRenderProps): ReactNode {\n return <span {...{\n 0: {\n className: \"x1l12bh x5yr21d x1x0u81l xf1j0q2 xmzn1mo x9f619 x1g12otp x1i1rx1s x13vifvy x9q68il x47corl x10l6tqk\"\n },\n 1: {\n className: \"x5yr21d xf1j0q2 x9f619 x1g12otp x13vifvy x9q68il x47corl x10l6tqk xnety89 x1ksdfms x12inkfj xfo62xy\"\n }\n }[!!(state.isResizing || state.isFocusVisible) << 0]} />;\n}\nfunction rowStyles(state: RowRenderProps) {\n return stylex.props(styles.row,\n // The same ring a cell and a column header draw, and for the same\n // reason: React Aria moves focus to the row itself, so the row is where\n // it has to show. Unconditional, as it is on those two — `focus` carries\n // its own `:focus-visible`, and the browser's default ring is what shows\n // through without it: a colour and an offset the rest of the table does\n // not use, and one no forced-colours mode is obliged to keep.\n styles.focus,\n // The lists page's dragged row and the drop target a row draws, from\n // `src/row` as every other collection's row takes them — the dragged one\n // before the selected container, so a selected row keeps it while it\n // moves.\n state.isDragging && rowLayers.dragging, state.isSelected && styles.rowSelected,\n // The state layers come from the render state, which is what makes a\n // row that only runs an action — `onRowAction`, a row's `onAction` or\n // `href` — take them as a selectable one does: React Aria reports a row\n // hovered or pressed only when a press does something to it, whether\n // that is selecting it, running its action or dragging it.\n state.isHovered && rowLayers.hovered, state.isPressed && rowLayers.pressed, state.isDropTarget && rowLayers.dropTarget, state.isDisabled && styles.rowDisabled);\n}\n\n// The arrow beside a sorted column's name. Nothing is drawn on a column that\n// is sortable but not currently sorted: the page puts the arrow next to the\n// column being sorted, and an arrow on every sortable column would say every\n// one of them was.\nfunction sortArrowFor(direction: 'ascending' | 'descending' | undefined) {\n if (direction === undefined) {\n return null;\n }\n return direction === 'ascending' ? <ArrowUpwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" /> : <ArrowDownwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" />;\n}\n\n/**\n * A grid of rows and columns. Sorting and selection are React Aria's: pass\n * `sortDescriptor` with `onSortChange` and mark the sortable columns\n * `allowsSorting`, and set `selectionMode` to `single` or `multiple` with\n * `selectedKeys` and `onSelectionChange`, or `defaultSelectedKeys`.\n *\n * ```tsx\n * <Table aria-label=\"Label\" selectionMode=\"multiple\">\n * <Table.Header>\n * <Table.Column selection />\n * <Table.Column id=\"name\" isRowHeader>Label</Table.Column>\n * </Table.Header>\n * <Table.Body>\n * <Table.Row id=\"first\">\n * <Table.Cell selection />\n * <Table.Cell>First item</Table.Cell>\n * </Table.Row>\n * </Table.Body>\n * </Table>\n * ```\n *\n * Composed from parts, since a cell takes arbitrary content: `Table.Header`,\n * `Table.Column`, `Table.Body`, `Table.Row`, `Table.Cell` and\n * `Table.Footer`. Name the table with `aria-label` or `aria-labelledby`, and\n * mark one column `isRowHeader` so a screen reader has something to read a\n * row by.\n *\n * The call site's `className` and `style` land on the table, which is the\n * element a layout positions.\n */\nfunction Table({\n onResize,\n onResizeEnd,\n resizable = false,\n resizeLabel,\n selectAllLabel,\n selectLabel,\n stickyHeader = false,\n ...props\n}: RefAttributes<HTMLTableElement> & TableProps) {\n // Held as state rather than in a ref object, since the columns are\n // measured from an effect that has to run again when it changes, and only\n // for a table that resizes, so no other table renders twice for it. The\n // call site's ref lands on the same element, read off `props` for the\n // reason NavigationBar gives.\n const [element, setElement] = useState<HTMLTableElement | null>(null);\n const ref = useMemo(() => resizable ? mergeRefs<HTMLTableElement>(setElement, props.ref ?? undefined) : props.ref, [props.ref, resizable]);\n const minWidths = useColumnMinWidths(resizable ? element : null);\n const table = <RACTable {...props} {...mergeStatefulStyles(tableClasses, props)} ref={ref} />;\n return <SelectAllLabelContext value={selectAllLabel}>\n <SelectLabelContext value={selectLabel}>\n <ResizeLabelContext value={resizeLabel}>\n <ResizableContext value={resizable}>\n <StickyHeaderContext value={stickyHeader}>\n <ColumnMinWidthsContext value={minWidths}>\n {resizable ? <RACResizableTableContainer className={resizableContainerClassName()} onResize={onResize} onResizeEnd={onResizeEnd}>\n {table}\n </RACResizableTableContainer> : table}\n </ColumnMinWidthsContext>\n </StickyHeaderContext>\n </ResizableContext>\n </ResizeLabelContext>\n </SelectLabelContext>\n </SelectAllLabelContext>;\n}\n\n/**\n * The rows. `renderEmptyState` is what it shows when there are none — a table\n * with no rows and nothing to say in their place is a blank area with a\n * header over it.\n *\n * It carries no styles of its own, since every rule a body needs is drawn by\n * the rows inside it, so a `className` here lands on the `<tbody>` through\n * React Aria rather than through a merge.\n */\nfunction TableBody<T extends object = object>({\n renderEmptyState,\n ...props\n}: RefAttributes<HTMLTableSectionElement> & TableBodyProps<T>) {\n return <RACTableBody<T> {...props} renderEmptyState={renderEmptyState === undefined ? undefined : emptyContent(renderEmptyState)} />;\n}\n\n/**\n * One cell. `selection` draws this row's checkbox in place of whatever else\n * the cell would hold. On a disabled row the cell fades as a whole, so what\n * it holds fades with its text.\n */\nfunction TableCell({\n children,\n selection = false,\n ...props\n}: RefAttributes<HTMLTableCellElement> & TableCellProps) {\n const label = useContext(SelectLabelContext);\n return <RACCell {...props} {...mergeStatefulStyles(cellStyles(selection), props)}>\n {cellContent(children, selection, label)}\n </RACCell>;\n}\n\n// The table's own classes, with the drop target the other collections'\n// boxes draw while a drop would land on the table as a whole.\nfunction tableClasses(state: TableRenderProps) {\n return stylex.props(styles.table, state.isDropTarget && collectionStyles.dropTarget);\n}\n\n/**\n * One column. `allowsSorting` is React Aria's and makes the header cell\n * itself the control that sorts; the arrow appears on the column the\n * `sortDescriptor` names. `isRowHeader` marks the column a screen reader\n * reads a row by.\n *\n * Its `id` shares a namespace with the rows', so give the two sets values\n * that cannot collide — a column and a row with one id between them leaves\n * the table with no columns at all.\n */\nfunction TableColumn({\n children,\n resizable = false,\n selection = false,\n ...props\n}: RefAttributes<HTMLTableCellElement> & TableColumnProps) {\n const label = useContext(SelectAllLabelContext);\n const resizeLabel = useContext(ResizeLabelContext);\n const resizableTable = useContext(ResizableContext);\n const sticky = useContext(StickyHeaderContext);\n // The header cell, which is what the table's measurements are keyed by,\n // held only in a table that measures them.\n const [element, setElement] = useState<HTMLTableCellElement | null>(null);\n const ref = useMemo(() => resizableTable ? mergeRefs<HTMLTableCellElement>(setElement, props.ref ?? undefined) : props.ref, [props.ref, resizableTable]);\n const minWidths = useContext(ColumnMinWidthsContext);\n const measured = element === null ? undefined : minWidths.get(element);\n return <RACColumn {...props} {...mergeStatefulStyles(columnStyles(selection, sticky), props)} minWidth={props.minWidth ?? (measured === undefined ? undefined : Math.max(measured, REACT_ARIA_MIN_WIDTH))} ref={ref}>\n {columnContent(children, selection, label, resizable && resizableTable, resizeLabel)}\n </RACColumn>;\n}\n\n/**\n * A row under the body, for totals and the like. It is not part of the\n * selection or the keyboard navigation — React Aria keeps it out of both.\n */\nfunction TableFooter<T extends object = object>(props: RefAttributes<HTMLTableSectionElement> & TableFooterProps<T>) {\n return <RACTableFooter<T> {...props} {...mergeStyles({\n className: \"x12smttz x13fuv20 x178xt8z x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4\"\n }, props)} />;\n}\n\n/**\n * The header row, holding the columns, and the rule drawn under it — which\n * moves to the cells when the header sticks, since a row group's border does\n * not travel with cells `position: sticky` has lifted out of it.\n */\nfunction TableHeader<T extends object = object>(props: RefAttributes<HTMLTableSectionElement> & TableHeaderProps<T>) {\n const sticky = useContext(StickyHeaderContext);\n return <RACTableHeader<T> {...props} {...mergeStatefulStyles({\n 0: {\n className: \"x1j6faob x1q0q8m5 xso031l\"\n },\n 1: {}\n }[!!sticky << 0], props)} />;\n}\n\n/**\n * The row the table shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`. It goes inside `Table.Body`, after the rows.\n */\nfunction TableLoadMore({\n label,\n ref,\n ...props\n}: RefAttributes<HTMLTableRowElement> & TableLoadMoreProps) {\n return <RACTableLoadMoreItem {...props} {...mergeStyles({\n className: \"xdd8jsf\"\n }, props)} ref={mergeRefs(dropAriaLevel, ref ?? undefined)}>\n <span className=\"x6s0dn4 x9f619 x78zum5 xl56j7k\">\n <CollectionLoadMore diameter=\"24px\" label={label} />\n </span>\n </RACTableLoadMoreItem>;\n}\n\n/**\n * One row. Give every row an `id` — that is the key selection is reported\n * by, and it has to differ from every column's. `onAction` runs when the\n * row is pressed.\n */\nfunction TableRow<T extends object = object>(props: RefAttributes<HTMLTableRowElement> & TableRowProps<T>) {\n return <RACRow<T> {...props} {...mergeStatefulStyles(rowStyles, props)} />;\n}\n\n/**\n * The narrowest each column of a resizable table can be with none of its\n * words broken, by the column's header cell, for the columns to take as\n * their minimum — see the header.\n *\n * Measured again when a row, a cell or its text changes, and when a font\n * finishes loading, which is when a word's width changes; never when the\n * table is resized, since what a column holds does not change with it.\n */\nfunction useColumnMinWidths(table: HTMLTableElement | null) {\n const [widths, setWidths] = useState(NO_MIN_WIDTHS);\n useLayoutEffect(() => {\n if (table === null) {\n return undefined;\n }\n const measure = () => {\n const next = measureColumns(table);\n setWidths(current => current.size === next.size && [...next].every(([header, width]) => current.get(header) === width) ? current : next);\n };\n measure();\n const changes = new MutationObserver(measure);\n changes.observe(table, {\n characterData: true,\n childList: true,\n subtree: true\n });\n document.fonts.addEventListener('loadingdone', measure);\n return () => {\n changes.disconnect();\n document.fonts.removeEventListener('loadingdone', measure);\n };\n }, [table]);\n return widths;\n}\nTable.Body = TableBody;\nTable.Cell = TableCell;\nTable.Column = TableColumn;\nTable.Footer = TableFooter;\nTable.Header = TableHeader;\nTable.LoadMore = TableLoadMore;\nTable.Row = TableRow;\nexport type { TableBodyProps, TableCellProps, TableColumnProps, TableFooterProps, TableHeaderProps, TableLoadMoreProps, TableProps, TableRowProps };\nexport { TableBody, TableCell, TableColumn, TableFooter, TableHeader, TableLoadMore, TableRow };\nexport default Table;"],"mappings":";;;;;;;;;;;;;;AAuGA,MAAMqB,wBAAwBnB,cAAkCoB,KAAAA,CAAS;AACzE,MAAMC,qBAAqBrB,cAAkCoB,KAAAA,CAAS;AACtE,MAAME,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,cAAc;EACZC,QAAQ;EACRF,OAAO;CACT;CACAG,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRP,OAAO;CACT;CACAQ,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRjB,OAAO;CACT;CACAkB,eAAe;EACbC,QAAQ;EACRnB,OAAO;CACT;CACAoB,eAAe;EACbD,QAAQ;EACRnB,OAAO;CACT;CACAqB,gBAAgB;EACdF,QAAQ;EACRG,QAAQ;EACRtB,OAAO;CACT;CACAuB,KAAK;EACHd,QAAQ;EACRe,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACR1B,OAAO;CACT;CACA2B,aAAa;EACXR,QAAQ;EACRT,QAAQ;EACRY,QAAQ;EACRM,QAAQ;EACR5B,OAAO;CACT;CACA6B,aAAa;EACXV,QAAQ;EACRT,QAAQ;EACR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,aAChD;IACLK,QAAOS,WAAY;IACnBH,SAAQC,MAAMG,oBAAqB,eAAef,OAAO;GAAC;EAC3D;EACA9B,KAAA,CAACpE,KAAK;EAACmE,EAAA,KAAAnE;EAAAmE,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAA;EAAAF,KAAAC,EAAA;EAAAC,KAAAD,EAAA;CAAA;CApBVlI,gBAAgBiI,IAoBbE,EAAO;CAAC,OACJlB;AAAM;AAEf3G,QAAM2K,OAAO1K;AACbD,QAAMJ,OAAOkJ;AACb9I,QAAMF,SAASkJ;AACfhJ,QAAM4K,SAAS1K;AACfF,QAAM6K,SAAS1K;AACfH,QAAM8K,WAAWtB;AACjBxJ,QAAMD,MAAM0J"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanso-labs/kanso-ui",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.27",
|
|
4
4
|
"description": "A React component library built on React Aria Components primitives and styled with StyleX, with design tokens sourced from a single W3C DTCG file and compiled via Style Dictionary",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
"@commitlint/cli": "21.2.4",
|
|
87
87
|
"@commitlint/config-conventional": "21.2.4",
|
|
88
88
|
"@eslint/js": "10.0.1",
|
|
89
|
-
"@kanso-labs/kanso-ui-core": "0.1.
|
|
90
|
-
"@kanso-labs/unplugin-style-dictionary": "0.10.
|
|
89
|
+
"@kanso-labs/kanso-ui-core": "0.1.16",
|
|
90
|
+
"@kanso-labs/unplugin-style-dictionary": "0.10.61",
|
|
91
91
|
"@microsoft/api-extractor": "7.60.1",
|
|
92
|
-
"@rolldown/plugin-babel": "0.3.
|
|
92
|
+
"@rolldown/plugin-babel": "0.3.1",
|
|
93
93
|
"@storybook/addon-a11y": "10.6.6",
|
|
94
94
|
"@storybook/addon-docs": "10.6.6",
|
|
95
95
|
"@storybook/addon-vitest": "10.6.6",
|
|
@@ -103,12 +103,12 @@
|
|
|
103
103
|
"@types/node": "26.6.6",
|
|
104
104
|
"@types/react": "19.3.0",
|
|
105
105
|
"@types/react-dom": "19.3.0",
|
|
106
|
-
"@vitejs/plugin-react": "6.
|
|
106
|
+
"@vitejs/plugin-react": "6.3.0",
|
|
107
107
|
"@vitest/browser-playwright": "5.1.0",
|
|
108
108
|
"@vitest/coverage-v8": "5.1.0",
|
|
109
109
|
"babel-plugin-react-compiler": "1.0.0",
|
|
110
110
|
"eslint": "10.14.0",
|
|
111
|
-
"eslint-plugin-oxlint": "1.
|
|
111
|
+
"eslint-plugin-oxlint": "1.93.0",
|
|
112
112
|
"eslint-plugin-perfectionist": "5.13.0",
|
|
113
113
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
114
114
|
"eslint-plugin-react-refresh": "0.5.7",
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"husky": "9.1.7",
|
|
118
118
|
"lightningcss": "1.33.0",
|
|
119
119
|
"lint-staged": "17.6.0",
|
|
120
|
-
"oxfmt": "0.
|
|
121
|
-
"oxlint": "1.
|
|
120
|
+
"oxfmt": "0.78.0",
|
|
121
|
+
"oxlint": "1.93.0",
|
|
122
122
|
"oxlint-tsgolint": "7.0.2006",
|
|
123
123
|
"playwright": "1.64.1",
|
|
124
124
|
"publint": "0.3.25",
|
|
@@ -129,8 +129,8 @@
|
|
|
129
129
|
"style-dictionary": "5.8.0",
|
|
130
130
|
"tsdown": "0.23.7",
|
|
131
131
|
"typescript": "6.0.3",
|
|
132
|
-
"typescript-eslint": "8.72.
|
|
133
|
-
"vite": "8.3.
|
|
132
|
+
"typescript-eslint": "8.72.2",
|
|
133
|
+
"vite": "8.3.7",
|
|
134
134
|
"vitest": "5.1.0"
|
|
135
135
|
},
|
|
136
136
|
"peerDependencies": {
|