@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
package/dist/glyphs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","SVGProps","arrowBackPath","arrowDownwardPath","arrowDropDownPath","arrowUpwardPath","calendarPath","checkCirclePath","checkPath","chevronDownPath","chevronEndPath","clockPath","closePath","errorPath","gridSize","keyboardPath","minusPath","personPath","plusPath","searchPath","stylex","mergeStyles","glyphStyles","GlyphProps","Omit","SVGSVGElement","ArrowBackGlyph","props","$","_c","t0","Symbol","for","t1","ArrowDownwardGlyph","ArrowDropDownGlyph","ArrowUpwardGlyph","CalendarGlyph","CheckCircleGlyph","CheckGlyph","ClockGlyph","ErrorGlyph","Glyph","children","t2","t3","t4","t5","t6","glyph","KeyboardGlyph","MinusGlyph","IndeterminateGlyph","ChevronDownGlyph","ChevronEndGlyph","CloseGlyph","PersonGlyph","PlusGlyph","SearchGlyph","_c","props","stylex.props"],"sources":["../../src/glyphs/index.tsx"],"sourcesContent":["import type { ReactNode, SVGProps } from 'react';\nimport { arrowBackPath, arrowDownwardPath, arrowDropDownPath, arrowUpwardPath, calendarPath, checkCirclePath, checkPath, chevronDownPath, chevronEndPath, clockPath, closePath, errorPath, gridSize, keyboardPath, minusPath, personPath, plusPath, searchPath } from '@kanso-labs/kanso-ui-core/glyphs';\nimport * as stylex from '@stylexjs/stylex';\nimport { mergeStyles } from '../styles/merge';\nimport { glyphStyles } from './styles';\n\n// The glyphs the library's own controls draw: the check and the dash a\n// checkbox shows, the plus and minus a number field's steppers show, and\n// the magnifier and cross a search field shows. Inline SVG in\n// `currentColor`, sized by whatever renders them, and private to the\n// library — a call site with icons of its own passes them to IconButton and\n// the slots that take a node, which is why nothing here is exported from\n// the package.\n//\n// The paths are @kanso-labs/kanso-ui-core's, the ones react-native-kanso-ui\n// draws too: the check, the horizontal rule, the plus, the search, the close,\n// the right and down chevrons, the two sort arrows, the back arrow, the\n// drop-down arrow, the calendar, the schedule clock, the keyboard, the person,\n// and the filled error and check circles. The package is a devDependency, so\n// the build writes them into dist. They are Material Symbols on their 24-unit\n// grid, which is what the checkbox page\n// draws at 18dp, the icon buttons page at 20 and the search, menus, date\n// picker and time picker pages at 24 — the date picker's menu\n// buttons draw their arrow at 18, a split button's menu button its\n// chevron at between 22 and 50, and a meter its two circles at 18.\n\ntype GlyphProps = Omit<SVGProps<SVGSVGElement>, 'children' | 'viewBox'>;\n\n// What a search view's back button draws, pointing at the page it returns\n// to. It says \"back\" rather than \"to the left\", so whatever renders it\n// mirrors it under a right-to-left writing mode, as ChevronEndGlyph's\n// renderers do.\nfunction ArrowBackGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={arrowBackPath} />\n </Glyph>;\n}\n\n// Which way a sorted column is ordered. Up is ascending and down is\n// descending, which is the direction the data tables page puts beside a\n// column header's name. Neither mirrors under a right-to-left writing mode:\n// they say \"up\" and \"down\" rather than \"onward\", and those do not flip.\nfunction ArrowDownwardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={arrowDownwardPath} />\n </Glyph>;\n}\n\n// What a menu button draws after its label, pointing at the list it opens.\n// Down is down in either writing direction, so it does not mirror.\nfunction ArrowDropDownGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={arrowDropDownPath} />\n </Glyph>;\n}\nfunction ArrowUpwardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={arrowUpwardPath} />\n </Glyph>;\n}\n\n// What the date picker's trigger draws: the calendar a date is picked from.\nfunction CalendarGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={calendarPath} />\n </Glyph>;\n}\n\n// What a meter in the positive tone draws beside its value: a check in a\n// filled circle, the same outline as the negative tone's error so the two\n// differ by the mark inside rather than by their colour alone.\nfunction CheckCircleGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={checkCirclePath} />\n </Glyph>;\n}\nfunction CheckGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={checkPath} />\n </Glyph>;\n}\n\n// What the time picker's trigger draws, and the button that takes its\n// keyboard entry back to the dial: the clock a time is picked from.\nfunction ClockGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={clockPath} />\n </Glyph>;\n}\n\n// What a meter in the negative tone draws beside its value: an exclamation\n// mark in a filled circle — see `CheckCircleGlyph`.\nfunction ErrorGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={errorPath} />\n </Glyph>;\n}\n\n/**\n * The svg every glyph draws: the 24-unit grid its path is on, the colour it\n * takes from the text around it, and its box. The call site's `className`\n * and `style` are merged with the glyph's own rather than replacing them.\n */\nfunction Glyph({\n children,\n ...props\n}: GlyphProps & {\n children: ReactNode;\n}) {\n return <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox={`0 0 ${gridSize} ${gridSize}`} {...props} {...mergeStyles(stylex.props(glyphStyles.glyph), props)}>\n {children}\n </svg>;\n}\n\n// What the time picker's dial draws on the button that switches it to typed\n// entry.\nfunction KeyboardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={keyboardPath} />\n </Glyph>;\n}\n\n// The same rule stands for a partly selected checkbox and for a stepper's\n// decrement; the two names say which is meant at the call site.\nfunction MinusGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={minusPath} />\n </Glyph>;\n}\nconst IndeterminateGlyph = MinusGlyph;\n\n// Points down at the menu a split button's second half opens.\nfunction ChevronDownGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={chevronDownPath} />\n </Glyph>;\n}\n\n// Points at the submenu a menu item opens. It says \"further in\" rather than\n// \"to the right\", so whatever renders it mirrors it under a right-to-left\n// writing mode — the glyph itself carries no direction of its own, since a\n// transform here would be an inline style.\nfunction ChevronEndGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={chevronEndPath} />\n </Glyph>;\n}\nfunction CloseGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={closePath} />\n </Glyph>;\n}\n\n// What an avatar with no name to take initials from draws: Material Design's\n// anonymous person, a head over shoulders.\nfunction PersonGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={personPath} />\n </Glyph>;\n}\nfunction PlusGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={plusPath} />\n </Glyph>;\n}\nfunction SearchGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={searchPath} />\n </Glyph>;\n}\nexport { ArrowBackGlyph, ArrowDownwardGlyph, ArrowDropDownGlyph, ArrowUpwardGlyph, CalendarGlyph, CheckCircleGlyph, CheckGlyph, ChevronDownGlyph, ChevronEndGlyph, ClockGlyph, CloseGlyph, ErrorGlyph, IndeterminateGlyph, KeyboardGlyph, Min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,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADpBM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACdG,UAAAA;EADS,CAAA;EAEHF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFHK;AAEG;AAEZ,SAAAwB,UAAA9B,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,oBAAA,QAAA,EAASZ,GAAAA,SAAQ,CAAA;EAAIU,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADlBM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACdG,UAAAA;EADS,CAAA;EAEHF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFHK;AAEG;AAEZ,SAAAyB,YAAA/B,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,oBAAA,QAAA,EAASX,GAAAA,WAAU,CAAA;EAAIS,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADpBM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACdG,UAAAA;EADS,CAAA;EAEHF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFHK;AAEG"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["arrowBackPath","arrowDownwardPath","arrowDropDownPath","arrowUpwardPath","calendarPath","checkCirclePath","checkPath","chevronDownPath","chevronEndPath","clockPath","closePath","errorPath","keyboardPath","minusPath","personPath","plusPath","searchPath","stylex","mergeStyles","glyphStyles","ArrowBackGlyph","props","$","_c","t0","Symbol","for","t1","ArrowDownwardGlyph","ArrowDropDownGlyph","ArrowUpwardGlyph","CalendarGlyph","CheckCircleGlyph","CheckGlyph","ClockGlyph","ErrorGlyph","Glyph","children","t2","t3","t4","t5","t6","glyph","KeyboardGlyph","MinusGlyph","IndeterminateGlyph","ChevronDownGlyph","ChevronEndGlyph","CloseGlyph","PersonGlyph","PlusGlyph","SearchGlyph"],"sources":["../../src/glyphs/index.tsx"],"sourcesContent":["import type { ReactNode, SVGProps } from 'react';\nimport { arrowBackPath, arrowDownwardPath, arrowDropDownPath, arrowUpwardPath, calendarPath, checkCirclePath, checkPath, chevronDownPath, chevronEndPath, clockPath, closePath, errorPath, gridSize, keyboardPath, minusPath, personPath, plusPath, searchPath } from '@kanso-labs/kanso-ui-core/glyphs';\nimport * as stylex from '@stylexjs/stylex';\nimport { mergeStyles } from '../styles/merge';\nimport { glyphStyles } from './styles';\n\n// The glyphs the library's own controls draw: the check and the dash a\n// checkbox shows, the plus and minus a number field's steppers show, and\n// the magnifier and cross a search field shows. Inline SVG in\n// `currentColor`, sized by whatever renders them, and private to the\n// library — a call site with icons of its own passes them to IconButton and\n// the slots that take a node, which is why nothing here is exported from\n// the package.\n//\n// The paths are @kanso-labs/kanso-ui-core's, the ones react-native-kanso-ui\n// draws too: the check, the horizontal rule, the plus, the search, the close,\n// the right and down chevrons, the two sort arrows, the back arrow, the\n// drop-down arrow, the calendar, the schedule clock, the keyboard, the person,\n// and the filled error and check circles. The package is a devDependency, so\n// the build writes them into dist. They are Material Symbols on their 24-unit\n// grid, which is what the checkbox page\n// draws at 18dp, the icon buttons page at 20 and the search, menus, date\n// picker and time picker pages at 24 — the date picker's menu\n// buttons draw their arrow at 18, a split button's menu button its\n// chevron at between 22 and 50, and a meter its two circles at 18.\n\ntype GlyphProps = Omit<SVGProps<SVGSVGElement>, 'children' | 'viewBox'>;\n\n// What a search view's back button draws, pointing at the page it returns\n// to. It says \"back\" rather than \"to the left\", so whatever renders it\n// mirrors it under a right-to-left writing mode, as ChevronEndGlyph's\n// renderers do.\nfunction ArrowBackGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={arrowBackPath} />\n </Glyph>;\n}\n\n// Which way a sorted column is ordered. Up is ascending and down is\n// descending, which is the direction the data tables page puts beside a\n// column header's name. Neither mirrors under a right-to-left writing mode:\n// they say \"up\" and \"down\" rather than \"onward\", and those do not flip.\nfunction ArrowDownwardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={arrowDownwardPath} />\n </Glyph>;\n}\n\n// What a menu button draws after its label, pointing at the list it opens.\n// Down is down in either writing direction, so it does not mirror.\nfunction ArrowDropDownGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={arrowDropDownPath} />\n </Glyph>;\n}\nfunction ArrowUpwardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={arrowUpwardPath} />\n </Glyph>;\n}\n\n// What the date picker's trigger draws: the calendar a date is picked from.\nfunction CalendarGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={calendarPath} />\n </Glyph>;\n}\n\n// What a meter in the positive tone draws beside its value: a check in a\n// filled circle, the same outline as the negative tone's error so the two\n// differ by the mark inside rather than by their colour alone.\nfunction CheckCircleGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={checkCirclePath} />\n </Glyph>;\n}\nfunction CheckGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={checkPath} />\n </Glyph>;\n}\n\n// What the time picker's trigger draws, and the button that takes its\n// keyboard entry back to the dial: the clock a time is picked from.\nfunction ClockGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={clockPath} />\n </Glyph>;\n}\n\n// What a meter in the negative tone draws beside its value: an exclamation\n// mark in a filled circle — see `CheckCircleGlyph`.\nfunction ErrorGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={errorPath} />\n </Glyph>;\n}\n\n/**\n * The svg every glyph draws: the 24-unit grid its path is on, the colour it\n * takes from the text around it, and its box. The call site's `className`\n * and `style` are merged with the glyph's own rather than replacing them.\n */\nfunction Glyph({\n children,\n ...props\n}: GlyphProps & {\n children: ReactNode;\n}) {\n return <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox={`0 0 ${gridSize} ${gridSize}`} {...props} {...mergeStyles(stylex.props(glyphStyles.glyph), props)}>\n {children}\n </svg>;\n}\n\n// What the time picker's dial draws on the button that switches it to typed\n// entry.\nfunction KeyboardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={keyboardPath} />\n </Glyph>;\n}\n\n// The same rule stands for a partly selected checkbox and for a stepper's\n// decrement; the two names say which is meant at the call site.\nfunction MinusGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={minusPath} />\n </Glyph>;\n}\nconst IndeterminateGlyph = MinusGlyph;\n\n// Points down at the menu a split button's second half opens.\nfunction ChevronDownGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={chevronDownPath} />\n </Glyph>;\n}\n\n// Points at the submenu a menu item opens. It says \"further in\" rather than\n// \"to the right\", so whatever renders it mirrors it under a right-to-left\n// writing mode — the glyph itself carries no direction of its own, since a\n// transform here would be an inline style.\nfunction ChevronEndGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={chevronEndPath} />\n </Glyph>;\n}\nfunction CloseGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={closePath} />\n </Glyph>;\n}\n\n// What an avatar with no name to take initials from draws: Material Design's\n// anonymous person, a head over shoulders.\nfunction PersonGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={personPath} />\n </Glyph>;\n}\nfunction PlusGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={plusPath} />\n </Glyph>;\n}\nfunction SearchGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d={searchPath} />\n </Glyph>;\n}\nexport { ArrowBackGlyph, ArrowDownwardGlyph, ArrowDropDownGlyph, ArrowUpwardGlyph, Calend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3,"file":"styles.js","names":["glyphStyles","glyph","kB7OPa","$$css"],"sources":["../../src/glyphs/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\n// The glyphs' one style, apart from the glyphs in ./index.tsx so that file\n// exports components alone, which is what keeps fast refresh working for it.\n//\n// Every glyph is sized by whatever renders it, so the box it is sized in is\n// set here rather than beside each of those sizes: an element given an\n// explicit size sets `border-box`, and keeping that on the glyph is what\n// stops a new call site sizing one from forgetting it.\nconst glyphStyles = {\n glyph: {\n kB7OPa: \"x9f619\",\n $$css: true\n }\n};\nexport { glyphStyles };"],"mappings":";AASA,MAAMA,cAAc,EAClBC,OAAO;CACLC,QAAQ;CACRC,OAAO;AACT,EACF"}
|
|
@@ -46,5 +46,4 @@ type AppBarScrollOptions = {
|
|
|
46
46
|
* give it `overflow-anchor: none`, as the `collapsed` prop explains.
|
|
47
47
|
*/
|
|
48
48
|
declare function useAppBarScroll({ collapseAfter }?: AppBarScrollOptions): AppBarScroll;
|
|
49
|
-
export { type AppBarScroll, type AppBarScrollOptions, useAppBarScroll };
|
|
50
|
-
//# sourceMappingURL=useAppBarScroll.d.ts.map
|
|
49
|
+
export { type AppBarScroll, type AppBarScrollOptions, useAppBarScroll };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppBarScroll.js","names":["
|
|
1
|
+
{"version":3,"file":"useAppBarScroll.js","names":["_c","useRef","useState","COLLAPSED_BLOCK_SIZE","collapsed","onScroll","event","ref","scrolled","collapseAfter","useAppBarScroll","t0","$","t1","undefined","t2","setCollapsed","setScrolled","t3","clientHeight","scrollHeight","scrollTop","currentTarget","givesBack","Math","max","current","offsetHeight","t4"],"sources":["../../src/hooks/useAppBarScroll.ts"],"sourcesContent":["'use client'\n\nimport type { RefObject, UIEvent } from 'react'\n\nimport { useRef, useState } from 'react'\n\n/**\n * The small bar's height in pixels, which is what a flexible bar collapses\n * to. AppBar draws its small height from this, so the hook's arithmetic and\n * the bar it measures cannot disagree.\n */\nconst COLLAPSED_BLOCK_SIZE = 64\n\ntype AppBarScroll = {\n /** For the bar's `collapsed`. */\n collapsed: boolean\n /** For the `onScroll` of the element that scrolls. */\n onScroll: (event: UIEvent<HTMLElement>) => void\n /**\n * For the bar's `ref`. The bar's height is what tells the hook how much\n * room collapsing gives back, so without it every page counts as long\n * enough to collapse on.\n */\n ref: RefObject<HTMLElement | null>\n /** For the bar's `scrolled`. */\n scrolled: boolean\n}\n\ntype AppBarScrollOptions = {\n /**\n * How far the page scrolls, in pixels, before the bar collapses. It\n * expands again once the page is scrolled back to this offset or less.\n * @default 0\n */\n collapseAfter?: number\n}\n\n/**\n * Derives an `AppBar`'s `scrolled` and `collapsed` from the element its page\n * scrolls in. Pass `ref` to the bar and `onScroll` to that element, and hand\n * the bar the two states.\n *\n * ```tsx\n * const { collapsed, onScroll, ref, scrolled } = useAppBarScroll()\n *\n * <div onScroll={onScroll}>\n * <AppBar collapsed={collapsed} ref={ref} scrolled={scrolled} size=\"lg\" />\n * </div>\n * ```\n *\n * It collapses the bar only on a page long enough to stay collapsed.\n * Collapsing shortens the page by the height the bar gives back, and a page\n * that overflows by less than that plus `collapseAfter` cannot scroll that\n * far any more: the browser pulls the offset back inside the shorter page,\n * below `collapseAfter`, the bar expands, the page lengthens, and the two\n * take turns on every scroll event. On such a page the bar stays expanded,\n * which is also all there is room for.\n *\n * The other half of keeping the bar steady is the scroll container's own:\n * give it `overflow-anchor: none`, as the `collapsed` prop explains.\n */\nfunction useAppBarScroll({\n collapseAfter = 0,\n}: AppBarScrollOptions = {}): AppBarScroll {\n const ref = useRef<HTMLElement>(null)\n const [collapsed, setCollapsed] = useState(false)\n const [scrolled, setScrolled] = useState(false)\n\n const onScroll = (event: UIEvent<HTMLElement>) => {\n const { clientHeight, scrollHeight, scrollTop } = event.currentTarget\n\n setScrolled(scrollTop > 0)\n if (scrollTop <= collapseAfter) {\n setCollapsed(false)\n } else if (!collapsed) {\n const givesBack = Math.max(\n 0,\n (ref.current?.offsetHeight ?? COLLAPSED_BLOCK_SIZE) -\n COLLAPSED_BLOCK_SIZE,\n )\n setCollapsed(scrollHeight - clientHeight - givesBack > collapseAfter)\n }\n }\n\n return { collapsed, onScroll, ref, scrolled }\n}\n\nexport type { AppBarScroll, AppBarScrollOptions }\nexport { COLLAPSED_BLOCK_SIZE, useAppBarScroll }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,SAAAU,gBAAAC,IAAA;CAAA,MAAAC,IAAAZ,EAAA,CAAA;CAAA,IAAAa;CAAA,IAAAD,EAAA,OAAAD,IAAA;EAAyBE,KAAAF,OAAAG,KAAAA,IAAA,CAEC,IAFDH;EAEEC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAFF,MAAA,EAAAH,eAAAM,OAAAF;CACvB,MAAAJ,gBAAAM,OAAAD,KAAAA,IAAA,IAAAC;CAEA,MAAAR,MAAYN,OAAoB,IAAI;CACpC,MAAA,CAAAG,WAAAY,gBAAkCd,SAAS,KAAK;CAChD,MAAA,CAAAM,UAAAS,eAAgCf,SAAS,KAAK;CAAC,IAAAgB;CAAA,IAAAN,EAAA,OAAAH,iBAAAG,EAAA,OAAAR,WAAA;EAE9Bc,MAAAZ,UAAA;GACf,MAAA,EAAAa,cAAAC,cAAAC,cAAkDf,MAAKgB;GAEvDL,YAAYI,YAAY,CAAC;GACzB,IAAIA,aAAaZ,eACfO,aAAa,KAAK;QACb,IAAI,CAACZ,WAAS;IACnB,MAAAmB,YAAkBC,KAAIC,IACpB,IACClB,IAAGmB,SAAsBC,gBAAAA,MAAAA,EAE5B;IACAX,aAAaI,eAAeD,eAAeI,YAAYd,aAAa;GAAC;EACtE;EACFG,EAAA,KAAAH;EAAAG,EAAA,KAAAR;EAAAQ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAdD,MAAAP,WAAiBa;CAchB,IAAAU;CAAA,IAAAhB,EAAA,OAAAR,aAAAQ,EAAA,OAAAP,YAAAO,EAAA,OAAAJ,UAAA;EAEMoB,KAAA;GAAAxB;GAAAC;GAAAE;GAAAC;EAAqC;EAACI,EAAA,KAAAR;EAAAQ,EAAA,KAAAP;EAAAO,EAAA,KAAAJ;EAAAI,EAAA,KAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,OAAtCgB;AAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBottomEdge.js","names":["
|
|
1
|
+
{"version":3,"file":"useBottomEdge.js","names":["useLayoutEffect","useSyncExternalStore","holders","Map","listeners","Set","clearance","getClearance","getServerClearance","hold","element","height","undefined","delete","set","next","Math","max","values","listener","subscribe","add","useBottomEdgeClearance","useHoldBottomEdge","ref","isHolding","$","_c","t0","t1","current","measure","ceil","window","innerHeight","getBoundingClientRect","top","observer","ResizeObserver","observe","addEventListener","document","disconnect","removeEventListener"],"sources":["../../src/hooks/useBottomEdge.ts"],"sourcesContent":["import type { RefObject } from 'react'\n\nimport { useLayoutEffect, useSyncExternalStore } from 'react'\n\n// The strips of the window's bottom edge that open overlays hold with their\n// actions, keyed by the element holding each, and how far a toast has to rise\n// to clear them all.\n//\n// The snackbar sits on that edge and above every modal, which is what lets a\n// message raised from inside a dialog be read over its scrim. But a\n// full-screen dialog's action bar and a sheet's actions sit on the same edge,\n// so a toast with an action lay over them and took the taps meant for their\n// buttons — and a toast with an action stays until it is answered. The parts\n// that hold the edge say so here, and the snackbar's region rises by the\n// tallest of them.\n//\n// A store rather than a context, since the two meet nowhere in the tree: the\n// snackbar is mounted once near the root, and the overlay is portalled to the\n// end of the body from wherever it was opened.\nconst holders = new Map<Element, number>()\nconst listeners = new Set<() => void>()\nlet clearance = 0\n\nfunction getClearance() {\n return clearance\n}\n\n// Nothing is open while a page is rendered on the server.\nfunction getServerClearance() {\n return 0\n}\n\nfunction hold(element: Element, height: number | undefined) {\n if (height === undefined || height <= 0) {\n holders.delete(element)\n } else {\n holders.set(element, height)\n }\n const next = Math.max(0, ...holders.values())\n if (next === clearance) {\n return\n }\n clearance = next\n for (const listener of listeners) {\n listener()\n }\n}\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n}\n\n/**\n * How far above the window's bottom edge a toast has to sit to clear the\n * actions of every open overlay holding that edge, in pixels: `0` while none\n * is open.\n */\nfunction useBottomEdgeClearance(): number {\n return useSyncExternalStore(subscribe, getClearance, getServerClearance)\n}\n\n/**\n * Holds the strip from the top of the element in `ref` to the bottom of the\n * window while `isHolding` is true, so a toast rises clear of it. For a part\n * whose own bottom is the window's: an overlay's actions, pinned there.\n *\n * Measured from where the element is drawn, so the strip takes in whatever\n * lies between it and the edge, a safe area among them. It is measured again\n * whenever the element resizes, the window does, or an animation or a scroll\n * ends, since an overlay arriving from below is drawn lower than it rests\n * until its entry has run — a dialog's entry is an animation, and a sheet's\n * is a scroll, which is also what a swipe that lets go of it makes.\n */\nfunction useHoldBottomEdge(\n ref: RefObject<HTMLElement | null>,\n isHolding: boolean,\n) {\n useLayoutEffect(() => {\n const element = ref.current\n if (element === null || !isHolding) {\n return undefined\n }\n\n const measure = () => {\n hold(\n element,\n Math.ceil(window.innerHeight - element.getBoundingClientRect().top),\n )\n }\n measure()\n const observer = new ResizeObserver(measure)\n observer.observe(element)\n window.addEventListener('resize', measure)\n document.addEventListener('animationend', measure, true)\n // Captured, since `scrollend` does not bubble from the element scrolled.\n document.addEventListener('scrollend', measure, true)\n\n return () => {\n observer.disconnect()\n window.removeEventListener('resize', measure)\n document.removeEventListener('animationend', measure, true)\n document.removeEventListener('scrollend', measure, true)\n hold(element, undefined)\n }\n }, [isHolding, ref])\n}\n\nexport { useBottomEdgeClearance, useHoldBottomEdge }\n"],"mappings":";;;AAmBA,MAAME,0BAAU,IAAIC,IAAqB;AACzC,MAAMC,4BAAY,IAAIC,IAAgB;AACtC,IAAIC,YAAY;AAEhB,SAASC,eAAe;CACtB,OAAOD;AACT;AAGA,SAASE,qBAAqB;CAC5B,OA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vDtB,KAAKC,SAASE,KAAAA,CAAS;GAAC;EACzB;EACAiB,KAAA,CAACJ,WAAWD,GAAG;EAACE,EAAA,KAAAD;EAAAC,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAD,KAAAF,EAAA;EAAAG,KAAAH,EAAA;CAAA;CA3BnB1B,gBAAgB4B,IA2BbC,EAAgB;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClippedTitle.js","names":["
|
|
1
|
+
{"version":3,"file":"useClippedTitle.js","names":["useState","textOf","useClippedTitle","label","$","_c","title","setTitle","t0","text","t1","event","span","currentTarget","undefined","scrollWidth","clientWidth","onPointerEnter","t2"],"sources":["../../src/hooks/useClippedTitle.ts"],"sourcesContent":["import type { PointerEvent, ReactNode } from 'react'\n\nimport { useState } from 'react'\n\nimport { textOf } from '../collection/text'\n\n// A label kept to one line ends in an ellipsis when it has no room, and a\n// sighted reader then had no way to read the rest: the accessible name stays\n// whole, but nothing on screen did. This hands such a label its full text as\n// a native `title`, so the browser's own tooltip shows it on hover.\n//\n// The label is measured when the pointer reaches it rather than watched, so\n// a page of labels that fit pays for nothing: no observer, no measurement on\n// render. A label that fits gets no title, since a tooltip repeating text\n// already in full view is noise. The text is the label's own when it is text\n// alone — a string, a number, or the two mixed, read as `textOf` reads an\n// item — and a label holding an element gets nothing, since a title is a\n// string and the element's text is not this hook's to guess.\n\n/**\n * The `title` and `onPointerEnter` for a label span that clips to one line,\n * through `overflow: hidden` or `clip`: spread both on that span.\n */\nfunction useClippedTitle(label: ReactNode) {\n const [title, setTitle] = useState<string>()\n const text = textOf(label)\n\n const onPointerEnter = (event: PointerEvent<HTMLElement>) => {\n const span = event.currentTarget\n setTitle(\n text !== undefined && span.scrollWidth > span.clientWidth\n ? text\n : undefined,\n )\n }\n\n return { onPointerEnter, title }\n}\n\nexport { useClippedTitle }\n"],"mappings":";;;;;;;;AAuBA,SAAAE,gBAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,OAAAC,YAA0BP,SAAiB;CAAC,IAAAQ;CAAA,IAAAJ,EAAA,OAAAD,OAAA;EAC/BK,KAAAP,OAAOE,KAAK;EAACC,EAAA,KAAAD;EAAAC,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAA1B,MAAAK,OAAaD;CAAa,IAAAE;CAAA,IAAAN,EAAA,OAAAK,MAAA;EAEHC,MAAAC,UAAA;GACrB,MAAAC,OAAaD,MAAKE;GAClBN,SACEE,SAASK,KAAAA,KAAaF,KAAIG,cAAeH,KAAII,cAA7CP,OAAAK,KAAAA,CAGF;EAAC;EACFV,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAPD,MAAAa,iBAAuBP;CAOtB,IAAAQ;CAAA,IAAAd,EAAA,OAAAa,kBAAAb,EAAA,OAAAE,OAAA;EAEMY,KAAA;GAAAD;GAAAX;EAAwB;EAACF,EAAA,KAAAa;EAAAb,EAAA,KAAAE;EAAAF,EAAA,KAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAAzBc;AAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useImageLoadingStatus.js","names":["
|
|
1
|
+
{"version":3,"file":"useImageLoadingStatus.js","names":["useState","shown","src","useImageLoadingStatus","$","_c","loaded","setLoaded","failed","setFailed","t0","Symbol","for","event","image","currentTarget","from","getAttribute","currentSrc","onLoad","t1","event_0","from_0","onError","status","undefined","t2","t3","previous"],"sources":["../../src/hooks/useImageLoadingStatus.ts"],"sourcesContent":["import type { SyntheticEvent } from 'react'\n\nimport { useCallback, useState } from 'react'\n\ntype ImageLoadingStatus = 'error' | 'loaded' | 'loading'\n\ninterface Loaded {\n /** The resource the browser chose and loaded, out of a `srcSet` too. */\n shown: string\n /** The `src` it loaded for. */\n src: string\n}\n\n/**\n * Whether the picture at `src` can be shown yet, from what the component's\n * own `<img>` reports. The image is rendered from the start and hidden until\n * it loads, so the browser fetches it as it would any image — `loading`,\n * `srcSet` and `sizes` all apply, which a detached preloader started on\n * mount left them no part in — and hand `onLoad` and `onError` to that\n * element. A component keeps its fallback until the picture is ready and\n * brings it back if the picture fails, so the browser's broken-image glyph\n * is never what shows.\n *\n * `previous` is the picture last loaded, while a new `src` is still loading,\n * so the component can keep showing it rather than drop back to the fallback\n * for as long as the new one takes — a theme swapping one logo for another\n * flashed the initial between them. It is the resource the browser actually\n * loaded, which is cached, so an element showing it needs no `srcSet`.\n *\n * No `src` counts as a failure, since the outcome is the same: the fallback\n * shows. Outcomes are remembered against the `src` they came for, so a\n * change of `src` reads as loading rather than as the old outcome.\n */\nfunction useImageLoadingStatus(src: string | undefined) {\n const [loaded, setLoaded] = useState<Loaded | null>(null)\n const [failed, setFailed] = useState<null | string>(null)\n\n // Read off the element rather than closed over, so the one pair of\n // handlers serves whichever `src` the element carries when it settles.\n const onLoad = useCallback((event: SyntheticEvent<HTMLImageElement>) => {\n const image = event.currentTarget\n const from = image.getAttribute('src')\n if (from !== null) {\n setLoaded({\n shown: image.currentSrc === '' ? from : image.currentSrc,\n src: from,\n })\n }\n }, [])\n const onError = useCallback((event: SyntheticEvent<HTMLImageElement>) => {\n const from = event.currentTarget.getAttribute('src')\n if (from !== null) {\n setFailed(from)\n }\n }, [])\n\n let status: ImageLoadingStatus = 'loading'\n if (src === undefined || failed === src) {\n status = 'error'\n } else if (loaded?.src === src) {\n status = 'loaded'\n }\n\n return {\n onError,\n onLoad,\n previous: status === 'loading' ? loaded?.shown : undefined,\n status,\n }\n}\n\nexport type { ImageLoadingStatus }\n\nexport { useImageLoadingStatus }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAAG,sBAAAD,KAAA;CAAA,MAAAE,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,QAAAC,aAA4BP,SAAwB,IAAI;CACxD,MAAA,CAAAQ,QAAAC,aAA4BT,SAAwB,IAAI;CAAC,IAAAU;CAAA,IAAAN,EAAA,OAAAO,OAAAC,IAAA,2BAAA,GAAA;EAI9BF,MAAAG,UAAA;GACzB,MAAAC,QAAcD,MAAKE;GACnB,MAAAC,OAAaF,MAAKG,aAAc,KAAK;GACrC,IAAID,SAAS,MACXT,UAAU;IAAAN,OACDa,MAAKI,eAAgB,KAArBF,OAAiCF,MAAKI;IAAWhB,KACnDc;GACP,CAAC;EACF;EACFZ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CATD,MAAAe,SAAeT;CAST,IAAAU;CAAA,IAAAhB,EAAA,OAAAO,OAAAC,IAAA,2BAAA,GAAA;EACsBQ,MAAAC,YAAA;GAC1B,MAAAC,SAAaT,QAAKE,cAAcE,aAAc,KAAK;GACnD,IAAID,WAAS,MACXP,UAAUO,MAAI;EACf;EACFZ,EAAA,KAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CALD,MAAAmB,UAAgBH;CAOhB,IAAAI,SAAiC;CACjC,IAAItB,QAAQuB,KAAAA,KAAajB,WAAWN,KAClCsB,SAASA;MACJ,IAAIlB,QAAMJ,QAAUA,KACzBsB,SAASA;CAMC,MAAAE,KAAAF,WAAW,YAAYlB,QAAML,QAA7BwB,KAAAA;CAAgD,IAAAE;CAAA,IAAAvB,EAAA,OAAAoB,UAAApB,EAAA,OAAAsB,IAAA;EAHrDC,KAAA;GAAAJ;GAAAJ;GAAAS,UAGKF;GAAgDF;EAE5D;EAACpB,EAAA,KAAAoB;EAAApB,EAAA,KAAAsB;EAAAtB,EAAA,KAAAuB;CAAA,OAAAA,KAAAvB,EAAA;CAAA,OALMuB;AAKN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRipple.js","names":["MouseEvent","MouseEventHandler","PointerEvent","PointerEventHandler","ReactNode","stylex","useCallback","useEffect","useMemo","useRef","useState","rippleStyles","motionDurationMs","motionEasing","spacingPx","PADDING","sm","INITIAL_ORIGIN_SCALE","SOFT_EDGE_MINIMUM_SIZE","SOFT_EDGE_CONTAINER_RATIO","surfaceProps","props","surface","RippleState","Holding","Inactive","TouchDelay","WaitingForClick","const","ReleaseHandlers","Element","Omit","RippleEventHandlers","HostElement","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","isTouch","event","pointerType","prefersReducedMotion","window","matchMedia","matches","useRipple","enabled","externalHandlers","endsOnRelease","centred","handlers","play","t0","t1","t2","t3","$","_c","undefined","t4","pressed","setPressed","rippleRef","state","growAnimation","rippleStartEvent","initialSize","rippleScale","removeDocumentListeners","t5","Symbol","for","isPrimary","startEvent","current","pointerId","isPressPointer","t6","event_0","buttons","shouldReactToEvent","t7","rect","height","width","maxDimension","Math","max","softEdgeSize","size","floor","hypotenuse","hypot","maxRadius","determineRippleSize","t8","rect_0","positionEvent","height_0","left","top","width_0","size_0","endPoint","x","y","origin","clientX","clientY","startPoint","getTranslationCoordinates","t9","target","positionEvent_0","ripple","parentElement","getBoundingClientRect","rect_1","size_1","cancel","endPoint_0","startPoint_0","style","animate","transform","duration","long1","easing","standard","fill","startPressAnimation","t10","animation","elapsed","currentTime","Infinity","medium1","Promise","resolve","setTimeout","endPressAnimation","t11","host","document","ownerDocument","handleEnd","event_1","composedPath","includes","addEventListener","removeEventListener","listenBeyondHost","t12","t13","t14","getState","t15","event_2","target_0","currentTarget","_temp","handlePointerDownAsync","t16","event_3","handlePointerDown","t17","event_4","handlePointerUp","t18","event_5","handlePointerLeave","t19","event_6","handlePointerCancel","t20","event_7","handleClick","t21","host_0","t22","handleContextMenu","onClickProp","onContextMenuProp","onPointerCancelProp","onPointerDownProp","onPointerLeaveProp","onPointerUpProp","t23","event_8","t24","event_9","t25","event_10","t26","event_11","t27","event_12","t28","event_13","t29","pointer","t30","t31","press","t32","surface_0","t33","enabledResult","t34","disabledResult","resolve_0","short2","stylex.props","rippleStyles","_c","disabledResult"],"sources":["../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ntype ReleaseHandlers<HostElement extends Element> = Omit<RippleEventHandlers<HostElement>, 'onClick'>;\ninterface RippleEventHandlers<HostElement extends Element> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Whether the reader has asked the OS for less motion.\n *\n * Growth is a Web Animations call, which makes it the one animation in the\n * library no `@media (prefers-reduced-motion: reduce)` branch can reach — see\n * src/styles/ripple.ts for the opacity half, which is CSS and carries one.\n *\n * Read at the press rather than once at mount, so a reader who changes the\n * setting is answered by their next press rather than by their next reload.\n * The press already reads layout through `getBoundingClientRect`, which costs\n * more than this does.\n */\nfunction prefersReducedMotion() {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape. A host can render `surface` in a positioned part of\n * itself instead, and the ripple then grows in that part alone, from where\n * the pointer is over it: a navigation destination draws it in its\n * indicator.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * Pass `endsOnRelease` for a host that never hears its own click: a\n * collection row, whose clicks React Aria's press handling keeps for itself.\n * The press then ends when the pointer is released over the host rather than\n * on the click that would follow, still held for the minimum a short press\n * gets. A keyboard press reaches such a host as no pointer event at all, so\n * it draws no ripple there unless the host plays one.\n *\n * `play` is that: a whole press from the middle of the surface, as a click\n * with no pointer before it plays, for a host that learns of a press some\n * other way. A checkbox calls it for a key, which reaches its input rather\n * than the label its ripple listens on.\n *\n * Pass `centred` for a host whose presses land beside its surface as well as\n * on it: a checkbox, whose label runs the width of its row. Every press then\n * grows from the middle of the surface, as a key's does. Following the\n * pointer, a press at the far end of the label grew from hundreds of pixels\n * away and reached the control only as the growth ended.\n *\n * `handlers`, `play` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\n// A host ending on the release never hears a click, so nothing is taken for\n// one and none is handed back: the handlers are the pointer ones alone, which\n// is also what a collection row's type admits.\nfunction useRipple<HostElement extends Element = Element>(enabled: boolean, externalHandlers: ReleaseHandlers<HostElement>, endsOnRelease: true, centred?: boolean): {\n handlers: ReleaseHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled?: boolean, externalHandlers?: RippleEventHandlers<HostElement>, endsOnRelease?: false, centred?: boolean): {\n handlers: RippleEventHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}, endsOnRelease = false, centred = false): {\n handlers: RippleEventHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n // Removes the listeners a press keeps on its host's document, while one is\n // in flight — see `listenBeyondHost`.\n const removeDocumentListeners = useRef<(() => void) | undefined>(undefined);\n\n // Whether `event` comes from the pointer a press would follow: the primary\n // one, and the one that started the press already in flight, if any.\n const isPressPointer = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n return !startEvent || startEvent.pointerId === event.pointerId;\n }, []);\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => isPressPointer(event) && (isTouch(event) || event.buttons === 1), [isPressPointer]);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: Element, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n\n // Read once and share: the two helpers below both only need the\n // rect, and a second `getBoundingClientRect()` call back to back with\n // the first would be a redundant layout read.\n //\n // The surface's rect rather than the host's, since the ripple is placed\n // inside the surface. The two are one box wherever the surface fills\n // the host, which is every host but one drawing the surface in a part\n // of itself. Under forced colours the surface is not drawn and has no\n // box, so the host's stands in for a ripple nobody sees.\n const surface = ripple.parentElement?.getBoundingClientRect();\n const rect = surface && (surface.width > 0 || surface.height > 0) ? surface : target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n // A host with no box has nowhere to draw: one hidden while it is\n // pressed, or a row whose press hides the pane it sits in, which is\n // gone before the click that plays the keyboard's ripple arrives.\n // The disc would start at 0px, and the scale it grows by divides by\n // that, which came out as `scale(Infinity)` — a keyframe the browser\n // rejects with a warning.\n if (initialSize.current === 0) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, centred ? undefined : positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n //\n // Zeroed rather than skipped under reduced motion, which lands the\n // disc at its full size with the growth never drawn. Skipping the\n // call outright would leave `growAnimation` unset, and the release\n // below reads its `currentTime` to decide whether the press has\n // been visible long enough — so the press would still be shown, and\n // would stop being held for its minimum.\n duration: prefersReducedMotion() ? 0 : motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [centred, determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n removeDocumentListeners.current?.();\n removeDocumentListeners.current = undefined;\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // A press can end somewhere other than its host. React Aria's press\n // handling releases the capture a touch takes on its pointerdown, so that a\n // finger can leave the element, and a press that turns into a scroll — or\n // a finger that slides off and lifts — then ends with a pointercancel or\n // pointerup on whatever is under it, which the host never hears. Left to\n // the host's handlers alone, the ripple held at its pressed opacity until\n // the next press on that host finished a cycle.\n //\n // So the press listens on its host's document, in the capture phase, for\n // its own pointer, the way React Aria's own press handling does. An end the\n // host does hear is left to the host's handlers, which run after these.\n const listenBeyondHost = useCallback((host: HostElement, pointerId: number) => {\n removeDocumentListeners.current?.();\n const document = host.ownerDocument;\n const handleEnd = (event: globalThis.PointerEvent) => {\n if (event.pointerId !== pointerId || event.composedPath().includes(host)) {\n return;\n }\n void endPressAnimation();\n };\n document.addEventListener('pointercancel', handleEnd, true);\n document.addEventListener('pointerup', handleEnd, true);\n removeDocumentListeners.current = () => {\n document.removeEventListener('pointercancel', handleEnd, true);\n document.removeEventListener('pointerup', handleEnd, true);\n };\n }, [endPressAnimation]);\n\n // A host unmounted mid-press leaves nothing listening behind it.\n useEffect(() => () => {\n removeDocumentListeners.current?.();\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n listenBeyondHost(target, event.pointerId);\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, listenBeyondHost, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n // A mouse or pen release carries no pressed button, so the guard the\n // other handlers share turns it away, which is right while a click\n // follows to end the press. A host ending on the release matches it by\n // its pointer alone.\n if (endsOnRelease && !isTouch(event)) {\n if (isPressPointer(event) && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n return;\n }\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n } else if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n\n // The release is as far as such a host hears, so it is where the\n // press ends — see `endsOnRelease` above.\n if (endsOnRelease && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n }, [endPressAnimation, endsOnRelease, isPressPointer, shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n\n // The element the surface is rendered in stands in for the host a click\n // would have named. With no surface rendered there is nothing to play, and\n // a press already in flight is left to the pointer that started it.\n const play = useCallback(() => {\n const host = rippleRef.current?.parentElement?.parentElement;\n if (!host || state.current !== RippleState.Inactive) {\n return;\n }\n startPressAnimation(host);\n void endPressAnimation();\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => {\n const pointer = {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n };\n return endsOnRelease ? pointer : {\n onClick,\n ...pointer\n };\n }, [endsOnRelease, onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n play,\n surface\n }), [handlers, play, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n play,\n surface: null\n }), [externalHandlers, play]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { useRipple };"],"mappings":";;;;;;;;AAeA,MAAMe,UAAUD,UAAUE;AAI1B,MAAMC,uBAAuB;AAC7B,MAAMC,yBAAyB;AAC/B,MAAMC,4BAA4B;AAIlC,MAAMC,eAAef,MAAaM,OAAaW,OAAO;;;;;;;;AAStD,MAAMC,cAAc;;CAElBC,SAAS;;CAETC,UAAU;;CAEVC,YAAY;;CAEZC,iBAAiB;AACnB;AAWA,SAASa,QAAQC,OAAqB;CACpC,OAAOA,MAAMC,gBAAgB;AAC/B;;;;;;;;;;;;;AAcA,SAASC,uBAAuB;CAC9B,OAAOC,OAAOC,WAAW,kCAAkC,CAAC,CAACC;AAC/D;AA+DA,SAAAC,UAAAO,IAAAC,IAAAC,IAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAA0D,MAAAX,UAAAM,OAAAM,KAAAA,IAAA,OAAAN;CAAc,IAAAO;CAAA,IAAAH,EAAA,OAAAH,IAAA;EAAEM,KAAAN,OAAAK,KAAAA,IAAA,CAAsD,IAAtDL;EAAuDG,EAAA,KAAAH;EAAAG,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAvD,MAAAT,mBAAAY;CAAyD,MAAAX,gBAAAM,OAAAI,KAAAA,IAAA,QAAAJ;CAAuB,MAAAL,UAAAM,OAAAG,KAAAA,IAAA,QAAAH;CAKxJ,MAAA,CAAAK,SAAAC,cAA8BrD,SAAS,KAAK;CAC5C,MAAAsD,YAAkBvD,OAAwB,IAAI;CAC9C,MAAAwD,QAAcxD,OAAoBc,YAAWE,QAAS;CACt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oJ;CAAA,IAAApJ,EAAA,QAAAkJ,KAAA;EADnEE,MAAA,oBAAA,QAAA;GAAkB,eAAA;GAAM,GAAK1L;GACrD,UAAA,oBAAA,QAAA;IAAW4C,KAAAA;IAAS,GAAM4I;GAAiE,CAAA;EACtF,CAAA;EAAAlJ,EAAA,MAAAkJ;EAAAlJ,EAAA,MAAAoJ;CAAA,OAAAA,MAAApJ,EAAA;CAFX,MAAAqJ,YAA8BD;CAEN,IAAAE;CAAA,IAAAtJ,EAAA,QAAAN,YAAAM,EAAA,QAAAL,QAAAK,EAAA,QAAAqJ,WAAA;EAOaC,MAAA;GAAA5J;GAAAC;GAAA/B,SAGnCA;EACF;EAACoC,EAAA,MAAAN;EAAAM,EAAA,MAAAL;EAAAK,EAAA,MAAAqJ;EAAArJ,EAAA,MAAAsJ;CAAA,OAAAA,MAAAtJ,EAAA;CAJD,MAAAuJ,gBAAqCD;CAIN,IAAAE;CAAA,IAAAxJ,EAAA,QAAAT,oBAAAS,EAAA,QAAAL,MAAA;EACO6J,MAAA;GAAA9J,UAC1BH;GAAgBI;GAAA/B,SAEjB;EACX;EAACoC,EAAA,MAAAT;EAAAS,EAAA,MAAAL;EAAAK,EAAA,MAAAwJ;CAAA,OAAAA,MAAAxJ,EAAA;CAA6B,OACvBV,UAAAiK,gBAAAE;AAAwC;AAzVjD,SAAAjD,MAAAkD,WAAA;CAwMMvE,WAAWD,WAAShI,iBAAgByM,MAAO;AAAC"}
|
|
1
|
+
{"version":3,"file":"useRipple.js","names":["stylex","useEffect","useRef","useState","rippleStyles","motionDurationMs","motionEasing","spacingPx","PADDING","sm","INITIAL_ORIGIN_SCALE","SOFT_EDGE_MINIMUM_SIZE","SOFT_EDGE_CONTAINER_RATIO","surfaceProps","surface","RippleState","Holding","Inactive","TouchDelay","WaitingForClick","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","isTouch","event","pointerType","prefersReducedMotion","window","matchMedia","matches","useRipple","enabled","externalHandlers","endsOnRelease","centred","handlers","play","t0","t1","t2","t3","$","_c","undefined","t4","pressed","setPressed","rippleRef","state","growAnimation","rippleStartEvent","initialSize","rippleScale","removeDocumentListeners","t5","Symbol","for","isPrimary","startEvent","current","pointerId","isPressPointer","t6","event_0","buttons","shouldReactToEvent","t7","rect","height","width","maxDimension","Math","max","softEdgeSize","size","floor","hypotenuse","hypot","maxRadius","determineRippleSize","t8","rect_0","positionEvent","height_0","left","top","width_0","size_0","endPoint","x","y","origin","clientX","clientY","startPoint","getTranslationCoordinates","t9","target","positionEvent_0","ripple","parentElement","getBoundingClientRect","rect_1","size_1","cancel","endPoint_0","startPoint_0","style","animate","transform","duration","long1","easing","standard","fill","startPressAnimation","t10","animation","elapsed","currentTime","Infinity","medium1","Promise","resolve","setTimeout","endPressAnimation","t11","host","document","ownerDocument","handleEnd","event_1","composedPath","includes","addEventListener","removeEventListener","listenBeyondHost","t12","t13","t14","getState","t15","event_2","target_0","currentTarget","_temp","handlePointerDownAsync","t16","event_3","handlePointerDown","t17","event_4","handlePointerUp","t18","event_5","handlePointerLeave","t19","event_6","handlePointerCancel","t20","event_7","handleClick","t21","host_0","t22","handleContextMenu","onClickProp","onContextMenuProp","onPointerCancelProp","onPointerDownProp","onPointerLeaveProp","onPointerUpProp","t23","event_8","t24","event_9","t25","event_10","t26","event_11","t27","event_12","t28","event_13","t29","pointer","t30","t31","press","t32","surface_0","t33","enabledResult","t34","disabledResult","resolve_0","short2"],"sources":["../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ntype ReleaseHandlers<HostElement extends Element> = Omit<RippleEventHandlers<HostElement>, 'onClick'>;\ninterface RippleEventHandlers<HostElement extends Element> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Whether the reader has asked the OS for less motion.\n *\n * Growth is a Web Animations call, which makes it the one animation in the\n * library no `@media (prefers-reduced-motion: reduce)` branch can reach — see\n * src/styles/ripple.ts for the opacity half, which is CSS and carries one.\n *\n * Read at the press rather than once at mount, so a reader who changes the\n * setting is answered by their next press rather than by their next reload.\n * The press already reads layout through `getBoundingClientRect`, which costs\n * more than this does.\n */\nfunction prefersReducedMotion() {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape. A host can render `surface` in a positioned part of\n * itself instead, and the ripple then grows in that part alone, from where\n * the pointer is over it: a navigation destination draws it in its\n * indicator.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * Pass `endsOnRelease` for a host that never hears its own click: a\n * collection row, whose clicks React Aria's press handling keeps for itself.\n * The press then ends when the pointer is released over the host rather than\n * on the click that would follow, still held for the minimum a short press\n * gets. A keyboard press reaches such a host as no pointer event at all, so\n * it draws no ripple there unless the host plays one.\n *\n * `play` is that: a whole press from the middle of the surface, as a click\n * with no pointer before it plays, for a host that learns of a press some\n * other way. A checkbox calls it for a key, which reaches its input rather\n * than the label its ripple listens on.\n *\n * Pass `centred` for a host whose presses land beside its surface as well as\n * on it: a checkbox, whose label runs the width of its row. Every press then\n * grows from the middle of the surface, as a key's does. Following the\n * pointer, a press at the far end of the label grew from hundreds of pixels\n * away and reached the control only as the growth ended.\n *\n * `handlers`, `play` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\n// A host ending on the release never hears a click, so nothing is taken for\n// one and none is handed back: the handlers are the pointer ones alone, which\n// is also what a collection row's type admits.\nfunction useRipple<HostElement extends Element = Element>(enabled: boolean, externalHandlers: ReleaseHandlers<HostElement>, endsOnRelease: true, centred?: boolean): {\n handlers: ReleaseHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled?: boolean, externalHandlers?: RippleEventHandlers<HostElement>, endsOnRelease?: false, centred?: boolean): {\n handlers: RippleEventHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}, endsOnRelease = false, centred = false): {\n handlers: RippleEventHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n // Removes the listeners a press keeps on its host's document, while one is\n // in flight — see `listenBeyondHost`.\n const removeDocumentListeners = useRef<(() => void) | undefined>(undefined);\n\n // Whether `event` comes from the pointer a press would follow: the primary\n // one, and the one that started the press already in flight, if any.\n const isPressPointer = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n return !startEvent || startEvent.pointerId === event.pointerId;\n }, []);\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => isPressPointer(event) && (isTouch(event) || event.buttons === 1), [isPressPointer]);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: Element, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n\n // Read once and share: the two helpers below both only need the\n // rect, and a second `getBoundingClientRect()` call back to back with\n // the first would be a redundant layout read.\n //\n // The surface's rect rather than the host's, since the ripple is placed\n // inside the surface. The two are one box wherever the surface fills\n // the host, which is every host but one drawing the surface in a part\n // of itself. Under forced colours the surface is not drawn and has no\n // box, so the host's stands in for a ripple nobody sees.\n const surface = ripple.parentElement?.getBoundingClientRect();\n const rect = surface && (surface.width > 0 || surface.height > 0) ? surface : target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n // A host with no box has nowhere to draw: one hidden while it is\n // pressed, or a row whose press hides the pane it sits in, which is\n // gone before the click that plays the keyboard's ripple arrives.\n // The disc would start at 0px, and the scale it grows by divides by\n // that, which came out as `scale(Infinity)` — a keyframe the browser\n // rejects with a warning.\n if (initialSize.current === 0) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, centred ? undefined : positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n //\n // Zeroed rather than skipped under reduced motion, which lands the\n // disc at its full size with the growth never drawn. Skipping the\n // call outright would leave `growAnimation` unset, and the release\n // below reads its `currentTime` to decide whether the press has\n // been visible long enough — so the press would still be shown, and\n // would stop being held for its minimum.\n duration: prefersReducedMotion() ? 0 : motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [centred, determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n removeDocumentListeners.current?.();\n removeDocumentListeners.current = undefined;\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // A press can end somewhere other than its host. React Aria's press\n // handling releases the capture a touch takes on its pointerdown, so that a\n // finger can leave the element, and a press that turns into a scroll — or\n // a finger that slides off and lifts — then ends with a pointercancel or\n // pointerup on whatever is under it, which the host never hears. Left to\n // the host's handlers alone, the ripple held at its pressed opacity until\n // the next press on that host finished a cycle.\n //\n // So the press listens on its host's document, in the capture phase, for\n // its own pointer, the way React Aria's own press handling does. An end the\n // host does hear is left to the host's handlers, which run after these.\n const listenBeyondHost = useCallback((host: HostElement, pointerId: number) => {\n removeDocumentListeners.current?.();\n const document = host.ownerDocument;\n const handleEnd = (event: globalThis.PointerEvent) => {\n if (event.pointerId !== pointerId || event.composedPath().includes(host)) {\n return;\n }\n void endPressAnimation();\n };\n document.addEventListener('pointercancel', handleEnd, true);\n document.addEventListener('pointerup', handleEnd, true);\n removeDocumentListeners.current = () => {\n document.removeEventListener('pointercancel', handleEnd, true);\n document.removeEventListener('pointerup', handleEnd, true);\n };\n }, [endPressAnimation]);\n\n // A host unmounted mid-press leaves nothing listening behind it.\n useEffect(() => () => {\n removeDocumentListeners.current?.();\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n listenBeyondHost(target, event.pointerId);\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, listenBeyondHost, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n // A mouse or pen release carries no pressed button, so the guard the\n // other handlers share turns it away, which is right while a click\n // follows to end the press. A host ending on the release matches it by\n // its pointer alone.\n if (endsOnRelease && !isTouch(event)) {\n if (isPressPointer(event) && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n return;\n }\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n } else if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n\n // The release is as far as such a host hears, so it is where the\n // press ends — see `endsOnRelease` above.\n if (endsOnRelease && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n }, [endPressAnimation, endsOnRelease, isPressPointer, shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n\n // The element the surface is rendered in stands in for the host a click\n // would have named. With no surface rendered there is nothing to play, and\n // a press already in flight is left to the pointer that started it.\n const play = useCallback(() => {\n const host = rippleRef.current?.parentElement?.parentElement;\n if (!host || state.current !== RippleState.Inactive) {\n return;\n }\n startPressAnimation(host);\n void endPressAnimation();\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => {\n const pointer = {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n };\n return endsOnRelease ? pointer : {\n onClick,\n ...pointer\n };\n }, [endsOnRelease, onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n play,\n surface\n }), [handlers, play, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n play,\n surface: null\n }), [externalHandlers, play]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { use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FX,MAAAqJ,YAA8BD;CAEN,IAAAE;CAAA,IAAAtJ,EAAA,QAAAN,YAAAM,EAAA,QAAAL,QAAAK,EAAA,QAAAqJ,WAAA;EAOaC,MAAA;GAAA5J;GAAAC;GAAAzB,SAGnCA;EACF;EAAC8B,EAAA,MAAAN;EAAAM,EAAA,MAAAL;EAAAK,EAAA,MAAAqJ;EAAArJ,EAAA,MAAAsJ;CAAA,OAAAA,MAAAtJ,EAAA;CAJD,MAAAuJ,gBAAqCD;CAIN,IAAAE;CAAA,IAAAxJ,EAAA,QAAAT,oBAAAS,EAAA,QAAAL,MAAA;EACO6J,MAAA;GAAA9J,UAC1BH;GAAgBI;GAAAzB,SAEjB;EACX;EAAC8B,EAAA,MAAAT;EAAAS,EAAA,MAAAL;EAAAK,EAAA,MAAAwJ;CAAA,OAAAA,MAAAxJ,EAAA;CAA6B,OACvBV,UAAAiK,gBAAAE;AAAwC;AAzVjD,SAAAjD,MAAAkD,WAAA;CAwMMvE,WAAWD,WAASzH,iBAAgBkM,MAAO;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollStop.js","names":["
|
|
1
|
+
{"version":3,"file":"useScrollStop.js","names":["useLayoutEffect","useState","TABBABLE","join","TAB_ORDER_ATTRIBUTES","label","title","useScrollStop","ref","t0","$","_c","scrolls","setScrolls","holdsTabStop","setHoldsTabStop","t1","t2","element","current","measure","scrollHeight","clientHeight","scrollWidth","clientWidth","read","querySelectorAll","some","_temp","resize","ResizeObserver","observe","disconnect","child","children","mutation","MutationObserver","attributeFilter","characterData","childList","subtree","t3","Symbol","for","undefined","t4","t5","role","tabIndex","candidate","closest","getClientRects","length"],"sources":["../../src/hooks/useScrollStop.ts"],"sourcesContent":["import type { HTMLAttributes, RefObject } from 'react'\n\nimport { useLayoutEffect, useState } from 'react'\n\n// What a keyboard reaches with Tab: the controls that are focusable by\n// default, and anything a `tabindex` puts in the order. Each match is then\n// held to `tabIndex >= 0`, which drops a control taken out with\n// `tabindex=\"-1\"`, and to being drawn, which drops a hidden one.\nconst TABBABLE = [\n 'a[href]',\n 'area[href]',\n 'audio[controls]',\n 'button:not(:disabled)',\n 'iframe',\n 'input:not(:disabled):not([type=\"hidden\"])',\n 'select:not(:disabled)',\n 'summary',\n 'textarea:not(:disabled)',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n '[tabindex]',\n].join(', ')\n\n// The attributes that move a control in or out of the tab order, so a\n// change to one re-reads what the element holds.\nconst TAB_ORDER_ATTRIBUTES = [\n 'contenteditable',\n 'disabled',\n 'hidden',\n 'href',\n 'inert',\n 'tabindex',\n]\n\n/** What a panel's body is named by while it is a tab stop. */\ntype Naming = {\n /** The call site's own `aria-label`, which names it in place of the title. */\n label: string | undefined\n /** The id of the panel's title. */\n title: string | undefined\n}\n\ntype ScrollStopProps = Pick<\n HTMLAttributes<HTMLElement>,\n 'aria-labelledby' | 'role' | 'tabIndex'\n>\n\n/**\n * The props that make the element in `ref` a tab stop while it scrolls its\n * content and holds nothing a keyboard can reach: its content runs past the\n * element's own size in either direction, and nothing inside it is in the\n * tab order. Kept current as the element resizes and as its content changes.\n *\n * What it is for is keyboard access. A scroll container with nothing\n * focusable inside it cannot be reached from the keyboard in every browser,\n * so it is made a tab stop, and only then — a body short enough to show\n * whole is no stop at all, and one holding a field or a button is reached\n * and scrolled through that, where a stop of its own would be one more press\n * of Tab before the control.\n *\n * While it is a stop it is a region named by the panel's title, so a screen\n * reader landing on it says what it is rather than announcing an unnamed\n * group. A call site's `aria-label` names it instead, and a body with neither\n * stays a plain stop, since a region with no name is not one. The call site's\n * own `role`, `aria-labelledby` and `tabIndex` are spread after these, so\n * they win.\n *\n * The element is watched for its own size, and each child for its size, since\n * a child growing is how content outgrows a container whose size is capped.\n * The children are re-observed whenever the content changes, and a change of\n * text alone is caught by the same mutation observer, as is a control\n * entering or leaving the tab order. Measured in a layout effect, so the\n * first paint already has the answer rather than a frame later.\n */\nfunction useScrollStop(\n ref: RefObject<HTMLElement | null>,\n { label, title }: Naming,\n): ScrollStopProps {\n const [scrolls, setScrolls] = useState(false)\n const [holdsTabStop, setHoldsTabStop] = useState(false)\n\n useLayoutEffect(() => {\n const element = ref.current\n if (element === null) {\n return undefined\n }\n\n const measure = () => {\n setScrolls(\n element.scrollHeight > element.clientHeight ||\n element.scrollWidth > element.clientWidth,\n )\n }\n const read = () => {\n setHoldsTabStop(\n [...element.querySelectorAll<HTMLElement>(TABBABLE)].some(\n (candidate) =>\n candidate.tabIndex >= 0 &&\n candidate.closest('[inert]') === null &&\n candidate.getClientRects().length > 0,\n ),\n )\n }\n const resize = new ResizeObserver(measure)\n const observe = () => {\n resize.disconnect()\n resize.observe(element)\n for (const child of element.children) {\n resize.observe(child)\n }\n }\n const mutation = new MutationObserver(() => {\n observe()\n measure()\n read()\n })\n\n observe()\n mutation.observe(element, {\n attributeFilter: TAB_ORDER_ATTRIBUTES,\n characterData: true,\n childList: true,\n subtree: true,\n })\n measure()\n read()\n\n return () => {\n resize.disconnect()\n mutation.disconnect()\n }\n }, [ref])\n\n if (!scrolls || holdsTabStop) {\n return {}\n }\n return {\n 'aria-labelledby': label === undefined ? title : undefined,\n role: label === undefined && title === undefined ? undefined : 'region',\n tabIndex: 0,\n }\n}\n\nexport { useScrollStop }\n"],"mappings":";;;AAQA,MAAME,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAAY,CACb,CAACC,KAAK,IAAI;AAIX,MAAMC,uBAAuB;CAC3B;CACA;CACA;CACA;CACA;CACA;AAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CZ,SAAAG,cAAAC,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAEE,MAAA,EAAAN,OAAAC,UAAAG;CAEA,MAAA,CAAAG,SAAAC,cAA8BZ,SAAS,KAAK;CAC5C,MAAA,CAAAa,cAAAC,mBAAwCd,SAAS,KAAK;CAAC,IAAAe;CAAA,IAA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,KAAAA,KAAatC,UAAUsC,KAAAA,IAAjCA,KAAAA,IAAA;CAAiE,IAAAE;CAAA,IAAApC,EAAA,OAAA+B,MAAA/B,EAAA,OAAAmC,IAAA;EAFlEC,KAAA;GAAA,mBACcL;GAAuCM,MACpDF;GAAiEG,UAC7D;EACZ;EAACtC,EAAA,KAAA+B;EAAA/B,EAAA,KAAAmC;EAAAnC,EAAA,KAAAoC;CAAA,OAAAA,KAAApC,EAAA;CAAA,OAJMoC;AAIN;AAlEH,SAAAlB,MAAAqB,WAAA;CAAA,OAuBYA,UAASD,YAAa,KACtBC,UAASC,QAAS,SAAS,MAAM,QACjCD,UAASE,eAAgB,CAAC,CAAAC,SAAU;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToggleGroupDisabled.js","names":["
|
|
1
|
+
{"version":3,"file":"useToggleGroupDisabled.js","names":["useContext","ToggleGroupStateContext","useToggleGroupDisabled","id","group","undefined","isDisabled"],"sources":["../../src/hooks/useToggleGroupDisabled.ts"],"sourcesContent":["import type { Key } from 'react-aria-components'\n\nimport { useContext } from 'react'\nimport { ToggleGroupStateContext } from 'react-aria-components'\n\n/**\n * Whether the React Aria `ToggleButtonGroup` around a toggle disables it.\n *\n * The group does that through its own state rather than through the toggle's\n * props, so it reaches the toggle's render state and nothing earlier. A\n * ripple has to know earlier than that, since its handlers go on the element\n * outside the render function, and this is where it reads the group.\n *\n * Only a toggle with an `id` belongs to the group: React Aria leaves one\n * without an `id` to keep its own state, enabled whatever the group says.\n * This follows the same rule, so a toggle the group does not disable keeps\n * its ripple.\n */\nfunction useToggleGroupDisabled(id: Key | undefined): boolean {\n const group = useContext(ToggleGroupStateContext)\n return group !== null && id !== undefined && group.isDisabled\n}\n\nexport { useToggleGroupDisabled }\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,SAAAE,uBAAAC,IAAA;CACE,MAAAC,QAAcJ,WAAWC,uBAAuB;CAAC,OAC1CG,UAAU,QAAQD,OAAOE,KAAAA,KAAaD,MAAKE;AAAW"}
|
package/dist/i18n/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["LocalizedStringDictionary","LocalizedStringFormatter","useLocale","MESSAGES","
|
|
1
|
+
{"version":3,"file":"index.js","names":["LocalizedStringDictionary","LocalizedStringFormatter","useLocale","MESSAGES","back","cancel","carousel","characterLimit","count","characterLimitReached","confirm","copied","copy","copySelected","dragHandle","enterTime","loading","loadingMore","nextSlide","noResults","previousSlide","selectTime","slide","slideLabel","index","dictionary","cache","Map","messagesFor","locale","cached","get","undefined","formatter","numbers","Intl","NumberFormat","rules","PluralRules","messages","format","rule","select","set","useMessages","$","_c","t0","t1"],"sources":["../../src/i18n/index.ts"],"sourcesContent":["import {\n LocalizedStringDictionary,\n LocalizedStringFormatter,\n} from '@internationalized/string'\nimport { useLocale } from 'react-aria-components'\n\nimport { MESSAGES } from './messages'\n\n// The words the library writes itself, in the locale React Aria's\n// I18nProvider sets — the same locale every other name a control announces is\n// written in. Each one stands behind a prop that names it otherwise:\n// `pendingLabel`, a LoadMore's `label`, `copyLabel`, `copiedLabel` and\n// `selectedLabel`, a sheet handle's `aria-label`, `characterLimitLabel` and\n// `characterLimitReachedLabel`, the time picker's `cancelLabel`,\n// `confirmLabel`, `selectTimeLabel` and `enterTimeLabel`, and a collection's\n// `renderEmptyState` for its empty row.\n\ntype LibraryMessages = {\n /** What a search view's back button is called. */\n back: string\n /** The time picker's action that closes it and keeps the time it had. */\n cancel: string\n /** What a carousel calls itself, as its role description. */\n carousel: string\n /** The limit on a field's length, in words, for a count of characters. */\n characterLimit: (count: number) => string\n /** What a field announces once its length reaches its limit. */\n characterLimitReached: string\n /** The time picker's action that closes it and keeps the time picked. */\n confirm: string\n copied: string\n copy: string\n /**\n * What a copy field says when the clipboard refused it and the value has\n * been selected for the reader to copy themselves.\n */\n copySelected: string\n /**\n * What a bottom sheet's drag handle is called, while it is a button that\n * moves the sheet between its snap points.\n */\n dragHandle: string\n /** The time picker's headline while it takes a time typed. */\n enterTime: string\n loading: string\n loadingMore: string\n /** What a carousel's next button is called. */\n nextSlide: string\n /** What a collection says when filtering leaves nothing in it. */\n noResults: string\n /** What a carousel's previous button is called. */\n previousSlide: string\n /** The time picker's headline while it shows the dial. */\n selectTime: string\n /** What a carousel calls one of its slides, as its role description. */\n slide: string\n /** A slide's name: which of how many it is, as \"2 of 6\". */\n slideLabel: (index: number, count: number) => string\n}\n\nconst dictionary = new LocalizedStringDictionary(MESSAGES)\n\n// One set per locale an app renders in, built the first time a component asks\n// for it. Every string but the limit is fixed for its locale, so the set holds\n// them already formatted rather than formatting them on each render.\nconst cache = new Map<string, LibraryMessages>()\n\nfunction messagesFor(locale: string): LibraryMessages {\n const cached = cache.get(locale)\n if (cached !== undefined) {\n return cached\n }\n\n const formatter = new LocalizedStringFormatter(locale, dictionary)\n const numbers = new Intl.NumberFormat(locale)\n const rules = new Intl.PluralRules(locale)\n const messages = {\n back: formatter.format('back'),\n cancel: formatter.format('cancel'),\n carousel: formatter.format('carousel'),\n characterLimit: (count: number) =>\n formatter.format('characterLimit', {\n count: numbers.format(count),\n rule: rules.select(count),\n }),\n characterLimitReached: formatter.format('characterLimitReached'),\n confirm: formatter.format('confirm'),\n copied: formatter.format('copied'),\n copy: formatter.format('copy'),\n copySelected: formatter.format('copySelected'),\n dragHandle: formatter.format('dragHandle'),\n enterTime: formatter.format('enterTime'),\n loading: formatter.format('loading'),\n loadingMore: formatter.format('loadingMore'),\n nextSlide: formatter.format('nextSlide'),\n noResults: formatter.format('noResults'),\n previousSlide: formatter.format('previousSlide'),\n selectTime: formatter.format('selectTime'),\n slide: formatter.format('slide'),\n slideLabel: (index: number, count: number) =>\n formatter.format('slideLabel', {\n count: numbers.format(count),\n index: numbers.format(index),\n }),\n }\n cache.set(locale, messages)\n return messages\n}\n\n/** The library's own words, in the I18nProvider's locale. */\nfunction useMessages(): LibraryMessages {\n return messagesFor(useLocale().locale)\n}\n\nexport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