@kanso-labs/kanso-ui 0.45.22 → 0.45.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/badge/index.js.map +1 -1
- package/dist/button/context.js.map +1 -1
- package/dist/button/group.js.map +1 -1
- package/dist/button/hooks.js.map +1 -1
- package/dist/button/index.d.ts +3 -4
- package/dist/button/index.js.map +1 -1
- package/dist/button/styles.js.map +1 -1
- package/dist/button/toggle.js.map +1 -1
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js.map +1 -1
- package/dist/carousel/arrangement.d.ts +1 -2
- package/dist/carousel/arrangement.js.map +1 -1
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/label.js.map +1 -1
- package/dist/chip/styles.js.map +1 -1
- package/dist/collection/empty.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/styles.js.map +1 -1
- package/dist/collection/text.js.map +1 -1
- package/dist/color-scheme.d.ts +1 -2
- package/dist/color-scheme.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +1 -2
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +1 -2
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/index.d.ts +1 -2
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.d.ts +1 -2
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/breadcrumbs/index.d.ts +1 -2
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/button/index.d.ts +1 -2
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button-group/index.d.ts +1 -2
- package/dist/components/button-group/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +1 -2
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/card/index.d.ts +1 -2
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/carousel/index.d.ts +1 -2
- package/dist/components/carousel/index.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +1 -2
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.d.ts +1 -2
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +1 -2
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +1 -2
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/code/index.d.ts +1 -2
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/color-area/index.d.ts +1 -2
- package/dist/components/color-area/index.js.map +1 -1
- package/dist/components/color-field/index.d.ts +1 -2
- package/dist/components/color-field/index.js.map +1 -1
- package/dist/components/color-picker/index.d.ts +1 -2
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-slider/index.d.ts +1 -2
- package/dist/components/color-slider/index.js.map +1 -1
- package/dist/components/color-swatch/index.d.ts +1 -2
- package/dist/components/color-swatch/index.js.map +1 -1
- package/dist/components/color-swatch-picker/index.d.ts +1 -2
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/color-wheel/index.d.ts +1 -2
- package/dist/components/color-wheel/index.js.map +1 -1
- package/dist/components/combo-box/index.d.ts +1 -2
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/container/index.d.ts +1 -2
- package/dist/components/container/index.js.map +1 -1
- package/dist/components/copy-field/index.d.ts +1 -2
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/currency/index.d.ts +1 -2
- package/dist/components/currency/index.js.map +1 -1
- package/dist/components/date-field/index.d.ts +1 -2
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-picker/index.d.ts +1 -2
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/date-range-picker/index.d.ts +1 -2
- package/dist/components/date-range-picker/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +1 -2
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/disclosure/index.d.ts +1 -2
- package/dist/components/disclosure/index.js.map +1 -1
- package/dist/components/disclosure-group/index.d.ts +1 -2
- package/dist/components/disclosure-group/index.js.map +1 -1
- package/dist/components/drop-zone/index.d.ts +1 -2
- package/dist/components/drop-zone/index.js.map +1 -1
- package/dist/components/drop-zone/styles.js.map +1 -1
- package/dist/components/fab/index.d.ts +1 -2
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/fab-menu/index.d.ts +1 -2
- package/dist/components/fab-menu/index.js.map +1 -1
- package/dist/components/feed/index.d.ts +1 -2
- package/dist/components/feed/index.js.map +1 -1
- package/dist/components/form/index.d.ts +1 -2
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +1 -2
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/keycap/index.d.ts +1 -2
- package/dist/components/keycap/index.js.map +1 -1
- package/dist/components/link/index.d.ts +1 -2
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list/index.d.ts +1 -2
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.d.ts +1 -2
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/list-detail/index.d.ts +1 -2
- package/dist/components/list-detail/index.js.map +1 -1
- package/dist/components/list-item/index.d.ts +1 -2
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/loading-indicator/index.d.ts +1 -2
- package/dist/components/loading-indicator/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +1 -2
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +1 -2
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-bar/index.d.ts +1 -2
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-rail/index.d.ts +1 -2
- package/dist/components/navigation-rail/index.js.map +1 -1
- package/dist/components/navigation-tree/index.d.ts +1 -2
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +1 -2
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +1 -2
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +1 -2
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +1 -2
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +1 -2
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +1 -2
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +1 -2
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-view/index.d.ts +1 -2
- package/dist/components/search-view/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +1 -2
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/select/index.d.ts +1 -2
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/separator/index.d.ts +1 -2
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +1 -2
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/slider/index.d.ts +1 -2
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +1 -2
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/split-button/index.d.ts +1 -2
- package/dist/components/split-button/index.js.map +1 -1
- package/dist/components/stack/index.d.ts +1 -2
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/supporting-pane/index.d.ts +1 -2
- package/dist/components/supporting-pane/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +1 -2
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/table/index.d.ts +1 -2
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.d.ts +1 -2
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tag/index.d.ts +1 -2
- package/dist/components/tag/index.js.map +1 -1
- package/dist/components/text/index.d.ts +1 -2
- package/dist/components/text/index.js.map +1 -1
- package/dist/components/text-area/index.d.ts +1 -2
- package/dist/components/text-area/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +1 -2
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/time-field/index.d.ts +1 -2
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/time-picker/index.d.ts +1 -2
- package/dist/components/time-picker/index.js.map +1 -1
- package/dist/components/token-field/index.d.ts +1 -2
- package/dist/components/token-field/index.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +1 -2
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +1 -2
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tree/index.d.ts +1 -2
- package/dist/components/tree/index.js.map +1 -1
- package/dist/control/index.js.map +1 -1
- package/dist/control/styles.js.map +1 -1
- package/dist/drag/hooks.d.ts +1 -2
- package/dist/drag/hooks.js.map +1 -1
- package/dist/drag/index.js.map +1 -1
- package/dist/drag/styles.js.map +1 -1
- package/dist/fab/styles.js.map +1 -1
- package/dist/field/index.d.ts +3 -4
- package/dist/field/index.js.map +1 -1
- package/dist/field/press.js.map +1 -1
- package/dist/field/root.js.map +1 -1
- package/dist/field/styles.js.map +1 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/glyphs/styles.js.map +1 -1
- package/dist/hooks/useAppBarScroll.d.ts +1 -2
- package/dist/hooks/useAppBarScroll.js.map +1 -1
- package/dist/hooks/useBottomEdge.js.map +1 -1
- package/dist/hooks/useClippedTitle.js.map +1 -1
- package/dist/hooks/useImageLoadingStatus.js.map +1 -1
- package/dist/hooks/useRipple.js.map +1 -1
- package/dist/hooks/useScrollStop.js.map +1 -1
- package/dist/hooks/useToggleGroupDisabled.js.map +1 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js.map +1 -1
- package/dist/indicator/index.js.map +1 -1
- package/dist/indicator/styles.d.ts +1 -2
- package/dist/indicator/styles.js.map +1 -1
- package/dist/kanso-ui-core/defaults-DMH0HWCw.d.ts +1 -2
- package/dist/keycap/context.js.map +1 -1
- package/dist/layout.d.ts +1 -2
- package/dist/layout.js.map +1 -1
- package/dist/mark/index.js.map +1 -1
- package/dist/mark/initials.js.map +1 -1
- package/dist/mark/styles.js.map +1 -1
- package/dist/navigation/context.js.map +1 -1
- package/dist/navigation/index.d.ts +2 -3
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/styles.js.map +1 -1
- package/dist/overlay/index.js.map +1 -1
- package/dist/render/aria.js.map +1 -1
- package/dist/render/content.js.map +1 -1
- package/dist/render/name.d.ts +1 -2
- package/dist/render/ref.js.map +1 -1
- package/dist/render/useRender.d.ts +1 -2
- package/dist/render/useRender.js.map +1 -1
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js.map +1 -1
- package/dist/segments/index.js.map +1 -1
- package/dist/segments/styles.js.map +1 -1
- package/dist/styles/chequer.js.map +1 -1
- package/dist/styles/color.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/icon-button.js.map +1 -1
- package/dist/styles/merge.js.map +1 -1
- package/dist/styles/overlay.d.ts +2 -3
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles/picker.js.map +1 -1
- package/dist/styles/ripple.js.map +1 -1
- package/dist/styles/scheme.js.map +1 -1
- package/dist/swatch/index.js.map +1 -1
- package/dist/theme-scope.d.ts +1 -2
- package/dist/theme-scope.js.map +1 -1
- package/dist/tokens/design.tokens.stylex.js.map +1 -1
- package/dist/tokens/values.js.map +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","MouseEvent","ReactMouseEvent","ReactNode","PointerEvent","ReactPointerEvent","RefAttributes","SwitchFieldProps","RACSwitchFieldProps","SwitchButtonRenderProps","SwitchFieldRenderProps","stylex","useCallback","useRef","useState","SwitchButton","SwitchField","AccessibleName","ControlLabel","controlStyles","FieldMessage","invalidFrom","useFieldValidationBehavior","CheckGlyph","CloseGlyph","useRipple","focus","mergeStatefulStyles","colors","motion","radii","stateLayerOpacity","FORCED_COLORS","_temp","kLqNvP","styles","control","kgeoSG","kGOzcv","kpsdNU","kEoFBp","kGNEyG","kZKoxP","kB7OPa","kkrTdU","k1xSpc","kmuXW","kzqmXN","kjj79g","kVAEAm","$$css","handle","k6CgDc","kWkggS","kaIpWk","kMwMTN","kGuDYH","kIyJzY","k1ekBW","kAMwcw","handleActive","handleDisabled","handleError","handleOn","handleOnActive","handleOnDisabled","handlePressed","handleWithIcon","layer","kpwlN0","seat","k87sOh","seatAt","offset","val","undefined","seatDraggable","kFalU9","seatDragging","seatOn","track","kVAM5u","ksu8eU","kMzoRj","trackDisabled","trackError","trackOn","trackOnDisabled","trackOnError","hoverLayers","error","off","on","focusLayers","pressedLayers","TRAVEL","MOUSE_SLOP","TOUCH_SLOP","Drag","ReturnType","useHandleDrag","Ripple","HTMLSpanElement","SwitchProps","children","description","icon","unselectedIcon","Omit","buttonContent","icons","ripple","drag","state","interactive","isDisabled","isReadOnly","isSelected","tone","isInvalid","dragging","active","isHovered","isPressed","isFocusVisible","iconShown","props","controlReadOnly","controlDisabled","ringVisible","handlers","surface","drawsIcon","fieldContent","button","messages","Switch","t0","$","t1","t2","validationBehavior","T0","t3","t4","field","t5","t6","t7","t8","t9","t10","setOffset","origin","settled","cancelClick","Symbol","for","current","onPointerCancel","event","preventDefault","stopPropagation","onClickCapture","event_0","from","along","rtl","x","clientX","Math","abs","slop","next","min","max","base","onPointerMove","event_1","from_0","stopped","currentTarget","dispatchEvent","bubbles","pointerId","pointerType","input","closest","querySelector","focuses","preventScroll","click","onPointerUp","onPointerDown","event_2","touch","getComputedStyle","direction","setPointerCapture","stylex.props","_c","props"],"sources":["../../../src/components/switch/index.tsx"],"sourcesContent":["'use client';\n\n// React's event types are aliased because `useHandleDrag` also constructs a\n// DOM `PointerEvent`. Imported unaliased, the name shadows that constructor:\n// TypeScript still resolves the call to the global, since a type-only import\n// takes no value name, but a reader and a static analyser alike read it as\n// React's type, which has no runtime value behind it at all.\nimport type { MouseEvent as ReactMouseEvent, ReactNode, PointerEvent as ReactPointerEvent, RefAttributes } from 'react';\nimport type { SwitchFieldProps as RACSwitchFieldProps, SwitchButtonRenderProps, SwitchFieldRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useRef, useState } from 'react';\nimport { SwitchButton, SwitchField } from 'react-aria-components';\nimport type { AccessibleName } from '../../render/name';\nimport { ControlLabel } from '../../control';\nimport { controlStyles } from '../../control/styles';\nimport { FieldMessage } from '../../field';\nimport { invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CheckGlyph, CloseGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// The switch page: a 52 by 32dp track with a 2dp outline and a full corner,\n// a handle that is 16dp off, 24dp on and 28dp while pressed, a 16dp icon in\n// the handle when asked for, a 40dp state layer around the handle and a 48dp\n// target. Off, the track is surface container highest inside an outline\n// rule and the handle is outline, turning on surface variant while hovered,\n// pressed or focused; on, the track is primary and the handle on primary,\n// turning primary container in the same states, with the icon in on primary\n// container. Disabled, the track and its rule are on surface at the\n// disabled container opacity and the handle on surface at the disabled\n// content opacity, or surface when on. The state layer is on surface off and\n// primary on.\n//\n// The page draws the icon in two forms: on the selected handle alone, which\n// is `icon`, and in both states, which adds `unselectedIcon`. An off handle\n// holding an icon is 24dp, as an on one is, and the icon in it is surface\n// container highest, faded to the disabled content opacity while disabled.\n// Either prop takes `true` for the page's own glyph, the check on and the\n// cross off, or a node to draw in its place. The handle sets the 16dp as a\n// font size and the colour as `color`, so a `1em` icon in `currentColor`\n// takes both, as the README asks of every icon.\n//\n// The page gives no error state, so an invalid switch takes the checkbox's\n// error colours rather than showing its problem in the message alone. The\n// track's rule is error, and so is the handle while the switch is off; on,\n// the track keeps its primary fill and the handle its on primary, so the\n// switch still reads as on inside an error rule. The state layer is error\n// either way, as the checkbox's is, and a disabled switch keeps its disabled\n// colours. Under forced colours the error colour goes with every other, and\n// the switch keeps the mapping below, so there the message says what is\n// wrong.\n//\n// React Aria's `SwitchField` is the root, a div holding the description and\n// error slots; its `SwitchButton` is the label around a visually hidden\n// input, and everything drawn is that label's children, chosen from the\n// render state React Aria hands them. The field is the two-column grid the\n// checkbox uses, with the label `display: contents`, so the description and\n// error line up under the text.\n//\n// The handle travels between the two ends of the track and grows between\n// its three sizes on the same transition, `motion.durationShort2` with the\n// standard easing; the state layer and the ripple sit on a 40dp disc centred\n// on the handle, so they move with it. The adjacent label is body-large on\n// surface, which the page keeps the same whichever way the switch is.\n//\n// The page's pressed handle follows the pointer: it grows, travels with the\n// drag, and the switch flips when it is released past the middle of the\n// track or springs back when it is not. React Aria's `SwitchButton` has no\n// drag of its own, so the travel is this component's — see `useHandleDrag`.\n//\n// Under forced colours the switch names system colours for its fills. That\n// mode paints an author's fill in the page's own `Canvas`, so the handle\n// vanished and on and off drew the same empty pill; a system colour is kept\n// rather than repainted. Off is a `ButtonText` handle in an empty track with\n// a `ButtonText` rule. On is a `HighlightText` handle in a track filled with\n// `Highlight`, the pair the mode gives whatever is chosen, with the check in\n// `Highlight` over the handle. Disabled, the same shapes are `GrayText`, and\n// the handle of a switch that is on is emptied to `Canvas` so it still shows\n// against its track. Every style that sets a fill repeats its branch, since\n// one written without the query replaces the property whole, branch and all.\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)';\nconst _temp = {\n kLqNvP: \"x1lxsm33\",\n \"$$css\": true\n};\nconst styles = {\n control: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"x1fb0czk\",\n kpsdNU: \"xm4btww\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x1vqgdyp\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xvni27\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n handle: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xp2scj5 x1tt9vl1\",\n kZKoxP: \"xlup9mm\",\n kaIpWk: \"x16fbrrb\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x5yhsjm x1q5838n\",\n k1xSpc: \"x78zum5\",\n kGuDYH: \"x1j61zf2\",\n kzqmXN: \"x1kky2od\",\n kjj79g: \"xl56j7k\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"x7okvu4\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n handleActive: {\n kWkggS: \"x1ccu2yh x1tt9vl1\",\n $$css: true\n },\n handleDisabled: {\n kWkggS: \"x1crcgwy x1o55y2u\",\n kMwMTN: \"xx09jb7 x1a46atw\",\n $$css: true\n },\n handleError: {\n kWkggS: \"xwi4nbo x1tt9vl1\",\n $$css: true\n },\n handleOn: {\n kWkggS: \"x1ntwmx2 x1sir5s4\",\n kZKoxP: \"xxk0z11\",\n kMwMTN: \"xscdzaa x6jt684\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n },\n handleOnActive: {\n kWkggS: \"xp89om9 x1sir5s4\",\n $$css: true\n },\n handleOnDisabled: {\n kWkggS: \"x14s9m32 x9yvj25\",\n kMwMTN: \"x1gpw424 x1bhcspo\",\n $$css: true\n },\n handlePressed: {\n kZKoxP: \"x1fgtraw\",\n kzqmXN: \"xgd8bvy\",\n $$css: true\n },\n handleWithIcon: {\n kZKoxP: \"xxk0z11\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n },\n layer: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x16fbrrb\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"x100vrsf\",\n kpwlN0: \"x1qx2jxi\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"x15406qy\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n seat: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x1fgtraw\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kzqmXN: \"xgd8bvy\",\n k87sOh: \"x13vifvy\",\n kLqNvP: \"x1o0tod\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"x2hifos\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n seatAt: (offset: number) => [_temp, {\n \"--x-insetInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(`${offset}px`)\n }],\n seatDraggable: {\n kFalU9: \"x5ve5x3\",\n $$css: true\n },\n seatDragging: {\n kIyJzY: \"x1mq3mr6\",\n $$css: true\n },\n seatOn: {\n kLqNvP: \"x1n8ud3w\",\n $$css: true\n },\n track: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"x1rrhr5q x9yvj25\",\n kZKoxP: \"x10w6t97\",\n kVAM5u: \"x1fwvt7v x1ylmb6m\",\n kaIpWk: \"x1dkaolv\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xdh2fpr\",\n kB7OPa: \"x9f619\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xvni27\",\n kVAEAm: \"x1n2onr6\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xts7igz\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n trackDisabled: {\n kWkggS: \"x1trd85j x9yvj25\",\n kVAM5u: \"xrh88j3 xmnqt3w\",\n $$css: true\n },\n trackError: {\n kVAM5u: \"xx78ee7 x1ylmb6m\",\n $$css: true\n },\n trackOn: {\n kWkggS: \"xnety89 x1jzqe4\",\n kVAM5u: \"x1uajy3w x1n2ykn\",\n $$css: true\n },\n trackOnDisabled: {\n kWkggS: \"x19v6zzp x1o55y2u\",\n kVAM5u: \"x9r1u3d xmnqt3w\",\n $$css: true\n },\n trackOnError: {\n kVAM5u: \"xx78ee7 x1n2ykn\",\n $$css: true\n }\n};\n\n// The state layer over the handle: on surface while the switch is off and\n// primary while it is on, at the hover or the pressed opacity, and error\n// either way while it is invalid.\nconst hoverLayers = {\n error: {\n kWkggS: \"x55e1u4\",\n $$css: true\n },\n off: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n on: {\n kWkggS: \"x659ado\",\n $$css: true\n }\n};\n\n// A keyboard's focus draws the hover layer's colour at the focus opacity.\nconst focusLayers = {\n error: {\n kWkggS: \"xyn212m\",\n $$css: true\n },\n off: {\n kWkggS: \"xwqhyid\",\n $$css: true\n },\n on: {\n kWkggS: \"x1sog3nf\",\n $$css: true\n }\n};\nconst pressedLayers = {\n error: {\n kWkggS: \"x3czxiy\",\n $$css: true\n },\n off: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n on: {\n kWkggS: \"x1dvjsmr\",\n $$css: true\n }\n};\n\n// How far the seat travels: the track's 48dp inside its 2dp rule, less the\n// seat's own 28dp.\nconst TRAVEL = 20;\n\n// How far a press has to move before it is a drag, by the pointer making it.\n// Anything moves a little between pressing and lifting, and a press inside\n// this is still a tap, which flips the switch. A mouse moves a pixel or two,\n// so a quarter of the travel is room enough. A finger drifts further on an\n// ordinary tap — 6 to 10px was common — and under that same 5px the tap was\n// read as a drag let go before the middle, which settled where it began and\n// dropped the tap without a sign. A finger and a pen take half the travel,\n// the platforms' own touch slop; a drag past it is past the middle too.\nconst MOUSE_SLOP = TRAVEL / 4;\nconst TOUCH_SLOP = TRAVEL / 2;\ntype Drag = ReturnType<typeof useHandleDrag>;\ntype Ripple = ReturnType<typeof useRipple<HTMLSpanElement>>;\ntype SwitchProps = {\n /**\n * The label, beside the switch. A switch that a row labels some other way\n * leaves it out and passes `aria-label` or `aria-labelledby` instead — one\n * of the three is required, since a switch with none is announced as an\n * unnamed switch.\n *\n * A link or a button in it acts on its own, as in a native label, and\n * leaves the switch as it was. A press anywhere else in the label toggles\n * it.\n */\n children?: ReactNode;\n /**\n * A hint under the label. Replaced by `error` when there is one, so the\n * two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the switch in its error state — the error colours on the track and the\n * handle, the message and `aria-invalid` follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * The icon in the handle while the switch is on: `true` for the check, the\n * page's \"icon on selected switch\" form, or a node to draw in its place.\n * The handle draws it at 16px in its icon colour, so give a node `1em`\n * square in `currentColor`.\n * @default false\n */\n icon?: ReactNode;\n /**\n * The icon in the handle while the switch is off: `true` for the cross, or a\n * node to draw in its place. Given with `icon`, it is the page's form with\n * an icon in both states, and the off handle grows to the on handle's 24dp\n * to hold it.\n * @default false\n */\n unselectedIcon?: ReactNode;\n} & AccessibleName & Omit<RACSwitchFieldProps, 'children' | 'isInvalid' | 'validationBehavior'>;\n\n// What the label draws, chosen from the render state React Aria hands it.\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its inputs. The ripple's handlers and surface go on the\n// state layer while the switch can change, and are left off while it\n// cannot, since a press that changes nothing should not look like one.\nfunction buttonContent(children: ReactNode, icons: {\n off: ReactNode;\n on: ReactNode;\n}, ripple: Ripple, drag: Drag) {\n return (state: SwitchButtonRenderProps) => {\n const interactive = !state.isDisabled && !state.isReadOnly;\n const on = state.isSelected;\n const tone = state.isInvalid ? 'error' : on ? 'on' : 'off';\n const dragging = interactive && drag.offset !== null;\n const active = interactive && (state.isHovered || state.isPressed || state.isFocusVisible);\n const iconShown = on ? icons.on : icons.off;\n return <>\n <span {...stylex.props(styles.control, state.isReadOnly && controlStyles.controlReadOnly, state.isDisabled && controlStyles.controlDisabled)}>\n <span {...stylex.props(styles.track, on && styles.trackOn, state.isInvalid && (on ? styles.trackOnError : styles.trackError), state.isDisabled && (on ? styles.trackOnDisabled : styles.trackDisabled), state.isFocusVisible && focus.ringVisible)}>\n <span {...interactive ? drag.handlers(on) : {}} {...stylex.props(styles.seat, on && styles.seatOn, interactive && styles.seatDraggable, dragging && styles.seatDragging, dragging && styles.seatAt(drag.offset ?? 0))}>\n <span {...interactive ? ripple.handlers : {}} {...stylex.props(styles.layer, interactive && state.isHovered && hoverLayers[tone], interactive && state.isFocusVisible && focusLayers[tone], interactive && state.isPressed && pressedLayers[tone])}>\n {interactive ? ripple.surface : null}\n </span>\n <span {...stylex.props(styles.handle, on && styles.handleOn, active && (on ? styles.handleOnActive : styles.handleActive), !on && state.isInvalid && styles.handleError, !on && drawsIcon(icons.off) && styles.handleWithIcon, (dragging || interactive && state.isPressed) && styles.handlePressed, state.isDisabled && (on ? styles.handleOnDisabled : styles.handleDisabled))}>\n {iconShown}\n </span>\n </span>\n </span>\n </span>\n <ControlLabel state={state}>{children}</ControlLabel>\n </>;\n };\n}\n\n// Whether a handle icon prop draws anything: `false`, `null` and `undefined`\n// leave the handle empty, and so at its own size.\nfunction drawsIcon(icon: ReactNode) {\n return icon !== false && icon !== null && icon !== undefined;\n}\n\n// The button and the line under it, from the field's render state: the\n// description fades with a disabled switch, as its label does. Built by a\n// call for the same reason as `buttonContent`.\nfunction fieldContent(button: ReactNode, description: string | undefined, error: string | undefined) {\n return ({\n isDisabled\n }: SwitchFieldRenderProps) => <>\n {button}\n <div {...stylex.props(controlStyles.messages)}>\n <FieldMessage description={description} error={error} indent inset={false} isDisabled={isDisabled} />\n </div>\n </>;\n}\n\n/**\n * A switch that turns a setting on or off, with its label and optionally a\n * description or an error under it. Its state is React Aria's: pass\n * `isSelected` with `onChange` to control it, or `defaultSelected` to let it\n * keep its own. A switch takes effect as it is flipped, which is what sets\n * it apart from a checkbox in a form.\n *\n * Where the row around it already says what it turns on, it takes\n * `aria-label` in place of a label, and draws the track alone.\n *\n * ```tsx\n * const [selected, setSelected] = useState(false)\n *\n * <Switch isSelected={selected} onChange={setSelected}>\n * Label\n * </Switch>\n * <Switch aria-label=\"Label\" defaultSelected />\n * ```\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions.\n */\nfunction Switch({\n children,\n description,\n error,\n icon = false,\n unselectedIcon = false,\n ...props\n}: RefAttributes<HTMLDivElement> & SwitchProps) {\n const ripple = useRipple<HTMLSpanElement>();\n const drag = useHandleDrag();\n const validationBehavior = useFieldValidationBehavior();\n return <SwitchField isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(controlStyles.field), props)}>\n {fieldContent(<SwitchButton className=\"xjp7ctv\">\n {buttonContent(children, {\n off: unselectedIcon === true ? <CloseGlyph className=\"xlup9mm x1lliihq x1kky2od\" /> : unselectedIcon,\n on: icon === true ? <CheckGlyph className=\"xlup9mm x1lliihq x1kky2od\" /> : icon\n }, ripple, drag)}\n </SwitchButton>, description, error)}\n </SwitchField>;\n}\n\n/**\n * The handle following a pointer across the track, as the switch page draws\n * a pressed switch. The seat's inset comes from the drag while one is under\n * way, and the switch settles from where the handle was let go: on past the\n * middle of the track, off before it.\n *\n * What flips the switch on an ordinary tap is React Aria's own press, which\n * ends on the pointer being released and pays no attention to where the\n * handle was dragged to — so a drag has to end that press before releasing,\n * which is what the pointer cancel is for, and settle the switch itself.\n * Settling means clicking the field's own input, the same element a tap\n * reaches in the end: the change goes through React Aria, and a controlled\n * switch stays controlled, since nothing here calls `onChange` or holds any\n * state of the switch's own. The click the pointer's release sends after\n * that is cancelled too, so nothing flips the switch a second time.\n *\n * A press that moves no further than the slop is left alone entirely, so a\n * tap flips the switch however still the pointer was — a drag starts only\n * once the pointer passes it, and from then on the handle follows every move.\n * The slop is the pointer's own: a finger and a pen drift further on a tap\n * than a mouse does. A mouse or pen drag then focuses the input, as a tap\n * does.\n *\n * The guard for the click after a drag is cleared by the next press, not by\n * that click, since the click may never come: a touch dragged past the\n * browser's own slop sends none, and a guard left armed swallowed the next\n * tap instead.\n */\nfunction useHandleDrag() {\n const [offset, setOffset] = useState<null | number>(null);\n const origin = useRef<null | {\n base: number;\n focuses: boolean;\n on: boolean;\n rtl: boolean;\n slop: number;\n x: number;\n }>(null);\n const settled = useRef<null | number>(null);\n const cancelClick = useRef(false);\n const onPointerCancel = useCallback(() => {\n origin.current = null;\n settled.current = null;\n setOffset(null);\n }, []);\n const onClickCapture = useCallback((event: ReactMouseEvent<HTMLSpanElement>) => {\n if (!cancelClick.current) {\n return;\n }\n cancelClick.current = false;\n // The label's activation is the browser's own, so this is what stops the\n // input being flipped by a drag that settled where it began.\n event.preventDefault();\n event.stopPropagation();\n }, []);\n const onPointerMove = useCallback((event: ReactPointerEvent<HTMLSpanElement>) => {\n const from = origin.current;\n if (from === null) {\n return;\n }\n const along = from.rtl ? from.x - event.clientX : event.clientX - from.x;\n if (settled.current === null && Math.abs(along) <= from.slop) {\n return;\n }\n const next = Math.min(TRAVEL, Math.max(0, from.base + along));\n settled.current = next;\n setOffset(next);\n }, []);\n const onPointerUp = useCallback((event: ReactPointerEvent<HTMLSpanElement>) => {\n const from = origin.current;\n const stopped = settled.current;\n const seat = event.currentTarget;\n origin.current = null;\n settled.current = null;\n setOffset(null);\n // A press that never moved is a tap, which React Aria flips on its own.\n if (from === null || stopped === null) {\n return;\n }\n // React Aria's press is about to flip the switch from wherever it\n // started, so it is cancelled first — a pointer cancel is what ends a\n // press without firing it — and the drag settles the switch instead.\n seat.dispatchEvent(new PointerEvent('pointercancel', {\n bubbles: true,\n pointerId: event.pointerId,\n pointerType: event.pointerType\n }));\n // The pointer's own click follows this, by which time the switch has\n // already settled.\n cancelClick.current = true;\n const input = seat.closest('label')?.querySelector('input');\n // Where a tap leaves focus, a drag leaves it too, whichever side it\n // settles on. A tap reaches the input through the label, which focuses\n // it; the click below is programmatic and moves nothing, and React\n // Aria's press, which would, was cancelled above — so a mouse drag left\n // focus on the page, and a Space after it did nothing. A touch is left\n // alone, as a touch tap leaves no ring to find.\n if (from.focuses) {\n input?.focus({\n preventScroll: true\n });\n }\n if (stopped > TRAVEL / 2 === from.on) {\n return;\n }\n input?.click();\n }, []);\n const handlers = useCallback((on: boolean) => ({\n onClickCapture,\n onPointerCancel,\n onPointerDown: (event: ReactPointerEvent<HTMLSpanElement>) => {\n cancelClick.current = false;\n if (event.pointerType === 'mouse' && event.button !== 0) {\n return;\n }\n const touch = event.pointerType === 'touch';\n origin.current = {\n base: on ? TRAVEL : 0,\n focuses: !touch,\n on,\n rtl: getComputedStyle(event.currentTarget).direction === 'rtl',\n slop: touch || event.pointerType === 'pen' ? TOUCH_SLOP : MOUSE_SLOP,\n x: event.clientX\n };\n settled.current = null;\n try {\n event.currentTarget.setPointerCapture(event.pointerId);\n } catch {\n // A pointer the browser is not tracking has no capture to take —\n // a synthetic event in a test, where the moves are dispatched on\n // this element anyway.\n }\n },\n onPointerMove,\n onPointerUp\n }), [onClickCapture, onPointerCancel, onPointerMove, onPointerUp]);\n return {\n handlers,\n offset\n };\n}\nexport type { SwitchProps };\nexport default Switch;"],"mappings":";;;;;;;;;;;;;;;AAyFA,MAAMkC,QAAQ;CACZC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRX,QAAQ;EACRY,QAAQ;EACRX,QAAQ;EACRY,QAAQ;EACRX,QAAQ;EACRY,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRT,QAAQ;EACRC,QAAQ;EACRS,QAAQ;EACR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AAL,EAAA;CAtCD,MAAAsD,cAAoBjD;CAsCb,IAAAC;CAAA,IAAAN,EAAA,OAAAkB,OAAAC,IAAA,2BAAA,GAAA;EACsBb,MAAApD,QAAkB;GAAAuE;GAAAJ;GAAAkC,gBAG9BC,YAAA;IACbvC,YAAWG,UAAW;IACtB,IAAIE,QAAKyB,gBAAiB,WAAWzB,QAAK1B,WAAY,GAAC;IAGvD,MAAA6D,QAAcnC,QAAKyB,gBAAiB;IACpChC,OAAMK,UAAW;KAAAkB,MACTpF,KAAAG,SAAA;KAAe8F,SACZ,CAACM;KAAKvG;KAAA2E,KAEV6B,iBAAiBpC,QAAKqB,aAAc,CAAC,CAAAgB,cAAe;KAAKzB,MACxDuB,SAASnC,QAAKyB,gBAAiB,QAA/BxF,aAAAD;KAA8DwE,GACjER,QAAKS;IACV;IACAf,QAAOI,UAAW;IAClB,IAAA;KACEE,QAAKqB,cAAciB,kBAAmBtC,QAAKwB,SAAU;IAAC,QAAA,CAAA;GAKvD;GACFP;GAAAe;EAGH;EAAEtD,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CA5BF,MAAAR,WAAiBc;CA4BkD,IAAAE;CAAA,IAAAR,EAAA,OAAAjE,QAAA;EAC5DyE,KAAA;GAAAhB;GAAAzD;EAGP;EAACiE,EAAA,KAAAjE;EAAAiE,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAHMQ;AAGN"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","PointerEvent","stylex","useRef","useState","SwitchField","controlStyles","invalidFrom","useFieldValidationBehavior","useRipple","focus","mergeStatefulStyles","_temp","kLqNvP","styles","control","kgeoSG","kGOzcv","kpsdNU","kEoFBp","kGNEyG","kZKoxP","kB7OPa","kkrTdU","k1xSpc","kmuXW","kzqmXN","kjj79g","kVAEAm","$$css","handle","k6CgDc","kWkggS","kaIpWk","kMwMTN","kGuDYH","kIyJzY","k1ekBW","kAMwcw","handleActive","handleDisabled","handleError","handleOn","handleOnActive","handleOnDisabled","handlePressed","handleWithIcon","layer","kpwlN0","seat","k87sOh","seatAt","offset","val","undefined","seatDraggable","kFalU9","seatDragging","seatOn","track","kVAM5u","ksu8eU","kMzoRj","trackDisabled","trackError","trackOn","trackOnDisabled","trackOnError","hoverLayers","error","off","on","focusLayers","pressedLayers","TRAVEL","MOUSE_SLOP","TOUCH_SLOP","useHandleDrag","children","description","icon","unselectedIcon","buttonContent","icons","ripple","drag","state","interactive","isDisabled","isReadOnly","isSelected","tone","isInvalid","dragging","active","isHovered","isPressed","isFocusVisible","iconShown","props","controlReadOnly","controlDisabled","ringVisible","handlers","surface","drawsIcon","fieldContent","button","messages","Switch","t0","$","t1","t2","validationBehavior","T0","t3","t4","field","t5","t6","t7","t8","t9","t10","setOffset","origin","settled","cancelClick","Symbol","for","current","onPointerCancel","event","preventDefault","stopPropagation","onClickCapture","event_0","from","along","rtl","x","clientX","Math","abs","slop","next","min","max","base","onPointerMove","event_1","from_0","stopped","currentTarget","dispatchEvent","bubbles","pointerId","pointerType","input","closest","querySelector","focuses","preventScroll","click","onPointerUp","onPointerDown","event_2","touch","getComputedStyle","direction","setPointerCapture"],"sources":["../../../src/components/switch/index.tsx"],"sourcesContent":["'use client';\n\n// React's event types are aliased because `useHandleDrag` also constructs a\n// DOM `PointerEvent`. Imported unaliased, the name shadows that constructor:\n// TypeScript still resolves the call to the global, since a type-only import\n// takes no value name, but a reader and a static analyser alike read it as\n// React's type, which has no runtime value behind it at all.\nimport type { MouseEvent as ReactMouseEvent, ReactNode, PointerEvent as ReactPointerEvent, RefAttributes } from 'react';\nimport type { SwitchFieldProps as RACSwitchFieldProps, SwitchButtonRenderProps, SwitchFieldRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useRef, useState } from 'react';\nimport { SwitchButton, SwitchField } from 'react-aria-components';\nimport type { AccessibleName } from '../../render/name';\nimport { ControlLabel } from '../../control';\nimport { controlStyles } from '../../control/styles';\nimport { FieldMessage } from '../../field';\nimport { invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CheckGlyph, CloseGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// The switch page: a 52 by 32dp track with a 2dp outline and a full corner,\n// a handle that is 16dp off, 24dp on and 28dp while pressed, a 16dp icon in\n// the handle when asked for, a 40dp state layer around the handle and a 48dp\n// target. Off, the track is surface container highest inside an outline\n// rule and the handle is outline, turning on surface variant while hovered,\n// pressed or focused; on, the track is primary and the handle on primary,\n// turning primary container in the same states, with the icon in on primary\n// container. Disabled, the track and its rule are on surface at the\n// disabled container opacity and the handle on surface at the disabled\n// content opacity, or surface when on. The state layer is on surface off and\n// primary on.\n//\n// The page draws the icon in two forms: on the selected handle alone, which\n// is `icon`, and in both states, which adds `unselectedIcon`. An off handle\n// holding an icon is 24dp, as an on one is, and the icon in it is surface\n// container highest, faded to the disabled content opacity while disabled.\n// Either prop takes `true` for the page's own glyph, the check on and the\n// cross off, or a node to draw in its place. The handle sets the 16dp as a\n// font size and the colour as `color`, so a `1em` icon in `currentColor`\n// takes both, as the README asks of every icon.\n//\n// The page gives no error state, so an invalid switch takes the checkbox's\n// error colours rather than showing its problem in the message alone. The\n// track's rule is error, and so is the handle while the switch is off; on,\n// the track keeps its primary fill and the handle its on primary, so the\n// switch still reads as on inside an error rule. The state layer is error\n// either way, as the checkbox's is, and a disabled switch keeps its disabled\n// colours. Under forced colours the error colour goes with every other, and\n// the switch keeps the mapping below, so there the message says what is\n// wrong.\n//\n// React Aria's `SwitchField` is the root, a div holding the description and\n// error slots; its `SwitchButton` is the label around a visually hidden\n// input, and everything drawn is that label's children, chosen from the\n// render state React Aria hands them. The field is the two-column grid the\n// checkbox uses, with the label `display: contents`, so the description and\n// error line up under the text.\n//\n// The handle travels between the two ends of the track and grows between\n// its three sizes on the same transition, `motion.durationShort2` with the\n// standard easing; the state layer and the ripple sit on a 40dp disc centred\n// on the handle, so they move with it. The adjacent label is body-large on\n// surface, which the page keeps the same whichever way the switch is.\n//\n// The page's pressed handle follows the pointer: it grows, travels with the\n// drag, and the switch flips when it is released past the middle of the\n// track or springs back when it is not. React Aria's `SwitchButton` has no\n// drag of its own, so the travel is this component's — see `useHandleDrag`.\n//\n// Under forced colours the switch names system colours for its fills. That\n// mode paints an author's fill in the page's own `Canvas`, so the handle\n// vanished and on and off drew the same empty pill; a system colour is kept\n// rather than repainted. Off is a `ButtonText` handle in an empty track with\n// a `ButtonText` rule. On is a `HighlightText` handle in a track filled with\n// `Highlight`, the pair the mode gives whatever is chosen, with the check in\n// `Highlight` over the handle. Disabled, the same shapes are `GrayText`, and\n// the handle of a switch that is on is emptied to `Canvas` so it still shows\n// against its track. Every style that sets a fill repeats its branch, since\n// one written without the query replaces the property whole, branch and all.\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)';\nconst _temp = {\n kLqNvP: \"x1lxsm33\",\n \"$$css\": true\n};\nconst styles = {\n control: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"x1fb0czk\",\n kpsdNU: \"xm4btww\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x1vqgdyp\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xvni27\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n handle: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xp2scj5 x1tt9vl1\",\n kZKoxP: \"xlup9mm\",\n kaIpWk: \"x16fbrrb\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x5yhsjm x1q5838n\",\n k1xSpc: \"x78zum5\",\n kGuDYH: \"x1j61zf2\",\n kzqmXN: \"x1kky2od\",\n kjj79g: \"xl56j7k\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"x7okvu4\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n handleActive: {\n kWkggS: \"x1ccu2yh x1tt9vl1\",\n $$css: true\n },\n handleDisabled: {\n kWkggS: \"x1crcgwy x1o55y2u\",\n kMwMTN: \"xx09jb7 x1a46atw\",\n $$css: true\n },\n handleError: {\n kWkggS: \"xwi4nbo x1tt9vl1\",\n $$css: true\n },\n handleOn: {\n kWkggS: \"x1ntwmx2 x1sir5s4\",\n kZKoxP: \"xxk0z11\",\n kMwMTN: \"xscdzaa x6jt684\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n },\n handleOnActive: {\n kWkggS: \"xp89om9 x1sir5s4\",\n $$css: true\n },\n handleOnDisabled: {\n kWkggS: \"x14s9m32 x9yvj25\",\n kMwMTN: \"x1gpw424 x1bhcspo\",\n $$css: true\n },\n handlePressed: {\n kZKoxP: \"x1fgtraw\",\n kzqmXN: \"xgd8bvy\",\n $$css: true\n },\n handleWithIcon: {\n kZKoxP: \"xxk0z11\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n },\n layer: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x16fbrrb\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"x100vrsf\",\n kpwlN0: \"x1qx2jxi\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"x15406qy\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n seat: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x1fgtraw\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kzqmXN: \"xgd8bvy\",\n k87sOh: \"x13vifvy\",\n kLqNvP: \"x1o0tod\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"x2hifos\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n seatAt: (offset: number) => [_temp, {\n \"--x-insetInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(`${offset}px`)\n }],\n seatDraggable: {\n kFalU9: \"x5ve5x3\",\n $$css: true\n },\n seatDragging: {\n kIyJzY: \"x1mq3mr6\",\n $$css: true\n },\n seatOn: {\n kLqNvP: \"x1n8ud3w\",\n $$css: true\n },\n track: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"x1rrhr5q x9yvj25\",\n kZKoxP: \"x10w6t97\",\n kVAM5u: \"x1fwvt7v x1ylmb6m\",\n kaIpWk: \"x1dkaolv\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xdh2fpr\",\n kB7OPa: \"x9f619\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xvni27\",\n kVAEAm: \"x1n2onr6\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xts7igz\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n trackDisabled: {\n kWkggS: \"x1trd85j x9yvj25\",\n kVAM5u: \"xrh88j3 xmnqt3w\",\n $$css: true\n },\n trackError: {\n kVAM5u: \"xx78ee7 x1ylmb6m\",\n $$css: true\n },\n trackOn: {\n kWkggS: \"xnety89 x1jzqe4\",\n kVAM5u: \"x1uajy3w x1n2ykn\",\n $$css: true\n },\n trackOnDisabled: {\n kWkggS: \"x19v6zzp x1o55y2u\",\n kVAM5u: \"x9r1u3d xmnqt3w\",\n $$css: true\n },\n trackOnError: {\n kVAM5u: \"xx78ee7 x1n2ykn\",\n $$css: true\n }\n};\n\n// The state layer over the handle: on surface while the switch is off and\n// primary while it is on, at the hover or the pressed opacity, and error\n// either way while it is invalid.\nconst hoverLayers = {\n error: {\n kWkggS: \"x55e1u4\",\n $$css: true\n },\n off: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n on: {\n kWkggS: \"x659ado\",\n $$css: true\n }\n};\n\n// A keyboard's focus draws the hover layer's colour at the focus opacity.\nconst focusLayers = {\n error: {\n kWkggS: \"xyn212m\",\n $$css: true\n },\n off: {\n kWkggS: \"xwqhyid\",\n $$css: true\n },\n on: {\n kWkggS: \"x1sog3nf\",\n $$css: true\n }\n};\nconst pressedLayers = {\n error: {\n kWkggS: \"x3czxiy\",\n $$css: true\n },\n off: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n on: {\n kWkggS: \"x1dvjsmr\",\n $$css: true\n }\n};\n\n// How far the seat travels: the track's 48dp inside its 2dp rule, less the\n// seat's own 28dp.\nconst TRAVEL = 20;\n\n// How far a press has to move before it is a drag, by the pointer making it.\n// Anything moves a little between pressing and lifting, and a press inside\n// this is still a tap, which flips the switch. A mouse moves a pixel or two,\n// so a quarter of the travel is room enough. A finger drifts further on an\n// ordinary tap — 6 to 10px was common — and under that same 5px the tap was\n// read as a drag let go before the middle, which settled where it began and\n// dropped the tap without a sign. A finger and a pen take half the travel,\n// the platforms' own touch slop; a drag past it is past the middle too.\nconst MOUSE_SLOP = TRAVEL / 4;\nconst TOUCH_SLOP = TRAVEL / 2;\ntype Drag = ReturnType<typeof useHandleDrag>;\ntype Ripple = ReturnType<typeof useRipple<HTMLSpanElement>>;\ntype SwitchProps = {\n /**\n * The label, beside the switch. A switch that a row labels some other way\n * leaves it out and passes `aria-label` or `aria-labelledby` instead — one\n * of the three is required, since a switch with none is announced as an\n * unnamed switch.\n *\n * A link or a button in it acts on its own, as in a native label, and\n * leaves the switch as it was. A press anywhere else in the label toggles\n * it.\n */\n children?: ReactNode;\n /**\n * A hint under the label. Replaced by `error` when there is one, so the\n * two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the switch in its error state — the error colours on the track and the\n * handle, the message and `aria-invalid` follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * The icon in the handle while the switch is on: `true` for the check, the\n * page's \"icon on selected switch\" form, or a node to draw in its place.\n * The handle draws it at 16px in its icon colour, so give a node `1em`\n * square in `currentColor`.\n * @default false\n */\n icon?: ReactNode;\n /**\n * The icon in the handle while the switch is off: `true` for the cross, or a\n * node to draw in its place. Given with `icon`, it is the page's form with\n * an icon in both states, and the off handle grows to the on handle's 24dp\n * to hold it.\n * @default false\n */\n unselectedIcon?: ReactNode;\n} & AccessibleName & Omit<RACSwitchFieldProps, 'children' | 'isInvalid' | 'validationBehavior'>;\n\n// What the label draws, chosen from the render state React Aria hands it.\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its inputs. The ripple's handlers and surface go on the\n// state layer while the switch can change, and are left off while it\n// cannot, since a press that changes nothing should not look like one.\nfunction buttonContent(children: ReactNode, icons: {\n off: ReactNode;\n on: ReactNode;\n}, ripple: Ripple, drag: Drag) {\n return (state: SwitchButtonRenderProps) => {\n const interactive = !state.isDisabled && !state.isReadOnly;\n const on = state.isSelected;\n const tone = state.isInvalid ? 'error' : on ? 'on' : 'off';\n const dragging = interactive && drag.offset !== null;\n const active = interactive && (state.isHovered || state.isPressed || state.isFocusVisible);\n const iconShown = on ? icons.on : icons.off;\n return <>\n <span {...stylex.props(styles.control, state.isReadOnly && controlStyles.controlReadOnly, state.isDisabled && controlStyles.controlDisabled)}>\n <span {...stylex.props(styles.track, on && styles.trackOn, state.isInvalid && (on ? styles.trackOnError : styles.trackError), state.isDisabled && (on ? styles.trackOnDisabled : styles.trackDisabled), state.isFocusVisible && focus.ringVisible)}>\n <span {...interactive ? drag.handlers(on) : {}} {...stylex.props(styles.seat, on && styles.seatOn, interactive && styles.seatDraggable, dragging && styles.seatDragging, dragging && styles.seatAt(drag.offset ?? 0))}>\n <span {...interactive ? ripple.handlers : {}} {...stylex.props(styles.layer, interactive && state.isHovered && hoverLayers[tone], interactive && state.isFocusVisible && focusLayers[tone], interactive && state.isPressed && pressedLayers[tone])}>\n {interactive ? ripple.surface : null}\n </span>\n <span {...stylex.props(styles.handle, on && styles.handleOn, active && (on ? styles.handleOnActive : styles.handleActive), !on && state.isInvalid && styles.handleError, !on && drawsIcon(icons.off) && styles.handleWithIcon, (dragging || interactive && state.isPressed) && styles.handlePressed, state.isDisabled && (on ? styles.handleOnDisabled : styles.handleDisabled))}>\n {iconShown}\n </span>\n </span>\n </span>\n </span>\n <ControlLabel state={state}>{children}</ControlLabel>\n </>;\n };\n}\n\n// Whether a handle icon prop draws anything: `false`, `null` and `undefined`\n// leave the handle empty, and so at its own size.\nfunction drawsIcon(icon: ReactNode) {\n return icon !== false && icon !== null && icon !== undefined;\n}\n\n// The button and the line under it, from the field's render state: the\n// description fades with a disabled switch, as its label does. Built by a\n// call for the same reason as `buttonContent`.\nfunction fieldContent(button: ReactNode, description: string | undefined, error: string | undefined) {\n return ({\n isDisabled\n }: SwitchFieldRenderProps) => <>\n {button}\n <div {...stylex.props(controlStyles.messages)}>\n <FieldMessage description={description} error={error} indent inset={false} isDisabled={isDisabled} />\n </div>\n </>;\n}\n\n/**\n * A switch that turns a setting on or off, with its label and optionally a\n * description or an error under it. Its state is React Aria's: pass\n * `isSelected` with `onChange` to control it, or `defaultSelected` to let it\n * keep its own. A switch takes effect as it is flipped, which is what sets\n * it apart from a checkbox in a form.\n *\n * Where the row around it already says what it turns on, it takes\n * `aria-label` in place of a label, and draws the track alone.\n *\n * ```tsx\n * const [selected, setSelected] = useState(false)\n *\n * <Switch isSelected={selected} onChange={setSelected}>\n * Label\n * </Switch>\n * <Switch aria-label=\"Label\" defaultSelected />\n * ```\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions.\n */\nfunction Switch({\n children,\n description,\n error,\n icon = false,\n unselectedIcon = false,\n ...props\n}: RefAttributes<HTMLDivElement> & SwitchProps) {\n const ripple = useRipple<HTMLSpanElement>();\n const drag = useHandleDrag();\n const validationBehavior = useFieldValidationBehavior();\n return <SwitchField isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(controlStyles.field), props)}>\n {fieldContent(<SwitchButton className=\"xjp7ctv\">\n {buttonContent(children, {\n off: unselectedIcon === true ? <CloseGlyph className=\"xlup9mm x1lliihq x1kky2od\" /> : unselectedIcon,\n on: icon === true ? <CheckGlyph className=\"xlup9mm x1lliihq x1kky2od\" /> : icon\n }, ripple, drag)}\n </SwitchButton>, description, error)}\n </SwitchField>;\n}\n\n/**\n * The handle following a pointer across the track, as the switch page draws\n * a pressed switch. The seat's inset comes from the drag while one is under\n * way, and the switch settles from where the handle was let go: on past the\n * middle of the track, off before it.\n *\n * What flips the switch on an ordinary tap is React Aria's own press, which\n * ends on the pointer being released and pays no attention to where the\n * handle was dragged to — so a drag has to end that press before releasing,\n * which is what the pointer cancel is for, and settle the switch itself.\n * Settling means clicking the field's own input, the same element a tap\n * reaches in the end: the change goes through React Aria, and a controlled\n * switch stays controlled, since nothing here calls `onChange` or holds any\n * state of the switch's own. The click the pointer's release sends after\n * that is cancelled too, so nothing flips the switch a second time.\n *\n * A press that moves no further than the slop is left alone entirely, so a\n * tap flips the switch however still the pointer was — a drag starts only\n * once the pointer passes it, and from then on the handle follows every move.\n * The slop is the pointer's own: a finger and a pen drift further on a tap\n * than a mouse does. A mouse or pen drag then focuses the input, as a tap\n * does.\n *\n * The guard for the click after a drag is cleared by the next press, not by\n * that click, since the click may never come: a touch dragged past the\n * browser's own slop sends none, and a guard left armed swallowed the next\n * tap instead.\n */\nfunction useHandleDrag() {\n const [offset, setOffset] = useState<null | number>(null);\n const origin = useRef<null | {\n base: number;\n focuses: boolean;\n on: boolean;\n rtl: boolean;\n slop: number;\n x: number;\n }>(null);\n const settled = useRef<null | number>(null);\n const cancelClick = useRef(false);\n const onPointerCancel = useCallback(() => {\n origin.current = null;\n settled.current = null;\n setOffset(null);\n }, []);\n const onClickCapture = useCallback((event: ReactMouseEvent<HTMLSpanElement>) => {\n if (!cancelClick.current) {\n return;\n }\n cancelClick.current = false;\n // The label's activation is the browser's own, so this is what stops the\n // input being flipped by a drag that settled where it began.\n event.preventDefault();\n event.stopPropagation();\n }, []);\n const onPointerMove = useCallback((event: ReactPointerEvent<HTMLSpanElement>) => {\n const from = origin.current;\n if (from === null) {\n return;\n }\n const along = from.rtl ? from.x - event.clientX : event.clientX - from.x;\n if (settled.current === null && Math.abs(along) <= from.slop) {\n return;\n }\n const next = Math.min(TRAVEL, Math.max(0, from.base + along));\n settled.current = next;\n setOffset(next);\n }, []);\n const onPointerUp = useCallback((event: ReactPointerEvent<HTMLSpanElement>) => {\n const from = origin.current;\n const stopped = settled.current;\n const seat = event.currentTarget;\n origin.current = null;\n settled.current = null;\n setOffset(null);\n // A press that never moved is a tap, which React Aria flips on its own.\n if (from === null || stopped === null) {\n return;\n }\n // React Aria's press is about to flip the switch from wherever it\n // started, so it is cancelled first — a pointer cancel is what ends a\n // press without firing it — and the drag settles the switch instead.\n seat.dispatchEvent(new PointerEvent('pointercancel', {\n bubbles: true,\n pointerId: event.pointerId,\n pointerType: event.pointerType\n }));\n // The pointer's own click follows this, by which time the switch has\n // already settled.\n cancelClick.current = true;\n const input = seat.closest('label')?.querySelector('input');\n // Where a tap leaves focus, a drag leaves it too, whichever side it\n // settles on. A tap reaches the input through the label, which focuses\n // it; the click below is programmatic and moves nothing, and React\n // Aria's press, which would, was cancelled above — so a mouse drag left\n // focus on the page, and a Space after it did nothing. A touch is left\n // alone, as a touch tap leaves no ring to find.\n if (from.focuses) {\n input?.focus({\n preventScroll: true\n });\n }\n if (stopped > TRAVEL / 2 === from.on) {\n return;\n }\n input?.click();\n }, []);\n const handlers = useCallback((on: boolean) => ({\n onClickCapture,\n onPointerCancel,\n onPointerDown: (event: ReactPointerEvent<HTMLSpanElement>) => {\n cancelClick.current = false;\n if (event.pointerType === 'mouse' && event.button !== 0) {\n return;\n }\n const touch = event.pointerType === 'touch';\n origin.current = {\n base: on ? TRAVEL : 0,\n focuses: !touch,\n on,\n rtl: getComputedStyle(event.currentTarget).direction === 'rtl',\n slop: touch || event.pointerType === 'pen' ? TOUCH_SLOP : MOUSE_SLOP,\n x: event.clientX\n };\n settled.current = null;\n try {\n event.currentTarget.setPointerCapture(event.pointerId);\n } catch {\n // A pointer the browser is not tracking has no capture to take —\n // a synthetic event in a test, where the moves are dispatched on\n // this element anyway.\n }\n },\n onPointerMove,\n onPointerUp\n }), [onClickCapture, onPointerCancel, onPointerMove, onPointerUp]);\n return {\n handlers,\n offset\n };\n}\nexport type { SwitchProps };\nexport default Switch;"],"mappings":";;;;;;;;;;;;;;;AAyFA,MAAMY,QAAQ;CACZC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRX,QAAQ;EACRY,QAAQ;EACRX,QAAQ;EACRY,QAAQ;EACRX,QAAQ;EACRY,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRT,QAAQ;EACRC,QAAQ;EACRS,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,cAAc;EACZP,QAAQ;EACRH,OAAO;CACT;CACAW,gBAAgB;EACdR,QAAQ;EACRE,QAAQ;EACRL,OAAO;CACT;CACAY,aAAa;EACXT,QAAQ;EACRH,OAAO;CACT;CACAa,UAAU;EACRV,QAAQ;EACRX,QAAQ;EACRa,Q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AAC;IAGvD,MAAA6D,QAAcnC,QAAKyB,gBAAiB;IACpChC,OAAMK,UAAW;KAAAkB,MACT9E,KAAAG,SAAA;KAAewF,SACZ,CAACM;KAAKjG;KAAAqE,KAEV6B,iBAAiBpC,QAAKqB,aAAc,CAAC,CAAAgB,cAAe;KAAKzB,MACxDuB,SAASnC,QAAKyB,gBAAiB,QAA/BlF,aAAAD;KAA8DkE,GACjER,QAAKS;IACV;IACAf,QAAOI,UAAW;IAClB,IAAA;KACEE,QAAKqB,cAAciB,kBAAmBtC,QAAKwB,SAAU;IAAC,QAAA,CAAA;GAKvD;GACFP;GAAAe;EAGH;EAAEtD,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CA5BF,MAAAR,WAAiBc;CA4BkD,IAAAE;CAAA,IAAAR,EAAA,OAAA3D,QAAA;EAC5DmE,KAAA;GAAAhB;GAAAnD;EAGP;EAAC2D,EAAA,KAAA3D;EAAA2D,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAHMQ;AAGN"}
|
|
@@ -195,5 +195,4 @@ declare function TableLoadMore({ label, ref, ...props }: RefAttributes<HTMLTable
|
|
|
195
195
|
* row is pressed.
|
|
196
196
|
*/
|
|
197
197
|
declare function TableRow<T extends object = object>(props: RefAttributes<HTMLTableRowElement> & TableRowProps<T>): import("react").JSX.Element;
|
|
198
|
-
export { TableBody$1 as TableBody, type TableBodyProps$1 as TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter$1 as TableFooter, type TableFooterProps$1 as TableFooterProps, TableHeader$1 as TableHeader, type TableHeaderProps$1 as TableHeaderProps, TableLoadMore, type TableLoadMoreProps, type TableProps$1 as TableProps, TableRow, type TableRowProps, Table$1 as default };
|
|
199
|
-
//# sourceMappingURL=index.d.ts.map
|
|
198
|
+
export { TableBody$1 as TableBody, type TableBodyProps$1 as TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter$1 as TableFooter, type TableFooterProps$1 as TableFooterProps, TableHeader$1 as TableHeader, type TableHeaderProps$1 as TableHeaderProps, TableLoadMore, type TableLoadMoreProps, type TableProps$1 as TableProps, TableRow, type TableRowProps, Table$1 as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ColumnRenderProps","ColumnResizerRenderProps","CellProps","RACCellProps","ColumnProps","RACColumnProps","RowProps","RACRowProps","TableBodyProps","RACTableBodyProps","TableFooterProps","RACTableFooterProps","TableHeaderProps","RACTableHeaderProps","TableLoadMoreItemProps","RACTableLoadMoreItemProps","TableProps","RACTableProps","ResizableTableContainerProps","RowRenderProps","TableBodyRenderProps","TableRenderProps","stylex","createContext","useContext","useLayoutEffect","useMemo","useState","Cell","RACCell","Column","RACColumn","ColumnResizer","RACColumnResizer","ResizableTableContainer","RACResizableTableContainer","Row","RACRow","Table","RACTable","TableBody","RACTableBody","TableFooter","RACTableFooter","TableHeader","RACTableHeader","TableLoadMoreItem","RACTableLoadMoreItem","CollectionLoadMore","collectionStyles","ArrowDownwardGlyph","ArrowUpwardGlyph","mergeRefs","rowStyles","rowLayers","mergeStatefulStyles","mergeStyles","colors","sizing","spacing","stateLayerOpacity","typography","Checkbox","FORCED_COLORS","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","Omit","T","className","renderEmptyState","style","TableCellProps","children","TableColumnProps","resizable","TableLoadMoreProps","label","onResize","onResizeEnd","resizeLabel","selectAllLabel","selectLabel","stickyHeader","TableRowProps","ResizeLabelContext","ResizableContext","StickyHeaderContext","NO_MIN_WIDTHS","ReadonlyMap","Element","Map","ColumnMinWidthsContext","REACT_ARIA_MIN_WIDTH","cellContent","cellStyles","columnContent","state","sortArrowFor","sortDirection","resizerRule","columnStyles","props","allowsSorting","isHovered","isPressed","dropAriaLevel","node","HTMLTableRowElement","removeAttribute","emptyContent","measureColumns","HTMLTableElement","headers","HTMLTableCellElement","tHead","rows","push","cells","held","map","element","cssText","const","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","stylex.props","rowLayers","Table","_c","RACTable","RACResizableTableContainer","TableBody","RACTableBody","RACCell","RACColumn","TableFooter","RACTableFooter","TableHeader","RACTableHeader","RACTableLoadMoreItem","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,MAAMoE,wBAAwBzC,cAAkC0C,KAAAA,CAAS;AACzE,MAAMC,qBAAqB3C,cAAkC0C,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,eA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AAI,CAAC,CAAAG,OAAOjC,OAAA;KAAC,MAAA,CAAA9G,QAAAyF,SAAAqB;KAAe,OAAK+B,QAAOX,IAAKlI,MAAM,MAAMyF;IAAK,CAAA,IAAhGoD,UAAAD,IAAkH;GAAC;GAE1ID,QAAQ;GACR,MAAAK,UAAgB,IAAIC,iBAAiBN,OAAO;GAC5CK,QAAOE,QAASrH,OAAO;IAAAsH,eACN;IAAIC,WACR;IAAIC,SACN;GACX,CAAC;GACDC,SAAQC,MAAMC,iBAAkB,eAAeb,OAAO;GAAC,aAChD;IACLK,QAAOS,WAAY;IACnBH,SAAQC,MAAMG,oBAAqB,eAAef,OAAO;GAAC;EAC3D;EACA9B,KAAA,CAAChF,KAAK;EAAC+E,EAAA,KAAA/E;EAAA+E,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAA;EAAAF,KAAAC,EAAA;EAAAC,KAAAD,EAAA;CAAA;CApBVlK,gBAAgBiK,IAoBbE,EAAO;CAAC,OACJnB;AAAM;AAEfnI,QAAMoM,OAAOlM;AACbF,QAAMV,OAAOiL;AACbvK,QAAMR,SAASiL;AACfzK,QAAMqM,SAASjM;AACfJ,QAAMsM,SAAShM;AACfN,QAAMuM,WAAWtB;AACjBjL,QAAMF,MAAMoL"}
|
|
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,OAA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AI,CAAC,CAAAG,OAAOjC,OAAA;KAAC,MAAA,CAAAlG,QAAA6E,SAAAqB;KAAe,OAAK+B,QAAOX,IAAKtH,MAAM,MAAM6E;IAAK,CAAA,IAAhGoD,UAAAD,IAAkH;GAAC;GAE1ID,QAAQ;GACR,MAAAK,UAAgB,IAAIC,iBAAiBN,OAAO;GAC5CK,QAAOE,QAASzG,OAAO;IAAA0G,eACN;IAAIC,WACR;IAAIC,SACN;GACX,CAAC;GACDC,SAAQC,MAAMC,iBAAkB,eAAeb,OAAO;GAAC,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;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"}
|
|
@@ -66,5 +66,4 @@ type TabsTabProps = {
|
|
|
66
66
|
*/
|
|
67
67
|
icon?: ReactNode;
|
|
68
68
|
} & TabProps;
|
|
69
|
-
export { type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps$1 as TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tabs$1 as default };
|
|
70
|
-
//# sourceMappingURL=index.d.ts.map
|
|
69
|
+
export { type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps$1 as TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tabs$1 as default };
|