@kanso-labs/kanso-ui 0.40.9 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/color-scheme.d.ts +6 -0
  2. package/dist/color-scheme.js +9 -2
  3. package/dist/color-scheme.js.map +1 -1
  4. package/dist/components/app-bar/index.d.ts +16 -6
  5. package/dist/components/app-bar/index.js +54 -48
  6. package/dist/components/app-bar/index.js.map +1 -1
  7. package/dist/components/avatar/index.d.ts +28 -2
  8. package/dist/components/avatar/index.js +3 -0
  9. package/dist/components/avatar/index.js.map +1 -1
  10. package/dist/components/card/index.d.ts +12 -1
  11. package/dist/components/card/index.js +136 -66
  12. package/dist/components/card/index.js.map +1 -1
  13. package/dist/components/dialog/index.js +3 -2
  14. package/dist/components/dialog/index.js.map +1 -1
  15. package/dist/components/popover/index.js +3 -2
  16. package/dist/components/popover/index.js.map +1 -1
  17. package/dist/components/product-icon/index.d.ts +18 -0
  18. package/dist/components/product-icon/index.js +3 -0
  19. package/dist/components/product-icon/index.js.map +1 -1
  20. package/dist/components/segmented-button/index.d.ts +3 -0
  21. package/dist/components/segmented-button/index.js +131 -65
  22. package/dist/components/segmented-button/index.js.map +1 -1
  23. package/dist/components/separator/index.js +2 -2
  24. package/dist/components/separator/index.js.map +1 -1
  25. package/dist/components/sheet/index.js +17 -16
  26. package/dist/components/sheet/index.js.map +1 -1
  27. package/dist/components/snackbar/index.d.ts +10 -3
  28. package/dist/components/snackbar/index.js +32 -12
  29. package/dist/components/snackbar/index.js.map +1 -1
  30. package/dist/components/switch/index.js +12 -3
  31. package/dist/components/switch/index.js.map +1 -1
  32. package/dist/components/toolbar/index.d.ts +3 -2
  33. package/dist/components/toolbar/index.js +3 -2
  34. package/dist/components/toolbar/index.js.map +1 -1
  35. package/dist/field/index.js +75 -48
  36. package/dist/field/index.js.map +1 -1
  37. package/dist/glyphs/index.js +19 -1
  38. package/dist/glyphs/index.js.map +1 -1
  39. package/dist/hooks/useImageLoadingStatus.js +56 -45
  40. package/dist/hooks/useImageLoadingStatus.js.map +1 -1
  41. package/dist/mark/index.js +126 -86
  42. package/dist/mark/index.js.map +1 -1
  43. package/dist/mark/styles.js +14 -0
  44. package/dist/mark/styles.js.map +1 -1
  45. package/dist/overlay/index.js +24 -0
  46. package/dist/overlay/index.js.map +1 -0
  47. package/dist/styles/scheme.js +19 -0
  48. package/dist/styles/scheme.js.map +1 -0
  49. package/dist/styles.css +94 -26
  50. package/dist/theme-scope.d.ts +5 -2
  51. package/dist/theme-scope.js +2 -1
  52. package/dist/theme-scope.js.map +1 -1
  53. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","SVGProps","stylex","mergeStyles","glyphStyles","GlyphProps","Omit","SVGSVGElement","ArrowBackGlyph","props","$","_c","t0","Symbol","for","t1","ArrowDownwardGlyph","ArrowDropDownGlyph","ArrowUpwardGlyph","CalendarGlyph","CheckGlyph","ClockGlyph","Glyph","children","t2","t3","t4","t5","t6","glyph","KeyboardGlyph","MinusGlyph","IndeterminateGlyph","ChevronDownGlyph","ChevronEndGlyph","CloseGlyph","PlusGlyph","SearchGlyph","_c","props","stylex.props"],"sources":["../../src/glyphs/index.tsx"],"sourcesContent":["import type { ReactNode, SVGProps } from 'react';\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 the check, the horizontal rule, the plus, the search, the\n// close, the right and down chevrons, the two sort arrows, the back arrow,\n// the drop-down arrow, the calendar, the schedule clock and the keyboard from\n// Material Symbols on their 24-unit 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, and a split button's menu button its\n// chevron at between 22 and 50.\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=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\" />\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=\"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\" />\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=\"M7 10l5 5 5-5z\" />\n </Glyph>;\n}\nfunction ArrowUpwardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\" />\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=\"M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </Glyph>;\n}\nfunction CheckGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\" />\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=\"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z\" />\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 24 24\" {...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=\"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 12H4V7h16v10zm-9-9h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-3 0h2v2H5zm0-3h2v2H5zm3 6h8v2H8zm6-3h2v2h-2zm0-3h2v2h-2zm3 3h2v2h-2zm0-3h2v2h-2z\" />\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=\"M19 13H5v-2h14v2z\" />\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=\"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z\" />\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=\"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" />\n </Glyph>;\n}\nfunction CloseGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n </Glyph>;\n}\nfunction PlusGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" />\n </Glyph>;\n}\nfunction SearchGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </Glyph>;\n}\nexport { ArrowBackGlyph, ArrowDownwardGlyph, ArrowDropDownGlyph, ArrowUpwardGlyph, CalendarGlyph, CheckGlyph, ChevronDownGlyph, ChevronEndGlyph, ClockGlyph, CloseGlyph, IndeterminateGlyph, KeyboardGlyph, MinusGlyph, PlusGlyph, SearchGlyph };"],"mappings":";;;;;;AA4BA,SAAAQ,eAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,oBAA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CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,oBAAA,QAAA,EAAQ,GAAA,sCAAqC,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EAD7CM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACdG,UAAAA;EADS,CAAA;EAEHF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFHK;AAEG;AAEZ,SAAAsB,YAAA5B,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,oBAAA,QAAA,EAAQ,GAAA,6MAA4M,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADpNM,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":["ReactNode","SVGProps","stylex","mergeStyles","glyphStyles","GlyphProps","Omit","SVGSVGElement","ArrowBackGlyph","props","$","_c","t0","Symbol","for","t1","ArrowDownwardGlyph","ArrowDropDownGlyph","ArrowUpwardGlyph","CalendarGlyph","CheckGlyph","ClockGlyph","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 * 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 the check, the horizontal rule, the plus, the search, the\n// close, the right and down chevrons, the two sort arrows, the back arrow,\n// the drop-down arrow, the calendar, the schedule clock, the keyboard and the\n// person from\n// Material Symbols on their 24-unit 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, and a split button's menu button its\n// chevron at between 22 and 50.\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=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\" />\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=\"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\" />\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=\"M7 10l5 5 5-5z\" />\n </Glyph>;\n}\nfunction ArrowUpwardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\" />\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=\"M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </Glyph>;\n}\nfunction CheckGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\" />\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=\"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z\" />\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 24 24\" {...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=\"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 12H4V7h16v10zm-9-9h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-3 0h2v2H5zm0-3h2v2H5zm3 6h8v2H8zm6-3h2v2h-2zm0-3h2v2h-2zm3 3h2v2h-2zm0-3h2v2h-2z\" />\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=\"M19 13H5v-2h14v2z\" />\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=\"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z\" />\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=\"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" />\n </Glyph>;\n}\nfunction CloseGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\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=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\" />\n </Glyph>;\n}\nfunction PlusGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" />\n </Glyph>;\n}\nfunction SearchGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </Glyph>;\n}\nexport { ArrowBackGlyph, ArrowDownwardGlyph, ArrowDropDownGlyph, ArrowUpwardGlyph, CalendarGlyph, CheckGlyph, ChevronDownGlyph, ChevronEndGlyph, ClockGlyph, CloseGlyph, IndeterminateGlyph, KeyboardGlyph, MinusGlyph, PersonGlyph, PlusGlyph, SearchGlyph };"],"mappings":";;;;;;AA6BA,SAAAQ,eAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,oBAAA,QAAA,EAAQ,GAAA,+DAA8D,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADtEM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACdG,UAAAA;EADS,CAAA;EAEHF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFHK;AAEG;AAOZ,SAAAC,mBAAAP,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,oBAAA,QAAA,EAAQ,GAAA,iEAAgE,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADxEM,KAAA,oBAAC,OAAD;GAAM,GAAK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F,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EAD7CM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACdG,UAAAA;EADS,CAAA;EAEHF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFHK;AAEG;AAEZ,SAAAuB,YAAA7B,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,oBAAA,QAAA,EAAQ,GAAA,6MAA4M,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADpNM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACdG,UAAAA;EADS,CAAA;EAEHF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFHK;AAEG"}
@@ -1,58 +1,69 @@
1
1
  import { c } from "react/compiler-runtime";
2
- import { useEffect, useState } from "react";
2
+ import { useState } from "react";
3
3
  //#region src/hooks/useImageLoadingStatus.ts
4
4
  /**
5
- * Whether an image at `src` can be shown yet. It is loaded off-screen first,
6
- * so a component can keep its fallback in place until the picture is ready
7
- * and bring the fallback back if the picture fails — an `<img>` swapped in
8
- * as soon as `src` is known would show the browser's broken-image glyph in
9
- * between.
5
+ * Whether the picture at `src` can be shown yet, from what the component's
6
+ * own `<img>` reports. The image is rendered from the start and hidden until
7
+ * it loads, so the browser fetches it as it would any image — `loading`,
8
+ * `srcSet` and `sizes` all apply, which a detached preloader started on
9
+ * mount left them no part in — and hand `onLoad` and `onError` to that
10
+ * element. A component keeps its fallback until the picture is ready and
11
+ * brings it back if the picture fails, so the browser's broken-image glyph
12
+ * is never what shows.
13
+ *
14
+ * `previous` is the picture last loaded, while a new `src` is still loading,
15
+ * so the component can keep showing it rather than drop back to the fallback
16
+ * for as long as the new one takes — a theme swapping one logo for another
17
+ * flashed the initial between them. It is the resource the browser actually
18
+ * loaded, which is cached, so an element showing it needs no `srcSet`.
10
19
  *
11
20
  * No `src` counts as a failure, since the outcome is the same: the fallback
12
- * shows. What settled is remembered against the `src` it settled for, so a
13
- * change of `src` reads as loading again rather than as the old outcome.
21
+ * shows. Outcomes are remembered against the `src` they came for, so a
22
+ * change of `src` reads as loading rather than as the old outcome.
14
23
  */
15
24
  function useImageLoadingStatus(src) {
16
- const $ = c(3);
17
- const [settled, setSettled] = useState(null);
25
+ const $ = c(5);
26
+ const [loaded, setLoaded] = useState(null);
27
+ const [failed, setFailed] = useState(null);
18
28
  let t0;
29
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30
+ t0 = (event) => {
31
+ const image = event.currentTarget;
32
+ const from = image.getAttribute("src");
33
+ if (from !== null) setLoaded({
34
+ shown: image.currentSrc === "" ? from : image.currentSrc,
35
+ src: from
36
+ });
37
+ };
38
+ $[0] = t0;
39
+ } else t0 = $[0];
40
+ const onLoad = t0;
19
41
  let t1;
20
- if ($[0] !== src) {
21
- t0 = () => {
22
- if (src === void 0) return;
23
- const onLoad = () => {
24
- setSettled({
25
- src,
26
- status: "loaded"
27
- });
28
- };
29
- const onError = () => {
30
- setSettled({
31
- src,
32
- status: "error"
33
- });
34
- };
35
- const image = new window.Image();
36
- image.addEventListener("load", onLoad, { once: true });
37
- image.addEventListener("error", onError, { once: true });
38
- image.src = src;
39
- return () => {
40
- image.removeEventListener("load", onLoad);
41
- image.removeEventListener("error", onError);
42
- image.removeAttribute("src");
43
- };
42
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
43
+ t1 = (event_0) => {
44
+ const from_0 = event_0.currentTarget.getAttribute("src");
45
+ if (from_0 !== null) setFailed(from_0);
46
+ };
47
+ $[1] = t1;
48
+ } else t1 = $[1];
49
+ const onError = t1;
50
+ let status = "loading";
51
+ if (src === void 0 || failed === src) status = "error";
52
+ else if (loaded?.src === src) status = "loaded";
53
+ const t2 = status === "loading" ? loaded?.shown : void 0;
54
+ let t3;
55
+ if ($[2] !== status || $[3] !== t2) {
56
+ t3 = {
57
+ onError,
58
+ onLoad,
59
+ previous: t2,
60
+ status
44
61
  };
45
- t1 = [src];
46
- $[0] = src;
47
- $[1] = t0;
48
- $[2] = t1;
49
- } else {
50
- t0 = $[1];
51
- t1 = $[2];
52
- }
53
- useEffect(t0, t1);
54
- if (src === void 0) return "error";
55
- return settled?.src === src ? settled.status : "loading";
62
+ $[2] = status;
63
+ $[3] = t2;
64
+ $[4] = t3;
65
+ } else t3 = $[4];
66
+ return t3;
56
67
  }
57
68
  //#endregion
58
69
  export { useImageLoadingStatus };
@@ -1 +1 @@
1
- {"version":3,"file":"useImageLoadingStatus.js","names":["useEffect","useState","ImageLoadingStatus","Settled","src","status","useImageLoadingStatus","$","_c","settled","setSettled","t0","t1","undefined","onLoad","onError","image","window","Image","addEventListener","once","removeEventListener","removeAttribute","_c"],"sources":["../../src/hooks/useImageLoadingStatus.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\ntype ImageLoadingStatus = 'error' | 'loaded' | 'loading'\n\ninterface Settled {\n src: string\n status: 'error' | 'loaded'\n}\n\n/**\n * Whether an image at `src` can be shown yet. It is loaded off-screen first,\n * so a component can keep its fallback in place until the picture is ready\n * and bring the fallback back if the picture fails — an `<img>` swapped in\n * as soon as `src` is known would show the browser's broken-image glyph in\n * between.\n *\n * No `src` counts as a failure, since the outcome is the same: the fallback\n * shows. What settled is remembered against the `src` it settled for, so a\n * change of `src` reads as loading again rather than as the old outcome.\n */\nfunction useImageLoadingStatus(src: string | undefined): ImageLoadingStatus {\n const [settled, setSettled] = useState<null | Settled>(null)\n\n useEffect(() => {\n if (src === undefined) {\n return undefined\n }\n\n const onLoad = () => {\n setSettled({ src, status: 'loaded' })\n }\n const onError = () => {\n setSettled({ src, status: 'error' })\n }\n\n const image = new window.Image()\n image.addEventListener('load', onLoad, { once: true })\n image.addEventListener('error', onError, { once: true })\n image.src = src\n\n // A load `src` has moved on from, or one the component went before, is\n // stopped rather than left to run. Taking the listeners off is what keeps\n // it from reporting an outcome nobody asked for, and lets the image go\n // once nothing else holds it; removing its source aborts the fetch. That\n // is the source removed rather than set empty, which would also abort it\n // but queue an `error` event on the way.\n return () => {\n image.removeEventListener('load', onLoad)\n image.removeEventListener('error', onError)\n image.removeAttribute('src')\n }\n }, [src])\n\n if (src === undefined) {\n return 'error'\n }\n return settled?.src === src ? settled.status : 'loading'\n}\n\nexport type { ImageLoadingStatus }\n\nexport { useImageLoadingStatus }\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAAM,sBAAAF,KAAA;CAAA,MAAAG,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,SAAAC,cAA8BT,SAAyB,IAAI;CAAC,IAAAU;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAH,KAAA;EAElDO,WAAA;GACR,IAAIP,QAAQS,KAAAA,GAAS;GAIrB,MAAAC,eAAe;IACbJ,WAAW;KAAAN;KAAAC,QAAe;IAAS,CAAC;GAAC;GAEvC,MAAAU,gBAAgB;IACdL,WAAW;KAAAN;KAAAC,QAAe;IAAQ,CAAC;GAAC;GAGtC,MAAAW,QAAc,IAAIC,OAAMC,MAAO;GAC/BF,MAAKG,iBAAkB,QAAQL,QAAQ,EAAAM,MAAQ,KAAK,CAAC;GACrDJ,MAAKG,iBAAkB,SAASJ,SAAS,EAAAK,MAAQ,KAAK,CAAC;GACvDJ,MAAKZ,MAAOA;GAAH,aAQF;IACLY,MAAKK,oBAAqB,QAAQP,MAAM;IACxCE,MAAKK,oBAAqB,SAASN,OAAO;IAC1CC,MAAKM,gBAAiB,KAAK;GAAC;EAC7B;EACAV,KAAA,CAACR,GAAG;EAACG,EAAA,KAAAH;EAAAG,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAD,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CA5BRP,UAAUW,IA4BPC,EAAK;CAER,IAAIR,QAAQS,KAAAA,GAAS,OACZ;CACR,OACMJ,SAAOL,QAAUA,MAAMK,QAAOJ,SAA9B;AAAiD"}
1
+ {"version":3,"file":"useImageLoadingStatus.js","names":["SyntheticEvent","useCallback","useState","ImageLoadingStatus","Loaded","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","_c"],"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,SAAAO,sBAAAD,KAAA;CAAA,MAAAE,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,QAAAC,aAA4BT,SAAwB,IAAI;CACxD,MAAA,CAAAU,QAAAC,aAA4BX,SAAwB,IAAI;CAAC,IAAAY;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,11 +1,12 @@
1
1
  import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
2
  import { useRender } from "../render/useRender.js";
3
3
  import { mergeStyles } from "../styles/merge.js";
4
+ import { PersonGlyph } from "../glyphs/index.js";
4
5
  import { useImageLoadingStatus } from "../hooks/useImageLoadingStatus.js";
5
6
  import { initialOfThing, initialsOfPerson } from "./initials.js";
6
7
  import { markStyles } from "./styles.js";
7
8
  import { c } from "react/compiler-runtime";
8
- import { jsx } from "react/jsx-runtime";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
10
  import { useLocale } from "react-aria-components";
10
11
  //#region src/mark/index.tsx
11
12
  const KINDS = {
@@ -31,105 +32,144 @@ const KINDS = {
31
32
  * pill.
32
33
  */
33
34
  function Mark(t0) {
34
- const $ = c(27);
35
- const { kind, name, render, size, src, tone, ...props$1 } = t0;
35
+ const $ = c(41);
36
+ const { decorative: t1, imgProps, kind, name, render, showPersonIcon: t2, size, src, tone, ...props$1 } = t0;
37
+ const decorative = t1 === void 0 ? false : t1;
38
+ const showPersonIcon = t2 === void 0 ? true : t2;
36
39
  const { fit, initials, shape, tintsFallback } = KINDS[kind];
37
- const status = useImageLoadingStatus(src);
40
+ const { onError, onLoad, previous, status } = useImageLoadingStatus(src);
38
41
  const { locale } = useLocale();
39
- let t1;
42
+ let t3;
40
43
  if ($[0] !== initials || $[1] !== locale || $[2] !== name) {
41
- t1 = initials(name, locale);
44
+ t3 = initials(name, locale);
42
45
  $[0] = initials;
43
46
  $[1] = locale;
44
47
  $[2] = name;
45
- $[3] = t1;
46
- } else t1 = $[3];
47
- const fallback = t1;
48
- let t2;
49
- if ($[4] !== name) {
50
- t2 = name.trim();
51
- $[4] = name;
52
- $[5] = t2;
53
- } else t2 = $[5];
54
- const named = t2 !== "";
55
- let children;
56
- if (status === "loaded") {
57
- let t3;
58
- if ($[6] !== fit) {
59
- t3 = props(markStyles.image, fit);
60
- $[6] = fit;
61
- $[7] = t3;
62
- } else t3 = $[7];
63
- let t4;
64
- if ($[8] !== src || $[9] !== t3) {
65
- t4 = /* @__PURE__ */ jsx("img", {
66
- alt: "",
67
- src,
68
- ...t3
69
- });
70
- $[8] = src;
71
- $[9] = t3;
72
- $[10] = t4;
73
- } else t4 = $[10];
74
- children = t4;
75
- } else if (tintsFallback) {
76
- let t3;
77
- if ($[11] !== tone) {
78
- t3 = props(markStyles.fallback, markStyles[tone]);
79
- $[11] = tone;
80
- $[12] = t3;
81
- } else t3 = $[12];
82
- let t4;
83
- if ($[13] !== fallback || $[14] !== t3) {
84
- t4 = /* @__PURE__ */ jsx("span", {
85
- ...t3,
86
- children: fallback
87
- });
88
- $[13] = fallback;
89
- $[14] = t3;
90
- $[15] = t4;
91
- } else t4 = $[15];
92
- children = t4;
93
- } else children = fallback;
94
- const t3 = "span";
48
+ $[3] = t3;
49
+ } else t3 = $[3];
50
+ const fallback = t3;
95
51
  let t4;
96
- if ($[16] !== name || $[17] !== named) {
97
- t4 = named ? {
52
+ if ($[4] !== decorative || $[5] !== name) {
53
+ t4 = !decorative && name.trim() !== "";
54
+ $[4] = decorative;
55
+ $[5] = name;
56
+ $[6] = t4;
57
+ } else t4 = $[6];
58
+ const named = t4;
59
+ const showsPicture = status === "loaded" || previous !== void 0;
60
+ let initialsNode = null;
61
+ if (!showsPicture && kind === "person" && fallback === "") {
62
+ let t5;
63
+ if ($[7] !== showPersonIcon) {
64
+ t5 = showPersonIcon ? /* @__PURE__ */ jsx(PersonGlyph, { ...props(markStyles.personGlyph) }) : null;
65
+ $[7] = showPersonIcon;
66
+ $[8] = t5;
67
+ } else t5 = $[8];
68
+ initialsNode = t5;
69
+ } else if (!showsPicture) {
70
+ let t5;
71
+ if ($[9] !== fallback || $[10] !== tintsFallback || $[11] !== tone) {
72
+ t5 = tintsFallback ? /* @__PURE__ */ jsx("span", {
73
+ ...props(markStyles.fallback, markStyles[tone]),
74
+ children: fallback
75
+ }) : fallback;
76
+ $[9] = fallback;
77
+ $[10] = tintsFallback;
78
+ $[11] = tone;
79
+ $[12] = t5;
80
+ } else t5 = $[12];
81
+ initialsNode = t5;
82
+ }
83
+ let t5;
84
+ if ($[13] !== fit || $[14] !== previous) {
85
+ t5 = previous === void 0 ? null : /* @__PURE__ */ jsx("img", {
86
+ alt: "",
87
+ src: previous,
88
+ ...props(markStyles.image, fit)
89
+ }, previous);
90
+ $[13] = fit;
91
+ $[14] = previous;
92
+ $[15] = t5;
93
+ } else t5 = $[15];
94
+ let t6;
95
+ if ($[16] !== fit || $[17] !== imgProps || $[18] !== onError || $[19] !== onLoad || $[20] !== src || $[21] !== status) {
96
+ t6 = src === void 0 || status === "error" ? null : /* @__PURE__ */ jsx("img", {
97
+ alt: "",
98
+ decoding: "async",
99
+ loading: "lazy",
100
+ ...imgProps,
101
+ onError,
102
+ onLoad,
103
+ src,
104
+ ...props(markStyles.image, fit, status !== "loaded" && markStyles.imagePending)
105
+ }, src);
106
+ $[16] = fit;
107
+ $[17] = imgProps;
108
+ $[18] = onError;
109
+ $[19] = onLoad;
110
+ $[20] = src;
111
+ $[21] = status;
112
+ $[22] = t6;
113
+ } else t6 = $[22];
114
+ let t7;
115
+ if ($[23] !== initialsNode || $[24] !== t5 || $[25] !== t6) {
116
+ t7 = /* @__PURE__ */ jsxs(Fragment, { children: [
117
+ initialsNode,
118
+ t5,
119
+ t6
120
+ ] });
121
+ $[23] = initialsNode;
122
+ $[24] = t5;
123
+ $[25] = t6;
124
+ $[26] = t7;
125
+ } else t7 = $[26];
126
+ const children = t7;
127
+ const t8 = "span";
128
+ let t9;
129
+ if ($[27] !== name || $[28] !== named) {
130
+ t9 = named ? {
98
131
  "aria-label": name,
99
132
  role: "img"
100
133
  } : {};
101
- $[16] = name;
102
- $[17] = named;
103
- $[18] = t4;
104
- } else t4 = $[18];
105
- const t5 = children;
106
- const t6 = mergeStyles(props(markStyles.base, shape, markStyles[size], !tintsFallback && markStyles[tone]), props$1);
107
- let t7;
108
- if ($[19] !== children || $[20] !== props$1 || $[21] !== t4 || $[22] !== t6) {
109
- t7 = {
110
- ...t4,
134
+ $[27] = name;
135
+ $[28] = named;
136
+ $[29] = t9;
137
+ } else t9 = $[29];
138
+ let t10;
139
+ if ($[30] !== decorative) {
140
+ t10 = decorative ? { "aria-hidden": true } : {};
141
+ $[30] = decorative;
142
+ $[31] = t10;
143
+ } else t10 = $[31];
144
+ const t11 = mergeStyles(props(markStyles.base, shape, markStyles[size], !tintsFallback && markStyles[tone]), props$1);
145
+ let t12;
146
+ if ($[32] !== children || $[33] !== props$1 || $[34] !== t10 || $[35] !== t11 || $[36] !== t9) {
147
+ t12 = {
148
+ ...t9,
149
+ ...t10,
111
150
  ...props$1,
112
- children: t5,
113
- ...t6
151
+ children,
152
+ ...t11
114
153
  };
115
- $[19] = children;
116
- $[20] = props$1;
117
- $[21] = t4;
118
- $[22] = t6;
119
- $[23] = t7;
120
- } else t7 = $[23];
121
- let t8;
122
- if ($[24] !== render || $[25] !== t7) {
123
- t8 = {
124
- defaultTagName: t3,
125
- props: t7,
154
+ $[32] = children;
155
+ $[33] = props$1;
156
+ $[34] = t10;
157
+ $[35] = t11;
158
+ $[36] = t9;
159
+ $[37] = t12;
160
+ } else t12 = $[37];
161
+ let t13;
162
+ if ($[38] !== render || $[39] !== t12) {
163
+ t13 = {
164
+ defaultTagName: t8,
165
+ props: t12,
126
166
  render
127
167
  };
128
- $[24] = render;
129
- $[25] = t7;
130
- $[26] = t8;
131
- } else t8 = $[26];
132
- return useRender(t8);
168
+ $[38] = render;
169
+ $[39] = t12;
170
+ $[40] = t13;
171
+ } else t13 = $[40];
172
+ return useRender(t13);
133
173
  }
134
174
  //#endregion
135
175
  export { Mark as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["stylex","useLocale","RenderComponentProps","MarkSize","MarkTone","useImageLoadingStatus","useRender","mergeStyles","initialOfThing","initialsOfPerson","markStyles","KINDS","person","fit","cover","initials","shape","circle","tintsFallback","thing","contain","square","const","MarkProps","Omit","kind","name","size","src","tone","Mark","t0","$","_c","render","props","status","locale","t1","fallback","t2","trim","named","children","t3","image","t4","role","t6","base","t7","t8","defaultTagName","_c","props","stylex.props"],"sources":["../../src/mark/index.tsx"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport { useLocale } from 'react-aria-components';\nimport type { RenderComponentProps } from '../render/useRender';\nimport type { MarkSize, MarkTone } from './styles';\nimport { useImageLoadingStatus } from '../hooks/useImageLoadingStatus';\nimport { useRender } from '../render/useRender';\nimport { mergeStyles } from '../styles/merge';\nimport { initialOfThing, initialsOfPerson } from './initials';\nimport { markStyles } from './styles';\n\n// What each kind of mark is drawn as. The header of `./styles` says why the\n// two differ where they do; everything not in this table is the same for\n// both.\nconst KINDS = {\n person: {\n fit: markStyles.cover,\n initials: initialsOfPerson,\n shape: markStyles.circle,\n tintsFallback: false\n },\n thing: {\n fit: markStyles.contain,\n initials: initialOfThing,\n shape: markStyles.square,\n tintsFallback: true\n }\n} as const;\ntype MarkProps = Omit<RenderComponentProps<'span'>, 'children'> & {\n /** A person, which Avatar draws, or anything else, which ProductIcon does. */\n kind: keyof typeof KINDS;\n /** Supplies both the fallback's initials and the accessible name. */\n name: string;\n size: MarkSize;\n /** An image to show in place of the initials once it has loaded. */\n src?: string;\n tone: MarkTone;\n};\n\n/**\n * The small identity mark Avatar and ProductIcon both render: an image once\n * it has loaded, initials until then or if it fails, named for whoever or\n * whatever it stands for. Shared rather than written into each, so a fix to\n * one reaches both. Not a component of the library's own and not exported\n * from the package; see `src/chip` for the same arrangement around a chip's\n * pill.\n */\nfunction Mark({\n kind,\n name,\n render,\n size,\n src,\n tone,\n ...props\n}: MarkProps) {\n const {\n fit,\n initials,\n shape,\n tintsFallback\n } = KINDS[kind];\n // The image is shown only once it has loaded, and the initials stay until\n // then and come back if it fails — see useImageLoadingStatus.\n const status = useImageLoadingStatus(src);\n const {\n locale\n } = useLocale();\n const fallback = initials(name, locale);\n\n // role/aria-label rather than letting the initials be read: \"AL\" is not\n // what anyone means to announce. Marking the root as an image also makes\n // its contents presentational, so the image and the initials can't be\n // announced a second time underneath the name. A span rather than an\n // <img>, which is void: this element's whole job is to hold the initials\n // shown when there is no image, or none has loaded yet.\n //\n // A blank name — one still loading, say — names nothing, so the mark is\n // then a plain element rather than an image with no name, which a screen\n // reader reads as a bare \"image\". Its empty initials, or its image with an\n // empty alt, leave it nothing to announce.\n const named = name.trim() !== '';\n let children;\n if (status === 'loaded') {\n children = <img alt=\"\" src={src} {...stylex.props(markStyles.image, fit)} />;\n } else if (tintsFallback) {\n children = <span {...stylex.props(markStyles.fallback, markStyles[tone])}>\n {fallback}\n </span>;\n } else {\n children = fallback;\n }\n return useRender({\n defaultTagName: 'span',\n props: {\n ...(named ? {\n 'aria-label': name,\n role: 'img'\n } : {}),\n ...props,\n children,\n ...mergeStyles(stylex.props(markStyles.base, shape, markStyles[size], !tintsFallback && markStyles[tone]), props)\n },\n render\n });\n}\nexport default Mark;"],"mappings":";;;;;;;;;;AAaA,MAAMW,QAAQ;CACZC,QAAQ;EACNC,KAAKH,WAAWI;EAChBC,UAAUN;EACVO,OAAON,WAAWO;EAClBC,eAAe;CACjB;CACAC,OAAO;EACLN,KAAKH,WAAWU;EAChBL,UAAUP;EACVQ,OAAON,WAAWW;EAClBH,eAAe;CACjB;AACF;;;;;;;;;AAoBA,SAAAY,KAAAC,IAAA;CAAA,MAAAC,IAAAC,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AA;CAAA,OAZM1B,UAAU6C,EAYhB;AAAC"}
1
+ {"version":3,"file":"index.js","names":["ImgHTMLAttributes","stylex","useLocale","RenderComponentProps","MarkSize","MarkTone","PersonGlyph","useImageLoadingStatus","useRender","mergeStyles","initialOfThing","initialsOfPerson","markStyles","KINDS","person","fit","cover","initials","shape","circle","tintsFallback","thing","contain","square","const","MarkProps","decorative","imgProps","Pick","HTMLImageElement","kind","name","showPersonIcon","size","src","tone","Omit","Mark","t0","$","_c","t1","render","t2","props","undefined","onError","onLoad","previous","status","locale","t3","fallback","t4","trim","named","showsPicture","initialsNode","t5","personGlyph","image","t6","imagePending","t7","children","t8","t9","role","t10","t11","base","t12","t13","defaultTagName","_c","props","stylex.props"],"sources":["../../src/mark/index.tsx"],"sourcesContent":["import type { ImgHTMLAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useLocale } from 'react-aria-components';\nimport type { RenderComponentProps } from '../render/useRender';\nimport type { MarkSize, MarkTone } from './styles';\nimport { PersonGlyph } from '../glyphs';\nimport { useImageLoadingStatus } from '../hooks/useImageLoadingStatus';\nimport { useRender } from '../render/useRender';\nimport { mergeStyles } from '../styles/merge';\nimport { initialOfThing, initialsOfPerson } from './initials';\nimport { markStyles } from './styles';\n\n// What each kind of mark is drawn as. The header of `./styles` says why the\n// two differ where they do; everything not in this table is the same for\n// both.\nconst KINDS = {\n person: {\n fit: markStyles.cover,\n initials: initialsOfPerson,\n shape: markStyles.circle,\n tintsFallback: false\n },\n thing: {\n fit: markStyles.contain,\n initials: initialOfThing,\n shape: markStyles.square,\n tintsFallback: true\n }\n} as const;\ntype MarkProps = {\n /**\n * Hides the mark from assistive technology, for one beside the name it\n * stands for, which would otherwise be announced twice.\n */\n decorative?: boolean | undefined;\n /** Attributes for the picture's own `<img>`, as Avatar and ProductIcon take them. */\n imgProps?: Pick<ImgHTMLAttributes<HTMLImageElement>, 'crossOrigin' | 'decoding' | 'fetchPriority' | 'loading' | 'referrerPolicy' | 'sizes' | 'srcSet'> | undefined;\n /** A person, which Avatar draws, or anything else, which ProductIcon does. */\n kind: keyof typeof KINDS;\n /** Supplies the fallback's initials, and the accessible name unless decorative. */\n name: string;\n /**\n * Whether a person with no initials to take — a blank name — draws the\n * anonymous person glyph, or an empty disc, as a loading skeleton wants.\n */\n showPersonIcon?: boolean | undefined;\n size: MarkSize;\n /** An image to show in place of the initials once it has loaded. */\n src?: string;\n tone: MarkTone;\n} & Omit<RenderComponentProps<'span'>, 'children'>;\n\n/**\n * The small identity mark Avatar and ProductIcon both render: an image once\n * it has loaded, initials until then or if it fails, named for whoever or\n * whatever it stands for. Shared rather than written into each, so a fix to\n * one reaches both. Not a component of the library's own and not exported\n * from the package; see `src/chip` for the same arrangement around a chip's\n * pill.\n */\nfunction Mark({\n decorative = false,\n imgProps,\n kind,\n name,\n render,\n showPersonIcon = true,\n size,\n src,\n tone,\n ...props\n}: MarkProps) {\n const {\n fit,\n initials,\n shape,\n tintsFallback\n } = KINDS[kind];\n // The image is rendered from the start and shown once it has loaded, and\n // the initials stay until then and come back if it fails — see\n // useImageLoadingStatus.\n const {\n onError,\n onLoad,\n previous,\n status\n } = useImageLoadingStatus(src);\n const {\n locale\n } = useLocale();\n const fallback = initials(name, locale);\n\n // role/aria-label rather than letting the initials be read: \"AL\" is not\n // what anyone means to announce. Marking the root as an image also makes\n // its contents presentational, so the image and the initials can't be\n // announced a second time underneath the name. A span rather than an\n // <img>, which is void: this element's whole job is to hold the initials\n // shown when there is no image, or none has loaded yet.\n //\n // A blank name — one still loading, say — names nothing, so the mark is\n // then a plain element rather than an image with no name, which a screen\n // reader reads as a bare \"image\". Its empty initials, or its image with an\n // empty alt, leave it nothing to announce.\n //\n // A decorative mark is hidden outright. Beside the name it stands for — a\n // list row whose headline is the person — the name came out twice, once as\n // the image and once as the text, and with no role the initials would be\n // read as bare letters instead.\n const named = !decorative && name.trim() !== '';\n\n // The initials while no picture shows: before the first loads, and once\n // one fails. They are left out under a picture rather than kept beneath\n // it, since a letterboxed logo would show them through its transparent\n // parts.\n const showsPicture = status === 'loaded' || previous !== undefined;\n let initialsNode = null;\n if (!showsPicture && kind === 'person' && fallback === '') {\n // A person with no initials to take — a blank name, one still loading —\n // draws Material Design's anonymous person in the tone's on-container\n // colour, where it drew an empty disc. Decoration: a blank name is\n // unnamed, and the glyph announces nothing either.\n initialsNode = showPersonIcon ? <PersonGlyph {...stylex.props(markStyles.personGlyph)} /> : null;\n } else if (!showsPicture) {\n initialsNode = tintsFallback ? <span {...stylex.props(markStyles.fallback, markStyles[tone])}>\n {fallback}\n </span> : fallback;\n }\n\n // Two pictures at most, laid over the initials. The one last loaded stays\n // while a new `src` loads, and the new one is rendered on top of it from\n // the start, hidden until it has loaded: lazy, so an avatar far down an\n // unvirtualised list is not fetched on mount, and decoded off the main\n // thread, both of which the call site can change through `imgProps`. The\n // last loaded one is the resource the browser chose, out of a `srcSet`\n // too, and is cached, so it needs none of those.\n const children = <>\n {initialsNode}\n {previous === undefined ? null : <img alt=\"\" key={previous} src={previous} {...stylex.props(markStyles.image, fit)} />}\n {src === undefined || status === 'error' ? null : <img alt=\"\" decoding=\"async\" key={src} loading=\"lazy\" {...imgProps} onError={onError} onLoad={onLoad} src={src} {...stylex.props(markStyles.image, fit, status !== 'loaded' && markStyles.imagePending)} />}\n </>;\n return useRender({\n defaultTagName: 'span',\n props: {\n ...(named ? {\n 'aria-label': name,\n role: 'img'\n } : {}),\n ...(decorative ? {\n 'aria-hidden': true\n } : {}),\n ...props,\n children,\n ...mergeStyles(stylex.props(markStyles.base, shape, markStyles[size], !tintsFallback && markStyles[tone]), props)\n },\n render\n });\n}\nexport default Mark;"],"mappings":";;;;;;;;;;;AAeA,MAAMa,QAAQ;CACZC,QAAQ;EACNC,KAAKH,WAAWI;EAChBC,UAAUN;EACVO,OAAON,WAAWO;EAClBC,eAAe;CACjB;CACAC,OAAO;EACLN,KAAKH,WAAWU;EAChBL,UAAUP;EACVQ,OAAON,WAAWW;EAClBH,eAAe;C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;EAAAL,EAAA,MAAA6B;EAAA7B,EAAA,MAAA8B;EAAA9B,EAAA,MAAA2B;EAAA3B,EAAA,MAAAgC;CAAA,OAAAA,MAAAhC,EAAA;CAAA,IAAAiC;CAAA,IAAAjC,EAAA,QAAAG,UAAAH,EAAA,QAAAgC,KAAA;EAbcC,MAAA;GAAAC,gBACCR;GAAMrB,OACf2B;GAWN7B;EAEH;EAACH,EAAA,MAAAG;EAAAH,EAAA,MAAAgC;EAAAhC,EAAA,MAAAiC;CAAA,OAAAA,MAAAjC,EAAA;CAAA,OAfM/B,UAAUgE,GAehB;AAAC"}
@@ -12,6 +12,7 @@ const markStyles = {
12
12
  k63SB2: "x1bf3uqz",
13
13
  kjj79g: "xl56j7k",
14
14
  kVQacm: "xb3r6kr",
15
+ kVAEAm: "x1n2onr6",
15
16
  kfSwDN: "x87ps6o",
16
17
  $$css: true
17
18
  },
@@ -37,7 +38,15 @@ const markStyles = {
37
38
  },
38
39
  image: {
39
40
  kZKoxP: "x5yr21d",
41
+ kB7OPa: "x9f619",
40
42
  kzqmXN: "xh8yej3",
43
+ k87sOh: "x13vifvy",
44
+ kLqNvP: "x1o0tod",
45
+ kVAEAm: "x10l6tqk",
46
+ $$css: true
47
+ },
48
+ imagePending: {
49
+ kSiTet: "xg01cxk",
41
50
  $$css: true
42
51
  },
43
52
  lg: {
@@ -57,6 +66,11 @@ const markStyles = {
57
66
  kMwMTN: "xylzu7l",
58
67
  $$css: true
59
68
  },
69
+ personGlyph: {
70
+ kZKoxP: "x39lw6i",
71
+ kzqmXN: "xycev2y",
72
+ $$css: true
73
+ },
60
74
  positive: {
61
75
  kWkggS: "xa3zu90",
62
76
  kMwMTN: "x1di7zbg",
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["stylex","colors","radii","typography","FORCED_COLORS","markStyles","base","kGNEyG","kVAM5u","ksu8eU","kMzoRj","kB7OPa","k1xSpc","kmuXW","kMv6JI","k63SB2","kjj79g","kVQacm","kfSwDN","$$css","circle","kaIpWk","contain","kVIFPx","cover","fallback","kZKoxP","kzqmXN","image","lg","kGuDYH","md","negative","kWkggS","kMwMTN","positive","primary","secondary","sm","square","tertiary","MarkSize","MarkTone"],"sources":["../../src/mark/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, typography } from '../tokens/design.tokens.stylex';\n\n// The box Avatar and ProductIcon draw in, shared so a person and a thing stay\n// the same three sizes in the same five tones, and so either can fill a\n// leading slot without moving what sits beside it. They differ in the two\n// ways that matter for a mark rather than a face, and those are the keys a\n// kind picks between in `./index.tsx`.\n//\n// A person is a circle with the photo cropped to fill it; a thing is a\n// rounded square with its mark letterboxed. A logo is drawn to its own\n// bounding box, so a circle crops the corners it was composed with, and\n// cropping a face loses nothing anyone minds where cropping a wordmark loses\n// the word. The cost of `contain` is letterboxing — a wide mark leaves space\n// above and below — and that is the right trade for a mark whose whole job\n// is to be recognised.\n//\n// That cost is also why a thing's tone tints the fallback rather than the\n// root. A mark letterboxed into the square does not cover it, and neither\n// does one drawn with transparency, so a tint on the root showed as a\n// coloured box around every logo that was not an opaque square. On the\n// fallback it is seen exactly when it is meant to be: while there is no\n// mark, or none has loaded. A photo covers the whole circle, so a person's\n// tone stays on the root.\n//\n// Tones are container/on-container pairs rather than one colour each, so the\n// initials are always a role's own foreground and can't end up unreadable on\n// a tint they were never paired with.\n//\n// Sizes carry their own type size but not their own weight or family: the\n// label face at medium weight holds across all three, so a large mark is\n// bigger initials rather than differently-styled ones.\n//\n// The three are the library's own rather than a spec page's — no Material\n// Design page gives a measurement for one in text; the lists page draws its\n// leading elements in a diagram and tabulates only their padding. So they are\n// stated against the scale the library already has. `md` is 40dp, which is\n// Button's and IconButton's own `md` height, so a mark and a control line up\n// in a row. `lg` is 56dp. `sm` is 36dp, between the 32dp a chip and an `xs`\n// control take and that 40dp default, for a row that wants a person smaller\n// than the button beside them.\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst markStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1w1tqly\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x13rsnn2\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kMv6JI: \"xkknnkr\",\n k63SB2: \"x1bf3uqz\",\n kjj79g: \"xl56j7k\",\n kVQacm: \"xb3r6kr\",\n kfSwDN: \"x87ps6o\",\n $$css: true\n },\n circle: {\n kaIpWk: \"x16fbrrb\",\n $$css: true\n },\n contain: {\n kVIFPx: \"x19kjcj4\",\n $$css: true\n },\n cover: {\n kVIFPx: \"xl1xv1r\",\n $$css: true\n },\n fallback: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x5yr21d\",\n k1xSpc: \"x78zum5\",\n kzqmXN: \"xh8yej3\",\n kjj79g: \"xl56j7k\",\n $$css: true\n },\n image: {\n kZKoxP: \"x5yr21d\",\n kzqmXN: \"xh8yej3\",\n $$css: true\n },\n lg: {\n kZKoxP: \"xnnlda6\",\n kGuDYH: \"x1848etk\",\n kzqmXN: \"x15yg21f\",\n $$css: true\n },\n md: {\n kZKoxP: \"x1vqgdyp\",\n kGuDYH: \"x14zspaw\",\n kzqmXN: \"x100vrsf\",\n $$css: true\n },\n negative: {\n kWkggS: \"xkz0cvf\",\n kMwMTN: \"xylzu7l\",\n $$css: true\n },\n positive: {\n kWkggS: \"xa3zu90\",\n kMwMTN: \"x1di7zbg\",\n $$css: true\n },\n primary: {\n kWkggS: \"xp89om9\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n },\n secondary: {\n kWkggS: \"x15dekr4\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n sm: {\n kZKoxP: \"xc9qbxq\",\n kGuDYH: \"xkucv67\",\n kzqmXN: \"x14qfxbe\",\n $$css: true\n },\n square: {\n kaIpWk: \"x1xdvaa9\",\n $$css: true\n },\n tertiary: {\n kWkggS: \"xs6yvni\",\n kMwMTN: \"x3cbcwg\",\n $$css: true\n }\n};\ntype MarkSize = 'lg' | 'md' | 'sm';\ntype MarkTone = 'negative' | 'positive' | 'primary' | 'secondary' | 'tertiary';\nexport type { MarkSize, MarkTone };\nexport { markStyles };"],"mappings":";AA+CA,MAAMK,aAAa;CACjBC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRF,OAAO;CACT;CACAG,SAAS;EACPC,QAAQ;EACRJ,OAAO;CACT;CACAK,OAAO;EACLD,QAAQ;EACRJ,OAAO;CACT;CACAM,UAAU;EACRlB,QAAQ;EACRmB,QAAQ;EACRd,QAAQ;EACRe,QAAQ;EACRX,QAAQ;EACRG,OAAO;CACT;CACAS,OAAO;EACLF,QAAQ;EACRC,QAAQ;EACRR,OAAO;CACT;CACAU,IAAI;EACFH,QAAQ;EACRI,QAAQ;EACRH,QAAQ;EACRR,OAAO;CACT;CACAY,IAAI;EACFL,QAAQ;EACRI,QAAQ;EACRH,QAAQ;EACRR,OAAO;CACT;CACAa,UAAU;EACRC,QAAQ;EACRC,QAAQ;EACRf,OAAO;CACT;CACAgB,UAAU;EACRF,QAAQ;EACRC,QAAQ;EACRf,OAAO;CACT;CACAiB,SAAS;EACPH,QAAQ;EACRC,QAAQ;EACRf,OAAO;CACT;CACAkB,WAAW;EACTJ,QAAQ;EACRC,QAAQ;EACRf,OAAO;CACT;CACAmB,IAAI;EACFZ,QAAQ;EACRI,QAAQ;EACRH,QAAQ;EACRR,OAAO;CACT;CACAoB,QAAQ;EACNlB,QAAQ;EACRF,OAAO;CACT;CACAqB,UAAU;EACRP,QAAQ;EACRC,QAAQ;EACRf,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"styles.js","names":["stylex","colors","radii","typography","FORCED_COLORS","markStyles","base","kGNEyG","kVAM5u","ksu8eU","kMzoRj","kB7OPa","k1xSpc","kmuXW","kMv6JI","k63SB2","kjj79g","kVQacm","kVAEAm","kfSwDN","$$css","circle","kaIpWk","contain","kVIFPx","cover","fallback","kZKoxP","kzqmXN","image","k87sOh","kLqNvP","imagePending","kSiTet","lg","kGuDYH","md","negative","kWkggS","kMwMTN","personGlyph","positive","primary","secondary","sm","square","tertiary","MarkSize","MarkTone"],"sources":["../../src/mark/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, typography } from '../tokens/design.tokens.stylex';\n\n// The box Avatar and ProductIcon draw in, shared so a person and a thing stay\n// the same three sizes in the same five tones, and so either can fill a\n// leading slot without moving what sits beside it. They differ in the two\n// ways that matter for a mark rather than a face, and those are the keys a\n// kind picks between in `./index.tsx`.\n//\n// A person is a circle with the photo cropped to fill it; a thing is a\n// rounded square with its mark letterboxed. A logo is drawn to its own\n// bounding box, so a circle crops the corners it was composed with, and\n// cropping a face loses nothing anyone minds where cropping a wordmark loses\n// the word. The cost of `contain` is letterboxing — a wide mark leaves space\n// above and below — and that is the right trade for a mark whose whole job\n// is to be recognised.\n//\n// That cost is also why a thing's tone tints the fallback rather than the\n// root. A mark letterboxed into the square does not cover it, and neither\n// does one drawn with transparency, so a tint on the root showed as a\n// coloured box around every logo that was not an opaque square. On the\n// fallback it is seen exactly when it is meant to be: while there is no\n// mark, or none has loaded. A photo covers the whole circle, so a person's\n// tone stays on the root.\n//\n// Tones are container/on-container pairs rather than one colour each, so the\n// initials are always a role's own foreground and can't end up unreadable on\n// a tint they were never paired with.\n//\n// Sizes carry their own type size but not their own weight or family: the\n// label face at medium weight holds across all three, so a large mark is\n// bigger initials rather than differently-styled ones.\n//\n// The three are the library's own rather than a spec page's — no Material\n// Design page gives a measurement for one in text; the lists page draws its\n// leading elements in a diagram and tabulates only their padding. So they are\n// stated against the scale the library already has. `md` is 40dp, which is\n// Button's and IconButton's own `md` height, so a mark and a control line up\n// in a row. `lg` is 56dp. `sm` is 36dp, between the 32dp a chip and an `xs`\n// control take and that 40dp default, for a row that wants a person smaller\n// than the button beside them.\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst markStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1w1tqly\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x13rsnn2\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kMv6JI: \"xkknnkr\",\n k63SB2: \"x1bf3uqz\",\n kjj79g: \"xl56j7k\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x1n2onr6\",\n kfSwDN: \"x87ps6o\",\n $$css: true\n },\n circle: {\n kaIpWk: \"x16fbrrb\",\n $$css: true\n },\n contain: {\n kVIFPx: \"x19kjcj4\",\n $$css: true\n },\n cover: {\n kVIFPx: \"xl1xv1r\",\n $$css: true\n },\n fallback: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x5yr21d\",\n k1xSpc: \"x78zum5\",\n kzqmXN: \"xh8yej3\",\n kjj79g: \"xl56j7k\",\n $$css: true\n },\n image: {\n kZKoxP: \"x5yr21d\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"xh8yej3\",\n k87sOh: \"x13vifvy\",\n kLqNvP: \"x1o0tod\",\n kVAEAm: \"x10l6tqk\",\n $$css: true\n },\n imagePending: {\n kSiTet: \"xg01cxk\",\n $$css: true\n },\n lg: {\n kZKoxP: \"xnnlda6\",\n kGuDYH: \"x1848etk\",\n kzqmXN: \"x15yg21f\",\n $$css: true\n },\n md: {\n kZKoxP: \"x1vqgdyp\",\n kGuDYH: \"x14zspaw\",\n kzqmXN: \"x100vrsf\",\n $$css: true\n },\n negative: {\n kWkggS: \"xkz0cvf\",\n kMwMTN: \"xylzu7l\",\n $$css: true\n },\n personGlyph: {\n kZKoxP: \"x39lw6i\",\n kzqmXN: \"xycev2y\",\n $$css: true\n },\n positive: {\n kWkggS: \"xa3zu90\",\n kMwMTN: \"x1di7zbg\",\n $$css: true\n },\n primary: {\n kWkggS: \"xp89om9\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n },\n secondary: {\n kWkggS: \"x15dekr4\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n sm: {\n kZKoxP: \"xc9qbxq\",\n kGuDYH: \"xkucv67\",\n kzqmXN: \"x14qfxbe\",\n $$css: true\n },\n square: {\n kaIpWk: \"x1xdvaa9\",\n $$css: true\n },\n tertiary: {\n kWkggS: \"xs6yvni\",\n kMwMTN: \"x3cbcwg\",\n $$css: true\n }\n};\ntype MarkSize = 'lg' | 'md' | 'sm';\ntype MarkTone = 'negative' | 'positive' | 'primary' | 'secondary' | 'tertiary';\nexport type { MarkSize, MarkTone };\nexport { markStyles };"],"mappings":";AA+CA,MAAMK,aAAa;CACjBC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRF,OAAO;CACT;CACAG,SAAS;EACPC,QAAQ;EACRJ,OAAO;CACT;CACAK,OAAO;EACLD,QAAQ;EACRJ,OAAO;CACT;CACAM,UAAU;EACRnB,QAAQ;EACRoB,QAAQ;EACRf,QAAQ;EACRgB,QAAQ;EACRZ,QAAQ;EACRI,OAAO;CACT;CACAS,OAAO;EACLF,QAAQ;EACRhB,QAAQ;EACRiB,QAAQ;EACRE,QAAQ;EACRC,QAAQ;EACRb,QAAQ;EACRE,OAAO;CACT;CACAY,cAAc;EACZC,QAAQ;EACRb,OAAO;CACT;CACAc,IAAI;EACFP,QAAQ;EACRQ,QAAQ;EACRP,QAAQ;EACRR,OAAO;CACT;CACAgB,IAAI;EACFT,QAAQ;EACRQ,QAAQ;EACRP,QAAQ;EACRR,OAAO;CACT;CACAiB,UAAU;EACRC,QAAQ;EACRC,QAAQ;EACRnB,OAAO;CACT;CACAoB,aAAa;EACXb,QAAQ;EACRC,QAAQ;EACRR,OAAO;CACT;CACAqB,UAAU;EACRH,QAAQ;EACRC,QAAQ;EACRnB,OAAO;CACT;CACAsB,SAAS;EACPJ,QAAQ;EACRC,QAAQ;EACRnB,OAAO;CACT;CACAuB,WAAW;EACTL,QAAQ;EACRC,QAAQ;EACRnB,OAAO;CACT;CACAwB,IAAI;EACFjB,QAAQ;EACRQ,QAAQ;EACRP,QAAQ;EACRR,OAAO;CACT;CACAyB,QAAQ;EACNvB,QAAQ;EACRF,OAAO;CACT;CACA0B,UAAU;EACRR,QAAQ;EACRC,QAAQ;EACRnB,OAAO;CACT;AACF"}
@@ -0,0 +1,24 @@
1
+ import { c } from "react/compiler-runtime";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { SeparatorContext } from "react-aria-components";
4
+ //#region src/overlay/index.tsx
5
+ const NO_SEPARATOR = {};
6
+ /** Clears, for an overlay's content, the contexts that reach it from outside. */
7
+ function OverlayScope(t0) {
8
+ const $ = c(2);
9
+ const { children } = t0;
10
+ let t1;
11
+ if ($[0] !== children) {
12
+ t1 = /* @__PURE__ */ jsx(SeparatorContext, {
13
+ value: NO_SEPARATOR,
14
+ children
15
+ });
16
+ $[0] = children;
17
+ $[1] = t1;
18
+ } else t1 = $[1];
19
+ return t1;
20
+ }
21
+ //#endregion
22
+ export { OverlayScope };
23
+
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ReactNode","SeparatorContext","NO_SEPARATOR","OverlayScope","t0","$","_c","children","t1","_c"],"sources":["../../src/overlay/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport { SeparatorContext } from 'react-aria-components'\n\n// React context crosses the portal an overlay renders through, so what a\n// component around the trigger sets for its own children reaches into the\n// overlay as well. `Toolbar` sets the one that matters: it turns a\n// `Separator` across the bar, and a horizontal rule in a popover opened from\n// the bar took that orientation and drew as a vertical rule 0px long, told\n// to assistive technology as vertical too. An overlay is a surface of its\n// own, so its content starts from none of it, and a `Separator` there falls\n// back to its own horizontal default — as one inside React Aria's `Menu`\n// already did, since `Menu` provides a separator context of its own.\n//\n// Empty rather than null, so the separator reads no props from it rather\n// than finding no context and looking further out; a module constant, so the\n// value is the same object on every render.\nconst NO_SEPARATOR = {}\n\n/** Clears, for an overlay's content, the contexts that reach it from outside. */\nfunction OverlayScope({ children }: { children: ReactNode }) {\n return <SeparatorContext value={NO_SEPARATOR}>{children}</SeparatorContext>\n}\n\nexport { OverlayScope }\n"],"mappings":";;;;AAiBA,MAAME,eAAe,CAAC;;AAGtB,SAAAC,aAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAsB,MAAA,EAAAC,aAAAH;CAAqC,IAAAI;CAAA,IAAAH,EAAA,OAAAE,UAAA;EAClDC,KAAA,oBAAC,kBAAD;GAAyBN,OAAAA;GAAeK;EAAvB,CAAA;EAAmDF,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAApEG;AAAoE"}
@@ -0,0 +1,19 @@
1
+ //#region src/styles/scheme.ts
2
+ const pinnedScheme = {
3
+ dark: {
4
+ kWkggS: "x14s9m32",
5
+ kMwMTN: "x139gbkf",
6
+ kQNsl9: "xntwwlm",
7
+ $$css: true
8
+ },
9
+ light: {
10
+ kWkggS: "x14s9m32",
11
+ kMwMTN: "x139gbkf",
12
+ kQNsl9: "x19aimcq",
13
+ $$css: true
14
+ }
15
+ };
16
+ //#endregion
17
+ export { pinnedScheme };
18
+
19
+ //# sourceMappingURL=scheme.js.map