@kanso-labs/kanso-ui 0.45.31 → 0.45.33
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/components/app-bar/index.js +34 -19
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button-group/index.js +24 -12
- package/dist/components/button-group/index.js.map +1 -1
- package/dist/components/carousel/index.js +6 -3
- package/dist/components/carousel/index.js.map +1 -1
- package/dist/components/slider/index.js +16 -10
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/split-button/index.js +38 -20
- package/dist/components/split-button/index.js.map +1 -1
- package/dist/field/styles.js +2 -2
- package/dist/field/styles.js.map +1 -1
- package/dist/hooks/useRipple.js +1 -1
- package/dist/node_modules/@stylexjs/stylex/lib/es/stylex.js.map +1 -1
- package/dist/styles.css +1005 -985
- package/package.json +5 -5
|
@@ -49,18 +49,30 @@ const gaps = {
|
|
|
49
49
|
$$css: true
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
const corners = { shape: (start, end) => [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
const corners = { shape: (start, end) => [
|
|
53
|
+
end !== void 0 && {
|
|
54
|
+
kT0f0o: end != null ? "x1wsjk4f" : "",
|
|
55
|
+
$$css: true
|
|
56
|
+
},
|
|
57
|
+
start !== void 0 && {
|
|
58
|
+
kVL7Gh: start != null ? "x1oq9ryg" : "",
|
|
59
|
+
$$css: true
|
|
60
|
+
},
|
|
61
|
+
end !== void 0 && {
|
|
62
|
+
kfmiAY: end != null ? "xbsomw4" : "",
|
|
63
|
+
$$css: true
|
|
64
|
+
},
|
|
65
|
+
start !== void 0 && {
|
|
66
|
+
krdFHd: start != null ? "x6pmj1i" : "",
|
|
67
|
+
$$css: true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"--x-borderEndEndRadius": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(end),
|
|
71
|
+
"--x-borderEndStartRadius": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(start),
|
|
72
|
+
"--x-borderStartEndRadius": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(end),
|
|
73
|
+
"--x-borderStartStartRadius": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(start)
|
|
74
|
+
}
|
|
75
|
+
] };
|
|
64
76
|
const INNER = {
|
|
65
77
|
lg: radii.sm,
|
|
66
78
|
md: radii.sm,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","Children","isValidElement","useState","mergeStyles","radii","sizing","EXPANDED_RATIO","DISABLED","isDisabled","styles","group","kGNEyG","kB7OPa","k1xSpc","kwnvtZ","$$css","minimum","k7Eaqz","gaps","connected","kOIVth","lg","md","xl","xs","xxl","corners","shape","start","end","kT0f0o","kVL7Gh","kfmiAY","krdFHd","val","undefined","INNER","sm","ROUND","pill","controlLg","controlSm","controlXl","controlXs","controlXxl","INNER_PRESSED","children","className","selectionMode","size","style","variant","delta","index","ButtonGroup","t0","$","props","ref","t1","t2","press","setPress","groupProps","t3","items","toArray","filter","sized","t4","t5","Symbol","for","endPress","map","child","key","itemFor","count","length","content","t6","t7","connectedStyles","state","outer","inner","isPressed","isSelected","shift","onPressEnd","onPressStart","width","shiftFor","Math","abs","RACToggleButtonGroup","RACGroup"],"sources":["../../../src/components/button-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, ReactNode, RefAttributes } from 'react';\nimport type { ToggleButtonGroupProps as RACToggleButtonGroupProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Children, isValidElement, useCallback, useState } from 'react';\nimport { ButtonContext, Group as RACGroup, ToggleButtonGroup as RACToggleButtonGroup } from 'react-aria-components';\nimport type { ButtonState } from '../../button';\nimport type { ButtonGroupItem, GroupSize } from '../../button/context';\nimport type { ButtonShape, ButtonSize } from '../button';\nimport { ButtonGroupItemContext } from '../../button/context';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { radii, sizing, spacing } from '../../tokens/design.tokens.stylex';\n\n// The button groups page's two groups, around Buttons and IconButtons placed\n// inside: the standard group, buttons set apart by the page's 18dp, 12dp, 8dp,\n// 8dp and 8dp across the sizes, and the connected group, buttons 2dp apart\n// whose inner corners square off — 4dp, 8dp, 8dp, 16dp and 20dp — while the\n// group's two ends keep the buttons' own round. A square connected group\n// takes the same corner at its ends. The group draws nothing itself; it\n// hands each button its size, its corners and its part in the press\n// interaction through src/button/context.ts.\n//\n// **A press is felt across a standard group.** The pressed button widens by\n// 15% of its width — the share Material Design's own group widens it by —\n// and its neighbours narrow to make the room, so the group's width holds:\n// both neighbours by half the gain each, or the one neighbour of a button at\n// the group's end by all of it. Button takes the change as inline padding\n// and IconButton as width, and both ease it over the motion tokens' short\n// duration.\n//\n// **A connected group answers a press and a selection in the corner\n// instead.** Its buttons stay where they are; a pressed one's inner corners\n// tighten, and a selected one's round off entirely. The page gives the\n// pressed corner for its small group alone, 4dp against the 8dp it rests at;\n// the other sizes press to half their resting corner the same way. The page\n// also gives XS and S buttons in a connected group a 48dp minimum width,\n// which is their touch target.\n//\n// Given `selectionMode` the group is React Aria's `ToggleButtonGroup`, which\n// makes every button in it a toggle and reports the selection by the\n// buttons' `id`s: a radio group for `single`, a toolbar for `multiple`.\n// Without it the group is React Aria's plain `Group`.\n\n// The press interaction's share, from Material Design's own button group.\nconst EXPANDED_RATIO = 0.15;\nconst DISABLED = {\n isDisabled: true\n};\nconst styles = {\n group: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kwnvtZ: \"xozqiw3\",\n $$css: true\n },\n minimum: {\n k7Eaqz: \"x900493\",\n $$css: true\n }\n};\n\n// The space between buttons, by variant and size. The standard group's 18dp\n// at XS falls between two steps of the spacing scale and is written out.\nconst gaps = {\n connected: {\n kOIVth: \"x14qo01y\",\n $$css: true\n },\n lg: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n md: {\n kOIVth: \"x1gka490\",\n $$css: true\n },\n xl: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n xs: {\n kOIVth: \"xaobbuh\",\n $$css: true\n },\n xxl: {\n kOIVth: \"x126z3so\",\n $$css: true\n }\n};\n\n// A connected button's corners on each side, set from the button's place in\n// the group and its state.\nconst corners = {\n shape: (start: string, end: string) => [{\n kT0f0o: end != null ? \"x1wsjk4f\" : end,\n kVL7Gh: start != null ? \"x1oq9ryg\" : start,\n kfmiAY: end != null ? \"xbsomw4\" : end,\n krdFHd: start != null ? \"x6pmj1i\" : start,\n $$css: true\n }, {\n \"--x-borderEndEndRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-borderEndStartRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start),\n \"--x-borderStartEndRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-borderStartStartRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start)\n }]\n};\n\n// The inner corner each size rests at, and the corner it presses to. The 20dp\n// at XL falls between two steps of the radius scale, and the two halves that\n// are not steps of it are written out too.\nconst INNER = {\n lg: radii.sm,\n md: radii.sm,\n xl: radii.lg,\n xs: radii.xs,\n xxl: '20px'\n};\n\n// The round end at each size: half the button's height, or the pill where\n// that is smaller, as Button's own round corner is. Not the pill's 9999px\n// alone: CSS scales every corner of a box down together when two on one side\n// add up to more than the side is long, so a 9999px end beside an 8px inner\n// corner shrank the inner one to nothing. Half the height fits as written.\n// `min()` leaves the pill in charge below that, so a scheme that squares its\n// pill squares the group's ends with its Buttons. A label that wraps makes a\n// button taller than this, and its ends a little less than round.\nconst ROUND = {\n lg: `min(${radii.pill}, calc(${sizing.controlLg} / 2))`,\n md: `min(${radii.pill}, calc(${sizing.controlSm} / 2))`,\n xl: `min(${radii.pill}, calc(${sizing.controlXl} / 2))`,\n xs: `min(${radii.pill}, calc(${sizing.controlXs} / 2))`,\n xxl: `min(${radii.pill}, calc(${sizing.controlXxl} / 2))`\n};\nconst INNER_PRESSED = {\n lg: radii.xs,\n md: radii.xs,\n xl: radii.sm,\n xs: '2px',\n xxl: '10px'\n};\ntype ButtonGroupProps = Omit<RACToggleButtonGroupProps, 'children' | 'className' | 'selectionMode' | 'style'> & RefAttributes<HTMLDivElement> & {\n /** The buttons: Buttons and IconButtons, each with an `id` in a group that selects. */\n children?: ReactNode;\n /** The class for the group's own element. */\n className?: string;\n /**\n * Makes the group select, as React Aria's `ToggleButtonGroup`: `single`\n * for one at a time, `multiple` for any number. Left out, the group's\n * buttons are plain buttons.\n */\n selectionMode?: RACToggleButtonGroupProps['selectionMode'];\n /**\n * The shape a connected group gives its two ends: `round`, the pill, or\n * `square`, the size's corner, which its inner corners take as well.\n * @default 'round'\n */\n shape?: ButtonShape;\n /**\n * The size every button in the group takes, unless it names its own, and\n * the size the group spaces and shapes them for.\n * @default 'md'\n */\n size?: ButtonSize;\n /** The style for the group's own element. */\n style?: CSSProperties;\n /**\n * `standard` sets the buttons apart and widens a pressed one; `connected`\n * sets them 2dp apart with square inner corners.\n * @default 'standard'\n */\n variant?: ButtonGroupVariant;\n};\ntype ButtonGroupVariant = 'connected' | 'standard';\ntype Press = {\n delta: number;\n index: number;\n};\n\n/**\n * A row of Buttons and IconButtons drawn as the button groups page's\n * standard or connected group. Given `selectionMode`, its buttons are\n * toggles whose selection the group keeps, by their `id`s.\n *\n * ```tsx\n * <ButtonGroup aria-label=\"Label\" selectionMode=\"single\" variant=\"connected\">\n * <Button id=\"first\">First item</Button>\n * <Button id=\"second\">Second item</Button>\n * <Button id=\"third\">Third item</Button>\n * </ButtonGroup>\n * ```\n */\nfunction ButtonGroup({\n children,\n className,\n ref,\n selectionMode,\n shape = 'round',\n size,\n style,\n variant = 'standard',\n ...props\n}: ButtonGroupProps) {\n const [press, setPress] = useState<null | Press>(null);\n const items = Children.toArray(children).filter(isValidElement);\n const sized = size ?? 'md';\n const groupProps = mergeStyles(stylex.props(styles.group, variant === 'connected' ? gaps.connected : gaps[sized]), {\n className,\n style\n });\n const endPress = useCallback(() => {\n setPress(null);\n }, []);\n const content = items.map((child, index) => <ButtonGroupItemContext key={child.key ?? index} value={itemFor({\n count: items.length,\n endPress,\n index,\n press,\n setPress,\n shape,\n size,\n variant\n })}>\n {child}\n </ButtonGroupItemContext>);\n if (selectionMode !== undefined) {\n return <RACToggleButtonGroup ref={ref} selectionMode={selectionMode} {...props} {...groupProps}>\n {content}\n </RACToggleButtonGroup>;\n }\n\n // A plain group disables its buttons through React Aria's own context,\n // which Button and IconButton read; a selecting one does it itself.\n return <RACGroup aria-label={props['aria-label']} aria-labelledby={props['aria-labelledby']} ref={ref} {...groupProps}>\n {props.isDisabled === true ? <ButtonContext value={DISABLED}>{content}</ButtonContext> : content}\n </RACGroup>;\n}\n\n// A connected button's corners: the group's ends keep the outer shape, and\n// every edge it shares with a neighbour takes the inner corner, tighter while\n// pressed and round once selected — a press wins over a selection.\nfunction connectedStyles(index: number, count: number, size: GroupSize, shape: ButtonShape, state: ButtonState) {\n const outer = shape === 'square' ? INNER[size] : ROUND[size];\n const inner = state.isPressed ? INNER_PRESSED[size] : state.isSelected === true ? ROUND[size] : INNER[size];\n const start = index === 0 ? outer : inner;\n const end = index === count - 1 ? outer : inner;\n return [corners.shape(start, end), (size === 'xs' || size === 'md') && styles.minimum];\n}\n\n// One button's part in the group: its size, its corners in a connected\n// group, and its share of a press in a standard one.\nfunction itemFor({\n count,\n endPress,\n index,\n press,\n setPress,\n shape,\n size,\n variant\n}: {\n count: number;\n endPress: () => void;\n index: number;\n press: null | Press;\n setPress: (press: Press) => void;\n shape: ButtonShape;\n size: GroupSize | undefined;\n variant: ButtonGroupVariant;\n}): ButtonGroupItem {\n const sized = size ?? 'md';\n if (variant === 'connected') {\n return {\n shift: 0,\n size,\n styles: (state: ButtonState) => connectedStyles(index, count, sized, shape, state)\n };\n }\n return {\n onPressEnd: endPress,\n onPressStart: (width: number) => {\n setPress({\n delta: width * EXPANDED_RATIO,\n index\n });\n },\n shift: shiftFor(index, count, press),\n size\n };\n}\n\n// How far a standard group moves one button's width while a press is held:\n// the pressed button gains the whole share, and its neighbours give it up —\n// half each, or all of it from the one neighbour of a button at an end.\nfunction shiftFor(index: number, count: number, press: null | Press) {\n if (press === null) {\n return 0;\n }\n if (index === press.index) {\n return press.delta;\n }\n if (Math.abs(index - press.index) !== 1) {\n return 0;\n }\n const atEnd = press.index === 0 || press.index === count - 1;\n return -(atEnd ? press.delta : press.delta / 2);\n}\nexport type { ButtonGroupProps, ButtonGroupVariant };\nexport default ButtonGroup;"],"mappings":";;;;;;;;;;AA8CA,MAAMQ,iBAAiB;AACvB,MAAMC,WAAW,EACfC,YAAY,KACd;AACA,MAAMC,SAAS;CACbC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRF,OAAO;CACT;AACF;AAIA,MAAMG,OAAO;CACXC,WAAW;EACTC,QAAQ;EACRL,OAAO;CACT;CACAM,IAAI;EACFD,QAAQ;EACRL,OAAO;CACT;CACAO,IAAI;EACFF,QAAQ;EACRL,OAAO;CACT;CACAQ,IAAI;EACFH,QAAQ;EACRL,OAAO;CACT;CACAS,IAAI;EACFJ,QAAQ;EACRL,OAAO;CACT;CACAU,KAAK;EACHL,QAAQ;EACRL,OAAO;CACT;AACF;AAIA,MAAMW,UAAU,EACdC,QAAQC,OAAeC,QAAgB,CAAC;CACtCC,QAAQD,OAAO,OAAO,aAAaA;CACnCE,QAAQH,SAAS,OAAO,aAAaA;CACrCI,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IoB,SAAS,QAAQA,SAAS,SAASxC,OAAOO,OAAO;AACvF;AAIA,SAAS6D,QAAQ,EACfC,OACAL,UACApB,OACAQ,OACAC,UACAnC,OACAsB,MACAE,WAUkB;CAClB,MAAMiB,QAAQnB,QAAQ;CACtB,IAAIE,YAAY,aACd,OAAO;EACLsC,OAAO;EACPxC;EACAxC,SAAS2E,UAAuBD,gBAAgB9B,OAAOyB,OAAOV,OAAOzC,OAAOyD,KAAK;CACnF;CAEF,OAAO;EACLM,YAAYjB;EACZkB,eAAeC,UAAkB;GAC/B9B,SAAS;IACPV,OAAOwC,QAAQtF;IACf+C;GACF,CAAC;EACH;EACAoC,OAAOI,SAASxC,OAAOyB,OAAOjB,KAAK;EACnCZ;CACF;AACF;AAKA,SAAS4C,SAASxC,OAAeyB,OAAejB,OAAqB;CACnE,IAAIA,UAAU,MACZ,OAAO;CAET,IAAIR,UAAUQ,MAAMR,OAClB,OAAOQ,MAAMT;CAEf,IAAI0C,KAAKC,IAAI1C,QAAQQ,MAAMR,KAAK,MAAM,GACpC,OAAO;CAGT,OAAO,EADOQ,MAAMR,UAAU,KAAKQ,MAAMR,UAAUyB,QAAQ,IAC1CjB,MAAMT,QAAQS,MAAMT,QAAQ;AAC/C"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","Children","isValidElement","useState","mergeStyles","radii","sizing","EXPANDED_RATIO","DISABLED","isDisabled","styles","group","kGNEyG","kB7OPa","k1xSpc","kwnvtZ","$$css","minimum","k7Eaqz","gaps","connected","kOIVth","lg","md","xl","xs","xxl","corners","shape","start","end","undefined","kT0f0o","kVL7Gh","kfmiAY","krdFHd","val","INNER","sm","ROUND","pill","controlLg","controlSm","controlXl","controlXs","controlXxl","INNER_PRESSED","children","className","selectionMode","size","style","variant","delta","index","ButtonGroup","t0","$","props","ref","t1","t2","press","setPress","groupProps","t3","items","toArray","filter","sized","t4","t5","Symbol","for","endPress","map","child","key","itemFor","count","length","content","t6","t7","connectedStyles","state","outer","inner","isPressed","isSelected","shift","onPressEnd","onPressStart","width","shiftFor","Math","abs","RACToggleButtonGroup","RACGroup"],"sources":["../../../src/components/button-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, ReactNode, RefAttributes } from 'react';\nimport type { ToggleButtonGroupProps as RACToggleButtonGroupProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Children, isValidElement, useCallback, useState } from 'react';\nimport { ButtonContext, Group as RACGroup, ToggleButtonGroup as RACToggleButtonGroup } from 'react-aria-components';\nimport type { ButtonState } from '../../button';\nimport type { ButtonGroupItem, GroupSize } from '../../button/context';\nimport type { ButtonShape, ButtonSize } from '../button';\nimport { ButtonGroupItemContext } from '../../button/context';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { radii, sizing, spacing } from '../../tokens/design.tokens.stylex';\n\n// The button groups page's two groups, around Buttons and IconButtons placed\n// inside: the standard group, buttons set apart by the page's 18dp, 12dp, 8dp,\n// 8dp and 8dp across the sizes, and the connected group, buttons 2dp apart\n// whose inner corners square off — 4dp, 8dp, 8dp, 16dp and 20dp — while the\n// group's two ends keep the buttons' own round. A square connected group\n// takes the same corner at its ends. The group draws nothing itself; it\n// hands each button its size, its corners and its part in the press\n// interaction through src/button/context.ts.\n//\n// **A press is felt across a standard group.** The pressed button widens by\n// 15% of its width — the share Material Design's own group widens it by —\n// and its neighbours narrow to make the room, so the group's width holds:\n// both neighbours by half the gain each, or the one neighbour of a button at\n// the group's end by all of it. Button takes the change as inline padding\n// and IconButton as width, and both ease it over the motion tokens' short\n// duration.\n//\n// **A connected group answers a press and a selection in the corner\n// instead.** Its buttons stay where they are; a pressed one's inner corners\n// tighten, and a selected one's round off entirely. The page gives the\n// pressed corner for its small group alone, 4dp against the 8dp it rests at;\n// the other sizes press to half their resting corner the same way. The page\n// also gives XS and S buttons in a connected group a 48dp minimum width,\n// which is their touch target.\n//\n// Given `selectionMode` the group is React Aria's `ToggleButtonGroup`, which\n// makes every button in it a toggle and reports the selection by the\n// buttons' `id`s: a radio group for `single`, a toolbar for `multiple`.\n// Without it the group is React Aria's plain `Group`.\n\n// The press interaction's share, from Material Design's own button group.\nconst EXPANDED_RATIO = 0.15;\nconst DISABLED = {\n isDisabled: true\n};\nconst styles = {\n group: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kwnvtZ: \"xozqiw3\",\n $$css: true\n },\n minimum: {\n k7Eaqz: \"x900493\",\n $$css: true\n }\n};\n\n// The space between buttons, by variant and size. The standard group's 18dp\n// at XS falls between two steps of the spacing scale and is written out.\nconst gaps = {\n connected: {\n kOIVth: \"x14qo01y\",\n $$css: true\n },\n lg: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n md: {\n kOIVth: \"x1gka490\",\n $$css: true\n },\n xl: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n xs: {\n kOIVth: \"xaobbuh\",\n $$css: true\n },\n xxl: {\n kOIVth: \"x126z3so\",\n $$css: true\n }\n};\n\n// A connected button's corners on each side, set from the button's place in\n// the group and its state.\nconst corners = {\n shape: (start: string, end: string) => [end !== undefined && {\n kT0f0o: end != null ? \"x1wsjk4f\" : \"\",\n $$css: true\n }, start !== undefined && {\n kVL7Gh: start != null ? \"x1oq9ryg\" : \"\",\n $$css: true\n }, end !== undefined && {\n kfmiAY: end != null ? \"xbsomw4\" : \"\",\n $$css: true\n }, start !== undefined && {\n krdFHd: start != null ? \"x6pmj1i\" : \"\",\n $$css: true\n }, {\n \"--x-borderEndEndRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-borderEndStartRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start),\n \"--x-borderStartEndRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-borderStartStartRadius\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start)\n }]\n};\n\n// The inner corner each size rests at, and the corner it presses to. The 20dp\n// at XL falls between two steps of the radius scale, and the two halves that\n// are not steps of it are written out too.\nconst INNER = {\n lg: radii.sm,\n md: radii.sm,\n xl: radii.lg,\n xs: radii.xs,\n xxl: '20px'\n};\n\n// The round end at each size: half the button's height, or the pill where\n// that is smaller, as Button's own round corner is. Not the pill's 9999px\n// alone: CSS scales every corner of a box down together when two on one side\n// add up to more than the side is long, so a 9999px end beside an 8px inner\n// corner shrank the inner one to nothing. Half the height fits as written.\n// `min()` leaves the pill in charge below that, so a scheme that squares its\n// pill squares the group's ends with its Buttons. A label that wraps makes a\n// button taller than this, and its ends a little less than round.\nconst ROUND = {\n lg: `min(${radii.pill}, calc(${sizing.controlLg} / 2))`,\n md: `min(${radii.pill}, calc(${sizing.controlSm} / 2))`,\n xl: `min(${radii.pill}, calc(${sizing.controlXl} / 2))`,\n xs: `min(${radii.pill}, calc(${sizing.controlXs} / 2))`,\n xxl: `min(${radii.pill}, calc(${sizing.controlXxl} / 2))`\n};\nconst INNER_PRESSED = {\n lg: radii.xs,\n md: radii.xs,\n xl: radii.sm,\n xs: '2px',\n xxl: '10px'\n};\ntype ButtonGroupProps = Omit<RACToggleButtonGroupProps, 'children' | 'className' | 'selectionMode' | 'style'> & RefAttributes<HTMLDivElement> & {\n /** The buttons: Buttons and IconButtons, each with an `id` in a group that selects. */\n children?: ReactNode;\n /** The class for the group's own element. */\n className?: string;\n /**\n * Makes the group select, as React Aria's `ToggleButtonGroup`: `single`\n * for one at a time, `multiple` for any number. Left out, the group's\n * buttons are plain buttons.\n */\n selectionMode?: RACToggleButtonGroupProps['selectionMode'];\n /**\n * The shape a connected group gives its two ends: `round`, the pill, or\n * `square`, the size's corner, which its inner corners take as well.\n * @default 'round'\n */\n shape?: ButtonShape;\n /**\n * The size every button in the group takes, unless it names its own, and\n * the size the group spaces and shapes them for.\n * @default 'md'\n */\n size?: ButtonSize;\n /** The style for the group's own element. */\n style?: CSSProperties;\n /**\n * `standard` sets the buttons apart and widens a pressed one; `connected`\n * sets them 2dp apart with square inner corners.\n * @default 'standard'\n */\n variant?: ButtonGroupVariant;\n};\ntype ButtonGroupVariant = 'connected' | 'standard';\ntype Press = {\n delta: number;\n index: number;\n};\n\n/**\n * A row of Buttons and IconButtons drawn as the button groups page's\n * standard or connected group. Given `selectionMode`, its buttons are\n * toggles whose selection the group keeps, by their `id`s.\n *\n * ```tsx\n * <ButtonGroup aria-label=\"Label\" selectionMode=\"single\" variant=\"connected\">\n * <Button id=\"first\">First item</Button>\n * <Button id=\"second\">Second item</Button>\n * <Button id=\"third\">Third item</Button>\n * </ButtonGroup>\n * ```\n */\nfunction ButtonGroup({\n children,\n className,\n ref,\n selectionMode,\n shape = 'round',\n size,\n style,\n variant = 'standard',\n ...props\n}: ButtonGroupProps) {\n const [press, setPress] = useState<null | Press>(null);\n const items = Children.toArray(children).filter(isValidElement);\n const sized = size ?? 'md';\n const groupProps = mergeStyles(stylex.props(styles.group, variant === 'connected' ? gaps.connected : gaps[sized]), {\n className,\n style\n });\n const endPress = useCallback(() => {\n setPress(null);\n }, []);\n const content = items.map((child, index) => <ButtonGroupItemContext key={child.key ?? index} value={itemFor({\n count: items.length,\n endPress,\n index,\n press,\n setPress,\n shape,\n size,\n variant\n })}>\n {child}\n </ButtonGroupItemContext>);\n if (selectionMode !== undefined) {\n return <RACToggleButtonGroup ref={ref} selectionMode={selectionMode} {...props} {...groupProps}>\n {content}\n </RACToggleButtonGroup>;\n }\n\n // A plain group disables its buttons through React Aria's own context,\n // which Button and IconButton read; a selecting one does it itself.\n return <RACGroup aria-label={props['aria-label']} aria-labelledby={props['aria-labelledby']} ref={ref} {...groupProps}>\n {props.isDisabled === true ? <ButtonContext value={DISABLED}>{content}</ButtonContext> : content}\n </RACGroup>;\n}\n\n// A connected button's corners: the group's ends keep the outer shape, and\n// every edge it shares with a neighbour takes the inner corner, tighter while\n// pressed and round once selected — a press wins over a selection.\nfunction connectedStyles(index: number, count: number, size: GroupSize, shape: ButtonShape, state: ButtonState) {\n const outer = shape === 'square' ? INNER[size] : ROUND[size];\n const inner = state.isPressed ? INNER_PRESSED[size] : state.isSelected === true ? ROUND[size] : INNER[size];\n const start = index === 0 ? outer : inner;\n const end = index === count - 1 ? outer : inner;\n return [corners.shape(start, end), (size === 'xs' || size === 'md') && styles.minimum];\n}\n\n// One button's part in the group: its size, its corners in a connected\n// group, and its share of a press in a standard one.\nfunction itemFor({\n count,\n endPress,\n index,\n press,\n setPress,\n shape,\n size,\n variant\n}: {\n count: number;\n endPress: () => void;\n index: number;\n press: null | Press;\n setPress: (press: Press) => void;\n shape: ButtonShape;\n size: GroupSize | undefined;\n variant: ButtonGroupVariant;\n}): ButtonGroupItem {\n const sized = size ?? 'md';\n if (variant === 'connected') {\n return {\n shift: 0,\n size,\n styles: (state: ButtonState) => connectedStyles(index, count, sized, shape, state)\n };\n }\n return {\n onPressEnd: endPress,\n onPressStart: (width: number) => {\n setPress({\n delta: width * EXPANDED_RATIO,\n index\n });\n },\n shift: shiftFor(index, count, press),\n size\n };\n}\n\n// How far a standard group moves one button's width while a press is held:\n// the pressed button gains the whole share, and its neighbours give it up —\n// half each, or all of it from the one neighbour of a button at an end.\nfunction shiftFor(index: number, count: number, press: null | Press) {\n if (press === null) {\n return 0;\n }\n if (index === press.index) {\n return press.delta;\n }\n if (Math.abs(index - press.index) !== 1) {\n return 0;\n }\n const atEnd = press.index === 0 || press.index === count - 1;\n return -(atEnd ? press.delta : press.delta / 2);\n}\nexport type { ButtonGroupProps, ButtonGroupVariant };\nexport default ButtonGroup;"],"mappings":";;;;;;;;;;AA8CA,MAAMQ,iBAAiB;AACvB,MAAMC,WAAW,EACfC,YAAY,KACd;AACA,MAAMC,SAAS;CACbC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRF,OAAO;CACT;AACF;AAIA,MAAMG,OAAO;CACXC,WAAW;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R,UAAUyB,QAAQ,IAC1CjB,MAAMT,QAAQS,MAAMT,QAAQ;AAC/C"}
|
|
@@ -67,9 +67,12 @@ const _temp3 = {
|
|
|
67
67
|
const placed = {
|
|
68
68
|
item: (inlineSize, shift, clip) => [
|
|
69
69
|
_temp,
|
|
70
|
-
{
|
|
71
|
-
kz4h6p: clip != null ? "xx58lst" :
|
|
72
|
-
|
|
70
|
+
clip !== void 0 && {
|
|
71
|
+
kz4h6p: clip != null ? "xx58lst" : "",
|
|
72
|
+
$$css: true
|
|
73
|
+
},
|
|
74
|
+
shift !== void 0 && {
|
|
75
|
+
kLqNvP: shift != null ? "x1lxsm33" : "",
|
|
73
76
|
$$css: true
|
|
74
77
|
},
|
|
75
78
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","Children","createContext","isValidElement","useContext","useLayoutEffect","useRef","useState","arrange","placements","useMessages","focus","mergeStyles","radii","PADDING","DEFAULT_ITEM_SIZE","children","visibleWidth","width","itemSize","label","layout","nextLabel","previousLabel","styles","item","kaIpWk","kB7OPa","kzQI83","kmuXW","kAzted","kVQacm","kVAEAm","$$css","itemUncontained","k5xd4v","marker","scroller","kOuLrU","k1xSpc","kXHlph","kORKVm","kvh3hx","k5wCbM","khEr5k","kc424l","scrollerUncontained","katHQp","_temp","kzqmXN","_temp2","_temp3","placed","inlineSize","shift","clip","kz4h6p","kLqNvP","undefined","val","uncontained","count","index","large","placement","SlotContext","end","lastLarge","masked","scrolled","step","along","direction","offset","Math","round","min","max","Carousel","t0","$","t1","t2","ref","props","messages","scrollerRef","setWidth","setScrolled","items","toArray","filter","length","room","arrangement","steps","largeCount","position","drawn","t3","Symbol","for","current","clientWidth","abs","scrollLeft","measure","t4","t5","scroller_0","observer","ResizeObserver","observe","disconnect","t6","geometry","scrollAlong","previous","t7","geometry_0","next","t8","event","target","Node","Array","from","currentTarget","findIndex","child","contains","restRevealing","reveal","slots","map","_","index_0","t9","carousel","t10","className","t11","ring","t12","t13","0","1","t14","previousSlide","t15","t16","t17","t18","nextSlide","t19","t20","t21","t22","index_1","key","__0","rest","CarouselItem","slot","inset","slideLabel","slide","left","xl","at","sign","getComputedStyle","scrollTo","Item"],"sources":["../../../src/components/carousel/index.tsx"],"sourcesContent":["'use client';\n\nimport type { FocusEvent, HTMLAttributes, ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Children, createContext, isValidElement, useCallback, useContext, useLayoutEffect, useRef, useState } from 'react';\nimport type { CarouselLayout, Placement } from '../../carousel/arrangement';\nimport { arrange, GAP, placements } from '../../carousel/arrangement';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useMessages } from '../../i18n';\nimport { focus } from '../../styles/focus';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { radii, spacing } from '../../tokens/design.tokens.stylex';\nimport IconButton from '../icon-button';\n\n// The carousel page's carousel: a row of items that scrolls on and off the\n// screen, drawn in three of the page's layouts. Each has the page's 16dp of\n// padding at its ends and 8dp at its top and bottom, 8dp between items and a\n// 28dp corner on every item.\n//\n// - **Multi-browse**, the default, shows as many large items as fit at\n// `itemSize`, then a medium one and a small one, and fills its width\n// exactly; the large width gives way where the preferred one does not fit.\n// - **Hero** shows one large item and one small.\n// - **Uncontained** shows every item at `itemSize`, scrolling past the edge.\n//\n// **Items change size as they move**, as the page draws them. The first two\n// layouts come to rest one item apart, and between two rests every item's\n// place and width are interpolated, so an item shrinks as it leaves and\n// grows as it arrives; the last rests turn the arrangement round a slot at a\n// time, so every item is drawn large at one of them. The arithmetic is\n// `src/carousel/arrangement.ts`.\n// An item is laid out at the large width and masked down to the width it is\n// drawn at, centred, with the page's corner on the mask: what it holds is\n// cut at both sides rather than squeezed, as the page's masked items are.\n//\n// **What an item holds can see its mask.** The page shows an item's text\n// once the item is wide enough to hold it, and only what the item holds\n// knows where its text is, so `Carousel.Item` takes its children as a\n// function too, handed the width the item is laid out at and the width\n// that shows of it, as MDC-Android's masked items report their mask to a\n// listener. The text can then fade or hide as the mask closes over it.\n//\n// **The scrolling is the browser's.** A scroller holds the items' track,\n// which stays put while it scrolls, and a run of empty markers one item\n// apart after it, which is what gives the scroller its length and its rests:\n// each marker's end is a scroll-snap point, and a mark at the scroller's\n// start is the first. The position the scroller reports is what the items\n// are drawn from. Uncontained has no rests and no masks, so its items scroll\n// in the track themselves, snapping to their own starts.\n//\n// **It is the ARIA carousel pattern**, since React Aria has no carousel: a\n// region named by `label` and described as a carousel, each item a group\n// described as a slide and named by which of how many it is, and a previous\n// and a next button under it, at the end. Focus moving into an item that is\n// not drawn large scrolls the carousel to the nearest rest that draws it\n// large, and the scroller is a tab stop while it scrolls, so the arrow keys\n// move it too. Under reduced motion the scroller jumps rather than scrolling\n// smoothly.\n//\n// The page's large width is \"dynamic, or user-set\", and neither MDC-Android\n// nor Compose has a default for it; `itemSize`'s 240 is this component's own.\n// Uncontained keeps the 16dp at its end as well as its start, where the page\n// gives it a leading padding alone, so its last item does not end flush\n// against the edge.\n\n/** The page's 16dp at a carousel's ends. */\nconst PADDING = 16;\nconst DEFAULT_ITEM_SIZE = 240;\ntype CarouselItemProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n /**\n * What the item shows: usually an image, which the item masks. A function\n * is handed how much of the item shows, every time that changes, so text\n * the item has no room for can be hidden as the mask closes over it.\n */\n children?: ((state: CarouselItemRenderProps) => ReactNode) | ReactNode;\n};\n\n/** How much of a `Carousel.Item` shows, for children written as a function. */\ntype CarouselItemRenderProps = {\n /**\n * How much of `width` shows, in pixels. The mask takes the rest evenly\n * from both sides, so `(width - visibleWidth) / 2` is cut off each. It is\n * `width` for an item drawn large, and for every item of an uncontained\n * carousel, which masks nothing.\n */\n visibleWidth: number;\n /**\n * The width the item is laid out at, in pixels: the large item's, which\n * every item in the carousel shares.\n */\n width: number;\n};\ntype CarouselProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {\n /** The items: `Carousel.Item` for each. */\n children?: ReactNode;\n /**\n * The large item's preferred width, in pixels. Multi-browse lays out as\n * many as fit and narrows them where they do not; uncontained draws every\n * item at it; hero takes its large item's width from the carousel's.\n * @default 240\n */\n itemSize?: number;\n /**\n * What the carousel shows, for a screen reader. Required rather than\n * optional: a carousel is a region, and a region with no name is one a\n * screen reader cannot introduce.\n */\n label: string;\n /**\n * Which of the page's layouts the carousel draws.\n * @default 'multi-browse'\n */\n layout?: CarouselLayout;\n /**\n * What the next button is called. Left out, the library names it in the\n * reader's locale — \"Next slide\" in English.\n */\n nextLabel?: string;\n /**\n * What the previous button is called. Left out, the library names it in\n * the reader's locale — \"Previous slide\" in English.\n */\n previousLabel?: string;\n};\nconst styles = {\n item: {\n kaIpWk: \"x19pkqky\",\n kB7OPa: \"x9f619\",\n kzQI83: \"x1c4vz4f\",\n kmuXW: \"x2lah0s\",\n kAzted: \"x2lwn1j\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n itemUncontained: {\n k5xd4v: \"x1bhewko\",\n $$css: true\n },\n marker: {\n kmuXW: \"x2lah0s\",\n k5xd4v: \"x83psoy\",\n $$css: true\n },\n scroller: {\n kOuLrU: \"xfk6m8\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXHlph: \"xw2csxc\",\n kORKVm: \"x10wlt62\",\n kvh3hx: \"x7p5m3t\",\n kVAEAm: \"x1n2onr6\",\n k5wCbM: \"x1rohswg\",\n khEr5k: \"xkcv6ua xg83hb1\",\n kc424l: \"xhfbhpw\",\n $$css: true\n },\n scrollerUncontained: {\n katHQp: \"x7jkkja\",\n $$css: true\n }\n};\nconst _temp = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst _temp2 = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst _temp3 = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst placed = {\n item: (inlineSize: string, shift: string, clip: string) => [_temp, {\n kz4h6p: clip != null ? \"xx58lst\" : clip,\n kLqNvP: shift != null ? \"x1lxsm33\" : shift,\n $$css: true\n }, {\n \"--x-clipPath\": clip != null ? clip : undefined,\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(inlineSize),\n \"--x-insetInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(shift)\n }],\n marker: (inlineSize: string) => [_temp2, {\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(inlineSize)\n }],\n uncontained: (inlineSize: string) => [_temp3, {\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(inlineSize)\n }]\n};\ntype Slot = {\n count: number;\n index: number;\n /** The width the item is laid out at. */\n large: number;\n layout: CarouselLayout;\n /** Where it is drawn, for a layout that masks. */\n placement: Placement | undefined;\n};\nconst SlotContext = createContext<null | Slot>(null);\n\n/** What the controls and focus scroll by, as numbers read off one render. */\ntype Geometry = {\n /** The offset of the last rest, or for uncontained how far it scrolls. */\n end: number;\n /** How many items past the first large one the last large one is. */\n lastLarge: number;\n masked: boolean;\n scrolled: number;\n /** The distance between two rests, or for uncontained between two items. */\n step: number;\n};\n\n// Where a press of previous or next scrolls to from `scrolled`: the rest\n// either side of the nearest one, or for uncontained an item's width along,\n// kept between the two ends.\nfunction along(direction: -1 | 1, {\n end,\n masked,\n scrolled,\n step\n}: Geometry): number {\n if (step <= 0) {\n return 0;\n }\n const offset = masked ? (Math.round(scrolled / step) + direction) * step : scrolled + direction * step;\n return Math.min(Math.max(offset, 0), end);\n}\n\n/**\n * A row of items that scrolls on and off the screen, in the carousel page's\n * multi-browse, hero or uncontained layout. Name it with `label`, and give it\n * a `Carousel.Item` for each item.\n *\n * ```tsx\n * <Carousel label=\"Label\">\n * <Carousel.Item><img alt=\"First item\" src=\"…\" /></Carousel.Item>\n * <Carousel.Item><img alt=\"Second item\" src=\"…\" /></Carousel.Item>\n * </Carousel>\n * ```\n *\n * The call site's `className` and `style` land on the carousel as a whole,\n * which is the element a layout positions.\n */\nfunction Carousel({\n children,\n itemSize = DEFAULT_ITEM_SIZE,\n label,\n layout = 'multi-browse',\n nextLabel,\n previousLabel,\n ref,\n ...props\n}: CarouselProps & RefAttributes<HTMLElement>) {\n const messages = useMessages();\n const scrollerRef = useRef<HTMLDivElement>(null);\n // The scroller's width and how far it has scrolled along the text:\n // everything drawn is drawn from these two.\n const [width, setWidth] = useState(0);\n const [scrolled, setScrolled] = useState(0);\n const items = Children.toArray(children).filter(isValidElement);\n const count = items.length;\n const room = Math.max(width - 2 * PADDING, 0);\n const arrangement = arrange(layout, room, itemSize, count);\n const masked = layout !== 'uncontained';\n // Read off the arrangement as arithmetic, so each is a number of its own\n // rather than a field of an object the calls below are handed.\n const step = arrangement.large + GAP;\n // The last rest, or how far the uncontained track runs past the scroller.\n const end = masked ? arrangement.steps * step : Math.max(count * step - GAP + 2 * PADDING - width, 0);\n const lastLarge = arrangement.largeCount - 1;\n const position = masked && step > 0 ? scrolled / step : 0;\n const drawn = masked ? placements(layout, arrangement, room, PADDING, count, position) : [];\n\n // Measured before the first paint, again on every scroll, and whenever\n // the scroller's width changes. A right-to-left scroller counts its offset\n // down from zero.\n const measure = useCallback(() => {\n const scroller = scrollerRef.current;\n if (scroller === null) {\n return;\n }\n setWidth(scroller.clientWidth);\n setScrolled(Math.abs(scroller.scrollLeft));\n }, []);\n useLayoutEffect(() => {\n const scroller = scrollerRef.current;\n if (scroller === null) {\n return undefined;\n }\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(scroller);\n return () => {\n observer.disconnect();\n };\n }, [measure]);\n const previous = useCallback(() => {\n const geometry = {\n end,\n lastLarge,\n masked,\n scrolled,\n step\n };\n scrollAlong(scrollerRef.current, along(-1, geometry));\n }, [end, lastLarge, masked, scrolled, step]);\n const next = useCallback(() => {\n const geometry = {\n end,\n lastLarge,\n masked,\n scrolled,\n step\n };\n scrollAlong(scrollerRef.current, along(1, geometry));\n }, [end, lastLarge, masked, scrolled, step]);\n\n // Focus arriving in an item a masking layout is not drawing large.\n // Uncontained items are where they are drawn, so the browser's own\n // scrolling of focus into view is already right for them.\n const reveal = useCallback((event: FocusEvent<HTMLDivElement>) => {\n const {\n target\n } = event;\n if (!masked || step <= 0 || !(target instanceof Node)) {\n return;\n }\n const index = Array.from(event.currentTarget.children).findIndex(child => child.contains(target));\n if (index < 0) {\n return;\n }\n const geometry = {\n end,\n lastLarge,\n masked,\n scrolled,\n step\n };\n const offset = Math.min(restRevealing(index, geometry) * step, end);\n scrollAlong(scrollerRef.current, offset);\n }, [end, lastLarge, masked, scrolled, step]);\n const slots = items.map((_, index): Slot => ({\n count,\n index,\n large: arrangement.large,\n layout,\n placement: drawn[index]\n }));\n return <section aria-label={label} aria-roledescription={messages.carousel} ref={ref} {...props} {...mergeStyles({\n className: \"x9f619 x78zum5 xdt5ytf x126z3so xeuugli\"\n }, props)}>\n <div onScroll={measure} ref={scrollerRef}\n // A tab stop while there is anywhere to scroll, so the arrow keys\n // move it from rest to rest whatever its items hold. A scroll\n // container with nothing focusable inside is otherwise out of a\n // keyboard's reach, which axe's scrollable-region-focusable reports.\n // oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- see above\n tabIndex={end > 0 ? 0 : undefined} {...stylex.props(styles.scroller, focus.ring, !masked && styles.scrollerUncontained)}>\n {masked ? <div aria-hidden=\"true\" className=\"xjm9jq1 x1i1rx1s x13vifvy x1o0tod x47corl x10l6tqk x1bhewko\" /> : null}\n <div onFocus={reveal} {...{\n 0: {\n className: \"x9f619 x78zum5 x2lah0s x126z3so x1cmllll x790zyz\"\n },\n 1: {\n className: \"x9f619 x78zum5 x2lah0s x126z3so x1cmllll x790zyz xh8yej3 x1o0tod x7giv3 x7wzq59\"\n }\n }[!!masked << 0]}>\n {items.map((item, index) => <SlotContext key={item.key ?? index} value={slots[index] ?? null}>\n {item}\n </SlotContext>)}\n </div>\n {masked ? Array.from({\n length: arrangement.steps\n }, (_, rest) => <div aria-hidden=\"true\" key={rest} {...stylex.props(styles.marker, placed.marker(`${step}px`))} />) : null}\n </div>\n <div className=\"x9f619 x78zum5 x126z3so x13a6bvl x790zyz\">\n <IconButton aria-label={previousLabel ?? messages.previousSlide} isDisabled={scrolled <= 0.5} onPress={previous}>\n <ChevronEndGlyph className=\"xlzyvqe x1lliihq x15vhz18 x1pw7kks xpk2tj9\" />\n </IconButton>\n <IconButton aria-label={nextLabel ?? messages.nextSlide} isDisabled={scrolled >= end - 0.5} onPress={next}>\n <ChevronEndGlyph className=\"xlzyvqe x1lliihq x15vhz18 x19axjrm x1c071of\" />\n </IconButton>\n </div>\n </section>;\n}\n\n/**\n * One item. It is named by which of how many it is — \"2 of 6\" — unless it is\n * given an `aria-label` of its own.\n *\n * The call site's `className` and `style` land on the item.\n */\nfunction CarouselItem({\n children,\n ref,\n ...props\n}: CarouselItemProps & RefAttributes<HTMLDivElement>) {\n const messages = useMessages();\n const slot = useContext(SlotContext);\n const count = slot?.count ?? 1;\n const index = slot?.index ?? 0;\n const large = slot?.large ?? 0;\n const placement = slot?.placement;\n const visibleWidth = placement === undefined ? large : placement.width;\n const inset = (large - visibleWidth) / 2;\n return <div aria-label={messages.slideLabel(index + 1, count)} aria-roledescription={messages.slide} ref={ref}\n // The pattern's own role for a slide. Its suggested `fieldset` is a\n // form's grouping, with a legend and a border of its own.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- see above\n role=\"group\" {...props} {...mergeStyles(stylex.props(styles.item, slot?.layout === 'uncontained' && styles.itemUncontained, slot?.layout === 'uncontained' && placed.uncontained(`${large}px`), placement !== undefined && placed.item(`${large}px`, `${placement.left - inset - index * (large + GAP)}px`, `inset(0 ${inset}px round ${radii.xl})`)), props)}>\n {typeof children === 'function' ? children({\n visibleWidth,\n width: large\n }) : children}\n </div>;\n}\n\n// The nearest rest that draws the item at `index` large, from the rest\n// nearest `scrolled`: the one it starts, for an item before the large ones,\n// or the one it ends, for an item after them. At rest `s` the large items\n// are `s` to `s + lastLarge`.\nfunction restRevealing(index: number, {\n lastLarge,\n scrolled,\n step\n}: Geometry): number {\n const at = Math.round(scrolled / step);\n if (index < at) {\n return index;\n }\n if (index > at + lastLarge) {\n return index - lastLarge;\n }\n return at;\n}\n\n// Scrolls to an offset along the text, whichever way it runs: a\n// right-to-left scroller counts its offset down from zero.\nfunction scrollAlong(scroller: HTMLElement | null, offset: number) {\n if (scroller === null) {\n return;\n }\n const sign = getComputedStyle(scroller).direction === 'rtl' ? -1 : 1;\n scroller.scrollTo({\n left: sign * offset\n });\n}\nCarousel.Item = CarouselItem;\nexport type { CarouselItemProps, CarouselItemRenderProps, CarouselLayout, CarouselProps };\nexport { CarouselItem };\nexport default Carousel;"],"mappings":";;;;;;;;;;;;;;AAmEA,MAAMe,UAAU;AAChB,MAAMC,oBAAoB;AAyD1B,MAAMS,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,iBAAiB;EACfC,QAAQ;EACRF,OAAO;CACT;CACAG,QAAQ;EACNP,OAAO;EACPM,QAAQ;EACRF,OAAO;CACT;CACAI,UAAU;EACRC,QAAQ;EACRX,QAAQ;EACRY,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRZ,OAAO;CACT;CACAa,qBAAqB;EACnBC,QAAQ;EACRd,OAAO;CACT;AACF;AACA,MAAMe,QAAQ;CACZC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS;CACbD,QAAQ;CACR,SAAS;AACX;AACA,MAAME,SAAS;CACbF,QAAQ;CACR,SAAS;AACX;AACA,MAAMG,SAAS;CACb3B,OAAO4B,YAAoBC,OAAeC,SAAiB;EAACP;EAAO;GACjEQ,QAAQD,QAAQ,OAAO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EAAA,KAAAhE;EAAAgE,EAAA,KAAAjB;EAAAiB,EAAA,KAAA/D;EAAA+D,EAAA,KAAA4B;CAAA,OAAAA,KAAA5B,EAAA;CAAA,IAAAkC;CAAA,IAAAlC,EAAA,OAAAK,SAAAiF,SAAAtF,EAAA,OAAAI,WAAAJ,EAAA,QAAAG,OAAAH,EAAA,QAAAC,MAAAD,EAAA,QAAA2B,MAAA3B,EAAA,QAAA4B,IAAA;EARRM,KAAA,oBAAA,OAAA;GAAiB,cAAAjC;GAA6D,wBAAAC;GAAqBC;GAIrG,MAAAgB;GAAO,GAAKf;GAAK,GAAMuB;GACvBC,UAAAA;EAIG,CAAA;EAAA5B,EAAA,KAAAK,SAAAiF;EAAAtF,EAAA,KAAAI;EAAAJ,EAAA,MAAAG;EAAAH,EAAA,MAAAC;EAAAD,EAAA,MAAA2B;EAAA3B,EAAA,MAAA4B;EAAA5B,EAAA,MAAAkC;CAAA,OAAAA,KAAAlC,EAAA;CAAA,OATDkC;AASC;AAOV,SAASiB,cAAcrE,OAAe,EACpCK,WACAE,UACAC,QACmB;CACnB,MAAMmG,KAAK/F,KAAKC,MAAMN,WAAWC,IAAI;CACrC,IAAIR,QAAQ2G,IACV,OAAO3G;CAET,IAAIA,QAAQ2G,KAAKtG,WACf,OAAOL,QAAQK;CAEjB,OAAOsG;AACT;AAIA,SAASrD,YAAY/E,UAA8BoC,QAAgB;CACjE,IAAIpC,aAAa,MACf;CAEF,MAAMqI,OAAOC,iBAAiBtI,QAAQ,CAAC,CAACmC,cAAc,QAAQ,KAAK;CACnEnC,SAASuI,SAAS,EAChBL,MAAMG,OAAOjG,OACf,CAAC;AACH;AACAK,SAAS+F,OAAOX"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","Children","createContext","isValidElement","useContext","useLayoutEffect","useRef","useState","arrange","placements","useMessages","focus","mergeStyles","radii","PADDING","DEFAULT_ITEM_SIZE","children","visibleWidth","width","itemSize","label","layout","nextLabel","previousLabel","styles","item","kaIpWk","kB7OPa","kzQI83","kmuXW","kAzted","kVQacm","kVAEAm","$$css","itemUncontained","k5xd4v","marker","scroller","kOuLrU","k1xSpc","kXHlph","kORKVm","kvh3hx","k5wCbM","khEr5k","kc424l","scrollerUncontained","katHQp","_temp","kzqmXN","_temp2","_temp3","placed","inlineSize","shift","clip","undefined","kz4h6p","kLqNvP","val","uncontained","count","index","large","placement","SlotContext","end","lastLarge","masked","scrolled","step","along","direction","offset","Math","round","min","max","Carousel","t0","$","t1","t2","ref","props","messages","scrollerRef","setWidth","setScrolled","items","toArray","filter","length","room","arrangement","steps","largeCount","position","drawn","t3","Symbol","for","current","clientWidth","abs","scrollLeft","measure","t4","t5","scroller_0","observer","ResizeObserver","observe","disconnect","t6","geometry","scrollAlong","previous","t7","geometry_0","next","t8","event","target","Node","Array","from","currentTarget","findIndex","child","contains","restRevealing","reveal","slots","map","_","index_0","t9","carousel","t10","className","t11","ring","t12","t13","0","1","t14","previousSlide","t15","t16","t17","t18","nextSlide","t19","t20","t21","t22","index_1","key","__0","rest","CarouselItem","slot","inset","slideLabel","slide","left","xl","at","sign","getComputedStyle","scrollTo","Item"],"sources":["../../../src/components/carousel/index.tsx"],"sourcesContent":["'use client';\n\nimport type { FocusEvent, HTMLAttributes, ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Children, createContext, isValidElement, useCallback, useContext, useLayoutEffect, useRef, useState } from 'react';\nimport type { CarouselLayout, Placement } from '../../carousel/arrangement';\nimport { arrange, GAP, placements } from '../../carousel/arrangement';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useMessages } from '../../i18n';\nimport { focus } from '../../styles/focus';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { radii, spacing } from '../../tokens/design.tokens.stylex';\nimport IconButton from '../icon-button';\n\n// The carousel page's carousel: a row of items that scrolls on and off the\n// screen, drawn in three of the page's layouts. Each has the page's 16dp of\n// padding at its ends and 8dp at its top and bottom, 8dp between items and a\n// 28dp corner on every item.\n//\n// - **Multi-browse**, the default, shows as many large items as fit at\n// `itemSize`, then a medium one and a small one, and fills its width\n// exactly; the large width gives way where the preferred one does not fit.\n// - **Hero** shows one large item and one small.\n// - **Uncontained** shows every item at `itemSize`, scrolling past the edge.\n//\n// **Items change size as they move**, as the page draws them. The first two\n// layouts come to rest one item apart, and between two rests every item's\n// place and width are interpolated, so an item shrinks as it leaves and\n// grows as it arrives; the last rests turn the arrangement round a slot at a\n// time, so every item is drawn large at one of them. The arithmetic is\n// `src/carousel/arrangement.ts`.\n// An item is laid out at the large width and masked down to the width it is\n// drawn at, centred, with the page's corner on the mask: what it holds is\n// cut at both sides rather than squeezed, as the page's masked items are.\n//\n// **What an item holds can see its mask.** The page shows an item's text\n// once the item is wide enough to hold it, and only what the item holds\n// knows where its text is, so `Carousel.Item` takes its children as a\n// function too, handed the width the item is laid out at and the width\n// that shows of it, as MDC-Android's masked items report their mask to a\n// listener. The text can then fade or hide as the mask closes over it.\n//\n// **The scrolling is the browser's.** A scroller holds the items' track,\n// which stays put while it scrolls, and a run of empty markers one item\n// apart after it, which is what gives the scroller its length and its rests:\n// each marker's end is a scroll-snap point, and a mark at the scroller's\n// start is the first. The position the scroller reports is what the items\n// are drawn from. Uncontained has no rests and no masks, so its items scroll\n// in the track themselves, snapping to their own starts.\n//\n// **It is the ARIA carousel pattern**, since React Aria has no carousel: a\n// region named by `label` and described as a carousel, each item a group\n// described as a slide and named by which of how many it is, and a previous\n// and a next button under it, at the end. Focus moving into an item that is\n// not drawn large scrolls the carousel to the nearest rest that draws it\n// large, and the scroller is a tab stop while it scrolls, so the arrow keys\n// move it too. Under reduced motion the scroller jumps rather than scrolling\n// smoothly.\n//\n// The page's large width is \"dynamic, or user-set\", and neither MDC-Android\n// nor Compose has a default for it; `itemSize`'s 240 is this component's own.\n// Uncontained keeps the 16dp at its end as well as its start, where the page\n// gives it a leading padding alone, so its last item does not end flush\n// against the edge.\n\n/** The page's 16dp at a carousel's ends. */\nconst PADDING = 16;\nconst DEFAULT_ITEM_SIZE = 240;\ntype CarouselItemProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n /**\n * What the item shows: usually an image, which the item masks. A function\n * is handed how much of the item shows, every time that changes, so text\n * the item has no room for can be hidden as the mask closes over it.\n */\n children?: ((state: CarouselItemRenderProps) => ReactNode) | ReactNode;\n};\n\n/** How much of a `Carousel.Item` shows, for children written as a function. */\ntype CarouselItemRenderProps = {\n /**\n * How much of `width` shows, in pixels. The mask takes the rest evenly\n * from both sides, so `(width - visibleWidth) / 2` is cut off each. It is\n * `width` for an item drawn large, and for every item of an uncontained\n * carousel, which masks nothing.\n */\n visibleWidth: number;\n /**\n * The width the item is laid out at, in pixels: the large item's, which\n * every item in the carousel shares.\n */\n width: number;\n};\ntype CarouselProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {\n /** The items: `Carousel.Item` for each. */\n children?: ReactNode;\n /**\n * The large item's preferred width, in pixels. Multi-browse lays out as\n * many as fit and narrows them where they do not; uncontained draws every\n * item at it; hero takes its large item's width from the carousel's.\n * @default 240\n */\n itemSize?: number;\n /**\n * What the carousel shows, for a screen reader. Required rather than\n * optional: a carousel is a region, and a region with no name is one a\n * screen reader cannot introduce.\n */\n label: string;\n /**\n * Which of the page's layouts the carousel draws.\n * @default 'multi-browse'\n */\n layout?: CarouselLayout;\n /**\n * What the next button is called. Left out, the library names it in the\n * reader's locale — \"Next slide\" in English.\n */\n nextLabel?: string;\n /**\n * What the previous button is called. Left out, the library names it in\n * the reader's locale — \"Previous slide\" in English.\n */\n previousLabel?: string;\n};\nconst styles = {\n item: {\n kaIpWk: \"x19pkqky\",\n kB7OPa: \"x9f619\",\n kzQI83: \"x1c4vz4f\",\n kmuXW: \"x2lah0s\",\n kAzted: \"x2lwn1j\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n itemUncontained: {\n k5xd4v: \"x1bhewko\",\n $$css: true\n },\n marker: {\n kmuXW: \"x2lah0s\",\n k5xd4v: \"x83psoy\",\n $$css: true\n },\n scroller: {\n kOuLrU: \"xfk6m8\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXHlph: \"xw2csxc\",\n kORKVm: \"x10wlt62\",\n kvh3hx: \"x7p5m3t\",\n kVAEAm: \"x1n2onr6\",\n k5wCbM: \"x1rohswg\",\n khEr5k: \"xkcv6ua xg83hb1\",\n kc424l: \"xhfbhpw\",\n $$css: true\n },\n scrollerUncontained: {\n katHQp: \"x7jkkja\",\n $$css: true\n }\n};\nconst _temp = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst _temp2 = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst _temp3 = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst placed = {\n item: (inlineSize: string, shift: string, clip: string) => [_temp, clip !== undefined && {\n kz4h6p: clip != null ? \"xx58lst\" : \"\",\n $$css: true\n }, shift !== undefined && {\n kLqNvP: shift != null ? \"x1lxsm33\" : \"\",\n $$css: true\n }, {\n \"--x-clipPath\": clip != null ? clip : undefined,\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(inlineSize),\n \"--x-insetInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(shift)\n }],\n marker: (inlineSize: string) => [_temp2, {\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(inlineSize)\n }],\n uncontained: (inlineSize: string) => [_temp3, {\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(inlineSize)\n }]\n};\ntype Slot = {\n count: number;\n index: number;\n /** The width the item is laid out at. */\n large: number;\n layout: CarouselLayout;\n /** Where it is drawn, for a layout that masks. */\n placement: Placement | undefined;\n};\nconst SlotContext = createContext<null | Slot>(null);\n\n/** What the controls and focus scroll by, as numbers read off one render. */\ntype Geometry = {\n /** The offset of the last rest, or for uncontained how far it scrolls. */\n end: number;\n /** How many items past the first large one the last large one is. */\n lastLarge: number;\n masked: boolean;\n scrolled: number;\n /** The distance between two rests, or for uncontained between two items. */\n step: number;\n};\n\n// Where a press of previous or next scrolls to from `scrolled`: the rest\n// either side of the nearest one, or for uncontained an item's width along,\n// kept between the two ends.\nfunction along(direction: -1 | 1, {\n end,\n masked,\n scrolled,\n step\n}: Geometry): number {\n if (step <= 0) {\n return 0;\n }\n const offset = masked ? (Math.round(scrolled / step) + direction) * step : scrolled + direction * step;\n return Math.min(Math.max(offset, 0), end);\n}\n\n/**\n * A row of items that scrolls on and off the screen, in the carousel page's\n * multi-browse, hero or uncontained layout. Name it with `label`, and give it\n * a `Carousel.Item` for each item.\n *\n * ```tsx\n * <Carousel label=\"Label\">\n * <Carousel.Item><img alt=\"First item\" src=\"…\" /></Carousel.Item>\n * <Carousel.Item><img alt=\"Second item\" src=\"…\" /></Carousel.Item>\n * </Carousel>\n * ```\n *\n * The call site's `className` and `style` land on the carousel as a whole,\n * which is the element a layout positions.\n */\nfunction Carousel({\n children,\n itemSize = DEFAULT_ITEM_SIZE,\n label,\n layout = 'multi-browse',\n nextLabel,\n previousLabel,\n ref,\n ...props\n}: CarouselProps & RefAttributes<HTMLElement>) {\n const messages = useMessages();\n const scrollerRef = useRef<HTMLDivElement>(null);\n // The scroller's width and how far it has scrolled along the text:\n // everything drawn is drawn from these two.\n const [width, setWidth] = useState(0);\n const [scrolled, setScrolled] = useState(0);\n const items = Children.toArray(children).filter(isValidElement);\n const count = items.length;\n const room = Math.max(width - 2 * PADDING, 0);\n const arrangement = arrange(layout, room, itemSize, count);\n const masked = layout !== 'uncontained';\n // Read off the arrangement as arithmetic, so each is a number of its own\n // rather than a field of an object the calls below are handed.\n const step = arrangement.large + GAP;\n // The last rest, or how far the uncontained track runs past the scroller.\n const end = masked ? arrangement.steps * step : Math.max(count * step - GAP + 2 * PADDING - width, 0);\n const lastLarge = arrangement.largeCount - 1;\n const position = masked && step > 0 ? scrolled / step : 0;\n const drawn = masked ? placements(layout, arrangement, room, PADDING, count, position) : [];\n\n // Measured before the first paint, again on every scroll, and whenever\n // the scroller's width changes. A right-to-left scroller counts its offset\n // down from zero.\n const measure = useCallback(() => {\n const scroller = scrollerRef.current;\n if (scroller === null) {\n return;\n }\n setWidth(scroller.clientWidth);\n setScrolled(Math.abs(scroller.scrollLeft));\n }, []);\n useLayoutEffect(() => {\n const scroller = scrollerRef.current;\n if (scroller === null) {\n return undefined;\n }\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(scroller);\n return () => {\n observer.disconnect();\n };\n }, [measure]);\n const previous = useCallback(() => {\n const geometry = {\n end,\n lastLarge,\n masked,\n scrolled,\n step\n };\n scrollAlong(scrollerRef.current, along(-1, geometry));\n }, [end, lastLarge, masked, scrolled, step]);\n const next = useCallback(() => {\n const geometry = {\n end,\n lastLarge,\n masked,\n scrolled,\n step\n };\n scrollAlong(scrollerRef.current, along(1, geometry));\n }, [end, lastLarge, masked, scrolled, step]);\n\n // Focus arriving in an item a masking layout is not drawing large.\n // Uncontained items are where they are drawn, so the browser's own\n // scrolling of focus into view is already right for them.\n const reveal = useCallback((event: FocusEvent<HTMLDivElement>) => {\n const {\n target\n } = event;\n if (!masked || step <= 0 || !(target instanceof Node)) {\n return;\n }\n const index = Array.from(event.currentTarget.children).findIndex(child => child.contains(target));\n if (index < 0) {\n return;\n }\n const geometry = {\n end,\n lastLarge,\n masked,\n scrolled,\n step\n };\n const offset = Math.min(restRevealing(index, geometry) * step, end);\n scrollAlong(scrollerRef.current, offset);\n }, [end, lastLarge, masked, scrolled, step]);\n const slots = items.map((_, index): Slot => ({\n count,\n index,\n large: arrangement.large,\n layout,\n placement: drawn[index]\n }));\n return <section aria-label={label} aria-roledescription={messages.carousel} ref={ref} {...props} {...mergeStyles({\n className: \"x9f619 x78zum5 xdt5ytf x126z3so xeuugli\"\n }, props)}>\n <div onScroll={measure} ref={scrollerRef}\n // A tab stop while there is anywhere to scroll, so the arrow keys\n // move it from rest to rest whatever its items hold. A scroll\n // container with nothing focusable inside is otherwise out of a\n // keyboard's reach, which axe's scrollable-region-focusable reports.\n // oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- see above\n tabIndex={end > 0 ? 0 : undefined} {...stylex.props(styles.scroller, focus.ring, !masked && styles.scrollerUncontained)}>\n {masked ? <div aria-hidden=\"true\" className=\"xjm9jq1 x1i1rx1s x13vifvy x1o0tod x47corl x10l6tqk x1bhewko\" /> : null}\n <div onFocus={reveal} {...{\n 0: {\n className: \"x9f619 x78zum5 x2lah0s x126z3so x1cmllll x790zyz\"\n },\n 1: {\n className: \"x9f619 x78zum5 x2lah0s x126z3so x1cmllll x790zyz xh8yej3 x1o0tod x7giv3 x7wzq59\"\n }\n }[!!masked << 0]}>\n {items.map((item, index) => <SlotContext key={item.key ?? index} value={slots[index] ?? null}>\n {item}\n </SlotContext>)}\n </div>\n {masked ? Array.from({\n length: arrangement.steps\n }, (_, rest) => <div aria-hidden=\"true\" key={rest} {...stylex.props(styles.marker, placed.marker(`${step}px`))} />) : null}\n </div>\n <div className=\"x9f619 x78zum5 x126z3so x13a6bvl x790zyz\">\n <IconButton aria-label={previousLabel ?? messages.previousSlide} isDisabled={scrolled <= 0.5} onPress={previous}>\n <ChevronEndGlyph className=\"xlzyvqe x1lliihq x15vhz18 x1pw7kks xpk2tj9\" />\n </IconButton>\n <IconButton aria-label={nextLabel ?? messages.nextSlide} isDisabled={scrolled >= end - 0.5} onPress={next}>\n <ChevronEndGlyph className=\"xlzyvqe x1lliihq x15vhz18 x19axjrm x1c071of\" />\n </IconButton>\n </div>\n </section>;\n}\n\n/**\n * One item. It is named by which of how many it is — \"2 of 6\" — unless it is\n * given an `aria-label` of its own.\n *\n * The call site's `className` and `style` land on the item.\n */\nfunction CarouselItem({\n children,\n ref,\n ...props\n}: CarouselItemProps & RefAttributes<HTMLDivElement>) {\n const messages = useMessages();\n const slot = useContext(SlotContext);\n const count = slot?.count ?? 1;\n const index = slot?.index ?? 0;\n const large = slot?.large ?? 0;\n const placement = slot?.placement;\n const visibleWidth = placement === undefined ? large : placement.width;\n const inset = (large - visibleWidth) / 2;\n return <div aria-label={messages.slideLabel(index + 1, count)} aria-roledescription={messages.slide} ref={ref}\n // The pattern's own role for a slide. Its suggested `fieldset` is a\n // form's grouping, with a legend and a border of its own.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- see above\n role=\"group\" {...props} {...mergeStyles(stylex.props(styles.item, slot?.layout === 'uncontained' && styles.itemUncontained, slot?.layout === 'uncontained' && placed.uncontained(`${large}px`), placement !== undefined && placed.item(`${large}px`, `${placement.left - inset - index * (large + GAP)}px`, `inset(0 ${inset}px round ${radii.xl})`)), props)}>\n {typeof children === 'function' ? children({\n visibleWidth,\n width: large\n }) : children}\n </div>;\n}\n\n// The nearest rest that draws the item at `index` large, from the rest\n// nearest `scrolled`: the one it starts, for an item before the large ones,\n// or the one it ends, for an item after them. At rest `s` the large items\n// are `s` to `s + lastLarge`.\nfunction restRevealing(index: number, {\n lastLarge,\n scrolled,\n step\n}: Geometry): number {\n const at = Math.round(scrolled / step);\n if (index < at) {\n return index;\n }\n if (index > at + lastLarge) {\n return index - lastLarge;\n }\n return at;\n}\n\n// Scrolls to an offset along the text, whichever way it runs: a\n// right-to-left scroller counts its offset down from zero.\nfunction scrollAlong(scroller: HTMLElement | null, offset: number) {\n if (scroller === null) {\n return;\n }\n const sign = getComputedStyle(scroller).direction === 'rtl' ? -1 : 1;\n scroller.scrollTo({\n left: sign * offset\n });\n}\nCarousel.Item = CarouselItem;\nexport type { CarouselItemProps, CarouselItemRenderProps, CarouselLayout, CarouselProps };\nexport { CarouselItem };\nexport default Carousel;"],"mappings":";;;;;;;;;;;;;;AAmEA,MAAMe,UAAU;AAChB,MAAMC,oBAAoB;AAyD1B,MAAMS,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;E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A,MAAAkC;CAAA,OAAAA,KAAAlC,EAAA;CAAA,OATDkC;AASC;AAOV,SAASiB,cAAcrE,OAAe,EACpCK,WACAE,UACAC,QACmB;CACnB,MAAMmG,KAAK/F,KAAKC,MAAMN,WAAWC,IAAI;CACrC,IAAIR,QAAQ2G,IACV,OAAO3G;CAET,IAAIA,QAAQ2G,KAAKtG,WACf,OAAOL,QAAQK;CAEjB,OAAOsG;AACT;AAIA,SAASrD,YAAY/E,UAA8BoC,QAAgB;CACjE,IAAIpC,aAAa,MACf;CAEF,MAAMqI,OAAOC,iBAAiBtI,QAAQ,CAAC,CAACmC,cAAc,QAAQ,KAAK;CACnEnC,SAASuI,SAAS,EAChBL,MAAMG,OAAOjG,OACf,CAAC;AACH;AACAK,SAAS+F,OAAOX"}
|
|
@@ -262,17 +262,23 @@ const placements = {
|
|
|
262
262
|
"--x-insetBlockEnd": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(start),
|
|
263
263
|
"--x-insetBlockStart": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(end)
|
|
264
264
|
}],
|
|
265
|
-
inline: (start, end) => [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
265
|
+
inline: (start, end) => [
|
|
266
|
+
end !== void 0 && {
|
|
267
|
+
kt4wiu: end != null ? "xqxgn94" : "",
|
|
268
|
+
$$css: true
|
|
269
|
+
},
|
|
270
|
+
start !== void 0 && {
|
|
271
|
+
kLqNvP: start != null ? "x1lxsm33" : "",
|
|
272
|
+
$$css: true
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"--x-insetInlineEnd": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(end),
|
|
276
|
+
"--x-insetInlineStart": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(start)
|
|
277
|
+
}
|
|
278
|
+
],
|
|
273
279
|
stopBlock: (offset) => [_temp2, { "--x-insetBlockEnd": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(offset) }],
|
|
274
|
-
stopInline: (offset) => [{
|
|
275
|
-
kLqNvP: offset != null ? "x1lxsm33" :
|
|
280
|
+
stopInline: (offset) => [offset !== void 0 && {
|
|
281
|
+
kLqNvP: offset != null ? "x1lxsm33" : "",
|
|
276
282
|
$$css: true
|
|
277
283
|
}, { "--x-insetInlineStart": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(offset) }]
|
|
278
284
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","Slider","RACSlider","groupStyles","mergeStatefulStyles","GAP","CLEAR","STOP","sizes","lg","$$css","md","sm","xl","xs","styles","active","kWkggS","activeDisabled","activeHoldingIcon","k9g6sI","icon","kGNEyG","kZKoxP","kMwMTN","k1xSpc","kGuDYH","kzqmXN","k87sOh","kLqNvP","kjj79g","kVAEAm","iconDisabled","iconRoomBlock","iconRoomBlockXl","iconRoomInline","iconRoomInlineXl","iconVertical","krVfgx","inactiveDisabled","innerBlockEnd","kT0f0o","kVL7Gh","innerBlockStart","kfmiAY","krdFHd","innerInlineEnd","innerInlineStart","root","rootVertical","segment","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kB7OPa","kVQacm","segmentVertical","stop","stopActive","stopActiveDisabled","stopDisabled","stopEnd","kt4wiu","stopEndVertical","stopStart","stopStartVertical","stopVertical","thumb","k6CgDc","kkrTdU","kjBf7l","kInvED","k3XXqK","kMeerF","kIyJzY","k1ekBW","kAMwcw","thumbActive","thumbActiveVertical","thumbDisabled","thumbDragging","thumbFocused","thumbVertical","kbCHJM","_temp","_temp2","placements","block","start","end","val","undefined","inline","stopBlock","offset","stopInline","showStops","size","vertical","fraction","px","name","label","orientation","thumbLabels","AT_END","after","before","iconRoom","insetIcon","isDisabled","room","props","insetOf","offsetIn","share","partContent","part","extras","steps","hasIcon","from","to","length","inside","filter","place","atStart","atEnd","map","t0","$","T0","t1","t2","t3","t4","t5","t6","t7","t8","t9","state","0","className","2","1","3","trackContent","stepsOf","min","getThumbMinValue","max","getThumbMaxValue","values","fractions","step","index","push","getValuePercent","thumbContent","isDragging","isFocusVisible","getThumbValueLabel","thumbStyles","_","getThumbPercent","first","last","at","range","parts","innerStart","innerEnd"],"sources":["../../../src/components/slider/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { SliderProps as RACSliderProps, SliderState, SliderThumbRenderProps, SliderTrackRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Slider as RACSlider, SliderOutput, SliderThumb, SliderTrack } from 'react-aria-components';\nimport { FieldLabel } from '../../field';\nimport { groupStyles } from '../../field/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The sliders page. At the size its tokens call extra-small, the default: a\n// 16dp track with an 8dp corner, the active part in primary and the inactive\n// part in secondary container, a 4dp stop in on secondary container 6dp from\n// the inactive end, and a handle 4dp wide and 44dp tall in primary that\n// narrows to 2dp while pressed or focused. The track parts on each side of\n// the handle, with 6dp of space between them and it, and their corners\n// against the handle are 2dp where their outer ends are full. Disabled, the\n// active part and the handle are on surface at the disabled content opacity\n// and the inactive part at the disabled container opacity.\n//\n// `size` takes the page's four larger sizes, which thicken the track and\n// round its ends more, and lengthen the handle from M up:\n//\n// | Size | Track | Corner | Handle | Inset icon |\n// | ---- | ----- | ------ | ------ | ---------- |\n// | xs | 16dp | 8dp | 44dp | |\n// | sm | 24dp | 8dp | 44dp | |\n// | md | 40dp | 12dp | 52dp | 24dp |\n// | lg | 56dp | 16dp | 68dp | 24dp |\n// | xl | 96dp | 28dp | 108dp | 32dp |\n//\n// The handle stays 4dp wide, the corners against it 2dp and the space beside\n// it 6dp at every size.\n//\n// `showStops` is the page's stops configuration, which it used to call the\n// discrete slider: a 4dp stop at every step, in on primary on the active part\n// and on secondary container on the inactive one, so the reader can see\n// where the handle can land. The stops at the two ends sit 6dp in from them,\n// as the single stop does. A part clips what it holds, which is what hides\n// the stops beside the handle: the part ends 6dp short of it.\n//\n// `icon` is the page's inset icon, at the start of the active part in on\n// primary, from M up: the page gives it a size at M, L and XL alone. It is\n// 10dp in from the part's start, which is MDC-Android's padding, since the\n// page gives none, and like MDC-Android it is drawn only while the part has\n// room for it and that padding on both sides, and for a single handle.\n//\n// The value indicator is the page's label: inverse surface under label-large\n// in inverse on surface, 44dp tall and at least 48dp wide, 12dp above the\n// handle. It shows while the handle is dragged or has keyboard focus, and it\n// is React Aria's `SliderOutput`, so what it shows is what the slider\n// announces.\n//\n// React Aria's `Slider` is the root, `SliderTrack` the strip the handles are\n// placed along by percent, and `SliderThumb` each handle around a visually\n// hidden range input. The track's parts are drawn here from those percents\n// rather than with `SliderFill`, since the page's parts stop short of the\n// handle on both sides and the fill runs up to it. A range slider is the\n// same track with two handles and the active part between them.\n//\n// Vertical, the same parts run along the block axis, with the active part\n// rising from the bottom and the indicator to the start side of the handle.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The sliders page's own measurements, which are constants of the component\n// rather than steps of the consumer's spacing scale. The clearance used to be\n// read off `spacing.sm` — true at its default 8, since 6 plus half the\n// handle comes to the same — so a theme moving that step opened the gap\n// beside the handle while the stop, written as the literal it is, stayed\n// where the page puts it.\nconst GAP = 6;\nconst HANDLE_WIDTH = 4;\n/** How far a part stops short of a handle's centre. */\nconst CLEAR = GAP + HANDLE_WIDTH / 2;\n/** A stop's size. */\nconst STOP = 4;\n/** MDC-Android's padding either side of the inset icon. */\nconst ICON_PADDING = 10;\ntype SliderSize = 'lg' | 'md' | 'sm' | 'xl' | 'xs';\n\n// The sizes, as the custom properties every part reads: the track's\n// thickness, its outer corner and the handle's length, which the track\n// strip takes as its own thickness too.\nconst sizes = {\n lg: {\n \"--slider-corner\": \"x1hr852m\",\n \"--slider-handle\": \"x1i1s3m4\",\n \"--slider-icon\": \"xsfv7fh\",\n \"--slider-track\": \"xdrquod\",\n $$css: true\n },\n md: {\n \"--slider-corner\": \"x1welmdy\",\n \"--slider-handle\": \"x1290pjo\",\n \"--slider-icon\": \"xsfv7fh\",\n \"--slider-track\": \"xhx1aj5\",\n $$css: true\n },\n sm: {\n \"--slider-corner\": \"x1y8vi8n\",\n \"--slider-handle\": \"x1czf5nl\",\n \"--slider-track\": \"xf334ng\",\n $$css: true\n },\n xl: {\n \"--slider-corner\": \"x1tzw2no\",\n \"--slider-handle\": \"x1aoofsu\",\n \"--slider-icon\": \"xmfnedx\",\n \"--slider-track\": \"x1s6dhuk\",\n $$css: true\n },\n xs: {\n \"--slider-corner\": \"x1y8vi8n\",\n \"--slider-handle\": \"x1czf5nl\",\n \"--slider-track\": \"x16oikcs\",\n $$css: true\n }\n};\nconst styles = {\n active: {\n kWkggS: \"xnety89 x1jzqe4\",\n $$css: true\n },\n activeDisabled: {\n kWkggS: \"x1crcgwy\",\n $$css: true\n },\n activeHoldingIcon: {\n k9g6sI: \"xpqogu8\",\n $$css: true\n },\n icon: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"xi7vqlm\",\n kMwMTN: \"xwjo7ld x1k5gbb1\",\n k1xSpc: \"x78zum5\",\n kGuDYH: \"xuu3ggl\",\n kzqmXN: \"xoxpges\",\n k87sOh: \"xdtafdd\",\n kLqNvP: \"xi5uv41\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x10l6tqk\",\n $$css: true\n },\n iconDisabled: {\n kMwMTN: \"x1girmi0\",\n $$css: true\n },\n iconRoomBlock: {\n k1xSpc: \"x1uo08md x78zum5\",\n $$css: true\n },\n iconRoomBlockXl: {\n k1xSpc: \"x2mjljv x78zum5\",\n $$css: true\n },\n iconRoomInline: {\n k1xSpc: \"x1cueg3v x78zum5\",\n $$css: true\n },\n iconRoomInlineXl: {\n k1xSpc: \"x18ymn08 x78zum5\",\n $$css: true\n },\n iconVertical: {\n krVfgx: \"x1jn9clo\",\n k87sOh: \"x80663w\",\n kLqNvP: \"x1m57d8a\",\n $$css: true\n },\n inactiveDisabled: {\n kWkggS: \"x19v6zzp\",\n $$css: true\n },\n innerBlockEnd: {\n kT0f0o: \"x1ui04y5\",\n kVL7Gh: \"x6en5u8\",\n $$css: true\n },\n innerBlockStart: {\n kfmiAY: \"x1e4oeot\",\n krdFHd: \"xr9e8f9\",\n $$css: true\n },\n innerInlineEnd: {\n kT0f0o: \"x1ui04y5\",\n kfmiAY: \"x1e4oeot\",\n $$css: true\n },\n innerInlineStart: {\n kVL7Gh: \"x6en5u8\",\n krdFHd: \"xr9e8f9\",\n $$css: true\n },\n root: {\n kzqmXN: \"xh8yej3\",\n $$css: true\n },\n rootVertical: {\n kGNEyG: \"x1cy8zhl\",\n kZKoxP: \"x1u5z0ei\",\n kzqmXN: \"x14atkfc\",\n $$css: true\n },\n segment: {\n kWkggS: \"x15dekr4 x9yvj25\",\n kZKoxP: \"x9w084k\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1xpg3mf\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x13rsnn2\",\n kB7OPa: \"x9f619\",\n k87sOh: \"x1i1s66i\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x10l6tqk\",\n $$css: true\n },\n segmentVertical: {\n kZKoxP: \"xt7dq6l\",\n kzqmXN: \"x3fzmgt\",\n k87sOh: \"x80663w\",\n kLqNvP: \"x9k4rl8\",\n $$css: true\n },\n stop: {\n kWkggS: \"x81krv7 x1tt9vl1\",\n kZKoxP: \"xqu0tyb\",\n kaIpWk: \"x16fbrrb\",\n kzqmXN: \"x51ohtg\",\n k87sOh: \"x17a0tka\",\n kVAEAm: \"x10l6tqk\",\n $$css: true\n },\n stopActive: {\n kWkggS: \"x1ntwmx2 x1sir5s4\",\n $$css: true\n },\n stopActiveDisabled: {\n kWkggS: \"x1dbj914\",\n $$css: true\n },\n stopDisabled: {\n kWkggS: \"x1crcgwy\",\n $$css: true\n },\n stopEnd: {\n kt4wiu: \"x1f889gz\",\n $$css: true\n },\n stopEndVertical: {\n k87sOh: \"x1atx4j1\",\n kt4wiu: \"x1woyocn\",\n $$css: true\n },\n stopStart: {\n kLqNvP: \"xrr41r3\",\n $$css: true\n },\n stopStartVertical: {\n krVfgx: \"xrb244j\",\n k87sOh: \"x80663w\",\n kLqNvP: \"xhi6v0a\",\n $$css: true\n },\n stopVertical: {\n k87sOh: \"x80663w\",\n kLqNvP: \"xml7xvy\",\n $$css: true\n },\n thumb: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89 x1jzqe4\",\n kZKoxP: \"x16gdi9t\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1dkaolv\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x13rsnn2\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1jm3nie\",\n kzqmXN: \"x51ohtg\",\n k87sOh: \"xwa60dl\",\n kjBf7l: \"xrgy624 x1x84bn5\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xdl150w\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n thumbActive: {\n kzqmXN: \"xfo62xy\",\n $$css: true\n },\n thumbActiveVertical: {\n kZKoxP: \"x36qwtl\",\n kzqmXN: \"xluoxwi\",\n $$css: true\n },\n thumbDisabled: {\n kWkggS: \"x1crcgwy\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n thumbDragging: {\n kkrTdU: \"xi9pz9s\",\n $$css: true\n },\n thumbFocused: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n thumbVertical: {\n kZKoxP: \"xqu0tyb\",\n kzqmXN: \"xluoxwi\",\n k87sOh: \"x80663w\",\n kbCHJM: \"x1nrll8i\",\n $$css: true\n }\n};\n\n// Where each part of the track starts and ends, as insets from the track's\n// two ends, and where a stop sits inside a part. Dynamic styles, since the\n// percents come from the value at render time and StyleX compiles its\n// classes ahead of time; each writes its insets to custom properties inline.\nconst _temp = {\n krVfgx: \"xiicpxy\",\n k87sOh: \"x5mnzd7\",\n \"$$css\": true\n};\nconst _temp2 = {\n krVfgx: \"xiicpxy\",\n \"$$css\": true\n};\nconst placements = {\n block: (start: string, end: string) => [_temp, {\n \"--x-insetBlockEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start),\n \"--x-insetBlockStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end)\n }],\n inline: (start: string, end: string) => [{\n kt4wiu: end != null ? \"xqxgn94\" : end,\n kLqNvP: start != null ? \"x1lxsm33\" : start,\n $$css: true\n }, {\n \"--x-insetInlineEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-insetInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start)\n }],\n stopBlock: (offset: string) => [_temp2, {\n \"--x-insetBlockEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(offset)\n }],\n stopInline: (offset: string) => [{\n kLqNvP: offset != null ? \"x1lxsm33\" : offset,\n $$css: true\n }, {\n \"--x-insetInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(offset)\n }]\n};\n\n/** What a track draws besides its parts and handles. */\ntype Extras = {\n icon: ReactNode;\n showStops: boolean;\n size: SliderSize;\n vertical: boolean;\n};\n\n/** One end of a part: a fraction of the track's length, and pixels on top. */\ntype Inset = {\n fraction: number;\n px: number;\n};\n\n/**\n * A part of the track, by the insets of its two ends from the track's, and\n * which of the three it is: the inactive part before a range's first handle,\n * the active part, or the inactive part after the last handle.\n */\ntype Part = {\n active: boolean;\n end: Inset;\n name: 'active' | 'after' | 'before';\n start: Inset;\n};\ntype SliderProps = Omit<RACSliderProps, 'children' | 'orientation'> & {\n /**\n * The page's inset icon, at the start of the active part, from `md` up:\n * the page gives it a size at M, L and XL alone. Drawn for a single\n * handle, and only while the active part has room for it.\n */\n icon?: ReactNode;\n /**\n * What the slider sets. A slider that a row labels some other way leaves\n * it out and passes `aria-label` instead.\n */\n label?: string;\n /**\n * Along which axis the handle moves. A vertical slider is 240px tall until\n * `style` on the root says otherwise.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * A stop at every step, the page's stops configuration, so the reader can\n * see where the handle can land. Meant for a slider with a handful of\n * steps: each stop is a 4dp dot, and a fine step draws a crowd of them.\n * @default false\n */\n showStops?: boolean;\n /**\n * The page's sizes, by the track's thickness: 16dp at `xs`, 24dp at `sm`,\n * 40dp at `md`, 56dp at `lg` and 96dp at `xl`, with the handle 44dp long\n * up to `sm` and 52dp, 68dp and 108dp past it.\n * @default 'xs'\n */\n size?: SliderSize;\n /**\n * A name for each handle of a range slider, in order, since two handles\n * named by the same label cannot be told apart.\n */\n thumbLabels?: string[];\n};\nconst AT_END: Inset = {\n fraction: 0,\n px: 0\n};\n\n// A part's start inset, clear of a handle at `fraction` of the way along. The\n// fraction lands on the handle's centre, so half the handle's width joins the\n// page's gap to reach its edge.\nfunction after(fraction: number): Inset {\n return {\n fraction,\n px: CLEAR\n };\n}\n\n// A part's end inset, clear of a handle at `fraction` of the way along.\nfunction before(fraction: number): Inset {\n return {\n fraction: 1 - fraction,\n px: CLEAR\n };\n}\n\n// The container query that hides the inset icon for want of room: the part's\n// length along the track, against the icon and its padding at this size.\nfunction iconRoom(size: SliderSize, vertical: boolean) {\n if (vertical) {\n return size === 'xl' ? styles.iconRoomBlockXl : styles.iconRoomBlock;\n }\n return size === 'xl' ? styles.iconRoomInlineXl : styles.iconRoomInline;\n}\n\n// The inset icon, at the foot of the active part, while the part has room.\nfunction insetIcon({\n icon,\n size,\n vertical\n}: Extras, isDisabled: boolean): ReactNode {\n const room = iconRoom(size, vertical);\n return <span {...stylex.props(styles.icon, vertical && styles.iconVertical, room, isDisabled && styles.iconDisabled)}>\n {icon}\n </span>;\n}\nfunction insetOf({\n fraction,\n px\n}: Inset) {\n return `calc(${fraction * 100}% + ${px}px)`;\n}\n\n// Where a stop at `fraction` of the way along the track starts inside a part.\n// The part's own length is the `100%` the expression has to work from, and\n// the track's is that plus both insets, so a fraction of the track is a\n// share of the part's length plus their pixels.\nfunction offsetIn({\n end,\n start\n}: Part, fraction: number) {\n const share = 1 - start.fraction - end.fraction;\n const scale = (fraction - start.fraction) / share;\n return `calc(${scale} * (100% + ${start.px + end.px}px) - ${start.px + STOP / 2}px)`;\n}\n\n// What a part holds: a stop at each step inside it, the end stops where it\n// reaches the track's ends, and the inset icon.\nfunction partContent(part: Part, extras: Extras, isDisabled: boolean, steps: number[], hasIcon: boolean) {\n const {\n showStops,\n vertical\n } = extras;\n const stop = [styles.stop, vertical && styles.stopVertical, part.active && styles.stopActive, isDisabled && (part.active ? styles.stopActiveDisabled : styles.stopDisabled)];\n const from = part.start.fraction;\n const to = 1 - part.end.fraction;\n const length = 1 - part.start.fraction - part.end.fraction;\n const inside = showStops && length > 0 ? steps.filter(fraction => fraction >= from && fraction <= to) : [];\n const place = vertical ? placements.stopBlock : placements.stopInline;\n const atStart = part.start.fraction === 0 && part.start.px === 0;\n // The single stop at the inactive end is drawn with or without the stops\n // configuration; the one at the start is the configuration's own.\n const atEnd = part.end.fraction === 0 && part.end.px === 0 && !part.active;\n return <>\n {hasIcon ? insetIcon(extras, isDisabled) : null}\n {showStops && atStart ? <span {...stylex.props(...stop, vertical ? styles.stopStartVertical : styles.stopStart)} /> : null}\n {inside.map(fraction => <span key={fraction} {...stylex.props(...stop, place(offsetIn(part, fraction)))} />)}\n {atEnd ? <span {...stylex.props(...stop, vertical ? styles.stopEndVertical : styles.stopEnd)} /> : null}\n </>;\n}\n\n/**\n * A slider for one value, or for a range when the value is a pair. The value\n * is React Aria's: pass `value` with `onChange` to control it, or\n * `defaultValue` to let it keep its own, with `minValue`, `maxValue` and\n * `step` to shape it and `formatOptions` to say how it reads. Arrow keys\n * move a handle by a step, Page Up and Page Down by ten, Home and End to\n * the ends.\n *\n * The call site's `className` and `style` land on the slider as a whole,\n * which is the element a layout positions and the one that gives a vertical\n * slider its height.\n */\nfunction Slider({\n icon,\n label,\n orientation = 'horizontal',\n showStops = false,\n size = 'xs',\n thumbLabels,\n ...props\n}: RefAttributes<HTMLDivElement> & SliderProps) {\n const vertical = orientation === 'vertical';\n return <RACSlider orientation={orientation} {...props} {...mergeStatefulStyles(stylex.props(groupStyles.root, styles.root, sizes[size], vertical && styles.rootVertical), props)}>\n {label === undefined ? null : <FieldLabel variant=\"group\">{label}</FieldLabel>}\n <SliderTrack {...mergeStatefulStyles((state: SliderTrackRenderProps) => ({\n 0: {\n className: \"x16gdi9t x9f619 x1ypdohk xh8yej3 x1n2onr6\"\n },\n 2: {\n className: \"x9f619 x1ypdohk x1n2onr6 x5yr21d x1iyjqo2 xluoxwi x2lwn1j\"\n },\n 1: {\n className: \"x16gdi9t x9f619 xh8yej3 x1n2onr6 x1h6gzvc\"\n },\n 3: {\n className: \"x9f619 x1n2onr6 x5yr21d x1iyjqo2 xluoxwi x2lwn1j x1h6gzvc\"\n }\n })[!!vertical << 1 | !!state.isDisabled << 0], {})}>\n {trackContent({\n icon,\n showStops,\n size,\n vertical\n }, thumbLabels)}\n </SliderTrack>\n </RACSlider>;\n}\n\n// The fractions of the way along the track that a step lands on, ends left\n// out: those are drawn as the end stops, the page's gap in from each end.\nfunction stepsOf(state: SliderState) {\n const min = state.getThumbMinValue(0);\n const max = state.getThumbMaxValue(state.values.length - 1);\n const fractions: number[] = [];\n if (state.step <= 0) {\n return fractions;\n }\n for (let index = 1; min + index * state.step < max; index++) {\n fractions.push(state.getValuePercent(min + index * state.step));\n }\n return fractions;\n}\n\n// What a handle draws: its value while it is dragged or has keyboard focus.\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its inputs.\nfunction thumbContent(index: number, vertical: boolean) {\n return (state: SliderThumbRenderProps) => state.isDragging || state.isFocusVisible ? <SliderOutput {...{\n 0: {\n className: \"x6s0dn4 x1c5gpgi xn3w4p2 x1dkaolv x9f619 x1girmi0 x78zum5 xkknnkr x14zspaw x1v9cpvo x3mk9i xbudbmw xl56j7k x155f00i x1lz68p4 x900493 x18fpw6u x10l6tqk xaf021q xuuh30 xuxw1ft\"\n },\n 1: {\n className: \"x6s0dn4 x1c5gpgi xn3w4p2 x1dkaolv x9f619 x1girmi0 x78zum5 xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 x900493 x18fpw6u x10l6tqk xuxw1ft xdd4er5 xwa60dl x15zsqls xhi6v0a x1cb1t30\"\n }\n }[!!vertical << 0]}>\n {state.state.getThumbValueLabel(index)}\n </SliderOutput> : null;\n}\nfunction thumbStyles(vertical: boolean) {\n return (state: SliderThumbRenderProps) => stylex.props(styles.thumb, vertical && styles.thumbVertical, (state.isDragging || state.isFocusVisible) && (vertical ? styles.thumbActiveVertical : styles.thumbActive), state.isDragging && styles.thumbDragging, state.isFocusVisible && styles.thumbFocused, state.isDisabled && styles.thumbDisabled);\n}\n\n// The track's parts and handles, from the slider's state: an inactive part\n// before the first handle of a range, the active part up to or between the\n// handles, and the inactive part after the last one carrying the stop.\nfunction trackContent(extras: Extras, thumbLabels: string[] | undefined) {\n return ({\n isDisabled,\n state\n }: SliderTrackRenderProps) => {\n const {\n icon,\n showStops,\n size,\n vertical\n } = extras;\n const fractions = state.values.map((_, index) => state.getThumbPercent(index));\n const first = fractions[0] ?? 0;\n const last = fractions.at(-1) ?? 0;\n const range = fractions.length > 1;\n const parts: Part[] = [...(range ? [{\n active: false,\n end: before(first),\n name: 'before',\n start: AT_END\n } as const] : []), {\n active: true,\n end: before(last),\n name: 'active',\n start: range ? after(first) : AT_END\n }, {\n active: false,\n end: AT_END,\n name: 'after',\n start: after(last)\n }];\n const hasIcon = icon !== undefined && icon !== null && !range && (size === 'md' || size === 'lg' || size === 'xl');\n const steps = showStops ? stepsOf(state) : [];\n const place = vertical ? placements.block : placements.inline;\n const innerStart = vertical ? styles.innerBlockStart : styles.innerInlineStart;\n const innerEnd = vertical ? styles.innerBlockEnd : styles.innerInlineEnd;\n return <>\n {parts.map(part => <span key={part.name} {...stylex.props(styles.segment, vertical && styles.segmentVertical, part.active && styles.active, part.active && hasIcon && styles.activeHoldingIcon, isDisabled && (part.active ? styles.activeDisabled : styles.inactiveDisabled), part.start !== AT_END && innerStart, part.end !== AT_END && innerEnd, place(insetOf(part.start), insetOf(part.end)))}>\n {partContent(part, extras, isDisabled, steps, part.active && hasIcon)}\n </span>)}\n {fractions.map((_, index) => <SliderThumb aria-label={thumbLabels?.[index]} index={index}\n // oxlint-disable-next-line react/no-array-index-key -- a handle's position is its identity\n key={index} {...mergeStatefulStyles(thumbStyles(vertical), {})}>\n {thumbContent(index, vertical)}\n </SliderThumb>)}\n </>;\n };\n}\nexport type { SliderProps, SliderSize };\nexport default Slider;"],"mappings":";;;;;;;;;;AAgFA,MAAMO,QAAQD;;AAEd,MAAME,OAAO;AAQb,MAAMC,QAAQ;CACZC,IAAI;EACF,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClBC,OAAO;CACT;CACAC,IAAI;EACF,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClBD,OAAO;CACT;CACAE,IAAI;EACF,mBAAmB;EACnB,mBAAmB;EACnB,kBAAkB;EAClBF,OAAO;CACT;CACAG,IAAI;EACF,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClBH,OAAO;CACT;CACAI,IAAI;EACF,mBAAmB;EACnB,mBAAmB;EACnB,kBAAkB;EAClBJ,OAAO;CACT;AACF;AACA,MAAMK,SAAS;CACbC,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B,KAAKoC,GAAGR,UAAU,oBAAC,aAAD;GAAa,cAAYrD,cAAcqD;GAAeA;GAEzE,GAAI1J,oBAAoBiK,YAAYlE,QAAQ,GAAG,CAAC,CAAC;GACtD8D,UAAAA,aAAaH,OAAO3D,QAAQ;EAClB,GAFZ2D,KAEY,CAAC,CAClB,EAAA,CAAA;CACJ;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","Slider","RACSlider","groupStyles","mergeStatefulStyles","GAP","CLEAR","STOP","sizes","lg","$$css","md","sm","xl","xs","styles","active","kWkggS","activeDisabled","activeHoldingIcon","k9g6sI","icon","kGNEyG","kZKoxP","kMwMTN","k1xSpc","kGuDYH","kzqmXN","k87sOh","kLqNvP","kjj79g","kVAEAm","iconDisabled","iconRoomBlock","iconRoomBlockXl","iconRoomInline","iconRoomInlineXl","iconVertical","krVfgx","inactiveDisabled","innerBlockEnd","kT0f0o","kVL7Gh","innerBlockStart","kfmiAY","krdFHd","innerInlineEnd","innerInlineStart","root","rootVertical","segment","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kB7OPa","kVQacm","segmentVertical","stop","stopActive","stopActiveDisabled","stopDisabled","stopEnd","kt4wiu","stopEndVertical","stopStart","stopStartVertical","stopVertical","thumb","k6CgDc","kkrTdU","kjBf7l","kInvED","k3XXqK","kMeerF","kIyJzY","k1ekBW","kAMwcw","thumbActive","thumbActiveVertical","thumbDisabled","thumbDragging","thumbFocused","thumbVertical","kbCHJM","_temp","_temp2","placements","block","start","end","val","undefined","inline","stopBlock","offset","stopInline","showStops","size","vertical","fraction","px","name","label","orientation","thumbLabels","AT_END","after","before","iconRoom","insetIcon","isDisabled","room","props","insetOf","offsetIn","share","partContent","part","extras","steps","hasIcon","from","to","length","inside","filter","place","atStart","atEnd","map","t0","$","T0","t1","t2","t3","t4","t5","t6","t7","t8","t9","state","0","className","2","1","3","trackContent","stepsOf","min","getThumbMinValue","max","getThumbMaxValue","values","fractions","step","index","push","getValuePercent","thumbContent","isDragging","isFocusVisible","getThumbValueLabel","thumbStyles","_","getThumbPercent","first","last","at","range","parts","innerStart","innerEnd"],"sources":["../../../src/components/slider/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { SliderProps as RACSliderProps, SliderState, SliderThumbRenderProps, SliderTrackRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Slider as RACSlider, SliderOutput, SliderThumb, SliderTrack } from 'react-aria-components';\nimport { FieldLabel } from '../../field';\nimport { groupStyles } from '../../field/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The sliders page. At the size its tokens call extra-small, the default: a\n// 16dp track with an 8dp corner, the active part in primary and the inactive\n// part in secondary container, a 4dp stop in on secondary container 6dp from\n// the inactive end, and a handle 4dp wide and 44dp tall in primary that\n// narrows to 2dp while pressed or focused. The track parts on each side of\n// the handle, with 6dp of space between them and it, and their corners\n// against the handle are 2dp where their outer ends are full. Disabled, the\n// active part and the handle are on surface at the disabled content opacity\n// and the inactive part at the disabled container opacity.\n//\n// `size` takes the page's four larger sizes, which thicken the track and\n// round its ends more, and lengthen the handle from M up:\n//\n// | Size | Track | Corner | Handle | Inset icon |\n// | ---- | ----- | ------ | ------ | ---------- |\n// | xs | 16dp | 8dp | 44dp | |\n// | sm | 24dp | 8dp | 44dp | |\n// | md | 40dp | 12dp | 52dp | 24dp |\n// | lg | 56dp | 16dp | 68dp | 24dp |\n// | xl | 96dp | 28dp | 108dp | 32dp |\n//\n// The handle stays 4dp wide, the corners against it 2dp and the space beside\n// it 6dp at every size.\n//\n// `showStops` is the page's stops configuration, which it used to call the\n// discrete slider: a 4dp stop at every step, in on primary on the active part\n// and on secondary container on the inactive one, so the reader can see\n// where the handle can land. The stops at the two ends sit 6dp in from them,\n// as the single stop does. A part clips what it holds, which is what hides\n// the stops beside the handle: the part ends 6dp short of it.\n//\n// `icon` is the page's inset icon, at the start of the active part in on\n// primary, from M up: the page gives it a size at M, L and XL alone. It is\n// 10dp in from the part's start, which is MDC-Android's padding, since the\n// page gives none, and like MDC-Android it is drawn only while the part has\n// room for it and that padding on both sides, and for a single handle.\n//\n// The value indicator is the page's label: inverse surface under label-large\n// in inverse on surface, 44dp tall and at least 48dp wide, 12dp above the\n// handle. It shows while the handle is dragged or has keyboard focus, and it\n// is React Aria's `SliderOutput`, so what it shows is what the slider\n// announces.\n//\n// React Aria's `Slider` is the root, `SliderTrack` the strip the handles are\n// placed along by percent, and `SliderThumb` each handle around a visually\n// hidden range input. The track's parts are drawn here from those percents\n// rather than with `SliderFill`, since the page's parts stop short of the\n// handle on both sides and the fill runs up to it. A range slider is the\n// same track with two handles and the active part between them.\n//\n// Vertical, the same parts run along the block axis, with the active part\n// rising from the bottom and the indicator to the start side of the handle.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The sliders page's own measurements, which are constants of the component\n// rather than steps of the consumer's spacing scale. The clearance used to be\n// read off `spacing.sm` — true at its default 8, since 6 plus half the\n// handle comes to the same — so a theme moving that step opened the gap\n// beside the handle while the stop, written as the literal it is, stayed\n// where the page puts it.\nconst GAP = 6;\nconst HANDLE_WIDTH = 4;\n/** How far a part stops short of a handle's centre. */\nconst CLEAR = GAP + HANDLE_WIDTH / 2;\n/** A stop's size. */\nconst STOP = 4;\n/** MDC-Android's padding either side of the inset icon. */\nconst ICON_PADDING = 10;\ntype SliderSize = 'lg' | 'md' | 'sm' | 'xl' | 'xs';\n\n// The sizes, as the custom properties every part reads: the track's\n// thickness, its outer corner and the handle's length, which the track\n// strip takes as its own thickness too.\nconst sizes = {\n lg: {\n \"--slider-corner\": \"x1hr852m\",\n \"--slider-handle\": \"x1i1s3m4\",\n \"--slider-icon\": \"xsfv7fh\",\n \"--slider-track\": \"xdrquod\",\n $$css: true\n },\n md: {\n \"--slider-corner\": \"x1welmdy\",\n \"--slider-handle\": \"x1290pjo\",\n \"--slider-icon\": \"xsfv7fh\",\n \"--slider-track\": \"xhx1aj5\",\n $$css: true\n },\n sm: {\n \"--slider-corner\": \"x1y8vi8n\",\n \"--slider-handle\": \"x1czf5nl\",\n \"--slider-track\": \"xf334ng\",\n $$css: true\n },\n xl: {\n \"--slider-corner\": \"x1tzw2no\",\n \"--slider-handle\": \"x1aoofsu\",\n \"--slider-icon\": \"xmfnedx\",\n \"--slider-track\": \"x1s6dhuk\",\n $$css: true\n },\n xs: {\n \"--slider-corner\": \"x1y8vi8n\",\n \"--slider-handle\": \"x1czf5nl\",\n \"--slider-track\": \"x16oikcs\",\n $$css: true\n }\n};\nconst styles = {\n active: {\n kWkggS: \"xnety89 x1jzqe4\",\n $$css: true\n },\n activeDisabled: {\n kWkggS: \"x1crcgwy\",\n $$css: true\n },\n activeHoldingIcon: {\n k9g6sI: \"xpqogu8\",\n $$css: true\n },\n icon: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"xi7vqlm\",\n kMwMTN: \"xwjo7ld x1k5gbb1\",\n k1xSpc: \"x78zum5\",\n kGuDYH: \"xuu3ggl\",\n kzqmXN: \"xoxpges\",\n k87sOh: \"xdtafdd\",\n kLqNvP: \"xi5uv41\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x10l6tqk\",\n $$css: true\n },\n iconDisabled: {\n kMwMTN: \"x1girmi0\",\n $$css: true\n },\n iconRoomBlock: {\n k1xSpc: \"x1uo08md x78zum5\",\n $$css: true\n },\n iconRoomBlockXl: {\n k1xSpc: \"x2mjljv x78zum5\",\n $$css: true\n },\n iconRoomInline: {\n k1xSpc: \"x1cueg3v x78zum5\",\n $$css: true\n },\n iconRoomInlineXl: {\n k1xSpc: \"x18ymn08 x78zum5\",\n $$css: true\n },\n iconVertical: {\n krVfgx: \"x1jn9clo\",\n k87sOh: \"x80663w\",\n kLqNvP: \"x1m57d8a\",\n $$css: true\n },\n inactiveDisabled: {\n kWkggS: \"x19v6zzp\",\n $$css: true\n },\n innerBlockEnd: {\n kT0f0o: \"x1ui04y5\",\n kVL7Gh: \"x6en5u8\",\n $$css: true\n },\n innerBlockStart: {\n kfmiAY: \"x1e4oeot\",\n krdFHd: \"xr9e8f9\",\n $$css: true\n },\n innerInlineEnd: {\n kT0f0o: \"x1ui04y5\",\n kfmiAY: \"x1e4oeot\",\n $$css: true\n },\n innerInlineStart: {\n kVL7Gh: \"x6en5u8\",\n krdFHd: \"xr9e8f9\",\n $$css: true\n },\n root: {\n kzqmXN: \"xh8yej3\",\n $$css: true\n },\n rootVertical: {\n kGNEyG: \"x1cy8zhl\",\n kZKoxP: \"x1u5z0ei\",\n kzqmXN: \"x14atkfc\",\n $$css: true\n },\n segment: {\n kWkggS: \"x15dekr4 x9yvj25\",\n kZKoxP: \"x9w084k\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1xpg3mf\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x13rsnn2\",\n kB7OPa: \"x9f619\",\n k87sOh: \"x1i1s66i\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x10l6tqk\",\n $$css: true\n },\n segmentVertical: {\n kZKoxP: \"xt7dq6l\",\n kzqmXN: \"x3fzmgt\",\n k87sOh: \"x80663w\",\n kLqNvP: \"x9k4rl8\",\n $$css: true\n },\n stop: {\n kWkggS: \"x81krv7 x1tt9vl1\",\n kZKoxP: \"xqu0tyb\",\n kaIpWk: \"x16fbrrb\",\n kzqmXN: \"x51ohtg\",\n k87sOh: \"x17a0tka\",\n kVAEAm: \"x10l6tqk\",\n $$css: true\n },\n stopActive: {\n kWkggS: \"x1ntwmx2 x1sir5s4\",\n $$css: true\n },\n stopActiveDisabled: {\n kWkggS: \"x1dbj914\",\n $$css: true\n },\n stopDisabled: {\n kWkggS: \"x1crcgwy\",\n $$css: true\n },\n stopEnd: {\n kt4wiu: \"x1f889gz\",\n $$css: true\n },\n stopEndVertical: {\n k87sOh: \"x1atx4j1\",\n kt4wiu: \"x1woyocn\",\n $$css: true\n },\n stopStart: {\n kLqNvP: \"xrr41r3\",\n $$css: true\n },\n stopStartVertical: {\n krVfgx: \"xrb244j\",\n k87sOh: \"x80663w\",\n kLqNvP: \"xhi6v0a\",\n $$css: true\n },\n stopVertical: {\n k87sOh: \"x80663w\",\n kLqNvP: \"xml7xvy\",\n $$css: true\n },\n thumb: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89 x1jzqe4\",\n kZKoxP: \"x16gdi9t\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1dkaolv\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x13rsnn2\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1jm3nie\",\n kzqmXN: \"x51ohtg\",\n k87sOh: \"xwa60dl\",\n kjBf7l: \"xrgy624 x1x84bn5\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xdl150w\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n thumbActive: {\n kzqmXN: \"xfo62xy\",\n $$css: true\n },\n thumbActiveVertical: {\n kZKoxP: \"x36qwtl\",\n kzqmXN: \"xluoxwi\",\n $$css: true\n },\n thumbDisabled: {\n kWkggS: \"x1crcgwy\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n thumbDragging: {\n kkrTdU: \"xi9pz9s\",\n $$css: true\n },\n thumbFocused: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n thumbVertical: {\n kZKoxP: \"xqu0tyb\",\n kzqmXN: \"xluoxwi\",\n k87sOh: \"x80663w\",\n kbCHJM: \"x1nrll8i\",\n $$css: true\n }\n};\n\n// Where each part of the track starts and ends, as insets from the track's\n// two ends, and where a stop sits inside a part. Dynamic styles, since the\n// percents come from the value at render time and StyleX compiles its\n// classes ahead of time; each writes its insets to custom properties inline.\nconst _temp = {\n krVfgx: \"xiicpxy\",\n k87sOh: \"x5mnzd7\",\n \"$$css\": true\n};\nconst _temp2 = {\n krVfgx: \"xiicpxy\",\n \"$$css\": true\n};\nconst placements = {\n block: (start: string, end: string) => [_temp, {\n \"--x-insetBlockEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start),\n \"--x-insetBlockStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end)\n }],\n inline: (start: string, end: string) => [end !== undefined && {\n kt4wiu: end != null ? \"xqxgn94\" : \"\",\n $$css: true\n }, start !== undefined && {\n kLqNvP: start != null ? \"x1lxsm33\" : \"\",\n $$css: true\n }, {\n \"--x-insetInlineEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-insetInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start)\n }],\n stopBlock: (offset: string) => [_temp2, {\n \"--x-insetBlockEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(offset)\n }],\n stopInline: (offset: string) => [offset !== undefined && {\n kLqNvP: offset != null ? \"x1lxsm33\" : \"\",\n $$css: true\n }, {\n \"--x-insetInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(offset)\n }]\n};\n\n/** What a track draws besides its parts and handles. */\ntype Extras = {\n icon: ReactNode;\n showStops: boolean;\n size: SliderSize;\n vertical: boolean;\n};\n\n/** One end of a part: a fraction of the track's length, and pixels on top. */\ntype Inset = {\n fraction: number;\n px: number;\n};\n\n/**\n * A part of the track, by the insets of its two ends from the track's, and\n * which of the three it is: the inactive part before a range's first handle,\n * the active part, or the inactive part after the last handle.\n */\ntype Part = {\n active: boolean;\n end: Inset;\n name: 'active' | 'after' | 'before';\n start: Inset;\n};\ntype SliderProps = Omit<RACSliderProps, 'children' | 'orientation'> & {\n /**\n * The page's inset icon, at the start of the active part, from `md` up:\n * the page gives it a size at M, L and XL alone. Drawn for a single\n * handle, and only while the active part has room for it.\n */\n icon?: ReactNode;\n /**\n * What the slider sets. A slider that a row labels some other way leaves\n * it out and passes `aria-label` instead.\n */\n label?: string;\n /**\n * Along which axis the handle moves. A vertical slider is 240px tall until\n * `style` on the root says otherwise.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * A stop at every step, the page's stops configuration, so the reader can\n * see where the handle can land. Meant for a slider with a handful of\n * steps: each stop is a 4dp dot, and a fine step draws a crowd of them.\n * @default false\n */\n showStops?: boolean;\n /**\n * The page's sizes, by the track's thickness: 16dp at `xs`, 24dp at `sm`,\n * 40dp at `md`, 56dp at `lg` and 96dp at `xl`, with the handle 44dp long\n * up to `sm` and 52dp, 68dp and 108dp past it.\n * @default 'xs'\n */\n size?: SliderSize;\n /**\n * A name for each handle of a range slider, in order, since two handles\n * named by the same label cannot be told apart.\n */\n thumbLabels?: string[];\n};\nconst AT_END: Inset = {\n fraction: 0,\n px: 0\n};\n\n// A part's start inset, clear of a handle at `fraction` of the way along. The\n// fraction lands on the handle's centre, so half the handle's width joins the\n// page's gap to reach its edge.\nfunction after(fraction: number): Inset {\n return {\n fraction,\n px: CLEAR\n };\n}\n\n// A part's end inset, clear of a handle at `fraction` of the way along.\nfunction before(fraction: number): Inset {\n return {\n fraction: 1 - fraction,\n px: CLEAR\n };\n}\n\n// The container query that hides the inset icon for want of room: the part's\n// length along the track, against the icon and its padding at this size.\nfunction iconRoom(size: SliderSize, vertical: boolean) {\n if (vertical) {\n return size === 'xl' ? styles.iconRoomBlockXl : styles.iconRoomBlock;\n }\n return size === 'xl' ? styles.iconRoomInlineXl : styles.iconRoomInline;\n}\n\n// The inset icon, at the foot of the active part, while the part has room.\nfunction insetIcon({\n icon,\n size,\n vertical\n}: Extras, isDisabled: boolean): ReactNode {\n const room = iconRoom(size, vertical);\n return <span {...stylex.props(styles.icon, vertical && styles.iconVertical, room, isDisabled && styles.iconDisabled)}>\n {icon}\n </span>;\n}\nfunction insetOf({\n fraction,\n px\n}: Inset) {\n return `calc(${fraction * 100}% + ${px}px)`;\n}\n\n// Where a stop at `fraction` of the way along the track starts inside a part.\n// The part's own length is the `100%` the expression has to work from, and\n// the track's is that plus both insets, so a fraction of the track is a\n// share of the part's length plus their pixels.\nfunction offsetIn({\n end,\n start\n}: Part, fraction: number) {\n const share = 1 - start.fraction - end.fraction;\n const scale = (fraction - start.fraction) / share;\n return `calc(${scale} * (100% + ${start.px + end.px}px) - ${start.px + STOP / 2}px)`;\n}\n\n// What a part holds: a stop at each step inside it, the end stops where it\n// reaches the track's ends, and the inset icon.\nfunction partContent(part: Part, extras: Extras, isDisabled: boolean, steps: number[], hasIcon: boolean) {\n const {\n showStops,\n vertical\n } = extras;\n const stop = [styles.stop, vertical && styles.stopVertical, part.active && styles.stopActive, isDisabled && (part.active ? styles.stopActiveDisabled : styles.stopDisabled)];\n const from = part.start.fraction;\n const to = 1 - part.end.fraction;\n const length = 1 - part.start.fraction - part.end.fraction;\n const inside = showStops && length > 0 ? steps.filter(fraction => fraction >= from && fraction <= to) : [];\n const place = vertical ? placements.stopBlock : placements.stopInline;\n const atStart = part.start.fraction === 0 && part.start.px === 0;\n // The single stop at the inactive end is drawn with or without the stops\n // configuration; the one at the start is the configuration's own.\n const atEnd = part.end.fraction === 0 && part.end.px === 0 && !part.active;\n return <>\n {hasIcon ? insetIcon(extras, isDisabled) : null}\n {showStops && atStart ? <span {...stylex.props(...stop, vertical ? styles.stopStartVertical : styles.stopStart)} /> : null}\n {inside.map(fraction => <span key={fraction} {...stylex.props(...stop, place(offsetIn(part, fraction)))} />)}\n {atEnd ? <span {...stylex.props(...stop, vertical ? styles.stopEndVertical : styles.stopEnd)} /> : null}\n </>;\n}\n\n/**\n * A slider for one value, or for a range when the value is a pair. The value\n * is React Aria's: pass `value` with `onChange` to control it, or\n * `defaultValue` to let it keep its own, with `minValue`, `maxValue` and\n * `step` to shape it and `formatOptions` to say how it reads. Arrow keys\n * move a handle by a step, Page Up and Page Down by ten, Home and End to\n * the ends.\n *\n * The call site's `className` and `style` land on the slider as a whole,\n * which is the element a layout positions and the one that gives a vertical\n * slider its height.\n */\nfunction Slider({\n icon,\n label,\n orientation = 'horizontal',\n showStops = false,\n size = 'xs',\n thumbLabels,\n ...props\n}: RefAttributes<HTMLDivElement> & SliderProps) {\n const vertical = orientation === 'vertical';\n return <RACSlider orientation={orientation} {...props} {...mergeStatefulStyles(stylex.props(groupStyles.root, styles.root, sizes[size], vertical && styles.rootVertical), props)}>\n {label === undefined ? null : <FieldLabel variant=\"group\">{label}</FieldLabel>}\n <SliderTrack {...mergeStatefulStyles((state: SliderTrackRenderProps) => ({\n 0: {\n className: \"x16gdi9t x9f619 x1ypdohk xh8yej3 x1n2onr6\"\n },\n 2: {\n className: \"x9f619 x1ypdohk x1n2onr6 x5yr21d x1iyjqo2 xluoxwi x2lwn1j\"\n },\n 1: {\n className: \"x16gdi9t x9f619 xh8yej3 x1n2onr6 x1h6gzvc\"\n },\n 3: {\n className: \"x9f619 x1n2onr6 x5yr21d x1iyjqo2 xluoxwi x2lwn1j x1h6gzvc\"\n }\n })[!!vertical << 1 | !!state.isDisabled << 0], {})}>\n {trackContent({\n icon,\n showStops,\n size,\n vertical\n }, thumbLabels)}\n </SliderTrack>\n </RACSlider>;\n}\n\n// The fractions of the way along the track that a step lands on, ends left\n// out: those are drawn as the end stops, the page's gap in from each end.\nfunction stepsOf(state: SliderState) {\n const min = state.getThumbMinValue(0);\n const max = state.getThumbMaxValue(state.values.length - 1);\n const fractions: number[] = [];\n if (state.step <= 0) {\n return fractions;\n }\n for (let index = 1; min + index * state.step < max; index++) {\n fractions.push(state.getValuePercent(min + index * state.step));\n }\n return fractions;\n}\n\n// What a handle draws: its value while it is dragged or has keyboard focus.\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its inputs.\nfunction thumbContent(index: number, vertical: boolean) {\n return (state: SliderThumbRenderProps) => state.isDragging || state.isFocusVisible ? <SliderOutput {...{\n 0: {\n className: \"x6s0dn4 x1c5gpgi xn3w4p2 x1dkaolv x9f619 x1girmi0 x78zum5 xkknnkr x14zspaw x1v9cpvo x3mk9i xbudbmw xl56j7k x155f00i x1lz68p4 x900493 x18fpw6u x10l6tqk xaf021q xuuh30 xuxw1ft\"\n },\n 1: {\n className: \"x6s0dn4 x1c5gpgi xn3w4p2 x1dkaolv x9f619 x1girmi0 x78zum5 xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 x900493 x18fpw6u x10l6tqk xuxw1ft xdd4er5 xwa60dl x15zsqls xhi6v0a x1cb1t30\"\n }\n }[!!vertical << 0]}>\n {state.state.getThumbValueLabel(index)}\n </SliderOutput> : null;\n}\nfunction thumbStyles(vertical: boolean) {\n return (state: SliderThumbRenderProps) => stylex.props(styles.thumb, vertical && styles.thumbVertical, (state.isDragging || state.isFocusVisible) && (vertical ? styles.thumbActiveVertical : styles.thumbActive), state.isDragging && styles.thumbDragging, state.isFocusVisible && styles.thumbFocused, state.isDisabled && styles.thumbDisabled);\n}\n\n// The track's parts and handles, from the slider's state: an inactive part\n// before the first handle of a range, the active part up to or between the\n// handles, and the inactive part after the last one carrying the stop.\nfunction trackContent(extras: Extras, thumbLabels: string[] | undefined) {\n return ({\n isDisabled,\n state\n }: SliderTrackRenderProps) => {\n const {\n icon,\n showStops,\n size,\n vertical\n } = extras;\n const fractions = state.values.map((_, index) => state.getThumbPercent(index));\n const first = fractions[0] ?? 0;\n const last = fractions.at(-1) ?? 0;\n const range = fractions.length > 1;\n const parts: Part[] = [...(range ? [{\n active: false,\n end: before(first),\n name: 'before',\n start: AT_END\n } as const] : []), {\n active: true,\n end: before(last),\n name: 'active',\n start: range ? after(first) : AT_END\n }, {\n active: false,\n end: AT_END,\n name: 'after',\n start: after(last)\n }];\n const hasIcon = icon !== undefined && icon !== null && !range && (size === 'md' || size === 'lg' || size === 'xl');\n const steps = showStops ? stepsOf(state) : [];\n const place = vertical ? placements.block : placements.inline;\n const innerStart = vertical ? styles.innerBlockStart : styles.innerInlineStart;\n const innerEnd = vertical ? styles.innerBlockEnd : styles.innerInlineEnd;\n return <>\n {parts.map(part => <span key={part.name} {...stylex.props(styles.segment, vertical && styles.segmentVertical, part.active && styles.active, part.active && hasIcon && styles.activeHoldingIcon, isDisabled && (part.active ? styles.activeDisabled : styles.inactiveDisabled), part.start !== AT_END && innerStart, part.end !== AT_END && innerEnd, place(insetOf(part.start), insetOf(part.end)))}>\n {partContent(part, extras, isDisabled, steps, part.active && hasIcon)}\n </span>)}\n {fractions.map((_, index) => <SliderThumb aria-label={thumbLabels?.[index]} index={index}\n // oxlint-disable-next-line react/no-array-index-key -- a handle's position is its identity\n key={index} {...mergeStatefulStyles(thumbStyles(vertical), {})}>\n {thumbContent(index, vertical)}\n </SliderThumb>)}\n </>;\n };\n}\nexport type { SliderProps, SliderSize };\nexport default Slider;"],"mappings":";;;;;;;;;;AAgFA,MAAMO,QAAQD;;AAEd,MAAME,OAAO;AAQb,MAAMC,QAAQ;CACZC,IAAI;EACF,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClBC,OAAO;CACT;CACAC,IAAI;EACF,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClBD,OAAO;CACT;CACAE,IAAI;EACF,mBAAmB;EACnB,mBAAmB;EACnB,kBAAkB;EAClBF,OAAO;CACT;CACAG,IAAI;EACF,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClBH,OAAO;CACT;CACAI,IAAI;EACF,mBAAmB;EACnB,mBAAmB;EACnB,kBAAkB;EAClBJ,OAAO;CACT;AACF;AACA,MAAMK,SAAS;CACbC,QAAQ;EACNC,QAAQ;EACRP,OAAO;CACT;CACAQ,gBAAgB;EACdD,QAAQ;EAC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