@kanso-labs/react-native-kanso-ui 0.11.24 → 0.11.26
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/README.md +27 -0
- package/dist/calendar/index.js +105 -41
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +7 -0
- package/dist/calendar/styles.js.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -2
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/carousel/index.d.ts +24 -3
- package/dist/components/carousel/index.js +58 -35
- package/dist/components/carousel/index.js.map +1 -1
- package/dist/components/color-picker/index.js +98 -93
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/dialog/index.js +7 -2
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +2 -2
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/search-view/index.js.map +1 -1
- package/dist/components/segmented-button/index.js +108 -88
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/sheet/index.js +8 -4
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/table/index.js +1 -0
- package/dist/components/table/index.js.map +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js +112 -161
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +4 -0
- package/dist/field/styles.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/number/parser.js +3 -3
- package/dist/number/parser.js.map +1 -1
- package/dist/overlay/keyboard.js +100 -27
- package/dist/overlay/keyboard.js.map +1 -1
- package/dist/segments/index.js +1 -1
- package/dist/segments/index.js.map +1 -1
- package/package.json +15 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","HostInstance","StyleProp","TextStyle","View","ViewStyle","Color","ColorPickerState","useRef","useState","NativeView","Pressable","StyleSheet","Text","parseColor","useColorPickerState","useOverlayTriggerState","PickedColor","useLocaleOf","useMessages","PickerPopup","hitSlop","usePressFeedback","refsOf","colorNameOf","PickedColorContext","withOpacity","useTheme","composeStyles","themedStyles","useTypeRole","ColorArea","ColorField","ColorSlider","ColorSwatch","SWATCH","SURFACE_WIDTH","CHANNELS","stylesOf","colors","radii","spacing","stateLayerOpacity","create","body","boxSizing","gap","md","maxWidth","padding","lg","width","disabled","backgroundColor","onSurface","disabledContainer","swatch","height","trigger","alignItems","alignSelf","surfaceContainerLow","borderRadius","pill","flexDirection","sm","paddingHorizontal","paddingVertical","ColorPickerProps","alpha","children","defaultOpen","defaultValue","isDisabled","isOpen","label","onChange","value","onOpenChange","ref","style","testID","ColorPicker","t0","$","_c","t1","t2","undefined","theme","styles","locale","messages","labelRole","t3","state","t4","overlay","close","open","show","anchor","setTrigger","t5","t6","color","corners","feedback","t7","transparent","name","T0","t8","handlers","t9","t10","t11","t12","t13","t14","t15","ring","t16","layer","t17","t18","disabledContent","t19","t20","t21","t22","pickedOf","t23","getChannelName","t24","t25","t26","setColor","_c","NativeView"],"sources":["../../../src/components/color-picker/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n HostInstance,\n StyleProp,\n TextStyle,\n View,\n ViewStyle,\n} from 'react-native'\nimport type { Color } from 'react-stately'\nimport type { ColorPickerState } from 'react-stately/useColorPickerState'\n\nimport { useRef, useState } from 'react'\nimport { View as NativeView, Pressable, StyleSheet, Text } from 'react-native'\nimport { parseColor } from 'react-stately'\nimport { useColorPickerState } from 'react-stately/useColorPickerState'\nimport { useOverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport type { PickedColor } from '../../swatch'\n\nimport { useLocaleOf, useMessages } from '../../i18n/provider'\nimport { PickerPopup } from '../../picker'\nimport { hitSlop, usePressFeedback } from '../../press'\nimport { refsOf } from '../../ref'\nimport { colorNameOf, PickedColorContext } from '../../swatch'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\nimport { ColorArea } from '../color-area'\nimport { ColorField } from '../color-field'\nimport { ColorSlider } from '../color-slider'\nimport { ColorSwatch } from '../color-swatch'\n\n// Every colour control in one, as kanso-ui's ColorPicker composes them: a\n// swatch and a label as the trigger, and a plane, a hue slider, an alpha\n// slider and a hex field on the surface it opens. The value is React\n// Stately's `useColorPickerState`, which the controls on the surface take\n// through src/swatch's PickedColorContext, as React Aria's picker hands its\n// value to each control's context on web. So an arrangement passed as\n// `children` shares the value the same way, whatever it holds.\n//\n// Material Design carries no page for a colour picker. What it does carry is\n// the text fields page, which the field inside draws through, and the surface\n// a date picker opens on, which this one shares through src/picker. Three\n// choices are web's own, and kept.\n//\n// **The trigger is a swatch beside a name, not a swatch alone.** A swatch on\n// its own is a coloured square with no affordance, and a screen reader would\n// be told a colour rather than an action. It is a pill on surface container\n// low, the swatch at 24dp, the height of the label's line rather than a\n// swatch's own 40dp, and the label in label large, with the state layer and\n// ripple every control here draws in on surface. A screen reader hears the\n// label and then the colour, \"Label, dark purple\", where web's reads the\n// swatch's name first: the visible label leads, so a voice command that says\n// it finds the button.\n//\n// **Hue is a slider rather than a wheel.** A wheel and the plane want the\n// same room, and would make the surface square and large; the strip sits\n// under the plane at the width it already has. ColorWheel is for a picker\n// that wants to be round, which a call site builds as `children`.\n//\n// **It is docked from the medium window size up and modal below it**, the\n// date picker's pairing, through the same src/picker surface: a 280dp\n// surface anchored to a trigger is out of reach on a phone, and a centred one\n// on a tablet covers a form for no reason. Its dismissal, its motion and\n// where a screen reader goes are the date picker's.\n//\n// One thing the picker does that its parts do not. **The plane and the hue\n// slider are read in HSL.** A channel has to belong to the value's own space\n// or React Stately throws, and a hex is read as RGB, which has no saturation,\n// so `<ColorPicker defaultValue=\"#6750A4\" />` would throw outright. Reading\n// the two in HSL is what lets the picker take any notation. A change made on\n// either reports the colour in HSL, as React Stately's area and slider do on\n// web, and the field shows it as hex whatever space it is in.\n//\n// **Disabled reaches every control on the surface**, not only the trigger.\n// React Stately's picker state carries no disabled state, and the surface\n// opens independently of the trigger, so a disabled picker can still be on\n// screen: already open when a form disables it, or opened from outside. An\n// arrangement passed as `children` is the call site's own to disable.\n\n// The swatch in the trigger, at the height of the label's line rather than\n// the 40dp a swatch takes on its own.\nconst SWATCH = 24\n\n// The surface's width, as web's: room for the plane and a hex field.\nconst SURFACE_WIDTH = 280\n\n// Any HSL colour names the channels the two sliders draw. Their labels are\n// read off it in the locale, as React Stately words them, rather than written\n// here in English.\nconst CHANNELS = parseColor('hsl(0, 0%, 0%)')\n\nconst stylesOf = themedStyles(({ colors, radii, spacing, stateLayerOpacity }) =>\n StyleSheet.create({\n // What the surface holds, stacked: the plane, the sliders, then the\n // field. One column, so a picker reads top to bottom.\n body: {\n boxSizing: 'border-box',\n gap: spacing.md,\n maxWidth: '100%',\n padding: spacing.lg,\n width: SURFACE_WIDTH,\n },\n disabled: {\n backgroundColor: withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContainer,\n ),\n },\n swatch: {\n height: SWATCH,\n width: SWATCH,\n },\n trigger: {\n alignItems: 'center',\n alignSelf: 'flex-start',\n backgroundColor: colors.surfaceContainerLow,\n borderRadius: radii.pill,\n boxSizing: 'border-box',\n flexDirection: 'row',\n gap: spacing.sm,\n paddingHorizontal: spacing.md,\n paddingVertical: spacing.sm,\n },\n }),\n)\n\ntype ColorPickerProps = {\n /** Whether the alpha slider is drawn under the hue one. @default false */\n readonly alpha?: boolean\n /**\n * Replaces everything on the surface, for a picker that arranges its own\n * parts. The colour controls in it take the picker's value.\n */\n readonly children?: ReactNode\n /** Whether the surface starts open, when the picker keeps its own open state. */\n readonly defaultOpen?: boolean\n /**\n * The colour the picker holds at first, when it keeps its own: a CSS colour\n * string, or a `Color` from `parseColor`.\n * @default '#000000'\n */\n readonly defaultValue?: Color | string\n /**\n * Whether the whole picker is inert: the trigger, and the plane, sliders\n * and field on the surface, which can be on screen while disabled since\n * the surface opens independently of the trigger. An arrangement passed as\n * `children` is the call site's own to disable.\n * @default false\n */\n readonly isDisabled?: boolean\n /** Whether the surface is open, for a call site holding it with `onOpenChange`. */\n readonly isOpen?: boolean\n /**\n * What the trigger says beside its swatch. Required: it is the button's\n * name, the surface's and the field's.\n */\n readonly label: string\n /** Called with the colour each time a control on the surface changes it. */\n readonly onChange?: (value: Color) => void\n /** Called when the surface opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n /** The colour, for a call site holding it itself with `onChange`. */\n readonly value?: Color | string\n}\n\n/**\n * A colour picked from a plane, a hue slider and a hex field, behind a\n * trigger showing the colour. Pass `value` with `onChange` to control it, or\n * `defaultValue`, as a CSS colour string or a `Color` from `parseColor`,\n * which this package re-exports.\n *\n * ```tsx\n * <ColorPicker defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * `alpha` adds the transparency slider. From the medium window size up the\n * surface is docked under the trigger; below it, it opens centred over a\n * scrim, as a date picker's does. `defaultOpen`, `isOpen` and `onOpenChange`\n * reach the surface.\n *\n * Every part on the surface is this package's own, `ColorArea`,\n * `ColorSlider` and `ColorField`, and they share the picker's value rather\n * than taking it as props. Passing `children` replaces all of them, and a\n * `ColorArea`, `ColorField`, `ColorSlider`, `ColorSwatch`,\n * `ColorSwatchPicker` or `ColorWheel` among them takes the picker's value\n * where it is given none of its own.\n *\n * `style`, `ref` and `testID` land on the trigger, which is what a layout\n * places.\n */\nfunction ColorPicker({\n alpha = false,\n children,\n defaultOpen,\n defaultValue,\n isDisabled = false,\n isOpen,\n label,\n onChange,\n onOpenChange,\n ref,\n style,\n testID,\n value,\n}: ColorPickerProps) {\n const theme = useTheme()\n const { colors, radii, spacing, stateLayerOpacity } = theme\n const styles = stylesOf(theme)\n const locale = useLocaleOf(undefined)\n const messages = useMessages()\n const labelRole = useTypeRole('labelLarge')\n const state = useColorPickerState({ defaultValue, onChange, value })\n const overlay = useOverlayTriggerState({ defaultOpen, isOpen, onOpenChange })\n // oxlint-disable-next-line typescript/unbound-method -- React Stately's setters are callbacks, and read no `this`\n const { close, open: show } = overlay\n const anchor = useRef<HostInstance | null>(null)\n const [trigger, setTrigger] = useState<HostInstance | null>(null)\n const feedback = usePressFeedback({\n color: colors.onSurface,\n corners: { borderRadius: radii.pill },\n disabled: isDisabled,\n })\n const name = colorNameOf(state.color, locale, messages.transparent)\n\n return (\n <>\n <Pressable\n {...feedback.handlers}\n aria-expanded={overlay.isOpen}\n aria-label={`${label}, ${name}`}\n disabled={isDisabled}\n hitSlop={hitSlop(SWATCH + 2 * spacing.sm)}\n onPress={show}\n ref={refsOf<HostInstance>(ref, anchor, setTrigger)}\n role=\"button\"\n style={composeStyles<ViewStyle>(\n styles.trigger,\n isDisabled ? styles.disabled : undefined,\n feedback.ring,\n style,\n )}\n testID={testID}\n >\n {feedback.layer}\n <ColorSwatch color={state.color} style={styles.swatch} />\n <Text\n style={composeStyles<TextStyle>(labelRole, {\n color: isDisabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : colors.onSurface,\n })}\n >\n {label}\n </Text>\n </Pressable>\n <PickerPopup\n anchor={anchor}\n close={close}\n isOpen={overlay.isOpen}\n label={label}\n trigger={trigger}\n >\n {/*\n Inside the surface rather than around the picker, since the surface\n is drawn in the overlay host, which context set around the picker\n does not reach.\n */}\n <PickedColorContext value={pickedOf(state)}>\n {children ?? (\n <NativeView style={styles.body}>\n <ColorArea\n aria-label={label}\n colorSpace=\"hsl\"\n isDisabled={isDisabled}\n xChannel=\"saturation\"\n yChannel=\"lightness\"\n />\n <ColorSlider\n channel=\"hue\"\n colorSpace=\"hsl\"\n isDisabled={isDisabled}\n label={CHANNELS.getChannelName('hue', locale)}\n />\n {alpha ? (\n <ColorSlider\n channel=\"alpha\"\n isDisabled={isDisabled}\n label={CHANNELS.getChannelName('alpha', locale)}\n />\n ) : null}\n <ColorField isDisabled={isDisabled} label={label} />\n </NativeView>\n )}\n </PickedColorContext>\n </PickerPopup>\n </>\n )\n}\n\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's jsx-no-new-object-as-prop is after; the React Compiler\n// memoises the result on its inputs.\nfunction pickedOf(state: ColorPickerState): PickedColor {\n return {\n onChange: (color) => {\n state.setColor(color)\n },\n value: state.color,\n }\n}\n\nexport { ColorPicker }\nexport type { ColorPickerProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmFA,MAAMqC,SAAS;AAGf,MAAMC,gBAAgB;AAKtB,MAAMC,WAAWvB,WAAW,gBAAgB;AAE5C,MAAMwB,WAAWT,cAAc,EAAEU,QAAQC,OAAOC,SAASC,wBACvD9B,WAAW+B,OAAO;CAGhBC,MAAM;EACJC,WAAW;EACXC,KAAKL,QAAQM;EACbC,UAAU;EACVC,SAASR,QAAQS;EACjBC,OAAOf;CACT;CACAgB,UAAU,EACRC,iBAAiB3B,YACfa,OAAOe,WACPZ,kBAAkBa,iBACpB,EACF;CACAC,QAAQ;EACNC,QAAQtB;EACRgB,OAAOhB;CACT;CACAuB,SAAS;EACPC,YAAY;EACZC,WAAW;EACXP,iBAAiBd,OAAOsB;EACxBC,cAActB,MAAMuB;EACpBlB,WAAW;EACXmB,eAAe;EACflB,KAAKL,QAAQwB;EACbC,mBAAmBzB,QAAQM;EAC3BoB,iBAAiB1B,QAAQwB;CAC3B;AACF,CAAC,CACH;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,SAAAiB,YAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAqB,MAAA,EAAAhB,OAAAiB,IAAAhB,UAAAC,aAAAC,cAAAC,YAAAc,IAAAb,QAAAC,OAAAC,UAAAE,cAAAC,KAAAC,OAAAC,QAAAJ,UAAAM;CACnB,MAAAd,QAAAiB,OAAAE,KAAAA,IAAA,QAAAF;CAIA,MAAAb,aAAAc,OAAAC,KAAAA,IAAA,QAAAD;CAUA,MAAAE,QAAc9D,SAAS;CACvB,MAAA,EAAAY,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ef","ReactNode","Ref","HostInstance","StyleProp","TextStyle","View","ViewStyle","Color","ColorPickerState","useRef","useState","NativeView","Pressable","StyleSheet","Text","parseColor","useColorPickerState","useOverlayTriggerState","PickedColor","useLocaleOf","useMessages","PickerPopup","hitSlop","usePressFeedback","refsOf","colorNameOf","PickedColorContext","withOpacity","useTheme","composeStyles","themedStyles","useTypeRole","ColorArea","ColorField","ColorSlider","ColorSwatch","SWATCH","SURFACE_WIDTH","CHANNELS","stylesOf","colors","radii","spacing","stateLayerOpacity","create","body","boxSizing","gap","md","maxWidth","padding","lg","width","disabled","backgroundColor","onSurface","disabledContainer","swatch","height","swatchDisabled","opacity","disabledContent","trigger","alignItems","alignSelf","surfaceContainerLow","borderRadius","pill","flexDirection","sm","paddingHorizontal","paddingVertical","ColorPickerProps","alpha","children","defaultOpen","defaultValue","isDisabled","isOpen","label","onChange","value","onOpenChange","ref","style","testID","ColorPicker","t0","$","_c","t1","t2","undefined","theme","styles","locale","messages","labelRole","t3","state","t4","overlay","close","open","show","anchor","setTrigger","t5","t6","color","corners","feedback","t7","transparent","name","T0","t8","handlers","t9","t10","t11","t12","t13","t14","t15","ring","t16","layer","T1","t17","t18","t19","t20","t21","t22","t23","t24","pickedOf","t25","getChannelName","t26","t27","t28","setColor","_c","NativeView"],"sources":["../../../src/components/color-picker/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n HostInstance,\n StyleProp,\n TextStyle,\n View,\n ViewStyle,\n} from 'react-native'\nimport type { Color } from 'react-stately'\nimport type { ColorPickerState } from 'react-stately/useColorPickerState'\n\nimport { useRef, useState } from 'react'\nimport { View as NativeView, Pressable, StyleSheet, Text } from 'react-native'\nimport { parseColor } from 'react-stately'\nimport { useColorPickerState } from 'react-stately/useColorPickerState'\nimport { useOverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport type { PickedColor } from '../../swatch'\n\nimport { useLocaleOf, useMessages } from '../../i18n/provider'\nimport { PickerPopup } from '../../picker'\nimport { hitSlop, usePressFeedback } from '../../press'\nimport { refsOf } from '../../ref'\nimport { colorNameOf, PickedColorContext } from '../../swatch'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\nimport { ColorArea } from '../color-area'\nimport { ColorField } from '../color-field'\nimport { ColorSlider } from '../color-slider'\nimport { ColorSwatch } from '../color-swatch'\n\n// Every colour control in one, as kanso-ui's ColorPicker composes them: a\n// swatch and a label as the trigger, and a plane, a hue slider, an alpha\n// slider and a hex field on the surface it opens. The value is React\n// Stately's `useColorPickerState`, which the controls on the surface take\n// through src/swatch's PickedColorContext, as React Aria's picker hands its\n// value to each control's context on web. So an arrangement passed as\n// `children` shares the value the same way, whatever it holds.\n//\n// Material Design carries no page for a colour picker. What it does carry is\n// the text fields page, which the field inside draws through, and the surface\n// a date picker opens on, which this one shares through src/picker. Three\n// choices are web's own, and kept.\n//\n// **The trigger is a swatch beside a name, not a swatch alone.** A swatch on\n// its own is a coloured square with no affordance, and a screen reader would\n// be told a colour rather than an action. It is a pill on surface container\n// low, the swatch at 24dp, the height of the label's line rather than a\n// swatch's own 40dp, and the label in label large, with the state layer and\n// ripple every control here draws in on surface. A screen reader hears the\n// label and then the colour, \"Label, dark purple\", where web's reads the\n// swatch's name first: the visible label leads, so a voice command that says\n// it finds the button.\n//\n// **Hue is a slider rather than a wheel.** A wheel and the plane want the\n// same room, and would make the surface square and large; the strip sits\n// under the plane at the width it already has. ColorWheel is for a picker\n// that wants to be round, which a call site builds as `children`.\n//\n// **It is docked from the medium window size up and modal below it**, the\n// date picker's pairing, through the same src/picker surface: a 280dp\n// surface anchored to a trigger is out of reach on a phone, and a centred one\n// on a tablet covers a form for no reason. Its dismissal, its motion and\n// where a screen reader goes are the date picker's.\n//\n// One thing the picker does that its parts do not. **The plane and the hue\n// slider are read in HSL.** A channel has to belong to the value's own space\n// or React Stately throws, and a hex is read as RGB, which has no saturation,\n// so `<ColorPicker defaultValue=\"#6750A4\" />` would throw outright. Reading\n// the two in HSL is what lets the picker take any notation. A change made on\n// either reports the colour in HSL, as React Stately's area and slider do on\n// web, and the field shows it as hex whatever space it is in.\n//\n// **Disabled reaches every control on the surface**, not only the trigger.\n// React Stately's picker state carries no disabled state, and the surface\n// opens independently of the trigger, so a disabled picker can still be on\n// screen: already open when a form disables it, or opened from outside. An\n// arrangement passed as `children` is the call site's own to disable.\n\n// The swatch in the trigger, at the height of the label's line rather than\n// the 40dp a swatch takes on its own.\nconst SWATCH = 24\n\n// The surface's width, as web's: room for the plane and a hex field.\nconst SURFACE_WIDTH = 280\n\n// Any HSL colour names the channels the two sliders draw. Their labels are\n// read off it in the locale, as React Stately words them, rather than written\n// here in English.\nconst CHANNELS = parseColor('hsl(0, 0%, 0%)')\n\nconst stylesOf = themedStyles(({ colors, radii, spacing, stateLayerOpacity }) =>\n StyleSheet.create({\n // What the surface holds, stacked: the plane, the sliders, then the\n // field. One column, so a picker reads top to bottom.\n body: {\n boxSizing: 'border-box',\n gap: spacing.md,\n maxWidth: '100%',\n padding: spacing.lg,\n width: SURFACE_WIDTH,\n },\n disabled: {\n backgroundColor: withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContainer,\n ),\n },\n swatch: {\n height: SWATCH,\n width: SWATCH,\n },\n // Laid over the swatch while the trigger is disabled, at the opacity a\n // disabled label's colour mixes at, so the swatch fades with the label\n // and the trigger does not read as half enabled.\n swatchDisabled: {\n opacity: stateLayerOpacity.disabledContent,\n },\n trigger: {\n alignItems: 'center',\n alignSelf: 'flex-start',\n backgroundColor: colors.surfaceContainerLow,\n borderRadius: radii.pill,\n boxSizing: 'border-box',\n flexDirection: 'row',\n gap: spacing.sm,\n paddingHorizontal: spacing.md,\n paddingVertical: spacing.sm,\n },\n }),\n)\n\ntype ColorPickerProps = {\n /** Whether the alpha slider is drawn under the hue one. @default false */\n readonly alpha?: boolean\n /**\n * Replaces everything on the surface, for a picker that arranges its own\n * parts. The colour controls in it take the picker's value.\n */\n readonly children?: ReactNode\n /** Whether the surface starts open, when the picker keeps its own open state. */\n readonly defaultOpen?: boolean\n /**\n * The colour the picker holds at first, when it keeps its own: a CSS colour\n * string, or a `Color` from `parseColor`.\n * @default '#000000'\n */\n readonly defaultValue?: Color | string\n /**\n * Whether the whole picker is inert: the trigger, and the plane, sliders\n * and field on the surface, which can be on screen while disabled since\n * the surface opens independently of the trigger. An arrangement passed as\n * `children` is the call site's own to disable.\n * @default false\n */\n readonly isDisabled?: boolean\n /** Whether the surface is open, for a call site holding it with `onOpenChange`. */\n readonly isOpen?: boolean\n /**\n * What the trigger says beside its swatch. Required: it is the button's\n * name, the surface's and the field's.\n */\n readonly label: string\n /** Called with the colour each time a control on the surface changes it. */\n readonly onChange?: (value: Color) => void\n /** Called when the surface opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n /** The colour, for a call site holding it itself with `onChange`. */\n readonly value?: Color | string\n}\n\n/**\n * A colour picked from a plane, a hue slider and a hex field, behind a\n * trigger showing the colour. Pass `value` with `onChange` to control it, or\n * `defaultValue`, as a CSS colour string or a `Color` from `parseColor`,\n * which this package re-exports.\n *\n * ```tsx\n * <ColorPicker defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * `alpha` adds the transparency slider. From the medium window size up the\n * surface is docked under the trigger; below it, it opens centred over a\n * scrim, as a date picker's does. `defaultOpen`, `isOpen` and `onOpenChange`\n * reach the surface.\n *\n * Every part on the surface is this package's own, `ColorArea`,\n * `ColorSlider` and `ColorField`, and they share the picker's value rather\n * than taking it as props. Passing `children` replaces all of them, and a\n * `ColorArea`, `ColorField`, `ColorSlider`, `ColorSwatch`,\n * `ColorSwatchPicker` or `ColorWheel` among them takes the picker's value\n * where it is given none of its own.\n *\n * `style`, `ref` and `testID` land on the trigger, which is what a layout\n * places.\n */\nfunction ColorPicker({\n alpha = false,\n children,\n defaultOpen,\n defaultValue,\n isDisabled = false,\n isOpen,\n label,\n onChange,\n onOpenChange,\n ref,\n style,\n testID,\n value,\n}: ColorPickerProps) {\n const theme = useTheme()\n const { colors, radii, spacing, stateLayerOpacity } = theme\n const styles = stylesOf(theme)\n const locale = useLocaleOf(undefined)\n const messages = useMessages()\n const labelRole = useTypeRole('labelLarge')\n const state = useColorPickerState({ defaultValue, onChange, value })\n const overlay = useOverlayTriggerState({ defaultOpen, isOpen, onOpenChange })\n // oxlint-disable-next-line typescript/unbound-method -- React Stately's setters are callbacks, and read no `this`\n const { close, open: show } = overlay\n const anchor = useRef<HostInstance | null>(null)\n const [trigger, setTrigger] = useState<HostInstance | null>(null)\n const feedback = usePressFeedback({\n color: colors.onSurface,\n corners: { borderRadius: radii.pill },\n disabled: isDisabled,\n })\n const name = colorNameOf(state.color, locale, messages.transparent)\n\n return (\n <>\n <Pressable\n {...feedback.handlers}\n aria-expanded={overlay.isOpen}\n aria-label={`${label}, ${name}`}\n disabled={isDisabled}\n hitSlop={hitSlop(SWATCH + 2 * spacing.sm)}\n onPress={show}\n ref={refsOf<HostInstance>(ref, anchor, setTrigger)}\n role=\"button\"\n style={composeStyles<ViewStyle>(\n styles.trigger,\n isDisabled ? styles.disabled : undefined,\n feedback.ring,\n style,\n )}\n testID={testID}\n >\n {feedback.layer}\n <ColorSwatch\n color={state.color}\n style={composeStyles<ViewStyle>(\n styles.swatch,\n isDisabled ? styles.swatchDisabled : undefined,\n )}\n />\n <Text\n style={composeStyles<TextStyle>(labelRole, {\n color: isDisabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : colors.onSurface,\n })}\n >\n {label}\n </Text>\n </Pressable>\n <PickerPopup\n anchor={anchor}\n close={close}\n isOpen={overlay.isOpen}\n label={label}\n trigger={trigger}\n >\n {/*\n Inside the surface rather than around the picker, since the surface\n is drawn in the overlay host, which context set around the picker\n does not reach.\n */}\n <PickedColorContext value={pickedOf(state)}>\n {children ?? (\n <NativeView style={styles.body}>\n <ColorArea\n aria-label={label}\n colorSpace=\"hsl\"\n isDisabled={isDisabled}\n xChannel=\"saturation\"\n yChannel=\"lightness\"\n />\n <ColorSlider\n channel=\"hue\"\n colorSpace=\"hsl\"\n isDisabled={isDisabled}\n label={CHANNELS.getChannelName('hue', locale)}\n />\n {alpha ? (\n <ColorSlider\n channel=\"alpha\"\n isDisabled={isDisabled}\n label={CHANNELS.getChannelName('alpha', locale)}\n />\n ) : null}\n <ColorField isDisabled={isDisabled} label={label} />\n </NativeView>\n )}\n </PickedColorContext>\n </PickerPopup>\n </>\n )\n}\n\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's jsx-no-new-object-as-prop is after; the React Compiler\n// memoises the result on its inputs.\nfunction pickedOf(state: ColorPickerState): PickedColor {\n return {\n onChange: (color) => {\n state.setColor(color)\n },\n value: state.color,\n }\n}\n\nexport { ColorPicker }\nexport type { ColorPickerProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmFA,MAAMqC,SAAS;AAGf,MAAMC,gBAAgB;AAKtB,MAAMC,WAAWvB,WAAW,gBAAgB;AAE5C,MAAMwB,WAAWT,cAAc,EAAEU,QAAQC,OAAOC,SAASC,wBACvD9B,WAAW+B,OAAO;CAGhBC,MAAM;EACJC,WAAW;EACXC,KAAKL,QAAQM;EACbC,UAAU;EACVC,SAASR,QAAQS;EACjBC,OAAOf;CACT;CACAgB,UAAU,EACRC,iBAAiB3B,YACfa,OAAOe,WACPZ,kBAAkBa,iBACpB,EACF;CACAC,QAAQ;EACNC,QAAQtB;EACRgB,OAAOhB;CACT;CAIAuB,gBAAgB,EACdC,SAASjB,kBAAkBkB,gBAC7B;CACAC,SAAS;EACPC,YAAY;EACZC,WAAW;EACXV,iBAAiBd,OAAOyB;EACxBC,cAAczB,MAAM0B;EACpBrB,WAAW;EACXsB,eAAe;EACfrB,KAAKL,QAAQ2B;EACbC,mBAAmB5B,QAAQM;EAC3BuB,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a,QAAAvB;EAAAU,EAAA,MAAAoD;EAAApD,EAAA,MAAA1B;EAAA0B,EAAA,MAAAqD;CAAA,OAAAA,MAAArD,EAAA;CAAA,IAAAsD;CAAA,IAAAtD,EAAA,QAAA8C,OAAA9C,EAAA,QAAAqD,KAAA;EA3EhBC,MAAA,qBAAA,YAAA,EAAA,UAAA,CACER,KAmCAO,GAuCc,EAAA,CAAA;EACbrD,EAAA,MAAA8C;EAAA9C,EAAA,MAAAqD;EAAArD,EAAA,MAAAsD;CAAA,OAAAA,MAAAtD,EAAA;CAAA,OA5EHsD;AA4EG;AAOP,SAASL,SAAStC,OAAsC;CACtD,OAAO;EACLnB,WAAW6B,UAAU;GACnBV,MAAM4C,SAASlC,KAAK;EACtB;EACA5B,OAAOkB,MAAMU;CACf;AACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ButtonSlotContext } from "../../button/slots.js";
|
|
2
2
|
import { useWindowSizeClass } from "../../hooks/useWindowSizeClass.js";
|
|
3
3
|
import { ModalWindow, NO_INSETS, insetsOf, panelRoleOf, registerOf, useModalState, useModalTrigger } from "../../modal/index.js";
|
|
4
|
+
import { useKeyboardInset } from "../../overlay/keyboard.js";
|
|
4
5
|
import { refsOf } from "../../ref/index.js";
|
|
5
6
|
import { useTheme } from "../../theme/scope.js";
|
|
6
7
|
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
@@ -334,6 +335,7 @@ function DialogContent(t0) {
|
|
|
334
335
|
const [register] = useState(t5);
|
|
335
336
|
const [title, setTitle] = useState(null);
|
|
336
337
|
const motion = useDialogMotion(state.isOpen, present, setPresent, basic);
|
|
338
|
+
const keyboard = useKeyboardInset(present);
|
|
337
339
|
let t6;
|
|
338
340
|
if ($[15] !== basic || $[16] !== parts || $[17] !== register || $[18] !== titleId) {
|
|
339
341
|
t6 = {
|
|
@@ -356,7 +358,7 @@ function DialogContent(t0) {
|
|
|
356
358
|
const t7 = isDismissable && state.isOpen ? close : void 0;
|
|
357
359
|
const t8 = motion.scrim;
|
|
358
360
|
const T1 = View;
|
|
359
|
-
const t9 = composeStyles(styles.layout, basic ?
|
|
361
|
+
const t9 = composeStyles(styles.layout, basic ? { paddingBottom: theme.spacing.xl + keyboard } : styles.layoutFull);
|
|
360
362
|
const t10 = Animated;
|
|
361
363
|
let t11;
|
|
362
364
|
if ($[20] !== labelledBy || $[21] !== role) {
|
|
@@ -366,7 +368,10 @@ function DialogContent(t0) {
|
|
|
366
368
|
$[22] = t11;
|
|
367
369
|
} else t11 = $[22];
|
|
368
370
|
const t12 = isKeyboardDismissDisabled ? void 0 : close;
|
|
369
|
-
const t13 = composeStyles(styles.container, basic ? styles.containerBasic : styles.containerFull, basic ? void 0 :
|
|
371
|
+
const t13 = composeStyles(styles.container, basic ? styles.containerBasic : styles.containerFull, basic ? void 0 : {
|
|
372
|
+
...insetsOf(insets),
|
|
373
|
+
paddingBottom: Math.max(insets.bottom, keyboard)
|
|
374
|
+
}, motion.panel, style);
|
|
370
375
|
let t14;
|
|
371
376
|
if ($[23] !== children || $[24] !== slots) {
|
|
372
377
|
t14 = /* @__PURE__ */ jsx(ButtonSlotContext, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","HostInstance","LayoutChangeEvent","ScrollViewProps","StyleProp","TextProps","TextStyle","ViewProps","ViewStyle","AnimatedStyle","createContext","use","useCallback","useEffect","useId","useLayoutEffect","useMemo","useState","Text","NativeText","ScrollView","StyleSheet","useWindowDimensions","View","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","SafeAreaInsetsContext","ModalOpenProps","ModalTrigger","ResolvedTheme","ButtonSlotContext","useWindowSizeClass","insetsOf","ModalWindow","NO_INSETS","panelRoleOf","registerOf","useModalState","useModalTrigger","refsOf","useTheme","composeStyles","themedStyles","useTypeRole","MIN_WIDTH","MAX_WIDTH","SCALE_FROM","RISE_FROM","NO_PARTS","Readonly","Record","DialogPart","footer","header","title","stylesOf","colors","radii","shadows","sizing","spacing","create","actions","alignItems","flexDirection","flexShrink","flexWrap","gap","sm","justifyContent","padding","xl","actionsFull","borderTopColor","outlineVariant","borderTopWidth","minHeight","rowSm","paddingVertical","xs","bodyText","color","onSurfaceVariant","container","backgroundColor","surfaceContainerHigh","overflow","containerBasic","borderRadius","boxShadow","elevation3","maxHeight","maxWidth","minWidth","width","containerFull","flex","md","paddingBottom","lg","paddingHorizontal","paddingTop","headerFull","borderBottomColor","borderBottomWidth","layout","bottom","left","pointerEvents","position","right","top","layoutFull","onSurface","DialogLayout","basic","parts","register","part","setTitle","node","titleId","DialogLayoutContext","DialogTriggerContext","DialogBodyProps","ref","DialogContentProps","DialogOpenProps","Omit","children","isDismissable","isKeyboardDismissDisabled","role","style","defaultOpen","isOpen","onOpenChange","DialogPartProps","DialogProps","DialogTitleProps","bodyPaddingOf","Dialog","t0","$","_c","t1","context","slots","t2","t3","DialogBody","contentContainerStyle","onContentSizeChange","onLayout","props","useLayout","theme","styles","text","content","setContent","room","setRoom","height","measureContent","event","nativeEvent","measureRoom","T0","t4","t5","t6","DialogContent","undefined","outer","close","present","setPresent","state","insets","sizeClass","setParts","Symbol","for","motion","useDialogMotion","labelledBy","t7","t8","scrim","T1","t9","t10","t11","t12","t13","panel","t14","t15","t16","t17","t18","DialogFooter","DialogHeader","DialogTitle","reduceMotion","durationMedium1","durationShort2","durationShort3","easingEmphasizedAccelerate","easingEmphasizedDecelerate","easingStandard","fade","duration","easing","bezier","set","timer","setTimeout","Math","max","clearTimeout","shown","get","opacity","transform","scale","translateY","Error","Body","Content","Footer","Header","Title","_c","NativeText"],"sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n HostInstance,\n LayoutChangeEvent,\n ScrollViewProps,\n StyleProp,\n TextProps,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport {\n createContext,\n use,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react'\nimport {\n Text as NativeText,\n ScrollView,\n StyleSheet,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\n\nimport type { ModalOpenProps, ModalTrigger } from '../../modal'\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport { ButtonSlotContext } from '../../button/slots'\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport {\n insetsOf,\n ModalWindow,\n NO_INSETS,\n panelRoleOf,\n registerOf,\n useModalState,\n useModalTrigger,\n} from '../../modal'\nimport { refsOf } from '../../ref'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The dialogs spec page's two dialogs, as kanso-ui's Dialog draws them: one\n// component, since the page pairs them by window size rather than offering a\n// choice. In a medium window or wider it is the basic dialog, a container on\n// surface container high with the 28dp corner, between 280 and 560dp wide,\n// centred over the scrim, with 24dp of padding all round, 16dp between the\n// headline and the body and 24dp between the body and the actions. In a\n// compact window, below 600dp, the same dialog fills the window as the page's\n// full-screen dialog: square corners, a 56dp header with the headline in\n// title large and a divider under it, and a 56dp action bar over a divider,\n// both inside the device's safe area.\n//\n// An alert dialog, `role=\"alertdialog\"`, is a question with two or three\n// answers rather than a task, and stays the basic dialog at every width, as\n// on web, where a question filling a phone read as a headline at the top of\n// the screen and its answers at the bottom with nothing between them.\n//\n// **It is drawn in a React Native `Modal`**, through src/modal, which keeps\n// React context, so the dialog keeps the `ThemeScope` around it, and which is\n// a window of its own on iOS and Android, above the screen and its overlays.\n// The `Modal` therefore hosts overlays of its own, so a snackbar or a popover\n// raised from inside the dialog draws above it rather than under it.\n//\n// **It animates out as well as in**, from the motion tokens: the panel scales\n// up from 90% on the emphasised decelerating curve, or rises 3% of the window\n// when it fills it, and leaves on the emphasised accelerating one, while the\n// scrim fades on the standard curve. Web only animates in, since React Aria\n// keeps a closing surface mounted only while a CSS animation runs; here the\n// dialog stays mounted until its exit has run. Under reduced motion the\n// panel appears and leaves at once, and the scrim still fades, which is what\n// says the dialog came and went.\n//\n// **A press on the scrim closes it**, unless `isDismissable` is false, and\n// Android's back gesture and VoiceOver's escape gesture close it, unless\n// `isKeyboardDismissDisabled`, the prop that keeps Escape from closing it on\n// web, which is the key React Native Web's `Modal` hands the same handler.\n// A button inside `Dialog` and outside its content opens it, and one given\n// `slot=\"close\"` inside the content closes it, through src/button's\n// slots.ts.\n//\n// **Focus moves into the dialog and back.** On iOS and Android the screen\n// reader is sent to the headline once the dialog shows, and back to the\n// button that opened it once it has gone. React Native Web's `Modal` traps\n// focus and restores it itself, and is the dialog element there, so on web it\n// takes the dialog's name and the panel takes no role of its own. That\n// `Modal` sets its role itself, so an alert dialog is announced as a dialog\n// in the web Storybook; kanso-ui, the library for web apps, keeps the role.\n\n// The panel's width bounds, the page's, and how far it travels as it\n// arrives: it scales up from 90% as the basic dialog, or rises 3% of the\n// window as the full-screen one, as web's keyframes have it.\nconst MIN_WIDTH = 280\nconst MAX_WIDTH = 560\nconst SCALE_FROM = 0.9\nconst RISE_FROM = 0.03\n\nconst NO_PARTS: Readonly<Record<DialogPart, number>> = {\n footer: 0,\n header: 0,\n title: 0,\n}\n\nconst stylesOf = themedStyles(\n ({ colors, radii, shadows, sizing, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // The page's 24dp between the body and the actions, and 8dp between\n // the buttons. Actions that do not fit on one row wrap onto another,\n // still at the trailing edge.\n actions: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n gap: spacing.sm,\n justifyContent: 'flex-end',\n padding: spacing.xl,\n },\n // Full screen, the actions are the page's bottom action bar: 56dp at\n // least, over a divider, so an action whose label wraps grows the bar\n // rather than meeting the divider.\n actionsFull: {\n borderTopColor: colors.outlineVariant,\n borderTopWidth: 1,\n minHeight: sizing.rowSm,\n paddingVertical: spacing.xs,\n },\n // The text a body is handed as a string, in the page's body medium on\n // on-surface variant, which is what web's body sets for its text.\n bodyText: {\n color: colors.onSurfaceVariant,\n },\n // Both dialogs' container, whose corner, where it has one, clips the\n // body's scroll.\n container: {\n backgroundColor: colors.surfaceContainerHigh,\n overflow: 'hidden',\n },\n // The basic dialog's container, centred over the scrim and only as\n // tall as the room the scrim's padding leaves, so the body scrolls\n // rather than running off the screen.\n containerBasic: {\n borderRadius: radii.xl,\n boxShadow: shadows.elevation3,\n maxHeight: '100%',\n maxWidth: MAX_WIDTH,\n minWidth: MIN_WIDTH,\n width: '100%',\n },\n // Full screen, the container fills the window with square corners, and\n // its fill runs on under the safe area its content keeps out of.\n containerFull: {\n flex: 1,\n },\n // The page's 24dp above the headline and 16dp between it and the body,\n // with the headline beside whatever else the header holds, a close\n // button for one.\n header: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n gap: spacing.md,\n justifyContent: 'space-between',\n paddingBottom: spacing.lg,\n paddingHorizontal: spacing.xl,\n paddingTop: spacing.xl,\n },\n // Full screen, the header is the page's own 56dp bar, at least, under\n // a divider.\n headerFull: {\n borderBottomColor: colors.outlineVariant,\n borderBottomWidth: 1,\n minHeight: sizing.rowSm,\n paddingBottom: spacing.xs,\n paddingTop: spacing.xs,\n },\n // The scrim centres the container, which is what makes the dialog a\n // dialog rather than a sheet. Full screen it has no room to give. It\n // takes no touches itself, so a press around the container reaches the\n // scrim under it.\n layout: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n padding: spacing.xl,\n pointerEvents: 'box-none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n layoutFull: {\n alignItems: 'stretch',\n padding: 0,\n },\n // The headline gives way to whatever shares its row.\n title: {\n color: colors.onSurface,\n flexShrink: 1,\n },\n }),\n)\n\n// What the content's parts read: which of the two dialogs is drawn, which\n// parts are there, and the headline's name and node.\ntype DialogLayout = {\n readonly basic: boolean\n readonly parts: Readonly<Record<DialogPart, number>>\n readonly register: (part: DialogPart) => () => void\n readonly setTitle: (node: HostInstance | null) => void\n readonly titleId: string\n}\n\ntype DialogPart = 'footer' | 'header' | 'title'\n\nconst DialogLayoutContext = createContext<DialogLayout | null>(null)\nconst DialogTriggerContext = createContext<ModalTrigger | null>(null)\n\ntype DialogBodyProps = ScrollViewProps & {\n readonly ref?: Ref<ComponentRef<typeof ScrollView>>\n}\n\ntype DialogContentProps = DialogOpenProps &\n Omit<ViewProps, 'children' | 'role' | 'style'> & {\n readonly children?: ReactNode\n /**\n * Whether a press on the scrim, outside the container, closes the\n * dialog. Android's back gesture is `isKeyboardDismissDisabled`'s, and\n * this says nothing about it, so a dialog that has to be answered from\n * one of its actions turns off both.\n * @default true\n */\n readonly isDismissable?: boolean\n /**\n * Keeps Android's back gesture, VoiceOver's escape gesture, and Escape on\n * web, from closing the dialog.\n * @default false\n */\n readonly isKeyboardDismissDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * `alertdialog` for a dialog interrupting with something that has to be\n * answered before the app carries on. It also keeps the dialog the basic\n * one in a compact window, centred and sized to its content, where a\n * dialog of the default role fills the window.\n * @default 'dialog'\n */\n readonly role?: 'alertdialog' | 'dialog'\n readonly style?: StyleProp<ViewStyle>\n }\n\ntype DialogOpenProps = ModalOpenProps & {\n /** Whether the dialog starts open, when it keeps its own state. */\n readonly defaultOpen?: boolean\n /** Whether the dialog is open, when the call site holds the state. */\n readonly isOpen?: boolean\n /** Called with the new state as the dialog opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\ntype DialogPartProps = ViewProps & {\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\ntype DialogProps = DialogOpenProps & {\n /** The button that opens the dialog, and `Dialog.Content`. */\n readonly children?: ReactNode\n}\n\ntype DialogTitleProps = Omit<TextProps, 'role'> & {\n readonly ref?: Ref<HostInstance>\n}\n\n// The body's padding. The page's 24dp all round is spent by whichever part\n// is at each end, so the body takes the top of it when no header is there\n// and the bottom when no footer is. Full screen, it keeps 24dp under the\n// header's divider as well, which is the content padding the page gives the\n// full-screen dialog.\nfunction bodyPaddingOf(\n { basic, parts }: DialogLayout,\n spacing: ResolvedTheme['spacing'],\n): ViewStyle {\n return {\n gap: spacing.lg,\n paddingBottom: parts.footer > 0 ? 0 : spacing.xl,\n paddingHorizontal: spacing.xl,\n paddingTop: basic && parts.header > 0 ? 0 : spacing.xl,\n }\n}\n\n/**\n * A modal dialog centred over the screen, and the same dialog filling the\n * window in a compact window, the dialogs spec page's basic and full-screen\n * dialogs, paired by window size as the page pairs them. An alert dialog\n * stays the basic one at every width. Pass `isOpen` with `onOpenChange` to\n * hold the open state, or `defaultOpen` to let it keep its own.\n *\n * ```tsx\n * <Dialog>\n * <Button>Open</Button>\n * <Dialog.Content>\n * <Dialog.Header>\n * <Dialog.Title>Headline</Dialog.Title>\n * </Dialog.Header>\n * <Dialog.Body>Supporting text</Dialog.Body>\n * <Dialog.Footer>\n * <Button slot=\"close\" variant=\"text\">Cancel</Button>\n * </Dialog.Footer>\n * </Dialog.Content>\n * </Dialog>\n * ```\n *\n * Composed rather than configured by props, as web's is, since a dialog's\n * header, body and actions all take arbitrary content. A `Button`,\n * `IconButton` or `Chip` inside `Dialog` and outside its content opens it,\n * and a button given `slot=\"close\"` anywhere inside the content closes it. A\n * dialog nothing on the screen opens leaves `Dialog` out and passes `isOpen`\n * and `onOpenChange` to `Dialog.Content` instead.\n */\nfunction Dialog({ children, defaultOpen, isOpen, onOpenChange }: DialogProps) {\n const { context, slots } = useModalTrigger({\n defaultOpen,\n isOpen,\n onOpenChange,\n })\n\n return (\n <DialogTriggerContext value={context}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </DialogTriggerContext>\n )\n}\n\n/**\n * What the dialog shows, as a body that scrolls when its content runs past\n * the room it has. A string is drawn in the page's body medium on on-surface\n * variant; anything else draws itself. `style`, `ref` and `testID` land on\n * the `ScrollView`.\n *\n * A body its content runs past takes focus, as web's is a tab stop, so a\n * keyboard can scroll it when nothing inside it takes focus; a call site's\n * own `focusable` still wins.\n */\nfunction DialogBody({\n children,\n contentContainerStyle,\n onContentSizeChange,\n onLayout,\n ...props\n}: DialogBodyProps) {\n const layout = useLayout('Dialog.Body')\n const theme = useTheme()\n const styles = stylesOf(theme)\n const text = useTypeRole('bodyMedium')\n const { spacing } = theme\n const [content, setContent] = useState(0)\n const [room, setRoom] = useState(0)\n const measureContent = useCallback(\n (width: number, height: number) => {\n setContent(height)\n onContentSizeChange?.(width, height)\n },\n [onContentSizeChange],\n )\n const measureRoom = useCallback(\n (event: LayoutChangeEvent) => {\n setRoom(event.nativeEvent.layout.height)\n onLayout?.(event)\n },\n [onLayout],\n )\n\n return (\n <ScrollView\n focusable={content > room}\n onContentSizeChange={measureContent}\n onLayout={measureRoom}\n {...props}\n contentContainerStyle={composeStyles<ViewStyle>(\n bodyPaddingOf(layout, spacing),\n contentContainerStyle,\n )}\n >\n {typeof children === 'string' ? (\n <NativeText style={composeStyles<TextStyle>(text, styles.bodyText)}>\n {children}\n </NativeText>\n ) : (\n children\n )}\n </ScrollView>\n )\n}\n\n/**\n * The dialog itself, and the scrim behind it. Everything the dialog shows\n * goes in here; the button that opens it stays outside it.\n *\n * Inside `Dialog`, the open state is the trigger's. On its own it is this\n * part's: `isOpen` with `onOpenChange` holds it, and a `slot=\"close\"`\n * button, the scrim and the back gesture all report through `onOpenChange`.\n * `style`, `ref` and `testID` land on the container.\n */\nfunction DialogContent({\n children,\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled = false,\n isOpen,\n onOpenChange,\n role = 'dialog',\n style,\n ...props\n}: DialogContentProps) {\n const outer = use(DialogTriggerContext)\n const { close, present, setPresent, slots, state } = useModalState(outer, {\n defaultOpen,\n isOpen,\n onOpenChange,\n })\n const theme = useTheme()\n const styles = stylesOf(theme)\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const sizeClass = useWindowSizeClass()\n const basic = role === 'alertdialog' || sizeClass !== 'compact'\n const titleId = useId()\n const [parts, setParts] = useState(NO_PARTS)\n const [register] = useState(() => registerOf(setParts))\n const [title, setTitle] = useState<HostInstance | null>(null)\n const motion = useDialogMotion(state.isOpen, present, setPresent, basic)\n const layout = useMemo<DialogLayout>(\n () => ({ basic, parts, register, setTitle, titleId }),\n [basic, parts, register, titleId],\n )\n\n if (!present) {\n return null\n }\n\n const labelledBy = parts.title > 0 ? titleId : undefined\n\n return (\n <ModalWindow\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n labelledBy={labelledBy}\n onClose={close}\n onScrimPress={isDismissable && state.isOpen ? close : undefined}\n scrim={motion.scrim}\n title={title}\n >\n <View\n style={composeStyles<ViewStyle>(\n styles.layout,\n basic ? undefined : styles.layoutFull,\n )}\n >\n <Animated.View\n {...panelRoleOf(role, labelledBy)}\n onAccessibilityEscape={isKeyboardDismissDisabled ? undefined : close}\n {...props}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.container,\n basic ? styles.containerBasic : styles.containerFull,\n basic ? undefined : insetsOf(insets),\n motion.panel,\n style,\n )}\n >\n <DialogLayoutContext value={layout}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </DialogLayoutContext>\n </Animated.View>\n </View>\n </ModalWindow>\n )\n}\n\n/**\n * The dialog's actions, at the trailing edge and wrapping onto another row\n * when they do not fit on one. Full screen they are the page's bottom action\n * bar. `style`, `ref` and `testID` land on its view.\n */\nfunction DialogFooter({ style, ...props }: DialogPartProps) {\n const layout = useLayout('Dialog.Footer')\n const styles = stylesOf(useTheme())\n const { register } = layout\n\n useLayoutEffect(() => register('footer'), [register])\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n styles.actions,\n layout.basic ? undefined : styles.actionsFull,\n style,\n )}\n />\n )\n}\n\n/**\n * The dialog's header: its `Dialog.Title`, and anything beside it, such as a\n * close button. Full screen it is the page's header bar. `style`, `ref` and\n * `testID` land on its view.\n */\nfunction DialogHeader({ style, ...props }: DialogPartProps) {\n const layout = useLayout('Dialog.Header')\n const styles = stylesOf(useTheme())\n const { register } = layout\n\n useLayoutEffect(() => register('header'), [register])\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n styles.header,\n layout.basic ? undefined : styles.headerFull,\n style,\n )}\n />\n )\n}\n\n/**\n * Names the dialog: the container is labelled by it, and a screen reader is\n * sent to it once the dialog shows. In headline small as the basic dialog,\n * and title large as the full-screen one, where it shares a 56dp bar.\n * `style`, `ref` and `testID` land on React Native's own Text.\n */\nfunction DialogTitle({ ref, style, ...props }: DialogTitleProps) {\n const layout = useLayout('Dialog.Title')\n const styles = stylesOf(useTheme())\n const role = useTypeRole(layout.basic ? 'headlineSmall' : 'titleLarge')\n const { register, setTitle } = layout\n\n useLayoutEffect(() => register('title'), [register])\n\n return (\n <NativeText\n {...props}\n nativeID={layout.titleId}\n ref={refsOf(setTitle, ref)}\n role=\"heading\"\n style={composeStyles<TextStyle>(role, styles.title, style)}\n />\n )\n}\n\n/**\n * The scrim's and the panel's motion, and the timer that unmounts the dialog\n * once its exit has run. The panel arrives over the medium duration on the\n * emphasised decelerating curve and leaves over the short one on the\n * accelerating curve, and the scrim fades over the short one on the standard\n * curve, both ways. Under reduced motion the panel arrives and leaves at once.\n */\nfunction useDialogMotion(\n isOpen: boolean,\n present: boolean,\n setPresent: (present: boolean) => void,\n basic: boolean,\n) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const { height } = useWindowDimensions()\n const panel = useSharedValue(0)\n const scrim = useSharedValue(0)\n\n useEffect(() => {\n const fade = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n\n if (isOpen) {\n scrim.set(withTiming(1, fade))\n panel.set(\n reduceMotion\n ? 1\n : withTiming(1, {\n duration: motion.durationMedium1,\n easing: Easing.bezier(...motion.easingEmphasizedDecelerate),\n }),\n )\n return undefined\n }\n\n if (!present) {\n return undefined\n }\n\n scrim.set(withTiming(0, fade))\n panel.set(\n reduceMotion\n ? 0\n : withTiming(0, {\n duration: motion.durationShort3,\n easing: Easing.bezier(...motion.easingEmphasizedAccelerate),\n }),\n )\n const timer = setTimeout(\n () => {\n setPresent(false)\n },\n reduceMotion\n ? motion.durationShort2\n : Math.max(motion.durationShort2, motion.durationShort3),\n )\n\n return () => {\n clearTimeout(timer)\n }\n }, [isOpen, motion, panel, present, reduceMotion, scrim, setPresent])\n\n return {\n panel: useAnimatedStyle(() => {\n 'worklet'\n const shown = panel.get()\n\n return basic\n ? {\n opacity: shown,\n transform: [{ scale: SCALE_FROM + (1 - SCALE_FROM) * shown }],\n }\n : {\n opacity: shown,\n transform: [{ translateY: (1 - shown) * RISE_FROM * height }],\n }\n }),\n scrim: useAnimatedStyle(() => {\n 'worklet'\n return { opacity: scrim.get() }\n }),\n }\n}\n\nfunction useLayout(part: string) {\n const layout = use(DialogLayoutContext)\n\n if (layout === null) {\n throw new Error(`${part} is drawn inside Dialog.Content.`)\n }\n\n return layout\n}\n\nDialog.Body = DialogBody\nDialog.Content = DialogContent\nDialog.Footer = DialogFooter\nDialog.Header = DialogHeader\nDialog.Title = DialogTitle\n\nexport {\n Dialog,\n DialogBody,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n}\nexport type {\n DialogBodyProps,\n DialogContentProps,\n DialogPartProps,\n DialogProps,\n DialogTitleProps,\n}\n"],"mappings":";;;;;;;;;;;;;;AA4GA,MAAMkD,YAAY;AAClB,MAAMC,YAAY;AAClB,MAAMC,aAAa;AACnB,MAAMC,YAAY;AAElB,MAAMC,WAAiD;CACrDI,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT;AAEA,MAAMC,WAAWb,cACd,EAAEc,QAAQC,OAAOC,SAASC,QAAQC,cACjC3C,WAAW4C,OAAO;CAIhBC,SAAS;EACPC,YAAY;EACZC,eAAe;EACfC,Y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;AAEAoC,OAAOwF,OAAO/E;AACdT,OAAOyF,UAAU1D;AACjB/B,OAAO0F,SAAS7B;AAChB7D,OAAO2F,SAAS7B;AAChB9D,OAAO4F,QAAQ7B"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","HostInstance","LayoutChangeEvent","ScrollViewProps","StyleProp","TextProps","TextStyle","ViewProps","ViewStyle","AnimatedStyle","createContext","use","useCallback","useEffect","useId","useLayoutEffect","useMemo","useState","Text","NativeText","ScrollView","StyleSheet","useWindowDimensions","View","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","SafeAreaInsetsContext","ModalOpenProps","ModalTrigger","ResolvedTheme","ButtonSlotContext","useWindowSizeClass","insetsOf","ModalWindow","NO_INSETS","panelRoleOf","registerOf","useModalState","useModalTrigger","useKeyboardInset","refsOf","useTheme","composeStyles","themedStyles","useTypeRole","MIN_WIDTH","MAX_WIDTH","SCALE_FROM","RISE_FROM","NO_PARTS","Readonly","Record","DialogPart","footer","header","title","stylesOf","colors","radii","shadows","sizing","spacing","create","actions","alignItems","flexDirection","flexShrink","flexWrap","gap","sm","justifyContent","padding","xl","actionsFull","borderTopColor","outlineVariant","borderTopWidth","minHeight","rowSm","paddingVertical","xs","bodyText","color","onSurfaceVariant","container","backgroundColor","surfaceContainerHigh","overflow","containerBasic","borderRadius","boxShadow","elevation3","maxHeight","maxWidth","minWidth","width","containerFull","flex","md","paddingBottom","lg","paddingHorizontal","paddingTop","headerFull","borderBottomColor","borderBottomWidth","layout","bottom","left","pointerEvents","position","right","top","layoutFull","onSurface","DialogLayout","basic","parts","register","part","setTitle","node","titleId","DialogLayoutContext","DialogTriggerContext","DialogBodyProps","ref","DialogContentProps","DialogOpenProps","Omit","children","isDismissable","isKeyboardDismissDisabled","role","style","defaultOpen","isOpen","onOpenChange","DialogPartProps","DialogProps","DialogTitleProps","bodyPaddingOf","Dialog","t0","$","_c","t1","context","slots","t2","t3","DialogBody","contentContainerStyle","onContentSizeChange","onLayout","props","useLayout","theme","styles","text","content","setContent","room","setRoom","height","measureContent","event","nativeEvent","measureRoom","T0","t4","t5","t6","DialogContent","undefined","outer","close","present","setPresent","state","insets","sizeClass","setParts","Symbol","for","motion","useDialogMotion","keyboard","labelledBy","t7","t8","scrim","T1","t9","t10","t11","t12","t13","Math","max","panel","t14","t15","t16","t17","t18","DialogFooter","DialogHeader","DialogTitle","reduceMotion","durationMedium1","durationShort2","durationShort3","easingEmphasizedAccelerate","easingEmphasizedDecelerate","easingStandard","fade","duration","easing","bezier","set","timer","setTimeout","clearTimeout","shown","get","opacity","transform","scale","translateY","Error","Body","Content","Footer","Header","Title","_c","NativeText"],"sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n HostInstance,\n LayoutChangeEvent,\n ScrollViewProps,\n StyleProp,\n TextProps,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport {\n createContext,\n use,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react'\nimport {\n Text as NativeText,\n ScrollView,\n StyleSheet,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\n\nimport type { ModalOpenProps, ModalTrigger } from '../../modal'\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport { ButtonSlotContext } from '../../button/slots'\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport {\n insetsOf,\n ModalWindow,\n NO_INSETS,\n panelRoleOf,\n registerOf,\n useModalState,\n useModalTrigger,\n} from '../../modal'\nimport { useKeyboardInset } from '../../overlay/keyboard'\nimport { refsOf } from '../../ref'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The dialogs spec page's two dialogs, as kanso-ui's Dialog draws them: one\n// component, since the page pairs them by window size rather than offering a\n// choice. In a medium window or wider it is the basic dialog, a container on\n// surface container high with the 28dp corner, between 280 and 560dp wide,\n// centred over the scrim, with 24dp of padding all round, 16dp between the\n// headline and the body and 24dp between the body and the actions. In a\n// compact window, below 600dp, the same dialog fills the window as the page's\n// full-screen dialog: square corners, a 56dp header with the headline in\n// title large and a divider under it, and a 56dp action bar over a divider,\n// both inside the device's safe area.\n//\n// **It stays above the software keyboard.** While one is up the basic dialog\n// is centred in the room above it, and the full-screen one pads its bottom by\n// as much of the screen as the keyboard covers, so its actions and a field\n// focused in it are not hidden behind the keyboard. On Android a `Modal`\n// reports the keyboard to React Native only through\n// react-native-keyboard-controller, which src/overlay/keyboard.ts reads where\n// the app installs it.\n//\n// An alert dialog, `role=\"alertdialog\"`, is a question with two or three\n// answers rather than a task, and stays the basic dialog at every width, as\n// on web, where a question filling a phone read as a headline at the top of\n// the screen and its answers at the bottom with nothing between them.\n//\n// **It is drawn in a React Native `Modal`**, through src/modal, which keeps\n// React context, so the dialog keeps the `ThemeScope` around it, and which is\n// a window of its own on iOS and Android, above the screen and its overlays.\n// The `Modal` therefore hosts overlays of its own, so a snackbar or a popover\n// raised from inside the dialog draws above it rather than under it.\n//\n// **It animates out as well as in**, from the motion tokens: the panel scales\n// up from 90% on the emphasised decelerating curve, or rises 3% of the window\n// when it fills it, and leaves on the emphasised accelerating one, while the\n// scrim fades on the standard curve. Web only animates in, since React Aria\n// keeps a closing surface mounted only while a CSS animation runs; here the\n// dialog stays mounted until its exit has run. Under reduced motion the\n// panel appears and leaves at once, and the scrim still fades, which is what\n// says the dialog came and went.\n//\n// **A press on the scrim closes it**, unless `isDismissable` is false, and\n// Android's back gesture and VoiceOver's escape gesture close it, unless\n// `isKeyboardDismissDisabled`, the prop that keeps Escape from closing it on\n// web, which is the key React Native Web's `Modal` hands the same handler.\n// A button inside `Dialog` and outside its content opens it, and one given\n// `slot=\"close\"` inside the content closes it, through src/button's\n// slots.ts.\n//\n// **Focus moves into the dialog and back.** On iOS and Android the screen\n// reader is sent to the headline once the dialog shows, and back to the\n// button that opened it once it has gone. React Native Web's `Modal` traps\n// focus and restores it itself, and is the dialog element there, so on web it\n// takes the dialog's name and the panel takes no role of its own. That\n// `Modal` sets its role itself, so an alert dialog is announced as a dialog\n// in the web Storybook; kanso-ui, the library for web apps, keeps the role.\n\n// The panel's width bounds, the page's, and how far it travels as it\n// arrives: it scales up from 90% as the basic dialog, or rises 3% of the\n// window as the full-screen one, as web's keyframes have it.\nconst MIN_WIDTH = 280\nconst MAX_WIDTH = 560\nconst SCALE_FROM = 0.9\nconst RISE_FROM = 0.03\n\nconst NO_PARTS: Readonly<Record<DialogPart, number>> = {\n footer: 0,\n header: 0,\n title: 0,\n}\n\nconst stylesOf = themedStyles(\n ({ colors, radii, shadows, sizing, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // The page's 24dp between the body and the actions, and 8dp between\n // the buttons. Actions that do not fit on one row wrap onto another,\n // still at the trailing edge.\n actions: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n gap: spacing.sm,\n justifyContent: 'flex-end',\n padding: spacing.xl,\n },\n // Full screen, the actions are the page's bottom action bar: 56dp at\n // least, over a divider, so an action whose label wraps grows the bar\n // rather than meeting the divider.\n actionsFull: {\n borderTopColor: colors.outlineVariant,\n borderTopWidth: 1,\n minHeight: sizing.rowSm,\n paddingVertical: spacing.xs,\n },\n // The text a body is handed as a string, in the page's body medium on\n // on-surface variant, which is what web's body sets for its text.\n bodyText: {\n color: colors.onSurfaceVariant,\n },\n // Both dialogs' container, whose corner, where it has one, clips the\n // body's scroll.\n container: {\n backgroundColor: colors.surfaceContainerHigh,\n overflow: 'hidden',\n },\n // The basic dialog's container, centred over the scrim and only as\n // tall as the room the scrim's padding leaves, so the body scrolls\n // rather than running off the screen.\n containerBasic: {\n borderRadius: radii.xl,\n boxShadow: shadows.elevation3,\n maxHeight: '100%',\n maxWidth: MAX_WIDTH,\n minWidth: MIN_WIDTH,\n width: '100%',\n },\n // Full screen, the container fills the window with square corners, and\n // its fill runs on under the safe area its content keeps out of.\n containerFull: {\n flex: 1,\n },\n // The page's 24dp above the headline and 16dp between it and the body,\n // with the headline beside whatever else the header holds, a close\n // button for one.\n header: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n gap: spacing.md,\n justifyContent: 'space-between',\n paddingBottom: spacing.lg,\n paddingHorizontal: spacing.xl,\n paddingTop: spacing.xl,\n },\n // Full screen, the header is the page's own 56dp bar, at least, under\n // a divider.\n headerFull: {\n borderBottomColor: colors.outlineVariant,\n borderBottomWidth: 1,\n minHeight: sizing.rowSm,\n paddingBottom: spacing.xs,\n paddingTop: spacing.xs,\n },\n // The scrim centres the container, which is what makes the dialog a\n // dialog rather than a sheet. Full screen it has no room to give. It\n // takes no touches itself, so a press around the container reaches the\n // scrim under it.\n layout: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n padding: spacing.xl,\n pointerEvents: 'box-none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n layoutFull: {\n alignItems: 'stretch',\n padding: 0,\n },\n // The headline gives way to whatever shares its row.\n title: {\n color: colors.onSurface,\n flexShrink: 1,\n },\n }),\n)\n\n// What the content's parts read: which of the two dialogs is drawn, which\n// parts are there, and the headline's name and node.\ntype DialogLayout = {\n readonly basic: boolean\n readonly parts: Readonly<Record<DialogPart, number>>\n readonly register: (part: DialogPart) => () => void\n readonly setTitle: (node: HostInstance | null) => void\n readonly titleId: string\n}\n\ntype DialogPart = 'footer' | 'header' | 'title'\n\nconst DialogLayoutContext = createContext<DialogLayout | null>(null)\nconst DialogTriggerContext = createContext<ModalTrigger | null>(null)\n\ntype DialogBodyProps = ScrollViewProps & {\n readonly ref?: Ref<ComponentRef<typeof ScrollView>>\n}\n\ntype DialogContentProps = DialogOpenProps &\n Omit<ViewProps, 'children' | 'role' | 'style'> & {\n readonly children?: ReactNode\n /**\n * Whether a press on the scrim, outside the container, closes the\n * dialog. Android's back gesture is `isKeyboardDismissDisabled`'s, and\n * this says nothing about it, so a dialog that has to be answered from\n * one of its actions turns off both.\n * @default true\n */\n readonly isDismissable?: boolean\n /**\n * Keeps Android's back gesture, VoiceOver's escape gesture, and Escape on\n * web, from closing the dialog.\n * @default false\n */\n readonly isKeyboardDismissDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * `alertdialog` for a dialog interrupting with something that has to be\n * answered before the app carries on. It also keeps the dialog the basic\n * one in a compact window, centred and sized to its content, where a\n * dialog of the default role fills the window.\n * @default 'dialog'\n */\n readonly role?: 'alertdialog' | 'dialog'\n readonly style?: StyleProp<ViewStyle>\n }\n\ntype DialogOpenProps = ModalOpenProps & {\n /** Whether the dialog starts open, when it keeps its own state. */\n readonly defaultOpen?: boolean\n /** Whether the dialog is open, when the call site holds the state. */\n readonly isOpen?: boolean\n /** Called with the new state as the dialog opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\ntype DialogPartProps = ViewProps & {\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\ntype DialogProps = DialogOpenProps & {\n /** The button that opens the dialog, and `Dialog.Content`. */\n readonly children?: ReactNode\n}\n\ntype DialogTitleProps = Omit<TextProps, 'role'> & {\n readonly ref?: Ref<HostInstance>\n}\n\n// The body's padding. The page's 24dp all round is spent by whichever part\n// is at each end, so the body takes the top of it when no header is there\n// and the bottom when no footer is. Full screen, it keeps 24dp under the\n// header's divider as well, which is the content padding the page gives the\n// full-screen dialog.\nfunction bodyPaddingOf(\n { basic, parts }: DialogLayout,\n spacing: ResolvedTheme['spacing'],\n): ViewStyle {\n return {\n gap: spacing.lg,\n paddingBottom: parts.footer > 0 ? 0 : spacing.xl,\n paddingHorizontal: spacing.xl,\n paddingTop: basic && parts.header > 0 ? 0 : spacing.xl,\n }\n}\n\n/**\n * A modal dialog centred over the screen, and the same dialog filling the\n * window in a compact window, the dialogs spec page's basic and full-screen\n * dialogs, paired by window size as the page pairs them. An alert dialog\n * stays the basic one at every width. Pass `isOpen` with `onOpenChange` to\n * hold the open state, or `defaultOpen` to let it keep its own.\n *\n * ```tsx\n * <Dialog>\n * <Button>Open</Button>\n * <Dialog.Content>\n * <Dialog.Header>\n * <Dialog.Title>Headline</Dialog.Title>\n * </Dialog.Header>\n * <Dialog.Body>Supporting text</Dialog.Body>\n * <Dialog.Footer>\n * <Button slot=\"close\" variant=\"text\">Cancel</Button>\n * </Dialog.Footer>\n * </Dialog.Content>\n * </Dialog>\n * ```\n *\n * Composed rather than configured by props, as web's is, since a dialog's\n * header, body and actions all take arbitrary content. A `Button`,\n * `IconButton` or `Chip` inside `Dialog` and outside its content opens it,\n * and a button given `slot=\"close\"` anywhere inside the content closes it. A\n * dialog nothing on the screen opens leaves `Dialog` out and passes `isOpen`\n * and `onOpenChange` to `Dialog.Content` instead.\n */\nfunction Dialog({ children, defaultOpen, isOpen, onOpenChange }: DialogProps) {\n const { context, slots } = useModalTrigger({\n defaultOpen,\n isOpen,\n onOpenChange,\n })\n\n return (\n <DialogTriggerContext value={context}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </DialogTriggerContext>\n )\n}\n\n/**\n * What the dialog shows, as a body that scrolls when its content runs past\n * the room it has. A string is drawn in the page's body medium on on-surface\n * variant; anything else draws itself. `style`, `ref` and `testID` land on\n * the `ScrollView`.\n *\n * A body its content runs past takes focus, as web's is a tab stop, so a\n * keyboard can scroll it when nothing inside it takes focus; a call site's\n * own `focusable` still wins.\n */\nfunction DialogBody({\n children,\n contentContainerStyle,\n onContentSizeChange,\n onLayout,\n ...props\n}: DialogBodyProps) {\n const layout = useLayout('Dialog.Body')\n const theme = useTheme()\n const styles = stylesOf(theme)\n const text = useTypeRole('bodyMedium')\n const { spacing } = theme\n const [content, setContent] = useState(0)\n const [room, setRoom] = useState(0)\n const measureContent = useCallback(\n (width: number, height: number) => {\n setContent(height)\n onContentSizeChange?.(width, height)\n },\n [onContentSizeChange],\n )\n const measureRoom = useCallback(\n (event: LayoutChangeEvent) => {\n setRoom(event.nativeEvent.layout.height)\n onLayout?.(event)\n },\n [onLayout],\n )\n\n return (\n <ScrollView\n focusable={content > room}\n onContentSizeChange={measureContent}\n onLayout={measureRoom}\n {...props}\n contentContainerStyle={composeStyles<ViewStyle>(\n bodyPaddingOf(layout, spacing),\n contentContainerStyle,\n )}\n >\n {typeof children === 'string' ? (\n <NativeText style={composeStyles<TextStyle>(text, styles.bodyText)}>\n {children}\n </NativeText>\n ) : (\n children\n )}\n </ScrollView>\n )\n}\n\n/**\n * The dialog itself, and the scrim behind it. Everything the dialog shows\n * goes in here; the button that opens it stays outside it.\n *\n * Inside `Dialog`, the open state is the trigger's. On its own it is this\n * part's: `isOpen` with `onOpenChange` holds it, and a `slot=\"close\"`\n * button, the scrim and the back gesture all report through `onOpenChange`.\n * `style`, `ref` and `testID` land on the container.\n */\nfunction DialogContent({\n children,\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled = false,\n isOpen,\n onOpenChange,\n role = 'dialog',\n style,\n ...props\n}: DialogContentProps) {\n const outer = use(DialogTriggerContext)\n const { close, present, setPresent, slots, state } = useModalState(outer, {\n defaultOpen,\n isOpen,\n onOpenChange,\n })\n const theme = useTheme()\n const styles = stylesOf(theme)\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const sizeClass = useWindowSizeClass()\n const basic = role === 'alertdialog' || sizeClass !== 'compact'\n const titleId = useId()\n const [parts, setParts] = useState(NO_PARTS)\n const [register] = useState(() => registerOf(setParts))\n const [title, setTitle] = useState<HostInstance | null>(null)\n const motion = useDialogMotion(state.isOpen, present, setPresent, basic)\n const keyboard = useKeyboardInset(present)\n const layout = useMemo<DialogLayout>(\n () => ({ basic, parts, register, setTitle, titleId }),\n [basic, parts, register, titleId],\n )\n\n if (!present) {\n return null\n }\n\n const labelledBy = parts.title > 0 ? titleId : undefined\n\n return (\n <ModalWindow\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n labelledBy={labelledBy}\n onClose={close}\n onScrimPress={isDismissable && state.isOpen ? close : undefined}\n scrim={motion.scrim}\n title={title}\n >\n <View\n style={composeStyles<ViewStyle>(\n styles.layout,\n basic\n ? { paddingBottom: theme.spacing.xl + keyboard }\n : styles.layoutFull,\n )}\n >\n <Animated.View\n {...panelRoleOf(role, labelledBy)}\n onAccessibilityEscape={isKeyboardDismissDisabled ? undefined : close}\n {...props}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.container,\n basic ? styles.containerBasic : styles.containerFull,\n basic\n ? undefined\n : {\n ...insetsOf(insets),\n paddingBottom: Math.max(insets.bottom, keyboard),\n },\n motion.panel,\n style,\n )}\n >\n <DialogLayoutContext value={layout}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </DialogLayoutContext>\n </Animated.View>\n </View>\n </ModalWindow>\n )\n}\n\n/**\n * The dialog's actions, at the trailing edge and wrapping onto another row\n * when they do not fit on one. Full screen they are the page's bottom action\n * bar. `style`, `ref` and `testID` land on its view.\n */\nfunction DialogFooter({ style, ...props }: DialogPartProps) {\n const layout = useLayout('Dialog.Footer')\n const styles = stylesOf(useTheme())\n const { register } = layout\n\n useLayoutEffect(() => register('footer'), [register])\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n styles.actions,\n layout.basic ? undefined : styles.actionsFull,\n style,\n )}\n />\n )\n}\n\n/**\n * The dialog's header: its `Dialog.Title`, and anything beside it, such as a\n * close button. Full screen it is the page's header bar. `style`, `ref` and\n * `testID` land on its view.\n */\nfunction DialogHeader({ style, ...props }: DialogPartProps) {\n const layout = useLayout('Dialog.Header')\n const styles = stylesOf(useTheme())\n const { register } = layout\n\n useLayoutEffect(() => register('header'), [register])\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n styles.header,\n layout.basic ? undefined : styles.headerFull,\n style,\n )}\n />\n )\n}\n\n/**\n * Names the dialog: the container is labelled by it, and a screen reader is\n * sent to it once the dialog shows. In headline small as the basic dialog,\n * and title large as the full-screen one, where it shares a 56dp bar.\n * `style`, `ref` and `testID` land on React Native's own Text.\n */\nfunction DialogTitle({ ref, style, ...props }: DialogTitleProps) {\n const layout = useLayout('Dialog.Title')\n const styles = stylesOf(useTheme())\n const role = useTypeRole(layout.basic ? 'headlineSmall' : 'titleLarge')\n const { register, setTitle } = layout\n\n useLayoutEffect(() => register('title'), [register])\n\n return (\n <NativeText\n {...props}\n nativeID={layout.titleId}\n ref={refsOf(setTitle, ref)}\n role=\"heading\"\n style={composeStyles<TextStyle>(role, styles.title, style)}\n />\n )\n}\n\n/**\n * The scrim's and the panel's motion, and the timer that unmounts the dialog\n * once its exit has run. The panel arrives over the medium duration on the\n * emphasised decelerating curve and leaves over the short one on the\n * accelerating curve, and the scrim fades over the short one on the standard\n * curve, both ways. Under reduced motion the panel arrives and leaves at once.\n */\nfunction useDialogMotion(\n isOpen: boolean,\n present: boolean,\n setPresent: (present: boolean) => void,\n basic: boolean,\n) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const { height } = useWindowDimensions()\n const panel = useSharedValue(0)\n const scrim = useSharedValue(0)\n\n useEffect(() => {\n const fade = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n\n if (isOpen) {\n scrim.set(withTiming(1, fade))\n panel.set(\n reduceMotion\n ? 1\n : withTiming(1, {\n duration: motion.durationMedium1,\n easing: Easing.bezier(...motion.easingEmphasizedDecelerate),\n }),\n )\n return undefined\n }\n\n if (!present) {\n return undefined\n }\n\n scrim.set(withTiming(0, fade))\n panel.set(\n reduceMotion\n ? 0\n : withTiming(0, {\n duration: motion.durationShort3,\n easing: Easing.bezier(...motion.easingEmphasizedAccelerate),\n }),\n )\n const timer = setTimeout(\n () => {\n setPresent(false)\n },\n reduceMotion\n ? motion.durationShort2\n : Math.max(motion.durationShort2, motion.durationShort3),\n )\n\n return () => {\n clearTimeout(timer)\n }\n }, [isOpen, motion, panel, present, reduceMotion, scrim, setPresent])\n\n return {\n panel: useAnimatedStyle(() => {\n 'worklet'\n const shown = panel.get()\n\n return basic\n ? {\n opacity: shown,\n transform: [{ scale: SCALE_FROM + (1 - SCALE_FROM) * shown }],\n }\n : {\n opacity: shown,\n transform: [{ translateY: (1 - shown) * RISE_FROM * height }],\n }\n }),\n scrim: useAnimatedStyle(() => {\n 'worklet'\n return { opacity: scrim.get() }\n }),\n }\n}\n\nfunction useLayout(part: string) {\n const layout = use(DialogLayoutContext)\n\n if (layout === null) {\n throw new Error(`${part} is drawn inside Dialog.Content.`)\n }\n\n return layout\n}\n\nDialog.Body = DialogBody\nDialog.Content = DialogContent\nDialog.Footer = DialogFooter\nDialog.Header = DialogHeader\nDialog.Title = DialogTitle\n\nexport {\n Dialog,\n DialogBody,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n}\nexport type {\n DialogBodyProps,\n DialogContentProps,\n DialogPartProps,\n DialogProps,\n DialogTitleProps,\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqHA,MAAMmD,YAAY;AAClB,MAAMC,YAAY;AAClB,MAAMC,aAAa;AACnB,MAAMC,YAAY;AAElB,MAAMC,WAAiD;CACrDI,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT;AAEA,MAAMC,WAAWb,cACd,EAAEc,QAAQC,OAAOC,SAASC,QAAQC,cACjC5C,WAAW6C,OAAO;CAIhBC,SAAS;EACPC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,UAAU;EACVC,KAAKP,QAAQQ;EACbC,gBAAgB;EAChBC,SAASV,QAAQW;CACnB;CAIAC,aAAa;EACXC,gBAAgBjB,OAAOkB;EACvBC,gBAAgB;EAChBC,WAAWjB,OAAOkB;EAClBC,iBAAiBlB,QAAQmB;CAC3B;CAGAC,UAAU,EACRC,OAAOzB,OAAO0B,iBAChB;CAGAC,WAAW;EACTC,i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6F,QAAQ3B"}
|
|
@@ -31,8 +31,8 @@ type RangeCalendarProps$1<T extends DateValue = DateValue> = Pick<RangeCalendarP
|
|
|
31
31
|
readonly testID?: string;
|
|
32
32
|
/**
|
|
33
33
|
* How many months the calendar shows at once, and moves by: side by side
|
|
34
|
-
* from the expanded window size up, one under another below it
|
|
35
|
-
* `months` is read.
|
|
34
|
+
* from the expanded window size up, one under another below it, each
|
|
35
|
+
* named over its weeks. Only `months` is read.
|
|
36
36
|
* @default { months: 1 }
|
|
37
37
|
*/
|
|
38
38
|
readonly visibleDuration?: DateDuration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DateDuration","ComponentRef","Ref","StyleProp","ViewStyle","DateValue","RangeCalendarProps","StatelyRangeCalendarProps","createCalendar","View","useRangeCalendarState","CalendarFrame","useRootStyle","visibleRangeOf","useLocaleOf","composeStyles","Pick","T","locale","ref","showMonthYearMenus","style","testID","visibleDuration","RangeCalendar","t0","$","_c","ariaLabel","props","t1","undefined","writtenIn","months","Math","max","rootStyle","t2","t3","state","t4","shown","t5","t6","t7","firstDayOfWeek","t8","_c"],"sources":["../../../src/components/range-calendar/index.tsx"],"sourcesContent":["import type { DateDuration } from '@internationalized/date'\nimport type { ComponentRef, Ref } from 'react'\nimport type { StyleProp, ViewStyle } from 'react-native'\nimport type {\n DateValue,\n RangeCalendarProps as StatelyRangeCalendarProps,\n} from 'react-stately/useRangeCalendarState'\n\nimport { createCalendar } from '@internationalized/date'\nimport { View } from 'react-native'\nimport { useRangeCalendarState } from 'react-stately/useRangeCalendarState'\n\nimport { CalendarFrame, useRootStyle, visibleRangeOf } from '../../calendar'\nimport { useLocaleOf } from '../../i18n/provider'\nimport { composeStyles } from '../../theme/styles'\n\n// kanso-ui's RangeCalendar: the date pickers page's calendar again, picking\n// two dates rather than one. Every part it draws is Calendar's, from\n// src/calendar, the container, the header, the month and year menus, the\n// grid and the date cell, so the two cannot come apart.\n//\n// What a range adds is the band between its two ends. The docked token set\n// stops at the selected date, so the band's colours are the modal date\n// picker's range-selection tokens: the secondary container, one step down\n// from the primary the two ends take, with its label in on secondary\n// container and its state layers in on primary container. Two things follow\n// from drawing a band across a grid whose dates are spaced apart, as on web.\n//\n// **The band is square and the ends are round.** A run of days reads as one\n// shape rather than a row of circles, and the first and last day round only\n// their outer side, which is what makes the band begin and end at a circle.\n// The sides are logical, so a right-to-left layout turns the band over.\n//\n// **The band fills the whole of each day's column.** A day in the range\n// drops the 4dp either side that every other date keeps and takes the full\n// width of its column, so one day's band meets the next one's.\n//\n// The state is React Stately's `useRangeCalendarState`, which web's React\n// Aria range calendar is built on. A first press starts the range and a\n// second ends it, on either side of the first. While a range is started a\n// pointer over a date draws the range as far as it, as web's does; a touch\n// has no such preview, so on a phone the band shows once the second date is\n// pressed. A date `isDateUnavailable` rules out is struck through, and once\n// a range is started the dates past it are disabled, unless\n// `allowsNonContiguousRanges` lets the range run over it.\n//\n// Each date's name is React Aria's: the two ends open with the whole range,\n// a day inside it is said to be selected, and each date's hint says whether\n// a press starts a range or ends the one started.\n\ntype RangeCalendarProps<T extends DateValue = DateValue> = Pick<\n StatelyRangeCalendarProps<T>,\n | 'allowsNonContiguousRanges'\n | 'defaultFocusedValue'\n | 'defaultValue'\n | 'firstDayOfWeek'\n | 'focusedValue'\n | 'isDateUnavailable'\n | 'isDisabled'\n | 'isReadOnly'\n | 'maxValue'\n | 'minValue'\n | 'onChange'\n | 'onFocusChange'\n | 'value'\n> & {\n /**\n * The calendar's name. The month shown, or the months, is added to it, as\n * React Aria adds it on web.\n */\n readonly 'aria-label'?: string\n /**\n * The BCP 47 locale the calendar is written in: its month and weekday\n * names, its digits, its first day of the week and its calendar system.\n * Defaults to the `I18nProvider`'s, or the device's outside one.\n */\n readonly locale?: string\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * Whether the header draws the month and the year as menu buttons, each\n * opening a list of them in the grid's place, as `Calendar`'s does. The\n * year list runs a century either side of the year shown, or to\n * `minValue` and `maxValue` where they are closer.\n *\n * For one visible month. With `visibleDuration` of more than one, the\n * header is the plain one, whose heading names every month shown, since\n * the menus name only the first.\n * @default false\n */\n readonly showMonthYearMenus?: boolean\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n /**\n * How many months the calendar shows at once, and moves by: side by side\n * from the expanded window size up, one under another below it
|
|
1
|
+
{"version":3,"file":"index.js","names":["DateDuration","ComponentRef","Ref","StyleProp","ViewStyle","DateValue","RangeCalendarProps","StatelyRangeCalendarProps","createCalendar","View","useRangeCalendarState","CalendarFrame","useRootStyle","visibleRangeOf","useLocaleOf","composeStyles","Pick","T","locale","ref","showMonthYearMenus","style","testID","visibleDuration","RangeCalendar","t0","$","_c","ariaLabel","props","t1","undefined","writtenIn","months","Math","max","rootStyle","t2","t3","state","t4","shown","t5","t6","t7","firstDayOfWeek","t8","_c"],"sources":["../../../src/components/range-calendar/index.tsx"],"sourcesContent":["import type { DateDuration } from '@internationalized/date'\nimport type { ComponentRef, Ref } from 'react'\nimport type { StyleProp, ViewStyle } from 'react-native'\nimport type {\n DateValue,\n RangeCalendarProps as StatelyRangeCalendarProps,\n} from 'react-stately/useRangeCalendarState'\n\nimport { createCalendar } from '@internationalized/date'\nimport { View } from 'react-native'\nimport { useRangeCalendarState } from 'react-stately/useRangeCalendarState'\n\nimport { CalendarFrame, useRootStyle, visibleRangeOf } from '../../calendar'\nimport { useLocaleOf } from '../../i18n/provider'\nimport { composeStyles } from '../../theme/styles'\n\n// kanso-ui's RangeCalendar: the date pickers page's calendar again, picking\n// two dates rather than one. Every part it draws is Calendar's, from\n// src/calendar, the container, the header, the month and year menus, the\n// grid and the date cell, so the two cannot come apart.\n//\n// What a range adds is the band between its two ends. The docked token set\n// stops at the selected date, so the band's colours are the modal date\n// picker's range-selection tokens: the secondary container, one step down\n// from the primary the two ends take, with its label in on secondary\n// container and its state layers in on primary container. Two things follow\n// from drawing a band across a grid whose dates are spaced apart, as on web.\n//\n// **The band is square and the ends are round.** A run of days reads as one\n// shape rather than a row of circles, and the first and last day round only\n// their outer side, which is what makes the band begin and end at a circle.\n// The sides are logical, so a right-to-left layout turns the band over.\n//\n// **The band fills the whole of each day's column.** A day in the range\n// drops the 4dp either side that every other date keeps and takes the full\n// width of its column, so one day's band meets the next one's.\n//\n// The state is React Stately's `useRangeCalendarState`, which web's React\n// Aria range calendar is built on. A first press starts the range and a\n// second ends it, on either side of the first. While a range is started a\n// pointer over a date draws the range as far as it, as web's does; a touch\n// has no such preview, so on a phone the band shows once the second date is\n// pressed. A date `isDateUnavailable` rules out is struck through, and once\n// a range is started the dates past it are disabled, unless\n// `allowsNonContiguousRanges` lets the range run over it.\n//\n// Each date's name is React Aria's: the two ends open with the whole range,\n// a day inside it is said to be selected, and each date's hint says whether\n// a press starts a range or ends the one started.\n\ntype RangeCalendarProps<T extends DateValue = DateValue> = Pick<\n StatelyRangeCalendarProps<T>,\n | 'allowsNonContiguousRanges'\n | 'defaultFocusedValue'\n | 'defaultValue'\n | 'firstDayOfWeek'\n | 'focusedValue'\n | 'isDateUnavailable'\n | 'isDisabled'\n | 'isReadOnly'\n | 'maxValue'\n | 'minValue'\n | 'onChange'\n | 'onFocusChange'\n | 'value'\n> & {\n /**\n * The calendar's name. The month shown, or the months, is added to it, as\n * React Aria adds it on web.\n */\n readonly 'aria-label'?: string\n /**\n * The BCP 47 locale the calendar is written in: its month and weekday\n * names, its digits, its first day of the week and its calendar system.\n * Defaults to the `I18nProvider`'s, or the device's outside one.\n */\n readonly locale?: string\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * Whether the header draws the month and the year as menu buttons, each\n * opening a list of them in the grid's place, as `Calendar`'s does. The\n * year list runs a century either side of the year shown, or to\n * `minValue` and `maxValue` where they are closer.\n *\n * For one visible month. With `visibleDuration` of more than one, the\n * header is the plain one, whose heading names every month shown, since\n * the menus name only the first.\n * @default false\n */\n readonly showMonthYearMenus?: boolean\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n /**\n * How many months the calendar shows at once, and moves by: side by side\n * from the expanded window size up, one under another below it, each\n * named over its weeks. Only `months` is read.\n * @default { months: 1 }\n */\n readonly visibleDuration?: DateDuration\n}\n\n/**\n * A calendar for picking a range of dates. The value is a `{ start, end }`\n * pair of `@internationalized/date` values, as on web: pass `value` with\n * `onChange` to control it, or `defaultValue` to let it keep its own.\n *\n * ```tsx\n * import { CalendarDate } from '@internationalized/date'\n *\n * <RangeCalendar\n * aria-label=\"Label\"\n * defaultValue={{\n * start: new CalendarDate(2026, 9, 8),\n * end: new CalendarDate(2026, 9, 15),\n * }}\n * />\n * ```\n *\n * The two ends take the circle a selected date takes in `Calendar`, and the\n * days between them a band in the secondary container. `minValue`,\n * `maxValue`, `isDateUnavailable` and `visibleDuration` are the props\n * `Calendar` takes, and `allowsNonContiguousRanges` lets a range run past\n * the dates ruled out inside it rather than stopping at the first.\n *\n * `style`, `ref` and `testID` land on the container.\n */\nfunction RangeCalendar<T extends DateValue = DateValue>({\n 'aria-label': ariaLabel,\n locale,\n ref,\n showMonthYearMenus = false,\n style,\n testID,\n visibleDuration,\n ...props\n}: RangeCalendarProps<T>) {\n const writtenIn = useLocaleOf(locale)\n const months = Math.max(1, visibleDuration?.months ?? 1)\n const rootStyle = useRootStyle(months)\n const state = useRangeCalendarState<T>({\n ...props,\n createCalendar,\n locale: writtenIn,\n visibleDuration: { months },\n })\n const shown = visibleRangeOf(state, writtenIn, true)\n\n return (\n <View\n aria-label={ariaLabel === undefined ? shown : `${ariaLabel}, ${shown}`}\n ref={ref}\n role=\"group\"\n style={composeStyles<ViewStyle>(rootStyle, style)}\n testID={testID}\n >\n <CalendarFrame\n firstDayOfWeek={props.firstDayOfWeek}\n locale={writtenIn}\n months={months}\n showMonthYearMenus={showMonthYearMenus}\n state={state}\n />\n </View>\n )\n}\n\nexport type { RangeCalendarProps }\n\nexport { RangeCalendar }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8HA,SAAAwB,cAAAC,IA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AiB;EAAAjB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAJ;EAAAI,EAAA,MAAAoB;CAAA,OAAAA,KAAApB,EAAA;CAAA,OAdPoB;AAcO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","RefObject","HostInstance","StyleProp","TextInput","ViewStyle","AnimatedStyle","EdgeInsets","OverlayTriggerState","createContext","use","useCallback","useMemo","useRef","useState","Platform","StyleSheet","useWindowDimensions","View","Animated","SafeAreaInsetsContext","useOverlayTriggerState","AutocompleteValue","ButtonSlots","AnchoredPlacement","ResolvedTheme","AutocompleteProps","AutocompleteContext","ButtonSlotContext","FieldInput","ArrowBackGlyph","CloseGlyph","useWindowSizeClass","useMessages","insetsOf","ModalWindow","NO_INSETS","panelRoleOf","useAnchoredPlacement","useKeyboardTop","PANEL_ORIGINS","useFocusOnPlaced","usePanelMotion","useReturnFocus","refsOf","useTheme","composeStyles","themedStyles","Autocomplete","IconButton","FULL_HEADER","MIN_WIDTH","MAX_WIDTH","MIN_RESULTS","UNSEEN","opacity","stylesOf","colors","radii","shadows","spacing","create","back","marginStart","xs","clear","marginEnd","divider","backgroundColor","outline","flexShrink","height","docked","borderRadius","xl","boxShadow","elevation3","full","bottom","left","position","right","top","header","alignItems","flexDirection","gap","sm","paddingHorizontal","lg","resultsFull","flex","surface","surfaceContainerHigh","overflow","PanelProps","Omit","SearchViewContentProps","anchor","backLabel","clearLabel","close","isOpen","setInput","input","setPresent","present","T","children","label","placeholder","ref","style","testID","SearchViewProps","defaultOpen","onOpenChange","SearchViewRoot","state","SearchViewContext","clearOf","autocomplete","setInputValue","focus","dockedOf","placement","transformOrigin","side","width","Math","min","max","anchorWidth","fullOf","insets","covered","paddingBottom","measureBottomOf","panel","setBottom","measureInWindow","_x","y","_width","minHeightOf","minHeight","resultsOf","windowHeight","maxHeight","SearchView","t0","$","_c","t1","t2","open","t3","expanded","t4","default","trigger","slots","t5","root","t6","t7","SearchViewContent","defaultInputValue","filter","inputValue","onInputChange","props","Error","messages","undefined","clearSearch","t8","t9","t10","SearchViewPanel","theme","styles","sizing","typography","window","keyboardTop","align","motion","placed","setPanel","setOwnInput","controlLg","bodyLargeLineHeight","fontScale","Symbol","for","OS","onLayout","T0","onSurface","t11","t12","t13","t14","t15","t16","t17","t18","t19","Content","_c"],"sources":["../../../src/components/search-view/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref, RefObject } from 'react'\nimport type {\n HostInstance,\n StyleProp,\n TextInput,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { EdgeInsets } from 'react-native-safe-area-context'\nimport type { OverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport {\n createContext,\n use,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\nimport { useOverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport type { AutocompleteValue } from '../../autocomplete'\nimport type { ButtonSlots } from '../../button/slots'\nimport type { AnchoredPlacement } from '../../overlay'\nimport type { ResolvedTheme } from '../../theme/scope'\nimport type { AutocompleteProps } from '../autocomplete'\n\nimport { AutocompleteContext } from '../../autocomplete'\nimport { ButtonSlotContext } from '../../button/slots'\nimport { FieldInput } from '../../field'\nimport { ArrowBackGlyph, CloseGlyph } from '../../glyphs'\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport { useMessages } from '../../i18n/provider'\nimport { insetsOf, ModalWindow, NO_INSETS, panelRoleOf } from '../../modal'\nimport { useAnchoredPlacement } from '../../overlay'\nimport { useKeyboardTop } from '../../overlay/keyboard'\nimport {\n PANEL_ORIGINS,\n useFocusOnPlaced,\n usePanelMotion,\n useReturnFocus,\n} from '../../overlay/panel'\nimport { refsOf } from '../../ref'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { Autocomplete } from '../autocomplete'\nimport { IconButton } from '../icon-button'\n\n// kanso-ui's SearchView, the search page's search view: what a search opens\n// into. A header holds a back button, the input and a clear button, over a\n// 1dp divider in the outline role, and the results run under it. Both of the\n// page's forms are surface container high, with the input in body large on\n// surface over a supporting text in on surface variant, the back icon in on\n// surface and the clear icon in on surface variant.\n//\n// **Which form is the window's.** In a compact window it is the page's\n// full-screen view: the whole window, square, with a 72dp header, its content\n// inside the safe area while its fill runs on under it. From the medium\n// window up, the docked view: dropped under what opened it, as wide as that\n// and held between the page's 360dp and 720dp, with a 28dp corner, a 56dp\n// header, results at least 240dp tall and the whole view no taller than two\n// thirds of the window, at elevation 3, as web's takes them from Compose's\n// docked search bar. Both headers grow by as much as the input's line does at\n// the device's text size.\n//\n// **Both forms are drawn in a `Modal`**, through src/modal, as web's is a\n// dialog in a modal popover: a screen reader stays inside the view until it\n// closes, and a press outside the docked one lands on a scrim that draws\n// nothing and closes it. The docked one is placed by src/overlay's anchored\n// placement under its trigger, flipped above it where there is no room, and\n// kept above the software keyboard. Full screen, the results stop at the\n// keyboard's top edge, so the last of them can be scrolled into sight above\n// the keys.\n//\n// **It is Autocomplete around the header and the results**, as web's is: the\n// header's input is the autocomplete's field, so a ListBox or a List among\n// the results narrows as it is typed into, says how many rows a search leaves\n// to a screen reader, and takes a press on its first tap while the keyboard\n// is up, as it does anywhere inside an Autocomplete.\n//\n// **The header lines up with the search bar's.** The back button sits where\n// SearchField's magnifier does, its icon 28dp in, and the text starts at\n// 68dp, as the bar's does; the clear button's icon ends 28dp from the end. So\n// a view opened from a bar puts its input where the bar's was.\n//\n// **Focus goes to the input and back.** The input takes the keyboard's focus\n// as the view opens, and a screen reader is sent to it once the view shows,\n// and back to the trigger once it has gone. The back button closes it, as\n// Android's back gesture, VoiceOver's escape gesture and Escape on web do.\n// It fades and scales in and out, as src/overlay's anchored panels do, and\n// at once under reduced motion.\n\n// The page's full-screen header, and the docked view's bounds.\nconst FULL_HEADER = 72\nconst MIN_WIDTH = 360\nconst MAX_WIDTH = 720\nconst MIN_RESULTS = 240\n\n// The docked view's scrim takes presses and draws nothing.\nconst UNSEEN: ViewStyle = { opacity: 0 }\n\nconst stylesOf = themedStyles(\n ({ colors, radii, shadows, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // 4dp in from the header's padding, so the icon inside the 40dp button\n // sits 28dp in, where the search bar draws its magnifier.\n back: {\n marginStart: spacing.xs,\n },\n // 4dp in from the padding, so the icon inside the 40dp button ends 28dp\n // from the end, as the search bar's does.\n clear: {\n marginEnd: spacing.xs,\n },\n // The page's divider under the header, in the outline role.\n divider: {\n backgroundColor: colors.outline,\n flexShrink: 0,\n height: 1,\n },\n docked: {\n borderRadius: radii.xl,\n boxShadow: shadows.elevation3,\n },\n full: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n header: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n gap: spacing.sm,\n paddingHorizontal: spacing.lg,\n },\n // Full screen, the results take what the header leaves, and scroll\n // inside it.\n resultsFull: {\n flex: 1,\n },\n surface: {\n backgroundColor: colors.surfaceContainerHigh,\n overflow: 'hidden',\n },\n }),\n)\n\ntype PanelProps = Omit<\n SearchViewContentProps,\n | 'backLabel'\n | 'clearLabel'\n | 'defaultInputValue'\n | 'filter'\n | 'inputValue'\n | 'onInputChange'\n> & {\n readonly anchor: RefObject<HostInstance | null>\n readonly backLabel: string\n readonly clearLabel: string\n readonly close: () => void\n readonly docked: boolean\n readonly isOpen: boolean\n readonly setInput: (input: ComponentRef<typeof TextInput> | null) => void\n readonly setPresent: (present: boolean) => void\n}\n\ntype SearchViewContentProps<T extends object = object> = Omit<\n AutocompleteProps<T>,\n 'children'\n> & {\n /**\n * What the back button is called, for a screen reader. Left out, the\n * library names it in the `I18nProvider`'s locale, or the device's outside\n * one, \"Back\" in English.\n */\n readonly backLabel?: string\n /** The results: a ListBox or a List, which typing narrows. */\n readonly children?: ReactNode\n /**\n * What the clear button is called, for a screen reader. Left out, it is\n * the name React Aria gives web's in the `I18nProvider`'s locale, or the\n * device's outside one, \"Clear search\" in English.\n */\n readonly clearLabel?: string\n /**\n * What is searched, for a screen reader. It names both the view and its\n * input, and is read rather than shown; `placeholder` is what is seen.\n */\n readonly label: string\n /** The supporting text in the empty input, which is what a person reads. */\n readonly placeholder?: string\n readonly ref?: Ref<HostInstance>\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\ntype SearchViewProps = {\n /**\n * The Button or IconButton that opens the view, and `SearchView.Content`.\n */\n readonly children?: ReactNode\n /** Whether the view starts open, when it keeps its own state. */\n readonly defaultOpen?: boolean\n /** Whether the view is open, when the call site holds the state. */\n readonly isOpen?: boolean\n /** Called with the new state as the view opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\n// What the content reads from the root: the open state, and the trigger's\n// node, which the docked view is placed under and focus goes back to.\ntype SearchViewRoot = {\n readonly anchor: RefObject<HostInstance | null>\n readonly state: OverlayTriggerState\n}\n\nconst SearchViewContext = createContext<null | SearchViewRoot>(null)\n\n// Empties the input from the clear button, and hands the keyboard back to it,\n// so the next search is typed straight in.\nfunction clearOf(\n autocomplete: AutocompleteValue,\n input: ComponentRef<typeof TextInput> | null,\n) {\n return () => {\n autocomplete.setInputValue('')\n input?.focus()\n }\n}\n\n// The docked view: as wide as what opened it, between the page's bounds,\n// and placed under it.\nfunction dockedOf(placement: AnchoredPlacement): ViewStyle {\n return {\n ...placement.style,\n transformOrigin: PANEL_ORIGINS[placement.side],\n width: Math.min(\n MAX_WIDTH,\n Math.max(MIN_WIDTH, placement.anchorWidth ?? MIN_WIDTH),\n ),\n }\n}\n\n// The full-screen view's content inside the safe area, and above the\n// keyboard where the keyboard reaches further up than the safe area's own\n// bottom inset.\nfunction fullOf(insets: EdgeInsets, covered: number): ViewStyle {\n return {\n ...insetsOf(insets),\n paddingBottom: Math.max(insets.bottom, covered),\n transformOrigin: 'top',\n }\n}\n\n// Where the view's bottom edge is in the window, kept for the keyboard to be\n// measured against.\nfunction measureBottomOf(\n panel: HostInstance | null,\n setBottom: (bottom: number) => void,\n) {\n return () => {\n panel?.measureInWindow((_x, y, _width, height) => {\n setBottom(y + height)\n })\n }\n}\n\nfunction minHeightOf(minHeight: number): ViewStyle {\n return { minHeight }\n}\n\n// The docked view's results: at least the page's 240dp, and short enough\n// that the view stays within two thirds of the window.\nfunction resultsOf(windowHeight: number, header: number): ViewStyle {\n return {\n maxHeight: (windowHeight * 2) / 3 - header - 1,\n minHeight: MIN_RESULTS,\n }\n}\n\n/**\n * The view a search opens into: full screen in a compact window, docked\n * under what opened it in a wider one. Pass `isOpen` with `onOpenChange` to\n * hold the open state, or `defaultOpen` to let it keep its own.\n *\n * ```tsx\n * <SearchView>\n * <IconButton aria-label=\"Search\">\n * <SearchIcon />\n * </IconButton>\n * <SearchView.Content label=\"Search\" placeholder=\"Search\">\n * <ListBox aria-label=\"Results\">…</ListBox>\n * </SearchView.Content>\n * </SearchView>\n * ```\n *\n * Composed as Popover is: a `Button`, `IconButton` or `Chip` placed directly\n * inside `SearchView` opens the view, and `SearchView.Content` is the view\n * itself.\n */\nfunction SearchView({\n children,\n defaultOpen,\n isOpen,\n onOpenChange,\n}: SearchViewProps) {\n const state = useOverlayTriggerState({ defaultOpen, isOpen, onOpenChange })\n const anchor = useRef<HostInstance>(null)\n const slots = useMemo<ButtonSlots>(\n () => ({\n default: () => {\n state.open()\n },\n trigger: { expanded: state.isOpen, ref: anchor },\n }),\n [state],\n )\n const root = useMemo<SearchViewRoot>(() => ({ anchor, state }), [state])\n\n return (\n <SearchViewContext value={root}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </SearchViewContext>\n )\n}\n\n/**\n * The view: the header with its back button, input and clear button, and\n * the results under it, inside an Autocomplete, so typing narrows them. What\n * has been typed is the autocomplete's: pass `inputValue` with\n * `onInputChange` to control it, or `defaultInputValue` to let it keep its\n * own, which starts again each time the view opens.\n *\n * `style`, `ref` and `testID` land on the view's surface.\n */\nfunction SearchViewContent<T extends object = object>({\n backLabel,\n clearLabel,\n defaultInputValue,\n filter,\n inputValue,\n label,\n onInputChange,\n ...props\n}: SearchViewContentProps<T>) {\n const root = use(SearchViewContext)\n\n if (root === null) {\n throw new Error('SearchView.Content is drawn inside SearchView.')\n }\n\n const { anchor, state } = root\n const messages = useMessages()\n const docked = useWindowSizeClass() !== 'compact'\n const [present, setPresent] = useState(state.isOpen)\n const [input, setInput] = useState<ComponentRef<typeof TextInput> | null>(\n null,\n )\n const close = useCallback(() => {\n state.close()\n }, [state])\n const slots = useMemo<ButtonSlots>(() => ({ close }), [close])\n\n // Mounted the moment it opens, and kept until its exit has run.\n if (state.isOpen && !present) {\n setPresent(true)\n }\n\n useReturnFocus(present, false, anchor)\n\n if (!present) {\n return null\n }\n\n return (\n <Autocomplete<T>\n defaultInputValue={defaultInputValue}\n filter={filter}\n inputValue={inputValue}\n onInputChange={onInputChange}\n >\n <ModalWindow\n isKeyboardDismissDisabled={false}\n label={label}\n labelledBy={undefined}\n onClose={close}\n onScrimPress={state.isOpen ? close : undefined}\n scrim={UNSEEN}\n // Full screen it is shown at once, so the screen reader goes to the\n // input as the window shows; docked, once the view has been placed.\n title={docked ? null : input}\n >\n <ButtonSlotContext value={slots}>\n <SearchViewPanel\n {...props}\n anchor={anchor}\n backLabel={backLabel ?? messages.back}\n clearLabel={clearLabel ?? messages.clearSearch}\n close={close}\n docked={docked}\n isOpen={state.isOpen}\n label={label}\n setInput={setInput}\n setPresent={setPresent}\n />\n </ButtonSlotContext>\n </ModalWindow>\n </Autocomplete>\n )\n}\n\n// The surface, drawn in the `Modal` so the anchored placement measures the\n// layer it is drawn in. Read inside the Autocomplete, whose value the input\n// shows and reports each edit to.\nfunction SearchViewPanel({\n anchor,\n backLabel,\n children,\n clearLabel,\n close,\n docked,\n isOpen,\n label,\n placeholder,\n ref,\n setInput,\n setPresent,\n style,\n ...props\n}: PanelProps) {\n const theme = useTheme()\n const styles = stylesOf(theme)\n const { colors, sizing, typography } = theme\n const autocomplete = use(AutocompleteContext)\n const window = useWindowDimensions()\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const keyboardTop = useKeyboardTop()\n const placement = useAnchoredPlacement({ align: 'start', anchor })\n const motion = usePanelMotion(isOpen, !docked || placement.placed, setPresent)\n const [panel, setPanel] = useState<HostInstance | null>(null)\n const [input, setOwnInput] = useState<ComponentRef<typeof TextInput> | null>(\n null,\n )\n const [bottom, setBottom] = useState<null | number>(null)\n const header =\n (docked ? sizing.controlLg : FULL_HEADER) +\n typography.bodyLargeLineHeight * (window.fontScale - 1)\n // Full screen, how far the keyboard reaches up over the view. iOS draws it\n // over the window, where Android's `Modal` shrinks the window to make room\n // and leaves it nothing to cover.\n const covered =\n keyboardTop === null || bottom === null ? 0 : bottom - keyboardTop\n\n useFocusOnPlaced(docked && placement.placed, input)\n\n if (autocomplete === null) {\n return null\n }\n\n return (\n <Animated.View\n {...panelRoleOf('dialog', undefined)}\n aria-label={Platform.OS === 'web' ? undefined : label}\n onAccessibilityEscape={close}\n {...props}\n onLayout={docked ? placement.onLayout : measureBottomOf(panel, setBottom)}\n ref={refsOf(setPanel, ref)}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.surface,\n docked ? styles.docked : styles.full,\n docked ? dockedOf(placement) : fullOf(insets, covered),\n motion,\n style,\n )}\n >\n <View\n style={composeStyles<ViewStyle>(styles.header, minHeightOf(header))}\n >\n <IconButton aria-label={backLabel} slot=\"close\" style={styles.back}>\n <ArrowBackGlyph color={colors.onSurface} />\n </IconButton>\n <FieldInput\n aria-label={label}\n // A search view opens to be typed into, so the input takes the\n // keyboard as it shows rather than leaving it to the back button.\n autoFocus\n onChangeText={autocomplete.setInputValue}\n placeholder={placeholder}\n ref={refsOf(setOwnInput, setInput)}\n returnKeyType=\"search\"\n role=\"searchbox\"\n value={autocomplete.inputValue}\n />\n {autocomplete.inputValue === '' ? null : (\n <IconButton\n aria-label={clearLabel}\n onPress={clearOf(autocomplete, input)}\n style={styles.clear}\n >\n <CloseGlyph />\n </IconButton>\n )}\n </View>\n <View style={styles.divider} />\n <View\n style={docked ? resultsOf(window.height, header) : styles.resultsFull}\n >\n {children}\n </View>\n </Animated.View>\n )\n}\n\nSearchView.Content = SearchViewContent\n\nexport { SearchView, SearchViewContent }\nexport type { SearchViewContentProps, SearchViewProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAMoD,cAAc;AACpB,MAAMC,YAAY;AAClB,MAAMC,YAAY;AAClB,MAAMC,cAAc;AAGpB,MAAMC,SAAoB,EAAEC,SAAS,EAAE;AAEvC,MAAMC,WAAWT,cACd,EAAEU,QAAQC,OAAOC,SAASC,cACzB5C,WAAW6C,OAAO;CAGhBC,MAAM,EACJC,aAAaH,QAAQI,GACvB;CAGAC,OAAO,EACLC,WAAWN,QAAQI,GACrB;CAEAG,SAAS;EACPC,iBAAiBX,OAAOY;EACxBC,YAAY;EACZC,QAAQ;CACV;CACAC,QAAQ;EACNC,cAAcf,MAAMgB;EACpBC,WAAWhB,QAAQiB;CACrB;CACAC,MAAM;EACJC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC,KAAK;CACP;CACAC,QAAQ;EACNC,YAAY;EACZC,eAAe;EACff,YAAY;EACZgB,KAAK1B,QAAQ2B;EACbC,mBAAmB5B,QAAQ6B;CAC7B;CAGAC,aAAa,EACXC,MAAM,EACR;CACAC,SAAS;EACPxB,iBAAiBX,OAAOoC;EACxBC,UAAU;CACZ;AACF,CAAC,CACL;AAuEA,MAAMyB,oBAAoB9G,cAAqC,IAAI;AAInE,SAAS+G,QACPC,cACAjB,OACA;CACA,aAAa;EACXiB,aAAaC,cAAc,EAAE;EAC7BlB,OAAOmB,MAAM;CACf;AACF;AAIA,SAASC,SAASC,WAAyC;CACzD,OAAO;EACL,GAAGA,UAAUb;EACbc,iBAA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ostInstance","StyleProp","TextInput","ViewStyle","AnimatedStyle","EdgeInsets","OverlayTriggerState","createContext","use","useCallback","useMemo","useRef","useState","Platform","StyleSheet","useWindowDimensions","View","Animated","SafeAreaInsetsContext","useOverlayTriggerState","AutocompleteValue","ButtonSlots","AnchoredPlacement","ResolvedTheme","AutocompleteProps","AutocompleteContext","ButtonSlotContext","FieldInput","ArrowBackGlyph","CloseGlyph","useWindowSizeClass","useMessages","insetsOf","ModalWindow","NO_INSETS","panelRoleOf","useAnchoredPlacement","useKeyboardTop","PANEL_ORIGINS","useFocusOnPlaced","usePanelMotion","useReturnFocus","refsOf","useTheme","composeStyles","themedStyles","Autocomplete","IconButton","FULL_HEADER","MIN_WIDTH","MAX_WIDTH","MIN_RESULTS","UNSEEN","opacity","stylesOf","colors","radii","shadows","spacing","create","back","marginStart","xs","clear","marginEnd","divider","backgroundColor","outline","flexShrink","height","docked","borderRadius","xl","boxShadow","elevation3","full","bottom","left","position","right","top","header","alignItems","flexDirection","gap","sm","paddingHorizontal","lg","resultsFull","flex","surface","surfaceContainerHigh","overflow","PanelProps","Omit","SearchViewContentProps","anchor","backLabel","clearLabel","close","isOpen","setInput","input","setPresent","present","T","children","label","placeholder","ref","style","testID","SearchViewProps","defaultOpen","onOpenChange","SearchViewRoot","state","SearchViewContext","clearOf","autocomplete","setInputValue","focus","dockedOf","placement","transformOrigin","side","width","Math","min","max","anchorWidth","fullOf","insets","covered","paddingBottom","measureBottomOf","panel","setBottom","measureInWindow","_x","y","_width","minHeightOf","minHeight","resultsOf","windowHeight","maxHeight","SearchView","t0","$","_c","t1","t2","open","t3","expanded","t4","default","trigger","slots","t5","root","t6","t7","SearchViewContent","defaultInputValue","filter","inputValue","onInputChange","props","Error","messages","undefined","clearSearch","t8","t9","t10","SearchViewPanel","theme","styles","sizing","typography","window","keyboardTop","align","motion","placed","setPanel","setOwnInput","controlLg","bodyLargeLineHeight","fontScale","Symbol","for","OS","onLayout","T0","onSurface","t11","t12","t13","t14","t15","t16","t17","t18","t19","Content","_c"],"sources":["../../../src/components/search-view/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref, RefObject } from 'react'\nimport type {\n HostInstance,\n StyleProp,\n TextInput,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { EdgeInsets } from 'react-native-safe-area-context'\nimport type { OverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport {\n createContext,\n use,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\nimport { useOverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport type { AutocompleteValue } from '../../autocomplete'\nimport type { ButtonSlots } from '../../button/slots'\nimport type { AnchoredPlacement } from '../../overlay'\nimport type { ResolvedTheme } from '../../theme/scope'\nimport type { AutocompleteProps } from '../autocomplete'\n\nimport { AutocompleteContext } from '../../autocomplete'\nimport { ButtonSlotContext } from '../../button/slots'\nimport { FieldInput } from '../../field'\nimport { ArrowBackGlyph, CloseGlyph } from '../../glyphs'\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport { useMessages } from '../../i18n/provider'\nimport { insetsOf, ModalWindow, NO_INSETS, panelRoleOf } from '../../modal'\nimport { useAnchoredPlacement } from '../../overlay'\nimport { useKeyboardTop } from '../../overlay/keyboard'\nimport {\n PANEL_ORIGINS,\n useFocusOnPlaced,\n usePanelMotion,\n useReturnFocus,\n} from '../../overlay/panel'\nimport { refsOf } from '../../ref'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { Autocomplete } from '../autocomplete'\nimport { IconButton } from '../icon-button'\n\n// kanso-ui's SearchView, the search page's search view: what a search opens\n// into. A header holds a back button, the input and a clear button, over a\n// 1dp divider in the outline role, and the results run under it. Both of the\n// page's forms are surface container high, with the input in body large on\n// surface over a supporting text in on surface variant, the back icon in on\n// surface and the clear icon in on surface variant.\n//\n// **Which form is the window's.** In a compact window it is the page's\n// full-screen view: the whole window, square, with a 72dp header, its content\n// inside the safe area while its fill runs on under it. From the medium\n// window up, the docked view: dropped under what opened it, as wide as that\n// and held between the page's 360dp and 720dp, with a 28dp corner, a 56dp\n// header, results at least 240dp tall and the whole view no taller than two\n// thirds of the window, at elevation 3, as web's takes them from Compose's\n// docked search bar. Both headers grow by as much as the input's line does at\n// the device's text size.\n//\n// **Both forms are drawn in a `Modal`**, through src/modal, as web's is a\n// dialog in a modal popover: a screen reader stays inside the view until it\n// closes, and a press outside the docked one lands on a scrim that draws\n// nothing and closes it. The docked one is placed by src/overlay's anchored\n// placement under its trigger, flipped above it where there is no room, and\n// kept above the software keyboard. Full screen, the results stop at the\n// keyboard's top edge, so the last of them can be scrolled into sight above\n// the keys.\n//\n// **It is Autocomplete around the header and the results**, as web's is: the\n// header's input is the autocomplete's field, so a ListBox or a List among\n// the results narrows as it is typed into, says how many rows a search leaves\n// to a screen reader, and takes a press on its first tap while the keyboard\n// is up, as it does anywhere inside an Autocomplete.\n//\n// **The header lines up with the search bar's.** The back button sits where\n// SearchField's magnifier does, its icon 28dp in, and the text starts at\n// 68dp, as the bar's does; the clear button's icon ends 28dp from the end. So\n// a view opened from a bar puts its input where the bar's was.\n//\n// **Focus goes to the input and back.** The input takes the keyboard's focus\n// as the view opens, and a screen reader is sent to it once the view shows,\n// and back to the trigger once it has gone. The back button closes it, as\n// Android's back gesture, VoiceOver's escape gesture and Escape on web do.\n// It fades and scales in and out, as src/overlay's anchored panels do, and\n// at once under reduced motion.\n\n// The page's full-screen header, and the docked view's bounds.\nconst FULL_HEADER = 72\nconst MIN_WIDTH = 360\nconst MAX_WIDTH = 720\nconst MIN_RESULTS = 240\n\n// The docked view's scrim takes presses and draws nothing.\nconst UNSEEN: ViewStyle = { opacity: 0 }\n\nconst stylesOf = themedStyles(\n ({ colors, radii, shadows, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // 4dp in from the header's padding, so the icon inside the 40dp button\n // sits 28dp in, where the search bar draws its magnifier.\n back: {\n marginStart: spacing.xs,\n },\n // 4dp in from the padding, so the icon inside the 40dp button ends 28dp\n // from the end, as the search bar's does.\n clear: {\n marginEnd: spacing.xs,\n },\n // The page's divider under the header, in the outline role.\n divider: {\n backgroundColor: colors.outline,\n flexShrink: 0,\n height: 1,\n },\n docked: {\n borderRadius: radii.xl,\n boxShadow: shadows.elevation3,\n },\n full: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n header: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n gap: spacing.sm,\n paddingHorizontal: spacing.lg,\n },\n // Full screen, the results take what the header leaves, and scroll\n // inside it.\n resultsFull: {\n flex: 1,\n },\n surface: {\n backgroundColor: colors.surfaceContainerHigh,\n overflow: 'hidden',\n },\n }),\n)\n\ntype PanelProps = Omit<\n SearchViewContentProps,\n | 'backLabel'\n | 'clearLabel'\n | 'defaultInputValue'\n | 'filter'\n | 'inputValue'\n | 'onInputChange'\n> & {\n readonly anchor: RefObject<HostInstance | null>\n readonly backLabel: string\n readonly clearLabel: string\n readonly close: () => void\n readonly docked: boolean\n readonly isOpen: boolean\n readonly setInput: (input: ComponentRef<typeof TextInput> | null) => void\n readonly setPresent: (present: boolean) => void\n}\n\ntype SearchViewContentProps<T extends object = object> = Omit<\n AutocompleteProps<T>,\n 'children'\n> & {\n /**\n * What the back button is called, for a screen reader. Left out, the\n * library names it in the `I18nProvider`'s locale, or the device's outside\n * one, \"Back\" in English.\n */\n readonly backLabel?: string\n /** The results: a ListBox or a List, which typing narrows. */\n readonly children?: ReactNode\n /**\n * What the clear button is called, for a screen reader. Left out, it is\n * the name React Aria gives web's in the `I18nProvider`'s locale, or the\n * device's outside one, \"Clear search\" in English.\n */\n readonly clearLabel?: string\n /**\n * What is searched, for a screen reader. It names both the view and its\n * input, and is read rather than shown; `placeholder` is what is seen.\n */\n readonly label: string\n /** The supporting text in the empty input, which is what a person reads. */\n readonly placeholder?: string\n readonly ref?: Ref<HostInstance>\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\ntype SearchViewProps = {\n /**\n * The Button or IconButton that opens the view, and `SearchView.Content`.\n */\n readonly children?: ReactNode\n /** Whether the view starts open, when it keeps its own state. */\n readonly defaultOpen?: boolean\n /** Whether the view is open, when the call site holds the state. */\n readonly isOpen?: boolean\n /** Called with the new state as the view opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\n// What the content reads from the root: the open state, and the trigger's\n// node, which the docked view is placed under and focus goes back to.\ntype SearchViewRoot = {\n readonly anchor: RefObject<HostInstance | null>\n readonly state: OverlayTriggerState\n}\n\nconst SearchViewContext = createContext<null | SearchViewRoot>(null)\n\n// Empties the input from the clear button, and hands the keyboard back to it,\n// so the next search is typed straight in.\nfunction clearOf(\n autocomplete: AutocompleteValue,\n input: ComponentRef<typeof TextInput> | null,\n) {\n return () => {\n autocomplete.setInputValue('')\n input?.focus()\n }\n}\n\n// The docked view: as wide as what opened it, between the page's bounds,\n// and placed under it.\nfunction dockedOf(placement: AnchoredPlacement): ViewStyle {\n return {\n ...placement.style,\n transformOrigin: PANEL_ORIGINS[placement.side],\n width: Math.min(\n MAX_WIDTH,\n Math.max(MIN_WIDTH, placement.anchorWidth ?? MIN_WIDTH),\n ),\n }\n}\n\n// The full-screen view's content inside the safe area, and above the\n// keyboard where the keyboard reaches further up than the safe area's own\n// bottom inset.\nfunction fullOf(insets: EdgeInsets, covered: number): ViewStyle {\n return {\n ...insetsOf(insets),\n paddingBottom: Math.max(insets.bottom, covered),\n transformOrigin: 'top',\n }\n}\n\n// Where the view's bottom edge is in the window, kept for the keyboard to be\n// measured against.\nfunction measureBottomOf(\n panel: HostInstance | null,\n setBottom: (bottom: number) => void,\n) {\n return () => {\n panel?.measureInWindow((_x, y, _width, height) => {\n setBottom(y + height)\n })\n }\n}\n\nfunction minHeightOf(minHeight: number): ViewStyle {\n return { minHeight }\n}\n\n// The docked view's results: at least the page's 240dp, and short enough\n// that the view stays within two thirds of the window.\nfunction resultsOf(windowHeight: number, header: number): ViewStyle {\n return {\n maxHeight: (windowHeight * 2) / 3 - header - 1,\n minHeight: MIN_RESULTS,\n }\n}\n\n/**\n * The view a search opens into: full screen in a compact window, docked\n * under what opened it in a wider one. Pass `isOpen` with `onOpenChange` to\n * hold the open state, or `defaultOpen` to let it keep its own.\n *\n * ```tsx\n * <SearchView>\n * <IconButton aria-label=\"Search\">\n * <SearchIcon />\n * </IconButton>\n * <SearchView.Content label=\"Search\" placeholder=\"Search\">\n * <ListBox aria-label=\"Results\">…</ListBox>\n * </SearchView.Content>\n * </SearchView>\n * ```\n *\n * Composed as Popover is: a `Button`, `IconButton` or `Chip` placed directly\n * inside `SearchView` opens the view, and `SearchView.Content` is the view\n * itself.\n */\nfunction SearchView({\n children,\n defaultOpen,\n isOpen,\n onOpenChange,\n}: SearchViewProps) {\n const state = useOverlayTriggerState({ defaultOpen, isOpen, onOpenChange })\n const anchor = useRef<HostInstance>(null)\n const slots = useMemo<ButtonSlots>(\n () => ({\n default: () => {\n state.open()\n },\n trigger: { expanded: state.isOpen, ref: anchor },\n }),\n [state],\n )\n const root = useMemo<SearchViewRoot>(() => ({ anchor, state }), [state])\n\n return (\n <SearchViewContext value={root}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </SearchViewContext>\n )\n}\n\n/**\n * The view: the header with its back button, input and clear button, and\n * the results under it, inside an Autocomplete, so typing narrows them. What\n * has been typed is the autocomplete's: pass `inputValue` with\n * `onInputChange` to control it, or `defaultInputValue` to let it keep its\n * own, which starts again each time the view opens.\n *\n * `style`, `ref` and `testID` land on the view's surface.\n */\nfunction SearchViewContent<T extends object = object>({\n backLabel,\n clearLabel,\n defaultInputValue,\n filter,\n inputValue,\n label,\n onInputChange,\n ...props\n}: SearchViewContentProps<T>) {\n const root = use(SearchViewContext)\n\n if (root === null) {\n throw new Error('SearchView.Content is drawn inside SearchView.')\n }\n\n const { anchor, state } = root\n const messages = useMessages()\n const docked = useWindowSizeClass() !== 'compact'\n const [present, setPresent] = useState(state.isOpen)\n const [input, setInput] = useState<ComponentRef<typeof TextInput> | null>(\n null,\n )\n const close = useCallback(() => {\n state.close()\n }, [state])\n const slots = useMemo<ButtonSlots>(() => ({ close }), [close])\n\n // Mounted the moment it opens, and kept until its exit has run.\n if (state.isOpen && !present) {\n setPresent(true)\n }\n\n useReturnFocus(present, false, anchor)\n\n if (!present) {\n return null\n }\n\n return (\n <Autocomplete<T>\n defaultInputValue={defaultInputValue}\n filter={filter}\n inputValue={inputValue}\n onInputChange={onInputChange}\n >\n <ModalWindow\n isKeyboardDismissDisabled={false}\n label={label}\n labelledBy={undefined}\n onClose={close}\n onScrimPress={state.isOpen ? close : undefined}\n scrim={UNSEEN}\n // Full screen it is shown at once, so the screen reader goes to the\n // input as the window shows; docked, once the view has been placed.\n title={docked ? null : input}\n >\n <ButtonSlotContext value={slots}>\n <SearchViewPanel\n {...props}\n anchor={anchor}\n backLabel={backLabel ?? messages.back}\n clearLabel={clearLabel ?? messages.clearSearch}\n close={close}\n docked={docked}\n isOpen={state.isOpen}\n label={label}\n setInput={setInput}\n setPresent={setPresent}\n />\n </ButtonSlotContext>\n </ModalWindow>\n </Autocomplete>\n )\n}\n\n// The surface, drawn in the `Modal` so the anchored placement measures the\n// layer it is drawn in. Read inside the Autocomplete, whose value the input\n// shows and reports each edit to.\nfunction SearchViewPanel({\n anchor,\n backLabel,\n children,\n clearLabel,\n close,\n docked,\n isOpen,\n label,\n placeholder,\n ref,\n setInput,\n setPresent,\n style,\n ...props\n}: PanelProps) {\n const theme = useTheme()\n const styles = stylesOf(theme)\n const { colors, sizing, typography } = theme\n const autocomplete = use(AutocompleteContext)\n const window = useWindowDimensions()\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const keyboardTop = useKeyboardTop()\n const placement = useAnchoredPlacement({ align: 'start', anchor })\n const motion = usePanelMotion(isOpen, !docked || placement.placed, setPresent)\n const [panel, setPanel] = useState<HostInstance | null>(null)\n const [input, setOwnInput] = useState<ComponentRef<typeof TextInput> | null>(\n null,\n )\n const [bottom, setBottom] = useState<null | number>(null)\n const header =\n (docked ? sizing.controlLg : FULL_HEADER) +\n typography.bodyLargeLineHeight * (window.fontScale - 1)\n // Full screen, how far the keyboard reaches up over the view. iOS and\n // Android both draw it over the window, which runs edge to edge and does\n // not shrink to make room, so the view keeps out of its way itself.\n const covered =\n keyboardTop === null || bottom === null ? 0 : bottom - keyboardTop\n\n useFocusOnPlaced(docked && placement.placed, input)\n\n if (autocomplete === null) {\n return null\n }\n\n return (\n <Animated.View\n {...panelRoleOf('dialog', undefined)}\n aria-label={Platform.OS === 'web' ? undefined : label}\n onAccessibilityEscape={close}\n {...props}\n onLayout={docked ? placement.onLayout : measureBottomOf(panel, setBottom)}\n ref={refsOf(setPanel, ref)}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.surface,\n docked ? styles.docked : styles.full,\n docked ? dockedOf(placement) : fullOf(insets, covered),\n motion,\n style,\n )}\n >\n <View\n style={composeStyles<ViewStyle>(styles.header, minHeightOf(header))}\n >\n <IconButton aria-label={backLabel} slot=\"close\" style={styles.back}>\n <ArrowBackGlyph color={colors.onSurface} />\n </IconButton>\n <FieldInput\n aria-label={label}\n // A search view opens to be typed into, so the input takes the\n // keyboard as it shows rather than leaving it to the back button.\n autoFocus\n onChangeText={autocomplete.setInputValue}\n placeholder={placeholder}\n ref={refsOf(setOwnInput, setInput)}\n returnKeyType=\"search\"\n role=\"searchbox\"\n value={autocomplete.inputValue}\n />\n {autocomplete.inputValue === '' ? null : (\n <IconButton\n aria-label={clearLabel}\n onPress={clearOf(autocomplete, input)}\n style={styles.clear}\n >\n <CloseGlyph />\n </IconButton>\n )}\n </View>\n <View style={styles.divider} />\n <View\n style={docked ? resultsOf(window.height, header) : styles.resultsFull}\n >\n {children}\n </View>\n </Animated.View>\n )\n}\n\nSearchView.Content = SearchViewContent\n\nexport { SearchView, SearchViewContent }\nexport type { SearchViewContentProps, SearchViewProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAMoD,cAAc;AACpB,MAAMC,YAAY;AAClB,MAAMC,YAAY;AAClB,MAAMC,cAAc;AAGpB,MAAMC,SAAoB,EAAEC,SAAS,EAAE;AAEvC,MAAMC,WAAWT,cACd,EAAEU,QAAQC,OAAOC,SAASC,cACzB5C,WAAW6C,OAAO;CAGhBC,MAAM,EACJC,aAAaH,QAAQI,GACvB;CAGAC,OAAO,EACLC,WAAWN,QAAQI,GACrB;CAEAG,SAAS;EACPC,iBAAiBX,OAAOY;EACxBC,YAAY;EACZC,QAAQ;CACV;CACAC,QAAQ;EACNC,cAAcf,MAAMgB;EACpBC,WAAWhB,QAAQiB;CACrB;CACAC,MAAM;EACJC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC,KAAK;CACP;CACAC,QAAQ;EACNC,YAAY;EACZC,eAAe;EACff,YAAY;EACZgB,KAAK1B,QAAQ2B;EACbC,mBAAmB5B,QAAQ6B;CAC7B;CAGAC,aAAa,EACXC,MAAM,EACR;CACAC,SAAS;EACPxB,iBAAiBX,OAAOoC;EACxBC,UAAU;CACZ;AACF,CAAC,CACL;AAuEA,MAAMyB,oBAAoB9G,cAAqC,IAAI;AAInE,SAAS+G,QACPC,cACAjB,OACA;CACA,aAAa;EACXiB,aAAaC,cAAc,EAAE;EAC7BlB,OAAOmB,MAAM;CACf;AACF;AAIA,SAASC,SAASC,WAAyC;CACzD,OAAO;EACL,GAAGA,UAAUb;EACbc,iBAAiBtF,cAAcqF,UAAUE;EACzCC,OAAOC,KAAKC,IACV9E,WACA6E,KAAKE,IAAIhF,WAAW0E,UAAUO,eAAejF,SAAS,CACxD;CACF;AACF;AAKA,SAASkF,OAAOC,QAAoBC,SAA4B;CAC9D,OAAO;EACL,GAAGrG,SAASoG,MAAM;EACl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