@kanso-labs/kanso-ui 0.34.11 → 0.34.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar/index.js.map +1 -1
- package/dist/chip/index.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/styles.js.map +1 -1
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/color-area/index.js.map +1 -1
- package/dist/components/color-field/index.js.map +1 -1
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-slider/index.js.map +1 -1
- package/dist/components/color-swatch/index.js.map +1 -1
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/color-wheel/index.js.map +1 -1
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/container/index.js.map +1 -1
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/currency/index.js.map +1 -1
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/date-range-picker/index.js.map +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/disclosure/index.js.map +1 -1
- package/dist/components/disclosure-group/index.js.map +1 -1
- package/dist/components/drop-zone/index.js.map +1 -1
- package/dist/components/feed/index.js.map +1 -1
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/keycap/index.js.map +1 -1
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/list-detail/index.js.map +1 -1
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/supporting-pane/index.js.map +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tag/index.js.map +1 -1
- package/dist/components/text/index.js.map +1 -1
- package/dist/components/text-area/index.js.map +1 -1
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/token-field/index.js.map +1 -1
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tree/index.js.map +1 -1
- package/dist/control/index.js.map +1 -1
- package/dist/drag/hooks.js.map +1 -1
- package/dist/drag/index.js.map +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/hooks/useImageLoadingStatus.js.map +1 -1
- package/dist/hooks/useRipple.js.map +1 -1
- package/dist/hooks/useScrollable.js.map +1 -1
- package/dist/indicator/index.js.map +1 -1
- package/dist/node_modules/@stylexjs/stylex/lib/es/stylex.js.map +1 -1
- package/dist/render/useRender.js.map +1 -1
- package/dist/row/index.js.map +1 -1
- package/dist/segments/index.js.map +1 -1
- package/dist/styles/picker.js.map +1 -1
- package/package.json +5 -5
package/dist/field/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["FocusEvent","HTMLAttributes","ReactNode","Ref","ButtonProps","GroupProps","GroupRenderProps","InputProps","InputRenderProps","LabelProps","TextAreaProps","stylex","createContext","useContext","FieldError","FieldErrorContext","Group","Input","InputContext","Label","Button","RACButton","SelectStateContext","Text","TextArea","TextAreaContext","TextContext","useSlottedContext","VisuallyHidden","mergeStatefulStyles","mergeStyles","useInsideForm","fieldChromeStyles","groupStyles","BoxControl","label","BoxLabel","underLabel","FieldBoxProps","children","floatingLabel","isPopulated","leading","multiline","ref","HTMLDivElement","trailing","trigger","variant","FieldVariant","Omit","FieldInputProps","numeric","prefix","suffix","FieldLabelProps","state","Partial","FieldLabelState","FieldLabelVariant","Pick","FieldMessageProps","characterCount","characterLimitLabel","description","error","inset","maxLength","FieldTextAreaProps","autosize","FieldTriggerProps","FieldValueProps","HTMLElement","isFocused","isPlaceholder","OUTSIDE_BOX","BOX_CONTROLS","filled","fixed","floating","outlined","Record","BoxContext","boxContent","BoxContent","t0","$","_c","read","useFieldPopulated","populated","floated","isFocusWithin","t1","t2","props","outline","undefined","outlineLeading","outlineTrailing","outlineFocused","outlineNotch","outlineNotchOpen","t3","isDisabled","icon","iconMultiline","iconOutlined","iconDisabled","t4","column","columnFloating","columnDisabledFloating","columnDisabled","t5","boxLabel","boxLabelFloated","boxLabelOutlined","boxLabelOutlinedFloated","t6","t7","t8","isInvalid","iconError","t9","boxStyles","box","boxFloating","boxFixed","boxMultiline","boxLeading","boxTrailing","boxOutlined","boxOutlinedFloating","boxOutlinedMultiline","boxOutlinedError","boxError","boxOutlinedDisabled","boxDisabled","FieldBox","T0","t10","t11","FieldInput","placeholder","input","inputUnderLabel","inputUnderFloatingLabel","inputDisabled","control","Symbol","for","affixLine","affix","FieldSegments","segments","returnToStart","FieldTextArea","context","value","textArea","textAreaAutosize","autosizeCell","replica","FieldTrigger","FieldValue","hidden","valuePlaceholder","valuePlaceholderHidden","event","currentTarget","contains","relatedTarget","scrollLeft","select","selectionManager","selectedKeys","size","String","length","NO_STATE","FieldLabel","labelDisabled","labelError","labelFocused","FieldMessage","validation","invalid","insideForm","text","limit","hint","message","described","errorSlot","slots","errorMessage","messageError","messageStyles","written","messageLine","messageInset","counter"],"sources":["../../src/field/index.tsx"],"sourcesContent":["import type { FocusEvent, HTMLAttributes, ReactNode, Ref } from 'react';\nimport type { ButtonProps, GroupProps, GroupRenderProps, InputProps, InputRenderProps, LabelProps, TextAreaProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { FieldError, FieldErrorContext, Group, Input, InputContext, Label, Button as RACButton, SelectStateContext, Text, TextArea, TextAreaContext, TextContext, useSlottedContext, VisuallyHidden } from 'react-aria-components';\nimport { mergeStatefulStyles, mergeStyles } from '../styles/merge';\nimport { useInsideForm } from './root';\nimport { fieldChromeStyles, groupStyles } from './styles';\n\n// The chrome every field shares: the filled box with its label at the top, the\n// control inside it, and the line of supporting text under it. TextField drew\n// all of it on its own until the coverage plan brought a dozen more fields,\n// each of which would otherwise have written the same box a second time.\n//\n// Not a component of the library's own and not exported. Each field is still\n// React Aria's field component — TextField, NumberField, DateField — and these\n// are the parts it renders inside, which is what keeps the label association,\n// the description and error wiring, and validation on React Aria's side.\n//\n// Neither the notch nor the label can select on the state that drives them.\n// Both are children of the box and the state is the box's, and the filled\n// label reads it in CSS only because it changes type alone, which the box\n// hands down inherited — where the notch changes what it holds and the\n// label changes where it sits, and neither of those inherits. So the box's\n// content computes that state in React instead: focus from the box's own\n// render state, and a value from the control's context, which is where the\n// character counter reads it too. The border's colour is the box's,\n// inherited, which is what carries the hover, focus, error and disabled\n// roles to it.\n\n// What a control needs to know about the box around it: how the label is\n// drawn, and whether the control clears it with a margin — it does under\n// the filled box's label, and not under the outlined box's, whose label\n// sits on the outline rather than over the value.\ninterface BoxControl {\n label: BoxLabel;\n underLabel: boolean;\n}\n\n// How the box draws its label, for the control inside it — see the context\n// below.\ntype BoxLabel = 'fixed' | 'floating' | 'none';\ntype FieldBoxProps = {\n children?: ReactNode;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * Whether the control is holding anything, for a field whose control the\n * chrome cannot ask. It reads an input, a text area and a select's own\n * state; a control that is none of those — a token field's editable area,\n * say — says so here, and the floating label floats on it.\n */\n isPopulated?: boolean;\n /** What the field is for. */\n label: string;\n /** An icon at the start of the box, before the label and the control. */\n leading?: ReactNode;\n /**\n * Whether the box takes its height from the control inside it rather\n * than the page's 56dp, for a text area.\n * @default false\n */\n multiline?: boolean;\n /**\n * The box's own element. A field whose box is what something else is\n * anchored to needs it — a select's list is positioned against the box and\n * takes its width from it, which is what makes the two the same width.\n */\n ref?: Ref<HTMLDivElement>;\n /** An icon at the end of the box, after the control. */\n trailing?: ReactNode;\n /**\n * A press target covering the whole box, for a field whose box opens\n * something rather than taking a keystroke — {@link FieldTrigger}. Drawn\n * in the box itself rather than in the column the label and the control\n * share, so the padding and the icons open it too.\n */\n trigger?: ReactNode;\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<GroupProps, 'children'>;\n\n// `prefix` is also an HTML attribute — the RDFa one, which nothing here\n// wants — and React's element types carry it as a string, so it is left out\n// of the props taken from React Aria to make room for the affix.\ntype FieldInputProps = Omit<InputProps, 'prefix'> & {\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column.\n * @default false\n */\n numeric?: boolean;\n /**\n * Text before the value on its line, shown while the field is focused or\n * holds a value.\n */\n prefix?: ReactNode;\n /**\n * Text after the value on its line, shown while the field is focused or\n * holds a value.\n */\n suffix?: ReactNode;\n};\ntype FieldLabelProps = LabelProps & {\n /**\n * The states the colour follows. Disabled wins over error, and error over\n * focus, so a focused invalid field keeps its error colour.\n */\n state?: Partial<FieldLabelState>;\n /**\n * Where the label sits. `field` is inside a box, positioned and typed by\n * whatever renders it. `group` is above a group of controls, which has no\n * box to float a label in, so this one carries its type itself.\n * @default 'field'\n */\n variant?: FieldLabelVariant;\n};\ntype FieldLabelState = Pick<GroupRenderProps, 'isDisabled' | 'isFocusWithin' | 'isInvalid'>;\ntype FieldLabelVariant = 'field' | 'group';\ninterface FieldMessageProps {\n /**\n * Whether to count the characters the control holds at the end of the\n * line, against `maxLength` where there is one. The count is read off the\n * field's own input or text area context.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * It is read with the field on focus rather than as the value changes, so\n * it names the limit and not what is left of it.\n * @default `Up to ${maxLength} characters`, singular for a limit of one\n */\n characterLimitLabel?: string | undefined;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string | undefined;\n /** The problem with the current value, in words. */\n error?: string | undefined;\n /**\n * Whether the line is indented to a box's inline padding, so it starts\n * where a value above it does. Off for a field with no box to line up with.\n * @default true\n */\n inset?: boolean;\n /** The limit the count is shown against. */\n maxLength?: number | undefined;\n}\ntype FieldTextAreaProps = TextAreaProps & {\n /**\n * Whether the control grows with the text it holds, from the rows it asks\n * for. Off, it keeps its rows and scrolls.\n * @default false\n */\n autosize?: boolean;\n};\ntype FieldTriggerProps = ButtonProps;\ntype FieldValueProps = HTMLAttributes<HTMLElement> & {\n /**\n * Whether the field has focus. A hidden placeholder appears while it does,\n * the way an input's does.\n * @default false\n */\n isFocused?: boolean;\n /**\n * Whether nothing has been chosen yet, so what is drawn is the placeholder\n * rather than a value.\n * @default false\n */\n isPlaceholder?: boolean;\n};\ntype FieldVariant = 'filled' | 'outlined';\n\n// A control under a floating label carries a placeholder so the box can\n// tell when it is populated, shown only while focused. The default is what\n// a control rendered outside any box gets — a search bar's, which has no\n// label over it and shows its placeholder in every state. The four a box\n// provides are hoisted so each is one stable object.\nconst OUTSIDE_BOX: BoxControl = {\n label: 'none',\n underLabel: false\n};\nconst BOX_CONTROLS = {\n filled: {\n fixed: {\n label: 'fixed',\n underLabel: true\n },\n floating: {\n label: 'floating',\n underLabel: true\n }\n },\n outlined: {\n fixed: {\n label: 'fixed',\n underLabel: false\n },\n floating: {\n label: 'floating',\n underLabel: false\n }\n }\n} satisfies Record<FieldVariant, Record<'fixed' | 'floating', BoxControl>>;\nconst BoxContext = createContext<BoxControl>(OUTSIDE_BOX);\n\n// Written as calls rather than function literals at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// each result on its inputs.\nfunction boxContent(label: string, children: ReactNode, floatingLabel: boolean, isPopulated: boolean | undefined, leading: ReactNode, multiline: boolean, trailing: ReactNode, trigger: ReactNode, variant: FieldVariant) {\n return (state: GroupRenderProps) => <BoxContent floatingLabel={floatingLabel} isPopulated={isPopulated} label={label} leading={leading} multiline={multiline} state={state} trailing={trailing} trigger={trigger} variant={variant}>\n {children}\n </BoxContent>;\n}\n\n/**\n * What a box holds: its icons, its label and the control between them, plus\n * the outline when it has one. A component rather than the render function\n * itself, so it can read whether the control holds a value — which is what\n * the outlined box's notch and label follow, and what CSS cannot express\n * for them. See the outlined variant's note above.\n */\nfunction BoxContent({\n children,\n floatingLabel,\n isPopulated,\n label,\n leading,\n multiline,\n state,\n trailing,\n trigger,\n variant\n}: {\n children: ReactNode;\n floatingLabel: boolean;\n isPopulated: boolean | undefined;\n label: string;\n leading: ReactNode;\n multiline: boolean;\n state: GroupRenderProps;\n trailing: ReactNode;\n trigger: ReactNode;\n variant: FieldVariant;\n}) {\n const read = useFieldPopulated();\n const populated = isPopulated ?? read;\n const outlined = variant === 'outlined';\n const floated = !floatingLabel || state.isFocusWithin || populated;\n return <BoxContext value={BOX_CONTROLS[variant][floatingLabel ? 'floating' : 'fixed']}>\n {outlined ? <fieldset aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.outline, leading !== undefined && fieldChromeStyles.outlineLeading, trailing !== undefined && fieldChromeStyles.outlineTrailing, state.isFocusWithin && fieldChromeStyles.outlineFocused)}>\n <legend {...stylex.props(fieldChromeStyles.outlineNotch, floated && fieldChromeStyles.outlineNotchOpen)}>\n {floated ? label : null}\n </legend>\n </fieldset> : null}\n {trigger}\n {leading === undefined ? null : <span {...stylex.props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isDisabled && fieldChromeStyles.iconDisabled)}>\n {leading}\n </span>}\n <div {...stylex.props(fieldChromeStyles.column, floatingLabel && fieldChromeStyles.columnFloating, state.isDisabled && (floatingLabel ? fieldChromeStyles.columnDisabledFloating : fieldChromeStyles.columnDisabled))}>\n <FieldLabel state={state} {...stylex.props(fieldChromeStyles.boxLabel, floatingLabel && floated && fieldChromeStyles.boxLabelFloated, outlined && fieldChromeStyles.boxLabelOutlined, outlined && floated && fieldChromeStyles.boxLabelOutlinedFloated)}>\n {label}\n </FieldLabel>\n {children}\n </div>\n {trailing === undefined ? null : <span {...stylex.props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isInvalid && fieldChromeStyles.iconError, state.isDisabled && fieldChromeStyles.iconDisabled)}>\n {trailing}\n </span>}\n </BoxContext>;\n}\nfunction boxStyles(floatingLabel: boolean, multiline: boolean, leading: boolean, trailing: boolean, variant: FieldVariant) {\n const outlined = variant === 'outlined';\n return (state: GroupRenderProps) => stylex.props(fieldChromeStyles.box, floatingLabel ? fieldChromeStyles.boxFloating : fieldChromeStyles.boxFixed, multiline && fieldChromeStyles.boxMultiline, leading && fieldChromeStyles.boxLeading, trailing && fieldChromeStyles.boxTrailing, outlined && fieldChromeStyles.boxOutlined, outlined && floatingLabel && fieldChromeStyles.boxOutlinedFloating, outlined && multiline && fieldChromeStyles.boxOutlinedMultiline, state.isInvalid && (outlined ? fieldChromeStyles.boxOutlinedError : fieldChromeStyles.boxError), state.isDisabled && (outlined ? fieldChromeStyles.boxOutlinedDisabled : fieldChromeStyles.boxDisabled));\n}\n\n/**\n * The box a control sits in, filled or outlined, with its label. React\n * Aria's `Group`, so\n * the field around it hands down `isDisabled` and `isInvalid` through context\n * and the box reports focus within it as render state, which is what the\n * label's colour follows. A field that provides no group context — one built\n * on a button rather than an input — passes the two states itself.\n */\nfunction FieldBox({\n children,\n floatingLabel = true,\n isPopulated,\n label,\n leading,\n multiline = false,\n trailing,\n trigger,\n variant = 'filled',\n ...props\n}: FieldBoxProps) {\n return <Group {...props} {...mergeStatefulStyles(boxStyles(floatingLabel, multiline, leading !== undefined, trailing !== undefined, variant), props)}>\n {boxContent(label, children, floatingLabel, isPopulated, leading, multiline, trailing, trigger, variant)}\n </Group>;\n}\n\n/**\n * A field's text control, in a {@link FieldBox} or on its own. React Aria's\n * `Input`, which takes its label association, value and validation from the\n * field around it and reports its disabled state as render state.\n *\n * In a box it clears the label at the top, and under a floating label it\n * always carries a placeholder, since that is what the box reads to tell a\n * populated control from an empty one: its own where it was given one, a\n * blank otherwise. Outside a box it has no label over it and shows the\n * placeholder it was given in every state.\n */\nfunction FieldInput({\n numeric = false,\n placeholder,\n prefix,\n suffix,\n ...props\n}: FieldInputProps) {\n const box = useContext(BoxContext);\n const control = <Input placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} {...mergeStatefulStyles((state: InputRenderProps) => stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === 'floating' && fieldChromeStyles.inputUnderFloatingLabel, numeric && fieldChromeStyles.numeric, state.isDisabled && fieldChromeStyles.inputDisabled), props)} />;\n if (prefix === undefined && suffix === undefined) {\n return control;\n }\n return <span {...stylex.props(fieldChromeStyles.affixLine)}>\n {prefix === undefined ? null : <span {...stylex.props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {prefix}\n </span>}\n {control}\n {suffix === undefined ? null : <span {...stylex.props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {suffix}\n </span>}\n </span>;\n}\n\n/**\n * A date or a time's segments, in a {@link FieldBox}: React Aria's\n * `DateInput`, or the group holding a range's two. This is what carries the\n * control's type and its place on the line, clearing the label at the top,\n * as {@link FieldValue} does for a value that was chosen.\n *\n * A typed value longer than its box behaves as an input's text does. It is\n * clipped rather than cut short, since every segment on the line is still a\n * place to type. The browser scrolls whichever segment has focus into view,\n * as it scrolls to an input's caret. And when focus leaves the segments the\n * line goes back to its start, as an input's text does on blur, so a value\n * at rest reads from its beginning rather than from wherever it was left.\n */\nfunction FieldSegments({\n children\n}: {\n children: ReactNode;\n}) {\n const box = useContext(BoxContext);\n return <span onBlur={returnToStart} {...stylex.props(fieldChromeStyles.input, fieldChromeStyles.segments, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {children}\n </span>;\n}\n\n/**\n * A field's multi-line text control, in a {@link FieldBox} drawn `multiline`.\n * React Aria's `TextArea`, with the same label association, value and\n * validation {@link FieldInput} takes from the field around it, and the same\n * placeholder under a floating label.\n *\n * Given `autosize` it grows with its text from the rows it asks for. The\n * value it grows to fit is read off the field's context rather than\n * measured: the box holds a hidden replica of it in the control's own type,\n * in the same grid cell as the control, and the cell is as tall as whichever\n * of the two is taller.\n */\nfunction FieldTextArea({\n autosize = false,\n placeholder,\n ...props\n}: FieldTextAreaProps) {\n const box = useContext(BoxContext);\n const context = useSlottedContext(TextAreaContext);\n const value = typeof context?.value === 'string' ? context.value : '';\n const control = <TextArea placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} {...mergeStatefulStyles((state: InputRenderProps) => stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === 'floating' && fieldChromeStyles.inputUnderFloatingLabel, fieldChromeStyles.textArea, autosize && fieldChromeStyles.textAreaAutosize, autosize && fieldChromeStyles.autosizeCell, state.isDisabled && fieldChromeStyles.inputDisabled), props)} />;\n if (!autosize) {\n return control;\n }\n\n // A trailing space keeps a final line break of the value as a line of the\n // replica, which is how the control renders it.\n return <div {...stylex.props(fieldChromeStyles.autosize)}>\n {control}\n <div aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, fieldChromeStyles.replica, fieldChromeStyles.autosizeCell)}>\n {value}{' '}\n </div>\n </div>;\n}\n\n/**\n * The press target over a {@link FieldBox} whose whole surface opens\n * something — a select's list, a picker's calendar. React Aria's `Button`,\n * which takes the trigger's props from the field around it through context.\n *\n * It covers the box rather than sitting on its value's line, so the box's\n * own padding opens the field too. It draws nothing: the box already carries\n * the fill, the underline and the focus indicator, and it lights up while\n * this has focus because the indicator follows focus within.\n */\nfunction FieldTrigger(props: FieldTriggerProps) {\n return <RACButton {...props} {...mergeStatefulStyles(stylex.props(fieldChromeStyles.trigger), props)} />;\n}\n\n/**\n * A field's value where it was chosen rather than typed, in a\n * {@link FieldBox}. Put React Aria's own element inside it — a select's\n * `SelectValue` — and this is what carries the input's type and its place on\n * the line, clearing the label at the top and truncating rather than\n * wrapping. A date or a time is typed, segment by segment, and takes\n * {@link FieldSegments} instead.\n *\n * The wrapper is the styled one rather than React Aria's element, because\n * this is the box's flex item: styling the element inside instead left it\n * sizing itself against a parent that had already shrink-wrapped to it.\n *\n * `isPlaceholder` says nothing has been chosen, which takes the muted role;\n * under a floating label it is hidden until the field is focused, exactly as\n * an input's placeholder is.\n */\nfunction FieldValue({\n isFocused = false,\n isPlaceholder = false,\n ...props\n}: FieldValueProps) {\n const box = useContext(BoxContext);\n const hidden = isPlaceholder && box.label === 'floating' && !isFocused;\n return <span {...props} {...mergeStyles(stylex.props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props)} />;\n}\n\n// Back to the start of the line once focus has left every segment on it —\n// not while it moves from one segment to the next. The start is 0 in either\n// writing direction: a right-to-left line scrolls towards negative values.\nfunction returnToStart(event: FocusEvent<HTMLElement>) {\n if (!event.currentTarget.contains(event.relatedTarget)) {\n event.currentTarget.scrollLeft = 0;\n }\n}\nfunction useFieldPopulated() {\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n // A field whose value is chosen rather than typed holds no input at all,\n // so being populated is a question for its own state — without this a\n // select's floating label never floats, however much is chosen.\n const select = useContext(SelectStateContext);\n if (select !== null) {\n return select.selectionManager.selectedKeys.size > 0;\n }\n const value = input?.value ?? textArea?.value ?? '';\n return String(value).length > 0;\n}\n\n/**\n * Whether the control in this box is holding anything, read off React\n * Aria's context for whichever control the field renders. The filled box\n * reads the same thing in CSS through `:placeholder-shown`; this is for\n * what CSS cannot express — see the outlined variant's note above.\n */\n/**\n * A field's label: the colour alone, positioned and given its type by whatever\n * renders it. React Aria's `Label`, which the field around it associates with\n * its control through context.\n */\n// Hoisted rather than written as the parameter's default, which would be a\n// new object on every render.\nconst NO_STATE: Partial<FieldLabelState> = {};\nfunction FieldLabel({\n state = NO_STATE,\n variant = 'field',\n ...props\n}: FieldLabelProps) {\n const {\n isDisabled = false,\n isFocusWithin = false,\n isInvalid = false\n } = state;\n return <Label {...props} {...mergeStyles(stylex.props(fieldChromeStyles.label, variant === 'group' && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid && isFocusWithin && fieldChromeStyles.labelFocused), props)} />;\n}\n\n/**\n * The line under a field: the error while there is one, the description\n * otherwise. The error goes through React Aria's `FieldError`, which renders\n * only while the field is invalid and falls back to whatever validation\n * errors the field carries when no message is given — which is how a `Form`\n * with server-side errors, or the browser's own, reaches it without any\n * field changing. The description steps aside for those too, which is what\n * the field's validation state is read for.\n */\nfunction FieldMessage({\n characterCount = false,\n characterLimitLabel,\n description,\n error,\n inset = true,\n maxLength\n}: FieldMessageProps) {\n const validation = useContext(FieldErrorContext);\n const invalid = error !== undefined || (validation?.isInvalid ?? false);\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n const insideForm = useInsideForm();\n // Read directly rather than through `useSlottedContext`, which throws for\n // a missing slot exactly as `Text` does — the throw is the thing being\n // avoided. What it is for is below, at `written`.\n const text = useContext(TextContext);\n\n // The limit, in words, for the description React Aria reads out with the\n // field. `maxLength` alone reaches the control as the native attribute,\n // which is not reliably announced, and the count beside the message is\n // hidden — so without this a reader is never told there is a limit.\n const limit = maxLength === undefined ? undefined : characterLimitLabel ?? `Up to ${maxLength} character${maxLength === 1 ? '' : 's'}`;\n const hidden = limit === undefined ? null : <VisuallyHidden elementType=\"span\">\n <Text slot=\"description\">{limit}</Text>\n </VisuallyHidden>;\n\n // Nothing to say, and nowhere a message could arrive from: the field ends\n // at its control. Inside a form the line is drawn anyway, empty, since a\n // form is where a message appears after the fact — a server's answer, or\n // the browser's own on submit — and every field below this one would\n // otherwise move by the line's height when it does.\n //\n // A limit to announce leaves on its own rather than bringing the line with\n // it. The line is one line of type plus the 4dp above it, so drawing it\n // for something nobody can see would make a field with a limit taller than\n // the same field without one.\n if (!invalid && description === undefined && !characterCount && !insideForm) {\n return hidden;\n }\n const value = input?.value ?? textArea?.value ?? '';\n const length = String(value).length;\n const hint = invalid ? undefined : description;\n\n // One slotted description, never two. React Aria hands every element in\n // its description slot the same generated id, so a second one puts a\n // duplicate id in the document and axe fails the story. The limit rides\n // inside the hint where there is one, and carries the whole slot where\n // there is not — hidden either way, since the count already draws it.\n //\n // Hidden by clipping rather than by leaving it out of the row, and the\n // difference is a gap: the row is a flex line with 16dp between its parts,\n // and an element with no width is still a part. Clipping takes it out of\n // flow, so a field with a limit and no hint has the line it had before.\n const described = hint === undefined ? hidden : <Text slot=\"description\" {...stylex.props(fieldChromeStyles.message)}>\n {hint}\n {limit === undefined ? null :\n // The space is load-bearing: a description is read as the text\n // content of one element, and two spans run together without it.\n <VisuallyHidden elementType=\"span\">{` ${limit}`}</VisuallyHidden>}\n </Text>;\n\n // Outside a field that validates there is nothing to hand React Aria's\n // `FieldError`, and it draws nothing without it — a group of chips is a\n // group rather than a form control, so the error it was given is written\n // out instead.\n //\n // Through the group's error slot where there is one, which is what makes\n // the message reach a screen reader at all: React Aria generates the id\n // its `aria-describedby` points at up front, then keeps it only while\n // something in the document carries it, so an element outside the slot is\n // drawn and never announced. The description beside it has always gone\n // through its own slot, which is why that half worked.\n //\n // Not every group has one. `TagGroup` wires up a description and an error;\n // `TokenField` wires up a description alone and generates no error id at\n // all, so its message has nothing to attach to and stays a bare element.\n const errorSlot = text !== null && typeof text === 'object' && 'slots' in text && text.slots?.errorMessage !== undefined;\n const messageStyles = stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageError);\n const written = errorSlot ? <Text slot=\"errorMessage\" {...messageStyles}>\n {error}\n </Text> : <span {...messageStyles}>{error}</span>;\n return <div {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageLine, inset && fieldChromeStyles.messageInset)}>\n {validation === null && error !== undefined ? written : <FieldError {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageError)}>\n {error}\n </FieldError>}\n {described}\n {characterCount ?\n // Hidden from the tree, and the limit above is why. A count is the\n // one piece of supporting text that changes on every keystroke, and\n // a screen reader reading it back at that rate is worse than not\n // hearing it — the limit said once on focus is what a reader needs,\n // and this is the same fact drawn for whoever is looking.\n <span aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.counter, invalid && fieldChromeStyles.messageError)}>\n {maxLength === undefined ? length : `${length}/${maxLength}`}\n </span> : null}\n </div>;\n}\nexport type { FieldBoxProps, FieldInputProps, FieldLabelProps, FieldLabelState, FieldLabelVariant, FieldMessageProps, FieldTextAreaProps, FieldVariant };\nexport { FieldBox, FieldInput, FieldLabel, FieldMessage, FieldSegments,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UAAA7F,EAAA,QAAAnB,WAAA;EAEdyD,KAAA9D,iBAMH,oBAAA,QAAA;GAAkB,eAAA;GAAM,GAAKnD,MAAaqB,kBAAiBgK,SAAUhK,kBAAiB0K,SAAUf,WAAW3J,kBAAiBqK,YAAa;GAClIlI,UAAAA,cAAc8B,KAAAA,IAAdkF,SAAA,GAAsCA,OAAM,GAAIhH;EAC5C,CAAA,IARR;EAQemB,EAAA,MAAAxB;EAAAwB,EAAA,MAAAqG;EAAArG,EAAA,MAAA6F;EAAA7F,EAAA,MAAAnB;EAAAmB,EAAA,MAAAsC;CAAA,OAAAA,KAAAtC,EAAA;CAAA,IAAAuD;CAAA,IAAAvD,EAAA,QAAA2G,aAAA3G,EAAA,QAAAkC,MAAAlC,EAAA,QAAAmC,MAAAnC,EAAA,QAAAsC,IAAA;EAbbiB,MAAA,qBAAA,OAAA;GAcC,GAdQrB;GAAT,UAAA;IACFC;IAGAwE;IACArE;GASG;;EAAAtC,EAAA,MAAA2G;EAAA3G,EAAA,MAAAkC;EAAAlC,EAAA,MAAAmC;EAAAnC,EAAA,MAAAsC;EAAAtC,EAAA,MAAAuD;CAAA,OAAAA,MAAAvD,EAAA;CAAA,OAdDuD;AAcC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["FocusEvent","HTMLAttributes","ReactNode","Ref","ButtonProps","GroupProps","GroupRenderProps","InputProps","InputRenderProps","LabelProps","TextAreaProps","stylex","createContext","useContext","FieldError","FieldErrorContext","Group","Input","InputContext","Label","Button","RACButton","SelectStateContext","Text","TextArea","TextAreaContext","TextContext","useSlottedContext","VisuallyHidden","mergeStatefulStyles","mergeStyles","useInsideForm","fieldChromeStyles","groupStyles","BoxControl","label","BoxLabel","underLabel","FieldBoxProps","children","floatingLabel","isPopulated","leading","multiline","ref","HTMLDivElement","trailing","trigger","variant","FieldVariant","Omit","FieldInputProps","numeric","prefix","suffix","FieldLabelProps","state","Partial","FieldLabelState","FieldLabelVariant","Pick","FieldMessageProps","characterCount","characterLimitLabel","description","error","inset","maxLength","FieldTextAreaProps","autosize","FieldTriggerProps","FieldValueProps","HTMLElement","isFocused","isPlaceholder","OUTSIDE_BOX","BOX_CONTROLS","filled","fixed","floating","outlined","Record","BoxContext","boxContent","BoxContent","t0","$","_c","read","useFieldPopulated","populated","floated","isFocusWithin","t1","t2","props","outline","undefined","outlineLeading","outlineTrailing","outlineFocused","outlineNotch","outlineNotchOpen","t3","isDisabled","icon","iconMultiline","iconOutlined","iconDisabled","t4","column","columnFloating","columnDisabledFloating","columnDisabled","t5","boxLabel","boxLabelFloated","boxLabelOutlined","boxLabelOutlinedFloated","t6","t7","t8","isInvalid","iconError","t9","boxStyles","box","boxFloating","boxFixed","boxMultiline","boxLeading","boxTrailing","boxOutlined","boxOutlinedFloating","boxOutlinedMultiline","boxOutlinedError","boxError","boxOutlinedDisabled","boxDisabled","FieldBox","T0","t10","t11","FieldInput","placeholder","input","inputUnderLabel","inputUnderFloatingLabel","inputDisabled","control","Symbol","for","affixLine","affix","FieldSegments","segments","returnToStart","FieldTextArea","context","value","textArea","textAreaAutosize","autosizeCell","replica","FieldTrigger","FieldValue","hidden","valuePlaceholder","valuePlaceholderHidden","event","currentTarget","contains","relatedTarget","scrollLeft","select","selectionManager","selectedKeys","size","String","length","NO_STATE","FieldLabel","labelDisabled","labelError","labelFocused","FieldMessage","validation","invalid","insideForm","text","limit","hint","message","described","errorSlot","slots","errorMessage","messageError","messageStyles","written","messageLine","messageInset","counter","_c","stylex.props","props","RACButton"],"sources":["../../src/field/index.tsx"],"sourcesContent":["import type { FocusEvent, HTMLAttributes, ReactNode, Ref } from 'react';\nimport type { ButtonProps, GroupProps, GroupRenderProps, InputProps, InputRenderProps, LabelProps, TextAreaProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { FieldError, FieldErrorContext, Group, Input, InputContext, Label, Button as RACButton, SelectStateContext, Text, TextArea, TextAreaContext, TextContext, useSlottedContext, VisuallyHidden } from 'react-aria-components';\nimport { mergeStatefulStyles, mergeStyles } from '../styles/merge';\nimport { useInsideForm } from './root';\nimport { fieldChromeStyles, groupStyles } from './styles';\n\n// The chrome every field shares: the filled box with its label at the top, the\n// control inside it, and the line of supporting text under it. TextField drew\n// all of it on its own until the coverage plan brought a dozen more fields,\n// each of which would otherwise have written the same box a second time.\n//\n// Not a component of the library's own and not exported. Each field is still\n// React Aria's field component — TextField, NumberField, DateField — and these\n// are the parts it renders inside, which is what keeps the label association,\n// the description and error wiring, and validation on React Aria's side.\n//\n// Neither the notch nor the label can select on the state that drives them.\n// Both are children of the box and the state is the box's, and the filled\n// label reads it in CSS only because it changes type alone, which the box\n// hands down inherited — where the notch changes what it holds and the\n// label changes where it sits, and neither of those inherits. So the box's\n// content computes that state in React instead: focus from the box's own\n// render state, and a value from the control's context, which is where the\n// character counter reads it too. The border's colour is the box's,\n// inherited, which is what carries the hover, focus, error and disabled\n// roles to it.\n\n// What a control needs to know about the box around it: how the label is\n// drawn, and whether the control clears it with a margin — it does under\n// the filled box's label, and not under the outlined box's, whose label\n// sits on the outline rather than over the value.\ninterface BoxControl {\n label: BoxLabel;\n underLabel: boolean;\n}\n\n// How the box draws its label, for the control inside it — see the context\n// below.\ntype BoxLabel = 'fixed' | 'floating' | 'none';\ntype FieldBoxProps = {\n children?: ReactNode;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * Whether the control is holding anything, for a field whose control the\n * chrome cannot ask. It reads an input, a text area and a select's own\n * state; a control that is none of those — a token field's editable area,\n * say — says so here, and the floating label floats on it.\n */\n isPopulated?: boolean;\n /** What the field is for. */\n label: string;\n /** An icon at the start of the box, before the label and the control. */\n leading?: ReactNode;\n /**\n * Whether the box takes its height from the control inside it rather\n * than the page's 56dp, for a text area.\n * @default false\n */\n multiline?: boolean;\n /**\n * The box's own element. A field whose box is what something else is\n * anchored to needs it — a select's list is positioned against the box and\n * takes its width from it, which is what makes the two the same width.\n */\n ref?: Ref<HTMLDivElement>;\n /** An icon at the end of the box, after the control. */\n trailing?: ReactNode;\n /**\n * A press target covering the whole box, for a field whose box opens\n * something rather than taking a keystroke — {@link FieldTrigger}. Drawn\n * in the box itself rather than in the column the label and the control\n * share, so the padding and the icons open it too.\n */\n trigger?: ReactNode;\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<GroupProps, 'children'>;\n\n// `prefix` is also an HTML attribute — the RDFa one, which nothing here\n// wants — and React's element types carry it as a string, so it is left out\n// of the props taken from React Aria to make room for the affix.\ntype FieldInputProps = Omit<InputProps, 'prefix'> & {\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column.\n * @default false\n */\n numeric?: boolean;\n /**\n * Text before the value on its line, shown while the field is focused or\n * holds a value.\n */\n prefix?: ReactNode;\n /**\n * Text after the value on its line, shown while the field is focused or\n * holds a value.\n */\n suffix?: ReactNode;\n};\ntype FieldLabelProps = LabelProps & {\n /**\n * The states the colour follows. Disabled wins over error, and error over\n * focus, so a focused invalid field keeps its error colour.\n */\n state?: Partial<FieldLabelState>;\n /**\n * Where the label sits. `field` is inside a box, positioned and typed by\n * whatever renders it. `group` is above a group of controls, which has no\n * box to float a label in, so this one carries its type itself.\n * @default 'field'\n */\n variant?: FieldLabelVariant;\n};\ntype FieldLabelState = Pick<GroupRenderProps, 'isDisabled' | 'isFocusWithin' | 'isInvalid'>;\ntype FieldLabelVariant = 'field' | 'group';\ninterface FieldMessageProps {\n /**\n * Whether to count the characters the control holds at the end of the\n * line, against `maxLength` where there is one. The count is read off the\n * field's own input or text area context.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * It is read with the field on focus rather than as the value changes, so\n * it names the limit and not what is left of it.\n * @default `Up to ${maxLength} characters`, singular for a limit of one\n */\n characterLimitLabel?: string | undefined;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string | undefined;\n /** The problem with the current value, in words. */\n error?: string | undefined;\n /**\n * Whether the line is indented to a box's inline padding, so it starts\n * where a value above it does. Off for a field with no box to line up with.\n * @default true\n */\n inset?: boolean;\n /** The limit the count is shown against. */\n maxLength?: number | undefined;\n}\ntype FieldTextAreaProps = TextAreaProps & {\n /**\n * Whether the control grows with the text it holds, from the rows it asks\n * for. Off, it keeps its rows and scrolls.\n * @default false\n */\n autosize?: boolean;\n};\ntype FieldTriggerProps = ButtonProps;\ntype FieldValueProps = HTMLAttributes<HTMLElement> & {\n /**\n * Whether the field has focus. A hidden placeholder appears while it does,\n * the way an input's does.\n * @default false\n */\n isFocused?: boolean;\n /**\n * Whether nothing has been chosen yet, so what is drawn is the placeholder\n * rather than a value.\n * @default false\n */\n isPlaceholder?: boolean;\n};\ntype FieldVariant = 'filled' | 'outlined';\n\n// A control under a floating label carries a placeholder so the box can\n// tell when it is populated, shown only while focused. The default is what\n// a control rendered outside any box gets — a search bar's, which has no\n// label over it and shows its placeholder in every state. The four a box\n// provides are hoisted so each is one stable object.\nconst OUTSIDE_BOX: BoxControl = {\n label: 'none',\n underLabel: false\n};\nconst BOX_CONTROLS = {\n filled: {\n fixed: {\n label: 'fixed',\n underLabel: true\n },\n floating: {\n label: 'floating',\n underLabel: true\n }\n },\n outlined: {\n fixed: {\n label: 'fixed',\n underLabel: false\n },\n floating: {\n label: 'floating',\n underLabel: false\n }\n }\n} satisfies Record<FieldVariant, Record<'fixed' | 'floating', BoxControl>>;\nconst BoxContext = createContext<BoxControl>(OUTSIDE_BOX);\n\n// Written as calls rather than function literals at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// each result on its inputs.\nfunction boxContent(label: string, children: ReactNode, floatingLabel: boolean, isPopulated: boolean | undefined, leading: ReactNode, multiline: boolean, trailing: ReactNode, trigger: ReactNode, variant: FieldVariant) {\n return (state: GroupRenderProps) => <BoxContent floatingLabel={floatingLabel} isPopulated={isPopulated} label={label} leading={leading} multiline={multiline} state={state} trailing={trailing} trigger={trigger} variant={variant}>\n {children}\n </BoxContent>;\n}\n\n/**\n * What a box holds: its icons, its label and the control between them, plus\n * the outline when it has one. A component rather than the render function\n * itself, so it can read whether the control holds a value — which is what\n * the outlined box's notch and label follow, and what CSS cannot express\n * for them. See the outlined variant's note above.\n */\nfunction BoxContent({\n children,\n floatingLabel,\n isPopulated,\n label,\n leading,\n multiline,\n state,\n trailing,\n trigger,\n variant\n}: {\n children: ReactNode;\n floatingLabel: boolean;\n isPopulated: boolean | undefined;\n label: string;\n leading: ReactNode;\n multiline: boolean;\n state: GroupRenderProps;\n trailing: ReactNode;\n trigger: ReactNode;\n variant: FieldVariant;\n}) {\n const read = useFieldPopulated();\n const populated = isPopulated ?? read;\n const outlined = variant === 'outlined';\n const floated = !floatingLabel || state.isFocusWithin || populated;\n return <BoxContext value={BOX_CONTROLS[variant][floatingLabel ? 'floating' : 'fixed']}>\n {outlined ? <fieldset aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.outline, leading !== undefined && fieldChromeStyles.outlineLeading, trailing !== undefined && fieldChromeStyles.outlineTrailing, state.isFocusWithin && fieldChromeStyles.outlineFocused)}>\n <legend {...stylex.props(fieldChromeStyles.outlineNotch, floated && fieldChromeStyles.outlineNotchOpen)}>\n {floated ? label : null}\n </legend>\n </fieldset> : null}\n {trigger}\n {leading === undefined ? null : <span {...stylex.props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isDisabled && fieldChromeStyles.iconDisabled)}>\n {leading}\n </span>}\n <div {...stylex.props(fieldChromeStyles.column, floatingLabel && fieldChromeStyles.columnFloating, state.isDisabled && (floatingLabel ? fieldChromeStyles.columnDisabledFloating : fieldChromeStyles.columnDisabled))}>\n <FieldLabel state={state} {...stylex.props(fieldChromeStyles.boxLabel, floatingLabel && floated && fieldChromeStyles.boxLabelFloated, outlined && fieldChromeStyles.boxLabelOutlined, outlined && floated && fieldChromeStyles.boxLabelOutlinedFloated)}>\n {label}\n </FieldLabel>\n {children}\n </div>\n {trailing === undefined ? null : <span {...stylex.props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isInvalid && fieldChromeStyles.iconError, state.isDisabled && fieldChromeStyles.iconDisabled)}>\n {trailing}\n </span>}\n </BoxContext>;\n}\nfunction boxStyles(floatingLabel: boolean, multiline: boolean, leading: boolean, trailing: boolean, variant: FieldVariant) {\n const outlined = variant === 'outlined';\n return (state: GroupRenderProps) => stylex.props(fieldChromeStyles.box, floatingLabel ? fieldChromeStyles.boxFloating : fieldChromeStyles.boxFixed, multiline && fieldChromeStyles.boxMultiline, leading && fieldChromeStyles.boxLeading, trailing && fieldChromeStyles.boxTrailing, outlined && fieldChromeStyles.boxOutlined, outlined && floatingLabel && fieldChromeStyles.boxOutlinedFloating, outlined && multiline && fieldChromeStyles.boxOutlinedMultiline, state.isInvalid && (outlined ? fieldChromeStyles.boxOutlinedError : fieldChromeStyles.boxError), state.isDisabled && (outlined ? fieldChromeStyles.boxOutlinedDisabled : fieldChromeStyles.boxDisabled));\n}\n\n/**\n * The box a control sits in, filled or outlined, with its label. React\n * Aria's `Group`, so\n * the field around it hands down `isDisabled` and `isInvalid` through context\n * and the box reports focus within it as render state, which is what the\n * label's colour follows. A field that provides no group context — one built\n * on a button rather than an input — passes the two states itself.\n */\nfunction FieldBox({\n children,\n floatingLabel = true,\n isPopulated,\n label,\n leading,\n multiline = false,\n trailing,\n trigger,\n variant = 'filled',\n ...props\n}: FieldBoxProps) {\n return <Group {...props} {...mergeStatefulStyles(boxStyles(floatingLabel, multiline, leading !== undefined, trailing !== undefined, variant), props)}>\n {boxContent(label, children, floatingLabel, isPopulated, leading, multiline, trailing, trigger, variant)}\n </Group>;\n}\n\n/**\n * A field's text control, in a {@link FieldBox} or on its own. React Aria's\n * `Input`, which takes its label association, value and validation from the\n * field around it and reports its disabled state as render state.\n *\n * In a box it clears the label at the top, and under a floating label it\n * always carries a placeholder, since that is what the box reads to tell a\n * populated control from an empty one: its own where it was given one, a\n * blank otherwise. Outside a box it has no label over it and shows the\n * placeholder it was given in every state.\n */\nfunction FieldInput({\n numeric = false,\n placeholder,\n prefix,\n suffix,\n ...props\n}: FieldInputProps) {\n const box = useContext(BoxContext);\n const control = <Input placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} {...mergeStatefulStyles((state: InputRenderProps) => stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === 'floating' && fieldChromeStyles.inputUnderFloatingLabel, numeric && fieldChromeStyles.numeric, state.isDisabled && fieldChromeStyles.inputDisabled), props)} />;\n if (prefix === undefined && suffix === undefined) {\n return control;\n }\n return <span {...stylex.props(fieldChromeStyles.affixLine)}>\n {prefix === undefined ? null : <span {...stylex.props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {prefix}\n </span>}\n {control}\n {suffix === undefined ? null : <span {...stylex.props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {suffix}\n </span>}\n </span>;\n}\n\n/**\n * A date or a time's segments, in a {@link FieldBox}: React Aria's\n * `DateInput`, or the group holding a range's two. This is what carries the\n * control's type and its place on the line, clearing the label at the top,\n * as {@link FieldValue} does for a value that was chosen.\n *\n * A typed value longer than its box behaves as an input's text does. It is\n * clipped rather than cut short, since every segment on the line is still a\n * place to type. The browser scrolls whichever segment has focus into view,\n * as it scrolls to an input's caret. And when focus leaves the segments the\n * line goes back to its start, as an input's text does on blur, so a value\n * at rest reads from its beginning rather than from wherever it was left.\n */\nfunction FieldSegments({\n children\n}: {\n children: ReactNode;\n}) {\n const box = useContext(BoxContext);\n return <span onBlur={returnToStart} {...stylex.props(fieldChromeStyles.input, fieldChromeStyles.segments, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {children}\n </span>;\n}\n\n/**\n * A field's multi-line text control, in a {@link FieldBox} drawn `multiline`.\n * React Aria's `TextArea`, with the same label association, value and\n * validation {@link FieldInput} takes from the field around it, and the same\n * placeholder under a floating label.\n *\n * Given `autosize` it grows with its text from the rows it asks for. The\n * value it grows to fit is read off the field's context rather than\n * measured: the box holds a hidden replica of it in the control's own type,\n * in the same grid cell as the control, and the cell is as tall as whichever\n * of the two is taller.\n */\nfunction FieldTextArea({\n autosize = false,\n placeholder,\n ...props\n}: FieldTextAreaProps) {\n const box = useContext(BoxContext);\n const context = useSlottedContext(TextAreaContext);\n const value = typeof context?.value === 'string' ? context.value : '';\n const control = <TextArea placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} {...mergeStatefulStyles((state: InputRenderProps) => stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === 'floating' && fieldChromeStyles.inputUnderFloatingLabel, fieldChromeStyles.textArea, autosize && fieldChromeStyles.textAreaAutosize, autosize && fieldChromeStyles.autosizeCell, state.isDisabled && fieldChromeStyles.inputDisabled), props)} />;\n if (!autosize) {\n return control;\n }\n\n // A trailing space keeps a final line break of the value as a line of the\n // replica, which is how the control renders it.\n return <div {...stylex.props(fieldChromeStyles.autosize)}>\n {control}\n <div aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, fieldChromeStyles.replica, fieldChromeStyles.autosizeCell)}>\n {value}{' '}\n </div>\n </div>;\n}\n\n/**\n * The press target over a {@link FieldBox} whose whole surface opens\n * something — a select's list, a picker's calendar. React Aria's `Button`,\n * which takes the trigger's props from the field around it through context.\n *\n * It covers the box rather than sitting on its value's line, so the box's\n * own padding opens the field too. It draws nothing: the box already carries\n * the fill, the underline and the focus indicator, and it lights up while\n * this has focus because the indicator follows focus within.\n */\nfunction FieldTrigger(props: FieldTriggerProps) {\n return <RACButton {...props} {...mergeStatefulStyles(stylex.props(fieldChromeStyles.trigger), props)} />;\n}\n\n/**\n * A field's value where it was chosen rather than typed, in a\n * {@link FieldBox}. Put React Aria's own element inside it — a select's\n * `SelectValue` — and this is what carries the input's type and its place on\n * the line, clearing the label at the top and truncating rather than\n * wrapping. A date or a time is typed, segment by segment, and takes\n * {@link FieldSegments} instead.\n *\n * The wrapper is the styled one rather than React Aria's element, because\n * this is the box's flex item: styling the element inside instead left it\n * sizing itself against a parent that had already shrink-wrapped to it.\n *\n * `isPlaceholder` says nothing has been chosen, which takes the muted role;\n * under a floating label it is hidden until the field is focused, exactly as\n * an input's placeholder is.\n */\nfunction FieldValue({\n isFocused = false,\n isPlaceholder = false,\n ...props\n}: FieldValueProps) {\n const box = useContext(BoxContext);\n const hidden = isPlaceholder && box.label === 'floating' && !isFocused;\n return <span {...props} {...mergeStyles(stylex.props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props)} />;\n}\n\n// Back to the start of the line once focus has left every segment on it —\n// not while it moves from one segment to the next. The start is 0 in either\n// writing direction: a right-to-left line scrolls towards negative values.\nfunction returnToStart(event: FocusEvent<HTMLElement>) {\n if (!event.currentTarget.contains(event.relatedTarget)) {\n event.currentTarget.scrollLeft = 0;\n }\n}\nfunction useFieldPopulated() {\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n // A field whose value is chosen rather than typed holds no input at all,\n // so being populated is a question for its own state — without this a\n // select's floating label never floats, however much is chosen.\n const select = useContext(SelectStateContext);\n if (select !== null) {\n return select.selectionManager.selectedKeys.size > 0;\n }\n const value = input?.value ?? textArea?.value ?? '';\n return String(value).length > 0;\n}\n\n/**\n * Whether the control in this box is holding anything, read off React\n * Aria's context for whichever control the field renders. The filled box\n * reads the same thing in CSS through `:placeholder-shown`; this is for\n * what CSS cannot express — see the outlined variant's note above.\n */\n/**\n * A field's label: the colour alone, positioned and given its type by whatever\n * renders it. React Aria's `Label`, which the field around it associates with\n * its control through context.\n */\n// Hoisted rather than written as the parameter's default, which would be a\n// new object on every render.\nconst NO_STATE: Partial<FieldLabelState> = {};\nfunction FieldLabel({\n state = NO_STATE,\n variant = 'field',\n ...props\n}: FieldLabelProps) {\n const {\n isDisabled = false,\n isFocusWithin = false,\n isInvalid = false\n } = state;\n return <Label {...props} {...mergeStyles(stylex.props(fieldChromeStyles.label, variant === 'group' && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid && isFocusWithin && fieldChromeStyles.labelFocused), props)} />;\n}\n\n/**\n * The line under a field: the error while there is one, the description\n * otherwise. The error goes through React Aria's `FieldError`, which renders\n * only while the field is invalid and falls back to whatever validation\n * errors the field carries when no message is given — which is how a `Form`\n * with server-side errors, or the browser's own, reaches it without any\n * field changing. The description steps aside for those too, which is what\n * the field's validation state is read for.\n */\nfunction FieldMessage({\n characterCount = false,\n characterLimitLabel,\n description,\n error,\n inset = true,\n maxLength\n}: FieldMessageProps) {\n const validation = useContext(FieldErrorContext);\n const invalid = error !== undefined || (validation?.isInvalid ?? false);\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n const insideForm = useInsideForm();\n // Read directly rather than through `useSlottedContext`, which throws for\n // a missing slot exactly as `Text` does — the throw is the thing being\n // avoided. What it is for is below, at `written`.\n const text = useContext(TextContext);\n\n // The limit, in words, for the description React Aria reads out with the\n // field. `maxLength` alone reaches the control as the native attribute,\n // which is not reliably announced, and the count beside the message is\n // hidden — so without this a reader is never told there is a limit.\n const limit = maxLength === undefined ? undefined : characterLimitLabel ?? `Up to ${maxLength} character${maxLength === 1 ? '' : 's'}`;\n const hidden = limit === undefined ? null : <VisuallyHidden elementType=\"span\">\n <Text slot=\"description\">{limit}</Text>\n </VisuallyHidden>;\n\n // Nothing to say, and nowhere a message could arrive from: the field ends\n // at its control. Inside a form the line is drawn anyway, empty, since a\n // form is where a message appears after the fact — a server's answer, or\n // the browser's own on submit — and every field below this one would\n // otherwise move by the line's height when it does.\n //\n // A limit to announce leaves on its own rather than bringing the line with\n // it. The line is one line of type plus the 4dp above it, so drawing it\n // for something nobody can see would make a field with a limit taller than\n // the same field without one.\n if (!invalid && description === undefined && !characterCount && !insideForm) {\n return hidden;\n }\n const value = input?.value ?? textArea?.value ?? '';\n const length = String(value).length;\n const hint = invalid ? undefined : description;\n\n // One slotted description, never two. React Aria hands every element in\n // its description slot the same generated id, so a second one puts a\n // duplicate id in the document and axe fails the story. The limit rides\n // inside the hint where there is one, and carries the whole slot where\n // there is not — hidden either way, since the count already draws it.\n //\n // Hidden by clipping rather than by leaving it out of the row, and the\n // difference is a gap: the row is a flex line with 16dp between its parts,\n // and an element with no width is still a part. Clipping takes it out of\n // flow, so a field with a limit and no hint has the line it had before.\n const described = hint === undefined ? hidden : <Text slot=\"description\" {...stylex.props(fieldChromeStyles.message)}>\n {hint}\n {limit === undefined ? null :\n // The space is load-bearing: a description is read as the text\n // content of one element, and two spans run together without it.\n <VisuallyHidden elementType=\"span\">{` ${limit}`}</VisuallyHidden>}\n </Text>;\n\n // Outside a field that validates there is nothing to hand React Aria's\n // `FieldError`, and it draws nothing without it — a group of chips is a\n // group rather than a form control, so the error it was given is written\n // out instead.\n //\n // Through the group's error slot where there is one, which is what makes\n // the message reach a screen reader at all: React Aria generates the id\n // its `aria-describedby` points at up front, then keeps it only while\n // something in the document carries it, so an element outside the slot is\n // drawn and never announced. The description beside it has always gone\n // through its own slot, which is why that half worked.\n //\n // Not every group has one. `TagGroup` wires up a description and an error;\n // `TokenField` wires up a description alone and generates no error id at\n // all, so its message has nothing to attach to and stays a bare element.\n const errorSlot = text !== null && typeof text === 'object' && 'slots' in text && text.slots?.errorMessage !== undefined;\n const messageStyles = stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageError);\n const written = errorSlot ? <Text slot=\"errorMessage\" {...messageStyles}>\n {error}\n </Text> : <span {...messageStyles}>{error}</span>;\n return <div {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageLine, inset && fieldChromeStyles.messageInset)}>\n {validation === null && error !== undefined ? written : <FieldError {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageError)}>\n {error}\n </FieldError>}\n {described}\n {characterCount ?\n // Hidden from the tree, and the limit above is why. A count is the\n // one piece of supporting text that changes on every keystroke, and\n // a screen reader reading it back at that rate is worse than not\n // hearing it — the limit said once on focus is what a reader needs,\n // and this is the same fact drawn for whoever is looking.\n <span aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.counter, invalid && fieldChromeStyles.messageError)}>\n {maxLength === undefined ? length : `${length}/${maxLength}`}\n </span> : null}\n </div>;\n}\nexport type { FieldBoxProps, FieldInputProps, FieldLabelProps, FieldLabelState, FieldLabelVariant, FieldMessageProps, FieldTextAreaProps, FieldVariant };\nexport { FieldBox, FieldInput, FieldLabel, FieldMessage, FieldSegments, FieldTextArea, FieldTrigger, FieldValue };"],"mappings":";;;;;;;;;AA8LA,MAAM2E,cAA0B;CAC9BxC,OAAO;CACPE,YAAY;AACd;AACA,MAAMuC,eAAe;CACnBC,QAAQ;EACNC,OAAO;GACL3C,OAAO;GACPE,YAAY;EACd;EACA0C,UAAU;GACR5C,OAAO;GACPE,YAAY;EACd;CACF;CACA2C,UAAU;EACRF,OAAO;GACL3C,OAAO;GACPE,YAAY;EACd;EACA0C,UAAU;GACR5C,OAAO;GACPE,YAAY;EACd;CACF;AACF;AACA,MAAM6C,aAAatE,cAA0B+D,WAAW;AAKxD,SAASQ,WAAWhD,OAAeI,UAAqBC,eAAwBC,aAAkCC,SAAoBC,WAAoBG,UAAqBC,SAAoBC,SAAuB;CACxN,QAAQQ,UAA4B,oBAAC,YAAD;EAA2BhB;EAA4BC;EAAoBN;EAAgBO;EAAoBC;EAAkBa;EAAiBV;EAAmBC;EAAkBC;EACtNT;CACS,CAA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AAAtC,EAAA,MAAA2G;EAAA3G,EAAA,MAAAkC;EAAAlC,EAAA,MAAAmC;EAAAnC,EAAA,MAAAsC;EAAAtC,EAAA,MAAAuD;CAAA,OAAAA,MAAAvD,EAAA;CAAA,OAdDuD;AAcC"}
|
package/dist/glyphs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","SVGProps","stylex","mergeStyles","glyphStyles","GlyphProps","Omit","SVGSVGElement","ArrowDownwardGlyph","props","$","_c","t0","Symbol","for","t1","ArrowUpwardGlyph","CalendarGlyph","CheckGlyph","Glyph","children","t2","t3","t4","t5","t6","glyph","MinusGlyph","IndeterminateGlyph","ChevronEndGlyph","CloseGlyph","PlusGlyph","SearchGlyph"],"sources":["../../src/glyphs/index.tsx"],"sourcesContent":["import type { ReactNode, SVGProps } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { mergeStyles } from '../styles/merge';\nimport { glyphStyles } from './styles';\n\n// The glyphs the library's own controls draw: the check and the dash a\n// checkbox shows, the plus and minus a number field's steppers show, and\n// the magnifier and cross a search field shows. Inline SVG in\n// `currentColor`, sized by whatever renders them, and private to the\n// library — a call site with icons of its own passes them to IconButton and\n// the slots that take a node, which is why nothing here is exported from\n// the package.\n//\n// The paths are the check, the horizontal rule, the plus, the search, the\n// close, the right chevron, the two sort arrows and the calendar from\n// Material Symbols on their 24-unit grid, which is what the checkbox page\n// draws at 18dp, the icon buttons page at 20 and the search, menus and date\n// picker pages at 24.\n\ntype GlyphProps = Omit<SVGProps<SVGSVGElement>, 'children' | 'viewBox'>;\n\n// Which way a sorted column is ordered. Up is ascending and down is\n// descending, which is the direction the data tables page puts beside a\n// column header's name. Neither mirrors under a right-to-left writing mode:\n// they say \"up\" and \"down\" rather than \"onward\", and those do not flip.\nfunction ArrowDownwardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\" />\n </Glyph>;\n}\nfunction ArrowUpwardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\" />\n </Glyph>;\n}\n\n// What the date picker's trigger draws: the calendar a date is picked from.\nfunction CalendarGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </Glyph>;\n}\nfunction CheckGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\" />\n </Glyph>;\n}\n\n/**\n * The svg every glyph draws: the 24-unit grid its path is on, the colour it\n * takes from the text around it, and its box. The call site's `className`\n * and `style` are merged with the glyph's own rather than replacing them.\n */\nfunction Glyph({\n children,\n ...props\n}: GlyphProps & {\n children: ReactNode;\n}) {\n return <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props} {...mergeStyles(stylex.props(glyphStyles.glyph), props)}>\n {children}\n </svg>;\n}\n\n// The same rule stands for a partly selected checkbox and for a stepper's\n// decrement; the two names say which is meant at the call site.\nfunction MinusGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 13H5v-2h14v2z\" />\n </Glyph>;\n}\nconst IndeterminateGlyph = MinusGlyph;\n\n// Points at the submenu a menu item opens. It says \"further in\" rather than\n// \"to the right\", so whatever renders it mirrors it under a right-to-left\n// writing mode — the glyph itself carries no direction of its own, since a\n// transform here would be an inline style.\nfunction ChevronEndGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" />\n </Glyph>;\n}\nfunction CloseGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n </Glyph>;\n}\nfunction PlusGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" />\n </Glyph>;\n}\nfunction SearchGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </Glyph>;\n}\nexport type { GlyphProps };\nexport { ArrowDownwardGlyph, ArrowUpwardGlyph, CalendarGlyph, CheckGlyph, ChevronEndGlyph, CloseGlyph, IndeterminateGlyph, MinusGlyph, PlusGlyph, SearchGlyph };"],"mappings":";;;;;;AAyBA,SAAAQ,mBAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,oBAAA,QAAA,EAAQ,GAAA,iEAAgE,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADxEM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACdG,UAAAA;EADS,CAAA;EAEHF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFHK;AAEG;AAEZ,SAAAC,iBAAAP,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,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,sCAAqC,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EAD7CM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACdG,UAAAA;EADS,CAAA;EAEHF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFHK;AAEG;AAEZ,SAAAiB,YAAAvB,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEMF,KAAA,oBAAA,QAAA,EAAQ,GAAA,6MAA4M,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADpNM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACdG,UAAAA;EADS,CAAA;EAEHF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFHK;AAEG"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactNode","SVGProps","stylex","mergeStyles","glyphStyles","GlyphProps","Omit","SVGSVGElement","ArrowDownwardGlyph","props","$","_c","t0","Symbol","for","t1","ArrowUpwardGlyph","CalendarGlyph","CheckGlyph","Glyph","children","t2","t3","t4","t5","t6","glyph","MinusGlyph","IndeterminateGlyph","ChevronEndGlyph","CloseGlyph","PlusGlyph","SearchGlyph","_c","props","stylex.props"],"sources":["../../src/glyphs/index.tsx"],"sourcesContent":["import type { ReactNode, SVGProps } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { mergeStyles } from '../styles/merge';\nimport { glyphStyles } from './styles';\n\n// The glyphs the library's own controls draw: the check and the dash a\n// checkbox shows, the plus and minus a number field's steppers show, and\n// the magnifier and cross a search field shows. Inline SVG in\n// `currentColor`, sized by whatever renders them, and private to the\n// library — a call site with icons of its own passes them to IconButton and\n// the slots that take a node, which is why nothing here is exported from\n// the package.\n//\n// The paths are the check, the horizontal rule, the plus, the search, the\n// close, the right chevron, the two sort arrows and the calendar from\n// Material Symbols on their 24-unit grid, which is what the checkbox page\n// draws at 18dp, the icon buttons page at 20 and the search, menus and date\n// picker pages at 24.\n\ntype GlyphProps = Omit<SVGProps<SVGSVGElement>, 'children' | 'viewBox'>;\n\n// Which way a sorted column is ordered. Up is ascending and down is\n// descending, which is the direction the data tables page puts beside a\n// column header's name. Neither mirrors under a right-to-left writing mode:\n// they say \"up\" and \"down\" rather than \"onward\", and those do not flip.\nfunction ArrowDownwardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\" />\n </Glyph>;\n}\nfunction ArrowUpwardGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\" />\n </Glyph>;\n}\n\n// What the date picker's trigger draws: the calendar a date is picked from.\nfunction CalendarGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </Glyph>;\n}\nfunction CheckGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\" />\n </Glyph>;\n}\n\n/**\n * The svg every glyph draws: the 24-unit grid its path is on, the colour it\n * takes from the text around it, and its box. The call site's `className`\n * and `style` are merged with the glyph's own rather than replacing them.\n */\nfunction Glyph({\n children,\n ...props\n}: GlyphProps & {\n children: ReactNode;\n}) {\n return <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props} {...mergeStyles(stylex.props(glyphStyles.glyph), props)}>\n {children}\n </svg>;\n}\n\n// The same rule stands for a partly selected checkbox and for a stepper's\n// decrement; the two names say which is meant at the call site.\nfunction MinusGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 13H5v-2h14v2z\" />\n </Glyph>;\n}\nconst IndeterminateGlyph = MinusGlyph;\n\n// Points at the submenu a menu item opens. It says \"further in\" rather than\n// \"to the right\", so whatever renders it mirrors it under a right-to-left\n// writing mode — the glyph itself carries no direction of its own, since a\n// transform here would be an inline style.\nfunction ChevronEndGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" />\n </Glyph>;\n}\nfunction CloseGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n </Glyph>;\n}\nfunction PlusGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" />\n </Glyph>;\n}\nfunction SearchGlyph(props: GlyphProps) {\n return <Glyph {...props}>\n <path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </Glyph>;\n}\nexport type { GlyphProps };\nexport { ArrowDownwardGlyph, ArrowUpwardGlyph, CalendarGlyph, CheckGlyph, ChevronEndGlyph, CloseGlyph, IndeterminateGlyph, MinusGlyph, PlusGlyph, SearchGlyph };"],"mappings":";;;;;;AAyBA,SAAAQ,mBAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;C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Status.js","names":["useEffect","useState","ImageLoadingStatus","Settled","src","status","useImageLoadingStatus","$","_c","settled","setSettled","t0","t1","undefined","onLoad","onError","image","window","Image","addEventListener","once","removeEventListener","removeAttribute"],"sources":["../../src/hooks/useImageLoadingStatus.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\ntype ImageLoadingStatus = 'error' | 'loaded' | 'loading'\n\ninterface Settled {\n src: string\n status: 'error' | 'loaded'\n}\n\n/**\n * Whether an image at `src` can be shown yet. It is loaded off-screen first,\n * so a component can keep its fallback in place until the picture is ready\n * and bring the fallback back if the picture fails — an `<img>` swapped in\n * as soon as `src` is known would show the browser's broken-image glyph in\n * between.\n *\n * No `src` counts as a failure, since the outcome is the same: the fallback\n * shows. What settled is remembered against the `src` it settled for, so a\n * change of `src` reads as loading again rather than as the old outcome.\n */\nfunction useImageLoadingStatus(src: string | undefined): ImageLoadingStatus {\n const [settled, setSettled] = useState<null | Settled>(null)\n\n useEffect(() => {\n if (src === undefined) {\n return undefined\n }\n\n const onLoad = () => {\n setSettled({ src, status: 'loaded' })\n }\n const onError = () => {\n setSettled({ src, status: 'error' })\n }\n\n const image = new window.Image()\n image.addEventListener('load', onLoad, { once: true })\n image.addEventListener('error', onError, { once: true })\n image.src = src\n\n // A load `src` has moved on from, or one the component went before, is\n // stopped rather than left to run. Taking the listeners off is what keeps\n // it from reporting an outcome nobody asked for, and lets the image go\n // once nothing else holds it; removing its source aborts the fetch. That\n // is the source removed rather than set empty, which would also abort it\n // but queue an `error` event on the way.\n return () => {\n image.removeEventListener('load', onLoad)\n image.removeEventListener('error', onError)\n image.removeAttribute('src')\n }\n }, [src])\n\n if (src === undefined) {\n return 'error'\n }\n return settled?.src === src ? settled.status : 'loading'\n}\n\nexport type { ImageLoadingStatus }\n\nexport { useImageLoadingStatus }\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAAM,sBAAAF,KAAA;CAAA,MAAAG,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,SAAAC,cAA8BT,SAAyB,IAAI;CAAC,IAAAU;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAH,KAAA;EAElDO,WAAA;GACR,IAAIP,QAAQS,KAAAA,GAAS;GAIrB,MAAAC,eAAe;IACbJ,WAAW;KAAAN;KAAAC,QAAe;IAAS,CAAC;GAAC;GAEvC,MAAAU,gBAAgB;IACdL,WAAW;KAAAN;KAAAC,QAAe;IAAQ,CAAC;GAAC;GAGtC,MAAAW,QAAc,IAAIC,OAAMC,MAAO;GAC/BF,MAAKG,iBAAkB,QAAQL,QAAQ,EAAAM,MAAQ,KAAK,CAAC;GACrDJ,MAAKG,iBAAkB,SAASJ,SAAS,EAAAK,MAAQ,KAAK,CAAC;GACvDJ,MAAKZ,MAAOA;GAAH,aAQF;IACLY,MAAKK,oBAAqB,QAAQP,MAAM;IACxCE,MAAKK,oBAAqB,SAASN,OAAO;IAC1CC,MAAKM,gBAAiB,KAAK;GAAC;EAC7B;EACAV,KAAA,CAACR,GAAG;EAACG,EAAA,KAAAH;EAAAG,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAD,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CA5BRP,UAAUW,IA4BPC,EAAK;CAER,IAAIR,QAAQS,KAAAA,GAAS,OACZ;CACR,OACMJ,SAAOL,QAAUA,MAAMK,QAAOJ,SAA9B;AAAiD"}
|
|
1
|
+
{"version":3,"file":"useImageLoadingStatus.js","names":["useEffect","useState","ImageLoadingStatus","Settled","src","status","useImageLoadingStatus","$","_c","settled","setSettled","t0","t1","undefined","onLoad","onError","image","window","Image","addEventListener","once","removeEventListener","removeAttribute","_c"],"sources":["../../src/hooks/useImageLoadingStatus.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\ntype ImageLoadingStatus = 'error' | 'loaded' | 'loading'\n\ninterface Settled {\n src: string\n status: 'error' | 'loaded'\n}\n\n/**\n * Whether an image at `src` can be shown yet. It is loaded off-screen first,\n * so a component can keep its fallback in place until the picture is ready\n * and bring the fallback back if the picture fails — an `<img>` swapped in\n * as soon as `src` is known would show the browser's broken-image glyph in\n * between.\n *\n * No `src` counts as a failure, since the outcome is the same: the fallback\n * shows. What settled is remembered against the `src` it settled for, so a\n * change of `src` reads as loading again rather than as the old outcome.\n */\nfunction useImageLoadingStatus(src: string | undefined): ImageLoadingStatus {\n const [settled, setSettled] = useState<null | Settled>(null)\n\n useEffect(() => {\n if (src === undefined) {\n return undefined\n }\n\n const onLoad = () => {\n setSettled({ src, status: 'loaded' })\n }\n const onError = () => {\n setSettled({ src, status: 'error' })\n }\n\n const image = new window.Image()\n image.addEventListener('load', onLoad, { once: true })\n image.addEventListener('error', onError, { once: true })\n image.src = src\n\n // A load `src` has moved on from, or one the component went before, is\n // stopped rather than left to run. Taking the listeners off is what keeps\n // it from reporting an outcome nobody asked for, and lets the image go\n // once nothing else holds it; removing its source aborts the fetch. That\n // is the source removed rather than set empty, which would also abort it\n // but queue an `error` event on the way.\n return () => {\n image.removeEventListener('load', onLoad)\n image.removeEventListener('error', onError)\n image.removeAttribute('src')\n }\n }, [src])\n\n if (src === undefined) {\n return 'error'\n }\n return settled?.src === src ? settled.status : 'loading'\n}\n\nexport type { ImageLoadingStatus }\n\nexport { useImageLoadingStatus }\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAAM,sBAAAF,KAAA;CAAA,MAAAG,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,SAAAC,cAA8BT,SAAyB,IAAI;CAAC,IAAAU;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAH,KAAA;EAElDO,WAAA;GACR,IAAIP,QAAQS,KAAAA,GAAS;GAIrB,MAAAC,eAAe;IACbJ,WAAW;KAAAN;KAAAC,QAAe;IAAS,CAAC;GAAC;GAEvC,MAAAU,gBAAgB;IACdL,WAAW;KAAAN;KAAAC,QAAe;IAAQ,CAAC;GAAC;GAGtC,MAAAW,QAAc,IAAIC,OAAMC,MAAO;GAC/BF,MAAKG,iBAAkB,QAAQL,QAAQ,EAAAM,MAAQ,KAAK,CAAC;GACrDJ,MAAKG,iBAAkB,SAASJ,SAAS,EAAAK,MAAQ,KAAK,CAAC;GACvDJ,MAAKZ,MAAOA;GAAH,aAQF;IACLY,MAAKK,oBAAqB,QAAQP,MAAM;IACxCE,MAAKK,oBAAqB,SAASN,OAAO;IAC1CC,MAAKM,gBAAiB,KAAK;GAAC;EAC7B;EACAV,KAAA,CAACR,GAAG;EAACG,EAAA,KAAAH;EAAAG,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAD,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CA5BRP,UAAUW,IA4BPC,EAAK;CAER,IAAIR,QAAQS,KAAAA,GAAS,OACZ;CACR,OACMJ,SAAOL,QAAUA,MAAMK,QAAOJ,SAA9B;AAAiD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRipple.js","names":["MouseEvent","MouseEventHandler","PointerEvent","PointerEventHandler","ReactNode","stylex","useCallback","useMemo","useRef","useState","rippleStyles","motionDurationMs","motionEasing","spacingPx","PADDING","sm","INITIAL_ORIGIN_SCALE","SOFT_EDGE_MINIMUM_SIZE","SOFT_EDGE_CONTAINER_RATIO","surfaceProps","props","surface","RippleState","Holding","Inactive","TouchDelay","WaitingForClick","const","ReleaseHandlers","Element","Omit","RippleEventHandlers","HostElement","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","isTouch","event","pointerType","prefersReducedMotion","window","matchMedia","matches","useRipple","enabled","externalHandlers","endsOnRelease","handlers","t0","t1","t2","$","_c","undefined","t3","pressed","setPressed","rippleRef","state","growAnimation","rippleStartEvent","initialSize","rippleScale","t4","Symbol","for","isPrimary","startEvent","current","pointerId","isPressPointer","t5","event_0","buttons","shouldReactToEvent","t6","rect","height","width","maxDimension","Math","max","softEdgeSize","size","floor","hypotenuse","hypot","maxRadius","determineRippleSize","t7","rect_0","positionEvent","height_0","left","top","width_0","size_0","endPoint","x","y","origin","clientX","clientY","startPoint","getTranslationCoordinates","t8","target","positionEvent_0","ripple","cancel","rect_1","getBoundingClientRect","size_1","endPoint_0","startPoint_0","style","animate","transform","duration","long1","easing","standard","fill","startPressAnimation","t9","animation","elapsed","currentTime","Infinity","medium1","Promise","resolve","setTimeout","endPressAnimation","t10","getState","t11","event_1","target_0","currentTarget","_temp","handlePointerDownAsync","t12","event_2","handlePointerDown","t13","event_3","handlePointerUp","t14","event_4","handlePointerLeave","t15","event_5","handlePointerCancel","t16","event_6","handleClick","t17","handleContextMenu","onClickProp","onContextMenuProp","onPointerCancelProp","onPointerDownProp","onPointerLeaveProp","onPointerUpProp","t18","event_7","t19","event_8","t20","event_9","t21","event_10","t22","event_11","t23","event_12","t24","pointer","t25","t26","press","t27","t28","enabledResult","t29","disabledResult","resolve_0","short2"],"sources":["../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ntype ReleaseHandlers<HostElement extends Element> = Omit<RippleEventHandlers<HostElement>, 'onClick'>;\ninterface RippleEventHandlers<HostElement extends Element> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Whether the reader has asked the OS for less motion.\n *\n * Growth is a Web Animations call, which makes it the one animation in the\n * library no `@media (prefers-reduced-motion: reduce)` branch can reach — see\n * src/styles/ripple.ts for the opacity half, which is CSS and carries one.\n *\n * Read at the press rather than once at mount, so a reader who changes the\n * setting is answered by their next press rather than by their next reload.\n * The press already reads layout through `getBoundingClientRect`, which costs\n * more than this does.\n */\nfunction prefersReducedMotion() {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * Pass `endsOnRelease` for a host that never hears its own click: a\n * collection row, whose clicks React Aria's press handling keeps for itself.\n * The press then ends when the pointer is released over the host rather than\n * on the click that would follow, still held for the minimum a short press\n * gets. A keyboard press reaches such a host as no pointer event at all, so\n * it draws no ripple there.\n *\n * `handlers` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\n// A host ending on the release never hears a click, so nothing is taken for\n// one and none is handed back: the handlers are the pointer ones alone, which\n// is also what a collection row's type admits.\nfunction useRipple<HostElement extends Element = Element>(enabled: boolean, externalHandlers: ReleaseHandlers<HostElement>, endsOnRelease: true): {\n handlers: ReleaseHandlers<HostElement>;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled?: boolean, externalHandlers?: RippleEventHandlers<HostElement>, endsOnRelease?: false): {\n handlers: RippleEventHandlers<HostElement>;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}, endsOnRelease = false): {\n handlers: RippleEventHandlers<HostElement>;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n\n // Whether `event` comes from the pointer a press would follow: the primary\n // one, and the one that started the press already in flight, if any.\n const isPressPointer = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n return !startEvent || startEvent.pointerId === event.pointerId;\n }, []);\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => isPressPointer(event) && (isTouch(event) || event.buttons === 1), [isPressPointer]);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: HostElement, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n\n // Read once and share: the two helpers below both only need the\n // target's rect, and a second `getBoundingClientRect()` call back to\n // back with the first would be a redundant layout read.\n const rect = target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n //\n // Zeroed rather than skipped under reduced motion, which lands the\n // disc at its full size with the growth never drawn. Skipping the\n // call outright would leave `growAnimation` unset, and the release\n // below reads its `currentTime` to decide whether the press has\n // been visible long enough — so the press would still be shown, and\n // would stop being held for its minimum.\n duration: prefersReducedMotion() ? 0 : motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n // A mouse or pen release carries no pressed button, so the guard the\n // other handlers share turns it away, which is right while a click\n // follows to end the press. A host ending on the release matches it by\n // its pointer alone.\n if (endsOnRelease && !isTouch(event)) {\n if (isPressPointer(event) && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n return;\n }\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n } else if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n\n // The release is as far as such a host hears, so it is where the\n // press ends — see `endsOnRelease` above.\n if (endsOnRelease && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n }, [endPressAnimation, endsOnRelease, isPressPointer, shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => {\n const pointer = {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n };\n return endsOnRelease ? pointer : {\n onClick,\n ...pointer\n };\n }, [endsOnRelease, onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n surface\n }), [handlers, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n surface: null\n }), [externalHandlers]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { useRipple };"],"mappings":";;;;;;;;AAeA,MAAMc,UAAUD,UAAUE;AAI1B,MAAMC,uBAAuB;AAC7B,MAAMC,yBAAyB;AAC/B,MAAMC,4BAA4B;AAIlC,MAAMC,eAAed,MAAaK,OAAaW,OAAO;;;;;;;;AAStD,MAAMC,cAAc;;CAElBC,SAAS;;CAETC,UAAU;;CAEVC,YAAY;;CAEZC,iBAAiB;AACnB;AAWA,SAASa,QAAQC,OAAqB;CACpC,OAAOA,MAAMC,gBAAgB;AAC/B;;;;;;;;;;;;;AAcA,SAASC,uBAAuB;CAC9B,OAAOC,OAAOC,WAAW,kCAAkC,CAAC,CAACC;AAC/D;AA+CA,SAAAC,UAAAK,IAAAC,IAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAA0D,MAAAR,UAAAI,OAAAK,KAAAA,IAAA,OAAAL;CAAc,IAAAM;CAAA,IAAAH,EAAA,OAAAF,IAAA;EAAEK,KAAAL,OAAAI,KAAAA,IAAA,CAAsD,IAAtDJ;EAAuDE,EAAA,KAAAF;EAAAE,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAvD,MAAAN,mBAAAS;CAAyD,MAAAR,gBAAAI,OAAAG,KAAAA,IAAA,QAAAH;CAIjI,MAAA,CAAAK,SAAAC,cAA8BlD,SAAS,KAAK;CAC5C,MAAAmD,YAAkBpD,OAAwB,IAAI;CAC9C,MAAAqD,QAAcrD,OAAoBc,YAAWE,QAAS;CACtD,MAAAsC,gBAAsBtD,OAA8BgD,KAAAA,CAAS;CAC7D,MAAAO,mBAAyBvD,OAA8CgD,KAAAA,CAAS;CAChF,MAAAQ,cAAoBxD,OAAO,C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X;EAACiC,EAAA,MAAAN;EAAAM,EAAA,MAAAsI;CAAA,OAAAA,MAAAtI,EAAA;CAAuB,OACjBP,UAAA4I,gBAAAE;AAAwC;AAnRjD,SAAA9C,MAAA+C,WAAA;CAgJMvD,WAAWD,WAAS3H,iBAAgBoL,MAAO;AAAC"}
|
|
1
|
+
{"version":3,"file":"useRipple.js","names":["MouseEvent","MouseEventHandler","PointerEvent","PointerEventHandler","ReactNode","stylex","useCallback","useMemo","useRef","useState","rippleStyles","motionDurationMs","motionEasing","spacingPx","PADDING","sm","INITIAL_ORIGIN_SCALE","SOFT_EDGE_MINIMUM_SIZE","SOFT_EDGE_CONTAINER_RATIO","surfaceProps","props","surface","RippleState","Holding","Inactive","TouchDelay","WaitingForClick","const","ReleaseHandlers","Element","Omit","RippleEventHandlers","HostElement","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","isTouch","event","pointerType","prefersReducedMotion","window","matchMedia","matches","useRipple","enabled","externalHandlers","endsOnRelease","handlers","t0","t1","t2","$","_c","undefined","t3","pressed","setPressed","rippleRef","state","growAnimation","rippleStartEvent","initialSize","rippleScale","t4","Symbol","for","isPrimary","startEvent","current","pointerId","isPressPointer","t5","event_0","buttons","shouldReactToEvent","t6","rect","height","width","maxDimension","Math","max","softEdgeSize","size","floor","hypotenuse","hypot","maxRadius","determineRippleSize","t7","rect_0","positionEvent","height_0","left","top","width_0","size_0","endPoint","x","y","origin","clientX","clientY","startPoint","getTranslationCoordinates","t8","target","positionEvent_0","ripple","cancel","rect_1","getBoundingClientRect","size_1","endPoint_0","startPoint_0","style","animate","transform","duration","long1","easing","standard","fill","startPressAnimation","t9","animation","elapsed","currentTime","Infinity","medium1","Promise","resolve","setTimeout","endPressAnimation","t10","getState","t11","event_1","target_0","currentTarget","_temp","handlePointerDownAsync","t12","event_2","handlePointerDown","t13","event_3","handlePointerUp","t14","event_4","handlePointerLeave","t15","event_5","handlePointerCancel","t16","event_6","handleClick","t17","handleContextMenu","onClickProp","onContextMenuProp","onPointerCancelProp","onPointerDownProp","onPointerLeaveProp","onPointerUpProp","t18","event_7","t19","event_8","t20","event_9","t21","event_10","t22","event_11","t23","event_12","t24","pointer","t25","t26","press","t27","t28","enabledResult","t29","disabledResult","resolve_0","short2","stylex.props","rippleStyles","_c","disabledResult"],"sources":["../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ntype ReleaseHandlers<HostElement extends Element> = Omit<RippleEventHandlers<HostElement>, 'onClick'>;\ninterface RippleEventHandlers<HostElement extends Element> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Whether the reader has asked the OS for less motion.\n *\n * Growth is a Web Animations call, which makes it the one animation in the\n * library no `@media (prefers-reduced-motion: reduce)` branch can reach — see\n * src/styles/ripple.ts for the opacity half, which is CSS and carries one.\n *\n * Read at the press rather than once at mount, so a reader who changes the\n * setting is answered by their next press rather than by their next reload.\n * The press already reads layout through `getBoundingClientRect`, which costs\n * more than this does.\n */\nfunction prefersReducedMotion() {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * Pass `endsOnRelease` for a host that never hears its own click: a\n * collection row, whose clicks React Aria's press handling keeps for itself.\n * The press then ends when the pointer is released over the host rather than\n * on the click that would follow, still held for the minimum a short press\n * gets. A keyboard press reaches such a host as no pointer event at all, so\n * it draws no ripple there.\n *\n * `handlers` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\n// A host ending on the release never hears a click, so nothing is taken for\n// one and none is handed back: the handlers are the pointer ones alone, which\n// is also what a collection row's type admits.\nfunction useRipple<HostElement extends Element = Element>(enabled: boolean, externalHandlers: ReleaseHandlers<HostElement>, endsOnRelease: true): {\n handlers: ReleaseHandlers<HostElement>;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled?: boolean, externalHandlers?: RippleEventHandlers<HostElement>, endsOnRelease?: false): {\n handlers: RippleEventHandlers<HostElement>;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}, endsOnRelease = false): {\n handlers: RippleEventHandlers<HostElement>;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n\n // Whether `event` comes from the pointer a press would follow: the primary\n // one, and the one that started the press already in flight, if any.\n const isPressPointer = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n return !startEvent || startEvent.pointerId === event.pointerId;\n }, []);\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => isPressPointer(event) && (isTouch(event) || event.buttons === 1), [isPressPointer]);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: HostElement, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n\n // Read once and share: the two helpers below both only need the\n // target's rect, and a second `getBoundingClientRect()` call back to\n // back with the first would be a redundant layout read.\n const rect = target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n //\n // Zeroed rather than skipped under reduced motion, which lands the\n // disc at its full size with the growth never drawn. Skipping the\n // call outright would leave `growAnimation` unset, and the release\n // below reads its `currentTime` to decide whether the press has\n // been visible long enough — so the press would still be shown, and\n // would stop being held for its minimum.\n duration: prefersReducedMotion() ? 0 : motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n // A mouse or pen release carries no pressed button, so the guard the\n // other handlers share turns it away, which is right while a click\n // follows to end the press. A host ending on the release matches it by\n // its pointer alone.\n if (endsOnRelease && !isTouch(event)) {\n if (isPressPointer(event) && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n return;\n }\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n } else if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n\n // The release is as far as such a host hears, so it is where the\n // press ends — see `endsOnRelease` above.\n if (endsOnRelease && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n }, [endPressAnimation, endsOnRelease, isPressPointer, shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => {\n const pointer = {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n };\n return endsOnRelease ? pointer : {\n onClick,\n ...pointer\n };\n }, [endsOnRelease, onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n surface\n }), [handlers, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n surface: null\n }), [externalHandlers]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { useRipple };"],"mappings":";;;;;;;;AAeA,MAAMc,UAAUD,UAAUE;AAI1B,MAAMC,uBAAuB;AAC7B,MAAMC,yBAAyB;AAC/B,MAAMC,4BAA4B;AAIlC,MAAMC,e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A,MAAArB;EAAAqB,EAAA,MAAA+H;EAAA/H,EAAA,MAAAgI;CAAA,OAAAA,MAAAhI,EAAA;CAXH,MAAAJ,WAQEoI;CAIuG,IAAAC;CAAA,IAAAjI,EAAA,QAAAI,SAAA;EAEzE6H,MAAAlL,MAAaK,OAAY8K,OAAQ9H,WAAWhD,OAAYgD,OAAQ;EAACJ,EAAA,MAAAI;EAAAJ,EAAA,MAAAiI;CAAA,OAAAA,MAAAjI,EAAA;CAAA,IAAAmI;CAAA,IAAAnI,EAAA,QAAAiI,KAAA;EADnEE,MAAA,oBAAA,QAAA;GAAkB,eAAA;GAAM,GAAKtK;GACrD,UAAA,oBAAA,QAAA;IAAWyC,KAAAA;IAAS,GAAM2H;GAAiE,CAAA;EACtF,CAAA;EAAAjI,EAAA,MAAAiI;EAAAjI,EAAA,MAAAmI;CAAA,OAAAA,MAAAnI,EAAA;CAFX,MAAAjC,UAA8BoK;CAEN,IAAAC;CAAA,IAAApI,EAAA,QAAAJ,YAAAI,EAAA,QAAAjC,SAAA;EAOaqK,MAAA;GAAAxI;GAAA7B;EAGrC;EAACiC,EAAA,MAAAJ;EAAAI,EAAA,MAAAjC;EAAAiC,EAAA,MAAAoI;CAAA,OAAAA,MAAApI,EAAA;CAHD,MAAAqI,gBAAqCD;CAGZ,IAAAE;CAAA,IAAAtI,EAAA,QAAAN,kBAAA;EACa4I,MAAA;GAAA1I,UAC1BF;GAAgB3B,SACjB;EACX;EAACiC,EAAA,MAAAN;EAAAM,EAAA,MAAAsI;CAAA,OAAAA,MAAAtI,EAAA;CAAuB,OACjBP,UAAA4I,gBAAAE;AAAwC;AAnRjD,SAAA9C,MAAA+C,WAAA;CAgJMvD,WAAWD,WAAS3H,iBAAgBoL,MAAO;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollable.js","names":["RefObject","useLayoutEffect","useState","useScrollable","ref","$","_c","scrollable","setScrollable","t0","t1","element","current","measure","scrollHeight","clientHeight","resize","ResizeObserver","observe","disconnect","child","children","mutation","MutationObserver","characterData","childList","subtree"],"sources":["../../src/hooks/useScrollable.ts"],"sourcesContent":["import type { RefObject } from 'react'\n\nimport { useLayoutEffect, useState } from 'react'\n\n/**\n * Whether the element in `ref` is scrolling its content: whether the content\n * runs past the element's own block size. Kept current as the element\n * resizes and as its content changes.\n *\n * What it is for is keyboard access. A scroll container with nothing\n * focusable inside it cannot be reached from the keyboard in every browser,\n * so a component makes it a tab stop while this is true, and only then — a\n * body short enough to show whole is no stop at all.\n *\n * The element is watched for its own size, and each child for its size, since\n * a child growing is how content outgrows a container whose size is capped.\n * The children are re-observed whenever the content changes, and a change of\n * text alone is caught by the same mutation observer. Measured in a layout\n * effect, so the first paint already has the answer rather than a frame\n * later.\n */\nfunction useScrollable(ref: RefObject<HTMLElement | null>): boolean {\n const [scrollable, setScrollable] = useState(false)\n\n useLayoutEffect(() => {\n const element = ref.current\n if (element === null) {\n return undefined\n }\n\n const measure = () => {\n setScrollable(element.scrollHeight > element.clientHeight)\n }\n const resize = new ResizeObserver(measure)\n const observe = () => {\n resize.disconnect()\n resize.observe(element)\n for (const child of element.children) {\n resize.observe(child)\n }\n }\n const mutation = new MutationObserver(() => {\n observe()\n measure()\n })\n\n observe()\n mutation.observe(element, {\n characterData: true,\n childList: true,\n subtree: true,\n })\n measure()\n\n return () => {\n resize.disconnect()\n mutation.disconnect()\n }\n }, [ref])\n\n return scrollable\n}\n\nexport { useScrollable }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,SAAAG,cAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,YAAAC,iBAAoCN,SAAS,KAAK;CAAC,IAAAO;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,KAAA;EAEnCK,WAAA;GACd,MAAAE,UAAgBP,IAAGQ;GACnB,IAAID,YAAY,MAAI;GAIpB,MAAAE,gBAAgB;IACdL,cAAcG,QAAOG,eAAgBH,QAAOI,YAAa;GAAC;GAE5D,MAAAC,SAAe,IAAIC,eAAeJ,OAAO;GACzC,MAAAK,gBAAgB;IACdF,OAAMG,WAAY;IAClBH,OAAME,QAASP,OAAO;IACtB,KAAK,MAAAS,SAAeT,QAAOU,UACzBL,OAAME,QAASE,KAAK;GACrB;GAEH,MAAAE,WAAiB,IAAIC,uBAAiB;IACpCL,QAAQ;IACRL,QAAQ;GAAC,CACV;GAEDK,QAAQ;GACRI,SAAQJ,QAASP,SAAS;IAAAa,eACT;IAAIC,WACR;IAAIC,SACN;GACX,CAAC;GACDb,QAAQ;GAAC,aAEF;IACLG,OAAMG,WAAY;IAClBG,SAAQH,WAAY;GAAC;EACtB;EACAT,KAAA,CAACN,GAAG;EAACC,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAD,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAlCRJ,gBAAgBQ,IAkCbC,EAAK;CAAC,OAEFH;AAAU"}
|
|
1
|
+
{"version":3,"file":"useScrollable.js","names":["RefObject","useLayoutEffect","useState","useScrollable","ref","$","_c","scrollable","setScrollable","t0","t1","element","current","measure","scrollHeight","clientHeight","resize","ResizeObserver","observe","disconnect","child","children","mutation","MutationObserver","characterData","childList","subtree","_c"],"sources":["../../src/hooks/useScrollable.ts"],"sourcesContent":["import type { RefObject } from 'react'\n\nimport { useLayoutEffect, useState } from 'react'\n\n/**\n * Whether the element in `ref` is scrolling its content: whether the content\n * runs past the element's own block size. Kept current as the element\n * resizes and as its content changes.\n *\n * What it is for is keyboard access. A scroll container with nothing\n * focusable inside it cannot be reached from the keyboard in every browser,\n * so a component makes it a tab stop while this is true, and only then — a\n * body short enough to show whole is no stop at all.\n *\n * The element is watched for its own size, and each child for its size, since\n * a child growing is how content outgrows a container whose size is capped.\n * The children are re-observed whenever the content changes, and a change of\n * text alone is caught by the same mutation observer. Measured in a layout\n * effect, so the first paint already has the answer rather than a frame\n * later.\n */\nfunction useScrollable(ref: RefObject<HTMLElement | null>): boolean {\n const [scrollable, setScrollable] = useState(false)\n\n useLayoutEffect(() => {\n const element = ref.current\n if (element === null) {\n return undefined\n }\n\n const measure = () => {\n setScrollable(element.scrollHeight > element.clientHeight)\n }\n const resize = new ResizeObserver(measure)\n const observe = () => {\n resize.disconnect()\n resize.observe(element)\n for (const child of element.children) {\n resize.observe(child)\n }\n }\n const mutation = new MutationObserver(() => {\n observe()\n measure()\n })\n\n observe()\n mutation.observe(element, {\n characterData: true,\n childList: true,\n subtree: true,\n })\n measure()\n\n return () => {\n resize.disconnect()\n mutation.disconnect()\n }\n }, [ref])\n\n return scrollable\n}\n\nexport { useScrollable }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,SAAAG,cAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,YAAAC,iBAAoCN,SAAS,KAAK;CAAC,IAAAO;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,KAAA;EAEnCK,WAAA;GACd,MAAAE,UAAgBP,IAAGQ;GACnB,IAAID,YAAY,MAAI;GAIpB,MAAAE,gBAAgB;IACdL,cAAcG,QAAOG,eAAgBH,QAAOI,YAAa;GAAC;GAE5D,MAAAC,SAAe,IAAIC,eAAeJ,OAAO;GACzC,MAAAK,gBAAgB;IACdF,OAAMG,WAAY;IAClBH,OAAME,QAASP,OAAO;IACtB,KAAK,MAAAS,SAAeT,QAAOU,UACzBL,OAAME,QAASE,KAAK;GACrB;GAEH,MAAAE,WAAiB,IAAIC,uBAAiB;IACpCL,QAAQ;IACRL,QAAQ;GAAC,CACV;GAEDK,QAAQ;GACRI,SAAQJ,QAASP,SAAS;IAAAa,eACT;IAAIC,WACR;IAAIC,SACN;GACX,CAAC;GACDb,QAAQ;GAAC,aAEF;IACLG,OAAMG,WAAY;IAClBG,SAAQH,WAAY;GAAC;EACtB;EACAT,KAAA,CAACN,GAAG;EAACC,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAD,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAlCRJ,gBAAgBQ,IAkCbC,EAAK;CAAC,OAEFH;AAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","stylex","Label","IndicatorTone","indicatorStyles","ACTIVE_TONES","inherit","inheritActive","negative","negativeActive","positive","positiveActive","primary","const","IndicatorLabels","t0","$","_c","label","value","undefined","t1","Symbol","for","props","labels","t2","t3","t4","IndicatorLine","children","percentage","tone","active","solid","line","activeAt","track","trackSolid","inheritTrack","t5","t6","stop","t7","t8"],"sources":["../../src/indicator/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Label } from 'react-aria-components';\nimport type { IndicatorTone } from './styles';\nimport { indicatorStyles } from './styles';\n\n// The two pieces a linear indicator is drawn from, shared by\n// ProgressIndicator and Meter. The styles they use are in ./styles.ts.\n\n// What each tone draws the active indicator and the stop indicator in.\n// `primary` is the style they already carry, so it adds nothing.\nconst ACTIVE_TONES = {\n inherit: indicatorStyles.inheritActive,\n negative: indicatorStyles.negativeActive,\n positive: indicatorStyles.positiveActive,\n primary: null\n} as const;\n\n/**\n * The label and, optionally, the value, on a line above the indicator.\n * React Aria's `Label` reads the surrounding context, so the same element\n * names a progress bar and a meter alike. Renders nothing when there is\n * neither to show.\n */\nexport function IndicatorLabels({\n label,\n value\n}: {\n label: ReactNode;\n value: ReactNode;\n}) {\n if (label === undefined && value === undefined) {\n return null;\n }\n return <div {...stylex.props(indicatorStyles.labels)}>\n {label === undefined ? null : <Label {...stylex.props(indicatorStyles.label)}>{label}</Label>}\n {value === undefined ? null : <span {...stylex.props(indicatorStyles.label)}>{value}</span>}\n </div>;\n}\n\n/**\n * The page's line: the active indicator at its share of the width, the track\n * taking what is left, and the stop indicator at the end. Anything passed as\n * `children` is drawn inside the track, which is what the progress\n * indicator's buffer fills it with; with none the track is solid.\n */\nexport function IndicatorLine({\n children,\n percentage,\n tone\n}: {\n children?: ReactNode;\n percentage: number;\n tone: IndicatorTone;\n}) {\n const active = ACTIVE_TONES[tone];\n const solid = children === undefined;\n return <div {...stylex.props(indicatorStyles.line)}>\n <span {...stylex.props(indicatorStyles.active, indicatorStyles.activeAt(percentage), active)} />\n <span {...stylex.props(indicatorStyles.track, solid && indicatorStyles.trackSolid, solid && tone === 'inherit' && indicatorStyles.inheritTrack)}>\n {children}\n </span>\n <span {...stylex.props(indicatorStyles.stop, active)} />\n </div>;\n}"],"mappings":";;;;;;AAWA,MAAMK,eAAe;CACnBC,SAASF,gBAAgBG;CACzBC,UAAUJ,gBAAgBK;CAC1BC,UAAUN,gBAAgBO;CAC1BC,SAAS;AACX;;;;;;;AAQA,SAAOE,gBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAyB,MAAA,EAAAC,OAAAC,UAAAJ;CAO9B,IAAIG,UAAUE,KAAAA,KAAaD,UAAUC,KAAAA,GAAS,OACrC;CACR,IAAAC;CAAA,IAAAL,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EACeF,KAAApB,MAAaG,gBAAeqB,MAAO;EAACT,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,OAAAE,OAAA;EAC/CQ,KAAAR,UAAUE,KAAAA,IAAV,OAA6B,oBAAC,OAAD;GAAM,GAAKnB,MAAaG,gBAAec,KAAM;GAAIA,UAAAA;EAA3C,CAAA;EAAyDF,EAAA,KAAAE;EAAAF,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,OAAAG,OAAA;EAC5FQ,KAAAR,UAAUC,KAAAA,IAAV,OAA6B,oBAAA,QAAA;GAA6D,GAAnDnB,MAAaG,gBAAec,KAAM;GAAIC,UAAAA;EAAa,CAAA;EAAAH,EAAA,KAAAG;EAAA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AAgB;EAAAhB,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAwB;CAAA,IAAAxB,EAAA,OAAAc,YAAAd,EAAA,QAAAY,IAAA;EAA/IY,KAAA,oBAAA,QAAA;GAEO,GAFGZ;GACPE;EACI,CAAA;EAAAd,EAAA,KAAAc;EAAAd,EAAA,MAAAY;EAAAZ,EAAA,MAAAwB;CAAA,OAAAA,KAAAxB,EAAA;CAAA,IAAAyB;CAAA,IAAAzB,EAAA,QAAAiB,QAAA;EACGQ,KAAAxC,MAAaG,gBAAesC,MAAOT,MAAM;EAACjB,EAAA,MAAAiB;EAAAjB,EAAA,MAAAyB;CAAA,OAAAA,KAAAzB,EAAA;CAAA,IAAA2B;CAAA,IAAA3B,EAAA,QAAAyB,IAAA;EAApDE,KAAA,oBAAA,QAAA,EAAwD,GAA9CF,GAA0C,CAAA;EAAIzB,EAAA,MAAAyB;EAAAzB,EAAA,MAAA2B;CAAA,OAAAA,KAAA3B,EAAA;CAAA,IAAA4B;CAAA,IAAA5B,EAAA,QAAAW,MAAAX,EAAA,QAAAwB,MAAAxB,EAAA,QAAA2B,IAAA;EALrDC,KAAA,qBAAA,OAAA;GAMC,GANQvB;GAAT,UAAA;IACHM;IACAa;IAGAG;GACI;;EAAA3B,EAAA,MAAAW;EAAAX,EAAA,MAAAwB;EAAAxB,EAAA,MAAA2B;EAAA3B,EAAA,MAAA4B;CAAA,OAAAA,KAAA5B,EAAA;CAAA,OAND4B;AAMC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactNode","stylex","Label","IndicatorTone","indicatorStyles","ACTIVE_TONES","inherit","inheritActive","negative","negativeActive","positive","positiveActive","primary","const","IndicatorLabels","t0","$","_c","label","value","undefined","t1","Symbol","for","props","labels","t2","t3","t4","IndicatorLine","children","percentage","tone","active","solid","line","activeAt","track","trackSolid","inheritTrack","t5","t6","stop","t7","t8","_c","stylex.props"],"sources":["../../src/indicator/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Label } from 'react-aria-components';\nimport type { IndicatorTone } from './styles';\nimport { indicatorStyles } from './styles';\n\n// The two pieces a linear indicator is drawn from, shared by\n// ProgressIndicator and Meter. The styles they use are in ./styles.ts.\n\n// What each tone draws the active indicator and the stop indicator in.\n// `primary` is the style they already carry, so it adds nothing.\nconst ACTIVE_TONES = {\n inherit: indicatorStyles.inheritActive,\n negative: indicatorStyles.negativeActive,\n positive: indicatorStyles.positiveActive,\n primary: null\n} as const;\n\n/**\n * The label and, optionally, the value, on a line above the indicator.\n * React Aria's `Label` reads the surrounding context, so the same element\n * names a progress bar and a meter alike. Renders nothing when there is\n * neither to show.\n */\nexport function IndicatorLabels({\n label,\n value\n}: {\n label: ReactNode;\n value: ReactNode;\n}) {\n if (label === undefined && value === undefined) {\n return null;\n }\n return <div {...stylex.props(indicatorStyles.labels)}>\n {label === undefined ? null : <Label {...stylex.props(indicatorStyles.label)}>{label}</Label>}\n {value === undefined ? null : <span {...stylex.props(indicatorStyles.label)}>{value}</span>}\n </div>;\n}\n\n/**\n * The page's line: the active indicator at its share of the width, the track\n * taking what is left, and the stop indicator at the end. Anything passed as\n * `children` is drawn inside the track, which is what the progress\n * indicator's buffer fills it with; with none the track is solid.\n */\nexport function IndicatorLine({\n children,\n percentage,\n tone\n}: {\n children?: ReactNode;\n percentage: number;\n tone: IndicatorTone;\n}) {\n const active = ACTIVE_TONES[tone];\n const solid = children === undefined;\n return <div {...stylex.props(indicatorStyles.line)}>\n <span {...stylex.props(indicatorStyles.active, indicatorStyles.activeAt(percentage), active)} />\n <span {...stylex.props(indicatorStyles.track, solid && indicatorStyles.trackSolid, solid && tone === 'inherit' && indicatorStyles.inheritTrack)}>\n {children}\n </span>\n <span {...stylex.props(indicatorStyles.stop, active)} />\n </div>;\n}"],"mappings":";;;;;;AAWA,MAAMK,eAAe;CACnBC,SAASF,gBAAgBG;CACzBC,UAAUJ,gBAAgBK;CAC1BC,UAAUN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AAA3B,EAAA,QAAAyB,IAAA;EAApDE,KAAA,oBAAA,QAAA,EAAwD,GAA9CF,GAA0C,CAAA;EAAIzB,EAAA,MAAAyB;EAAAzB,EAAA,MAAA2B;CAAA,OAAAA,KAAA3B,EAAA;CAAA,IAAA4B;CAAA,IAAA5B,EAAA,QAAAW,MAAAX,EAAA,QAAAwB,MAAAxB,EAAA,QAAA2B,IAAA;EALrDC,KAAA,qBAAA,OAAA;GAMC,GANQvB;GAAT,UAAA;IACHM;IACAa;IAGAG;GACI;;EAAA3B,EAAA,MAAAW;EAAAX,EAAA,MAAAwB;EAAAxB,EAAA,MAAA2B;EAAA3B,EAAA,MAAA4B;CAAA,OAAAA,KAAA5B,EAAA;CAAA,OAND4B;AAMC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stylex.js","names":[],"sources":["../../../../../../node_modules/@stylexjs/stylex/lib/es/stylex.mjs"],"sourcesContent":["var styleq = {};\n\nvar hasRequiredStyleq;\n\nfunction requireStyleq () {\n\tif (hasRequiredStyleq) return styleq;\n\thasRequiredStyleq = 1;\n\n\tObject.defineProperty(styleq, \"__esModule\", {\n\t value: true\n\t});\n\tstyleq.styleq = void 0;\n\tvar cache = new WeakMap();\n\tvar compiledKey = '$$css';\n\tfunction createStyleq(options) {\n\t var disableCache;\n\t var disableMix;\n\t var transform;\n\t if (options != null) {\n\t disableCache = options.disableCache === true;\n\t disableMix = options.disableMix === true;\n\t transform = options.transform;\n\t }\n\t return function styleq() {\n\t var definedProperties = [];\n\t var className = '';\n\t var inlineStyle = null;\n\t var debugString = '';\n\t var nextCache = disableCache ? null : cache;\n\t var styles = new Array(arguments.length);\n\t for (var i = 0; i < arguments.length; i++) {\n\t styles[i] = arguments[i];\n\t }\n\t while (styles.length > 0) {\n\t var possibleStyle = styles.pop();\n\t if (possibleStyle == null || possibleStyle === false) {\n\t continue;\n\t }\n\t if (Array.isArray(possibleStyle)) {\n\t for (var _i = 0; _i < possibleStyle.length; _i++) {\n\t styles.push(possibleStyle[_i]);\n\t }\n\t continue;\n\t }\n\t var style = transform != null ? transform(possibleStyle) : possibleStyle;\n\t if (style.$$css != null) {\n\t var classNameChunk = '';\n\t if (nextCache != null && nextCache.has(style)) {\n\t var cacheEntry = nextCache.get(style);\n\t if (cacheEntry != null) {\n\t classNameChunk = cacheEntry[0];\n\t debugString = cacheEntry[2];\n\t definedProperties.push.apply(definedProperties, cacheEntry[1]);\n\t nextCache = cacheEntry[3];\n\t }\n\t } else {\n\t var definedPropertiesChunk = [];\n\t for (var prop in style) {\n\t var value = style[prop];\n\t if (prop === compiledKey) {\n\t var compiledKeyValue = style[prop];\n\t if (compiledKeyValue !== true) {\n\t debugString = debugString ? compiledKeyValue + '; ' + debugString : compiledKeyValue;\n\t }\n\t continue;\n\t }\n\t if (typeof value === 'string' || value === null) {\n\t if (!definedProperties.includes(prop)) {\n\t definedProperties.push(prop);\n\t if (nextCache != null) {\n\t definedPropertiesChunk.push(prop);\n\t }\n\t if (typeof value === 'string') {\n\t classNameChunk += classNameChunk ? ' ' + value : value;\n\t }\n\t }\n\t } else {\n\t console.error(\"styleq: \".concat(prop, \" typeof \").concat(String(value), \" is not \\\"string\\\" or \\\"null\\\".\"));\n\t }\n\t }\n\t if (nextCache != null) {\n\t var weakMap = new WeakMap();\n\t nextCache.set(style, [classNameChunk, definedPropertiesChunk, debugString, weakMap]);\n\t nextCache = weakMap;\n\t }\n\t }\n\t if (classNameChunk) {\n\t className = className ? classNameChunk + ' ' + className : classNameChunk;\n\t }\n\t } else {\n\t if (disableMix) {\n\t if (inlineStyle == null) {\n\t inlineStyle = {};\n\t }\n\t inlineStyle = Object.assign({}, style, inlineStyle);\n\t } else {\n\t var subStyle = null;\n\t for (var _prop in style) {\n\t var _value = style[_prop];\n\t if (_value !== undefined) {\n\t if (!definedProperties.includes(_prop)) {\n\t if (_value != null) {\n\t if (inlineStyle == null) {\n\t inlineStyle = {};\n\t }\n\t if (subStyle == null) {\n\t subStyle = {};\n\t }\n\t subStyle[_prop] = _value;\n\t }\n\t definedProperties.push(_prop);\n\t nextCache = null;\n\t }\n\t }\n\t }\n\t if (subStyle != null) {\n\t inlineStyle = Object.assign(subStyle, inlineStyle);\n\t }\n\t }\n\t }\n\t }\n\t var styleProps = [className, inlineStyle, debugString];\n\t return styleProps;\n\t };\n\t}\n\tvar styleq$1 = styleq.styleq = createStyleq();\n\tstyleq$1.factory = createStyleq;\n\treturn styleq;\n}\n\nvar styleqExports = /*@__PURE__*/ requireStyleq();\n\nconst errorForFn = name => new Error(`Unexpected 'stylex.${name}' call at runtime. Styles must be compiled by '@stylexjs/babel-plugin'.`);\nconst errorForType = key => errorForFn(`types.${key}`);\nconst create = function stylexCreate(_styles) {\n throw errorForFn('create');\n};\nconst createTheme = (_baseTokens, _overrides) => {\n throw errorForFn('createTheme');\n};\nconst defineConsts = function stylexDefineConsts(_styles) {\n throw errorForFn('defineConsts');\n};\nconst defineVars = function stylexDefineVars(_styles) {\n throw errorForFn('defineVars');\n};\nconst unstable_conditional = function stylexConditional(_value) {\n throw errorForFn('unstable_conditional');\n};\nconst unstable_defineVarsNested = function stylexDefineVarsNested(_styles) {\n throw errorForFn('unstable_defineVarsNested');\n};\nconst unstable_defineConstsNested = function stylexDefineConstsNested(_styles) {\n throw errorForFn('unstable_defineConstsNested');\n};\nconst unstable_createThemeNested = (_baseTokens, _overrides) => {\n throw errorForFn('unstable_createThemeNested');\n};\nconst defineMarker = () => {\n throw errorForFn('defineMarker');\n};\nconst firstThatWorks = (..._styles) => {\n throw errorForFn('firstThatWorks');\n};\nconst keyframes = _keyframes => {\n throw errorForFn('keyframes');\n};\nconst positionTry = _positionTry => {\n throw errorForFn('positionTry');\n};\nfunction props(...styles) {\n const [className, style, dataStyleSrc] = styleqExports.styleq(styles);\n const result = {};\n if (className != null && className !== '') {\n result.className = className;\n }\n if (style != null && Object.keys(style).length > 0) {\n result.style = style;\n }\n if (dataStyleSrc != null && dataStyleSrc !== '') {\n result['data-style-src'] = dataStyleSrc;\n }\n return result;\n}\nconst toKebabCase = str => str.replace(/([A-Z])/g, '-$1').toLowerCase();\nfunction attrs(...styles) {\n const {\n className,\n style,\n 'data-style-src': dataStyleSrc\n } = props.apply(this, styles);\n const result = {};\n if (className != null) {\n result.class = className;\n }\n if (style != null) {\n result.style = Object.entries(style).map(([key, value]) => `${toKebabCase(key)}:${value}`).join(';');\n }\n if (dataStyleSrc != null) {\n result['data-style-src'] = dataStyleSrc;\n }\n return result;\n}\nconst viewTransitionClass = _viewTransitionClass => {\n throw errorForFn('viewTransitionClass');\n};\nconst defaultMarker = () => {\n throw errorForFn('defaultMarker');\n};\nconst when = {\n ancestor: _p => {\n throw errorForFn('when.ancestor');\n },\n descendant: _p => {\n throw errorForFn('when.descendant');\n },\n siblingBefore: _p => {\n throw errorForFn('when.siblingBefore');\n },\n siblingAfter: _p => {\n throw errorForFn('when.siblingAfter');\n },\n anySibling: _p => {\n throw errorForFn('when.anySibling');\n }\n};\nconst env = Object.freeze({});\nconst types = {\n angle: _v => {\n throw errorForType('angle');\n },\n color: _v => {\n throw errorForType('color');\n },\n url: _v => {\n throw errorForType('url');\n },\n image: _v => {\n throw errorForType('image');\n },\n integer: _v => {\n throw errorForType('integer');\n },\n lengthPercentage: _v => {\n throw errorForType('lengthPercentage');\n },\n length: _v => {\n throw errorForType('length');\n },\n percentage: _v => {\n throw errorForType('percentage');\n },\n number: _v => {\n throw errorForType('number');\n },\n resolution: _v => {\n throw errorForType('resolution');\n },\n time: _v => {\n throw errorForType('time');\n },\n transformFunction: _v => {\n throw errorForType('transformFunction');\n },\n transformList: _v => {\n throw errorForType('transformList');\n }\n};\nconst legacyMerge = /*@__PURE__*/ function () {\n function _legacyMerge(...styles) {\n const [className] = styleqExports.styleq(styles);\n return className;\n }\n _legacyMerge.create = create;\n _legacyMerge.createTheme = createTheme;\n _legacyMerge.defineConsts = defineConsts;\n _legacyMerge.defineMarker = defineMarker;\n _legacyMerge.defineVars = defineVars;\n _legacyMerge.defaultMarker = defaultMarker;\n _legacyMerge.firstThatWorks = firstThatWorks;\n _legacyMerge.keyframes = keyframes;\n _legacyMerge.positionTry = positionTry;\n _legacyMerge.props = props;\n _legacyMerge.attrs = attrs;\n _legacyMerge.types = types;\n _legacyMerge.when = when;\n _legacyMerge.viewTransitionClass = viewTransitionClass;\n _legacyMerge.env = env;\n _legacyMerge.unstable_conditional = unstable_conditional;\n _legacyMerge.unstable_defineVarsNested = unstable_defineVarsNested;\n _legacyMerge.unstable_defineConstsNested = unstable_defineConstsNested;\n _legacyMerge.unstable_createThemeNested = unstable_createThemeNested;\n return _legacyMerge;\n}();\n\nexport { attrs, create, createTheme, defaultMarker, defineConsts, defineMarker, defineVars, env, firstThatWorks, keyframes, legacyMerge, positionTry, props, types, unstable_conditional, unstable_createThemeNested, unstable_defineConstsNested, unstable_defineVarsNested, viewTransitionClass, when };\n"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAI,SAAS,CAAC;AAEd,IAAI;AAEJ,SAAS,gBAAiB;CACzB,IAAI,mBAAmB,OAAO;CAC9B,oBAAoB;CAEpB,OAAO,eAAe,QAAQ,cAAc,EAC1C,OAAO,KACT,CAAC;CACD,OAAO,SAAS,KAAK;CACrB,IAAI,wBAAQ,IAAI,QAAQ;CACxB,IAAI,cAAc;CAClB,SAAS,aAAa,SAAS;EAC7B,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI,WAAW,MAAM;GACnB,eAAe,QAAQ,iBAAiB;GACxC,aAAa,QAAQ,eAAe;GACpC,YAAY,QAAQ;EACtB;EACA,OAAO,SAAS,SAAS;GACvB,IAAI,oBAAoB,CAAC;GACzB,IAAI,YAAY;GAChB,IAAI,cAAc;GAClB,IAAI,cAAc;GAClB,IAAI,YAAY,eAAe,OAAO;GACtC,IAAI,SAAS,IAAI,MAAM,UAAU,MAAM;GACvC,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KACpC,OAAO,KAAK,UAAU;GAExB,OAAO,OAAO,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,YAAY,YAAY,iBAAiB,MAAM,YAAY;IAE/D,OACE,IAAI,YAAY;KACd,IAAI,eAAe,MACjB,cAAc,CAAC;KAEjB,cAAc,OAAO,OAAO,CAAC,GAAG,OAAO,WAAW;IACpD,OAAO;KACL,IAAI,WAAW;KACf,KAAK,IAAI,SAAS,OAAO;MACvB,IAAI,SAAS,MAAM;MACnB,IAAI,WAAW,KAAA,GACT;WAAA,CAAC,kBAAkB,SAAS,KAAK,GAAG;QACtC,IAAI,UAAU,MAAM;SAClB,IAAI,eAAe,MACjB,cAAc,CAAC;SAEjB,IAAI,YAAY,MACd,WAAW,CAAC;SAEd,SAAS,SAAS;QACpB;QACA,kBAAkB,KAAK,KAAK;QAC5B,YAAY;OACd;;KAEJ;KACA,IAAI,YAAY,MACd,cAAc,OAAO,OAAO,UAAU,WAAW;IAErD;GAEJ;GAEA,OAAO;IADW;IAAW;IAAa;GAC1B;EAClB;CACF;CACA,IAAI,WAAW,OAAO,SAAS,aAAa;CAC5C,SAAS,UAAU;CACnB,OAAO;AACR;AAEA,IAAI,gBAA8B,4BAAc;AAwChD,SAAS,MAAM,GAAG,QAAQ;CACxB,MAAM,CAAC,WAAW,OAAO,gBAAgB,cAAc,OAAO,MAAM;CACpE,MAAM,SAAS,CAAC;CAChB,IAAI,aAAa,QAAQ,cAAc,IACrC,OAAO,YAAY;CAErB,IAAI,SAAS,QAAQ,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,GAC/C,OAAO,QAAQ;CAEjB,IAAI,gBAAgB,QAAQ,iBAAiB,IAC3C,OAAO,oBAAoB;CAE7B,OAAO;AACT;AA2CY,OAAO,OAAO,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"stylex.js","names":[],"sources":["../../../../../../node_modules/@stylexjs/stylex/lib/es/stylex.mjs"],"sourcesContent":["var styleq = {};\n\nvar hasRequiredStyleq;\n\nfunction requireStyleq () {\n\tif (hasRequiredStyleq) return styleq;\n\thasRequiredStyleq = 1;\n\n\tObject.defineProperty(styleq, \"__esModule\", {\n\t value: true\n\t});\n\tstyleq.styleq = void 0;\n\tvar cache = new WeakMap();\n\tvar compiledKey = '$$css';\n\tfunction createStyleq(options) {\n\t var disableCache;\n\t var disableMix;\n\t var transform;\n\t if (options != null) {\n\t disableCache = options.disableCache === true;\n\t disableMix = options.disableMix === true;\n\t transform = options.transform;\n\t }\n\t return function styleq() {\n\t var definedProperties = [];\n\t var className = '';\n\t var inlineStyle = null;\n\t var debugString = '';\n\t var nextCache = disableCache ? null : cache;\n\t var styles = new Array(arguments.length);\n\t for (var i = 0; i < arguments.length; i++) {\n\t styles[i] = arguments[i];\n\t }\n\t while (styles.length > 0) {\n\t var possibleStyle = styles.pop();\n\t if (possibleStyle == null || possibleStyle === false) {\n\t continue;\n\t }\n\t if (Array.isArray(possibleStyle)) {\n\t for (var _i = 0; _i < possibleStyle.length; _i++) {\n\t styles.push(possibleStyle[_i]);\n\t }\n\t continue;\n\t }\n\t var style = transform != null ? transform(possibleStyle) : possibleStyle;\n\t if (style.$$css != null) {\n\t var classNameChunk = '';\n\t if (nextCache != null && nextCache.has(style)) {\n\t var cacheEntry = nextCache.get(style);\n\t if (cacheEntry != null) {\n\t classNameChunk = cacheEntry[0];\n\t debugString = cacheEntry[2];\n\t definedProperties.push.apply(definedProperties, cacheEntry[1]);\n\t nextCache = cacheEntry[3];\n\t }\n\t } else {\n\t var definedPropertiesChunk = [];\n\t for (var prop in style) {\n\t var value = style[prop];\n\t if (prop === compiledKey) {\n\t var compiledKeyValue = style[prop];\n\t if (compiledKeyValue !== true) {\n\t debugString = debugString ? compiledKeyValue + '; ' + debugString : compiledKeyValue;\n\t }\n\t continue;\n\t }\n\t if (typeof value === 'string' || value === null) {\n\t if (!definedProperties.includes(prop)) {\n\t definedProperties.push(prop);\n\t if (nextCache != null) {\n\t definedPropertiesChunk.push(prop);\n\t }\n\t if (typeof value === 'string') {\n\t classNameChunk += classNameChunk ? ' ' + value : value;\n\t }\n\t }\n\t } else {\n\t console.error(\"styleq: \".concat(prop, \" typeof \").concat(String(value), \" is not \\\"string\\\" or \\\"null\\\".\"));\n\t }\n\t }\n\t if (nextCache != null) {\n\t var weakMap = new WeakMap();\n\t nextCache.set(style, [classNameChunk, definedPropertiesChunk, debugString, weakMap]);\n\t nextCache = weakMap;\n\t }\n\t }\n\t if (classNameChunk) {\n\t className = className ? classNameChunk + ' ' + className : classNameChunk;\n\t }\n\t } else {\n\t if (disableMix) {\n\t if (inlineStyle == null) {\n\t inlineStyle = {};\n\t }\n\t inlineStyle = Object.assign({}, style, inlineStyle);\n\t } else {\n\t var subStyle = null;\n\t for (var _prop in style) {\n\t var _value = style[_prop];\n\t if (_value !== undefined) {\n\t if (!definedProperties.includes(_prop)) {\n\t if (_value != null) {\n\t if (inlineStyle == null) {\n\t inlineStyle = {};\n\t }\n\t if (subStyle == null) {\n\t subStyle = {};\n\t }\n\t subStyle[_prop] = _value;\n\t }\n\t definedProperties.push(_prop);\n\t nextCache = null;\n\t }\n\t }\n\t }\n\t if (subStyle != null) {\n\t inlineStyle = Object.assign(subStyle, inlineStyle);\n\t }\n\t }\n\t }\n\t }\n\t var styleProps = [className, inlineStyle, debugString];\n\t return styleProps;\n\t };\n\t}\n\tvar styleq$1 = styleq.styleq = createStyleq();\n\tstyleq$1.factory = createStyleq;\n\treturn styleq;\n}\n\nvar styleqExports = /*@__PURE__*/ requireStyleq();\n\nconst errorForFn = name => new Error(`Unexpected 'stylex.${name}' call at runtime. Styles must be compiled by '@stylexjs/babel-plugin'.`);\nconst errorForType = key => errorForFn(`types.${key}`);\nconst create = function stylexCreate(_styles) {\n throw errorForFn('create');\n};\nconst createTheme = (_baseTokens, _overrides) => {\n throw errorForFn('createTheme');\n};\nconst defineConsts = function stylexDefineConsts(_styles) {\n throw errorForFn('defineConsts');\n};\nconst defineVars = function stylexDefineVars(_styles) {\n throw errorForFn('defineVars');\n};\nconst unstable_conditional = function stylexConditional(_value) {\n throw errorForFn('unstable_conditional');\n};\nconst unstable_defineVarsNested = function stylexDefineVarsNested(_styles) {\n throw errorForFn('unstable_defineVarsNested');\n};\nconst unstable_defineConstsNested = function stylexDefineConstsNested(_styles) {\n throw errorForFn('unstable_defineConstsNested');\n};\nconst unstable_createThemeNested = (_baseTokens, _overrides) => {\n throw errorForFn('unstable_createThemeNested');\n};\nconst defineMarker = () => {\n throw errorForFn('defineMarker');\n};\nconst firstThatWorks = (..._styles) => {\n throw errorForFn('firstThatWorks');\n};\nconst keyframes = _keyframes => {\n throw errorForFn('keyframes');\n};\nconst positionTry = _positionTry => {\n throw errorForFn('positionTry');\n};\nfunction props(...styles) {\n const [className, style, dataStyleSrc] = styleqExports.styleq(styles);\n const result = {};\n if (className != null && className !== '') {\n result.className = className;\n }\n if (style != null && Object.keys(style).length > 0) {\n result.style = style;\n }\n if (dataStyleSrc != null && dataStyleSrc !== '') {\n result['data-style-src'] = dataStyleSrc;\n }\n return result;\n}\nconst toKebabCase = str => str.replace(/([A-Z])/g, '-$1').toLowerCase();\nfunction attrs(...styles) {\n const {\n className,\n style,\n 'data-style-src': dataStyleSrc\n } = props.apply(this, styles);\n const result = {};\n if (className != null) {\n result.class = className;\n }\n if (style != null) {\n result.style = Object.entries(style).map(([key, value]) => `${toKebabCase(key)}:${value}`).join(';');\n }\n if (dataStyleSrc != null) {\n result['data-style-src'] = dataStyleSrc;\n }\n return result;\n}\nconst viewTransitionClass = _viewTransitionClass => {\n throw errorForFn('viewTransitionClass');\n};\nconst defaultMarker = () => {\n throw errorForFn('defaultMarker');\n};\nconst when = {\n ancestor: _p => {\n throw errorForFn('when.ancestor');\n },\n descendant: _p => {\n throw errorForFn('when.descendant');\n },\n siblingBefore: _p => {\n throw errorForFn('when.siblingBefore');\n },\n siblingAfter: _p => {\n throw errorForFn('when.siblingAfter');\n },\n anySibling: _p => {\n throw errorForFn('when.anySibling');\n }\n};\nconst env = Object.freeze({});\nconst types = {\n angle: _v => {\n throw errorForType('angle');\n },\n color: _v => {\n throw errorForType('color');\n },\n url: _v => {\n throw errorForType('url');\n },\n image: _v => {\n throw errorForType('image');\n },\n integer: _v => {\n throw errorForType('integer');\n },\n lengthPercentage: _v => {\n throw errorForType('lengthPercentage');\n },\n length: _v => {\n throw errorForType('length');\n },\n percentage: _v => {\n throw errorForType('percentage');\n },\n number: _v => {\n throw errorForType('number');\n },\n resolution: _v => {\n throw errorForType('resolution');\n },\n time: _v => {\n throw errorForType('time');\n },\n transformFunction: _v => {\n throw errorForType('transformFunction');\n },\n transformList: _v => {\n throw errorForType('transformList');\n }\n};\nconst legacyMerge = /*@__PURE__*/ function () {\n function _legacyMerge(...styles) {\n const [className] = styleqExports.styleq(styles);\n return className;\n }\n _legacyMerge.create = create;\n _legacyMerge.createTheme = createTheme;\n _legacyMerge.defineConsts = defineConsts;\n _legacyMerge.defineMarker = defineMarker;\n _legacyMerge.defineVars = defineVars;\n _legacyMerge.defaultMarker = defaultMarker;\n _legacyMerge.firstThatWorks = firstThatWorks;\n _legacyMerge.keyframes = keyframes;\n _legacyMerge.positionTry = positionTry;\n _legacyMerge.props = props;\n _legacyMerge.attrs = attrs;\n _legacyMerge.types = types;\n _legacyMerge.when = when;\n _legacyMerge.viewTransitionClass = viewTransitionClass;\n _legacyMerge.env = env;\n _legacyMerge.unstable_conditional = unstable_conditional;\n _legacyMerge.unstable_defineVarsNested = unstable_defineVarsNested;\n _legacyMerge.unstable_defineConstsNested = unstable_defineConstsNested;\n _legacyMerge.unstable_createThemeNested = unstable_createThemeNested;\n return _legacyMerge;\n}();\n\nexport { attrs, create, createTheme, defaultMarker, defineConsts, defineMarker, defineVars, env, firstThatWorks, keyframes, legacyMerge, positionTry, props, types, unstable_conditional, unstable_createThemeNested, unstable_defineConstsNested, unstable_defineVarsNested, viewTransitionClass, when };\n"],"ignoreList":[0],"mappings":";AAAA,IAAI,SAAS,CAAC;AAEd,IAAI;AAEJ,SAAS,gBAAiB;CACzB,IAAI,mBAAmB,OAAO;CAC9B,oBAAoB;CAEpB,OAAO,eAAe,QAAQ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