@kanso-labs/kanso-ui 0.45.28 → 0.45.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar/index.js +4 -4
- package/dist/calendar/index.js.map +1 -1
- package/dist/components/app-bar/index.js +1 -0
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +6 -6
- package/dist/components/autocomplete/index.js +4 -4
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/breadcrumbs/index.d.ts +5 -5
- package/dist/components/breadcrumbs/index.js +5 -5
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/button/index.d.ts +3 -3
- package/dist/components/button/index.js +2 -2
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +7 -7
- package/dist/components/calendar/index.js +4 -4
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/checkbox-group/index.d.ts +5 -5
- package/dist/components/checkbox-group/index.js +4 -4
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/color-area/index.d.ts +4 -4
- package/dist/components/color-area/index.js +4 -4
- package/dist/components/color-area/index.js.map +1 -1
- package/dist/components/color-field/index.d.ts +7 -7
- package/dist/components/color-field/index.js +4 -4
- package/dist/components/color-field/index.js.map +1 -1
- package/dist/components/color-picker/index.d.ts +4 -4
- package/dist/components/color-picker/index.js +4 -4
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-slider/index.d.ts +6 -6
- package/dist/components/color-slider/index.js +4 -4
- package/dist/components/color-slider/index.js.map +1 -1
- package/dist/components/color-swatch/index.d.ts +4 -4
- package/dist/components/color-swatch/index.js +4 -4
- package/dist/components/color-swatch/index.js.map +1 -1
- package/dist/components/color-swatch-picker/index.d.ts +12 -12
- package/dist/components/color-swatch-picker/index.js +7 -7
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/color-wheel/index.d.ts +6 -6
- package/dist/components/color-wheel/index.js +4 -4
- package/dist/components/color-wheel/index.js.map +1 -1
- package/dist/components/combo-box/index.d.ts +5 -5
- package/dist/components/combo-box/index.js +4 -4
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/date-field/index.d.ts +6 -6
- package/dist/components/date-field/index.js +4 -4
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-picker/index.d.ts +6 -6
- package/dist/components/date-picker/index.js +4 -4
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/date-range-picker/index.d.ts +6 -6
- package/dist/components/date-range-picker/index.js +4 -4
- package/dist/components/date-range-picker/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +6 -6
- package/dist/components/dialog/index.js +9 -9
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/disclosure/index.d.ts +10 -10
- package/dist/components/disclosure/index.js +8 -8
- package/dist/components/disclosure/index.js.map +1 -1
- package/dist/components/disclosure-group/index.d.ts +4 -4
- package/dist/components/disclosure-group/index.js +4 -4
- package/dist/components/disclosure-group/index.js.map +1 -1
- package/dist/components/drop-zone/index.d.ts +8 -8
- package/dist/components/drop-zone/index.js +6 -6
- package/dist/components/drop-zone/index.js.map +1 -1
- package/dist/components/form/index.d.ts +5 -5
- package/dist/components/form/index.js +4 -4
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/link/index.d.ts +6 -6
- package/dist/components/link/index.js +4 -4
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list-box/index.d.ts +18 -18
- package/dist/components/list-box/index.js +11 -11
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +16 -16
- package/dist/components/menu/index.js +14 -14
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +6 -6
- package/dist/components/meter/index.js +4 -4
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-tree/index.d.ts +15 -15
- package/dist/components/navigation-tree/index.js +13 -13
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +5 -5
- package/dist/components/number-field/index.js +4 -4
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popover/index.js +12 -12
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +5 -5
- package/dist/components/radio-group/index.js +4 -4
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +7 -7
- package/dist/components/range-calendar/index.js +4 -4
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +6 -6
- package/dist/components/search-field/index.js +4 -4
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/select/index.d.ts +5 -5
- package/dist/components/select/index.js +4 -4
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/separator/index.d.ts +5 -5
- package/dist/components/separator/index.js +4 -4
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +5 -5
- package/dist/components/sheet/index.js +12 -12
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/slider/index.d.ts +4 -4
- package/dist/components/slider/index.js +4 -4
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/table/index.d.ts +20 -20
- package/dist/components/table/index.js +17 -17
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.d.ts +5 -5
- package/dist/components/tabs/index.js +8 -8
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-area/index.d.ts +2 -2
- package/dist/components/text-area/index.js +2 -2
- package/dist/components/text-area/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +4 -4
- package/dist/components/text-field/index.js +4 -4
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/time-field/index.d.ts +6 -6
- package/dist/components/time-field/index.js +4 -4
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/token-field/index.d.ts +7 -7
- package/dist/components/token-field/index.js +4 -4
- package/dist/components/token-field/index.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +6 -6
- package/dist/components/toolbar/index.js +4 -4
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tooltip/index.js +4 -4
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tree/index.d.ts +17 -17
- package/dist/components/tree/index.js +14 -14
- package/dist/components/tree/index.js.map +1 -1
- package/dist/drag/hooks.d.ts +3 -3
- package/dist/drag/hooks.js +4 -4
- package/dist/drag/hooks.js.map +1 -1
- package/dist/drag/index.js +4 -4
- package/dist/drag/index.js.map +1 -1
- package/dist/react-aria.d.ts +2 -2
- package/dist/react-aria.js +2 -2
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","createContext","useContext","useEffect","useState","Tabs","RACTabs","Tab","refCallback","mergeStatefulStyles","mergeStyles","styles","indicator","k6CgDc","kWkggS","kZKoxP","kLZC3w","kPef9Z","kEafiO","kfmiAY","krdFHd","kB7OPa","kzqmXN","krVfgx","kkqhue","kUOVxO","k7Eaqz","kVAEAm","kIyJzY","k1ekBW","kAMwcw","$$css","indicatorSecondary","indicatorSecondaryVertical","kBCPoo","k8ry5P","ke9TFa","kYYq5F","kt4wiu","indicatorVertical","kVL7Gh","kqGvvJ","kAzted","label","kGNEyG","k1xSpc","kjj79g","ks0D6T","labelInline","kOIVth","labelStacked","kXwgrk","tab","kMzoRj","kMwMTN","kkrTdU","kCS8Yb","kzQI83","kmuXW","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kjBf7l","kInvED","k3XXqK","kMeerF","k8WAf4","kg3NbH","kybGjl","tabActive","tabActiveFocused","tabActiveHovered","tabActiveSecondary","tabDisabled","tabInactive","tabInactiveEngaged","tabInactiveFocused","tabInactiveHovered","tabPressed","tabScrollable","tabSecondaryFocused","tabSecondaryHovered","tabSecondaryPressed","tabStacked","tabVertical","VARIANTS","primary","active","activeFocused","activeHovered","inactiveFocused","inactiveHovered","horizontal","vertical","pressed","secondary","layout","orientation","variant","BarContext","revealed","WeakSet","NO_PANELS","Set","PanelsContext","RegisterPanelContext","id","children","badgeFor","badge","icon","undefined","className","revealInBar","element","closest","bar","first","has","add","box","getBoundingClientRect","room","left","Math","min","max","right","top","bottom","scrollBy","behavior","tabClasses","stacked","roles","state","engaged","isHovered","isFocusVisible","isPressed","props","isSelected","isDisabled","tabContent","hasIcon","after","underLabel","text","tabRenderer","hasPanel","render","domProps","adjusted","t0","$","t1","t2","t3","t4","panels","setPanels","t5","Symbol","for","previous","next","previous_0","next_0","delete","register","T0","t6","0","1","t7","t8","t9","t10","TabsList","2","3","TabsPanel","TabsPanels","TabsTab","ref","List","Panel","Panels","RACSelectionIndicator","RACTabPanels"],"sources":["../../../src/components/tabs/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { Key, TabsProps as RACTabsProps, TabListProps, TabPanelProps, TabPanelsProps, TabProps, TabRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport { SelectionIndicator as RACSelectionIndicator, TabPanels as RACTabPanels, Tabs as RACTabs, Tab, TabList, TabPanel } from 'react-aria-components';\nimport { refCallback } from '../../render/ref';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Badge from '../badge';\n\n// The tabs page's primary and secondary tabs. Both are a 48dp bar on the\n// surface, divided into equal sections, with a 1dp outline-variant divider\n// inside the bar along its bottom edge.\n//\n// **Primary** draws the active tab in the primary role and, under its label,\n// a 3dp primary indicator rounded along its top. The indicator follows the\n// label rather than the tab, inset 2dp from the label's ends and never\n// shorter than 24dp, which is what the page draws. A primary tab given an\n// icon stacks the page's 24dp icon over its label, 2dp apart, and the bar\n// grows to the page's 64dp.\n//\n// **Secondary** is the strip that sits under a primary one. Its active tab\n// keeps the on-surface role, and its 2dp primary indicator spans the whole\n// tab. An icon sits before the label, 8dp from it, which is the page's\n// spacing for an inline icon and material-web's layout for a secondary tab:\n// the strip keeps its 48dp under the primary one either way.\n//\n// A badge sits on the icon where a primary tab stacks one, placed as the\n// badges page places it, and 4dp after the label anywhere else.\n//\n// **The bar is equal sections unless `layout` says otherwise.**\n// `layout=\"scrollable\"` is the page's scrollable tabs: each tab as wide as\n// its label, between MDC-Android's 72dp and 264dp, in a bar that scrolls\n// without a scrollbar and brings the selected tab into view, as\n// material-web's does.\n//\n// **`orientation=\"vertical\"` turns the bar on its side.** The page draws no\n// vertical tabs, so this follows the horizontal bar's own measurements: the\n// tabs stack, the divider runs down the bar's inline end, and each\n// indicator lies along that edge — 3dp and rounded toward the tab on a\n// primary bar, 2dp and square on a secondary one — spanning the tab rather\n// than a label that no longer runs along it. The bar sits beside the panels\n// rather than above them.\n//\n// The indicator is React Aria's `SelectionIndicator`, which is a shared\n// element: it is rendered inside every tab but drawn in the selected one,\n// and on a change it keeps the old one until it has finished moving to the\n// new one's place. No `SharedElementTransition` is rendered here — `Tab`\n// scopes its own, and one added around the list changes nothing, which is\n// worth knowing because the primitive throws outside a scope when it is put\n// anywhere else.\n//\n// The label is wrapped in a span of its own so a primary indicator has the\n// label's width to follow: it is drawn inside the span, and the span is as\n// tall as the tab so the indicator reaches the bottom of the bar. Which tab\n// carries it comes from React Aria's render state rather than a selector,\n// since StyleX cannot target [data-selected] on the element it is styling.\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 styles = {\n indicator: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kZKoxP: \"xuoj239\",\n kLZC3w: \"x4hsqty\",\n kPef9Z: \"x4z998w\",\n kEafiO: \"x1cuxy5d\",\n kfmiAY: \"x1pixlao\",\n krdFHd: \"xyooppx\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"x17v02zk\",\n krVfgx: \"x1ey2m1c\",\n kkqhue: \"x17y0mx6\",\n kUOVxO: \"xvueqy4\",\n k7Eaqz: \"xnei2rj\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"x1mxbss1\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n indicatorSecondary: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kZKoxP: \"x36qwtl\",\n kLZC3w: \"x4hsqty\",\n kPef9Z: \"x4z998w\",\n kEafiO: \"x7sdbh0\",\n kB7OPa: \"x9f619\",\n krVfgx: \"x1ey2m1c\",\n kkqhue: \"x17y0mx6\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"x1mxbss1\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n indicatorSecondaryVertical: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kBCPoo: \"x1ksdfms\",\n k8ry5P: \"xf1j0q2\",\n ke9TFa: \"x12inkfj\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"xfo62xy\",\n kYYq5F: \"x10no89f\",\n kt4wiu: \"xtijo5x\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"xcxfjh9\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n indicatorVertical: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kZKoxP: \"x1qu6c4t\",\n kVL7Gh: \"x25gbn0\",\n kBCPoo: \"x1ksdfms\",\n k8ry5P: \"xf1j0q2\",\n ke9TFa: \"x1o9zed4\",\n krdFHd: \"xyooppx\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"x1g8rjiy\",\n kYYq5F: \"x10no89f\",\n kt4wiu: \"xtijo5x\",\n kqGvvJ: \"x1nkss2m\",\n kAzted: \"xjwf9q1\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"xcxfjh9\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n label: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x5yr21d\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kjj79g: \"xl56j7k\",\n ks0D6T: \"x193iq5w\",\n k7Eaqz: \"xeuugli\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n labelInline: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n labelStacked: {\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x14qo01y\",\n $$css: true\n },\n tab: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"x1r8uery\",\n kzQI83: \"x1iyjqo2\",\n kmuXW: \"xs83m0k\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kAzted: \"x1dry9sr\",\n k7Eaqz: \"xeuugli\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n k8WAf4: \"xt970qd\",\n kg3NbH: \"x790zyz\",\n kVAEAm: \"x1n2onr6\",\n kybGjl: \"x1hl2dhg\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n tabActive: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n tabActiveFocused: {\n kWkggS: \"x1sog3nf\",\n $$css: true\n },\n tabActiveHovered: {\n kWkggS: \"x659ado\",\n $$css: true\n },\n tabActiveSecondary: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n tabDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n tabInactive: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n tabInactiveEngaged: {\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n tabInactiveFocused: {\n kWkggS: \"xwqhyid\",\n $$css: true\n },\n tabInactiveHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n tabPressed: {\n kWkggS: \"x1dvjsmr\",\n $$css: true\n },\n tabScrollable: {\n kCS8Yb: \"xdl72j9\",\n kzQI83: \"x1c4vz4f\",\n kmuXW: \"x2lah0s\",\n ks0D6T: \"x1pdpmub\",\n k7Eaqz: \"x187xtus\",\n $$css: true\n },\n tabSecondaryFocused: {\n kWkggS: \"xwqhyid\",\n $$css: true\n },\n tabSecondaryHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n tabSecondaryPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n tabStacked: {\n kAzted: \"x8nclml\",\n $$css: true\n },\n tabVertical: {\n kCS8Yb: \"xdl72j9\",\n kzQI83: \"x1c4vz4f\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"x1nhvcw1\",\n $$css: true\n }\n};\n\n// A vertical bar beside its panels, which take the rest of the row. A style\n// of its own rather than one of the list's, since it is the root that holds\n// the two.\n\n/** The tabs page's two styles of tab bar. */\ntype TabsVariant = 'primary' | 'secondary';\n\n// What each style draws a tab's states in. A table rather than a branch per\n// state, so the two styles cannot differ in which states they answer.\nconst VARIANTS = {\n primary: {\n active: styles.tabActive,\n activeFocused: styles.tabActiveFocused,\n activeHovered: styles.tabActiveHovered,\n inactiveFocused: styles.tabInactiveFocused,\n inactiveHovered: styles.tabInactiveHovered,\n indicator: {\n horizontal: styles.indicator,\n vertical: styles.indicatorVertical\n },\n pressed: styles.tabPressed\n },\n secondary: {\n active: styles.tabActiveSecondary,\n activeFocused: styles.tabSecondaryFocused,\n activeHovered: styles.tabSecondaryHovered,\n inactiveFocused: styles.tabSecondaryFocused,\n inactiveHovered: styles.tabSecondaryHovered,\n indicator: {\n horizontal: styles.indicatorSecondary,\n vertical: styles.indicatorSecondaryVertical\n },\n pressed: styles.tabSecondaryPressed\n }\n} satisfies Record<TabsVariant, unknown>;\n\n// The bar's three decisions, from the root to the list and every tab in it.\n// A context rather than props on each part, since they are the bar's and\n// repeating them on every tab is how the two drift.\ntype Bar = {\n layout: TabsLayout;\n orientation: Orientation;\n variant: TabsVariant;\n};\ntype Orientation = NonNullable<RACTabsProps['orientation']>;\n\n/** How the bar shares its room among the tabs. */\ntype TabsLayout = 'fixed' | 'scrollable';\nconst BarContext = createContext<Bar>({\n layout: 'fixed',\n orientation: 'horizontal',\n variant: 'primary'\n});\n\n// The bars a reveal has already scrolled, so that only the first is instant.\nconst revealed = new WeakSet<Element>();\nconst NO_PANELS: ReadonlySet<Key> = new Set();\n\n// Which panels are mounted, by id. React Aria points a selected tab's\n// `aria-controls` at the panel it would control whether or not one exists,\n// and a strip used on its own — tabs that filter the content below rather\n// than swapping a panel — then references an id nothing carries, which axe\n// reports as an invalid attribute value. Each panel registers itself here so\n// a tab can leave the attribute off when its panel is not there.\nconst PanelsContext = createContext<ReadonlySet<Key>>(NO_PANELS);\nconst RegisterPanelContext = createContext<(id: Key) => () => void>(() => () => {});\n\n// `children` is narrowed to nodes. React Aria also accepts a function there,\n// to hand the children the tabs' render state, and that form cannot be\n// wrapped in a context provider without calling it first — which would be\n// doing React Aria's job with none of its state. Nothing here needs it, so\n// the narrower type says so rather than leaving a signature that type-checks\n// and then fails to render.\ntype TabsProps = Omit<RACTabsProps, 'children'> & {\n children?: ReactNode;\n /**\n * How the bar shares its room: `fixed` divides it into equal sections, and\n * `scrollable` gives each tab its label's width in a bar that scrolls,\n * which is the page's choice for more tabs than the room has sections for.\n * @default 'fixed'\n */\n layout?: TabsLayout;\n /**\n * Which of the page's two tab bars this is: `primary` for the main one,\n * `secondary` for a strip under a primary one.\n * @default 'primary'\n */\n variant?: TabsVariant;\n};\n\n// The badge, which wraps the icon where a primary tab stacks one and stands\n// after the label anywhere else: `true` for the small dot, a number for the\n// large badge, and nothing for `false`.\nfunction badgeFor(badge: boolean | number | undefined, icon?: ReactNode): ReactNode {\n if (badge === undefined || badge === false) {\n return icon ?? null;\n }\n return <Badge count={badge === true ? undefined : badge} {...{\n 0: {},\n 1: {\n className: \"x2lah0s\"\n }\n }[!!(icon === undefined) << 0]}>\n {icon}\n </Badge>;\n}\n\n// Scrolls a scrollable bar just far enough to show its selected tab whole,\n// handed to the selected tab's label as a ref so it runs as that tab\n// becomes the selected one. The bar alone, never the page: `scrollIntoView`\n// would scroll every scrolling ancestor, the window included, to bring a\n// bar below the fold up to it. The first reveal is instant, so a bar opens\n// on its selected tab rather than sliding to it; the rest take the bar's own\n// smooth scrolling.\nfunction revealInBar(element: HTMLElement | null) {\n const tab = element?.closest('[role=\"tab\"]');\n const bar = tab?.closest('[role=\"tablist\"]');\n if (tab === undefined || tab === null || bar === undefined || bar === null) {\n return;\n }\n const first = !revealed.has(bar);\n revealed.add(bar);\n const box = tab.getBoundingClientRect();\n const room = bar.getBoundingClientRect();\n const left = Math.min(0, box.left - room.left) + Math.max(0, box.right - room.right);\n const top = Math.min(0, box.top - room.top) + Math.max(0, box.bottom - room.bottom);\n if (left !== 0 || top !== 0) {\n bar.scrollBy({\n behavior: first ? 'instant' : 'auto',\n left,\n top\n });\n }\n}\n\n// StyleX cannot target [data-selected] on the element it is styling, so the\n// active tab cannot be chosen in CSS. React Aria's answer is a className that\n// is a function of the tab's own state, the same mechanism Chip uses —\n// mergeStatefulStyles wraps this one so a tab still keeps a className the call\n// site passed.\nfunction tabClasses({\n layout,\n orientation,\n variant\n}: Bar, stacked: boolean) {\n const roles = VARIANTS[variant];\n const vertical = orientation === 'vertical';\n return (state: TabRenderProps) => {\n const engaged = state.isHovered || state.isFocusVisible || state.isPressed;\n\n // The layers in rising order, so a press shows over a focused tab and\n // focus over a hovered one.\n return stylex.props(styles.tab, layout === 'scrollable' && !vertical && styles.tabScrollable, vertical && styles.tabVertical, stacked && styles.tabStacked, state.isSelected ? roles.active : styles.tabInactive, !state.isSelected && engaged && styles.tabInactiveEngaged, state.isHovered && (state.isSelected ? roles.activeHovered : roles.inactiveHovered), state.isFocusVisible && (state.isSelected ? roles.activeFocused : roles.inactiveFocused), state.isPressed && roles.pressed, state.isDisabled && styles.tabDisabled);\n };\n}\n\n// The tab's content: the icon, if any, then the label, wrapped so the\n// indicator has its width to follow. A badge after the label shares a line\n// with it, which is the one wrapper a tab without one goes without. Built by\n// a call for the same reason as `tabRenderer` below; React Aria hands the\n// function the tab's state, and it is passed on when the children are a\n// function too.\nfunction tabContent(children: TabProps['children'], {\n layout,\n orientation,\n variant\n}: Bar, icon: ReactNode, badge: boolean | number | undefined) {\n const hasIcon = icon !== undefined && icon !== null;\n const stacked = hasIcon && variant === 'primary';\n const after = stacked ? null : badgeFor(badge);\n const indicator = <RACSelectionIndicator {...stylex.props(VARIANTS[variant].indicator[orientation])} />;\n // A primary indicator follows the label along a horizontal bar, and lies\n // along the tab's edge everywhere else.\n const underLabel = variant === 'primary' && orientation === 'horizontal';\n return (state: TabRenderProps & {\n defaultChildren: ReactNode;\n }) => {\n const text = <span {...{\n 0: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub x1h7i4cw\"\n },\n 2: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub xh0615m\"\n },\n 1: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub x1h7i4cw x1yc453h\"\n },\n 3: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub xh0615m x1yc453h\"\n }\n }[!!stacked << 1 | !!(orientation === 'vertical') << 0]}>\n {typeof children === 'function' ? children(state) : children}\n </span>;\n return <>\n <span ref={layout === 'scrollable' && state.isSelected ? revealInBar : undefined} {...stylex.props(styles.label, hasIcon && (stacked ? styles.labelStacked : styles.labelInline))}>\n {hasIcon ? <span className=\"x6s0dn4 xxk0z11 x3nfvp2 x2lah0s x1pvqxga xvy4d1p xl56j7k\">\n {stacked ? badgeFor(badge, icon) : icon}\n </span> : null}\n {after === null ? text : <span className=\"x6s0dn4 x9f619 x3nfvp2 xzoy561 x193iq5w xeuugli\">\n {text}\n {after}\n </span>}\n {underLabel ? indicator : null}\n </span>\n {underLabel ? null : indicator}\n </>;\n };\n}\n\n// React Aria renders a tab with `href` as an anchor and any other as a div,\n// and expects a `render` function to return the same element it would have.\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 two inputs. See PanelsContext for why the attribute is\n// dropped.\nfunction tabRenderer(hasPanel: boolean, render: TabProps['render']): NonNullable<TabProps['render']> {\n return (domProps, state) => {\n const adjusted = hasPanel ? domProps : {\n ...domProps,\n 'aria-controls': undefined\n };\n if (render !== undefined) {\n return render(adjusted, state);\n }\n if ('href' in adjusted) {\n // oxlint-disable-next-line jsx-a11y/anchor-has-content -- filled by React Aria\n return <a {...adjusted} />;\n }\n return <div {...adjusted} />;\n };\n}\n\n/**\n * A tab bar and its panels. Selection is React Aria's `selectedKey`: pass\n * it with `onSelectionChange` to control it, or `defaultSelectedKey` to let\n * it keep its own. Each `Tabs.Tab` names the `Tabs.Panel` it controls through\n * a shared `id`, and a strip may stand alone without panels.\n *\n * Composed rather than configured by props, because the number of tabs and\n * what each panel holds are the call site's to decide — the parts are\n * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.\n */\nfunction Tabs({\n children,\n layout = 'fixed',\n orientation = 'horizontal',\n variant = 'primary',\n ...props\n}: RefAttributes<HTMLDivElement> & TabsProps) {\n const bar = useMemo(() => ({\n layout,\n orientation,\n variant\n }), [layout, orientation, variant]);\n const [panels, setPanels] = useState<ReadonlySet<Key>>(NO_PANELS);\n const register = useCallback((id: Key) => {\n setPanels(previous => {\n if (previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.add(id);\n return next;\n });\n return () => {\n setPanels(previous => {\n if (!previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.delete(id);\n return next;\n });\n };\n }, []);\n return <RACTabs {...props} orientation={orientation} {...mergeStatefulStyles({\n 0: {},\n 1: {\n className: \"x78zum5\"\n }\n }[!!(orientation === 'vertical') << 0], props)}>\n <RegisterPanelContext value={register}>\n <PanelsContext value={panels}>\n <BarContext value={bar}>{children}</BarContext>\n </PanelsContext>\n </RegisterPanelContext>\n </RACTabs>;\n}\nfunction TabsList(props: RefAttributes<HTMLDivElement> & TabsListProps) {\n const {\n layout,\n orientation\n } = useContext(BarContext);\n return <TabList {...props} {...mergeStatefulStyles({\n 0: {\n className: \"xp05xdj x9f619 x78zum5\"\n },\n 2: {\n className: \"xp05xdj x9f619 x78zum5 xfk6m8 xysyzu8 x1rohswg xkcv6ua xg83hb1\"\n },\n 1: {\n className: \"x9f619 x78zum5 x1kbcym6 xiwn18o xdt5ytf x2lah0s\"\n },\n 3: {\n className: \"x9f619 x78zum5 xfk6m8 xysyzu8 x1rohswg xkcv6ua xg83hb1 x1kbcym6 xiwn18o xdt5ytf x2lah0s\"\n }\n }[!!(layout === 'scrollable') << 1 | !!(orientation === 'vertical') << 0], props)} />;\n}\nfunction TabsPanel(props: RefAttributes<HTMLDivElement> & TabsPanelProps) {\n const register = useContext(RegisterPanelContext);\n const {\n id\n } = props;\n useEffect(() => {\n if (id === undefined) {\n return undefined;\n }\n return register(id);\n }, [id, register]);\n return <TabPanel {...props} {...mergeStatefulStyles({\n className: \"x9f619 x1iyjqo2 xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn\"\n }, props)} />;\n}\n\n/**\n * An optional box around the panels, which animates its height as one panel\n * gives way to the next. Without it the panels still work; the box around\n * them simply jumps from one height to the other.\n */\nfunction TabsPanels(props: RefAttributes<HTMLDivElement> & TabsPanelsProps) {\n return <RACTabPanels {...props} {...mergeStyles({\n className: \"x12w9bfk x1t2j4n3 x9f619 x1iyjqo2 xeuugli x7giv3 x1hm618n xioksi3 x1f55p5c x1seskgd\"\n }, props)} />;\n}\nfunction TabsTab({\n badge,\n children,\n icon,\n ref,\n render,\n ...props\n}: RefAttributes<HTMLAnchorElement | HTMLDivElement> & TabsTabProps) {\n const panels = useContext(PanelsContext);\n const bar = useContext(BarContext);\n const hasPanel = props.id !== undefined && panels.has(props.id);\n const stacked = icon !== undefined && icon !== null && bar.variant === 'primary';\n return <Tab {...props}\n // A tab with `href` is an anchor and any other a div, so the ref is\n // typed as either and handed over as the callback both accept — see\n // src/render/ref.ts.\n ref={refCallback(ref)} render={tabRenderer(hasPanel, render)} {...mergeStatefulStyles(tabClasses(bar, stacked), props)}>\n {tabContent(children, bar, icon, badge)}\n </Tab>;\n}\nTabs.List = TabsList;\nTabs.Panel = TabsPanel;\nTabs.Panels = TabsPanels;\nTabs.Tab = TabsTab;\ntype TabsListProps = TabListProps<object>;\ntype TabsPanelProps = TabPanelProps;\ntype TabsPanelsProps = Omit<TabPanelsProps<object>, 'children'> & {\n children?: ReactNode;\n};\ntype TabsTabProps = {\n /**\n * A badge on the tab: `true` for the badges page's small dot, a number for\n * the large badge holding it. It sits on a primary tab's icon, and after\n * the label anywhere else. The badge is hidden from assistive technology,\n * so say what it says in the tab's name too — \"First item, 3 new\".\n */\n badge?: boolean | number;\n /**\n * An icon with the label, at the page's 24dp: over it on a primary tab,\n * whose bar grows to 64dp, and before it on a secondary one. An icon drawn\n * in `em` takes its size from the slot.\n */\n icon?: ReactNode;\n} & TabProps;\nexport type { TabsLayout, TabsListProps, TabsPanelProps, TabsPanelsProps, Tab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AAAI,IAAA;EALpCG,KAAA,oBAAC,IAAD;GAAI,GAAKrB;GAIX,KAAAe;GAA0B,QAAAC;GAA6B,GAAMC;GAC7DC,UAAAA;EALM,CAAA;EAMHJ,EAAA,KAAAgB;EAAAhB,EAAA,KAAAd;EAAAc,EAAA,KAAAC;EAAAD,EAAA,MAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OANDO;AAMC;AAEV9J,OAAKsL,OAAOP;AACZ/K,OAAKuL,QAAQL;AACblL,OAAKwL,SAASL;AACdnL,OAAKE,MAAMkL"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","createContext","useContext","useEffect","useState","Tabs","RACTabs","Tab","refCallback","mergeStatefulStyles","mergeStyles","styles","indicator","k6CgDc","kWkggS","kZKoxP","kLZC3w","kPef9Z","kEafiO","kfmiAY","krdFHd","kB7OPa","kzqmXN","krVfgx","kkqhue","kUOVxO","k7Eaqz","kVAEAm","kIyJzY","k1ekBW","kAMwcw","$$css","indicatorSecondary","indicatorSecondaryVertical","kBCPoo","k8ry5P","ke9TFa","kYYq5F","kt4wiu","indicatorVertical","kVL7Gh","kqGvvJ","kAzted","label","kGNEyG","k1xSpc","kjj79g","ks0D6T","labelInline","kOIVth","labelStacked","kXwgrk","tab","kMzoRj","kMwMTN","kkrTdU","kCS8Yb","kzQI83","kmuXW","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kjBf7l","kInvED","k3XXqK","kMeerF","k8WAf4","kg3NbH","kybGjl","tabActive","tabActiveFocused","tabActiveHovered","tabActiveSecondary","tabDisabled","tabInactive","tabInactiveEngaged","tabInactiveFocused","tabInactiveHovered","tabPressed","tabScrollable","tabSecondaryFocused","tabSecondaryHovered","tabSecondaryPressed","tabStacked","tabVertical","VARIANTS","primary","active","activeFocused","activeHovered","inactiveFocused","inactiveHovered","horizontal","vertical","pressed","secondary","layout","orientation","variant","BarContext","revealed","WeakSet","NO_PANELS","Set","PanelsContext","RegisterPanelContext","id","children","badgeFor","badge","icon","undefined","className","revealInBar","element","closest","bar","first","has","add","box","getBoundingClientRect","room","left","Math","min","max","right","top","bottom","scrollBy","behavior","tabClasses","stacked","roles","state","engaged","isHovered","isFocusVisible","isPressed","props","isSelected","isDisabled","tabContent","hasIcon","after","underLabel","text","tabRenderer","hasPanel","render","domProps","adjusted","t0","$","t1","t2","t3","t4","panels","setPanels","t5","Symbol","for","previous","next","previous_0","next_0","delete","register","T0","t6","0","1","t7","t8","t9","t10","TabsList","2","3","TabsPanel","TabsPanels","TabsTab","ref","List","Panel","Panels","RACSelectionIndicator","RACTabPanels"],"sources":["../../../src/components/tabs/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { Key, TabsProps as RACTabsProps, TabListProps, TabPanelProps, TabPanelsProps, TabProps, TabRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport { SelectionIndicator as RACSelectionIndicator, TabPanels as RACTabPanels, Tabs as RACTabs, Tab, TabList, TabPanel } from 'react-aria-components';\nimport { refCallback } from '../../render/ref';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Badge from '../badge';\n\n// The tabs page's primary and secondary tabs. Both are a 48dp bar on the\n// surface, divided into equal sections, with a 1dp outline-variant divider\n// inside the bar along its bottom edge.\n//\n// **Primary** draws the active tab in the primary role and, under its label,\n// a 3dp primary indicator rounded along its top. The indicator follows the\n// label rather than the tab, inset 2dp from the label's ends and never\n// shorter than 24dp, which is what the page draws. A primary tab given an\n// icon stacks the page's 24dp icon over its label, 2dp apart, and the bar\n// grows to the page's 64dp.\n//\n// **Secondary** is the strip that sits under a primary one. Its active tab\n// keeps the on-surface role, and its 2dp primary indicator spans the whole\n// tab. An icon sits before the label, 8dp from it, which is the page's\n// spacing for an inline icon and material-web's layout for a secondary tab:\n// the strip keeps its 48dp under the primary one either way.\n//\n// A badge sits on the icon where a primary tab stacks one, placed as the\n// badges page places it, and 4dp after the label anywhere else.\n//\n// **The bar is equal sections unless `layout` says otherwise.**\n// `layout=\"scrollable\"` is the page's scrollable tabs: each tab as wide as\n// its label, between MDC-Android's 72dp and 264dp, in a bar that scrolls\n// without a scrollbar and brings the selected tab into view, as\n// material-web's does.\n//\n// **`orientation=\"vertical\"` turns the bar on its side.** The page draws no\n// vertical tabs, so this follows the horizontal bar's own measurements: the\n// tabs stack, the divider runs down the bar's inline end, and each\n// indicator lies along that edge — 3dp and rounded toward the tab on a\n// primary bar, 2dp and square on a secondary one — spanning the tab rather\n// than a label that no longer runs along it. The bar sits beside the panels\n// rather than above them.\n//\n// The indicator is React Aria's `SelectionIndicator`, which is a shared\n// element: it is rendered inside every tab but drawn in the selected one,\n// and on a change it keeps the old one until it has finished moving to the\n// new one's place. No `SharedElementTransition` is rendered here — `Tab`\n// scopes its own, and one added around the list changes nothing, which is\n// worth knowing because the primitive throws outside a scope when it is put\n// anywhere else.\n//\n// The label is wrapped in a span of its own so a primary indicator has the\n// label's width to follow: it is drawn inside the span, and the span is as\n// tall as the tab so the indicator reaches the bottom of the bar. Which tab\n// carries it comes from React Aria's render state rather than a selector,\n// since StyleX cannot target [data-selected] on the element it is styling.\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 styles = {\n indicator: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kZKoxP: \"xuoj239\",\n kLZC3w: \"x4hsqty\",\n kPef9Z: \"x4z998w\",\n kEafiO: \"x1cuxy5d\",\n kfmiAY: \"x1pixlao\",\n krdFHd: \"xyooppx\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"x17v02zk\",\n krVfgx: \"x1ey2m1c\",\n kkqhue: \"x17y0mx6\",\n kUOVxO: \"xvueqy4\",\n k7Eaqz: \"xnei2rj\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"x1mxbss1\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n indicatorSecondary: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kZKoxP: \"x36qwtl\",\n kLZC3w: \"x4hsqty\",\n kPef9Z: \"x4z998w\",\n kEafiO: \"x7sdbh0\",\n kB7OPa: \"x9f619\",\n krVfgx: \"x1ey2m1c\",\n kkqhue: \"x17y0mx6\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"x1mxbss1\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n indicatorSecondaryVertical: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kBCPoo: \"x1ksdfms\",\n k8ry5P: \"xf1j0q2\",\n ke9TFa: \"x12inkfj\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"xfo62xy\",\n kYYq5F: \"x10no89f\",\n kt4wiu: \"xtijo5x\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"xcxfjh9\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n indicatorVertical: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kZKoxP: \"x1qu6c4t\",\n kVL7Gh: \"x25gbn0\",\n kBCPoo: \"x1ksdfms\",\n k8ry5P: \"xf1j0q2\",\n ke9TFa: \"x1o9zed4\",\n krdFHd: \"xyooppx\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"x1g8rjiy\",\n kYYq5F: \"x10no89f\",\n kt4wiu: \"xtijo5x\",\n kqGvvJ: \"x1nkss2m\",\n kAzted: \"xjwf9q1\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"xcxfjh9\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n label: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x5yr21d\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kjj79g: \"xl56j7k\",\n ks0D6T: \"x193iq5w\",\n k7Eaqz: \"xeuugli\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n labelInline: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n labelStacked: {\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x14qo01y\",\n $$css: true\n },\n tab: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"x1r8uery\",\n kzQI83: \"x1iyjqo2\",\n kmuXW: \"xs83m0k\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kAzted: \"x1dry9sr\",\n k7Eaqz: \"xeuugli\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n k8WAf4: \"xt970qd\",\n kg3NbH: \"x790zyz\",\n kVAEAm: \"x1n2onr6\",\n kybGjl: \"x1hl2dhg\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n tabActive: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n tabActiveFocused: {\n kWkggS: \"x1sog3nf\",\n $$css: true\n },\n tabActiveHovered: {\n kWkggS: \"x659ado\",\n $$css: true\n },\n tabActiveSecondary: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n tabDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n tabInactive: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n tabInactiveEngaged: {\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n tabInactiveFocused: {\n kWkggS: \"xwqhyid\",\n $$css: true\n },\n tabInactiveHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n tabPressed: {\n kWkggS: \"x1dvjsmr\",\n $$css: true\n },\n tabScrollable: {\n kCS8Yb: \"xdl72j9\",\n kzQI83: \"x1c4vz4f\",\n kmuXW: \"x2lah0s\",\n ks0D6T: \"x1pdpmub\",\n k7Eaqz: \"x187xtus\",\n $$css: true\n },\n tabSecondaryFocused: {\n kWkggS: \"xwqhyid\",\n $$css: true\n },\n tabSecondaryHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n tabSecondaryPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n tabStacked: {\n kAzted: \"x8nclml\",\n $$css: true\n },\n tabVertical: {\n kCS8Yb: \"xdl72j9\",\n kzQI83: \"x1c4vz4f\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"x1nhvcw1\",\n $$css: true\n }\n};\n\n// A vertical bar beside its panels, which take the rest of the row. A style\n// of its own rather than one of the list's, since it is the root that holds\n// the two.\n\n/** The tabs page's two styles of tab bar. */\ntype TabsVariant = 'primary' | 'secondary';\n\n// What each style draws a tab's states in. A table rather than a branch per\n// state, so the two styles cannot differ in which states they answer.\nconst VARIANTS = {\n primary: {\n active: styles.tabActive,\n activeFocused: styles.tabActiveFocused,\n activeHovered: styles.tabActiveHovered,\n inactiveFocused: styles.tabInactiveFocused,\n inactiveHovered: styles.tabInactiveHovered,\n indicator: {\n horizontal: styles.indicator,\n vertical: styles.indicatorVertical\n },\n pressed: styles.tabPressed\n },\n secondary: {\n active: styles.tabActiveSecondary,\n activeFocused: styles.tabSecondaryFocused,\n activeHovered: styles.tabSecondaryHovered,\n inactiveFocused: styles.tabSecondaryFocused,\n inactiveHovered: styles.tabSecondaryHovered,\n indicator: {\n horizontal: styles.indicatorSecondary,\n vertical: styles.indicatorSecondaryVertical\n },\n pressed: styles.tabSecondaryPressed\n }\n} satisfies Record<TabsVariant, unknown>;\n\n// The bar's three decisions, from the root to the list and every tab in it.\n// A context rather than props on each part, since they are the bar's and\n// repeating them on every tab is how the two drift.\ntype Bar = {\n layout: TabsLayout;\n orientation: Orientation;\n variant: TabsVariant;\n};\ntype Orientation = NonNullable<RACTabsProps['orientation']>;\n\n/** How the bar shares its room among the tabs. */\ntype TabsLayout = 'fixed' | 'scrollable';\nconst BarContext = createContext<Bar>({\n layout: 'fixed',\n orientation: 'horizontal',\n variant: 'primary'\n});\n\n// The bars a reveal has already scrolled, so that only the first is instant.\nconst revealed = new WeakSet<Element>();\nconst NO_PANELS: ReadonlySet<Key> = new Set();\n\n// Which panels are mounted, by id. React Aria points a selected tab's\n// `aria-controls` at the panel it would control whether or not one exists,\n// and a strip used on its own — tabs that filter the content below rather\n// than swapping a panel — then references an id nothing carries, which axe\n// reports as an invalid attribute value. Each panel registers itself here so\n// a tab can leave the attribute off when its panel is not there.\nconst PanelsContext = createContext<ReadonlySet<Key>>(NO_PANELS);\nconst RegisterPanelContext = createContext<(id: Key) => () => void>(() => () => {});\n\n// `children` is narrowed to nodes. React Aria also accepts a function there,\n// to hand the children the tabs' render state, and that form cannot be\n// wrapped in a context provider without calling it first — which would be\n// doing React Aria's job with none of its state. Nothing here needs it, so\n// the narrower type says so rather than leaving a signature that type-checks\n// and then fails to render.\ntype TabsProps = Omit<RACTabsProps, 'children'> & {\n children?: ReactNode;\n /**\n * How the bar shares its room: `fixed` divides it into equal sections, and\n * `scrollable` gives each tab its label's width in a bar that scrolls,\n * which is the page's choice for more tabs than the room has sections for.\n * @default 'fixed'\n */\n layout?: TabsLayout;\n /**\n * Which of the page's two tab bars this is: `primary` for the main one,\n * `secondary` for a strip under a primary one.\n * @default 'primary'\n */\n variant?: TabsVariant;\n};\n\n// The badge, which wraps the icon where a primary tab stacks one and stands\n// after the label anywhere else: `true` for the small dot, a number for the\n// large badge, and nothing for `false`.\nfunction badgeFor(badge: boolean | number | undefined, icon?: ReactNode): ReactNode {\n if (badge === undefined || badge === false) {\n return icon ?? null;\n }\n return <Badge count={badge === true ? undefined : badge} {...{\n 0: {},\n 1: {\n className: \"x2lah0s\"\n }\n }[!!(icon === undefined) << 0]}>\n {icon}\n </Badge>;\n}\n\n// Scrolls a scrollable bar just far enough to show its selected tab whole,\n// handed to the selected tab's label as a ref so it runs as that tab\n// becomes the selected one. The bar alone, never the page: `scrollIntoView`\n// would scroll every scrolling ancestor, the window included, to bring a\n// bar below the fold up to it. The first reveal is instant, so a bar opens\n// on its selected tab rather than sliding to it; the rest take the bar's own\n// smooth scrolling.\nfunction revealInBar(element: HTMLElement | null) {\n const tab = element?.closest('[role=\"tab\"]');\n const bar = tab?.closest('[role=\"tablist\"]');\n if (tab === undefined || tab === null || bar === undefined || bar === null) {\n return;\n }\n const first = !revealed.has(bar);\n revealed.add(bar);\n const box = tab.getBoundingClientRect();\n const room = bar.getBoundingClientRect();\n const left = Math.min(0, box.left - room.left) + Math.max(0, box.right - room.right);\n const top = Math.min(0, box.top - room.top) + Math.max(0, box.bottom - room.bottom);\n if (left !== 0 || top !== 0) {\n bar.scrollBy({\n behavior: first ? 'instant' : 'auto',\n left,\n top\n });\n }\n}\n\n// StyleX cannot target [data-selected] on the element it is styling, so the\n// active tab cannot be chosen in CSS. React Aria's answer is a className that\n// is a function of the tab's own state, the same mechanism Chip uses —\n// mergeStatefulStyles wraps this one so a tab still keeps a className the call\n// site passed.\nfunction tabClasses({\n layout,\n orientation,\n variant\n}: Bar, stacked: boolean) {\n const roles = VARIANTS[variant];\n const vertical = orientation === 'vertical';\n return (state: TabRenderProps) => {\n const engaged = state.isHovered || state.isFocusVisible || state.isPressed;\n\n // The layers in rising order, so a press shows over a focused tab and\n // focus over a hovered one.\n return stylex.props(styles.tab, layout === 'scrollable' && !vertical && styles.tabScrollable, vertical && styles.tabVertical, stacked && styles.tabStacked, state.isSelected ? roles.active : styles.tabInactive, !state.isSelected && engaged && styles.tabInactiveEngaged, state.isHovered && (state.isSelected ? roles.activeHovered : roles.inactiveHovered), state.isFocusVisible && (state.isSelected ? roles.activeFocused : roles.inactiveFocused), state.isPressed && roles.pressed, state.isDisabled && styles.tabDisabled);\n };\n}\n\n// The tab's content: the icon, if any, then the label, wrapped so the\n// indicator has its width to follow. A badge after the label shares a line\n// with it, which is the one wrapper a tab without one goes without. Built by\n// a call for the same reason as `tabRenderer` below; React Aria hands the\n// function the tab's state, and it is passed on when the children are a\n// function too.\nfunction tabContent(children: TabProps['children'], {\n layout,\n orientation,\n variant\n}: Bar, icon: ReactNode, badge: boolean | number | undefined) {\n const hasIcon = icon !== undefined && icon !== null;\n const stacked = hasIcon && variant === 'primary';\n const after = stacked ? null : badgeFor(badge);\n const indicator = <RACSelectionIndicator {...stylex.props(VARIANTS[variant].indicator[orientation])} />;\n // A primary indicator follows the label along a horizontal bar, and lies\n // along the tab's edge everywhere else.\n const underLabel = variant === 'primary' && orientation === 'horizontal';\n return (state: TabRenderProps & {\n defaultChildren: ReactNode;\n }) => {\n const text = <span {...{\n 0: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub x1h7i4cw\"\n },\n 2: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub xh0615m\"\n },\n 1: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub x1h7i4cw x1yc453h\"\n },\n 3: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub xh0615m x1yc453h\"\n }\n }[!!stacked << 1 | !!(orientation === 'vertical') << 0]}>\n {typeof children === 'function' ? children(state) : children}\n </span>;\n return <>\n <span ref={layout === 'scrollable' && state.isSelected ? revealInBar : undefined} {...stylex.props(styles.label, hasIcon && (stacked ? styles.labelStacked : styles.labelInline))}>\n {hasIcon ? <span className=\"x6s0dn4 xxk0z11 x3nfvp2 x2lah0s x1pvqxga xvy4d1p xl56j7k\">\n {stacked ? badgeFor(badge, icon) : icon}\n </span> : null}\n {after === null ? text : <span className=\"x6s0dn4 x9f619 x3nfvp2 xzoy561 x193iq5w xeuugli\">\n {text}\n {after}\n </span>}\n {underLabel ? indicator : null}\n </span>\n {underLabel ? null : indicator}\n </>;\n };\n}\n\n// React Aria renders a tab with `href` as an anchor and any other as a div,\n// and expects a `render` function to return the same element it would have.\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 two inputs. See PanelsContext for why the attribute is\n// dropped.\nfunction tabRenderer(hasPanel: boolean, render: TabProps['render']): NonNullable<TabProps['render']> {\n return (domProps, state) => {\n const adjusted = hasPanel ? domProps : {\n ...domProps,\n 'aria-controls': undefined\n };\n if (render !== undefined) {\n return render(adjusted, state);\n }\n if ('href' in adjusted) {\n // oxlint-disable-next-line jsx-a11y/anchor-has-content -- filled by React Aria\n return <a {...adjusted} />;\n }\n return <div {...adjusted} />;\n };\n}\n\n/**\n * A tab bar and its panels. Selection is React Aria's `selectedKey`: pass\n * it with `onSelectionChange` to control it, or `defaultSelectedKey` to let\n * it keep its own. Each `Tabs.Tab` names the `Tabs.Panel` it controls through\n * a shared `id`, and a strip may stand alone without panels.\n *\n * Composed rather than configured by props, because the number of tabs and\n * what each panel holds are the call site's to decide — the parts are\n * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.\n */\nfunction Tabs({\n children,\n layout = 'fixed',\n orientation = 'horizontal',\n variant = 'primary',\n ...props\n}: RefAttributes<HTMLDivElement> & TabsProps) {\n const bar = useMemo(() => ({\n layout,\n orientation,\n variant\n }), [layout, orientation, variant]);\n const [panels, setPanels] = useState<ReadonlySet<Key>>(NO_PANELS);\n const register = useCallback((id: Key) => {\n setPanels(previous => {\n if (previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.add(id);\n return next;\n });\n return () => {\n setPanels(previous => {\n if (!previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.delete(id);\n return next;\n });\n };\n }, []);\n return <RACTabs {...props} orientation={orientation} {...mergeStatefulStyles({\n 0: {},\n 1: {\n className: \"x78zum5\"\n }\n }[!!(orientation === 'vertical') << 0], props)}>\n <RegisterPanelContext value={register}>\n <PanelsContext value={panels}>\n <BarContext value={bar}>{children}</BarContext>\n </PanelsContext>\n </RegisterPanelContext>\n </RACTabs>;\n}\nfunction TabsList(props: RefAttributes<HTMLDivElement> & TabsListProps) {\n const {\n layout,\n orientation\n } = useContext(BarContext);\n return <TabList {...props} {...mergeStatefulStyles({\n 0: {\n className: \"xp05xdj x9f619 x78zum5\"\n },\n 2: {\n className: \"xp05xdj x9f619 x78zum5 xfk6m8 xysyzu8 x1rohswg xkcv6ua xg83hb1\"\n },\n 1: {\n className: \"x9f619 x78zum5 x1kbcym6 xiwn18o xdt5ytf x2lah0s\"\n },\n 3: {\n className: \"x9f619 x78zum5 xfk6m8 xysyzu8 x1rohswg xkcv6ua xg83hb1 x1kbcym6 xiwn18o xdt5ytf x2lah0s\"\n }\n }[!!(layout === 'scrollable') << 1 | !!(orientation === 'vertical') << 0], props)} />;\n}\nfunction TabsPanel(props: RefAttributes<HTMLDivElement> & TabsPanelProps) {\n const register = useContext(RegisterPanelContext);\n const {\n id\n } = props;\n useEffect(() => {\n if (id === undefined) {\n return undefined;\n }\n return register(id);\n }, [id, register]);\n return <TabPanel {...props} {...mergeStatefulStyles({\n className: \"x9f619 x1iyjqo2 xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn\"\n }, props)} />;\n}\n\n/**\n * An optional box around the panels, which animates its height as one panel\n * gives way to the next. Without it the panels still work; the box around\n * them simply jumps from one height to the other.\n */\nfunction TabsPanels(props: RefAttributes<HTMLDivElement> & TabsPanelsProps) {\n return <RACTabPanels {...props} {...mergeStyles({\n className: \"x12w9bfk x1t2j4n3 x9f619 x1iyjqo2 xeuugli x7giv3 x1hm618n xioksi3 x1f55p5c x1seskgd\"\n }, props)} />;\n}\nfunction TabsTab({\n badge,\n children,\n icon,\n ref,\n render,\n ...props\n}: RefAttributes<HTMLAnchorElement | HTMLDivElement> & TabsTabProps) {\n const panels = useContext(PanelsContext);\n const bar = useContext(BarContext);\n const hasPanel = props.id !== undefined && panels.has(props.id);\n const stacked = icon !== undefined && icon !== null && bar.variant === 'primary';\n return <Tab {...props}\n // A tab with `href` is an anchor and any other a div, so the ref is\n // typed as either and handed over as the callback both accept — see\n // src/render/ref.ts.\n ref={refCallback(ref)} render={tabRenderer(hasPanel, render)} {...mergeStatefulStyles(tabClasses(bar, stacked), props)}>\n {tabContent(children, bar, icon, badge)}\n </Tab>;\n}\nTabs.List = TabsList;\nTabs.Panel = TabsPanel;\nTabs.Panels = TabsPanels;\nTabs.Tab = TabsTab;\ntype TabsListProps = TabListProps<object>;\ntype TabsPanelProps = TabPanelProps;\ntype TabsPanelsProps = Omit<TabPanelsProps<object>, 'children'> & {\n children?: ReactNode;\n};\ntype TabsTabProps = {\n /**\n * A badge on the tab: `true` for the badges page's small dot, a number for\n * the large badge holding it. It sits on a primary tab's icon, and after\n * the label anywhere else. The badge is hidden from assistive technology,\n * so say what it says in the tab's name too — \"First item, 3 new\".\n */\n badge?: boolean | number;\n /**\n * An icon with the label, at the page's 24dp: over it on a primary tab,\n * whose bar grows to 64dp, and before it on a secondary one. An icon drawn\n * in `em` takes its size from the slot.\n */\n icon?: ReactNode;\n} & TabProps;\nexport type { TabsLayout, TabsListProps, TabsPanelProps, TabsPanelsProps, TabsProps,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,IAAA;EALpCG,KAAA,oBAAC,IAAD;GAAI,GAAKrB;GAIX,KAAAe;GAA0B,QAAAC;GAA6B,GAAMC;GAC7DC,UAAAA;EALM,CAAA;EAMHJ,EAAA,KAAAgB;EAAAhB,EAAA,KAAAd;EAAAc,EAAA,KAAAC;EAAAD,EAAA,MAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OANDO;AAMC;AAEV9J,KAAKsL,OAAOP;AACZ/K,KAAKuL,QAAQL;AACblL,KAAKwL,SAASL;AACdnL,KAAKE,MAAMkL"}
|
|
@@ -108,5 +108,5 @@ type TextAreaProps = Omit<TextFieldProps, 'children' | 'isInvalid' | 'validation
|
|
|
108
108
|
* shared with every other field; this component is what React Aria's
|
|
109
109
|
* `TextField` puts around them.
|
|
110
110
|
*/
|
|
111
|
-
declare function TextArea
|
|
112
|
-
export { type TextAreaProps, TextArea
|
|
111
|
+
declare function TextArea({ autosize, characterCount, characterLimitLabel, characterLimitReachedLabel, description, error, floatingLabel, inputRef, isDisabled, label, leadingIcon, rows, trailingIcon, variant, ...props }: RefAttributes<HTMLDivElement> & TextAreaProps): import("react").JSX.Element;
|
|
112
|
+
export { type TextAreaProps, TextArea as default };
|
|
@@ -22,7 +22,7 @@ import { TextField } from "react-aria-components";
|
|
|
22
22
|
* shared with every other field; this component is what React Aria's
|
|
23
23
|
* `TextField` puts around them.
|
|
24
24
|
*/
|
|
25
|
-
function TextArea
|
|
25
|
+
function TextArea(t0) {
|
|
26
26
|
const $ = c(30);
|
|
27
27
|
const { autosize: t1, characterCount: t2, characterLimitLabel, characterLimitReachedLabel, description, error, floatingLabel: t3, inputRef, isDisabled: t4, label, leadingIcon, rows: t5, trailingIcon, variant: t6, ...props$1 } = t0;
|
|
28
28
|
const autosize = t1 === void 0 ? true : t1;
|
|
@@ -113,6 +113,6 @@ function TextArea$1(t0) {
|
|
|
113
113
|
} else t12 = $[29];
|
|
114
114
|
return t12;
|
|
115
115
|
}
|
|
116
|
-
export { TextArea
|
|
116
|
+
export { TextArea as default };
|
|
117
117
|
|
|
118
118
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","RACTextField","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","autosize","characterCount","characterLimitLabel","characterLimitReachedLabel","description","error","floatingLabel","inputRef","label","leadingIcon","rows","trailingIcon","variant","TextArea","t0","$","t1","t2","t3","isDisabled","t4","t5","t6","props","undefined","validationBehavior","T0","t7","t8","root","t9","t10","isRequired","t11","maxLength","t12"],"sources":["../../../src/components/text-area/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { TextFieldProps as RACTextFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { TextField as RACTextField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldTextArea } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// The text fields page's multi-line configuration of the filled field: the\n// same box, floating label, icons, underline and message as TextField,\n// holding a text area rather than an input. The page gives the box 56dp by\n// default and 8dp of padding above and below, with the label vertically\n// centred while the field is empty; a box holding more than one line keeps\n// the padding and grows, which is the chrome's `multiline` box, and its\n// icons stay centred in its height as it does. The page draws no resize\n// handle, and none is drawn here.\n//\n// Its own component rather than a prop of TextField, so `rows` and\n// `autosize` stay off TextField's type and `numeric` stays off this one.\n\ntype TextAreaProps = Omit<RACTextFieldProps, 'children' | 'isInvalid' | 'validationBehavior'> & {\n /**\n * Whether the field grows with the text it holds, from `rows` up. `false`\n * keeps it at `rows` and scrolls the text inside.\n * @default true\n */\n autosize?: boolean;\n /**\n * Whether to count the characters the field holds at the end of the\n * supporting line, against `maxLength` where there is one, as the text\n * fields page's character counter does. The count is written in the\n * `I18nProvider`'s digits and grouping.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * Read with the field on focus rather than as the value changes, so it\n * names the limit and not what is left of it. The visible count is hidden\n * from the tree, which is what this replaces. Left out, it is the\n * sentence for it in the I18nProvider's locale — \"Up to 20 characters\" in\n * English, singular for a limit of one.\n */\n characterLimitLabel?: string;\n /**\n * What a screen reader is told once the length reaches `maxLength`, where\n * `characterCount` draws the count: the count is hidden from the tree, so\n * this is how a reader learns the field has stopped taking characters. It\n * is said once as the limit is reached, and again only after the length\n * has dropped below it. Left out, it is the sentence for it in the\n * I18nProvider's locale — \"Character limit reached\" in English.\n */\n characterLimitReachedLabel?: string;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * A ref to the field's own `<textarea>`, which is the element a call site\n * moves focus to — after a server's error, say. `ref` is the field as a\n * whole.\n */\n inputRef?: Ref<HTMLTextAreaElement>;\n /**\n * What the field is for. Required rather than optional: a text area with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the text: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em` takes\n * that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * How many lines of text the field shows: the least it shows while it\n * grows, or all it shows when it does not.\n * @default 3\n */\n rows?: number;\n /**\n * An icon at the end of the box, after the text: the page's 24dp trailing\n * icon, in the muted role and the error role while the field has an error.\n * An icon drawn in `em` takes that size from the slot.\n */\n trailingIcon?: ReactNode;\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats — the text fields page's two fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A labelled multi-line input. Its value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue` to let it keep its own — and\n * `onChange` is handed the string, not the event. The call site's\n * `className` and `style` land on the field as a whole, which is the element\n * a layout positions.\n *\n * The text fields page's configurations are props: `leadingIcon` and\n * `trailingIcon` at the box's ends, and `characterCount` opposite the\n * supporting text, counting against `maxLength`.\n *\n * The box, label, control and message are the field chrome in `src/field`,\n * shared with every other field; this component is what React Aria's\n * `TextField` puts around them.\n */\nfunction TextArea({\n autosize = true,\n characterCount = false,\n characterLimitLabel,\n characterLimitReachedLabel,\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n rows = 3,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TextAreaProps) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTextField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} leading={leadingIcon} multiline trailing={trailingIcon} variant={variant}>\n <FieldTextArea autosize={autosize} ref={inputRef} rows={rows} />\n </FieldBox>\n <FieldMessage characterCount={characterCount} characterLimitLabel={characterLimitLabel} characterLimitReachedLabel={characterLimitReachedLabel} description={description} error={error} maxLength={props.maxLength} />\n </RACTextField>;\n}\nexport type { TextAreaProps };\nexport default TextArea;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmIA,SAAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","RACTextField","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","autosize","characterCount","characterLimitLabel","characterLimitReachedLabel","description","error","floatingLabel","inputRef","label","leadingIcon","rows","trailingIcon","variant","TextArea","t0","$","t1","t2","t3","isDisabled","t4","t5","t6","props","undefined","validationBehavior","T0","t7","t8","root","t9","t10","isRequired","t11","maxLength","t12"],"sources":["../../../src/components/text-area/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { TextFieldProps as RACTextFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { TextField as RACTextField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldTextArea } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// The text fields page's multi-line configuration of the filled field: the\n// same box, floating label, icons, underline and message as TextField,\n// holding a text area rather than an input. The page gives the box 56dp by\n// default and 8dp of padding above and below, with the label vertically\n// centred while the field is empty; a box holding more than one line keeps\n// the padding and grows, which is the chrome's `multiline` box, and its\n// icons stay centred in its height as it does. The page draws no resize\n// handle, and none is drawn here.\n//\n// Its own component rather than a prop of TextField, so `rows` and\n// `autosize` stay off TextField's type and `numeric` stays off this one.\n\ntype TextAreaProps = Omit<RACTextFieldProps, 'children' | 'isInvalid' | 'validationBehavior'> & {\n /**\n * Whether the field grows with the text it holds, from `rows` up. `false`\n * keeps it at `rows` and scrolls the text inside.\n * @default true\n */\n autosize?: boolean;\n /**\n * Whether to count the characters the field holds at the end of the\n * supporting line, against `maxLength` where there is one, as the text\n * fields page's character counter does. The count is written in the\n * `I18nProvider`'s digits and grouping.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * Read with the field on focus rather than as the value changes, so it\n * names the limit and not what is left of it. The visible count is hidden\n * from the tree, which is what this replaces. Left out, it is the\n * sentence for it in the I18nProvider's locale — \"Up to 20 characters\" in\n * English, singular for a limit of one.\n */\n characterLimitLabel?: string;\n /**\n * What a screen reader is told once the length reaches `maxLength`, where\n * `characterCount` draws the count: the count is hidden from the tree, so\n * this is how a reader learns the field has stopped taking characters. It\n * is said once as the limit is reached, and again only after the length\n * has dropped below it. Left out, it is the sentence for it in the\n * I18nProvider's locale — \"Character limit reached\" in English.\n */\n characterLimitReachedLabel?: string;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * A ref to the field's own `<textarea>`, which is the element a call site\n * moves focus to — after a server's error, say. `ref` is the field as a\n * whole.\n */\n inputRef?: Ref<HTMLTextAreaElement>;\n /**\n * What the field is for. Required rather than optional: a text area with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the text: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em` takes\n * that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * How many lines of text the field shows: the least it shows while it\n * grows, or all it shows when it does not.\n * @default 3\n */\n rows?: number;\n /**\n * An icon at the end of the box, after the text: the page's 24dp trailing\n * icon, in the muted role and the error role while the field has an error.\n * An icon drawn in `em` takes that size from the slot.\n */\n trailingIcon?: ReactNode;\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats — the text fields page's two fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A labelled multi-line input. Its value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue` to let it keep its own — and\n * `onChange` is handed the string, not the event. The call site's\n * `className` and `style` land on the field as a whole, which is the element\n * a layout positions.\n *\n * The text fields page's configurations are props: `leadingIcon` and\n * `trailingIcon` at the box's ends, and `characterCount` opposite the\n * supporting text, counting against `maxLength`.\n *\n * The box, label, control and message are the field chrome in `src/field`,\n * shared with every other field; this component is what React Aria's\n * `TextField` puts around them.\n */\nfunction TextArea({\n autosize = true,\n characterCount = false,\n characterLimitLabel,\n characterLimitReachedLabel,\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n rows = 3,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TextAreaProps) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTextField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} leading={leadingIcon} multiline trailing={trailingIcon} variant={variant}>\n <FieldTextArea autosize={autosize} ref={inputRef} rows={rows} />\n </FieldBox>\n <FieldMessage characterCount={characterCount} characterLimitLabel={characterLimitLabel} characterLimitReachedLabel={characterLimitReachedLabel} description={description} error={error} maxLength={props.maxLength} />\n </RACTextField>;\n}\nexport type { TextAreaProps };\nexport default TextArea;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmIA,SAAAoB,SAAAC,IAAA;CAAA,MAAAC,IAAAtB,EAAA,EAAA;CAAkB,MAAA,EAAAO,UAAAgB,IAAAf,gBAAAgB,IAAAf,qBAAAC,4BAAAC,aAAAC,OAAAC,eAAAY,IAAAX,UAAAY,YAAAC,IAAAZ,OAAAC,aAAAC,MAAAW,IAAAV,cAAAC,SAAAU,IAAA,GAAAC,YAAAT;CAChB,MAAAd,WAAAgB,OAAAQ,KAAAA,IAAA,OAAAR;CACA,MAAAf,iBAAAgB,OAAAO,KAAAA,IAAA,QAAAP;CAKA,MAAAX,gBAAAY,OAAAM,KAAAA,IAAA,OAAAN;CAEA,MA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AA,IAAAlB,EAAA,QAAAd,kBAAAc,EAAA,QAAAb,uBAAAa,EAAA,QAAAZ,8BAAAY,EAAA,QAAAX,eAAAW,EAAA,QAAAV,SAAAU,EAAA,QAAAQ,QAAAW,WAAA;EACXD,MAAA,oBAAC,cAAD;GAA8BhC;GAAqCC;GAAiDC;GAAyCC;GAAoBC;GAAkB,WAAAkB,QAAKW;EAAU,CAAA;EAAInB,EAAA,MAAAd;EAAAc,EAAA,MAAAb;EAAAa,EAAA,MAAAZ;EAAAY,EAAA,MAAAX;EAAAW,EAAA,MAAAV;EAAAU,EAAA,MAAAQ,QAAAW;EAAAnB,EAAA,MAAAkB;CAAA,OAAAA,MAAAlB,EAAA;CAAA,IAAAoB;CAAA,IAAApB,EAAA,QAAAW,MAAAX,EAAA,QAAAI,cAAAJ,EAAA,QAAAQ,WAAAR,EAAA,QAAAgB,OAAAhB,EAAA,QAAAkB,OAAAlB,EAAA,QAAAY,MAAAZ,EAAA,QAAAa,MAAAb,EAAA,QAAAU,oBAAA;EAJnNU,MAAA,qBAAC,IAAD;GAA0BhB;GAAuB,WAAAQ;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA5H,UAAA,CACHG,KAGAE,GAJgB;;EAKHlB,EAAA,MAAAW;EAAAX,EAAA,MAAAI;EAAAJ,EAAA,MAAAQ;EAAAR,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAU;EAAAV,EAAA,MAAAoB;CAAA,OAAAA,MAAApB,EAAA;CAAA,OALVoB;AAKU"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FieldVariant } from "../../field/index.js";
|
|
2
2
|
import { ReactNode, Ref, RefAttributes } from "react";
|
|
3
|
-
import { TextFieldProps } from "react-aria-components";
|
|
4
|
-
type TextFieldProps
|
|
3
|
+
import { TextFieldProps as TextFieldProps$1 } from "react-aria-components";
|
|
4
|
+
type TextFieldProps = Omit<TextFieldProps$1, 'children' | 'isInvalid' | 'prefix' | 'validationBehavior'> & {
|
|
5
5
|
/**
|
|
6
6
|
* Whether to count the characters the field holds at the end of the
|
|
7
7
|
* supporting line, against `maxLength` where there is one, as the text
|
|
@@ -147,5 +147,5 @@ type TextFieldProps$1 = Omit<TextFieldProps, 'children' | 'isInvalid' | 'prefix'
|
|
|
147
147
|
* draws them; this component is what React Aria's `TextField` puts around
|
|
148
148
|
* them.
|
|
149
149
|
*/
|
|
150
|
-
declare function TextField
|
|
151
|
-
export { type TextFieldProps
|
|
150
|
+
declare function TextField({ characterCount, characterLimitLabel, characterLimitReachedLabel, description, error, floatingLabel, inputRef, isDisabled, label, leadingIcon, numeric, prefix, suffix, trailingIcon, variant, ...props }: RefAttributes<HTMLDivElement> & TextFieldProps): import("react").JSX.Element;
|
|
151
|
+
export { type TextFieldProps, TextField as default };
|
|
@@ -5,7 +5,7 @@ import { fieldStyles, invalidFrom, useFieldValidationBehavior } from "../../fiel
|
|
|
5
5
|
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { TextField } from "react-aria-components";
|
|
8
|
+
import { TextField as TextField$1 } from "react-aria-components";
|
|
9
9
|
// src/components/text-field/index.tsx
|
|
10
10
|
/**
|
|
11
11
|
* A labelled single-line input. Its value is React Aria's: pass `value` with
|
|
@@ -45,7 +45,7 @@ import { TextField } from "react-aria-components";
|
|
|
45
45
|
* draws them; this component is what React Aria's `TextField` puts around
|
|
46
46
|
* them.
|
|
47
47
|
*/
|
|
48
|
-
function TextField
|
|
48
|
+
function TextField(t0) {
|
|
49
49
|
const $ = c(32);
|
|
50
50
|
const { characterCount: t1, characterLimitLabel, characterLimitReachedLabel, description, error, floatingLabel: t2, inputRef, isDisabled: t3, label, leadingIcon, numeric: t4, prefix, suffix, trailingIcon, variant: t5, ...props$1 } = t0;
|
|
51
51
|
const characterCount = t1 === void 0 ? false : t1;
|
|
@@ -54,7 +54,7 @@ function TextField$1(t0) {
|
|
|
54
54
|
const numeric = t4 === void 0 ? false : t4;
|
|
55
55
|
const variant = t5 === void 0 ? "filled" : t5;
|
|
56
56
|
const validationBehavior = useFieldValidationBehavior();
|
|
57
|
-
const T0 = TextField;
|
|
57
|
+
const T0 = TextField$1;
|
|
58
58
|
const t6 = numeric ? "decimal" : void 0;
|
|
59
59
|
let t7;
|
|
60
60
|
if ($[0] !== error) {
|
|
@@ -140,6 +140,6 @@ function TextField$1(t0) {
|
|
|
140
140
|
} else t12 = $[31];
|
|
141
141
|
return t12;
|
|
142
142
|
}
|
|
143
|
-
export { TextField
|
|
143
|
+
export { TextField as default };
|
|
144
144
|
|
|
145
145
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","TextField","RACTextField","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","characterCount","characterLimitLabel","characterLimitReachedLabel","description","error","floatingLabel","inputRef","label","leadingIcon","numeric","prefix","suffix","trailingIcon","variant","t0","$","t1","t2","isDisabled","t3","t4","t5","props","undefined","validationBehavior","T0","t6","t7","t8","root","t9","t10","isRequired","t11","maxLength","t12"],"sources":["../../../src/components/text-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { TextFieldProps as RACTextFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { TextField as RACTextField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\ntype TextFieldProps = Omit<RACTextFieldProps, 'children' | 'isInvalid' | 'prefix' | 'validationBehavior'> & {\n /**\n * Whether to count the characters the field holds at the end of the\n * supporting line, against `maxLength` where there is one, as the text\n * fields page's character counter does. The count is written in the\n * `I18nProvider`'s digits and grouping.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * Read with the field on focus rather than as the value changes, so it\n * names the limit and not what is left of it. The visible count is hidden\n * from the tree, which is what this replaces. Left out, it is the\n * sentence for it in the I18nProvider's locale — \"Up to 20 characters\" in\n * English, singular for a limit of one.\n */\n characterLimitLabel?: string;\n /**\n * What a screen reader is told once the length reaches `maxLength`, where\n * `characterCount` draws the count: the count is hidden from the tree, so\n * this is how a reader learns the field has stopped taking characters. It\n * is said once as the limit is reached, and again only after the length\n * has dropped below it. Left out, it is the sentence for it in the\n * I18nProvider's locale — \"Character limit reached\" in English.\n */\n characterLimitReachedLabel?: string;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as Material Design's text fields\n * draw it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * What the field is for. Required rather than optional: a text field with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the value: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em`\n * takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column. The value runs left to\n * right whatever the page's direction, so a minus sign stays before the\n * digits under a right-to-left locale, and a phone shows the decimal\n * keypad. That keypad has no minus key on iOS or Android, so a field taking\n * negative amounts gives an `inputMode` of its own, which replaces it, or\n * is a `NumberField`, which picks a keypad for each platform.\n * @default false\n */\n numeric?: boolean;\n /**\n * Text before the value on its line, in the muted role, shown while the\n * field is focused or holds a value.\n */\n prefix?: ReactNode;\n /**\n * Text after the value on its line, in the muted role, shown while the\n * field is focused or holds a value.\n */\n suffix?: ReactNode;\n /**\n * An icon at the end of the box, after the value: the page's 24dp trailing\n * icon, in the muted role and the error role while the field has an error.\n * An icon drawn in `em` takes that size from the slot.\n *\n * It may be a control rather than a picture, such as an `IconButton` that\n * clears the field. A press on it is the button's own, where a press\n * anywhere else in the box focuses the input. The button is 40px around\n * its 24px icon, so an inline margin of -8px on each side puts the icon\n * where a bare one sits. It draws its own colours, so it keeps the muted\n * role while the field has an error.\n */\n trailingIcon?: ReactNode;\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats — Material Design's two text fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A labelled single-line input. Its value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue` to let it keep its own — and\n * `onChange` is handed the string, not the event. The call site's\n * `className` and `style` land on the field as a whole, which is the element\n * a layout positions.\n *\n * ```tsx\n * <TextField description=\"Supporting line\" label=\"Label\" />\n * ```\n *\n * The configurations of Material Design's text fields are props:\n * `leadingIcon` and `trailingIcon` at the box's ends, `prefix` and `suffix`\n * on the value's line, and `characterCount` opposite the supporting text,\n * counting against `maxLength`. A trailing icon that clears the field is an\n * `IconButton` there, shown while the field holds something:\n *\n * ```tsx\n * const [value, setValue] = useState('')\n *\n * <TextField\n * label=\"Label\"\n * onChange={setValue}\n * trailingIcon={\n * value === '' ? undefined : (\n * <IconButton aria-label=\"Clear\" onPress={() => setValue('')}>\n * <CloseIcon />\n * </IconButton>\n * )\n * }\n * value={value}\n * />\n * ```\n *\n * The box, label, input and message are drawn as every field in the library\n * draws them; this component is what React Aria's `TextField` puts around\n * them.\n */\nfunction TextField({\n characterCount = false,\n characterLimitLabel,\n characterLimitReachedLabel,\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n numeric = false,\n prefix,\n suffix,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TextFieldProps) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTextField\n // The decimal keypad for a numeric field, unless the call site names\n // another below.\n inputMode={numeric ? 'decimal' : undefined} isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldInput leftToRight={numeric} numeric={numeric} prefix={prefix} ref={inputRef} suffix={suffix} />\n </FieldBox>\n <FieldMessage characterCount={characterCount} characterLimitLabel={characterLimitLabel} characterLimitReachedLabel={characterLimitReachedLabel} description={description} error={error} maxLength={props.maxLength} />\n </RACTextField>;\n}\nexport type { TextFieldProps };\nexport default TextField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6JA,SAAAE,YAAAoB,IAAA;CAAA,MAAAC,IAAAvB,EAAA,EAAA;CAAmB,MAAA,EAAAQ,gBAAAgB,IAAAf,qBAAAC,4BAAAC,aAAAC,OAAAC,eAAAY,IAAAX,UAAAY,YAAAC,IAAAZ,OAAAC,aAAAC,SAAAW,IAAAV,QAAAC,QAAAC,cAAAC,SAAAQ,IAAA,GAAAC,YAAAR;CACjB,MAAAd,iBAAAgB,OAAAO,KAAAA,IAAA,QAAAP;CAKA,MAAAX,gBAAAY,OAAAM,KAAAA,IAAA,OAAAN;CAEA,MAAAC,aAAAC,OAAAI,KAAAA,IAAA,QAAAJ;CAGA,MAAAV,UAAAW,OAAAG,KAAAA,IAAA,QAAAH;CAIA,MAAAP,UAAAQ,OAAAE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Af,kBAAAe,EAAA,QAAAd,uBAAAc,EAAA,QAAAb,8BAAAa,EAAA,QAAAZ,eAAAY,EAAA,QAAAX,SAAAW,EAAA,QAAAO,QAAAY,WAAA;EACXD,MAAA,oBAAC,cAAD;GAA8BjC;GAAqCC;GAAiDC;GAAyCC;GAAoBC;GAAkB,WAAAkB,QAAKY;EAAU,CAAA;EAAInB,EAAA,MAAAf;EAAAe,EAAA,MAAAd;EAAAc,EAAA,MAAAb;EAAAa,EAAA,MAAAZ;EAAAY,EAAA,MAAAX;EAAAW,EAAA,MAAAO,QAAAY;EAAAnB,EAAA,MAAAkB;CAAA,OAAAA,MAAAlB,EAAA;CAAA,IAAAoB;CAAA,IAAApB,EAAA,QAAAU,MAAAV,EAAA,QAAAG,cAAAH,EAAA,QAAAO,WAAAP,EAAA,QAAAgB,OAAAhB,EAAA,QAAAkB,OAAAlB,EAAA,QAAAW,MAAAX,EAAA,QAAAY,MAAAZ,EAAA,QAAAa,MAAAb,EAAA,QAAAS,oBAAA;EAPnNW,MAAA,qBAAC,IAAD;GAGI,WAAAT;GAA6CR;GAAuB,WAAAS;GAAwCH;GAAkB,GAAMF;GAAK,GAAMM;GAHnJ,UAAA,CAIHG,KAGAE,GAPgB;;EAQHlB,EAAA,MAAAU;EAAAV,EAAA,MAAAG;EAAAH,EAAA,MAAAO;EAAAP,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAS;EAAAT,EAAA,MAAAoB;CAAA,OAAAA,MAAApB,EAAA;CAAA,OARVoB;AAQU"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","TextField","RACTextField","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","characterCount","characterLimitLabel","characterLimitReachedLabel","description","error","floatingLabel","inputRef","label","leadingIcon","numeric","prefix","suffix","trailingIcon","variant","t0","$","t1","t2","isDisabled","t3","t4","t5","props","undefined","validationBehavior","T0","t6","t7","t8","root","t9","t10","isRequired","t11","maxLength","t12"],"sources":["../../../src/components/text-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { TextFieldProps as RACTextFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { TextField as RACTextField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\ntype TextFieldProps = Omit<RACTextFieldProps, 'children' | 'isInvalid' | 'prefix' | 'validationBehavior'> & {\n /**\n * Whether to count the characters the field holds at the end of the\n * supporting line, against `maxLength` where there is one, as the text\n * fields page's character counter does. The count is written in the\n * `I18nProvider`'s digits and grouping.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * Read with the field on focus rather than as the value changes, so it\n * names the limit and not what is left of it. The visible count is hidden\n * from the tree, which is what this replaces. Left out, it is the\n * sentence for it in the I18nProvider's locale — \"Up to 20 characters\" in\n * English, singular for a limit of one.\n */\n characterLimitLabel?: string;\n /**\n * What a screen reader is told once the length reaches `maxLength`, where\n * `characterCount` draws the count: the count is hidden from the tree, so\n * this is how a reader learns the field has stopped taking characters. It\n * is said once as the limit is reached, and again only after the length\n * has dropped below it. Left out, it is the sentence for it in the\n * I18nProvider's locale — \"Character limit reached\" in English.\n */\n characterLimitReachedLabel?: string;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as Material Design's text fields\n * draw it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * What the field is for. Required rather than optional: a text field with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the value: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em`\n * takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column. The value runs left to\n * right whatever the page's direction, so a minus sign stays before the\n * digits under a right-to-left locale, and a phone shows the decimal\n * keypad. That keypad has no minus key on iOS or Android, so a field taking\n * negative amounts gives an `inputMode` of its own, which replaces it, or\n * is a `NumberField`, which picks a keypad for each platform.\n * @default false\n */\n numeric?: boolean;\n /**\n * Text before the value on its line, in the muted role, shown while the\n * field is focused or holds a value.\n */\n prefix?: ReactNode;\n /**\n * Text after the value on its line, in the muted role, shown while the\n * field is focused or holds a value.\n */\n suffix?: ReactNode;\n /**\n * An icon at the end of the box, after the value: the page's 24dp trailing\n * icon, in the muted role and the error role while the field has an error.\n * An icon drawn in `em` takes that size from the slot.\n *\n * It may be a control rather than a picture, such as an `IconButton` that\n * clears the field. A press on it is the button's own, where a press\n * anywhere else in the box focuses the input. The button is 40px around\n * its 24px icon, so an inline margin of -8px on each side puts the icon\n * where a bare one sits. It draws its own colours, so it keeps the muted\n * role while the field has an error.\n */\n trailingIcon?: ReactNode;\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats — Material Design's two text fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A labelled single-line input. Its value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue` to let it keep its own — and\n * `onChange` is handed the string, not the event. The call site's\n * `className` and `style` land on the field as a whole, which is the element\n * a layout positions.\n *\n * ```tsx\n * <TextField description=\"Supporting line\" label=\"Label\" />\n * ```\n *\n * The configurations of Material Design's text fields are props:\n * `leadingIcon` and `trailingIcon` at the box's ends, `prefix` and `suffix`\n * on the value's line, and `characterCount` opposite the supporting text,\n * counting against `maxLength`. A trailing icon that clears the field is an\n * `IconButton` there, shown while the field holds something:\n *\n * ```tsx\n * const [value, setValue] = useState('')\n *\n * <TextField\n * label=\"Label\"\n * onChange={setValue}\n * trailingIcon={\n * value === '' ? undefined : (\n * <IconButton aria-label=\"Clear\" onPress={() => setValue('')}>\n * <CloseIcon />\n * </IconButton>\n * )\n * }\n * value={value}\n * />\n * ```\n *\n * The box, label, input and message are drawn as every field in the library\n * draws them; this component is what React Aria's `TextField` puts around\n * them.\n */\nfunction TextField({\n characterCount = false,\n characterLimitLabel,\n characterLimitReachedLabel,\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n numeric = false,\n prefix,\n suffix,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TextFieldProps) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTextField\n // The decimal keypad for a numeric field, unless the call site names\n // another below.\n inputMode={numeric ? 'decimal' : undefined} isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldInput leftToRight={numeric} numeric={numeric} prefix={prefix} ref={inputRef} suffix={suffix} />\n </FieldBox>\n <FieldMessage characterCount={characterCount} characterLimitLabel={characterLimitLabel} characterLimitReachedLabel={characterLimitReachedLabel} description={description} error={error} maxLength={props.maxLength} />\n </RACTextField>;\n}\nexport type { TextFieldProps };\nexport default TextField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;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HnJ,UAAA,CAIHG,KAGAE,GAPgB;;EAQHlB,EAAA,MAAAU;EAAAV,EAAA,MAAAG;EAAAH,EAAA,MAAAO;EAAAP,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAS;EAAAT,EAAA,MAAAoB;CAAA,OAAAA,MAAApB,EAAA;CAAA,OARVoB;AAQU"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FieldVariant } from "../../field/index.js";
|
|
2
2
|
import { ReactNode, RefAttributes } from "react";
|
|
3
|
-
import { TimeFieldProps, TimeValue } from "react-aria-components";
|
|
4
|
-
type TimeFieldProps
|
|
3
|
+
import { TimeFieldProps as TimeFieldProps$1, TimeValue } from "react-aria-components";
|
|
4
|
+
type TimeFieldProps<T extends TimeValue = TimeValue> = Omit<TimeFieldProps$1<T>, 'children' | 'className' | 'style'> & {
|
|
5
5
|
/** A function may compute the class from the field's render state. */
|
|
6
|
-
className?: TimeFieldProps<T>['className'];
|
|
6
|
+
className?: TimeFieldProps$1<T>['className'];
|
|
7
7
|
/** Supporting text under the field. */
|
|
8
8
|
description?: string;
|
|
9
9
|
/**
|
|
@@ -29,7 +29,7 @@ type TimeFieldProps$1<T extends TimeValue = TimeValue> = Omit<TimeFieldProps<T>,
|
|
|
29
29
|
*/
|
|
30
30
|
leadingIcon?: ReactNode;
|
|
31
31
|
/** A function may compute the style from the field's render state. */
|
|
32
|
-
style?: TimeFieldProps<T>['style'];
|
|
32
|
+
style?: TimeFieldProps$1<T>['style'];
|
|
33
33
|
/**
|
|
34
34
|
* An icon at the box's trailing end, in the page's 24dp size. An icon
|
|
35
35
|
* drawn in `em` takes that size from the slot.
|
|
@@ -60,5 +60,5 @@ type TimeFieldProps$1<T extends TimeValue = TimeValue> = Omit<TimeFieldProps<T>,
|
|
|
60
60
|
* field chrome in `src/field`. The call site's `className` and `style` land
|
|
61
61
|
* on the field as a whole, which is the element a layout positions.
|
|
62
62
|
*/
|
|
63
|
-
declare function TimeField
|
|
64
|
-
export { type TimeFieldProps
|
|
63
|
+
declare function TimeField<T extends TimeValue>({ description, error, floatingLabel, isDisabled, label, leadingIcon, trailingIcon, variant, ...props }: RefAttributes<HTMLDivElement> & TimeFieldProps<T>): import("react").JSX.Element;
|
|
64
|
+
export { type TimeFieldProps, TimeField as default };
|
|
@@ -7,7 +7,7 @@ import { segmentStyles } from "../../segments/styles.js";
|
|
|
7
7
|
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { DateInput, TimeField } from "react-aria-components";
|
|
10
|
+
import { DateInput, TimeField as TimeField$1 } from "react-aria-components";
|
|
11
11
|
// src/components/time-field/index.tsx
|
|
12
12
|
/**
|
|
13
13
|
* A time typed rather than picked: one segment per part, each its own focus
|
|
@@ -28,14 +28,14 @@ import { DateInput, TimeField } from "react-aria-components";
|
|
|
28
28
|
* field chrome in `src/field`. The call site's `className` and `style` land
|
|
29
29
|
* on the field as a whole, which is the element a layout positions.
|
|
30
30
|
*/
|
|
31
|
-
function TimeField
|
|
31
|
+
function TimeField(t0) {
|
|
32
32
|
const $ = c(22);
|
|
33
33
|
const { description, error, floatingLabel: t1, isDisabled: t2, label, leadingIcon, trailingIcon, variant: t3, ...props$1 } = t0;
|
|
34
34
|
const floatingLabel = t1 === void 0 ? true : t1;
|
|
35
35
|
const isDisabled = t2 === void 0 ? false : t2;
|
|
36
36
|
const variant = t3 === void 0 ? "filled" : t3;
|
|
37
37
|
const validationBehavior = useFieldValidationBehavior();
|
|
38
|
-
const T0 = TimeField;
|
|
38
|
+
const T0 = TimeField$1;
|
|
39
39
|
let t4;
|
|
40
40
|
if ($[0] !== error) {
|
|
41
41
|
t4 = invalidFrom(error);
|
|
@@ -103,6 +103,6 @@ function TimeField$1(t0) {
|
|
|
103
103
|
} else t9 = $[21];
|
|
104
104
|
return t9;
|
|
105
105
|
}
|
|
106
|
-
export { TimeField
|
|
106
|
+
export { TimeField as default };
|
|
107
107
|
|
|
108
108
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","TimeField","RACTimeField","fieldStyles","invalidFrom","useFieldValidationBehavior","renderSegment","segmentStyles","mergeStatefulStyles","description","error","floatingLabel","label","leadingIcon","trailingIcon","variant","t0","$","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","Symbol","for","input","t7","isRequired","t8","t9","RACDateInput"],"sources":["../../../src/components/time-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TimeFieldProps as RACTimeFieldProps, TimeValue } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateInput as RACDateInput, TimeField as RACTimeField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A time typed a segment at a time. Every part of it is DateField's, from\n// `src/segments` — the segment treatment, the muted placeholder, the filled\n// focus and the punctuation between — so a time on a form and a date on the\n// same form cannot come apart.\n//\n// What differs is the value it holds and nothing else. The time pickers page\n// gives its input the text field's own box, which is what the shared field\n// chrome already draws, so there is no measurement here that the date field's\n// comment does not already name.\n//\n// **Twelve or twenty-four hours is the reader's locale, not a prop.** React\n// Aria decides from the locale whether there is a day-period segment at all,\n// so a field under `I18nProvider` with `en-GB` shows a 24-hour clock and the\n// same field under `en-US` shows AM and PM. Nothing here overrides it, and\n// `hourCycle` is React Aria's own for a page that has to.\n\ntype TimeFieldProps<T extends TimeValue = TimeValue> = Omit<RACTimeFieldProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the field's render state. */\n className?: RACTimeFieldProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /**\n * An icon at the box's leading end, in the page's 24dp size. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACTimeFieldProps<T>['style'];\n /**\n * An icon at the box's trailing end, in the page's 24dp size. An icon\n * drawn in `em` takes that size from the slot.\n */\n trailingIcon?: ReactNode;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A time typed rather than picked: one segment per part, each its own focus\n * stop. The value is React Aria's — pass `value` with `onChange` to control\n * it, or `defaultValue` — as a `Time` from this package's `./date` subpath.\n *\n * ```tsx\n * import { Time } from '@kanso-labs/kanso-ui/date'\n *\n * <TimeField defaultValue={new Time(9, 30)} label=\"Label\" />\n * ```\n *\n * Whether it shows a twelve or twenty-four hour clock is the reader's\n * locale, through React Aria's `I18nProvider`. `granularity` takes it down\n * to seconds, and `minValue` and `maxValue` bound what may be typed.\n *\n * The segments are `DateField`'s, and the box, label and message are the\n * field chrome in `src/field`. The call site's `className` and `style` land\n * on the field as a whole, which is the element a layout positions.\n */\nfunction TimeField<T extends TimeValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TimeFieldProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTimeField<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, for the reason DateField's own comment gives: the\n // box reads an `<input>` to decide, and a segmented field has none —\n // its segments hold the value's line from the first render.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldSegments>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACTimeField>;\n}\nexport type { TimeFieldProps };\nexport default TimeField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,SAAAE,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","TimeField","RACTimeField","fieldStyles","invalidFrom","useFieldValidationBehavior","renderSegment","segmentStyles","mergeStatefulStyles","description","error","floatingLabel","label","leadingIcon","trailingIcon","variant","t0","$","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","Symbol","for","input","t7","isRequired","t8","t9","RACDateInput"],"sources":["../../../src/components/time-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TimeFieldProps as RACTimeFieldProps, TimeValue } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateInput as RACDateInput, TimeField as RACTimeField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A time typed a segment at a time. Every part of it is DateField's, from\n// `src/segments` — the segment treatment, the muted placeholder, the filled\n// focus and the punctuation between — so a time on a form and a date on the\n// same form cannot come apart.\n//\n// What differs is the value it holds and nothing else. The time pickers page\n// gives its input the text field's own box, which is what the shared field\n// chrome already draws, so there is no measurement here that the date field's\n// comment does not already name.\n//\n// **Twelve or twenty-four hours is the reader's locale, not a prop.** React\n// Aria decides from the locale whether there is a day-period segment at all,\n// so a field under `I18nProvider` with `en-GB` shows a 24-hour clock and the\n// same field under `en-US` shows AM and PM. Nothing here overrides it, and\n// `hourCycle` is React Aria's own for a page that has to.\n\ntype TimeFieldProps<T extends TimeValue = TimeValue> = Omit<RACTimeFieldProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the field's render state. */\n className?: RACTimeFieldProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /**\n * An icon at the box's leading end, in the page's 24dp size. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACTimeFieldProps<T>['style'];\n /**\n * An icon at the box's trailing end, in the page's 24dp size. An icon\n * drawn in `em` takes that size from the slot.\n */\n trailingIcon?: ReactNode;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A time typed rather than picked: one segment per part, each its own focus\n * stop. The value is React Aria's — pass `value` with `onChange` to control\n * it, or `defaultValue` — as a `Time` from this package's `./date` subpath.\n *\n * ```tsx\n * import { Time } from '@kanso-labs/kanso-ui/date'\n *\n * <TimeField defaultValue={new Time(9, 30)} label=\"Label\" />\n * ```\n *\n * Whether it shows a twelve or twenty-four hour clock is the reader's\n * locale, through React Aria's `I18nProvider`. `granularity` takes it down\n * to seconds, and `minValue` and `maxValue` bound what may be typed.\n *\n * The segments are `DateField`'s, and the box, label and message are the\n * field chrome in `src/field`. The call site's `className` and `style` land\n * on the field as a whole, which is the element a layout positions.\n */\nfunction TimeField<T extends TimeValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TimeFieldProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTimeField<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, for the reason DateField's own comment gives: the\n // box reads an `<input>` to decide, and a segmented field has none —\n // its segments hold the value's line from the first render.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldSegments>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACTimeField>;\n}\nexport type { TimeFieldProps };\nexport default TimeField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,SAAAE,UAAAe,IAAA;CAAA,MAAAC,IAAAlB,EAAA,EAAA;CAAwC,MAAA,EAAAU,aAAAC,OAAAC,eAAAO,IAAAC,YAAAC,IAAAR,OAAAC,aAAAC,cAAAC,SAAAM,IAAA,GAAAC,YAAAN;CAGtC,MAAAL,gBAAAO,OAAAK,KAAAA,IAAA,OAAAL;CACA,MAAAC,aAAAC,OAAAG,KAAAA,IAAA,QAAAH;CAIA,MAAAL,UAAAM,OAAAE,KAAAA,IAAA,WAAAF;CAGA,MAAAG,qBAA2BnB,2BAA2B;CAC9C,MAAAoB,KAAAvB;CAAY,IAAAwB;CAAA,IAAAT,EAAA,OAAAP,OAAA;EAAuCgB,KAAAtB,YAAYM,KAAK;EAACO,EAAA,KAAAP;EAAAO,EAAA,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,EAAA,QAAAO,oBAAA;EAZrDY,KAAA,qBAAC,IAAD;GAA6BjB;GAAuB,WAAAO;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA/H,UAAA,CACHM,IAWAE,EAZgB;;EAaHlB,EAAA,MAAAQ;EAAAR,EAAA,MAAAE;EAAAF,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAO;EAAAP,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAbVmB;AAaU"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FieldVariant } from "../../field/index.js";
|
|
2
2
|
import { ReactNode, RefAttributes } from "react";
|
|
3
|
-
import { TokenFieldProps, TokenFieldValue, TokenInputProps } from "react-aria-components";
|
|
4
|
-
type TokenFieldProps
|
|
3
|
+
import { TokenFieldProps as TokenFieldProps$1, TokenFieldValue, TokenInputProps } from "react-aria-components";
|
|
4
|
+
type TokenFieldProps<T extends TokenFieldValue = TokenFieldValue> = {
|
|
5
5
|
/** A function may compute the class from the field's render state. */
|
|
6
|
-
className?: TokenFieldProps<T>['className'];
|
|
6
|
+
className?: TokenFieldProps$1<T>['className'];
|
|
7
7
|
/**
|
|
8
8
|
* A hint shown under the field. Replaced by `error` when there is one, so
|
|
9
9
|
* the two never stack.
|
|
@@ -43,7 +43,7 @@ type TokenFieldProps$1<T extends TokenFieldValue = TokenFieldValue> = {
|
|
|
43
43
|
*/
|
|
44
44
|
renderToken?: (segment: TokenSegment) => ReactNode;
|
|
45
45
|
/** A function may compute the style from the field's render state. */
|
|
46
|
-
style?: TokenFieldProps<T>['style'];
|
|
46
|
+
style?: TokenFieldProps$1<T>['style'];
|
|
47
47
|
/**
|
|
48
48
|
* An icon at the end of the box, after the value: the page's 24dp trailing
|
|
49
49
|
* icon, in the muted role and the error role once the field has an error.
|
|
@@ -55,7 +55,7 @@ type TokenFieldProps$1<T extends TokenFieldValue = TokenFieldValue> = {
|
|
|
55
55
|
* @default 'filled'
|
|
56
56
|
*/
|
|
57
57
|
variant?: FieldVariant;
|
|
58
|
-
} & Omit<TokenFieldProps<T>, 'children' | 'className' | 'style'>;
|
|
58
|
+
} & Omit<TokenFieldProps$1<T>, 'children' | 'className' | 'style'>;
|
|
59
59
|
type TokenSegment = Parameters<TokenInputProps['children']>[0];
|
|
60
60
|
/**
|
|
61
61
|
* A labelled field whose value is text with inline tokens — a tag input, a
|
|
@@ -80,5 +80,5 @@ type TokenSegment = Parameters<TokenInputProps['children']>[0];
|
|
|
80
80
|
* The call site's `className` and `style` land on the field as a whole,
|
|
81
81
|
* which is the element a layout positions.
|
|
82
82
|
*/
|
|
83
|
-
declare function TokenField
|
|
84
|
-
export { type TokenFieldProps
|
|
83
|
+
declare function TokenField<T extends TokenFieldValue = TokenFieldValue>({ description, error, floatingLabel, label, leadingIcon, renderToken, trailingIcon, variant, ...props }: RefAttributes<HTMLDivElement> & TokenFieldProps<T>): import("react").JSX.Element;
|
|
84
|
+
export { type TokenFieldProps, type TokenSegment, TokenField as default };
|
|
@@ -9,7 +9,7 @@ import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
|
9
9
|
import { c } from "react/compiler-runtime";
|
|
10
10
|
import { useId, useLayoutEffect, useRef, useState } from "react";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { Token, TokenField, TokenInput } from "react-aria-components";
|
|
12
|
+
import { Token, TokenField as TokenField$1, TokenInput } from "react-aria-components";
|
|
13
13
|
// src/components/token-field/index.tsx
|
|
14
14
|
const styles = { token: {
|
|
15
15
|
kXLuUW: "xxymvpz",
|
|
@@ -57,7 +57,7 @@ function tokenContent(renderToken) {
|
|
|
57
57
|
* The call site's `className` and `style` land on the field as a whole,
|
|
58
58
|
* which is the element a layout positions.
|
|
59
59
|
*/
|
|
60
|
-
function TokenField
|
|
60
|
+
function TokenField(t0) {
|
|
61
61
|
const $ = c(35);
|
|
62
62
|
const { description, error, floatingLabel: t1, label, leadingIcon, renderToken, trailingIcon, variant: t2, ...props$1 } = t0;
|
|
63
63
|
const floatingLabel = t1 === void 0 ? true : t1;
|
|
@@ -90,7 +90,7 @@ function TokenField$1(t0) {
|
|
|
90
90
|
t5 = $[4];
|
|
91
91
|
}
|
|
92
92
|
useLayoutEffect(t4, t5);
|
|
93
|
-
const T0 = TokenField;
|
|
93
|
+
const T0 = TokenField$1;
|
|
94
94
|
const t6 = changeHandler(setHeld, props$1.onChange);
|
|
95
95
|
const t7 = mergeStatefulStyles(props(fieldStyles.root), props$1);
|
|
96
96
|
const t8 = props$1.isDisabled;
|
|
@@ -183,6 +183,6 @@ function TokenField$1(t0) {
|
|
|
183
183
|
} else t16 = $[34];
|
|
184
184
|
return t16;
|
|
185
185
|
}
|
|
186
|
-
export { TokenField
|
|
186
|
+
export { TokenField as default };
|
|
187
187
|
|
|
188
188
|
//# sourceMappingURL=index.js.map
|