@kanso-labs/kanso-ui 0.46.0 → 0.47.1
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/chip/label.js +1 -0
- package/dist/chip/label.js.map +1 -1
- package/dist/chip/styles.js +1 -0
- package/dist/chip/styles.js.map +1 -1
- package/dist/components/breadcrumbs/index.js +1 -1
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/code/index.js +32 -26
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/color-swatch/index.js +1 -1
- package/dist/components/color-swatch/index.js.map +1 -1
- package/dist/components/icon-button/index.js +3 -3
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/link/index.js +2 -2
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/menu/index.js +4 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/progress-indicator/index.js +258 -172
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/search-view/index.js +1 -1
- package/dist/components/search-view/index.js.map +1 -1
- package/dist/components/table/index.d.ts +26 -5
- package/dist/components/table/index.js +93 -75
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tag/index.js +1 -0
- package/dist/components/tag/index.js.map +1 -1
- package/dist/components/time-picker/index.js +35 -5
- package/dist/components/time-picker/index.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +4 -3
- package/dist/components/toolbar/index.js +107 -38
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/navigation/styles.js +1 -1
- package/dist/navigation/styles.js.map +1 -1
- package/dist/segments/index.js +2 -6
- package/dist/segments/index.js.map +1 -1
- package/dist/segments/literal.js +66 -0
- package/dist/segments/literal.js.map +1 -0
- package/dist/segments/styles.js +4 -0
- package/dist/segments/styles.js.map +1 -1
- package/dist/styles.css +351 -34
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","Toolbar","RACToolbar","SeparatorContext","mergeStatefulStyles","styles","base","kOuLrU","kaIpWk","kB7OPa","kMwMTN","k1xSpc","kOIVth","ks0D6T","k3XXqK","kVQacm","k5wCbM","$$css","horizontal","kGNEyG","klIVar","kprqdN","kjj79g","kAzted","k8WAf4","kg3NbH","neutral","kWkggS","vertical","kfiyM8","kAPf3g","k7Eaqz","vibrant","tone","t0","$","T0","T1","t1","t2","t3","t4","orientation","t5","t6","props","undefined","t7","t8","separator"],"sources":["../../../src/components/toolbar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ToolbarProps as RACToolbarProps, SeparatorProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport { Toolbar as RACToolbar, SeparatorContext } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing } from '../../tokens/design.tokens.stylex';\n\n// The toolbars page's container: a row of frequently used controls, on a\n// surface of its own, with the arrow keys moving between them rather than\n// Tab. The page calls it \"a container with configurable slots\", so nothing\n// here says what goes in one — an icon button, a button, a field or a rule\n// are all the call site's to place.\n//\n// The measurements are the page's, stated there in words: 64dp tall,\n// centred, 8dp between items and 16dp of padding outside them. The two\n// colour schemes are its own too — standard on surface container, vibrant on\n// primary container — and both put the muted content role on what they hold.\n// `tone` spells the standard one `neutral` rather than by the page's name,\n// since that is the word every `tone` in the library uses for its neutral\n// role.\n//\n// Two things are this component's own.\n//\n// **A rule inside it runs across the row, not along it.** React Aria's\n// `Toolbar` sets its orientation on itself and nowhere else, so a\n// `Separator` written among the controls would draw the way it does anywhere\n// else — along the row, where it is invisible. This provides React Aria's\n// separator context with the perpendicular orientation, and `Separator`\n// reads it, so a rule between two controls is correct without the call site\n// saying which way it runs. The context reaches the bar's own controls and\n// stops at an overlay opened from one: React context crosses the portal a\n// popover, sheet or dialog renders through, so their content parts clear it\n// — see `src/overlay` — and a rule inside one runs across the overlay as it\n// does anywhere else.\n//\n// **Arrow-key navigation is React Aria's and is not wrapped.** The arrows\n// move between the controls, and — worth knowing, since the pattern usually\n// implies otherwise — React Aria leaves every control tabbable rather than\n// giving the bar a roving tabindex, so Tab still steps through them one by\n// one. What the bar adds is the toolbar role, which tells a screen reader\n// the controls belong together, and a second way to move between them.\n//\n// One departure, and it is about the shape. The page gives the container's\n// corner as a token its widget draws rather than writes, so there is no\n// value to read: what it states in words is the height, the alignment and\n// the padding, and nothing else. The fully rounded corner here, and the\n// inline box that goes with it, are the library's own choice for a bar that\n// floats over a page rather than docking to its edge — a docked one spans\n// its container and squares its corner, both from the call site.\n\nconst styles = {\n base: {\n kOuLrU: \"xfk6m8\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n k1xSpc: \"xwz0xwf\",\n kOIVth: \"x126z3so\",\n ks0D6T: \"x193iq5w\",\n k3XXqK: \"x1t137rt\",\n kVQacm: \"xysyzu8\",\n k5wCbM: \"x1rohswg\",\n $$css: true\n },\n horizontal: {\n kGNEyG: \"x6s0dn4\",\n klIVar: \"x1mt6kc2\",\n kprqdN: \"x1mt1orb\",\n kjj79g: \"xej7fhh\",\n kAzted: \"x8nclml\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n neutral: {\n kWkggS: \"x1mjdul6\",\n $$css: true\n },\n vertical: {\n kfiyM8: \"x1l10kik\",\n kprqdN: \"x1sdr0u7\",\n kAPf3g: \"x1o2pa38\",\n k7Eaqz: \"x4m7ku4\",\n k8WAf4: \"xp6hjv6\",\n kg3NbH: \"xn60lsn\",\n $$css: true\n },\n vibrant: {\n kWkggS: \"xp89om9\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n }\n};\ntype ToolbarProps = Omit<RACToolbarProps, 'children' | 'className' | 'style'> & {\n /** The controls, and any rule between them. */\n children?: ReactNode;\n /** A function may compute the class from the toolbar's render state. */\n className?: RACToolbarProps['className'];\n /** A function may compute the style from the toolbar's render state. */\n style?: RACToolbarProps['style'];\n /**\n * Which of the page's two colour schemes the bar takes. `neutral` is the\n * page's standard scheme, the surface container it draws by default;\n * `vibrant` moves it to primary container, for a bar meant to carry the\n * page's accent.\n * @default 'neutral'\n */\n tone?: ToolbarTone;\n};\ntype ToolbarTone = 'neutral' | 'vibrant';\n\n/**\n * A container for a set of controls, announced as a toolbar so a screen\n * reader reads them as one group, with the arrow keys moving between them.\n * Tab still steps through each control: React Aria's toolbar adds the arrows\n * rather than replacing what Tab does.\n *\n * ```tsx\n * <Toolbar aria-label=\"Label\">\n * <IconButton aria-label=\"First item\">\n * <FirstIcon />\n * </IconButton>\n * <Separator />\n * <IconButton aria-label=\"Second item\">\n * <SecondIcon />\n * </IconButton>\n * </Toolbar>\n * ```\n *\n * Name it with `aria-label` or `aria-labelledby` — nothing here labels it for\n * you, and a toolbar with no name is a group a screen reader cannot announce.\n *\n * `orientation` is React Aria's, and it decides both which arrows move and\n * which way the bar runs. A `Separator` among its controls draws across that\n * direction without being told; one inside an overlay opened from the bar\n * draws as it would anywhere else.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n *\n * Every control keeps its own width. A bar given less room than its controls\n * need — a phone's width, say — stays inside it and scrolls along its length\n * rather than squeezing a control or overflowing the page.\n */\nfunction Toolbar({\n orientation = 'horizontal',\n tone = 'neutral',\n ...props\n}: RefAttributes<HTMLDivElement> & ToolbarProps) {\n // The rule runs across the toolbar rather than along it. Memoised because\n // a fresh object here would be a new context value on every render, which\n // is what react-perf's no-new-object-as-prop is after.\n const separator = useMemo<SeparatorProps>(() => ({\n orientation: orientation === 'horizontal' ? 'vertical' : 'horizontal'\n }), [orientation]);\n return <SeparatorContext value={separator}>\n <RACToolbar orientation={orientation} {...props} {...mergeStatefulStyles(stylex.props(styles.base, styles[orientation], styles[tone]), props)} />\n </S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,KAAAA;EAAiBG,KAAAA;EAAWL,KAAApC,oBAAoBJ,MAAaK,OAAMC,MAAOD,OAAOqC,cAAcrC,OAAO4B,KAAK,GAAGY,OAAK;EAACV,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAA;EAAAL,KAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;EAAAM,KAAAN,EAAA;CAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAC,MAAAD,EAAA,QAAAG,MAAAH,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,IAAA;EAA7IG,KAAA,oBAAC,IAAD;GAAyBD,aAAAA;GAAW,GAAMG;GAAK,GAAML;EAAwF,CAAA;EAAIL,EAAA,KAAAC;EAAAD,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAE,MAAAF,EAAA,QAAAM,MAAAN,EAAA,QAAAQ,IAAA;EAD9IC,KAAA,oBAAC,IAAD;GAAyBK,OAAAA;GAC5BN,UAAAA;EADoB,CAAA;EAEHR,EAAA,MAAAE;EAAAF,EAAA,MAAAM;EAAAN,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAFdS;AAEc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","createElement","Toolbar","RACToolbar","SeparatorContext","mergeStatefulStyles","styles","base","kOuLrU","kaIpWk","kB7OPa","kMwMTN","k1xSpc","kOIVth","ks0D6T","k3XXqK","kVQacm","k5wCbM","$$css","horizontal","kGNEyG","klIVar","kprqdN","kjj79g","kAzted","k8WAf4","kg3NbH","neutral","kWkggS","vertical","kfiyM8","kAPf3g","k7Eaqz","vibrant","tone","FOCUSABLE","join","PRESSABLE_INPUTS","Set","controlsIn","bar","HTMLElement","querySelectorAll","filter","control","tabIndex","matches","closest","checkVisibility","homeAndEnd","event","currentTarget","target","key","altKey","ctrlKey","metaKey","shiftKey","defaultPrevented","contains","ownsHomeAndEnd","controls","at","undefined","preventDefault","focus","HTMLInputElement","has","type","HTMLTextAreaElement","HTMLSelectElement","isContentEditable","t0","$","T0","T1","t1","t2","t3","t4","t5","orientation","t6","t7","props","t8","t9","separator","toolbarRenderer","render","domProps","renderProps","merged","onKeyDown"],"sources":["../../../src/components/toolbar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { KeyboardEvent, ReactNode, RefAttributes } from 'react';\nimport type { ToolbarProps as RACToolbarProps, SeparatorProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createElement, useMemo } from 'react';\nimport { Toolbar as RACToolbar, SeparatorContext } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing } from '../../tokens/design.tokens.stylex';\n\n// The toolbars page's container: a row of frequently used controls, on a\n// surface of its own, with the arrow keys moving between them rather than\n// Tab. The page calls it \"a container with configurable slots\", so nothing\n// here says what goes in one — an icon button, a button, a field or a rule\n// are all the call site's to place.\n//\n// The measurements are the page's, stated there in words: 64dp tall,\n// centred, 8dp between items and 16dp of padding outside them. The two\n// colour schemes are its own too — standard on surface container, vibrant on\n// primary container — and both put the muted content role on what they hold.\n// `tone` spells the standard one `neutral` rather than by the page's name,\n// since that is the word every `tone` in the library uses for its neutral\n// role.\n//\n// Two things are this component's own.\n//\n// **A rule inside it runs across the row, not along it.** React Aria's\n// `Toolbar` sets its orientation on itself and nowhere else, so a\n// `Separator` written among the controls would draw the way it does anywhere\n// else — along the row, where it is invisible. This provides React Aria's\n// separator context with the perpendicular orientation, and `Separator`\n// reads it, so a rule between two controls is correct without the call site\n// saying which way it runs. The context reaches the bar's own controls and\n// stops at an overlay opened from one: React context crosses the portal a\n// popover, sheet or dialog renders through, so their content parts clear it\n// — see `src/overlay` — and a rule inside one runs across the overlay as it\n// does anywhere else.\n//\n// **Keyboard navigation is React Aria's, with Home and End added.** The\n// arrows move between the controls, and the bar is a single Tab stop, as\n// the APG's toolbar pattern has it. React Aria gets there without a roving\n// tabindex: every control keeps its own `tabindex`, and a Tab pressed inside\n// the bar first moves focus to its last control, a Shift+Tab to its first,\n// so the browser's own move then leaves the bar from there. Coming back with\n// either, focus returns to the control focused last rather than to the end\n// it came in from. The bar's other contribution is the toolbar role, which\n// tells a screen reader the controls belong together.\n//\n// The pattern also gives Home and End to the first and the last control,\n// which React Aria's toolbar leaves alone, so `homeAndEnd` below adds them:\n// the start and the end of the bar in document order, whichever way it runs\n// and whichever direction it is drawn in, passing over a disabled control.\n// They are taken as the key bubbles out of the control rather than ahead of\n// it, so a control that has a use for them keeps it: a field moves its\n// caret, and a control that handles the key first, as React Aria's slider\n// does, takes it from the bar.\n//\n// One departure, and it is about the shape. The page gives the container's\n// corner as a token its widget draws rather than writes, so there is no\n// value to read: what it states in words is the height, the alignment and\n// the padding, and nothing else. The fully rounded corner here, and the\n// inline box that goes with it, are the library's own choice for a bar that\n// floats over a page rather than docking to its edge — a docked one spans\n// its container and squares its corner, both from the call site.\n\nconst styles = {\n base: {\n kOuLrU: \"xfk6m8\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n k1xSpc: \"xwz0xwf\",\n kOIVth: \"x126z3so\",\n ks0D6T: \"x193iq5w\",\n k3XXqK: \"x1t137rt\",\n kVQacm: \"xysyzu8\",\n k5wCbM: \"x1rohswg\",\n $$css: true\n },\n horizontal: {\n kGNEyG: \"x6s0dn4\",\n klIVar: \"x1mt6kc2\",\n kprqdN: \"x1mt1orb\",\n kjj79g: \"xej7fhh\",\n kAzted: \"x8nclml\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n neutral: {\n kWkggS: \"x1mjdul6\",\n $$css: true\n },\n vertical: {\n kfiyM8: \"x1l10kik\",\n kprqdN: \"x1sdr0u7\",\n kAPf3g: \"x1o2pa38\",\n k7Eaqz: \"x4m7ku4\",\n k8WAf4: \"xp6hjv6\",\n kg3NbH: \"xn60lsn\",\n $$css: true\n },\n vibrant: {\n \"--icon-button-standard-color\": \"x78l5pw\",\n kWkggS: \"xp89om9\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n }\n};\ntype ToolbarProps = Omit<RACToolbarProps, 'children' | 'className' | 'style'> & {\n /** The controls, and any rule between them. */\n children?: ReactNode;\n /** A function may compute the class from the toolbar's render state. */\n className?: RACToolbarProps['className'];\n /** A function may compute the style from the toolbar's render state. */\n style?: RACToolbarProps['style'];\n /**\n * Which of the page's two colour schemes the bar takes. `neutral` is the\n * page's standard scheme, the surface container it draws by default;\n * `vibrant` moves it to primary container, for a bar meant to carry the\n * page's accent.\n * @default 'neutral'\n */\n tone?: ToolbarTone;\n};\ntype ToolbarRender = RACToolbarProps['render'];\ntype ToolbarTone = 'neutral' | 'vibrant';\n\n// What can take focus in the bar, as a Tab could land on it: a native\n// control or anything with a `tabindex`, narrowed in `controlsIn`.\nconst FOCUSABLE = ['a[href]', 'area[href]', 'button', 'iframe', 'input:not([type=\"hidden\"])', 'select', 'summary', 'textarea', '[contenteditable]:not([contenteditable=\"false\"])', '[tabindex]'].join(',');\n\n// The input types that are a press target rather than a value, and so have\n// no use for Home and End of their own.\nconst PRESSABLE_INPUTS = new Set(['button', 'checkbox', 'image', 'radio', 'reset', 'submit']);\n\n/**\n * The bar's controls a Tab could land on, in document order: a disabled\n * one, one taken out of the Tab order, and one inert or not drawn are left\n * out, so Home and End never reach a control that cannot take focus.\n */\nfunction controlsIn(bar: HTMLElement) {\n return [...bar.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(control => control.tabIndex >= 0 && !control.matches(':disabled') && control.closest('[inert]') === null && control.checkVisibility());\n}\n\n// Home and End, to the first and the last control. Left alone while a\n// modifier is held, which the browser may want, once a control has taken\n// the key, and on a key from a portal the bar renders — a popover opened\n// from one of its controls — which React carries up to the bar as though it\n// came from inside it. Taken from the page once used, so End does not\n// scroll it as well.\nfunction homeAndEnd(event: KeyboardEvent<HTMLDivElement>) {\n const bar = event.currentTarget;\n const {\n target\n } = event;\n if (event.key !== 'Home' && event.key !== 'End' || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey || event.defaultPrevented || !(target instanceof HTMLElement) || !bar.contains(target) || ownsHomeAndEnd(target)) {\n return;\n }\n const controls = controlsIn(bar);\n const control = event.key === 'Home' ? controls.at(0) : controls.at(-1);\n if (control === undefined) {\n return;\n }\n event.preventDefault();\n control.focus();\n}\n\n/**\n * Whether `target` is a control with its own use for Home and End: a field,\n * whose caret they move, a native select or range, or editable text.\n */\nfunction ownsHomeAndEnd(target: HTMLElement) {\n if (target instanceof HTMLInputElement) {\n return !PRESSABLE_INPUTS.has(target.type);\n }\n return target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement || target.isContentEditable;\n}\n\n/**\n * A container for a set of controls, announced as a toolbar so a screen\n * reader reads them as one group, with the arrow keys moving between them\n * and Home and End moving to the first and the last enabled control. The\n * bar is one Tab stop: Tab and Shift+Tab leave it from whichever control has\n * focus, and coming back returns to that control.\n *\n * ```tsx\n * <Toolbar aria-label=\"Label\">\n * <IconButton aria-label=\"First item\">\n * <FirstIcon />\n * </IconButton>\n * <Separator />\n * <IconButton aria-label=\"Second item\">\n * <SecondIcon />\n * </IconButton>\n * </Toolbar>\n * ```\n *\n * Name it with `aria-label` or `aria-labelledby` — nothing here labels it for\n * you, and a toolbar with no name is a group a screen reader cannot announce.\n *\n * `orientation` is React Aria's, and it decides both which arrows move and\n * which way the bar runs. A `Separator` among its controls draws across that\n * direction without being told; one inside an overlay opened from the bar\n * draws as it would anywhere else.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n *\n * Every control keeps its own width. A bar given less room than its controls\n * need — a phone's width, say — stays inside it and scrolls along its length\n * rather than squeezing a control or overflowing the page.\n */\nfunction Toolbar({\n orientation = 'horizontal',\n tone = 'neutral',\n ...props\n}: RefAttributes<HTMLDivElement> & ToolbarProps) {\n // The rule runs across the toolbar rather than along it. Memoised because\n // a fresh object here would be a new context value on every render, which\n // is what react-perf's no-new-object-as-prop is after.\n const separator = useMemo<SeparatorProps>(() => ({\n orientation: orientation === 'horizontal' ? 'vertical' : 'horizontal'\n }), [orientation]);\n return <SeparatorContext value={separator}>\n <RACToolbar orientation={orientation} {...props} render={toolbarRenderer(props.render)} {...mergeStatefulStyles(stylex.props(styles.base, styles[orientation], styles[tone]), props)} />\n </SeparatorContext>;\n}\n\n/**\n * The bar's element, with Home and End added to the keys React Aria handles,\n * then handed to the call site's own `render` if it passed one. React Aria's\n * toolbar passes no keyboard handler of the call site's through, so the\n * element it hands over carries none for this to compose with.\n */\nfunction toolbarRenderer(render: ToolbarRender): NonNullable<ToolbarRender> {\n return (domProps, renderProps) => {\n const merged = {\n ...domProps,\n onKeyDown: homeAndEnd\n };\n return render === undefined ? createElement('div', merged) : render(merged, renderProps);\n };\n}\nexport type { ToolbarProps, ToolbarTone };\nexport default Toolbar;"],"mappings":";;;;;;;;AAkEA,MAAMO,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,YAAY;EACVC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRR,OAAO;CACT;CACAS,SAAS;EACPC,QAAQ;EACRV,OAAO;CACT;CACAW,UAAU;EACRC,QAAQ;EACRR,QAAQ;EACRS,QAAQ;EACR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MAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAM,IAAA;EAApLG,KAAA,oBAAC,IAAD;GAAyBD,aAAAA;GAAW,GAAMG;GAAe,QAAAN;GAA6B,GAAMC;EAAwF,CAAA;EAAIN,EAAA,MAAAC;EAAAD,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAM;EAAAN,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,QAAAE,MAAAF,EAAA,QAAAO,MAAAP,EAAA,QAAAS,IAAA;EADrLC,KAAA,oBAAC,IAAD;GAAyBI,OAAAA;GAC5BL,UAAAA;EADoB,CAAA;EAEHT,EAAA,MAAAE;EAAAF,EAAA,MAAAO;EAAAP,EAAA,MAAAS;EAAAT,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAFdU;AAEc;;;;;;;AASvB,SAASK,gBAAgBC,QAAmD;CAC1E,QAAQC,UAAUC,gBAAgB;EAChC,MAAMC,SAAS;GACb,GAAGF;GACHG,WAAW5C;EACb;EACA,OAAOwC,WAAW1B,KAAAA,IAAY9D,cAAc,OAAO2F,MAAM,IAAIH,OAAOG,QAAQD,WAAW;CACzF;AACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ import SplitButton, { SplitButtonAction, SplitButtonActionProps, SplitButtonMenu
|
|
|
71
71
|
import Stack, { StackAlign, StackGap, StackJustify, StackProps } from "./components/stack/index.js";
|
|
72
72
|
import SupportingPane, { SupportingPaneProps } from "./components/supporting-pane/index.js";
|
|
73
73
|
import Switch, { SwitchProps } from "./components/switch/index.js";
|
|
74
|
-
import Table, { TableBody, TableBodyProps, TableCell, TableCellProps, TableColumn, TableColumnProps, TableFooter, TableFooterProps, TableHeader, TableHeaderProps, TableLoadMore, TableLoadMoreProps, TableProps, TableRow, TableRowProps } from "./components/table/index.js";
|
|
74
|
+
import Table, { TableAlign, TableBody, TableBodyProps, TableCell, TableCellProps, TableColumn, TableColumnProps, TableFooter, TableFooterProps, TableHeader, TableHeaderProps, TableLoadMore, TableLoadMoreProps, TableProps, TableRow, TableRowProps } from "./components/table/index.js";
|
|
75
75
|
import Tabs, { TabsLayout, TabsList, TabsListProps, TabsPanel, TabsPanelProps, TabsPanels, TabsPanelsProps, TabsProps, TabsTab, TabsTabProps, TabsVariant } from "./components/tabs/index.js";
|
|
76
76
|
import Tag, { TagProps, TagTone, TagVariant } from "./components/tag/index.js";
|
|
77
77
|
import Text, { TextProps } from "./components/text/index.js";
|
|
@@ -89,4 +89,4 @@ import { useDragAndDrop } from "./drag/hooks.js";
|
|
|
89
89
|
import { Collection, DIRECTORY_DRAG_TYPE, Focusable, FocusableElement, GridLayout, HoverEvent, I18nProvider, Key, KeyboardEvent, ListLayout, PressEvent, Pressable, RouterProvider, Selection, SharedElement, SharedElementTransition, SortDescriptor, TableLayout, TokenFieldValue, Virtualizer, VisuallyHidden, WaterfallLayout, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDrop, useFilter, useListData, useLocale, useTreeData } from "./react-aria.js";
|
|
90
90
|
import { t as KuiTheme } from "./kanso-ui-core/defaults-DMH0HWCw.js";
|
|
91
91
|
import { ThemeScope, ThemeScopeProps } from "./theme-scope.js";
|
|
92
|
-
export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselItemRenderProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipDropdownProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyDisplay, type CurrencyNotation, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Focusable, type FocusableElement, Form, type FormProps, GridLayout, type HoverEvent, I18nProvider, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type Key, type KeyboardEvent, Keycap, type KeycapProps, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, SharedElement, SharedElementTransition, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, type SortDescriptor, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLayout, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, TokenFieldValue, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, colorScheme, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, themeScope, useAppBarScroll, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
|
|
92
|
+
export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselItemRenderProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipDropdownProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyDisplay, type CurrencyNotation, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Focusable, type FocusableElement, Form, type FormProps, GridLayout, type HoverEvent, I18nProvider, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type Key, type KeyboardEvent, Keycap, type KeycapProps, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, SharedElement, SharedElementTransition, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, type SortDescriptor, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableAlign, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLayout, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, TokenFieldValue, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, colorScheme, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, themeScope, useAppBarScroll, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["colors","stateLayerOpacity","onSecondaryContainer","hover","focus","pressed","secondaryContainer","navigationItemStyles","fade","kIyJzY","k1ekBW","kAMwcw","$$css","icon","kGNEyG","k1xSpc","kGuDYH","kjj79g","itemDisabled","kMwMTN","kkrTdU","label","kXHlph","kORKVm","kg5iWk","khDVqt","link","kB7OPa","k3XXqK","kVAEAm","kMnn75","pill","kWkggS","kaIpWk","ringWeight","kMeerF","navigationListStyles","item","list","kH6xsr","kogj98","kmVPX3","barItemStyles","badgeMark","kSGwAc","kLqNvP","keTefX","indicator","kZKoxP","kmuXW","kzqmXN","indicatorCurrent","kVAM5u","ksu8eU","kMzoRj","indicatorFocused","indicatorFocusedCurrent","indicatorHovered","indicatorHoveredCurrent","indicatorPressed","indicatorPressedCurrent","indicatorRing","kjBf7l","kInvED","k5JduY","kSy8m5","kcktkL","kwXMNM","kCS8Yb","kXwgrk","kzQI83","kOIVth","kqGvvJ","kAzted","k7Eaqz","k8WAf4","kg3NbH","itemCurrent","itemFocused","itemFocusedCurrent","itemHovered","itemHoveredCurrent","itemPressed","itemPressedCurrent","itemRing","kMv6JI","k63SB2","kb6lSQ","kLWn49","ks0D6T","labelCurrent","listItem","collapsedItemStyles","expandedItemStyles","crampedBarItemStyles"],"sources":["../../src/navigation/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The destinations NavigationBar and NavigationRail both draw, in the three\n// forms the two pages give them. Apart from either component so the two\n// cannot drift, and outside `src/components` for the reason src/row gives.\n//\n// A vertical destination puts its icon in the page's 56dp by 32dp active\n// indicator with the label 4dp under it, in label medium: the navigation bar\n// below the medium breakpoint, and the collapsed rail. A horizontal one is a\n// pill holding the icon and the label side by side, 16dp in at either end:\n// the bar at and above the medium breakpoint at 40dp with 4dp between the\n// two, and the expanded rail at 56dp with 8dp between them, in label large.\n//\n// The current destination's pill is the secondary container, with its icon\n// in on secondary container and, under the pill, its label in secondary;\n// every other is on surface variant. A label set inside the pill, as a\n// horizontal destination sets it, takes on secondary container instead — the\n// library's own call. Secondary over secondary container is not a pair a\n// scheme is held to, and the Poster scheme's came to 4:1, short of the 4.5:1\n// text needs; on secondary container is the pair every scheme guarantees.\n//\n// The hover, focus and pressed layers are the on secondary container role\n// over whatever the pill is, at the pages' 8%, 10% and 10%, drawn on the\n// pill — the indicator in a vertical destination, the whole destination in a\n// horizontal one. They are applied in that order, so where two hold the\n// later wins, as the pages draw one layer at a time. A focused destination's\n// ring goes around the same pill; ./index.tsx says whose ring it is.\n//\n// A change from one of those states to another fades, over the pages' short\n// duration on the standard curve, rather than landing in one frame. A press\n// also draws the library's ripple over the pressed layer, clipped to the\n// pill: inside the indicator in a vertical destination, which positions it,\n// and across the whole destination in a horizontal one, whose indicator is\n// left unpositioned so the ripple fills the link and takes the indicator's\n// pill corner.\n//\n// Under forced colours the mode paints the secondary container over in its\n// background, which left the current destination looking like every other.\n// The pill takes a 2px border in `Highlight` there, which the mode keeps,\n// and a focused destination's ring doubles its weight, so the two marks\n// differ in shape and not in colour alone — see `ringWeight`.\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 pill's ground and the layers over it, written out whole for each\n// ground, since StyleX replaces a property whole.\nconst HOVERED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.hover} * 100%), transparent)`;\nconst FOCUSED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.focus} * 100%), transparent)`;\nconst PRESSED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.pressed} * 100%), transparent)`;\nconst HOVERED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.hover} * 100%), ${colors.secondaryContainer})`;\nconst FOCUSED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.focus} * 100%), ${colors.secondaryContainer})`;\nconst PRESSED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.pressed} * 100%), ${colors.secondaryContainer})`;\n\n// What every destination draws whatever its form.\nconst navigationItemStyles = {\n fade: {\n kIyJzY: \"x1qno0dh x12w9bfk\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n icon: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kGuDYH: \"x1pvqxga\",\n kjj79g: \"xl56j7k\",\n $$css: true\n },\n itemDisabled: {\n kMwMTN: \"x1gpw424 x1bhcspo\",\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n label: {\n kMwMTN: \"x1w5n3ug\",\n kXHlph: \"x101abm8\",\n kORKVm: \"xryxfnj\",\n kg5iWk: \"xlyipyv\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n link: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n k3XXqK: \"x1t137rt\",\n kVAEAm: \"x1n2onr6\",\n kMnn75: \"xkrqix3\",\n $$css: true\n },\n pill: {\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n ringWeight: {\n kMeerF: \"x1de99jn xlqle6p\",\n $$css: true\n }\n};\n\n// The list a bar or a rail holds its destinations in, and the item each\n// destination sits in — see `NavigationList` in ./index.tsx. The list clears\n// the margin, padding and markers a `<ul>` comes with, and each form gives\n// the space between its destinations as its `list`. The item takes the\n// destination's place in the bar's row or the rail's column, which each form\n// gives as its `listItem`, and the link fills it.\nconst navigationListStyles = {\n item: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n $$css: true\n },\n list: {\n kB7OPa: \"x9f619\",\n kH6xsr: \"x3ct3a4\",\n kogj98: \"x1ghz6dp\",\n kmVPX3: \"x1717udv\",\n $$css: true\n }\n};\n\n// The pages' least touch target, which a horizontal bar destination's 40dp\n// pill falls short of.\nconst TARGET_SIZE = '48px';\n\n// The navigation bar page's 64dp row, and the 40dp pill a horizontal\n// destination draws inside it.\nconst BAR_ROW = '64px';\nconst PILL = '40px';\n\n// The navigation bar's destination: vertical below the medium breakpoint and\n// horizontal at it and above, so every value that differs is a pair.\nconst barItemStyles = {\n badgeMark: {\n kSGwAc: \"xcspwbw\",\n kLqNvP: \"xty0069 x19sl9hu\",\n keTefX: \"xhi6r6q\",\n kVAEAm: \"x10l6tqk x15m4ytg\",\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x10w6t97 x10qpgbh\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x15yg21f x11lewyt\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6 xtke4eg\",\n $$css: true\n },\n indicatorCurrent: {\n kWkggS: \"x15dekr4 x8jqrm0\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck xnqlxux\",\n kMzoRj: \"x2h6xq1\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n kWkggS: \"x1syr9su x8jqrm0\",\n $$css: true\n },\n indicatorFocusedCurrent: {\n kWkggS: \"x1s5x49g x8jqrm0\",\n $$css: true\n },\n indicatorHovered: {\n kWkggS: \"x173luhf x8jqrm0\",\n $$css: true\n },\n indicatorHoveredCurrent: {\n kWkggS: \"x1fctxn6 x8jqrm0\",\n $$css: true\n },\n indicatorPressed: {\n kWkggS: \"x1rydsgj x8jqrm0\",\n $$css: true\n },\n indicatorPressedCurrent: {\n kWkggS: \"xzpauq9 x8jqrm0\",\n $$css: true\n },\n indicatorRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59 x1t601oj\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n item: {\n k5JduY: \"x1ktxc2h\",\n kSy8m5: \"xfmxh57\",\n kcktkL: \"xb7ltuz\",\n kwXMNM: \"x1j6awrg\",\n kZKoxP: \"xiioxts\",\n kaIpWk: \"x1dkaolv\",\n kCS8Yb: \"x1r8uery x1a6ly76\",\n kXwgrk: \"xdt5ytf xapwh9g\",\n kzQI83: \"x1iyjqo2 x10cb59y\",\n kOIVth: \"xzoy561\",\n kjj79g: \"xl56j7k\",\n kqGvvJ: \"x10im51j xap7i12\",\n kAzted: \"x8nclml xtyuij1\",\n k7Eaqz: \"xeuugli\",\n k8WAf4: \"x1t0vds8 x1nouyz5\",\n kg3NbH: \"xnjsko4 xze1m75\",\n $$css: true\n },\n itemCurrent: {\n kWkggS: \"xjbqb8w x1xec0pq\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"x1xldtvv x1wx4lrg\",\n kMzoRj: \"x2h6xq1\",\n $$css: true\n },\n itemFocused: {\n kWkggS: \"xjbqb8w xdodzsd\",\n $$css: true\n },\n itemFocusedCurrent: {\n kWkggS: \"xjbqb8w xnmt8re\",\n $$css: true\n },\n itemHovered: {\n kWkggS: \"xjbqb8w xdenq60\",\n $$css: true\n },\n itemHoveredCurrent: {\n kWkggS: \"xjbqb8w xjq3nej\",\n $$css: true\n },\n itemPressed: {\n kWkggS: \"xjbqb8w x7fq6vu\",\n $$css: true\n },\n itemPressedCurrent: {\n kWkggS: \"xjbqb8w x9wewpu\",\n $$css: true\n },\n itemRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x1t137rt xxgb522\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n label: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"xzakmg9 x16ybrrz\",\n $$css: true\n },\n list: {\n kOIVth: \"xxhr3t x110hqo6\",\n $$css: true\n },\n listItem: {\n kCS8Yb: \"x1r8uery x1a6ly76\",\n kzQI83: \"x1iyjqo2 x10cb59y\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n }\n};\n\n// The collapsed rail's destination: always vertical, the pitch from one to\n// the next the rail's 4dp gap.\nconst collapsedItemStyles = {\n badgeMark: {\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x10w6t97\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x15yg21f\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n indicatorCurrent: {\n kWkggS: \"x15dekr4\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x2h6xq1\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n kWkggS: \"x1syr9su\",\n $$css: true\n },\n indicatorFocusedCurrent: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n indicatorHovered: {\n kWkggS: \"x173luhf\",\n $$css: true\n },\n indicatorHoveredCurrent: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n indicatorPressed: {\n kWkggS: \"x1rydsgj\",\n $$css: true\n },\n indicatorPressedCurrent: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n item: {\n kXwgrk: \"xdt5ytf\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"xzoy561\",\n kzqmXN: \"xh8yej3\",\n kjj79g: \"xl56j7k\",\n k8WAf4: \"x1t0vds8\",\n kg3NbH: \"ximhkdq\",\n $$css: true\n },\n itemCurrent: {\n $$css: true\n },\n itemFocused: {\n $$css: true\n },\n itemFocusedCurrent: {\n $$css: true\n },\n itemHovered: {\n $$css: true\n },\n itemHoveredCurrent: {\n $$css: true\n },\n itemPressed: {\n $$css: true\n },\n itemPressedCurrent: {\n $$css: true\n },\n label: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"xzakmg9\",\n $$css: true\n },\n list: {\n kOIVth: \"xzoy561\",\n $$css: true\n },\n listItem: {\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xh8yej3\",\n $$css: true\n }\n};\n\n// The expanded rail's destination: always horizontal, a 56dp pill as wide as\n// what it holds.\nconst expandedItemStyles = {\n badgeMark: {\n kSGwAc: \"xqcrz7y\",\n kLqNvP: \"x1o0tod\",\n keTefX: \"x18xomjl\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n $$css: true\n },\n indicatorCurrent: {\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n $$css: true\n },\n indicatorFocusedCurrent: {\n $$css: true\n },\n indicatorHovered: {\n $$css: true\n },\n indicatorHoveredCurrent: {\n $$css: true\n },\n indicatorPressed: {\n $$css: true\n },\n indicatorPressedCurrent: {\n $$css: true\n },\n item: {\n kSGwAc: \"xqcrz7y\",\n kZKoxP: \"xnnlda6\",\n kaIpWk: \"x1dkaolv\",\n kXwgrk: \"x1q0g3np\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"x126z3so\",\n ks0D6T: \"x193iq5w\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n itemCurrent: {\n kWkggS: \"x15dekr4\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x2h6xq1\",\n $$css: true\n },\n itemFocused: {\n kWkggS: \"x1syr9su\",\n $$css: true\n },\n itemFocusedCurrent: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n itemHovered: {\n kWkggS: \"x173luhf\",\n $$css: true\n },\n itemHoveredCurrent: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n itemPressed: {\n kWkggS: \"x1rydsgj\",\n $$css: true\n },\n itemPressedCurrent: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n label: {\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n list: {\n $$css: true\n },\n listItem: {\n kSGwAc: \"xqcrz7y\",\n kmuXW: \"x2lah0s\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n }\n};\n\n// The bar's destination when the bar is too narrow for its horizontal form\n// at a width that would otherwise draw it — see NavigationBar. Vertical at\n// every width: the bar's own vertical item, with the collapsed rail's\n// indicator, label and badge placement, which are the bar's vertical ones.\nconst crampedBarItemStyles = {\n item: {\n kZKoxP: \"x5yr21d\",\n kaIpWk: \"x1dkaolv\",\n kCS8Yb: \"x1r8uery\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"xzoy561\",\n kjj79g: \"xl56j7k\",\n k7Eaqz: \"xeuugli\",\n k8WAf4: \"x1t0vds8\",\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n list: {\n kOIVth: \"xxhr3t\",\n $$css: true\n },\n listItem: {\n kCS8Yb: \"x1r8uery\",\n kzQI83: \"x1iyjqo2\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n }\n};\nexport { barItemStyles, collapsedItemStyles, crampedBarItemStyles, expandedItemStyles, navigationItemStyles, navigationListStyles };"],"mappings":";;AAoD6B,GAAsBA,OAAOE,uBAA6BD,kBAAkBE;AAC5E,GAAsBH,OAAOE,uBAA6BD,kBAAkBG;AAC5E,GAAsBJ,OAAOE,uBAA6BD,kBAAkBI;AAC5E,GAAsBL,OAAOE,uBAA6BD,kBAAkBE,QAAkBH,OAAOM;AACrG,GAAsBN,OAAOE,uBAA6BD,kBAAkBG,QAAkBJ,OAAOM;AACrG,GAAsBN,OAAOE,uBAA6BD,kBAAkBI,UAAoBL,OAAOM;AAGpI,MAAMC,uBAAuB;CAC3BC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;C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;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRtD,QAAQ;EACRyD,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRhE,OAAO;CACT;CACA0B,MAAM;EACJiC,QAAQ;EACR3D,OAAO;CACT;CACA+E,UAAU;EACRvB,QAAQ;EACRE,QAAQ;EACRI,QAAQ;EACR9D,OAAO;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"styles.js","names":["colors","stateLayerOpacity","onSecondaryContainer","hover","focus","pressed","secondaryContainer","navigationItemStyles","fade","kIyJzY","k1ekBW","kAMwcw","$$css","icon","kGNEyG","k1xSpc","kGuDYH","kjj79g","itemDisabled","kMwMTN","kkrTdU","label","kXHlph","kORKVm","kg5iWk","khDVqt","link","kB7OPa","k3XXqK","kVAEAm","kMnn75","pill","kWkggS","kaIpWk","ringWeight","kMeerF","navigationListStyles","item","list","kH6xsr","kogj98","kmVPX3","barItemStyles","badgeMark","kSGwAc","kLqNvP","keTefX","indicator","kZKoxP","kmuXW","kzqmXN","indicatorCurrent","kVAM5u","ksu8eU","kMzoRj","indicatorFocused","indicatorFocusedCurrent","indicatorHovered","indicatorHoveredCurrent","indicatorPressed","indicatorPressedCurrent","indicatorRing","kjBf7l","kInvED","k5JduY","kSy8m5","kcktkL","kwXMNM","kCS8Yb","kXwgrk","kzQI83","kOIVth","kqGvvJ","kAzted","k7Eaqz","k8WAf4","kg3NbH","itemCurrent","itemFocused","itemFocusedCurrent","itemHovered","itemHoveredCurrent","itemPressed","itemPressedCurrent","itemRing","kMv6JI","k63SB2","kb6lSQ","kLWn49","ks0D6T","labelCurrent","listItem","collapsedItemStyles","expandedItemStyles","crampedBarItemStyles"],"sources":["../../src/navigation/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The destinations NavigationBar and NavigationRail both draw, in the three\n// forms the two pages give them. Apart from either component so the two\n// cannot drift, and outside `src/components` for the reason src/row gives.\n//\n// A vertical destination puts its icon in the page's 56dp by 32dp active\n// indicator with the label 4dp under it, in label medium: the navigation bar\n// below the medium breakpoint, and the collapsed rail. A horizontal one is a\n// pill holding the icon and the label side by side, 16dp in at either end:\n// the bar at and above the medium breakpoint at 40dp with 4dp between the\n// two, and the expanded rail at 56dp with 8dp between them, in label large.\n//\n// The current destination's pill is the secondary container, with its icon\n// in on secondary container and, under the pill, its label in secondary;\n// every other is on surface variant. A label set inside the pill, as a\n// horizontal destination sets it, takes on secondary container instead — the\n// library's own call. Secondary over secondary container is not a pair a\n// scheme is held to, and the Poster scheme's came to 4:1, short of the 4.5:1\n// text needs; on secondary container is the pair every scheme guarantees.\n//\n// The hover, focus and pressed layers are the on secondary container role\n// over whatever the pill is, at the pages' 8%, 10% and 10%, drawn on the\n// pill — the indicator in a vertical destination, the whole destination in a\n// horizontal one. They are applied in that order, so where two hold the\n// later wins, as the pages draw one layer at a time. A focused destination's\n// ring goes around the same pill; ./index.tsx says whose ring it is.\n//\n// A change from one of those states to another fades, over the pages' short\n// duration on the standard curve, rather than landing in one frame. A press\n// also draws the library's ripple over the pressed layer, clipped to the\n// pill: inside the indicator in a vertical destination, which positions it,\n// and across the whole destination in a horizontal one, whose indicator is\n// left unpositioned so the ripple fills the link and takes the indicator's\n// pill corner.\n//\n// Under forced colours the mode paints the secondary container over in its\n// background, which left the current destination looking like every other.\n// The pill takes a 2px border in `Highlight` there, which the mode keeps,\n// and a focused destination's ring doubles its weight, so the two marks\n// differ in shape and not in colour alone — see `ringWeight`.\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 pill's ground and the layers over it, written out whole for each\n// ground, since StyleX replaces a property whole.\nconst HOVERED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.hover} * 100%), transparent)`;\nconst FOCUSED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.focus} * 100%), transparent)`;\nconst PRESSED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.pressed} * 100%), transparent)`;\nconst HOVERED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.hover} * 100%), ${colors.secondaryContainer})`;\nconst FOCUSED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.focus} * 100%), ${colors.secondaryContainer})`;\nconst PRESSED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.pressed} * 100%), ${colors.secondaryContainer})`;\n\n// What every destination draws whatever its form.\nconst navigationItemStyles = {\n fade: {\n kIyJzY: \"x1qno0dh x12w9bfk\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n icon: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kGuDYH: \"x1pvqxga\",\n kjj79g: \"xl56j7k\",\n $$css: true\n },\n itemDisabled: {\n kMwMTN: \"x1gpw424 x1bhcspo\",\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n label: {\n kMwMTN: \"x1w5n3ug\",\n kXHlph: \"x101abm8\",\n kORKVm: \"xryxfnj\",\n kg5iWk: \"xlyipyv\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n link: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n k3XXqK: \"x1t137rt\",\n kVAEAm: \"x1n2onr6\",\n kMnn75: \"xkrqix3\",\n $$css: true\n },\n pill: {\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n ringWeight: {\n kMeerF: \"x1de99jn xlqle6p\",\n $$css: true\n }\n};\n\n// The list a bar or a rail holds its destinations in, and the item each\n// destination sits in — see `NavigationList` in ./index.tsx. The list clears\n// the margin, padding and markers a `<ul>` comes with, and each form gives\n// the space between its destinations as its `list`. The item takes the\n// destination's place in the bar's row or the rail's column, which each form\n// gives as its `listItem`, and the link fills it.\nconst navigationListStyles = {\n item: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n $$css: true\n },\n list: {\n kB7OPa: \"x9f619\",\n kH6xsr: \"x3ct3a4\",\n kogj98: \"x1ghz6dp\",\n kmVPX3: \"x1717udv\",\n $$css: true\n }\n};\n\n// The pages' least touch target, which a horizontal bar destination's 40dp\n// pill falls short of.\nconst TARGET_SIZE = '48px';\n\n// The navigation bar page's 64dp row, and the 40dp pill a horizontal\n// destination draws inside it.\nconst BAR_ROW = '64px';\nconst PILL = '40px';\n\n// The navigation bar's destination: vertical below the medium breakpoint and\n// horizontal at it and above, so every value that differs is a pair.\nconst barItemStyles = {\n badgeMark: {\n kSGwAc: \"xcspwbw\",\n kLqNvP: \"xty0069 x19sl9hu\",\n keTefX: \"xhi6r6q\",\n kVAEAm: \"x10l6tqk x15m4ytg\",\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x10w6t97 x10qpgbh\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x15yg21f x11lewyt\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6 xtke4eg\",\n $$css: true\n },\n indicatorCurrent: {\n kWkggS: \"x15dekr4 x8jqrm0\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck xnqlxux\",\n kMzoRj: \"x2h6xq1\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n kWkggS: \"x1syr9su x8jqrm0\",\n $$css: true\n },\n indicatorFocusedCurrent: {\n kWkggS: \"x1s5x49g x8jqrm0\",\n $$css: true\n },\n indicatorHovered: {\n kWkggS: \"x173luhf x8jqrm0\",\n $$css: true\n },\n indicatorHoveredCurrent: {\n kWkggS: \"x1fctxn6 x8jqrm0\",\n $$css: true\n },\n indicatorPressed: {\n kWkggS: \"x1rydsgj x8jqrm0\",\n $$css: true\n },\n indicatorPressedCurrent: {\n kWkggS: \"xzpauq9 x8jqrm0\",\n $$css: true\n },\n indicatorRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59 x1t601oj\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n item: {\n k5JduY: \"x1ktxc2h\",\n kSy8m5: \"xfmxh57\",\n kcktkL: \"xb7ltuz\",\n kwXMNM: \"x1j6awrg\",\n kZKoxP: \"xiioxts\",\n kaIpWk: \"x1dkaolv\",\n kCS8Yb: \"x1r8uery x1a6ly76\",\n kXwgrk: \"xdt5ytf xapwh9g\",\n kzQI83: \"x1iyjqo2 x10cb59y\",\n kOIVth: \"xzoy561\",\n kjj79g: \"xl56j7k\",\n kqGvvJ: \"x10im51j xap7i12\",\n kAzted: \"x8nclml xtyuij1\",\n k7Eaqz: \"xeuugli\",\n k8WAf4: \"x1t0vds8 x1nouyz5\",\n kg3NbH: \"ximhkdq xze1m75\",\n $$css: true\n },\n itemCurrent: {\n kWkggS: \"xjbqb8w x1xec0pq\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"x1xldtvv x1wx4lrg\",\n kMzoRj: \"x2h6xq1\",\n $$css: true\n },\n itemFocused: {\n kWkggS: \"xjbqb8w xdodzsd\",\n $$css: true\n },\n itemFocusedCurrent: {\n kWkggS: \"xjbqb8w xnmt8re\",\n $$css: true\n },\n itemHovered: {\n kWkggS: \"xjbqb8w xdenq60\",\n $$css: true\n },\n itemHoveredCurrent: {\n kWkggS: \"xjbqb8w xjq3nej\",\n $$css: true\n },\n itemPressed: {\n kWkggS: \"xjbqb8w x7fq6vu\",\n $$css: true\n },\n itemPressedCurrent: {\n kWkggS: \"xjbqb8w x9wewpu\",\n $$css: true\n },\n itemRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x1t137rt xxgb522\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n label: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"xzakmg9 x16ybrrz\",\n $$css: true\n },\n list: {\n kOIVth: \"xxhr3t x110hqo6\",\n $$css: true\n },\n listItem: {\n kCS8Yb: \"x1r8uery x1a6ly76\",\n kzQI83: \"x1iyjqo2 x10cb59y\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n }\n};\n\n// The collapsed rail's destination: always vertical, the pitch from one to\n// the next the rail's 4dp gap.\nconst collapsedItemStyles = {\n badgeMark: {\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x10w6t97\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x15yg21f\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n indicatorCurrent: {\n kWkggS: \"x15dekr4\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x2h6xq1\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n kWkggS: \"x1syr9su\",\n $$css: true\n },\n indicatorFocusedCurrent: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n indicatorHovered: {\n kWkggS: \"x173luhf\",\n $$css: true\n },\n indicatorHoveredCurrent: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n indicatorPressed: {\n kWkggS: \"x1rydsgj\",\n $$css: true\n },\n indicatorPressedCurrent: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n item: {\n kXwgrk: \"xdt5ytf\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"xzoy561\",\n kzqmXN: \"xh8yej3\",\n kjj79g: \"xl56j7k\",\n k8WAf4: \"x1t0vds8\",\n kg3NbH: \"ximhkdq\",\n $$css: true\n },\n itemCurrent: {\n $$css: true\n },\n itemFocused: {\n $$css: true\n },\n itemFocusedCurrent: {\n $$css: true\n },\n itemHovered: {\n $$css: true\n },\n itemHoveredCurrent: {\n $$css: true\n },\n itemPressed: {\n $$css: true\n },\n itemPressedCurrent: {\n $$css: true\n },\n label: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"xzakmg9\",\n $$css: true\n },\n list: {\n kOIVth: \"xzoy561\",\n $$css: true\n },\n listItem: {\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xh8yej3\",\n $$css: true\n }\n};\n\n// The expanded rail's destination: always horizontal, a 56dp pill as wide as\n// what it holds.\nconst expandedItemStyles = {\n badgeMark: {\n kSGwAc: \"xqcrz7y\",\n kLqNvP: \"x1o0tod\",\n keTefX: \"x18xomjl\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n $$css: true\n },\n indicatorCurrent: {\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n $$css: true\n },\n indicatorFocusedCurrent: {\n $$css: true\n },\n indicatorHovered: {\n $$css: true\n },\n indicatorHoveredCurrent: {\n $$css: true\n },\n indicatorPressed: {\n $$css: true\n },\n indicatorPressedCurrent: {\n $$css: true\n },\n item: {\n kSGwAc: \"xqcrz7y\",\n kZKoxP: \"xnnlda6\",\n kaIpWk: \"x1dkaolv\",\n kXwgrk: \"x1q0g3np\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"x126z3so\",\n ks0D6T: \"x193iq5w\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n itemCurrent: {\n kWkggS: \"x15dekr4\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x2h6xq1\",\n $$css: true\n },\n itemFocused: {\n kWkggS: \"x1syr9su\",\n $$css: true\n },\n itemFocusedCurrent: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n itemHovered: {\n kWkggS: \"x173luhf\",\n $$css: true\n },\n itemHoveredCurrent: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n itemPressed: {\n kWkggS: \"x1rydsgj\",\n $$css: true\n },\n itemPressedCurrent: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n label: {\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n list: {\n $$css: true\n },\n listItem: {\n kSGwAc: \"xqcrz7y\",\n kmuXW: \"x2lah0s\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n }\n};\n\n// The bar's destination when the bar is too narrow for its horizontal form\n// at a width that would otherwise draw it — see NavigationBar. Vertical at\n// every width: the bar's own vertical item, with the collapsed rail's\n// indicator, label and badge placement, which are the bar's vertical ones.\nconst crampedBarItemStyles = {\n item: {\n kZKoxP: \"x5yr21d\",\n kaIpWk: \"x1dkaolv\",\n kCS8Yb: \"x1r8uery\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"xzoy561\",\n kjj79g: \"xl56j7k\",\n k7Eaqz: \"xeuugli\",\n k8WAf4: \"x1t0vds8\",\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n list: {\n kOIVth: \"xxhr3t\",\n $$css: true\n },\n listItem: {\n kCS8Yb: \"x1r8uery\",\n kzQI83: \"x1iyjqo2\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n }\n};\nexport { barItemStyles, collapsedItemStyles, crampedBarItemStyles, expandedItemStyles, navigationItemStyles, navigationListStyles };"],"mappings":";;AAoD6B,GAAsBA,OAAOE,uBAA6BD,kBAAkBE;AAC5E,GAAsBH,OAAOE,uBAA6BD,kBAAkBG;AAC5E,GAAsBJ,OAAOE,uBAA6BD,kBAAkBI;AAC5E,GAAsBL,OAAOE,uBAA6BD,kBAAkBE,QAAkBH,OAAOM;AACrG,GAAsBN,OAAOE,uBAA6BD,kBAAkBG,QAAkBJ,OAAOM;AACrG,GAAsBN,OAAOE,uBAA6BD,kBAAkBI,UAAoBL,OAAOM;AAGpI,MAAMC,uBAAuB;CAC3BC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,cAAc;EACZC,QAAQ;EACRC,QAAQ;EACRR,OAAO;CACT;CACAS,OAAO;EACLF,QAAQ;EACRG,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRb,OAAO;CACT;CACAc,MAAM;EACJZ,QAAQ;EACRa,QAAQ;EACRR,QAAQ;EACRC,QAAQ;EACRL,QAAQ;EACRa,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRlB,OAAO;CACT;CACAmB,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRN,QAAQ;EACRR,QAAQ;EACR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Q;EACRoC,QAAQ;EACRpB,OAAO;EACPsB,QAAQ;EACRkB,QAAQ;EACRb,QAAQ;EACRhE,OAAO;CACT;CACAiE,aAAa;EACX7C,QAAQ;EACRoB,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACR1C,OAAO;CACT;CACAkE,aAAa;EACX9C,QAAQ;EACRpB,OAAO;CACT;CACAmE,oBAAoB;EAClB/C,QAAQ;EACRpB,OAAO;CACT;CACAoE,aAAa;EACXhD,QAAQ;EACRpB,OAAO;CACT;CACAqE,oBAAoB;EAClBjD,QAAQ;EACRpB,OAAO;CACT;CACAsE,aAAa;EACXlD,QAAQ;EACRpB,OAAO;CACT;CACAuE,oBAAoB;EAClBnD,QAAQ;EACRpB,OAAO;CACT;CACAS,OAAO;EACLgE,QAAQ;EACRrE,QAAQ;EACRsE,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACR5E,OAAO;CACT;CACA8E,cAAc;EACZvE,QAAQ;EACRP,OAAO;CACT;CACA0B,MAAM,EACJ1B,OAAO,KACT;CACA+E,UAAU;EACR/C,QAAQ;EACRK,OAAO;EACPwC,QAAQ;EACR7E,OAAO;CACT;AACF;AAMA,MAAMkF,uBAAuB;CAC3BzD,MAAM;EACJW,QAAQ;EACRf,QAAQ;EACRmC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRtD,QAAQ;EACRyD,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRhE,OAAO;CACT;CACA0B,MAAM;EACJiC,QAAQ;EACR3D,OAAO;CACT;CACA+E,UAAU;EACRvB,QAAQ;EACRE,QAAQ;EACRI,QAAQ;EACR9D,OAAO;CACT;AACF"}
|
package/dist/segments/index.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
|
+
import { SegmentLiteral } from "./literal.js";
|
|
2
3
|
import { segmentStyles } from "./styles.js";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import { DateSegment } from "react-aria-components";
|
|
5
6
|
// src/segments/index.tsx
|
|
6
|
-
const UNSEEN = /^[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]*$/u;
|
|
7
|
-
const HANGING = /^[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]*\p{P}+\s+$/u;
|
|
8
7
|
function renderSegment(segment) {
|
|
9
|
-
if (segment.type === "literal") return /* @__PURE__ */ jsx(
|
|
10
|
-
...props(segmentStyles.segment, segmentStyles.segmentLiteral, !UNSEEN.test(segment.text) && segmentStyles.segmentSeparator, HANGING.test(segment.text) && segmentStyles.segmentSeparatorHanging),
|
|
11
|
-
segment
|
|
12
|
-
});
|
|
8
|
+
if (segment.type === "literal") return /* @__PURE__ */ jsx(SegmentLiteral, { segment });
|
|
13
9
|
return /* @__PURE__ */ jsx(DateSegment, {
|
|
14
10
|
className: segmentClassName,
|
|
15
11
|
segment
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["stylex","segmentStyles","
|
|
1
|
+
{"version":3,"file":"index.js","names":["stylex","segmentStyles","renderSegment","segment","type","segmentClassName","state","isDisabled","isFocused","isPlaceholder","segmentPlaceholder","segmentFocused","segmentDisabled","className","RACDateSegment"],"sources":["../../src/segments/index.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateInput as RACDateInput, DateSegment as RACDateSegment } from 'react-aria-components';\nimport { SegmentLiteral } from './literal';\nimport { segmentStyles } from './styles';\n\n// How a date or a time is drawn once React Aria has decided what its parts\n// are. Shared by DateField and TimeField, which differ only in the value they\n// hold: the segments, their order and their number all come from React Aria,\n// so what is here is the same for both.\n\n// What React Aria hands the input for each part of the date. Taken off the\n// component rather than imported, since the segment type is not on the\n// package's public surface.\ntype Segment = Parameters<NonNullable<Parameters<typeof RACDateInput>[0]['children']>>[0];\n\n// What each segment draws. A literal — the slash or colon between two\n// segments — takes a style of its own, since it is punctuation rather than\n// something a reader types into — see `SegmentLiteral`.\nfunction renderSegment(segment: Segment): ReactElement {\n if (segment.type === 'literal') {\n return <SegmentLiteral segment={segment} />;\n }\n return <RACDateSegment className={segmentClassName} segment={segment} />;\n}\n\n// A segment's classes, from React Aria's render state. StyleX cannot target\n// `[data-placeholder]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// The order matters: `disabled` is last, and StyleX replaces a property\n// whole, so it wins over both the placeholder and the focused branches.\nfunction segmentClassName(state: {\n isDisabled: boolean;\n isFocused: boolean;\n isPlaceholder: boolean;\n}) {\n return stylex.props(segmentStyles.segment, state.isPlaceholder && segmentStyles.segmentPlaceholder, state.isFocused && segmentStyles.segmentFocused, state.isDisabled && segmentStyles.segmentDisabled).className ?? '';\n}\nexport { renderSegment };"],"mappings":";;;;;;AAmBA,SAASE,cAAcC,SAAgC;CACrD,IAAIA,QAAQC,SAAS,WACnB,OAAO,oBAAC,gBAAD,EAAyBD,QAAQ,CAAA;CAE1C,OAAO,oBAACW,aAAD;EAAgB,WAAWT;EAA2BF;CAAQ,CAAA;AACvE;AAQA,SAASE,iBAAiBC,OAIvB;CACD,OAAON,MAAaC,cAAcE,SAASG,MAAMG,iBAAiBR,cAAcS,oBAAoBJ,MAAME,aAAaP,cAAcU,gBAAgBL,MAAMC,cAAcN,cAAcW,eAAe,CAAC,CAACC,aAAa;AACvN"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
|
+
import { segmentStyles } from "./styles.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { DateFieldStateContext, DateSegment } from "react-aria-components";
|
|
7
|
+
// src/segments/literal.tsx
|
|
8
|
+
const UNSEEN = /^[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]*$/u;
|
|
9
|
+
const HANGING = /^[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]*\p{P}+\s+$/u;
|
|
10
|
+
const DATE_PARTS = /* @__PURE__ */ new Set([
|
|
11
|
+
"day",
|
|
12
|
+
"era",
|
|
13
|
+
"month",
|
|
14
|
+
"year"
|
|
15
|
+
]);
|
|
16
|
+
function joinsDateToTime(segments, segment) {
|
|
17
|
+
const index = segments.indexOf(segment);
|
|
18
|
+
if (index === -1) return false;
|
|
19
|
+
let before;
|
|
20
|
+
for (let at = index - 1; at >= 0 && before === void 0; at -= 1) if (segments[at].type !== "literal") before = segments[at];
|
|
21
|
+
const after = segments.slice(index + 1).find((candidate) => candidate.type !== "literal");
|
|
22
|
+
return before !== void 0 && after !== void 0 && DATE_PARTS.has(before.type) && !DATE_PARTS.has(after.type);
|
|
23
|
+
}
|
|
24
|
+
function SegmentLiteral(t0) {
|
|
25
|
+
const $ = c(11);
|
|
26
|
+
const { segment } = t0;
|
|
27
|
+
const state = useContext(DateFieldStateContext);
|
|
28
|
+
let t1;
|
|
29
|
+
if ($[0] !== segment.text) {
|
|
30
|
+
t1 = UNSEEN.test(segment.text);
|
|
31
|
+
$[0] = segment.text;
|
|
32
|
+
$[1] = t1;
|
|
33
|
+
} else t1 = $[1];
|
|
34
|
+
const seen = !t1;
|
|
35
|
+
let T0;
|
|
36
|
+
let t2;
|
|
37
|
+
if ($[2] !== seen || $[3] !== segment || $[4] !== state) {
|
|
38
|
+
const hanging = HANGING.test(segment.text);
|
|
39
|
+
const joining = seen && !hanging && state !== null && joinsDateToTime(state.segments, segment);
|
|
40
|
+
T0 = DateSegment;
|
|
41
|
+
t2 = props(segmentStyles.segment, segmentStyles.segmentLiteral, seen && segmentStyles.segmentSeparator, hanging && segmentStyles.segmentSeparatorHanging, joining && segmentStyles.segmentSeparatorJoining);
|
|
42
|
+
$[2] = seen;
|
|
43
|
+
$[3] = segment;
|
|
44
|
+
$[4] = state;
|
|
45
|
+
$[5] = T0;
|
|
46
|
+
$[6] = t2;
|
|
47
|
+
} else {
|
|
48
|
+
T0 = $[5];
|
|
49
|
+
t2 = $[6];
|
|
50
|
+
}
|
|
51
|
+
let t3;
|
|
52
|
+
if ($[7] !== T0 || $[8] !== segment || $[9] !== t2) {
|
|
53
|
+
t3 = /* @__PURE__ */ jsx(T0, {
|
|
54
|
+
...t2,
|
|
55
|
+
segment
|
|
56
|
+
});
|
|
57
|
+
$[7] = T0;
|
|
58
|
+
$[8] = segment;
|
|
59
|
+
$[9] = t2;
|
|
60
|
+
$[10] = t3;
|
|
61
|
+
} else t3 = $[10];
|
|
62
|
+
return t3;
|
|
63
|
+
}
|
|
64
|
+
export { SegmentLiteral };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=literal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal.js","names":["stylex","useContext","DateFieldStateContext","RACDateSegment","segmentStyles","UNSEEN","HANGING","DATE_PARTS","Set","joinsDateToTime","segments","segment","index","indexOf","before","at","undefined","type","after","slice","find","candidate","has","SegmentLiteral","t0","$","_c","state","t1","text","test","seen","T0","t2","hanging","joining","segmentLiteral","segmentSeparator","segmentSeparatorHanging","segmentSeparatorJoining","t3"],"sources":["../../src/segments/literal.tsx"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { DateFieldStateContext, DateInput as RACDateInput, DateSegment as RACDateSegment } from 'react-aria-components';\nimport { segmentStyles } from './styles';\n\n// What React Aria hands the input for each part of the date. Taken off the\n// component rather than imported, since the segment type is not on the\n// package's public surface.\ntype Segment = Parameters<NonNullable<Parameters<typeof RACDateInput>[0]['children']>>[0];\n\n// The invisible marks that keep a value's direction, which a locale can put\n// at either end of it as a literal of their own.\nconst UNSEEN = /^[\\u061c\\u200e\\u200f\\u202a-\\u202e\\u2066-\\u2069]*$/u;\n\n// Punctuation followed by a space, as the comma between a date and its time\n// is written, in any script, once the direction marks are set aside.\nconst HANGING = /^[\\u061c\\u200e\\u200f\\u202a-\\u202e\\u2066-\\u2069]*\\p{P}+\\s+$/u;\n\n// The parts of a value that belong to its date rather than its time.\nconst DATE_PARTS: ReadonlySet<string> = new Set(['day', 'era', 'month', 'year']);\n\n// Whether `segment` is a literal standing between the last part of a date\n// and the first part of its time, read off the segments around it.\nfunction joinsDateToTime(segments: readonly Segment[], segment: Segment) {\n const index = segments.indexOf(segment);\n if (index === -1) {\n return false;\n }\n // Walked back by hand: `findLast` is ES2023, and the library compiles to\n // ES2022.\n let before: Segment | undefined;\n for (let at = index - 1; at >= 0 && before === undefined; at -= 1) {\n if (segments[at].type !== 'literal') {\n before = segments[at];\n }\n }\n const after = segments.slice(index + 1).find(candidate => candidate.type !== 'literal');\n return before !== undefined && after !== undefined && DATE_PARTS.has(before.type) && !DATE_PARTS.has(after.type);\n}\n\n// A literal between two segments, with the room either side of it only where\n// it takes up room: a direction mark at the start of a time is a literal too,\n// and spaced, it moved the value off the label's edge. A space is spaced like\n// a slash, since it is what stands between a time and its AM or PM, two\n// segments narrow enough to need that room as targets. A comma and its space\n// hang off the segment before them instead — see `segmentSeparatorHanging`.\n//\n// A space standing alone between a date and its time, as Japanese writes\n// one, takes the wider room of `segmentSeparatorJoining`. Which literal that\n// is depends on the segments either side, so it is read off the field's\n// state, which holds the same segment objects React Aria hands this. A\n// TimeField has no date, and leaves that state empty.\nfunction SegmentLiteral({\n segment\n}: {\n segment: Segment;\n}) {\n const state = useContext(DateFieldStateContext);\n const seen = !UNSEEN.test(segment.text);\n const hanging = HANGING.test(segment.text);\n const joining = seen && !hanging && state !== null && joinsDateToTime(state.segments, segment);\n return <RACDateSegment {...stylex.props(segmentStyles.segment, segmentStyles.segmentLiteral, seen && segmentStyles.segmentSeparator, hanging && segmentStyles.segmentSeparatorHanging, joining && segmentStyles.segmentSeparatorJoining)} segment={segment} />;\n}\nexport { SegmentLiteral };"],"mappings":";;;;;;;AAYA,MAAMK,SAAS;AAIf,MAAMC,UAAU;AAGhB,MAAMC,6BAAkC,IAAIC,IAAI;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W/B,cAAamC,uBAAwB;EAACd,EAAA,KAAAM;EAAAN,EAAA,KAAAd;EAAAc,EAAA,KAAAE;EAAAF,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;CAAA,OAAA;EAAAD,KAAAP,EAAA;EAAAQ,KAAAR,EAAA;CAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,OAAAO,MAAAP,EAAA,OAAAd,WAAAc,EAAA,OAAAQ,IAAA;EAAjOO,KAAA,oBAAC,IAAD;GAAe,GAAKP;GAAwNtB;EAAO,CAAA;EAAIc,EAAA,KAAAO;EAAAP,EAAA,KAAAd;EAAAc,EAAA,KAAAQ;EAAAR,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAAvPe;AAAuP"}
|
package/dist/segments/styles.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["segmentStyles","input","kGNEyG","kB7OPa","k1xSpc","k3XXqK","$$css","segment","kaIpWk","knGrYV","kMwMTN","kjBf7l","kInvED","kMeerF","kg3NbH","k9WMMc","segmentDisabled","segmentFocused","kWkggS","segmentLiteral","segmentPlaceholder","segmentSeparator","segmentSeparatorHanging","kZCmMZ"],"sources":["../../src/segments/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity } from '../tokens/design.tokens.stylex';\n\n// The segments a date or a time is typed into, shared by DateField and\n// TimeField. Apart from either component so the two cannot drift, and outside\n// `src/components` because a directory there is a public component with\n// stories, a barrel entry and a `styling.test.tsx` case — which shared styles\n// are none of.\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)';\nconst segmentStyles = {\n input: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n segment: {\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n knGrYV: \"xbuiw85\",\n kMwMTN: \"x139gbkf\",\n kjBf7l: \"x1x84bn5\",\n kInvED: \"xs9jlpd\",\n k3XXqK: \"x1t137rt xc0lcac x1894zjx\",\n kMeerF: \"x1jrff4x\",\n kg3NbH: \"xdomwbk\",\n k9WMMc: \"xp4054r\",\n $$css: true\n },\n segmentDisabled: {\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n segmentFocused: {\n kWkggS: \"xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n segmentLiteral: {\n kMwMTN: \"x1w5n3ug\",\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n segmentPlaceholder: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n segmentSeparator: {\n kg3NbH: \"ximhkdq\",\n $$css: true\n },\n segmentSeparatorHanging: {\n kZCmMZ: \"x1c1uobl\",\n $$css: true\n }\n};\nexport { segmentStyles };"],"mappings":";AAeA,MAAMA,gBAAgB;CACpBC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRL,QAAQ;EACRM,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,iBAAiB;EACfN,QAAQ;EACRJ,OAAO;CACT;CACAW,gBAAgB;EACdC,QAAQ;EACRR,QAAQ;EACRJ,OAAO;CACT;CACAa,gBAAgB;EACdT,QAAQ;EACRI,QAAQ;EACRR,OAAO;CACT;CACAc,oBAAoB;EAClBV,QAAQ;EACRJ,OAAO;CACT;CACAe,kBAAkB;EAChBP,QAAQ;EACRR,OAAO;CACT;CACAgB,yBAAyB;EACvBC,QAAQ;EACRjB,OAAO;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"styles.js","names":["segmentStyles","input","kGNEyG","kB7OPa","k1xSpc","k3XXqK","$$css","segment","kaIpWk","knGrYV","kMwMTN","kjBf7l","kInvED","kMeerF","kg3NbH","k9WMMc","segmentDisabled","segmentFocused","kWkggS","segmentLiteral","segmentPlaceholder","segmentSeparator","segmentSeparatorHanging","kZCmMZ","segmentSeparatorJoining"],"sources":["../../src/segments/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity } from '../tokens/design.tokens.stylex';\n\n// The segments a date or a time is typed into, shared by DateField and\n// TimeField. Apart from either component so the two cannot drift, and outside\n// `src/components` because a directory there is a public component with\n// stories, a barrel entry and a `styling.test.tsx` case — which shared styles\n// are none of.\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)';\nconst segmentStyles = {\n input: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n segment: {\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n knGrYV: \"xbuiw85\",\n kMwMTN: \"x139gbkf\",\n kjBf7l: \"x1x84bn5\",\n kInvED: \"xs9jlpd\",\n k3XXqK: \"x1t137rt xc0lcac x1894zjx\",\n kMeerF: \"x1jrff4x\",\n kg3NbH: \"xdomwbk\",\n k9WMMc: \"xp4054r\",\n $$css: true\n },\n segmentDisabled: {\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n segmentFocused: {\n kWkggS: \"xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n segmentLiteral: {\n kMwMTN: \"x1w5n3ug\",\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n segmentPlaceholder: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n segmentSeparator: {\n kg3NbH: \"ximhkdq\",\n $$css: true\n },\n segmentSeparatorHanging: {\n kZCmMZ: \"x1c1uobl\",\n $$css: true\n },\n segmentSeparatorJoining: {\n kg3NbH: \"xn60lsn\",\n $$css: true\n }\n};\nexport { segmentStyles };"],"mappings":";AAeA,MAAMA,gBAAgB;CACpBC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRL,QAAQ;EACRM,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,iBAAiB;EACfN,QAAQ;EACRJ,OAAO;CACT;CACAW,gBAAgB;EACdC,QAAQ;EACRR,QAAQ;EACRJ,OAAO;CACT;CACAa,gBAAgB;EACdT,QAAQ;EACRI,QAAQ;EACRR,OAAO;CACT;CACAc,oBAAoB;EAClBV,QAAQ;EACRJ,OAAO;CACT;CACAe,kBAAkB;EAChBP,QAAQ;EACRR,OAAO;CACT;CACAgB,yBAAyB;EACvBC,QAAQ;EACRjB,OAAO;CACT;CACAkB,yBAAyB;EACvBV,QAAQ;EACRR,OAAO;CACT;AACF"}
|