@kanso-labs/kanso-ui 0.45.22 → 0.45.24
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","HTMLAttributes","ReactNode","RefAttributes","ClassNameOrFunction","DialogTriggerProps","HeadingProps","ModalOverlayProps","ModalRenderProps","DialogProps","RACDialogProps","StyleOrFunction","stylex","createContext","useContext","useId","useLayoutEffect","useMemo","useRef","useState","useSyncExternalStore","DialogTrigger","Heading","HeadingContext","Modal","ModalOverlay","Dialog","RACDialog","useSlottedContext","useHoldBottomEdge","useScrollStop","OverlayScope","mergeRefs","mergeStatefulStyles","mergeStyles","overlay","colors","media","motion","radii","shadows","sizing","spacing","typography","FORCED_COLORS","HEADLINE_REACH","controlSm","headlineSmallLineHeight","FULL_SCREEN","scaleIn","slideInFromBottom","styles","body","kB7OPa","kMwMTN","k1xSpc","kXwgrk","kzQI83","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","kHjlTd","kORKVm","kGO01o","kLKAdn","kg3NbH","$$css","centre","kGNEyG","kjj79g","kmVPX3","basic","BasicContext","HeaderContext","DescriptionContext","id","Omit","children","t0","$","props","t1","DialogBody","ref","callerRef","isBasic","describe","generated","undefined","title","scrollStop","label","t2","merged","t3","modalBodyRing","t4","DialogContent","className","container","defaultOpen","isKeyboardDismissDisabled","isOpen","onOpenChange","style","isDismissable","role","setBody","scrim","0","1","t5","t6","Symbol","for","modalDialog","t7","t8","t9","t10","t11","DialogFooter","useFullScreen","DialogHeader","DialogTitle","isHeaded","4","2","6","5","3","7","isFullScreen","window","matchMedia","matches","isFullScreenOnServer","subscribeToFullScreen","listener","query","addEventListener","removeEventListener","Body","Content","Footer","Header","Title","DialogContentProps","Element","Pick","DialogTitleProps","Dialog","_c","props","stylex.props","RACDialog"],"sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport type { HTMLAttributes, ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, DialogTriggerProps, HeadingProps, ModalOverlayProps, ModalRenderProps, DialogProps as RACDialogProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';\nimport { DialogTrigger, Heading, HeadingContext, Modal, ModalOverlay, Dialog as RACDialog, useSlottedContext } from 'react-aria-components';\nimport { useHoldBottomEdge } from '../../hooks/useBottomEdge';\nimport { useScrollStop } from '../../hooks/useScrollStop';\nimport { OverlayScope } from '../../overlay';\nimport { mergeRefs } from '../../render/ref';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, shadows, sizing, spacing, typography } from '../../tokens/design.tokens.stylex';\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// How far a headline in a header reaches past its own line, above and below:\n// half of what the headline-small line lacks of a standard control's\n// height, which is 4 at the default tokens. The header gives the same back\n// out of its padding. See `header`.\nconst HEADLINE_REACH = `max(0px, calc((${sizing.controlSm} - ${typography.headlineSmallLineHeight}) / 2))`;\n\n// The window size the full-screen dialog is drawn at, which the styles read\n// as `media.belowMedium`. Spelled again for `matchMedia`, which is the one\n// thing in this file that has to know it outside a stylesheet: the footer\n// holds the window's bottom edge only there. See `useFullScreen`.\nconst FULL_SCREEN = '(width < 600px)';\n\n// The dialogs page's two dialogs, which are one component here for the same\n// reason Sheet's two presentations are: the page pairs them by window size\n// rather than offering a choice. Above the medium breakpoint it is the basic\n// dialog — a container on surface container high with a 28dp corner, between\n// 280 and 560dp wide, centred over the scrim, with 24dp of padding all round,\n// 16dp between the headline and the body and 24dp between the body and the\n// actions. Below it the same dialog fills the window as the page's\n// full-screen dialog: square corners, a 56dp header with the headline and a\n// divider under it, and a 56dp action bar with a divider over it.\n//\n// The pairing is for a dialog that is a task, which needs the room. An alert\n// dialog is a question with two or three answers, and the page keeps the\n// full-screen dialog for tasks, so `role=\"alertdialog\"` stays the basic dialog\n// at every width. Filled to a phone's window it read as a headline at the top\n// of the screen and its answers at the bottom, with nothing between them but\n// the chrome. The `basic` styles below are how: each restates, without the\n// breakpoint, the properties the paired styles change below it.\n//\n// The headline is headline-small on surface, the body body-medium on surface\n// variant, and the buttons are the call site's — the page draws text buttons\n// there, which is `Button`'s `text` variant.\n//\n// Two things the page draws are the call site's rather than the component's.\n// The optional icon above the headline, which the page centres the headline\n// and body with when it is there, is anything a `Dialog.Header` is given; a\n// dialog that wants it centres its own header. And the dividers a basic\n// dialog may show around a scrolling body are left out, since the page has\n// them only for that case and the body here scrolls with the header and\n// footer pinned either side of it, which is what they were marking.\n//\n// React Aria's overlay is three nested elements — the scrim, the container,\n// and the dialog inside it — so the styles split the same way, and the scrim\n// and the element carrying the dialog role are the ones every modal overlay\n// shares.\nconst scaleIn = \"xnirehn-B\";\nconst slideInFromBottom = \"x1itx4s0-B\";\nconst styles = {\n body: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kHjlTd: \"xj0a0fe\",\n kORKVm: \"x1odjw0f\",\n kGO01o: \"x1az23kl x18d9i69\",\n kLKAdn: \"x886u18 xexx8yu x3reb9c\",\n kg3NbH: \"xg0ps1x\",\n $$css: true\n },\n centre: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1apw6a7 xd76zvj\",\n $$css: true\n }\n};\n\n// The basic dialog at every width, for an alert dialog. Each entry is the\n// above-breakpoint value of every property its namesake in `styles` changes\n// below the breakpoint, laid over that namesake, so a property it leaves out\n// is the same in both presentations already. A value changed above the\n// breakpoint there has to change here too, which `index.test.tsx` checks by\n// comparing an alert dialog on a phone with any dialog on a desktop.\nconst basic = {\n body: {\n kLKAdn: \"x886u18 xexx8yu\",\n $$css: true\n },\n centre: {\n kmVPX3: \"x1apw6a7\",\n $$css: true\n }\n};\n\n// Whether this dialog is the basic one at every width. Content decides it from\n// the role and the parts read it, since each part carries its own share of\n// the full-screen presentation.\nconst BasicContext = createContext(false);\n\n// Whether a title sits in a header, which is what it reaches past its line\n// in; see `header`. Content clears it, so a dialog opened from inside a\n// header starts outside one.\nconst HeaderContext = createContext(false);\n\n// Where an alert dialog's body hands Content its id, so the dialog can name\n// the body as its description: the message an alert dialog interrupts with\n// is what a screen reader should read out with the title. Null in a dialog\n// of any other role, whose body may hold a form or a long document rather\n// than one message.\nconst DescriptionContext = createContext<((id: string | undefined) => void) | null>(null);\ntype DialogProps = Omit<DialogTriggerProps, 'children'> & {\n children?: ReactNode;\n};\n\n/**\n * A modal dialog centred over the page, and the same dialog filling the\n * window below the medium breakpoint — the dialogs page's basic and\n * full-screen dialogs, paired by window size as the page pairs them. An\n * alert dialog stays the basic one at every width. Open state is React\n * Aria's: pass `isOpen` with `onOpenChange` to control it, or\n * `defaultOpen` to let it keep its own.\n *\n * Composed rather than configured by props, as `Sheet` is, since a dialog's\n * header, body and actions all take arbitrary content — the parts are\n * `Dialog.Content`, `Dialog.Header`, `Dialog.Title`, `Dialog.Body` and\n * `Dialog.Footer`. A `Button` or `IconButton` placed directly inside\n * `Dialog` opens it, and one given `slot=\"close\"` anywhere inside the\n * content closes it; neither needs a part of its own.\n *\n * ```tsx\n * <Dialog>\n * <Button>Open dialog</Button>\n * <Dialog.Content>\n * <Dialog.Header>\n * <Dialog.Title>Headline</Dialog.Title>\n * <IconButton aria-label=\"Close\" slot=\"close\">\n * <CloseIcon />\n * </IconButton>\n * </Dialog.Header>\n * <Dialog.Body>Supporting text</Dialog.Body>\n * <Dialog.Footer>\n * <Button slot=\"close\" variant=\"text\">\n * Cancel\n * </Button>\n * <Button onPress={confirm} slot=\"close\" variant=\"text\">\n * Confirm\n * </Button>\n * </Dialog.Footer>\n * </Dialog.Content>\n * </Dialog>\n * ```\n *\n * `Dialog` is the trigger's half, so a dialog nothing on the page opens — one\n * a route shows, or a menu item raises — leaves it out and passes `isOpen`\n * and `onOpenChange` to `Dialog.Content` instead. Wrapped in `Dialog` with no\n * button inside it, React Aria warns that its press responder found nothing\n * to press.\n *\n * Tab stays inside an open dialog, so a `Snackbar` shown meanwhile is\n * reached with F6, which React Aria uses to move between landmarks. Tabbing\n * on past the snackbar's last control leads back into the dialog.\n */\nfunction Dialog({\n children,\n ...props\n}: DialogProps) {\n return <DialogTrigger {...props}>{children}</DialogTrigger>;\n}\nfunction DialogBody({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const describe = useContext(DescriptionContext);\n const generated = useId();\n // An alert dialog's body describes the dialog, so it carries an id for the\n // dialog to point at: the call site's own, or one of its own. In a layout\n // effect, so the dialog carries its description from its first paint.\n const id = props.id ?? (describe === null ? undefined : generated);\n useLayoutEffect(() => {\n if (describe === null || id === undefined) {\n return undefined;\n }\n describe(id);\n return () => {\n describe(undefined);\n };\n }, [describe, id]);\n const ref = useRef<HTMLDivElement>(null);\n // A body its content runs past is a tab stop named by the title, so a\n // keyboard can scroll it, when nothing inside it takes focus; a call\n // site's own name, role and tabIndex still win. See useScrollStop.\n const title = useSlottedContext(HeadingContext, 'title');\n const scrollStop = useScrollStop(ref, {\n label: props['aria-label'],\n title: title?.id\n });\n // The body measures itself through its own ref, and the call site's lands\n // on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div {...scrollStop} id={id} {...props} ref={merged} {...mergeStyles(stylex.props(styles.body, isBasic && basic.body, overlay.modalBodyRing), props)} />;\n}\n\n/**\n * The dialog itself, and the scrim behind it. Everything the dialog shows\n * goes in here; the trigger stays outside it, since the trigger lives in the\n * page while this is portalled out to the end of the body.\n *\n * `role=\"alertdialog\"` is React Aria's, for a dialog interrupting with\n * something that has to be answered before the page carries on — a screen\n * reader announces it rather than waiting to be asked. It also keeps the\n * dialog the basic one below the medium breakpoint, centred and sized to its\n * content, where a dialog of the default role fills the window. Its\n * `Dialog.Body` is its description, so the message is read out with the\n * title; an `aria-describedby` of the call site's own names another.\n *\n * A press on the scrim closes the dialog unless `isDismissable` says\n * otherwise, which is the same default `Sheet` takes and the reverse of\n * React Aria's own. Escape is a separate prop, `isKeyboardDismissDisabled`,\n * and `isDismissable` says nothing about it — so a dialog that has to be\n * answered from one of its actions, as an alert dialog usually does, turns\n * off both.\n *\n * Inside `Dialog`, the open state is the trigger's. On its own, with no\n * trigger, it is this part's: `isOpen` with `onOpenChange` controls it, and\n * a `slot=\"close\"` button, Escape and the scrim all report through\n * `onOpenChange`, as they would to `Dialog`.\n *\n * The scrim draws at `z-index: 900`, over any page content layered below\n * that, such as a sticky header, and the panel draws inside it. A\n * `Snackbar` draws at 1000, so a toast raised from inside the dialog is read\n * over it, and React Aria's popovers and menus draw above both.\n */\nfunction DialogContent({\n children,\n className,\n container,\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled,\n isOpen,\n onOpenChange,\n ref,\n style,\n ...props\n}: DialogContentProps & RefAttributes<HTMLDivElement>) {\n const isBasic = props.role === 'alertdialog';\n // The id of the body, which an alert dialog is described by unless the\n // call site names a description of its own.\n const [body, setBody] = useState<string>();\n return <BasicContext value={isBasic}>\n <DescriptionContext value={isBasic ? setBody : null}>\n <OverlayScope>\n <ModalOverlay defaultOpen={defaultOpen} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled} isOpen={isOpen} onOpenChange={onOpenChange}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...stylex.props(overlay.scrim, styles.centre, isBasic && basic.centre)}>\n <Modal\n // The panel, where the call site's class and style land, rather\n // than the dialog inside it, which takes the rest of the props.\n ref={ref} {...mergeStatefulStyles({\n 0: {\n className: \"x1n1nwrg x1u6grsq xbhiib0 x1ebxanj x16dv9tl xvkjz1l xt7dq6l x1ju3lih x1w1tqly x19pkqky x1f120ba xx61lck x1gb867b x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r x27kpxv x6iovhr x1u2d2a2 xxzqys8 xb3r6kr x9xqwrn xg8iv3o x19b5e0v xsds98l\"\n },\n 1: {\n className: \"x1n1nwrg x1u6grsq x16dv9tl xvkjz1l x1w1tqly x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r xb3r6kr xbhiib0 xt7dq6l x19pkqky xx61lck x27kpxv x1u2d2a2\"\n }\n }[!!isBasic << 0], {\n className,\n style\n })}>\n <HeaderContext value={false}>\n <RACDialog {...props} aria-describedby={props['aria-describedby'] ?? (isBasic ? body : undefined)} {...stylex.props(overlay.modalDialog)}>\n {children}\n </RACDialog>\n </HeaderContext>\n </Modal>\n </ModalOverlay>\n </OverlayScope>\n </DescriptionContext>\n </BasicContext>;\n}\n\n/**\n * The dialog's actions. Full screen they are the action bar on the window's\n * bottom edge, which a toast rises clear of while the dialog is open, so a\n * tap meant for one of them never lands on the toast's own action instead.\n */\nfunction DialogFooter({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const ref = useRef<HTMLDivElement>(null);\n useHoldBottomEdge(ref, useFullScreen() && !isBasic);\n // The footer measures itself through its own ref, and the call site's\n // lands on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div {...props} ref={merged} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x12smttz x1ejq31n x1vv4zg8 x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xnvi70j x8i8c5o x1pr6p50 x13h71tw xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x12smttz x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xg0ps1x x1ejq31n x8i8c5o x13h71tw\"\n }\n }[!!isBasic << 0], props)} />;\n}\nfunction DialogHeader(props: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n return <HeaderContext value>\n <div {...props} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x1j6faob x1sy0etr xf6te7g xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xnvi70j x11wnguw x1pr6p50 x1837goc xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x1j6faob xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xg0ps1x x1sy0etr x11wnguw x1837goc\"\n }\n }[!!isBasic << 0], props)} />\n </HeaderContext>;\n}\n\n/**\n * Names the dialog. Rendered through React Aria's title slot, which is what\n * points the dialog's `aria-labelledby` at it — a dialog without one\n * announces itself unnamed.\n */\nfunction DialogTitle(props: DialogTitleProps & RefAttributes<HTMLHeadingElement>) {\n const isBasic = useContext(BasicContext);\n const isHeaded = useContext(HeaderContext);\n return <Heading slot=\"title\" {...props} {...mergeStyles({\n 0: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe\"\n },\n 4: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs\"\n },\n 2: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n },\n 6: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n },\n 1: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda\"\n },\n 5: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda\"\n },\n 3: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda\"\n },\n 7: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda\"\n }\n }[!!isHeaded << 2 | !!isBasic << 1 | !!(isBasic && isHeaded) << 0], props)} />;\n}\n\n// Whether the window is at the size the full-screen dialog is drawn at, kept\n// current as it resizes. False on the server, where there is no window and\n// nothing is open.\nfunction isFullScreen() {\n return window.matchMedia(FULL_SCREEN).matches;\n}\nfunction isFullScreenOnServer() {\n return false;\n}\nfunction subscribeToFullScreen(listener: () => void) {\n const query = window.matchMedia(FULL_SCREEN);\n query.addEventListener('change', listener);\n return () => {\n query.removeEventListener('change', listener);\n };\n}\nfunction useFullScreen() {\n return useSyncExternalStore(subscribeToFullScreen, isFullScreen, isFullScreenOnServer);\n}\nDialog.Body = DialogBody;\nDialog.Content = DialogContent;\nDialog.Footer = DialogFooter;\nDialog.Header = DialogHeader;\nDialog.Title = DialogTitle;\n\n// The dialog's own props, plus the scrim's open state and dismissal settings\n// and the container's styling. A call site has no reason to know there are\n// three elements: `className` and `style` reach the container, which is the\n// one worth restyling, the open state and the dismissal settings reach the\n// scrim, and everything else lands on the dialog.\n//\n// `isDismissable` is declared here rather than picked with its siblings,\n// since the picked one carries React Aria's documentation, whose default is\n// the reverse of this component's.\ntype DialogContentProps = {\n /** A function may compute the class from the container's render state. */\n className?: ClassNameOrFunction<ModalRenderProps>;\n /**\n * Where to portal the dialog and scrim. Defaults to the container of the\n * `ThemeScope` around it, which keeps the dialog on that scope's tokens, or\n * to the end of `<body>` where there is none. A subtree themed through the\n * `themeScope` class has no container of its own, so point this inside it, or\n * the dialog renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Whether a press on the scrim, outside the container, closes the\n * dialog. `true` here where React Aria's own default is `false`, the\n * same default `Sheet` takes. Escape is `isKeyboardDismissDisabled`'s,\n * and this says nothing about it — an alert dialog, which has to be\n * answered from one of its actions, turns off both.\n * @default true\n */\n isDismissable?: boolean;\n /** A function may compute the style from the container's render state. */\n style?: StyleOrFunction<ModalRenderProps>;\n} & Omit<RACDialogProps, 'className' | 'style'> & Pick<ModalOverlayProps, 'defaultOpen' | 'isKeyboardDismissDisabled' | 'isOpen' | 'onOpenChange'>;\ntype DialogTitleProps = HeadingProps;\nexport type { DialogContentProps, DialogProps, DialogTitleProps };\nexport { DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle };\nexport default Dialog;"],"mappings":";;;;;;;;;;;;;;AA0BuB,GAAkB0C,OAAOK,YAAeH,WAAWI;AAM1E,MAAMC,cAAc;AAsCpB,MAAMG,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRhB,QAAQ;EACRiB,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;AACF;AAQA,MAAMK,QAAQ;CACZtB,MAAM;EACJe,QAAQ;EACRE,OAAO;CACT;CACAC,QAAQ;EACNG,QAAQ;EACRJ,OAAO;CACT;AACF;AAKA,MAAMM,eAAe9D,cAAc,KAAK;AAKxC,MAAM+D,gBAAgB/D,cAAc,KAAK;AAOzC,MAAMgE,qBAAqBhE,cAAyD,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDxF,SAAAa,SAAAuD,IAAA;CAAA,MAAAC,IAAAlF,EAAA,CAAA;CAAA,IAAAg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,EAAA/B,WACU,uIACb;GAACgC,GACE,EAAAhC,WACU,8FACb;GAACiC,GACE,EAAAjC,WACU,8FACb;EACF,EAAE,CAAC,CAAC2B,YAAY,IAAI,CAAC,CAACxC,WAAW,IAAI,CAAC,EAAEA,WAAAwC,aAAwB,IAAI7C,KAAK;EAACD,EAAA,KAAAM;EAAAN,EAAA,KAAA8C;EAAA9C,EAAA,KAAAC;EAAAD,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAC,SAAAD,EAAA,OAAAD,IAAA;EAzBnEG,KAAA,oBAAC,SAAD;GAAc,MAAA;GAAO,GAAKD;GAAK,GAAMF;EAyB8B,CAAA;EAAIC,EAAA,KAAAC;EAAAD,EAAA,KAAAD;EAAAC,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAzBvEE;AAyBuE;AAMhF,SAASmD,eAAe;CACtB,OAAOC,OAAOC,WAAWzF,WAAW,CAAC,CAAC0F;AACxC;AACA,SAASC,uBAAuB;CAC9B,OAAO;AACT;AACA,SAASC,sBAAsBC,UAAsB;CACnD,MAAMC,QAAQN,OAAOC,WAAWzF,WAAW;CAC3C8F,MAAMC,iBAAiB,UAAUF,QAAQ;CACzC,aAAa;EACXC,MAAME,oBAAoB,UAAUH,QAAQ;CAC9C;AACF;AACA,SAAAhB,gBAAA;CAAA,OACSzG,qBAAqBwH,uBAAuBL,cAAcI,oBAAoB;AAAC;AAExFjH,SAAOuH,OAAO5D;AACd3D,SAAOwH,UAAU9C;AACjB1E,SAAOyH,SAASvB;AAChBlG,SAAO0H,SAAStB;AAChBpG,SAAO2H,QAAQtB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","createContext","useContext","useId","useLayoutEffect","useRef","useState","useSyncExternalStore","HeadingContext","Dialog","useSlottedContext","useHoldBottomEdge","useScrollStop","mergeRefs","mergeStatefulStyles","mergeStyles","overlay","sizing","typography","controlSm","headlineSmallLineHeight","FULL_SCREEN","styles","body","kB7OPa","kMwMTN","k1xSpc","kXwgrk","kzQI83","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","kHjlTd","kORKVm","kGO01o","kLKAdn","kg3NbH","$$css","centre","kGNEyG","kjj79g","kmVPX3","basic","BasicContext","HeaderContext","DescriptionContext","id","children","t0","$","props","t1","DialogBody","ref","callerRef","isBasic","describe","generated","undefined","title","scrollStop","label","t2","merged","t3","modalBodyRing","t4","DialogContent","className","container","defaultOpen","isKeyboardDismissDisabled","isOpen","onOpenChange","style","isDismissable","role","setBody","scrim","0","1","t5","t6","Symbol","for","modalDialog","t7","t8","t9","t10","t11","DialogFooter","useFullScreen","DialogHeader","DialogTitle","isHeaded","4","2","6","5","3","7","isFullScreen","window","matchMedia","matches","isFullScreenOnServer","subscribeToFullScreen","listener","query","addEventListener","removeEventListener","Body","Content","Footer","Header","Title","RACDialog"],"sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport type { HTMLAttributes, ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, DialogTriggerProps, HeadingProps, ModalOverlayProps, ModalRenderProps, DialogProps as RACDialogProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';\nimport { DialogTrigger, Heading, HeadingContext, Modal, ModalOverlay, Dialog as RACDialog, useSlottedContext } from 'react-aria-components';\nimport { useHoldBottomEdge } from '../../hooks/useBottomEdge';\nimport { useScrollStop } from '../../hooks/useScrollStop';\nimport { OverlayScope } from '../../overlay';\nimport { mergeRefs } from '../../render/ref';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, shadows, sizing, spacing, typography } from '../../tokens/design.tokens.stylex';\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// How far a headline in a header reaches past its own line, above and below:\n// half of what the headline-small line lacks of a standard control's\n// height, which is 4 at the default tokens. The header gives the same back\n// out of its padding. See `header`.\nconst HEADLINE_REACH = `max(0px, calc((${sizing.controlSm} - ${typography.headlineSmallLineHeight}) / 2))`;\n\n// The window size the full-screen dialog is drawn at, which the styles read\n// as `media.belowMedium`. Spelled again for `matchMedia`, which is the one\n// thing in this file that has to know it outside a stylesheet: the footer\n// holds the window's bottom edge only there. See `useFullScreen`.\nconst FULL_SCREEN = '(width < 600px)';\n\n// The dialogs page's two dialogs, which are one component here for the same\n// reason Sheet's two presentations are: the page pairs them by window size\n// rather than offering a choice. Above the medium breakpoint it is the basic\n// dialog — a container on surface container high with a 28dp corner, between\n// 280 and 560dp wide, centred over the scrim, with 24dp of padding all round,\n// 16dp between the headline and the body and 24dp between the body and the\n// actions. Below it the same dialog fills the window as the page's\n// full-screen dialog: square corners, a 56dp header with the headline and a\n// divider under it, and a 56dp action bar with a divider over it.\n//\n// The pairing is for a dialog that is a task, which needs the room. An alert\n// dialog is a question with two or three answers, and the page keeps the\n// full-screen dialog for tasks, so `role=\"alertdialog\"` stays the basic dialog\n// at every width. Filled to a phone's window it read as a headline at the top\n// of the screen and its answers at the bottom, with nothing between them but\n// the chrome. The `basic` styles below are how: each restates, without the\n// breakpoint, the properties the paired styles change below it.\n//\n// The headline is headline-small on surface, the body body-medium on surface\n// variant, and the buttons are the call site's — the page draws text buttons\n// there, which is `Button`'s `text` variant.\n//\n// Two things the page draws are the call site's rather than the component's.\n// The optional icon above the headline, which the page centres the headline\n// and body with when it is there, is anything a `Dialog.Header` is given; a\n// dialog that wants it centres its own header. And the dividers a basic\n// dialog may show around a scrolling body are left out, since the page has\n// them only for that case and the body here scrolls with the header and\n// footer pinned either side of it, which is what they were marking.\n//\n// React Aria's overlay is three nested elements — the scrim, the container,\n// and the dialog inside it — so the styles split the same way, and the scrim\n// and the element carrying the dialog role are the ones every modal overlay\n// shares.\nconst scaleIn = \"xnirehn-B\";\nconst slideInFromBottom = \"x1itx4s0-B\";\nconst styles = {\n body: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kHjlTd: \"xj0a0fe\",\n kORKVm: \"x1odjw0f\",\n kGO01o: \"x1az23kl x18d9i69\",\n kLKAdn: \"x886u18 xexx8yu x3reb9c\",\n kg3NbH: \"xg0ps1x\",\n $$css: true\n },\n centre: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1apw6a7 xd76zvj\",\n $$css: true\n }\n};\n\n// The basic dialog at every width, for an alert dialog. Each entry is the\n// above-breakpoint value of every property its namesake in `styles` changes\n// below the breakpoint, laid over that namesake, so a property it leaves out\n// is the same in both presentations already. A value changed above the\n// breakpoint there has to change here too, which `index.test.tsx` checks by\n// comparing an alert dialog on a phone with any dialog on a desktop.\nconst basic = {\n body: {\n kLKAdn: \"x886u18 xexx8yu\",\n $$css: true\n },\n centre: {\n kmVPX3: \"x1apw6a7\",\n $$css: true\n }\n};\n\n// Whether this dialog is the basic one at every width. Content decides it from\n// the role and the parts read it, since each part carries its own share of\n// the full-screen presentation.\nconst BasicContext = createContext(false);\n\n// Whether a title sits in a header, which is what it reaches past its line\n// in; see `header`. Content clears it, so a dialog opened from inside a\n// header starts outside one.\nconst HeaderContext = createContext(false);\n\n// Where an alert dialog's body hands Content its id, so the dialog can name\n// the body as its description: the message an alert dialog interrupts with\n// is what a screen reader should read out with the title. Null in a dialog\n// of any other role, whose body may hold a form or a long document rather\n// than one message.\nconst DescriptionContext = createContext<((id: string | undefined) => void) | null>(null);\ntype DialogProps = Omit<DialogTriggerProps, 'children'> & {\n children?: ReactNode;\n};\n\n/**\n * A modal dialog centred over the page, and the same dialog filling the\n * window below the medium breakpoint — the dialogs page's basic and\n * full-screen dialogs, paired by window size as the page pairs them. An\n * alert dialog stays the basic one at every width. Open state is React\n * Aria's: pass `isOpen` with `onOpenChange` to control it, or\n * `defaultOpen` to let it keep its own.\n *\n * Composed rather than configured by props, as `Sheet` is, since a dialog's\n * header, body and actions all take arbitrary content — the parts are\n * `Dialog.Content`, `Dialog.Header`, `Dialog.Title`, `Dialog.Body` and\n * `Dialog.Footer`. A `Button` or `IconButton` placed directly inside\n * `Dialog` opens it, and one given `slot=\"close\"` anywhere inside the\n * content closes it; neither needs a part of its own.\n *\n * ```tsx\n * <Dialog>\n * <Button>Open dialog</Button>\n * <Dialog.Content>\n * <Dialog.Header>\n * <Dialog.Title>Headline</Dialog.Title>\n * <IconButton aria-label=\"Close\" slot=\"close\">\n * <CloseIcon />\n * </IconButton>\n * </Dialog.Header>\n * <Dialog.Body>Supporting text</Dialog.Body>\n * <Dialog.Footer>\n * <Button slot=\"close\" variant=\"text\">\n * Cancel\n * </Button>\n * <Button onPress={confirm} slot=\"close\" variant=\"text\">\n * Confirm\n * </Button>\n * </Dialog.Footer>\n * </Dialog.Content>\n * </Dialog>\n * ```\n *\n * `Dialog` is the trigger's half, so a dialog nothing on the page opens — one\n * a route shows, or a menu item raises — leaves it out and passes `isOpen`\n * and `onOpenChange` to `Dialog.Content` instead. Wrapped in `Dialog` with no\n * button inside it, React Aria warns that its press responder found nothing\n * to press.\n *\n * Tab stays inside an open dialog, so a `Snackbar` shown meanwhile is\n * reached with F6, which React Aria uses to move between landmarks. Tabbing\n * on past the snackbar's last control leads back into the dialog.\n */\nfunction Dialog({\n children,\n ...props\n}: DialogProps) {\n return <DialogTrigger {...props}>{children}</DialogTrigger>;\n}\nfunction DialogBody({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const describe = useContext(DescriptionContext);\n const generated = useId();\n // An alert dialog's body describes the dialog, so it carries an id for the\n // dialog to point at: the call site's own, or one of its own. In a layout\n // effect, so the dialog carries its description from its first paint.\n const id = props.id ?? (describe === null ? undefined : generated);\n useLayoutEffect(() => {\n if (describe === null || id === undefined) {\n return undefined;\n }\n describe(id);\n return () => {\n describe(undefined);\n };\n }, [describe, id]);\n const ref = useRef<HTMLDivElement>(null);\n // A body its content runs past is a tab stop named by the title, so a\n // keyboard can scroll it, when nothing inside it takes focus; a call\n // site's own name, role and tabIndex still win. See useScrollStop.\n const title = useSlottedContext(HeadingContext, 'title');\n const scrollStop = useScrollStop(ref, {\n label: props['aria-label'],\n title: title?.id\n });\n // The body measures itself through its own ref, and the call site's lands\n // on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div {...scrollStop} id={id} {...props} ref={merged} {...mergeStyles(stylex.props(styles.body, isBasic && basic.body, overlay.modalBodyRing), props)} />;\n}\n\n/**\n * The dialog itself, and the scrim behind it. Everything the dialog shows\n * goes in here; the trigger stays outside it, since the trigger lives in the\n * page while this is portalled out to the end of the body.\n *\n * `role=\"alertdialog\"` is React Aria's, for a dialog interrupting with\n * something that has to be answered before the page carries on — a screen\n * reader announces it rather than waiting to be asked. It also keeps the\n * dialog the basic one below the medium breakpoint, centred and sized to its\n * content, where a dialog of the default role fills the window. Its\n * `Dialog.Body` is its description, so the message is read out with the\n * title; an `aria-describedby` of the call site's own names another.\n *\n * A press on the scrim closes the dialog unless `isDismissable` says\n * otherwise, which is the same default `Sheet` takes and the reverse of\n * React Aria's own. Escape is a separate prop, `isKeyboardDismissDisabled`,\n * and `isDismissable` says nothing about it — so a dialog that has to be\n * answered from one of its actions, as an alert dialog usually does, turns\n * off both.\n *\n * Inside `Dialog`, the open state is the trigger's. On its own, with no\n * trigger, it is this part's: `isOpen` with `onOpenChange` controls it, and\n * a `slot=\"close\"` button, Escape and the scrim all report through\n * `onOpenChange`, as they would to `Dialog`.\n *\n * The scrim draws at `z-index: 900`, over any page content layered below\n * that, such as a sticky header, and the panel draws inside it. A\n * `Snackbar` draws at 1000, so a toast raised from inside the dialog is read\n * over it, and React Aria's popovers and menus draw above both.\n */\nfunction DialogContent({\n children,\n className,\n container,\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled,\n isOpen,\n onOpenChange,\n ref,\n style,\n ...props\n}: DialogContentProps & RefAttributes<HTMLDivElement>) {\n const isBasic = props.role === 'alertdialog';\n // The id of the body, which an alert dialog is described by unless the\n // call site names a description of its own.\n const [body, setBody] = useState<string>();\n return <BasicContext value={isBasic}>\n <DescriptionContext value={isBasic ? setBody : null}>\n <OverlayScope>\n <ModalOverlay defaultOpen={defaultOpen} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled} isOpen={isOpen} onOpenChange={onOpenChange}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...stylex.props(overlay.scrim, styles.centre, isBasic && basic.centre)}>\n <Modal\n // The panel, where the call site's class and style land, rather\n // than the dialog inside it, which takes the rest of the props.\n ref={ref} {...mergeStatefulStyles({\n 0: {\n className: \"x1n1nwrg x1u6grsq xbhiib0 x1ebxanj x16dv9tl xvkjz1l xt7dq6l x1ju3lih x1w1tqly x19pkqky x1f120ba xx61lck x1gb867b x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r x27kpxv x6iovhr x1u2d2a2 xxzqys8 xb3r6kr x9xqwrn xg8iv3o x19b5e0v xsds98l\"\n },\n 1: {\n className: \"x1n1nwrg x1u6grsq x16dv9tl xvkjz1l x1w1tqly x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r xb3r6kr xbhiib0 xt7dq6l x19pkqky xx61lck x27kpxv x1u2d2a2\"\n }\n }[!!isBasic << 0], {\n className,\n style\n })}>\n <HeaderContext value={false}>\n <RACDialog {...props} aria-describedby={props['aria-describedby'] ?? (isBasic ? body : undefined)} {...stylex.props(overlay.modalDialog)}>\n {children}\n </RACDialog>\n </HeaderContext>\n </Modal>\n </ModalOverlay>\n </OverlayScope>\n </DescriptionContext>\n </BasicContext>;\n}\n\n/**\n * The dialog's actions. Full screen they are the action bar on the window's\n * bottom edge, which a toast rises clear of while the dialog is open, so a\n * tap meant for one of them never lands on the toast's own action instead.\n */\nfunction DialogFooter({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const ref = useRef<HTMLDivElement>(null);\n useHoldBottomEdge(ref, useFullScreen() && !isBasic);\n // The footer measures itself through its own ref, and the call site's\n // lands on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div {...props} ref={merged} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x12smttz x1ejq31n x1vv4zg8 x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xnvi70j x8i8c5o x1pr6p50 x13h71tw xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x12smttz x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xg0ps1x x1ejq31n x8i8c5o x13h71tw\"\n }\n }[!!isBasic << 0], props)} />;\n}\nfunction DialogHeader(props: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n return <HeaderContext value>\n <div {...props} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x1j6faob x1sy0etr xf6te7g xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xnvi70j x11wnguw x1pr6p50 x1837goc xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x1j6faob xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xg0ps1x x1sy0etr x11wnguw x1837goc\"\n }\n }[!!isBasic << 0], props)} />\n </HeaderContext>;\n}\n\n/**\n * Names the dialog. Rendered through React Aria's title slot, which is what\n * points the dialog's `aria-labelledby` at it — a dialog without one\n * announces itself unnamed.\n */\nfunction DialogTitle(props: DialogTitleProps & RefAttributes<HTMLHeadingElement>) {\n const isBasic = useContext(BasicContext);\n const isHeaded = useContext(HeaderContext);\n return <Heading slot=\"title\" {...props} {...mergeStyles({\n 0: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe\"\n },\n 4: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs\"\n },\n 2: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n },\n 6: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n },\n 1: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda\"\n },\n 5: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda\"\n },\n 3: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda\"\n },\n 7: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda\"\n }\n }[!!isHeaded << 2 | !!isBasic << 1 | !!(isBasic && isHeaded) << 0], props)} />;\n}\n\n// Whether the window is at the size the full-screen dialog is drawn at, kept\n// current as it resizes. False on the server, where there is no window and\n// nothing is open.\nfunction isFullScreen() {\n return window.matchMedia(FULL_SCREEN).matches;\n}\nfunction isFullScreenOnServer() {\n return false;\n}\nfunction subscribeToFullScreen(listener: () => void) {\n const query = window.matchMedia(FULL_SCREEN);\n query.addEventListener('change', listener);\n return () => {\n query.removeEventListener('change', listener);\n };\n}\nfunction useFullScreen() {\n return useSyncExternalStore(subscribeToFullScreen, isFullScreen, isFullScreenOnServer);\n}\nDialog.Body = DialogBody;\nDialog.Content = DialogContent;\nDialog.Footer = DialogFooter;\nDialog.Header = DialogHeader;\nDialog.Title = DialogTitle;\n\n// The dialog's own props, plus the scrim's open state and dismissal settings\n// and the container's styling. A call site has no reason to know there are\n// three elements: `className` and `style` reach the container, which is the\n// one worth restyling, the open state and the dismissal settings reach the\n// scrim, and everything else lands on the dialog.\n//\n// `isDismissable` is declared here rather than picked with its siblings,\n// since the picked one carries React Aria's documentation, whose default is\n// the reverse of this component's.\ntype DialogContentProps = {\n /** A function may compute the class from the container's render state. */\n className?: ClassNameOrFunction<ModalRenderProps>;\n /**\n * Where to portal the dialog and scrim. Defaults to the container of the\n * `ThemeScope` around it, which keeps the dialog on that scope's tokens, or\n * to the end of `<body>` where there is none. A subtree themed through the\n * `themeScope` class has no container of its own, so point this inside it, or\n * the dialog renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Whether a press on the scrim, outside the container, closes the\n * dialog. `true` here where React Aria's own default is `false`, the\n * same default `Sheet` takes. Escape is `isKeyboardDismissDisabled`'s,\n * and this says nothing about it — an alert dialog, which has to be\n * answered from one of its actions, turns off both.\n * @default true\n */\n isDismissable?: boolean;\n /** A function may compute the style from the container's render state. */\n style?: StyleOrFunction<ModalRenderProps>;\n} & Omit<RACDialogProps, 'className' | 'style'> & Pick<ModalOverlayProps, 'defaultOpen' | 'isKeyboardDismissDisabled' | 'isOpen' | 'onOpenChange'>;\ntype DialogTitleProps = HeadingProps;\nexport type { DialogContentProps, DialogProps, DialogTitleProps };\nexport { DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle };\nexport default Dialog;"],"mappings":";;;;;;;;;;;;;;AA0BuB,GAAkBkB,OAAOE,YAAeD,WAAWE;AAM1E,MAAMC,cAAc;AAsCpB,MAAMC,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRhB,QAAQ;EACRiB,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;AACF;AAQA,MAAMK,QAAQ;CACZtB,MAAM;EACJe,QAAQ;EACRE,OAAO;CACT;CACAC,QAAQ;EACNG,QAAQ;EACRJ,OAAO;CACT;AACF;AAKA,MAAMM,eAAe7C,cAAc,KAAK;AAKxC,MAAM8C,gBAAgB9C,cAAc,KAAK;AAOzC,MAAM+C,qBAAqB/C,cAAyD,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDxF,SAAAQ,SAAA0C,IAAA;CAAA,MAAAC,IAAArD,EAAA,CAAA;CAAA,IAAAmD;CAAA,IAAAG;CAAA,IAAAD,EAAA,OAAAD,IAAA;EAAgB,CAAA,CAAAD,UAAA,GAAAG,SAAAF;EAGFC,EA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Y,IAAI,CAAC,CAACxC,WAAW,IAAI,CAAC,EAAEA,WAAAwC,aAAwB,IAAI7C,KAAK;EAACD,EAAA,KAAAM;EAAAN,EAAA,KAAA8C;EAAA9C,EAAA,KAAAC;EAAAD,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAC,SAAAD,EAAA,OAAAD,IAAA;EAzBnEG,KAAA,oBAAC,SAAD;GAAc,MAAA;GAAO,GAAKD;GAAK,GAAMF;EAyB8B,CAAA;EAAIC,EAAA,KAAAC;EAAAD,EAAA,KAAAD;EAAAC,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAzBvEE;AAyBuE;AAMhF,SAASmD,eAAe;CACtB,OAAOC,OAAOC,WAAWtF,WAAW,CAAC,CAACuF;AACxC;AACA,SAASC,uBAAuB;CAC9B,OAAO;AACT;AACA,SAASC,sBAAsBC,UAAsB;CACnD,MAAMC,QAAQN,OAAOC,WAAWtF,WAAW;CAC3C2F,MAAMC,iBAAiB,UAAUF,QAAQ;CACzC,aAAa;EACXC,MAAME,oBAAoB,UAAUH,QAAQ;CAC9C;AACF;AACA,SAAAhB,gBAAA;CAAA,OACSxF,qBAAqBuG,uBAAuBL,cAAcI,oBAAoB;AAAC;AAExFpG,SAAO0G,OAAO5D;AACd9C,SAAO2G,UAAU9C;AACjB7D,SAAO4G,SAASvB;AAChBrF,SAAO6G,SAAStB;AAChBvF,SAAO8G,QAAQtB"}
|
|
@@ -62,5 +62,4 @@ declare function DisclosureHeader({ children, headingLevel, leading, supporting
|
|
|
62
62
|
* reader should be able to jump to.
|
|
63
63
|
*/
|
|
64
64
|
declare function DisclosurePanel$1({ children, ...props }: DisclosurePanelProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
65
|
-
export { DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel$1 as DisclosurePanel, type DisclosurePanelProps$1 as DisclosurePanelProps, type DisclosureProps$1 as DisclosureProps, Disclosure$1 as default };
|
|
66
|
-
//# sourceMappingURL=index.d.ts.map
|
|
65
|
+
export { DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel$1 as DisclosurePanel, type DisclosurePanelProps$1 as DisclosurePanelProps, type DisclosureProps$1 as DisclosureProps, Disclosure$1 as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","FocusableElement","DisclosurePanelProps","RACDisclosurePanelProps","DisclosureProps","RACDisclosureProps","stylex","useContext","DisclosureStateContext","Button","RACButton","Disclosure","RACDisclosure","DisclosurePanel","RACDisclosurePanel","Heading","RACHeading","ChevronEndGlyph","useRipple","RowContent","rowStyles","mergeStatefulStyles","colors","motion","spacing","styles","header","kzqmXN","k9WMMc","$$css","DisclosureHeaderProps","children","headingLevel","leading","supporting","Omit","className","style","chevronFor","isExpanded","t0","$","T0","t1","t2","t3","props","DisclosureHeader","undefined","state","ripple","headerClassName","handlers","t4","t5","surface","headerContent","t6","t7","Symbol","for","0","1","isDisabled","isHovered","isPressed","base","list","interactive","twoLine","hovered","pressed","disabled","Header","Panel","Disclosure","_c","RACDisclosure","RACButton","RACHeading","DisclosurePanel","RACDisclosurePanel","stylex.props"],"sources":["../../../src/components/disclosure/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { FocusableElement, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { DisclosureStateContext, Button as RACButton, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, Heading as RACHeading } from 'react-aria-components';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, spacing } from '../../tokens/design.tokens.stylex';\n\n// A section that opens to show what is under it, and closes again. The\n// header is the row every list here draws — `src/row`, shared with ListItem,\n// ListBox and List — so its 56dp floor, body-large headline, body-medium\n// supporting line and state layers are that module's, and a header sitting\n// above a list cannot drift from the rows below it.\n//\n// The lists page gives the expand interaction its own token set, which its\n// widget keeps behind a menu that does not open to a script. What the page\n// states in words covers the row, which is what the shared module already\n// carries; the chevron's size and the panel's inset below are the library's\n// own, taken from the row's own trailing slot and inline padding rather than\n// invented.\n//\n// Three things are this component's own.\n//\n// **The header is a heading with a button in it.** React Aria wants both —\n// the heading is what a screen reader jumps between, and the button is what\n// opens the section — so `Disclosure.Header` renders the pair rather than\n// leaving a call site to remember. `headingLevel` says where in the page's\n// outline it sits.\n//\n// **The panel opens to its own height, without one being measured.** A grid\n// whose single row goes from `0fr` to `1fr` interpolates between nothing and\n// the content's natural height, so no height is read from the DOM and no\n// number is written down. Under `prefers-reduced-motion` the row snaps\n// instead.\n//\n// **Only the opening animates, and that is React Aria's doing rather than a\n// choice here.** It marks the collapsed panel `hidden=\"until-found\"`, so on\n// the way closed the content stops being laid out at once and the track has\n// nothing left to shrink. Worth knowing before reaching for a closing\n// animation: it needs the panel kept in the layout, which would cost the\n// find-in-page behaviour that attribute buys.\n\nconst styles = {\n header: {\n kzqmXN: \"xh8yej3\",\n k9WMMc: \"x1yc453h\",\n $$css: true\n }\n};\ntype DisclosureHeaderProps = {\n /** The header's headline — what the section is about. */\n children?: ReactNode;\n /**\n * Where the header sits in the page's outline. React Aria renders the\n * trigger inside a heading, and a screen reader moves between them.\n * @default 3\n */\n headingLevel?: number;\n /** Content before the headline: an avatar, an icon. */\n leading?: ReactNode;\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n};\ntype DisclosurePanelProps = Omit<RACDisclosurePanelProps, 'className' | 'style'> & {\n /** A function may compute the class from the panel's render state. */\n className?: RACDisclosurePanelProps['className'];\n /** A function may compute the style from the panel's render state. */\n style?: RACDisclosurePanelProps['style'];\n};\ntype DisclosureProps = Omit<RACDisclosureProps, 'children'> & {\n /** A `Disclosure.Header` and a `Disclosure.Panel`. */\n children?: ReactNode;\n};\n\n// The chevron, turned or not. A call rather than JSX written at the prop,\n// which is what react-perf's jsx-no-jsx-as-prop is after; the React Compiler\n// memoises the result on `isExpanded`.\nfunction chevronFor(isExpanded: boolean) {\n return <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 x1w5n3ug x2lah0s xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 x1w5n3ug x2lah0s xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl\"\n }\n }[!!isExpanded << 0]} />;\n}\n\n/**\n * A section that opens to show what is under it. Whether it is open is React\n * Aria's: pass `isExpanded` with `onExpandedChange` to control it, or\n * `defaultExpanded` to let it keep its own.\n *\n * ```tsx\n * <Disclosure>\n * <Disclosure.Header>Headline</Disclosure.Header>\n * <Disclosure.Panel>Supporting line</Disclosure.Panel>\n * </Disclosure>\n * ```\n *\n * The header is the row every list here draws, so a section above a list of\n * rows lines up with them. The panel opens to whatever height its content\n * turns out to have, and snaps rather than sliding under\n * `prefers-reduced-motion`.\n *\n * The call site's `className` and `style` land on the container, which is the\n * element a layout positions.\n */\nfunction Disclosure({\n children,\n ...props\n}: DisclosureProps & RefAttributes<HTMLDivElement>) {\n return <RACDisclosure {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {children}\n </RACDisclosure>;\n}\n\n/**\n * The row that opens the section. It renders the heading React Aria wants\n * around the trigger and the button inside it, and draws the shared row's\n * slots with a chevron in the trailing one.\n */\nfunction DisclosureHeader({\n children,\n headingLevel = 3,\n leading,\n supporting\n}: DisclosureHeaderProps) {\n // The chevron turns with the section, and React Aria's button render state\n // reports the press states rather than what the button controls — so\n // whether the section is open comes from the disclosure's own context.\n const state = useContext(DisclosureStateContext);\n // The press ripple a list's rows draw, since this is the same row. It is a\n // button, which hears its own click, so the press ends there as Button's\n // does, and a keyboard press draws one too.\n const ripple = useRipple<FocusableElement>();\n return <RACHeading level={headingLevel} className=\"x1qlqyl8 x1pd3egz x1ghz6dp\">\n <RACButton className={headerClassName(supporting)} slot=\"trigger\" {...ripple.handlers}>\n {headerContent(children, leading, supporting, state?.isExpanded === true, ripple.surface)}\n </RACButton>\n </RACHeading>;\n}\n\n/**\n * What the section shows while it is open. Its content lines up with the\n * headline above it, and it takes the group role React Aria gives it —\n * `role=\"region\"` names it in the landmark list instead, for a section a\n * reader should be able to jump to.\n */\nfunction DisclosurePanel({\n children,\n ...props\n}: DisclosurePanelProps & RefAttributes<HTMLDivElement>) {\n // The track has to know, and React Aria hands the render state to the panel\n // rather than to what wraps it — so the state comes from its context, the\n // same one its own panel reads.\n const state = useContext(DisclosureStateContext);\n return <div {...{\n 0: {\n className: \"x12w9bfk xrvj5dj xihq33y xjvfotl x1qn9uv2 x1seskgd\"\n },\n 1: {\n className: \"x12w9bfk xrvj5dj xjvfotl x1qn9uv2 x1seskgd x1tu4anv\"\n }\n }[!!(state?.isExpanded === true) << 0]}>\n <RACDisclosurePanel {...props} {...mergeStatefulStyles({\n className: \"x9f619 x2lwn1j x7giv3 x1hm618n\"\n }, props)}>\n <div className=\"x9f619 xzfxn0k x25398y x790zyz\">{children}</div>\n </RACDisclosurePanel>\n </div>;\n}\n\n// The trigger's classes, from React Aria's render state. `isSelected` is not\n// among them — a disclosure's button reports `aria-expanded` rather than a\n// selection — so the row draws unselected throughout and only its disabled\n// state changes.\n//\n// A supporting line moves the header from the page's one-line container\n// height to its two-line one, which is a floor rather than something the\n// row's own box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as\n// an argument rather than read from the render state, since React Aria\n// reports what the trigger is doing and not what it holds; the classes are\n// built by a call for the same reason `headerContent` is.\n// No overline, and so no three-line header. The row takes the list\n// variant's metrics because a header looks like a list row, but what it\n// follows is its own page, and that page gives a headline and a supporting\n// line — the three-line item belongs to the lists page, which `List.Item`\n// and `ListBox.Item` draw.\n//\n// The hover and pressed layers come from the trigger's render state, like\n// every other row React Aria hosts — see `focusVisible` in\n// `src/row/styles.ts` for the order they are drawn in.\nfunction headerClassName(supporting: ReactNode) {\n return (state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => stylex.props(rowStyles.base, rowStyles.list, rowStyles.interactive, styles.header, supporting !== undefined && rowStyles.twoLine, state.isHovered && rowStyles.hovered, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled).className ?? '';\n}\n\n// What the header row draws. Built by a call rather than written inline at\n// the prop, which is what react-perf's no-new-function-as-prop is after; the\n// React Compiler memoises the result on its inputs.\nfunction headerContent(children: ReactNode, leading: ReactNode, supporting: ReactNode, isExpanded: boolean, ripple: ReactNode) {\n return (state: {\n isDisabled: boolean;\n }) => <>\n <RowContent isDisabled={state.isDisabled} leading={leading} supporting={supporting} trailing={chevronFor(isExpanded)}>\n {children}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\nDisclosure.Header = DisclosureHeader;\nDisclosure.Panel = DisclosurePanel;\nexport type { DisclosureHeaderProps, DisclosurePanelProps, DisclosureProps };\nexport { DisclosureHeader, DisclosurePanel };\nexport default Disclosure;"],"mappings":";;;;;;;;;;;;AAiDA,MAAM4B,SAAS,EACbC,QAAQ;CACNC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AA6BA,SAASS,WAAWC,YAAqB;CACvC,OAAO,oBAAC,iBAAD,EAAiB,GAAI;EAC1B,GAAG,EACDH,WAAW,sFACb;EACA,GAAG,EACDA,WAAW,sFACb;CACF,EAAE,CAAC,CAACG,cAAc,GAAG,CAAA;AACvB;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAA5B,aAAA6B,IAAA;CAAA,MAAAC,IAAA3C,EAAA,EAAA;CAAA,IAAA4C;CAAA,IAAAX;CAAA,IAAAY;CAAA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uBK,YAAqBW,QAAmB;CAC7H,QAAQD,UAEF,qBAAA,YAAA,EAAA,UAAA,CACF,oBAAC,YAAD;EAAY,YAAYA,MAAMc;EAAqB9B;EAAqBC;EAAY,UAAUI,WAAWC,UAAU;EAChHR;CACS,CAAA,GACXkB,MAAMc,aAAa,OAAOb,MAC7B,EAAA,CAAA;AACJ;AACAvC,aAAW8D,SAAS1B;AACpBpC,aAAW+D,QAAQ7D"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","useContext","DisclosureStateContext","Disclosure","RACDisclosure","DisclosurePanel","RACDisclosurePanel","useRipple","rowStyles","mergeStatefulStyles","styles","header","kzqmXN","k9WMMc","$$css","children","headingLevel","leading","supporting","className","chevronFor","isExpanded","t0","$","T0","t1","t2","t3","props","DisclosureHeader","undefined","state","ripple","headerClassName","handlers","t4","t5","surface","headerContent","t6","t7","Symbol","for","0","1","isDisabled","isHovered","isPressed","base","list","interactive","twoLine","hovered","pressed","disabled","Header","Panel","RACButton","RACHeading"],"sources":["../../../src/components/disclosure/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { FocusableElement, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { DisclosureStateContext, Button as RACButton, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, Heading as RACHeading } from 'react-aria-components';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, spacing } from '../../tokens/design.tokens.stylex';\n\n// A section that opens to show what is under it, and closes again. The\n// header is the row every list here draws — `src/row`, shared with ListItem,\n// ListBox and List — so its 56dp floor, body-large headline, body-medium\n// supporting line and state layers are that module's, and a header sitting\n// above a list cannot drift from the rows below it.\n//\n// The lists page gives the expand interaction its own token set, which its\n// widget keeps behind a menu that does not open to a script. What the page\n// states in words covers the row, which is what the shared module already\n// carries; the chevron's size and the panel's inset below are the library's\n// own, taken from the row's own trailing slot and inline padding rather than\n// invented.\n//\n// Three things are this component's own.\n//\n// **The header is a heading with a button in it.** React Aria wants both —\n// the heading is what a screen reader jumps between, and the button is what\n// opens the section — so `Disclosure.Header` renders the pair rather than\n// leaving a call site to remember. `headingLevel` says where in the page's\n// outline it sits.\n//\n// **The panel opens to its own height, without one being measured.** A grid\n// whose single row goes from `0fr` to `1fr` interpolates between nothing and\n// the content's natural height, so no height is read from the DOM and no\n// number is written down. Under `prefers-reduced-motion` the row snaps\n// instead.\n//\n// **Only the opening animates, and that is React Aria's doing rather than a\n// choice here.** It marks the collapsed panel `hidden=\"until-found\"`, so on\n// the way closed the content stops being laid out at once and the track has\n// nothing left to shrink. Worth knowing before reaching for a closing\n// animation: it needs the panel kept in the layout, which would cost the\n// find-in-page behaviour that attribute buys.\n\nconst styles = {\n header: {\n kzqmXN: \"xh8yej3\",\n k9WMMc: \"x1yc453h\",\n $$css: true\n }\n};\ntype DisclosureHeaderProps = {\n /** The header's headline — what the section is about. */\n children?: ReactNode;\n /**\n * Where the header sits in the page's outline. React Aria renders the\n * trigger inside a heading, and a screen reader moves between them.\n * @default 3\n */\n headingLevel?: number;\n /** Content before the headline: an avatar, an icon. */\n leading?: ReactNode;\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n};\ntype DisclosurePanelProps = Omit<RACDisclosurePanelProps, 'className' | 'style'> & {\n /** A function may compute the class from the panel's render state. */\n className?: RACDisclosurePanelProps['className'];\n /** A function may compute the style from the panel's render state. */\n style?: RACDisclosurePanelProps['style'];\n};\ntype DisclosureProps = Omit<RACDisclosureProps, 'children'> & {\n /** A `Disclosure.Header` and a `Disclosure.Panel`. */\n children?: ReactNode;\n};\n\n// The chevron, turned or not. A call rather than JSX written at the prop,\n// which is what react-perf's jsx-no-jsx-as-prop is after; the React Compiler\n// memoises the result on `isExpanded`.\nfunction chevronFor(isExpanded: boolean) {\n return <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 x1w5n3ug x2lah0s xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 x1w5n3ug x2lah0s xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl\"\n }\n }[!!isExpanded << 0]} />;\n}\n\n/**\n * A section that opens to show what is under it. Whether it is open is React\n * Aria's: pass `isExpanded` with `onExpandedChange` to control it, or\n * `defaultExpanded` to let it keep its own.\n *\n * ```tsx\n * <Disclosure>\n * <Disclosure.Header>Headline</Disclosure.Header>\n * <Disclosure.Panel>Supporting line</Disclosure.Panel>\n * </Disclosure>\n * ```\n *\n * The header is the row every list here draws, so a section above a list of\n * rows lines up with them. The panel opens to whatever height its content\n * turns out to have, and snaps rather than sliding under\n * `prefers-reduced-motion`.\n *\n * The call site's `className` and `style` land on the container, which is the\n * element a layout positions.\n */\nfunction Disclosure({\n children,\n ...props\n}: DisclosureProps & RefAttributes<HTMLDivElement>) {\n return <RACDisclosure {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {children}\n </RACDisclosure>;\n}\n\n/**\n * The row that opens the section. It renders the heading React Aria wants\n * around the trigger and the button inside it, and draws the shared row's\n * slots with a chevron in the trailing one.\n */\nfunction DisclosureHeader({\n children,\n headingLevel = 3,\n leading,\n supporting\n}: DisclosureHeaderProps) {\n // The chevron turns with the section, and React Aria's button render state\n // reports the press states rather than what the button controls — so\n // whether the section is open comes from the disclosure's own context.\n const state = useContext(DisclosureStateContext);\n // The press ripple a list's rows draw, since this is the same row. It is a\n // button, which hears its own click, so the press ends there as Button's\n // does, and a keyboard press draws one too.\n const ripple = useRipple<FocusableElement>();\n return <RACHeading level={headingLevel} className=\"x1qlqyl8 x1pd3egz x1ghz6dp\">\n <RACButton className={headerClassName(supporting)} slot=\"trigger\" {...ripple.handlers}>\n {headerContent(children, leading, supporting, state?.isExpanded === true, ripple.surface)}\n </RACButton>\n </RACHeading>;\n}\n\n/**\n * What the section shows while it is open. Its content lines up with the\n * headline above it, and it takes the group role React Aria gives it —\n * `role=\"region\"` names it in the landmark list instead, for a section a\n * reader should be able to jump to.\n */\nfunction DisclosurePanel({\n children,\n ...props\n}: DisclosurePanelProps & RefAttributes<HTMLDivElement>) {\n // The track has to know, and React Aria hands the render state to the panel\n // rather than to what wraps it — so the state comes from its context, the\n // same one its own panel reads.\n const state = useContext(DisclosureStateContext);\n return <div {...{\n 0: {\n className: \"x12w9bfk xrvj5dj xihq33y xjvfotl x1qn9uv2 x1seskgd\"\n },\n 1: {\n className: \"x12w9bfk xrvj5dj xjvfotl x1qn9uv2 x1seskgd x1tu4anv\"\n }\n }[!!(state?.isExpanded === true) << 0]}>\n <RACDisclosurePanel {...props} {...mergeStatefulStyles({\n className: \"x9f619 x2lwn1j x7giv3 x1hm618n\"\n }, props)}>\n <div className=\"x9f619 xzfxn0k x25398y x790zyz\">{children}</div>\n </RACDisclosurePanel>\n </div>;\n}\n\n// The trigger's classes, from React Aria's render state. `isSelected` is not\n// among them — a disclosure's button reports `aria-expanded` rather than a\n// selection — so the row draws unselected throughout and only its disabled\n// state changes.\n//\n// A supporting line moves the header from the page's one-line container\n// height to its two-line one, which is a floor rather than something the\n// row's own box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as\n// an argument rather than read from the render state, since React Aria\n// reports what the trigger is doing and not what it holds; the classes are\n// built by a call for the same reason `headerContent` is.\n// No overline, and so no three-line header. The row takes the list\n// variant's metrics because a header looks like a list row, but what it\n// follows is its own page, and that page gives a headline and a supporting\n// line — the three-line item belongs to the lists page, which `List.Item`\n// and `ListBox.Item` draw.\n//\n// The hover and pressed layers come from the trigger's render state, like\n// every other row React Aria hosts — see `focusVisible` in\n// `src/row/styles.ts` for the order they are drawn in.\nfunction headerClassName(supporting: ReactNode) {\n return (state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => stylex.props(rowStyles.base, rowStyles.list, rowStyles.interactive, styles.header, supporting !== undefined && rowStyles.twoLine, state.isHovered && rowStyles.hovered, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled).className ?? '';\n}\n\n// What the header row draws. Built by a call rather than written inline at\n// the prop, which is what react-perf's no-new-function-as-prop is after; the\n// React Compiler memoises the result on its inputs.\nfunction headerContent(children: ReactNode, leading: ReactNode, supporting: ReactNode, isExpanded: boolean, ripple: ReactNode) {\n return (state: {\n isDisabled: boolean;\n }) => <>\n <RowContent isDisabled={state.isDisabled} leading={leading} supporting={supporting} trailing={chevronFor(isExpanded)}>\n {children}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\nDisclosure.Header = DisclosureHeader;\nDisclosure.Panel = DisclosurePanel;\nexport type { DisclosureHeaderProps, DisclosurePanelProps, DisclosureProps };\nexport { DisclosureHeader, DisclosurePanel };\nexport default Disclosure;"],"mappings":";;;;;;;;;;;;AAiDA,MAAMW,SAAS,EACbC,QAAQ;CACNC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AA6BA,SAASM,WAAWC,YAAqB;CACvC,OAAO,oBAAC,iBAAD,EAAiB,GAAI;EAC1B,GAAG,EACDF,WAAW,sFACb;EACA,GAAG,EACDA,WAAW,sFACb;CACF,EAAE,CAAC,CAACE,cAAc,GAAG,CAAA;AACvB;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAAlB,aAAAmB,IAAA;CAAA,MAAAC,IAAAxB,EAAA,EAAA;CAAA,IAAAyB;CAAA,IAAAT;CAAA,IAAAU;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAoB,MAAA,EAAAP,UAAAY,IAAA,GAAAC,UAAAN;EAAAP,WAAAY;EAIVH,KAAApB;EAAkBwB,KAAAA;EAAWF,KAAAjB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UAAU;EAChHN;CACS,CAAA,GACXgB,MAAMc,aAAa,OAAOb,MAC7B,EAAA,CAAA;AACJ;AACA7B,aAAWoD,SAAS1B;AACpB1B,aAAWqD,QAAQnD"}
|
|
@@ -31,5 +31,4 @@ type DisclosureGroupProps$1 = Omit<DisclosureGroupProps, 'children'> & {
|
|
|
31
31
|
* element a layout positions.
|
|
32
32
|
*/
|
|
33
33
|
declare function DisclosureGroup$1({ children, divided, ...props }: DisclosureGroupProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
34
|
-
export { type DisclosureGroupProps$1 as DisclosureGroupProps, DisclosureGroup$1 as default };
|
|
35
|
-
//# sourceMappingURL=index.d.ts.map
|
|
34
|
+
export { type DisclosureGroupProps$1 as DisclosureGroupProps, DisclosureGroup$1 as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","Children","Fragment","isValidElement","DisclosureGroup","RACDisclosureGroup","mergeStatefulStyles","children","divided","t0","$","T0","t1","t2","t3","t4","props","undefined","className","dividedChildren","sections","flatten","map","section","index","keyOf","toArray","flatMap","child","type","key","String","Separator"],"sources":["../../../src/components/disclosure-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DisclosureGroupProps as RACDisclosureGroupProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Children, Fragment, isValidElement } from 'react';\nimport { DisclosureGroup as RACDisclosureGroup } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport Separator from '../separator';\n\n// A stack of Disclosures that agree with each other about what is open —\n// the lists page's accordion. The sections are the library's own\n// `Disclosure`, unchanged: this adds only the agreement between them and the\n// rule that divides them.\n//\n// Give each section an `id`, which is the key the group reports as expanded.\n// Whether one opens at a time or several is `allowsMultipleExpanded`, and it\n// is React Aria's rather than two components — a group that closes the last\n// section when a new one opens is the same stack with a different word.\n//\n// Two things are this component's own.\n//\n// **A rule between the sections, and none at the ends.** The group renders\n// the library's `Separator` between each pair rather than asking each\n// section to draw a border, so a section drawn on its own and a section in a\n// group stay the same component. `divided={false}` leaves them undivided,\n// for a stack sitting on cards of its own.\n//\n// **Nothing else is added.** The group draws no container, no corner and no\n// colour: an accordion inside a card and one running down a page want\n// different surroundings, and the page is what knows which it is.\n//\n// The lists page keeps its expand-interaction tokens behind a token-set menu\n// that does not open to a script, so what is drawn here is what the page\n// states in words plus what `Disclosure` already carries; see that\n// component's comment for the same note.\n\ntype DisclosureGroupProps = Omit<RACDisclosureGroupProps, 'children'> & {\n /** The sections, as `Disclosure` elements each given an `id`. */\n children?: ReactNode;\n /**\n * Whether a rule is drawn between the sections. There is never one above\n * the first or below the last.\n * @default true\n */\n divided?: boolean;\n};\n\n/**\n * A stack of `Disclosure` sections that agree about what is open. Which are\n * expanded is React Aria's: pass `expandedKeys` with `onExpandedChange` to\n * control it, or `defaultExpandedKeys` to let the group keep its own.\n *\n * ```tsx\n * <DisclosureGroup defaultExpandedKeys={FIRST}>\n * <Disclosure id=\"first\">\n * <Disclosure.Header>Headline</Disclosure.Header>\n * <Disclosure.Panel>Supporting line</Disclosure.Panel>\n * </Disclosure>\n * </DisclosureGroup>\n * ```\n *\n * One section opens at a time unless `allowsMultipleExpanded` says otherwise.\n * Give every section an `id` — that is the key the group reports.\n *\n * The call site's `className` and `style` land on the container, which is the\n * element a layout positions.\n */\nfunction DisclosureGroup({\n children,\n divided = true,\n ...props\n}: DisclosureGroupProps & RefAttributes<HTMLDivElement>) {\n return <RACDisclosureGroup {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {divided ? dividedChildren(children) : children}\n </RACDisclosureGroup>;\n}\n\n// The sections with a rule between each pair, and none at the ends. The\n// rules are decorative: each section opens on a heading holding its button,\n// which already tells a reader where it starts, so a \"separator\" announced\n// between every pair would only repeat it.\nfunction dividedChildren(children: ReactNode) {\n const sections = flatten(children);\n return sections.map((section, index) => <Fragment key={keyOf(section, index)}>\n {index === 0 ? null : <Separator decorative />}\n {section}\n </Fragment>);\n}\n\n// The sections, with any fragment around them opened up first.\n// `Children.toArray` flattens arrays but hands back a fragment as one child,\n// and a call site that writes its sections inside one — or maps over data and\n// wraps the result — would otherwise get a single entry and no rules at all.\n// Recursive, since a fragment may hold another.\nfunction flatten(children: ReactNode): ReactNode[] {\n return Children.toArray(children).flatMap(child => {\n if (isValidElement<{\n children?: ReactNode;\n }>(child)) {\n if (child.type === Fragment) {\n return flatten(child.props.children);\n }\n }\n return [child];\n });\n}\n\n// The key `Children.toArray` put on the entry, falling back to its position\n// for anything that is not an element — a string between two sections is not\n// a thing this component expects, but it should render rather than throw.\nfunction keyOf(section: ReactNode, index: number) {\n if (isValidElement(section)) {\n return section.key ?? String(index);\n }\n return String(index);\n}\nexport type { DisclosureGroupProps };\nexport default DisclosureGroup;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,SAAAI,kBAAAK,IAAA;CAAA,MAAAC,IAAAV,EAAA,EAAA;CAAA,IAAAW;CAAA,IAAAJ;CAAA,IAAAC;CAAA,IAAAI;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAyB,MAAA,EAAAF,UAAAO,IAAAN,SAAAO,IAAA,GAAAC,UAAAP;EAAAF,WAAAO;EAEvBN,UAAAO,OAAAE,KAAAA,IAAA,OAAAF;EAGQJ,KAAAN;EAAuBW,KAAAA;EAAWH,KAAAP,oBAAoB,EAAAY,WACjD,yBACb,GAAGF,KAAK;EAACN,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAH;EAAAG,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAF,KAAAD,EAAA;EAAAH,WAAAG,EAAA;EAAAF,UAAAE,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;CAAA;CAA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ref
|
|
|
54
54
|
* `defaultCamera` opens straight to a camera on a device that has one.
|
|
55
55
|
*/
|
|
56
56
|
declare function FileTrigger$1(props: FileTriggerProps$1): import("react").JSX.Element;
|
|
57
|
-
export { type DropZoneProps$1 as DropZoneProps, FileTrigger$1 as FileTrigger, type FileTriggerProps$1 as FileTriggerProps, DropZone$1 as default };
|
|
58
|
-
//# sourceMappingURL=index.d.ts.map
|
|
57
|
+
export { type DropZoneProps$1 as DropZoneProps, FileTrigger$1 as FileTrigger, type FileTriggerProps$1 as FileTriggerProps, DropZone$1 as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","DropZone","RACDropZone","FileTrigger","mergeStatefulStyles","dropZoneStyles","rootStyles","children","label","content","isDisabled","undefined","props","labelDisabled","t0","$","T0","t1","t2","t3","t4","t5","RACFileTrigger"],"sources":["../../../src/components/drop-zone/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DropZoneProps as RACDropZoneProps, FileTriggerProps as RACFileTriggerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DropZone as RACDropZone, FileTrigger as RACFileTrigger } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { dropZoneStyles, rootStyles } from './styles';\n\n// A place to drop files, and a button that opens the file picker. The design\n// system carries no page for either — there is no drop target and no file\n// input in it — so the drop target is drawn from the nearest thing it does\n// carry, the outlined card: the same surface, the same 1dp outline-variant\n// rule and the same medium corner.\n//\n// Two departures from that card, both this component's own.\n//\n// **The rule is dashed rather than solid.** A solid rule reads as a card,\n// which is a thing that holds content; a dashed one reads as a place to put\n// something, which is what this is. It is the one convention strong enough\n// that drawing it as a card would be the surprising choice.\n//\n// **Dropping over it fills it.** The rule goes to the primary role and the\n// surface to primary container, which is the same pair a selected list row\n// takes — so \"this is the target\" looks the same here as \"this is the one\n// chosen\" does elsewhere.\n//\n// **The label names the target rather than being composed into a name.**\n// React Aria puts a visually hidden button inside and, given nothing, labels\n// it `DropZone` — its own component name, untranslated, which is what a\n// screen reader would then read out. Passing the label through as the\n// button's `aria-label` and drawing the text as ordinary content is what\n// makes the name the words the call site wrote and nothing else; React\n// Aria's own label slot would compose the two and say both.\n//\n// `FileTrigger` is beside it rather than inside it, and that is React Aria's\n// shape rather than a choice here: a file picker is useful on its own, with\n// no drop target anywhere near it. It renders nothing but a hidden input, so\n// it takes no `className` or `style` of its own — whatever it wraps is what\n// is seen, and that is normally the library's Button.\n\ntype DropZoneProps = Omit<RACDropZoneProps, 'children' | 'className' | 'style'> & {\n /** What the target holds: its label, and whatever else it offers. */\n children?: ReactNode;\n /** A function may compute the class from the target's render state. */\n className?: RACDropZoneProps['className'];\n /**\n * What the target says it is for. Drawn inside it and used as its\n * accessible name, so a target with one needs no `aria-label`. A string\n * rather than a node, since it is what names the target; anything richer\n * goes in `children` beside it.\n */\n label?: string;\n /** A function may compute the style from the target's render state. */\n style?: RACDropZoneProps['style'];\n};\ntype FileTriggerProps = RACFileTriggerProps;\n\n// What the target draws, from React Aria's render state. Written as a call\n// rather than inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\nfunction content(children: ReactNode, label: string | undefined, isDisabled: boolean) {\n return <>\n {label === undefined ? null : <p {...stylex.props(dropZoneStyles.label, isDisabled && dropZoneStyles.labelDisabled)}>\n {label}\n </p>}\n {children}\n </>;\n}\n\n/**\n * A place to drop files. What is dropped is React Aria's: `onDrop` is handed\n * the items, and `isFileDropItem`, `isDirectoryDropItem`, `isTextDropItem`\n * and `DIRECTORY_DRAG_TYPE` are exported from the package for reading them.\n *\n * ```tsx\n * <DropZone label=\"Drop here\" onDrop={handleDrop}>\n * <FileTrigger onSelect={handleSelect}>\n * <Button variant=\"outlined\">Label</Button>\n * </FileTrigger>\n * </DropZone>\n * ```\n *\n * It is drawn from the outlined card, with a dashed rule rather than a solid\n * one, and fills with the primary container while something is over it.\n * `label` both draws the words and names the target; `aria-label` names it\n * without drawing anything, for a page that already says what it takes.\n *\n * The call site's `className` and `style` land on the target itself, which\n * is the element a layout positions.\n */\nfunction DropZone({\n children,\n label,\n ...props\n}: DropZoneProps & RefAttributes<HTMLDivElement>) {\n return <RACDropZone aria-label={props['aria-label'] ?? label} {...props} {...mergeStatefulStyles(rootStyles, props)}>\n {content(children, label, props.isDisabled ?? false)}\n </RACDropZone>;\n}\n\n/**\n * A button that opens the file picker. Wrap whatever should open it —\n * normally the library's Button — and take the files from `onSelect`.\n *\n * ```tsx\n * <FileTrigger acceptedFileTypes={['image/*']} onSelect={handleSelect}>\n * <Button>Label</Button>\n * </FileTrigger>\n * ```\n *\n * It renders nothing of its own but the hidden input, so it takes no\n * `className` or `style`: what is seen is whatever it wraps. `allowsMultiple`\n * takes more than one file, `acceptDirectory` takes a folder, and\n * `defaultCamera` opens straight to a camera on a device that has one.\n */\nfunction FileTrigger(props: FileTriggerProps) {\n return <RACFileTrigger {...props} />;\n}\nexport type { DropZoneProps, FileTriggerProps };\nexport { FileTrigger };\nexport default DropZone;"],"mappings":";;;;;;;;AA8DA,SAASU,QAAQF,UAAqBC,OAA2BE,YAAqB;CACpF,OAAO,qBAAA,UAAA,EAAA,UAAA,CACFF,UAAUG,KAAAA,IAAY,OAAO,oBAAC,KAAD;EAAG,GAAIX,MAAaK,eAAeG,OAAOE,cAAcL,eAAeQ,aAAa;EAC7GL,UAAAA;CACA,CAAA,GACJD,QACH,EAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAAN,WAAAa,IAAA;CAAA,MAAAC,IAAAhB,EAAA,EAAA;CAAA,IAAAiB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAkB,MAAA,EAAAP,UAAAC,OAAA,GAAAI,UAAAE;EAKRE,KAAAd;EAAwBe,KAAAL,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","kWkggS","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kB7OPa","k1xSpc","kXwgrk","kOIVth","kjj79g","kAzted","kjBf7l","kInvED","k3XXqK","kMeerF","kmVPX3","kIyJzY","k1ekBW","kAMwcw","rootDisabled","kkrTdU","rootFocused","rootOver","rootStyles","state","isDisabled","isDropTarget","isFocusVisible","className"],"sources":["../../../src/components/drop-zone/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// Apart from ./index.tsx so that file exports components alone, which is what\n// keeps fast refresh working for it — the same arrangement `src/row` uses.\n// `rootStyles` is here for a second reason: index.test.tsx applies it\n// directly, because React Aria enters `isDropTarget` only inside a real drag\n// session that a synthetic DragEvent does not start.\n\nconst dropZoneStyles = {\n label: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kogj98: \"x1ghz6dp\",\n k9WMMc: \"x2b8uid\",\n $$css: true\n },\n labelDisabled: {\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n root: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x14s9m32\",\n kVAM5u: \"x133yhug\",\n kaIpWk: \"x62ce2h\",\n ksu8eU: \"xbsl7fq\",\n kMzoRj: \"xmkeg23\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x1gka490\",\n kjj79g: \"xl56j7k\",\n kAzted: \"x1db3i3o\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1apw6a7\",\n kIyJzY: \"xkzkux9\",\n k1ekBW: \"xts7igz\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n rootDisabled: {\n kWkggS: \"x14s9m32\",\n kVAM5u: \"x9wqfse\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n rootFocused: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n rootOver: {\n kWkggS: \"xp89om9\",\n kVAM5u: \"x1uajy3w\",\n ksu8eU: \"x1y0btm7\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n }\n};\n\n// The target's own classes, from React Aria's render state. `disabled` is\n// applied last so it wins over the other two, and StyleX replaces a property\n// whole, so it takes their fill and their rule with it.\nfunction rootStyles(state: {\n isDisabled: boolean;\n isDropTarget: boolean;\n isFocusVisible: boolean;\n}) {\n return {\n 0: {\n className: \"x12w9bfk x6s0dn4 x14s9m32 x133yhug x62ce2h xbsl7fq xmkeg23 x9f619 x139gbkf x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7\"\n },\n 4: {\n className: \"x12w9bfk x6s0dn4 x14s9m32 x133yhug x62ce2h xbsl7fq xmkeg23 x9f619 x139gbkf x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59\"\n },\n 2: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xp89om9 x1uajy3w x1y0btm7 xscdzaa\"\n },\n 6: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59 xp89om9 x1uajy3w x1y0btm7 xscdzaa\"\n },\n 1: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xbsl7fq xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n },\n 5: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xbsl7fq xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n },\n 3: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 x1y0btm7 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n },\n 7: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59 x1y0btm7 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n }\n }[!!state.isFocusVisible << 2 | !!state.isDropTarget << 1 | !!state.isDisabled << 0];\n}\nexport { dropZoneStyles, rootStyles };"],"mappings":";AAUA,MAAMA,iBAAiB;CACrBC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,eAAe;EACbT,QAAQ;EACRQ,OAAO;CACT;CACAE,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRlB,QAAQ;EACRmB,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRvB,OAAO;CACT;CACAwB,cAAc;EACZnB,QAAQ;EACRC,QAAQ;EACRd,QAAQ;EACRiC,QAAQ;EACRzB,OAAO;CACT;CACA0B,aAAa;EACXR,QAAQ;EACRlB,OAAO;CACT;CACA2B,UAAU;EACRtB,QAAQ;EACRC,QAAQ;EACRE,QAAQ;EACRhB,QAAQ;EACRQ,OAAO;CACT;AACF;AAKA,SAAS4B,WAAWC,OAIjB;CACD,OAAO;EACL,GAAG,EACDI,WAAW,0LACb;EACA,GAAG,EACDA,WAAW,yLACb;EACA,GAAG,EACDA,WAAW,yLACb;EACA,GAAG,EACDA,WAAW,wLACb;EACA,GAAG,EACDA,WAAW,kMACb;EACA,GAAG,EACDA,WAAW,iMACb;EACA,GAAG,EACDA,WAAW,mMACb;EACA,GAAG,EACDA,WAAW,kMACb;CACF,EAAE,CAAC,CAACJ,MAAMG,kBAAkB,IAAI,CAAC,CAACH,MAAME,gBAAgB,IAAI,CAAC,CAACF,MAAMC,cAAc;AACpF"}
|
|
@@ -66,5 +66,4 @@ type FabVariant = 'filled' | 'tonal';
|
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
declare function Fab({ children, label, size, tone, variant, ...props }: FabProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>): import("react").JSX.Element;
|
|
69
|
-
export { type FabProps, type FabSize, type FabTone, type FabVariant, Fab as default };
|
|
70
|
-
//# sourceMappingURL=index.d.ts.map
|
|
69
|
+
export { type FabProps, type FabSize, type FabTone, type FabVariant, Fab as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","extendedFabSizes","fabIconSizes","fabSizes","fabStyles","fabTones","focus","children","label","size","tone","variant","Fab","t0","$","props","t1","t2","t3","undefined","t4","t5","fabClasses","t6","icon","t7","isExtended","state","base","ring","isHovered","hovered","isFocusVisible","focused","isPressed","pressed","isDisabled","disabled"],"sources":["../../../src/components/fab/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport type { ButtonDOMProps, ButtonState } from '../../button';\nimport { ButtonBase } from '../../button';\nimport { extendedFabSizes, fabIconSizes, fabSizes, fabStyles, fabTones } from '../../fab/styles';\nimport { focus } from '../../styles/focus';\n\n// The FAB page's floating action button, and the extended FAB page's form of\n// it with a label: a screen's primary action, raised over the content on the\n// pages' level 3 shadow and lifted to level 4 under a hovering pointer.\n//\n// Three sizes, the pages' FAB, medium FAB and large FAB: `md` is 56dp with a\n// 24dp icon and a 16dp corner, `lg` 80dp with 28dp and 20dp, and `xl` 96dp\n// with 36dp and 28dp. The extended form keeps the size's height and corner\n// and sets a label after the icon in the size's type role — title medium,\n// title large and headline small — with 16dp, 26dp and 28dp of padding and\n// 8dp, 12dp and 16dp before the label. The 80dp size, the 20dp corner and\n// the 26dp and 28dp paddings fall between steps of their scales and are\n// written out. The pages' small FAB is gone from the newer set, so there is\n// no `xs`.\n//\n// Six colour pairs, by `tone` and `variant`: `tonal` draws the tone's\n// container pair — primary container is the pages' default — and `filled`\n// the tone itself, as Button's two variants of those names do.\n//\n// The hover, focus and pressed layers are the label colour at the usual 8%,\n// 10% and 10%, drawn as an image over the container, as the row module draws\n// its layers, so one style serves all six pairs. The pages give no disabled\n// FAB; a disabled one takes the 12% and 38% every disabled container takes,\n// and drops its shadow.\n//\n// Under forced colours the shadow goes and the container is painted over, so\n// the button is drawn as a 1px `ButtonText` rule, as Button's are.\n//\n// What every button does past its own styles — the ripple, the link form, a\n// parent's disabled state — is `src/button`'s, shared with Button and\n// IconButton. The styles below are `src/fab`'s, shared with FabMenu's FAB.\n\ntype FabProps = {\n /**\n * What the FAB does, in words. A FAB without a `label` is an icon alone,\n * which has no name of its own, so give it this; with a `label` the label\n * is its name.\n */\n 'aria-label'?: string;\n /** The FAB's icon, drawn at the size's icon size. */\n children?: ReactNode;\n /** A function may compute the class from the FAB's render state. */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Disables the press ripple. The state layers are unaffected.\n * @default false\n */\n disableRipple?: boolean;\n /**\n * Where the FAB leads. Given one, it is rendered as a link — an `<a>`,\n * announced as the link it is — with the same styles and ripple.\n */\n href?: string;\n /**\n * A label after the icon, which makes this the extended FAB: as tall as\n * the size, as wide as what it holds.\n */\n label?: ReactNode;\n /** The link's `rel`, when `href` is set. */\n rel?: string;\n /**\n * The pages' three sizes: `md` the FAB at 56px, `lg` the medium FAB at\n * 80px and `xl` the large FAB at 96px.\n * @default 'md'\n */\n size?: FabSize;\n /** A function may compute the style from the FAB's render state. */\n style?: StyleOrFunction<ButtonState>;\n /** The link's `target`, when `href` is set. */\n target?: string;\n /**\n * The colour role the FAB is drawn in.\n * @default 'primary'\n */\n tone?: FabTone;\n /**\n * `tonal` draws the tone's container pair, the pages' default; `filled`\n * draws the tone itself.\n * @default 'tonal'\n */\n variant?: FabVariant;\n} & Omit<ButtonDOMProps, 'aria-label' | 'isPending'>;\ntype FabSize = 'lg' | 'md' | 'xl';\ntype FabTone = 'primary' | 'secondary' | 'tertiary';\ntype FabVariant = 'filled' | 'tonal';\n\n/**\n * A screen's primary action, raised over its content. Its icon is its\n * children; given a `label` it is the extended FAB, with the label after the\n * icon. Given `href` it is a link with the same appearance.\n *\n * ```tsx\n * <Fab aria-label=\"Label\">\n * <PlusIcon />\n * </Fab>\n * ```\n */\nfunction Fab({\n children,\n label,\n size = 'md',\n tone = 'primary',\n variant = 'tonal',\n ...props\n}: FabProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>) {\n return <ButtonBase {...props} classes={fabClasses(label !== undefined, size, tone, variant)}>\n {children === undefined ? null : <span {...stylex.props(fabStyles.icon, fabIconSizes[size])}>\n {children}\n </span>}\n {label}\n </ButtonBase>;\n}\n\n// The FAB's classes, from React Aria's render state: the layers from what it\n// reports rather than from `:hover` and `:active`, for Button's reasons — see\n// its header. Built by a call rather than written inline at the prop, which\n// is what react-perf's no-new-function-as-prop is after.\nfunction fabClasses(isExtended: boolean, size: FabSize, tone: FabTone, variant: FabVariant) {\n return (state: ButtonState) => stylex.props(fabStyles.base, focus.ring, fabTones[variant][tone], isExtended ? extendedFabSizes[size] : fabSizes[size], state.isHovered && fabStyles.hovered, state.isFocusVisible && fabStyles.focused, state.isPressed && fabStyles.pressed, state.isDisabled && fabStyles.disabled);\n}\nexport type { FabProps, FabSize, FabTone, FabVariant };\nexport default Fab;"],"mappings":";;;;;;;;;;;;;;;;;;;AA0GA,SAAAa,IAAAC,IAAA;CAAA,MAAAC,IAAAf,EAAA,EAAA;CAAA,IAAAQ;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAa,CAAA,CAAAN,UAAAC,OAAAC,MAAAO,IAAAN,MAAAO,IAAAN,SAAAO,IAAA,GAAAH,WAAAF;EAOqDC,EAAA,KAAAD;EAAAC,EAAA,KAAAP;EAAAO,EAAA,KAAAN;EAAAM,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAX,WAAAO,EAAA;EAAAN,QAAAM,EAAA;EAAAC,UAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAJhE,MAAAL,OAAAO,OAAAG,KAAAA,IAAA,OAAAH;CACA,MAA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1B,UAAU2B,SAASJ,MAAMK,kBAAkB5B,UAAU6B,SAASN,MAAMO,aAAa9B,UAAU+B,SAASR,MAAMS,cAAchC,UAAUiC,QAAQ;AACtT"}
|
|
@@ -86,5 +86,4 @@ declare namespace FabMenu {
|
|
|
86
86
|
* Choosing it closes the menu.
|
|
87
87
|
*/
|
|
88
88
|
declare function FabMenuItem({ children, icon, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp, textValue, ...props }: FabMenuItemProps & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
89
|
-
export { FabMenuItem, type FabMenuItemProps, type FabMenuProps, FabMenu as default };
|
|
90
|
-
//# sourceMappingURL=index.d.ts.map
|
|
89
|
+
export { FabMenuItem, type FabMenuItemProps, type FabMenuProps, FabMenu as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","Key","MenuItemRenderProps","MenuItemProps","RACMenuItemProps","StyleOrFunction","stylex","createContext","useCallback","useContext","useState","Menu","RACMenu","MenuItem","RACMenuItem","MenuTrigger","RACMenuTrigger","Popover","RACPopover","Text","ButtonState","FabSize","FabTone","ButtonBase","textOf","fabIconSizes","fabSizes","fabStyles","fabTones","CloseGlyph","useRipple","focus","mergeStatefulStyles","colors","motion","radii","shadows","sizing","spacing","stateLayerOpacity","typography","FORCED_COLORS","riseIn","styles","closeButton","kZKoxP","kaIpWk","kzqmXN","$$css","closeIcon","kGuDYH","item","kGNEyG","kVAM5u","ksu8eU","kMzoRj","kGVxlE","kB7OPa","kkrTdU","k1xSpc","kMv6JI","k63SB2","kOIVth","kb6lSQ","kLWn49","kAzted","k7Eaqz","k3XXqK","kVQacm","kg3NbH","kVAEAm","khDVqt","itemDisabled","kWkggS","kMwMTN","itemFocused","kjBf7l","kInvED","kMeerF","trigger","kIyJzY","k1ekBW","kAMwcw","ToneContext","FabMenuItemProps","Omit","children","className","icon","style","FabMenuProps","container","Element","defaultOpen","isOpen","onAction","key","onOpenChange","size","tone","HTMLButtonElement","FabMenu","t0","$","label","t1","ref","t2","t3","undefined","ownOpen","setOwnOpen","open","t4","next","changeOpen","t5","triggerClasses","t6","props","t7","t8","t9","t10","t11","t12","t13","FabMenuItem","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","textValue","ripple","T0","handlers","itemClasses","md","surface","state","tonal","isHovered","hovered","isFocused","focused","isFocusVisible","isPressed","pressed","isDisabled","base","ring","filled","disabled","Item","_c","stylex.props","RACMenu","RACPopover","RACMenuTrigger","props","RACMenuItem"],"sources":["../../../src/components/fab-menu/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, Key, MenuItemRenderProps, MenuItemProps as RACMenuItemProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useState } from 'react';\nimport { Menu as RACMenu, MenuItem as RACMenuItem, MenuTrigger as RACMenuTrigger, Popover as RACPopover, Text } from 'react-aria-components';\nimport type { ButtonState } from '../../button';\nimport type { FabSize, FabTone } from '../fab';\nimport { ButtonBase } from '../../button';\nimport { textOf } from '../../collection/text';\nimport { fabIconSizes, fabSizes, fabStyles, fabTones } from '../../fab/styles';\nimport { 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, shadows, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The FAB menu page's menu: a FAB that opens two to six related actions\n// floating above it, in place of a speed dial. Open, the FAB becomes the\n// menu's close button — the pages' 56dp circle in the tone itself, with a\n// 20dp close mark — and the actions stand in a column 8dp above it, lined up\n// on its trailing edge, each a 56dp pill on the tone's container pair with\n// 24dp at either end, a 24dp icon 8dp before a title-medium label, 4dp apart\n// and raised on the level 3 shadow. The values are the page's, read from\n// Material Design's own FAB menu tokens. The three tones are the page's three\n// colour sets: the close button takes the tone and the actions its\n// container, so the two contrast as the page draws them.\n//\n// The FAB is the menu's own rather than a child the call site places, as\n// Menu's trigger is, because what it draws depends on whether the menu is\n// open, and the menu is what knows. Closed, it is Fab at any of its sizes,\n// with Fab's styles; it shrinks to the close button's 56dp as the menu opens,\n// keeping the corner its layout anchors it by, and its corner rounds and its\n// colour deepens over the same medium duration. A reader who asks for\n// reduced motion gets the change at once.\n//\n// React Aria's `MenuTrigger`, `Menu` and `MenuItem` supply the behaviour: the\n// FAB's `aria-expanded`, the arrow keys between the actions, Escape and an\n// outside press to close, and focus returned to the FAB. The surface is\n// React Aria's `Popover` with nothing drawn on it, since each action is a\n// container of its own; it arrives over the overlay module's short duration,\n// as every popup does, and leaves at once, for the reason that module\n// gives.\n//\n// Under forced colours the shadows go and the containers are painted over,\n// so the FAB and each action are drawn as a 1px `ButtonText` rule.\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// The actions rise into place from just below where they settle.\nconst riseIn = \"x1uknk9t-B\";\nconst styles = {\n closeButton: {\n kZKoxP: \"xs1ryiz\",\n kaIpWk: \"x16rqkct\",\n kzqmXN: \"x1fh0d6s\",\n $$css: true\n },\n closeIcon: {\n kGuDYH: \"xwsyq91\",\n $$css: true\n },\n item: {\n kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1dkaolv\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\n kGVxlE: \"x1udv5rz\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n k63SB2: \"xrf6cl6\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n kAzted: \"xdovgog\",\n k7Eaqz: \"x13ijof9\",\n k3XXqK: \"x1t137rt\",\n kVQacm: \"xb3r6kr\",\n kg3NbH: \"xg0ps1x\",\n kVAEAm: \"x1n2onr6\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n itemDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n itemFocused: {\n kjBf7l: \"x1x84bn5\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n trigger: {\n kIyJzY: \"xioksi3 x12w9bfk\",\n k1ekBW: \"x104ni8d\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n }\n};\n\n// What a tone draws its actions in: the container pair, as the close button\n// takes the tone itself.\nconst ToneContext = createContext<FabTone>('primary');\ntype FabMenuItemProps = Omit<RACMenuItemProps, 'children' | 'className' | 'style'> & {\n /** The action's name, drawn as its label. */\n children: ReactNode;\n /** A function may compute the class from the action's render state. */\n className?: ClassNameOrFunction<MenuItemRenderProps>;\n /** An icon before the label, at the page's 24px. */\n icon?: ReactNode;\n /** A function may compute the style from the action's render state. */\n style?: StyleOrFunction<MenuItemRenderProps>;\n};\ntype FabMenuProps = {\n /**\n * What the FAB does, in words: an icon alone has no name, and the menu\n * takes its name from the FAB that opens it.\n */\n 'aria-label': string;\n /** The actions, as `FabMenu.Item`s — the page asks for two to six. */\n children: ReactNode;\n /**\n * A function may compute the class from the FAB's render state. It lands\n * on the FAB, which is what a layout positions.\n */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Where the actions are portalled to. Defaults to the container of the\n * `ThemeScope` around it, or to the end of `<body>` where there is none. A\n * subtree themed through the `themeScope` class has no container of its own,\n * so point this inside it, or they render outside and keep the page's tokens.\n */\n container?: Element;\n /**\n * Whether the menu starts open, when it keeps its own state.\n * @default false\n */\n defaultOpen?: boolean;\n /** The FAB's icon while the menu is closed. */\n icon: ReactNode;\n /** Whether the menu is open, when the call site holds the state. */\n isOpen?: boolean;\n /** Called with an action's `id` when it is chosen. */\n onAction?: (key: Key) => void;\n /** Called when the menu opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /**\n * The FAB's size while the menu is closed, as Fab's: `md` 56px, `lg` 80px\n * or `xl` 96px. Open, it is the close button's 56px whatever it was.\n * @default 'md'\n */\n size?: FabSize;\n /** A function may compute the style from the FAB's render state. */\n style?: StyleOrFunction<ButtonState>;\n /**\n * The page's three colour sets: the close button takes the tone and the\n * actions its container pair.\n * @default 'primary'\n */\n tone?: FabTone;\n} & RefAttributes<HTMLButtonElement>;\n\n/**\n * A FAB that opens a column of related actions above it, and closes them\n * again. The actions are `FabMenu.Item`s.\n *\n * ```tsx\n * <FabMenu aria-label=\"Label\" icon={<PlusIcon />}>\n * <FabMenu.Item icon={<FirstIcon />} id=\"first\">\n * First item\n * </FabMenu.Item>\n * <FabMenu.Item icon={<SecondIcon />} id=\"second\">\n * Second item\n * </FabMenu.Item>\n * </FabMenu>\n * ```\n *\n * The call site's `className`, `style` and `ref` land on the FAB.\n */\nfunction FabMenu({\n 'aria-label': label,\n children,\n className,\n container,\n defaultOpen = false,\n icon,\n isOpen,\n onAction,\n onOpenChange,\n ref,\n size = 'md',\n style,\n tone = 'primary'\n}: FabMenuProps) {\n const [ownOpen, setOwnOpen] = useState(defaultOpen);\n const open = isOpen ?? ownOpen;\n const changeOpen = useCallback((next: boolean) => {\n if (isOpen === undefined) {\n setOwnOpen(next);\n }\n onOpenChange?.(next);\n }, [isOpen, onOpenChange]);\n return <ToneContext value={tone}>\n <RACMenuTrigger isOpen={open} onOpenChange={changeOpen}>\n <ButtonBase aria-label={label} classes={triggerClasses(open, size, tone)} className={className} ref={ref} style={style}>\n <span {...stylex.props(fabStyles.icon, open ? styles.closeIcon : fabIconSizes[size])}>\n {open ? <CloseGlyph className=\"xlzyvqe x15vhz18\" /> : icon}\n </span>\n </ButtonBase>\n <RACPopover offset={8} placement=\"top end\"\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} className=\"xvhm28k x1u6grsq xhpbw76 x16dv9tl x9f619 x1t137rt\">\n <RACMenu onAction={onAction} className=\"xuk3077 x9f619 x78zum5 xdt5ytf xzoy561 x1t137rt\">\n {children}\n </RACMenu>\n </RACPopover>\n </RACMenuTrigger>\n </ToneContext>;\n}\n\n/**\n * One action: a pill holding an icon and a label, on the menu's tone.\n * Choosing it closes the menu.\n */\nfunction FabMenuItem({\n children,\n icon,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n textValue,\n ...props\n}: FabMenuItemProps & RefAttributes<HTMLDivElement>) {\n const tone = useContext(ToneContext);\n // The press ripple Menu's items draw — see MenuItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACMenuItem textValue={textValue ?? textOf(children)} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemClasses(tone), props)}>\n {icon === undefined ? null : <span {...stylex.props(fabStyles.icon, fabIconSizes.md)}>{icon}</span>}\n <Text slot=\"label\">{children}</Text>\n {ripple.surface}\n </RACMenuItem>;\n}\n\n// An action's classes, from React Aria's render state: the tone's container\n// pair, and the layers over it. Built by a call rather than written inline at\n// the prop, which is what react-perf's no-new-function-as-prop is after.\nfunction itemClasses(tone: FabTone) {\n return (state: MenuItemRenderProps) => stylex.props(styles.item, fabTones.tonal[tone], state.isHovered && fabStyles.hovered, state.isFocused && fabStyles.focused, state.isFocusVisible && styles.itemFocused, state.isPressed && fabStyles.pressed, state.isDisabled && styles.itemDisabled);\n}\n\n// The FAB's classes: Fab's own while the menu is closed, the close button's\n// while it is open. A press layer is drawn only while closed — React Aria\n// reports the FAB pressed for as long as its menu is open.\nfunction triggerClasses(isOpen: boolean, size: FabSize, tone: FabTone) {\n return (state: ButtonState) => stylex.props(fabStyles.base, focus.ring, styles.trigger, isOpen ? fabTones.filled[tone] : fabTones.tonal[tone], isOpen ? styles.closeButton : fabSizes[size], state.isHovered && fabStyles.hovered, state.isFocusVisible && fabStyles.focused, !isOpen && state.isPressed && fabStyles.pressed, state.isDisabled && fabStyles.disabled);\n}\nFabMenu.Item = FabMenuItem;\nexport type { FabMenuItemProps, FabMenuProps };\nexport { FabMenuItem };\nexport default FabMenu;"],"mappings":";;;;;;;;;;;;;;AAyDA,MAAM+C,SAAS;CACbC,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,WAAW;EACTC,QAAQ;EACRF,OAAO;CACT;CACAG,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRvB,OAAO;CACT;CACAwB,cAAc;EACZC,QAAQ;EACRpB,QAAQ;EACRG,QAAQ;EACRkB,QAAQ;EACRhB,QAAQ;EACRV,OAAO;CACT;CACA2B,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACR9B,OAAO;CACT;CACA+B,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRlC,OAAO;CACT;AACF;AAIA,MAAMmC,cAAc5E,cAAuB,SAAS;;;;;;;;;;;;;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EAAA,MAAAgC;EAAAhC,EAAA,MAAAgB;EAAAhB,EAAA,MAAA+B,OAAAE;EAAAjC,EAAA,MAAA+B,OAAAK;EAAApC,EAAA,MAAAI;EAAAJ,EAAA,MAAAU;EAAAV,EAAA,MAAAa;EAAAb,EAAA,MAAAe;EAAAf,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OAJTiB;AAIS;AAMlB,SAASiB,YAAYtC,MAAe;CAClC,QAAQyC,UAA+BtI,MAAaqC,OAAOQ,MAAMvB,SAASiH,MAAM1C,OAAOyC,MAAME,aAAanH,UAAUoH,SAASH,MAAMI,aAAarH,UAAUsH,SAASL,MAAMM,kBAAkBvG,OAAOgC,aAAaiE,MAAMO,aAAaxH,UAAUyH,SAASR,MAAMS,cAAc1G,OAAO6B,YAAY;AAC9R;AAKA,SAAS6C,eAAevB,QAAiBI,MAAeC,MAAe;CACrE,QAAQyC,UAAuBtI,MAAaqB,UAAU2H,MAAMvH,MAAMwH,MAAM5G,OAAOoC,SAASe,SAASlE,SAAS4H,OAAOrD,QAAQvE,SAASiH,MAAM1C,OAAOL,SAASnD,OAAOC,cAAclB,SAASwE,OAAO0C,MAAME,aAAanH,UAAUoH,SAASH,MAAMM,kBAAkBvH,UAAUsH,SAAS,CAACnD,UAAU8C,MAAMO,aAAaxH,UAAUyH,SAASR,MAAMS,cAAc1H,UAAU8H,QAAQ;AACvW;AACApD,QAAQqD,OAAO3B"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","createContext","useContext","useState","RACMenuItem","textOf","fabIconSizes","fabSizes","fabStyles","fabTones","useRipple","focus","mergeStatefulStyles","styles","closeButton","kZKoxP","kaIpWk","kzqmXN","$$css","closeIcon","kGuDYH","item","kGNEyG","kVAM5u","ksu8eU","kMzoRj","kGVxlE","kB7OPa","kkrTdU","k1xSpc","kMv6JI","k63SB2","kOIVth","kb6lSQ","kLWn49","kAzted","k7Eaqz","k3XXqK","kVQacm","kg3NbH","kVAEAm","khDVqt","itemDisabled","kWkggS","kMwMTN","itemFocused","kjBf7l","kInvED","kMeerF","trigger","kIyJzY","k1ekBW","kAMwcw","ToneContext","children","className","icon","style","container","defaultOpen","isOpen","onAction","onOpenChange","size","tone","FabMenu","t0","$","label","t1","ref","t2","t3","undefined","ownOpen","setOwnOpen","open","t4","next","changeOpen","t5","triggerClasses","t6","props","t7","t8","t9","t10","t11","t12","t13","FabMenuItem","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","textValue","ripple","T0","handlers","itemClasses","md","surface","state","tonal","isHovered","hovered","isFocused","focused","isFocusVisible","isPressed","pressed","isDisabled","base","ring","filled","disabled","Item","RACMenu","RACPopover","RACMenuTrigger"],"sources":["../../../src/components/fab-menu/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, Key, MenuItemRenderProps, MenuItemProps as RACMenuItemProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useState } from 'react';\nimport { Menu as RACMenu, MenuItem as RACMenuItem, MenuTrigger as RACMenuTrigger, Popover as RACPopover, Text } from 'react-aria-components';\nimport type { ButtonState } from '../../button';\nimport type { FabSize, FabTone } from '../fab';\nimport { ButtonBase } from '../../button';\nimport { textOf } from '../../collection/text';\nimport { fabIconSizes, fabSizes, fabStyles, fabTones } from '../../fab/styles';\nimport { 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, shadows, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The FAB menu page's menu: a FAB that opens two to six related actions\n// floating above it, in place of a speed dial. Open, the FAB becomes the\n// menu's close button — the pages' 56dp circle in the tone itself, with a\n// 20dp close mark — and the actions stand in a column 8dp above it, lined up\n// on its trailing edge, each a 56dp pill on the tone's container pair with\n// 24dp at either end, a 24dp icon 8dp before a title-medium label, 4dp apart\n// and raised on the level 3 shadow. The values are the page's, read from\n// Material Design's own FAB menu tokens. The three tones are the page's three\n// colour sets: the close button takes the tone and the actions its\n// container, so the two contrast as the page draws them.\n//\n// The FAB is the menu's own rather than a child the call site places, as\n// Menu's trigger is, because what it draws depends on whether the menu is\n// open, and the menu is what knows. Closed, it is Fab at any of its sizes,\n// with Fab's styles; it shrinks to the close button's 56dp as the menu opens,\n// keeping the corner its layout anchors it by, and its corner rounds and its\n// colour deepens over the same medium duration. A reader who asks for\n// reduced motion gets the change at once.\n//\n// React Aria's `MenuTrigger`, `Menu` and `MenuItem` supply the behaviour: the\n// FAB's `aria-expanded`, the arrow keys between the actions, Escape and an\n// outside press to close, and focus returned to the FAB. The surface is\n// React Aria's `Popover` with nothing drawn on it, since each action is a\n// container of its own; it arrives over the overlay module's short duration,\n// as every popup does, and leaves at once, for the reason that module\n// gives.\n//\n// Under forced colours the shadows go and the containers are painted over,\n// so the FAB and each action are drawn as a 1px `ButtonText` rule.\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// The actions rise into place from just below where they settle.\nconst riseIn = \"x1uknk9t-B\";\nconst styles = {\n closeButton: {\n kZKoxP: \"xs1ryiz\",\n kaIpWk: \"x16rqkct\",\n kzqmXN: \"x1fh0d6s\",\n $$css: true\n },\n closeIcon: {\n kGuDYH: \"xwsyq91\",\n $$css: true\n },\n item: {\n kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1dkaolv\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\n kGVxlE: \"x1udv5rz\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n k63SB2: \"xrf6cl6\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n kAzted: \"xdovgog\",\n k7Eaqz: \"x13ijof9\",\n k3XXqK: \"x1t137rt\",\n kVQacm: \"xb3r6kr\",\n kg3NbH: \"xg0ps1x\",\n kVAEAm: \"x1n2onr6\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n itemDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n itemFocused: {\n kjBf7l: \"x1x84bn5\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n trigger: {\n kIyJzY: \"xioksi3 x12w9bfk\",\n k1ekBW: \"x104ni8d\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n }\n};\n\n// What a tone draws its actions in: the container pair, as the close button\n// takes the tone itself.\nconst ToneContext = createContext<FabTone>('primary');\ntype FabMenuItemProps = Omit<RACMenuItemProps, 'children' | 'className' | 'style'> & {\n /** The action's name, drawn as its label. */\n children: ReactNode;\n /** A function may compute the class from the action's render state. */\n className?: ClassNameOrFunction<MenuItemRenderProps>;\n /** An icon before the label, at the page's 24px. */\n icon?: ReactNode;\n /** A function may compute the style from the action's render state. */\n style?: StyleOrFunction<MenuItemRenderProps>;\n};\ntype FabMenuProps = {\n /**\n * What the FAB does, in words: an icon alone has no name, and the menu\n * takes its name from the FAB that opens it.\n */\n 'aria-label': string;\n /** The actions, as `FabMenu.Item`s — the page asks for two to six. */\n children: ReactNode;\n /**\n * A function may compute the class from the FAB's render state. It lands\n * on the FAB, which is what a layout positions.\n */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Where the actions are portalled to. Defaults to the container of the\n * `ThemeScope` around it, or to the end of `<body>` where there is none. A\n * subtree themed through the `themeScope` class has no container of its own,\n * so point this inside it, or they render outside and keep the page's tokens.\n */\n container?: Element;\n /**\n * Whether the menu starts open, when it keeps its own state.\n * @default false\n */\n defaultOpen?: boolean;\n /** The FAB's icon while the menu is closed. */\n icon: ReactNode;\n /** Whether the menu is open, when the call site holds the state. */\n isOpen?: boolean;\n /** Called with an action's `id` when it is chosen. */\n onAction?: (key: Key) => void;\n /** Called when the menu opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /**\n * The FAB's size while the menu is closed, as Fab's: `md` 56px, `lg` 80px\n * or `xl` 96px. Open, it is the close button's 56px whatever it was.\n * @default 'md'\n */\n size?: FabSize;\n /** A function may compute the style from the FAB's render state. */\n style?: StyleOrFunction<ButtonState>;\n /**\n * The page's three colour sets: the close button takes the tone and the\n * actions its container pair.\n * @default 'primary'\n */\n tone?: FabTone;\n} & RefAttributes<HTMLButtonElement>;\n\n/**\n * A FAB that opens a column of related actions above it, and closes them\n * again. The actions are `FabMenu.Item`s.\n *\n * ```tsx\n * <FabMenu aria-label=\"Label\" icon={<PlusIcon />}>\n * <FabMenu.Item icon={<FirstIcon />} id=\"first\">\n * First item\n * </FabMenu.Item>\n * <FabMenu.Item icon={<SecondIcon />} id=\"second\">\n * Second item\n * </FabMenu.Item>\n * </FabMenu>\n * ```\n *\n * The call site's `className`, `style` and `ref` land on the FAB.\n */\nfunction FabMenu({\n 'aria-label': label,\n children,\n className,\n container,\n defaultOpen = false,\n icon,\n isOpen,\n onAction,\n onOpenChange,\n ref,\n size = 'md',\n style,\n tone = 'primary'\n}: FabMenuProps) {\n const [ownOpen, setOwnOpen] = useState(defaultOpen);\n const open = isOpen ?? ownOpen;\n const changeOpen = useCallback((next: boolean) => {\n if (isOpen === undefined) {\n setOwnOpen(next);\n }\n onOpenChange?.(next);\n }, [isOpen, onOpenChange]);\n return <ToneContext value={tone}>\n <RACMenuTrigger isOpen={open} onOpenChange={changeOpen}>\n <ButtonBase aria-label={label} classes={triggerClasses(open, size, tone)} className={className} ref={ref} style={style}>\n <span {...stylex.props(fabStyles.icon, open ? styles.closeIcon : fabIconSizes[size])}>\n {open ? <CloseGlyph className=\"xlzyvqe x15vhz18\" /> : icon}\n </span>\n </ButtonBase>\n <RACPopover offset={8} placement=\"top end\"\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} className=\"xvhm28k x1u6grsq xhpbw76 x16dv9tl x9f619 x1t137rt\">\n <RACMenu onAction={onAction} className=\"xuk3077 x9f619 x78zum5 xdt5ytf xzoy561 x1t137rt\">\n {children}\n </RACMenu>\n </RACPopover>\n </RACMenuTrigger>\n </ToneContext>;\n}\n\n/**\n * One action: a pill holding an icon and a label, on the menu's tone.\n * Choosing it closes the menu.\n */\nfunction FabMenuItem({\n children,\n icon,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n textValue,\n ...props\n}: FabMenuItemProps & RefAttributes<HTMLDivElement>) {\n const tone = useContext(ToneContext);\n // The press ripple Menu's items draw — see MenuItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACMenuItem textValue={textValue ?? textOf(children)} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemClasses(tone), props)}>\n {icon === undefined ? null : <span {...stylex.props(fabStyles.icon, fabIconSizes.md)}>{icon}</span>}\n <Text slot=\"label\">{children}</Text>\n {ripple.surface}\n </RACMenuItem>;\n}\n\n// An action's classes, from React Aria's render state: the tone's container\n// pair, and the layers over it. Built by a call rather than written inline at\n// the prop, which is what react-perf's no-new-function-as-prop is after.\nfunction itemClasses(tone: FabTone) {\n return (state: MenuItemRenderProps) => stylex.props(styles.item, fabTones.tonal[tone], state.isHovered && fabStyles.hovered, state.isFocused && fabStyles.focused, state.isFocusVisible && styles.itemFocused, state.isPressed && fabStyles.pressed, state.isDisabled && styles.itemDisabled);\n}\n\n// The FAB's classes: Fab's own while the menu is closed, the close button's\n// while it is open. A press layer is drawn only while closed — React Aria\n// reports the FAB pressed for as long as its menu is open.\nfunction triggerClasses(isOpen: boolean, size: FabSize, tone: FabTone) {\n return (state: ButtonState) => stylex.props(fabStyles.base, focus.ring, styles.trigger, isOpen ? fabTones.filled[tone] : fabTones.tonal[tone], isOpen ? styles.closeButton : fabSizes[size], state.isHovered && fabStyles.hovered, state.isFocusVisible && fabStyles.focused, !isOpen && state.isPressed && fabStyles.pressed, state.isDisabled && fabStyles.disabled);\n}\nFabMenu.Item = FabMenuItem;\nexport type { FabMenuItemProps, FabMenuProps };\nexport { FabMenuItem };\nexport default FabMenu;"],"mappings":";;;;;;;;;;;;;;AAyDA,MAAMc,SAAS;CACbC,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,WAAW;EACTC,QAAQ;EACRF,OAAO;CACT;CACAG,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRvB,OAAO;CACT;CACAwB,cAAc;EACZC,QAAQ;EACRpB,QAAQ;EACRG,QAAQ;EACRkB,QAAQ;EACRhB,QAAQ;EACRV,OAAO;CACT;CACA2B,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACR9B,OAAO;CACT;CACA+B,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;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FG;IACDE;IACCgB,OAAMK;GAHQ;;EAIHpC,EAAA,MAAAgC;EAAAhC,EAAA,MAAAgB;EAAAhB,EAAA,MAAA+B,OAAAE;EAAAjC,EAAA,MAAA+B,OAAAK;EAAApC,EAAA,MAAAI;EAAAJ,EAAA,MAAAU;EAAAV,EAAA,MAAAa;EAAAb,EAAA,MAAAe;EAAAf,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OAJTiB;AAIS;AAMlB,SAASiB,YAAYrC,MAAe;CAClC,QAAQwC,UAA+BxG,MAAaa,OAAOQ,MAAMZ,SAASgG,MAAMzC,OAAOwC,MAAME,aAAalG,UAAUmG,SAASH,MAAMI,aAAapG,UAAUqG,SAASL,MAAMM,kBAAkBjG,OAAOgC,aAAa2D,MAAMO,aAAavG,UAAUwG,SAASR,MAAMS,cAAcpG,OAAO6B,YAAY;AAC9R;AAKA,SAASuC,eAAerB,QAAiBG,MAAeC,MAAe;CACrE,QAAQwC,UAAuBxG,MAAaQ,UAAU0G,MAAMvG,MAAMwG,MAAMtG,OAAOoC,SAASW,SAASnD,SAAS2G,OAAOpD,QAAQvD,SAASgG,MAAMzC,OAAOJ,SAAS/C,OAAOC,cAAcP,SAASwD,OAAOyC,MAAME,aAAalG,UAAUmG,SAASH,MAAMM,kBAAkBtG,UAAUqG,SAAS,CAACjD,UAAU4C,MAAMO,aAAavG,UAAUwG,SAASR,MAAMS,cAAczG,UAAU6G,QAAQ;AACvW;AACApD,QAAQqD,OAAO3B"}
|
|
@@ -29,5 +29,4 @@ type FeedProps = {
|
|
|
29
29
|
* inside a pane reflows with the pane rather than with the browser.
|
|
30
30
|
*/
|
|
31
31
|
declare function Feed({ minItemWidth, render, ...props }: FeedProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
32
|
-
export { type FeedProps, Feed as default };
|
|
33
|
-
//# sourceMappingURL=index.d.ts.map
|
|
32
|
+
export { type FeedProps, Feed as default };
|