@traefik-labs/faency 13.7.0 → 13.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/dist/components/AriaTable/AriaTable.cjs +48 -22
- package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
- package/dist/components/AriaTable/AriaTable.js +49 -23
- package/dist/components/AriaTable/AriaTable.js.map +1 -1
- package/dist/components/AriaTable/AriaTable.vanilla.cjs +8 -4
- package/dist/components/AriaTable/AriaTable.vanilla.cjs.map +1 -1
- package/dist/components/AriaTable/AriaTable.vanilla.css.cjs.map +1 -1
- package/dist/components/AriaTable/AriaTable.vanilla.css.js.map +1 -1
- package/dist/components/AriaTable/AriaTable.vanilla.js +8 -4
- package/dist/components/AriaTable/AriaTable.vanilla.js.map +1 -1
- package/dist/components/Avatar/Avatar.vanilla.cjs +5 -2
- package/dist/components/Avatar/Avatar.vanilla.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.vanilla.css.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.vanilla.css.js.map +1 -1
- package/dist/components/Avatar/Avatar.vanilla.js +5 -2
- package/dist/components/Avatar/Avatar.vanilla.js.map +1 -1
- package/dist/components/Badge/Badge.vanilla.cjs +2 -10
- package/dist/components/Badge/Badge.vanilla.cjs.map +1 -1
- package/dist/components/Badge/Badge.vanilla.css.cjs.map +1 -1
- package/dist/components/Badge/Badge.vanilla.css.js.map +1 -1
- package/dist/components/Badge/Badge.vanilla.js +2 -10
- package/dist/components/Badge/Badge.vanilla.js.map +1 -1
- package/dist/components/Blockquote/Blockquote.vanilla.cjs +5 -11
- package/dist/components/Blockquote/Blockquote.vanilla.cjs.map +1 -1
- package/dist/components/Blockquote/Blockquote.vanilla.css.cjs.map +1 -1
- package/dist/components/Blockquote/Blockquote.vanilla.css.js.map +1 -1
- package/dist/components/Blockquote/Blockquote.vanilla.js +5 -11
- package/dist/components/Blockquote/Blockquote.vanilla.js.map +1 -1
- package/dist/components/Box/Box.vanilla.cjs +2 -10
- package/dist/components/Box/Box.vanilla.cjs.map +1 -1
- package/dist/components/Box/Box.vanilla.css.cjs.map +1 -1
- package/dist/components/Box/Box.vanilla.css.js.map +1 -1
- package/dist/components/Box/Box.vanilla.js +2 -10
- package/dist/components/Box/Box.vanilla.js.map +1 -1
- package/dist/components/Bubble/Bubble.vanilla.cjs +2 -10
- package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -1
- package/dist/components/Bubble/Bubble.vanilla.css.cjs.map +1 -1
- package/dist/components/Bubble/Bubble.vanilla.css.js.map +1 -1
- package/dist/components/Bubble/Bubble.vanilla.js +2 -10
- package/dist/components/Bubble/Bubble.vanilla.js.map +1 -1
- package/dist/components/Button/Button.vanilla.cjs +2 -10
- package/dist/components/Button/Button.vanilla.cjs.map +1 -1
- package/dist/components/Button/Button.vanilla.css.cjs.map +1 -1
- package/dist/components/Button/Button.vanilla.css.js.map +1 -1
- package/dist/components/Button/Button.vanilla.js +2 -10
- package/dist/components/Button/Button.vanilla.js.map +1 -1
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs +3 -17
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.css.cjs.map +1 -1
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.css.js.map +1 -1
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js +3 -17
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js.map +1 -1
- package/dist/components/Card/Card.vanilla.cjs +6 -11
- package/dist/components/Card/Card.vanilla.cjs.map +1 -1
- package/dist/components/Card/Card.vanilla.css.cjs.map +1 -1
- package/dist/components/Card/Card.vanilla.css.js.map +1 -1
- package/dist/components/Card/Card.vanilla.js +6 -11
- package/dist/components/Card/Card.vanilla.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +3 -6
- package/dist/components/CodeBlock/CodeBlock.vanilla.cjs.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.vanilla.css.cjs.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.vanilla.css.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.vanilla.js +3 -6
- package/dist/components/CodeBlock/CodeBlock.vanilla.js.map +1 -1
- package/dist/components/Combobox/Combobox.vanilla.cjs +3 -10
- package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -1
- package/dist/components/Combobox/Combobox.vanilla.css.cjs.map +1 -1
- package/dist/components/Combobox/Combobox.vanilla.css.js.map +1 -1
- package/dist/components/Combobox/Combobox.vanilla.js +3 -10
- package/dist/components/Combobox/Combobox.vanilla.js.map +1 -1
- package/dist/components/Container/Container.vanilla.cjs +5 -11
- package/dist/components/Container/Container.vanilla.cjs.map +1 -1
- package/dist/components/Container/Container.vanilla.css.cjs.map +1 -1
- package/dist/components/Container/Container.vanilla.css.js.map +1 -1
- package/dist/components/Container/Container.vanilla.js +5 -11
- package/dist/components/Container/Container.vanilla.js.map +1 -1
- package/dist/components/Elevation/Elevation.vanilla.cjs +5 -11
- package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
- package/dist/components/Elevation/Elevation.vanilla.css.cjs.map +1 -1
- package/dist/components/Elevation/Elevation.vanilla.css.js.map +1 -1
- package/dist/components/Elevation/Elevation.vanilla.js +5 -11
- package/dist/components/Elevation/Elevation.vanilla.js.map +1 -1
- package/dist/components/Field/Field.vanilla.cjs +3 -9
- package/dist/components/Field/Field.vanilla.cjs.map +1 -1
- package/dist/components/Field/Field.vanilla.css.cjs.map +1 -1
- package/dist/components/Field/Field.vanilla.css.js.map +1 -1
- package/dist/components/Field/Field.vanilla.js +3 -9
- package/dist/components/Field/Field.vanilla.js.map +1 -1
- package/dist/components/Flex/Flex.vanilla.cjs +5 -11
- package/dist/components/Flex/Flex.vanilla.cjs.map +1 -1
- package/dist/components/Flex/Flex.vanilla.css.cjs.map +1 -1
- package/dist/components/Flex/Flex.vanilla.css.js.map +1 -1
- package/dist/components/Flex/Flex.vanilla.js +5 -11
- package/dist/components/Flex/Flex.vanilla.js.map +1 -1
- package/dist/components/Grid/Grid.vanilla.cjs +7 -11
- package/dist/components/Grid/Grid.vanilla.cjs.map +1 -1
- package/dist/components/Grid/Grid.vanilla.css.cjs.map +1 -1
- package/dist/components/Grid/Grid.vanilla.css.js.map +1 -1
- package/dist/components/Grid/Grid.vanilla.js +7 -11
- package/dist/components/Grid/Grid.vanilla.js.map +1 -1
- package/dist/components/Heading/Heading.vanilla.cjs +35 -0
- package/dist/components/Heading/Heading.vanilla.cjs.map +1 -0
- package/dist/components/Heading/Heading.vanilla.css.cjs +85 -0
- package/dist/components/Heading/Heading.vanilla.css.cjs.map +1 -0
- package/dist/components/Heading/Heading.vanilla.css.js +74 -0
- package/dist/components/Heading/Heading.vanilla.css.js.map +1 -0
- package/dist/components/Heading/Heading.vanilla.js +30 -0
- package/dist/components/Heading/Heading.vanilla.js.map +1 -0
- package/dist/components/IconButton/IconButton.vanilla.cjs +5 -11
- package/dist/components/IconButton/IconButton.vanilla.cjs.map +1 -1
- package/dist/components/IconButton/IconButton.vanilla.css.cjs.map +1 -1
- package/dist/components/IconButton/IconButton.vanilla.css.js.map +1 -1
- package/dist/components/IconButton/IconButton.vanilla.js +5 -11
- package/dist/components/IconButton/IconButton.vanilla.js.map +1 -1
- package/dist/components/Image/Image.vanilla.cjs +2 -10
- package/dist/components/Image/Image.vanilla.cjs.map +1 -1
- package/dist/components/Image/Image.vanilla.css.cjs.map +1 -1
- package/dist/components/Image/Image.vanilla.css.js.map +1 -1
- package/dist/components/Image/Image.vanilla.js +2 -10
- package/dist/components/Image/Image.vanilla.js.map +1 -1
- package/dist/components/Input/Input.vanilla.cjs +2 -10
- package/dist/components/Input/Input.vanilla.cjs.map +1 -1
- package/dist/components/Input/Input.vanilla.css.cjs.map +1 -1
- package/dist/components/Input/Input.vanilla.css.js.map +1 -1
- package/dist/components/Input/Input.vanilla.js +2 -10
- package/dist/components/Input/Input.vanilla.js.map +1 -1
- package/dist/components/Label/Label.vanilla.cjs +5 -11
- package/dist/components/Label/Label.vanilla.cjs.map +1 -1
- package/dist/components/Label/Label.vanilla.css.cjs.map +1 -1
- package/dist/components/Label/Label.vanilla.css.js.map +1 -1
- package/dist/components/Label/Label.vanilla.js +5 -11
- package/dist/components/Label/Label.vanilla.js.map +1 -1
- package/dist/components/List/List.vanilla.cjs +10 -18
- package/dist/components/List/List.vanilla.cjs.map +1 -1
- package/dist/components/List/List.vanilla.css.cjs.map +1 -1
- package/dist/components/List/List.vanilla.css.js.map +1 -1
- package/dist/components/List/List.vanilla.js +7 -15
- package/dist/components/List/List.vanilla.js.map +1 -1
- package/dist/components/Meter/Meter.vanilla.cjs +3 -8
- package/dist/components/Meter/Meter.vanilla.cjs.map +1 -1
- package/dist/components/Meter/Meter.vanilla.css.cjs.map +1 -1
- package/dist/components/Meter/Meter.vanilla.css.js.map +1 -1
- package/dist/components/Meter/Meter.vanilla.js +3 -8
- package/dist/components/Meter/Meter.vanilla.js.map +1 -1
- package/dist/components/Panel/Panel.vanilla.cjs +2 -10
- package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
- package/dist/components/Panel/Panel.vanilla.css.cjs.map +1 -1
- package/dist/components/Panel/Panel.vanilla.css.js.map +1 -1
- package/dist/components/Panel/Panel.vanilla.js +2 -10
- package/dist/components/Panel/Panel.vanilla.js.map +1 -1
- package/dist/components/Paragraph/Paragraph.vanilla.cjs +5 -11
- package/dist/components/Paragraph/Paragraph.vanilla.cjs.map +1 -1
- package/dist/components/Paragraph/Paragraph.vanilla.css.cjs.map +1 -1
- package/dist/components/Paragraph/Paragraph.vanilla.css.js.map +1 -1
- package/dist/components/Paragraph/Paragraph.vanilla.js +5 -11
- package/dist/components/Paragraph/Paragraph.vanilla.js.map +1 -1
- package/dist/components/RowLink/RowLink.vanilla.cjs.map +1 -1
- package/dist/components/RowLink/RowLink.vanilla.css.cjs.map +1 -1
- package/dist/components/RowLink/RowLink.vanilla.css.js.map +1 -1
- package/dist/components/RowLink/RowLink.vanilla.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +3 -14
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.cjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +3 -14
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.vanilla.cjs +2 -10
- package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.vanilla.css.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.vanilla.css.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.vanilla.js +2 -10
- package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -1
- package/dist/components/Spinner/Spinner.vanilla.cjs +3 -6
- package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -1
- package/dist/components/Spinner/Spinner.vanilla.css.cjs.map +1 -1
- package/dist/components/Spinner/Spinner.vanilla.css.js.map +1 -1
- package/dist/components/Spinner/Spinner.vanilla.js +3 -6
- package/dist/components/Spinner/Spinner.vanilla.js.map +1 -1
- package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +3 -10
- package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -1
- package/dist/components/SplitLayout/SplitLayout.vanilla.css.cjs.map +1 -1
- package/dist/components/SplitLayout/SplitLayout.vanilla.css.js.map +1 -1
- package/dist/components/SplitLayout/SplitLayout.vanilla.js +3 -10
- package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -1
- package/dist/components/Table/Table.vanilla.cjs +8 -4
- package/dist/components/Table/Table.vanilla.cjs.map +1 -1
- package/dist/components/Table/Table.vanilla.css.cjs.map +1 -1
- package/dist/components/Table/Table.vanilla.css.js.map +1 -1
- package/dist/components/Table/Table.vanilla.js +8 -4
- package/dist/components/Table/Table.vanilla.js.map +1 -1
- package/dist/components/Text/Text.vanilla.cjs +5 -11
- package/dist/components/Text/Text.vanilla.cjs.map +1 -1
- package/dist/components/Text/Text.vanilla.css.cjs.map +1 -1
- package/dist/components/Text/Text.vanilla.css.js.map +1 -1
- package/dist/components/Text/Text.vanilla.js +5 -11
- package/dist/components/Text/Text.vanilla.js.map +1 -1
- package/dist/components/TextField/TextField.vanilla.cjs.map +1 -1
- package/dist/components/TextField/TextField.vanilla.css.cjs.map +1 -1
- package/dist/components/TextField/TextField.vanilla.css.js.map +1 -1
- package/dist/components/TextField/TextField.vanilla.js.map +1 -1
- package/dist/components/Textarea/Textarea.vanilla.cjs +2 -10
- package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.vanilla.css.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.vanilla.css.js.map +1 -1
- package/dist/components/Textarea/Textarea.vanilla.js +2 -10
- package/dist/components/Textarea/Textarea.vanilla.js.map +1 -1
- package/dist/components/Toast/Toast.vanilla.cjs +4 -15
- package/dist/components/Toast/Toast.vanilla.cjs.map +1 -1
- package/dist/components/Toast/Toast.vanilla.css.cjs.map +1 -1
- package/dist/components/Toast/Toast.vanilla.css.js.map +1 -1
- package/dist/components/Toast/Toast.vanilla.js +4 -15
- package/dist/components/Toast/Toast.vanilla.js.map +1 -1
- package/dist/faency.css +118 -2
- package/dist/index.cjs +9 -0
- package/dist/index.d.cts +36800 -0
- package/dist/index.d.ts +248 -94
- package/dist/index.js +3 -1
- package/dist/styles/recipeVariants.cjs +15 -0
- package/dist/styles/recipeVariants.cjs.map +1 -0
- package/dist/styles/recipeVariants.js +15 -0
- package/dist/styles/recipeVariants.js.map +1 -0
- package/dist/styles/themeContext.cjs.map +1 -1
- package/dist/styles/themeContext.js.map +1 -1
- package/dist/styles/themes.css.cjs.map +1 -1
- package/dist/styles/themes.css.js.map +1 -1
- package/dist/styles/tokens.css.cjs.map +1 -1
- package/dist/styles/tokens.css.js.map +1 -1
- package/dist/utils/warnOnce.cjs +8 -1
- package/dist/utils/warnOnce.cjs.map +1 -1
- package/dist/utils/warnOnce.js +8 -1
- package/dist/utils/warnOnce.js.map +1 -1
- package/package.json +32 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.vanilla.cjs","names":["forwardRef","cx","tableRecipe","rowLinkTable","useInlineStyle","captionRecipe","thead","tbody","tfoot","ARIA_SORT","thRecipe","SortButtonVanilla","tdRecipe","useState","useId","collapsedContent","_Fragment","trRecipe","rowLinkRow","handleRowClick","stopEvent","ExpandToggleVanilla","mapRowLink","RowLinkVanilla"],"sources":["../../../components/Table/Table.vanilla.tsx"],"sourcesContent":["import { RecipeVariants } from '@vanilla-extract/recipes';\nimport React, { forwardRef, ReactNode, useId, useState } from 'react';\n\nimport { CSSProps } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useInlineStyle } from '../../styles/useInlineStyle';\nimport {\n handleRowClick,\n mapRowLink,\n openRowLink,\n RowLinkShortcutProps,\n} from '../RowLink/RowLink.utils';\nimport { RowLinkVanilla } from '../RowLink/RowLink.vanilla';\nimport { rowLinkRow, rowLinkTable } from '../RowLink/RowLink.vanilla.css';\nimport { ExpandToggleVanilla, stopEvent } from './ExpandToggle.vanilla';\nimport { ARIA_SORT, SortButtonVanilla } from './SortButton.vanilla';\nimport {\n captionRecipe,\n collapsedCell,\n collapsedContent as collapsedContentClass,\n emptyHeaderCell,\n tableRecipe,\n tbody,\n tdRecipe,\n tfoot,\n thead,\n thRecipe,\n toggleCell,\n trRecipe,\n} from './Table.vanilla.css';\nimport { TableSortProps } from './useTableSort';\n\ntype TableRecipeVariants = NonNullable<RecipeVariants<typeof tableRecipe>>;\ntype CaptionRecipeVariants = NonNullable<RecipeVariants<typeof captionRecipe>>;\ntype TrRecipeVariants = NonNullable<RecipeVariants<typeof trRecipe>>;\ntype ThRecipeVariants = NonNullable<RecipeVariants<typeof thRecipe>>;\ntype TdRecipeVariants = NonNullable<RecipeVariants<typeof tdRecipe>>;\n\nexport type TableVanillaProps = React.TableHTMLAttributes<HTMLTableElement> &\n CSSProps &\n TableRecipeVariants;\n\nexport const TableVanilla = forwardRef<HTMLTableElement, TableVanillaProps>(\n ({ elevation, className, css, style, ...props }, ref) => (\n <table\n ref={ref}\n className={cx(tableRecipe({ elevation }), rowLinkTable, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTableVanilla.displayName = 'TableVanilla';\n\nexport type CaptionVanillaProps = React.HTMLAttributes<HTMLTableCaptionElement> &\n CSSProps &\n CaptionRecipeVariants;\n\nexport const CaptionVanilla = forwardRef<HTMLTableCaptionElement, CaptionVanillaProps>(\n (\n { size, weight, variant, gradient, transform, noWrap, className, css, style, ...props },\n ref,\n ) => (\n <caption\n ref={ref}\n className={cx(\n captionRecipe({ size, weight, variant, gradient, transform, noWrap }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nCaptionVanilla.displayName = 'CaptionVanilla';\n\nexport type TableSectionVanillaProps = React.HTMLAttributes<HTMLTableSectionElement> & CSSProps;\n\nconst section = (Tag: 'thead' | 'tbody' | 'tfoot', sectionClass: string, displayName: string) => {\n const Section = forwardRef<HTMLTableSectionElement, TableSectionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <Tag\n ref={ref}\n className={cx(sectionClass, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n );\n Section.displayName = displayName;\n return Section;\n};\n\nexport const TheadVanilla = section('thead', thead, 'TheadVanilla');\nexport const TbodyVanilla = section('tbody', tbody, 'TbodyVanilla');\nexport const TfootVanilla = section('tfoot', tfoot, 'TfootVanilla');\n\nexport type ThVanillaProps = Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n ThRecipeVariants &\n TableSortProps;\n\nexport const ThVanilla = forwardRef<HTMLTableCellElement, ThVanillaProps>(\n (\n {\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n align,\n sort,\n onSort,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => (\n <th\n ref={ref}\n aria-sort={sort && ARIA_SORT[sort]}\n className={cx(\n thRecipe({ size, weight, variant, gradient, transform, noWrap, align }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {onSort ? (\n <SortButtonVanilla sort={sort} onSort={onSort}>\n {children}\n </SortButtonVanilla>\n ) : (\n children\n )}\n </th>\n ),\n);\n\nThVanilla.displayName = 'ThVanilla';\n\nexport type TdVanillaProps = Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n TdRecipeVariants;\n\nexport const TdVanilla = forwardRef<HTMLTableCellElement, TdVanillaProps>(\n ({ subtle, align, className, css, style, ...props }, ref) => (\n <td\n ref={ref}\n className={cx(tdRecipe({ subtle, align }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTdVanilla.displayName = 'TdVanilla';\n\nexport type TrVanillaProps = React.HTMLAttributes<HTMLTableRowElement> &\n CSSProps &\n TrRecipeVariants &\n RowLinkShortcutProps & {\n /** Content shown in a full-width row below, toggled by a button in a new first cell. */\n collapsedContent?: ReactNode;\n /** Column span of the collapsed content row; set it to the number of columns. */\n collapsedContentColSpan?: number;\n /** Accessible name of the expand button. */\n expandLabel?: string;\n /** Adds an empty first cell, to line up with rows that have an expand button. */\n emptyFirstColumn?: boolean;\n /** Styles the empty first cell as a header, for a row in `TheadVanilla`. */\n tableHead?: boolean;\n };\n\nexport const TrVanilla = forwardRef<HTMLTableRowElement, TrVanillaProps>(\n (\n {\n collapsedContent,\n collapsedContentColSpan = 1,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n href,\n linkAs,\n linkCell,\n linkProps,\n linkOverlay,\n interactive,\n active,\n className,\n css,\n style,\n children,\n onClick,\n onAuxClick,\n ...props\n },\n ref,\n ) => {\n const [isOpen, setIsOpen] = useState(false);\n const contentId = useId();\n const inlineStyle = useInlineStyle(css, style);\n const collapsible = !!collapsedContent;\n\n return (\n <>\n <tr\n ref={ref}\n className={cx(\n trRecipe({ interactive: interactive ?? (href !== undefined || undefined), active }),\n rowLinkRow,\n className,\n )}\n data-collapsed={collapsible && !isOpen ? '' : undefined}\n style={inlineStyle}\n onClick={(event) => handleRowClick(event, onClick)}\n onAuxClick={(event) => {\n onAuxClick?.(event);\n openRowLink(event);\n }}\n {...props}\n >\n {emptyFirstColumn &&\n (tableHead ? <td className={cx(thRecipe(), emptyHeaderCell)} /> : <TdVanilla />)}\n {collapsible && (\n <TdVanilla className={toggleCell} onClick={stopEvent}>\n <ExpandToggleVanilla\n label={expandLabel}\n isOpen={isOpen}\n controls={contentId}\n onToggle={() => setIsOpen((open) => !open)}\n />\n </TdVanilla>\n )}\n {mapRowLink(\n children,\n { href, linkAs, linkCell, linkProps, linkOverlay },\n TdVanilla,\n RowLinkVanilla,\n { row: 'TrVanilla', cell: 'TdVanilla' },\n )}\n </tr>\n {collapsible && (\n <TrVanilla>\n <TdVanilla\n id={contentId}\n colSpan={collapsedContentColSpan}\n className={collapsedCell}\n data-closed={isOpen ? undefined : ''}\n >\n <div className={collapsedContentClass}>{collapsedContent}</div>\n </TdVanilla>\n </TrVanilla>\n )}\n </>\n );\n },\n);\n\nTrVanilla.displayName = 'TrVanilla';\n"],"mappings":";;;;;;;;;;;;;AA0CA,IAAa,gBAAA,GAAeA,MAAAA,WAAAA,EACzB,EAAE,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAC/C,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;CACO;CACL,WAAWC,WAAAA,GAAGC,0BAAAA,YAAY,EAAE,UAAU,CAAC,GAAGC,4BAAAA,cAAc,SAAS;CACjE,OAAOC,uBAAAA,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,aAAa,cAAc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EAdN,UAAA;GAgBG,qBACE,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD,EAAI,WAAWlB,WAAAA,GAAGS,0BAAAA,SAAS,GAAA,YAAkB,EAAI,CAAA,IAAI,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD,CAAY,CAAA;GAC/E,eACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;IAAW,WAAA;IAAuB,SAASU,6BAAAA;IACzC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAAA,qBAAD;KACE,OAAO;KACC;KACR,UAAU;KACV,gBAAgB,WAAW,SAAS,CAAC,IAAI;IAC1C,CAAA;GACQ,CAAA;GAEZC,sBAAAA,WACC,UACA;IAAE;IAAM;IAAQ;IAAU;IAAW;GAAY,GACjD,WACAC,wBAAAA,gBACA;IAAE,KAAK;IAAa,MAAM;GAAY,CACxC;EACE;CACH,CAAA,GAAA,eACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACE,IAAI;EACJ,SAAS;EACT,WAAA;EACA,eAAa,SAAS,KAAA,IAAY;EAElC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAA;GAAmC,UAAAR;EAAsB,CAAA;CACrD,CAAA,EACF,CAAA,CAEb,EAAA,CAAA;AAEN,CACF;AAEA,UAAU,cAAc"}
|
|
1
|
+
{"version":3,"file":"Table.vanilla.cjs","names":["withVariantKeys","captionRecipe","tableRecipe","thRecipe","forwardRef","cx","rowLinkTable","useInlineStyle","thead","tbody","tfoot","ARIA_SORT","SortButtonVanilla","tdRecipe","useState","useId","collapsedContent","_Fragment","trRecipe","rowLinkRow","handleRowClick","stopEvent","ExpandToggleVanilla","mapRowLink","RowLinkVanilla"],"sources":["../../../components/Table/Table.vanilla.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, useId, useState } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport {\n handleRowClick,\n mapRowLink,\n openRowLink,\n RowLinkShortcutProps,\n} from '@/components/RowLink/RowLink.utils';\nimport { RowLinkVanilla } from '@/components/RowLink/RowLink.vanilla';\nimport { rowLinkRow, rowLinkTable } from '@/components/RowLink/RowLink.vanilla.css';\n\nimport { ExpandToggleVanilla, stopEvent } from './ExpandToggle.vanilla';\nimport { ARIA_SORT, SortButtonVanilla } from './SortButton.vanilla';\nimport {\n captionRecipe,\n collapsedCell,\n collapsedContent as collapsedContentClass,\n emptyHeaderCell,\n tableRecipe,\n tbody,\n tdRecipe,\n tfoot,\n thead,\n thRecipe,\n toggleCell,\n trRecipe,\n} from './Table.vanilla.css';\nimport { TableSortProps } from './useTableSort';\n\nconst captionClass = withVariantKeys(captionRecipe);\nconst tableClass = withVariantKeys(tableRecipe);\nconst thClass = withVariantKeys(thRecipe);\n\ntype TableRecipeVariants = RecipeVariantProps<typeof tableRecipe>;\ntype CaptionRecipeVariants = RecipeVariantProps<typeof captionRecipe>;\ntype TrRecipeVariants = RecipeVariantProps<typeof trRecipe>;\ntype ThRecipeVariants = RecipeVariantProps<typeof thRecipe>;\ntype TdRecipeVariants = RecipeVariantProps<typeof tdRecipe>;\n\nexport type TableVanillaProps = React.TableHTMLAttributes<HTMLTableElement> &\n CSSProps &\n TableRecipeVariants;\n\nexport const TableVanilla = forwardRef<HTMLTableElement, TableVanillaProps>(\n ({ elevation, className, css, style, ...props }, ref) => (\n <table\n ref={ref}\n className={cx(tableClass({ elevation }), rowLinkTable, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTableVanilla.displayName = 'TableVanilla';\n\nexport type CaptionVanillaProps = React.HTMLAttributes<HTMLTableCaptionElement> &\n CSSProps &\n CaptionRecipeVariants;\n\nexport const CaptionVanilla = forwardRef<HTMLTableCaptionElement, CaptionVanillaProps>(\n (\n { size, weight, variant, gradient, transform, noWrap, className, css, style, ...props },\n ref,\n ) => (\n <caption\n ref={ref}\n className={cx(\n captionClass({ size, weight, variant, gradient, transform, noWrap }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nCaptionVanilla.displayName = 'CaptionVanilla';\n\nexport type TableSectionVanillaProps = React.HTMLAttributes<HTMLTableSectionElement> & CSSProps;\n\nconst section = (Tag: 'thead' | 'tbody' | 'tfoot', sectionClass: string, displayName: string) => {\n const Section = forwardRef<HTMLTableSectionElement, TableSectionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <Tag\n ref={ref}\n className={cx(sectionClass, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n );\n Section.displayName = displayName;\n return Section;\n};\n\nexport const TheadVanilla = section('thead', thead, 'TheadVanilla');\nexport const TbodyVanilla = section('tbody', tbody, 'TbodyVanilla');\nexport const TfootVanilla = section('tfoot', tfoot, 'TfootVanilla');\n\nexport type ThVanillaProps = Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n ThRecipeVariants &\n TableSortProps;\n\nexport const ThVanilla = forwardRef<HTMLTableCellElement, ThVanillaProps>(\n (\n {\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n align,\n sort,\n onSort,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => (\n <th\n ref={ref}\n aria-sort={sort && ARIA_SORT[sort]}\n className={cx(\n thClass({ size, weight, variant, gradient, transform, noWrap, align }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {onSort ? (\n <SortButtonVanilla sort={sort} onSort={onSort}>\n {children}\n </SortButtonVanilla>\n ) : (\n children\n )}\n </th>\n ),\n);\n\nThVanilla.displayName = 'ThVanilla';\n\nexport type TdVanillaProps = Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n TdRecipeVariants;\n\nexport const TdVanilla = forwardRef<HTMLTableCellElement, TdVanillaProps>(\n ({ subtle, align, className, css, style, ...props }, ref) => (\n <td\n ref={ref}\n className={cx(tdRecipe({ subtle, align }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTdVanilla.displayName = 'TdVanilla';\n\nexport type TrVanillaProps = React.HTMLAttributes<HTMLTableRowElement> &\n CSSProps &\n TrRecipeVariants &\n RowLinkShortcutProps & {\n /** Content shown in a full-width row below, toggled by a button in a new first cell. */\n collapsedContent?: ReactNode;\n /** Column span of the collapsed content row; set it to the number of columns. */\n collapsedContentColSpan?: number;\n /** Accessible name of the expand button. */\n expandLabel?: string;\n /** Adds an empty first cell, to line up with rows that have an expand button. */\n emptyFirstColumn?: boolean;\n /** Styles the empty first cell as a header, for a row in `TheadVanilla`. */\n tableHead?: boolean;\n };\n\nexport const TrVanilla = forwardRef<HTMLTableRowElement, TrVanillaProps>(\n (\n {\n collapsedContent,\n collapsedContentColSpan = 1,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n href,\n linkAs,\n linkCell,\n linkProps,\n linkOverlay,\n interactive,\n active,\n className,\n css,\n style,\n children,\n onClick,\n onAuxClick,\n ...props\n },\n ref,\n ) => {\n const [isOpen, setIsOpen] = useState(false);\n const contentId = useId();\n const inlineStyle = useInlineStyle(css, style);\n const collapsible = !!collapsedContent;\n\n return (\n <>\n <tr\n ref={ref}\n className={cx(\n trRecipe({ interactive: interactive ?? (href !== undefined || undefined), active }),\n rowLinkRow,\n className,\n )}\n data-collapsed={collapsible && !isOpen ? '' : undefined}\n style={inlineStyle}\n onClick={(event) => handleRowClick(event, onClick)}\n onAuxClick={(event) => {\n onAuxClick?.(event);\n openRowLink(event);\n }}\n {...props}\n >\n {emptyFirstColumn &&\n (tableHead ? <td className={cx(thClass(), emptyHeaderCell)} /> : <TdVanilla />)}\n {collapsible && (\n <TdVanilla className={toggleCell} onClick={stopEvent}>\n <ExpandToggleVanilla\n label={expandLabel}\n isOpen={isOpen}\n controls={contentId}\n onToggle={() => setIsOpen((open) => !open)}\n />\n </TdVanilla>\n )}\n {mapRowLink(\n children,\n { href, linkAs, linkCell, linkProps, linkOverlay },\n TdVanilla,\n RowLinkVanilla,\n { row: 'TrVanilla', cell: 'TdVanilla' },\n )}\n </tr>\n {collapsible && (\n <TrVanilla>\n <TdVanilla\n id={contentId}\n colSpan={collapsedContentColSpan}\n className={collapsedCell}\n data-closed={isOpen ? undefined : ''}\n >\n <div className={collapsedContentClass}>{collapsedContent}</div>\n </TdVanilla>\n </TrVanilla>\n )}\n </>\n );\n },\n);\n\nTrVanilla.displayName = 'TrVanilla';\n"],"mappings":";;;;;;;;;;;;;;AAkCA,IAAM,eAAeA,uBAAAA,gBAAgBC,0BAAAA,aAAa;AAClD,IAAM,aAAaD,uBAAAA,gBAAgBE,0BAAAA,WAAW;AAC9C,IAAM,UAAUF,uBAAAA,gBAAgBG,0BAAAA,QAAQ;AAYxC,IAAa,gBAAA,GAAeC,MAAAA,WAAAA,EACzB,EAAE,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAC/C,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;CACO;CACL,WAAWC,WAAAA,GAAG,WAAW,EAAE,UAAU,CAAC,GAAGC,4BAAAA,cAAc,SAAS;CAChE,OAAOC,uBAAAA,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,aAAa,cAAc;AAM3B,IAAa,kBAAA,GAAiBH,MAAAA,WAAAA,EAE1B,EAAE,MAAM,QAAQ,SAAS,UAAU,WAAW,QAAQ,WAAW,KAAK,OAAO,GAAG,SAChF,QAEA,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;CACO;CACL,WAAWC,WAAAA,GACT,aAAa;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC,GACnE,SACF;CACA,OAAOE,uBAAAA,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;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AU;KACV,gBAAgB,WAAW,SAAS,CAAC,IAAI;IAC1C,CAAA;GACQ,CAAA;GAEZC,sBAAAA,WACC,UACA;IAAE;IAAM;IAAQ;IAAU;IAAW;GAAY,GACjD,WACAC,wBAAAA,gBACA;IAAE,KAAK;IAAa,MAAM;GAAY,CACxC;EACE;CACH,CAAA,GAAA,eACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACE,IAAI;EACJ,SAAS;EACT,WAAA;EACA,eAAa,SAAS,KAAA,IAAY;EAElC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAA;GAAmC,UAAAR;EAAsB,CAAA;CACrD,CAAA,EACF,CAAA,CAEb,EAAA,CAAA;AAEN,CACF;AAEA,UAAU,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.vanilla.css.cjs","names":[
|
|
1
|
+
{"version":3,"file":"Table.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.vanilla.css.js","names":[
|
|
1
|
+
{"version":3,"file":"Table.vanilla.css.js","names":[],"sources":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cx } from "../../styles/cx.js";
|
|
2
|
+
import { withVariantKeys } from "../../styles/recipeVariants.js";
|
|
2
3
|
import { useInlineStyle } from "../../styles/useInlineStyle.js";
|
|
3
4
|
import { handleRowClick, mapRowLink, openRowLink } from "../RowLink/RowLink.utils.js";
|
|
4
5
|
import { RowLinkVanilla } from "../RowLink/RowLink.vanilla.js";
|
|
@@ -9,16 +10,19 @@ import { captionRecipe, tableRecipe, tbody, tdRecipe, tfoot, thRecipe, thead, tr
|
|
|
9
10
|
import { forwardRef, useId, useState } from "react";
|
|
10
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
// components/Table/Table.vanilla.tsx
|
|
13
|
+
var captionClass = withVariantKeys(captionRecipe);
|
|
14
|
+
var tableClass = withVariantKeys(tableRecipe);
|
|
15
|
+
var thClass = withVariantKeys(thRecipe);
|
|
12
16
|
var TableVanilla = forwardRef(({ elevation, className, css, style, ...props }, ref) => /* @__PURE__ */ jsx("table", {
|
|
13
17
|
ref,
|
|
14
|
-
className: cx(
|
|
18
|
+
className: cx(tableClass({ elevation }), rowLinkTable, className),
|
|
15
19
|
style: useInlineStyle(css, style),
|
|
16
20
|
...props
|
|
17
21
|
}));
|
|
18
22
|
TableVanilla.displayName = "TableVanilla";
|
|
19
23
|
var CaptionVanilla = forwardRef(({ size, weight, variant, gradient, transform, noWrap, className, css, style, ...props }, ref) => /* @__PURE__ */ jsx("caption", {
|
|
20
24
|
ref,
|
|
21
|
-
className: cx(
|
|
25
|
+
className: cx(captionClass({
|
|
22
26
|
size,
|
|
23
27
|
weight,
|
|
24
28
|
variant,
|
|
@@ -46,7 +50,7 @@ var TfootVanilla = section("tfoot", tfoot, "TfootVanilla");
|
|
|
46
50
|
var ThVanilla = forwardRef(({ size, weight, variant, gradient, transform, noWrap, align, sort, onSort, className, css, style, children, ...props }, ref) => /* @__PURE__ */ jsx("th", {
|
|
47
51
|
ref,
|
|
48
52
|
"aria-sort": sort && ARIA_SORT[sort],
|
|
49
|
-
className: cx(
|
|
53
|
+
className: cx(thClass({
|
|
50
54
|
size,
|
|
51
55
|
weight,
|
|
52
56
|
variant,
|
|
@@ -94,7 +98,7 @@ var TrVanilla = forwardRef(({ collapsedContent: collapsedContent$1, collapsedCon
|
|
|
94
98
|
},
|
|
95
99
|
...props,
|
|
96
100
|
children: [
|
|
97
|
-
emptyFirstColumn && (tableHead ? /* @__PURE__ */ jsx("td", { className: cx(
|
|
101
|
+
emptyFirstColumn && (tableHead ? /* @__PURE__ */ jsx("td", { className: cx(thClass(), "_1aa2xbm2e") }) : /* @__PURE__ */ jsx(TdVanilla, {})),
|
|
98
102
|
collapsible && /* @__PURE__ */ jsx(TdVanilla, {
|
|
99
103
|
className: "_1aa2xbm2l",
|
|
100
104
|
onClick: stopEvent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.vanilla.js","names":["collapsedContent","_Fragment"],"sources":["../../../components/Table/Table.vanilla.tsx"],"sourcesContent":["import { RecipeVariants } from '@vanilla-extract/recipes';\nimport React, { forwardRef, ReactNode, useId, useState } from 'react';\n\nimport { CSSProps } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useInlineStyle } from '../../styles/useInlineStyle';\nimport {\n handleRowClick,\n mapRowLink,\n openRowLink,\n RowLinkShortcutProps,\n} from '../RowLink/RowLink.utils';\nimport { RowLinkVanilla } from '../RowLink/RowLink.vanilla';\nimport { rowLinkRow, rowLinkTable } from '../RowLink/RowLink.vanilla.css';\nimport { ExpandToggleVanilla, stopEvent } from './ExpandToggle.vanilla';\nimport { ARIA_SORT, SortButtonVanilla } from './SortButton.vanilla';\nimport {\n captionRecipe,\n collapsedCell,\n collapsedContent as collapsedContentClass,\n emptyHeaderCell,\n tableRecipe,\n tbody,\n tdRecipe,\n tfoot,\n thead,\n thRecipe,\n toggleCell,\n trRecipe,\n} from './Table.vanilla.css';\nimport { TableSortProps } from './useTableSort';\n\ntype TableRecipeVariants = NonNullable<RecipeVariants<typeof tableRecipe>>;\ntype CaptionRecipeVariants = NonNullable<RecipeVariants<typeof captionRecipe>>;\ntype TrRecipeVariants = NonNullable<RecipeVariants<typeof trRecipe>>;\ntype ThRecipeVariants = NonNullable<RecipeVariants<typeof thRecipe>>;\ntype TdRecipeVariants = NonNullable<RecipeVariants<typeof tdRecipe>>;\n\nexport type TableVanillaProps = React.TableHTMLAttributes<HTMLTableElement> &\n CSSProps &\n TableRecipeVariants;\n\nexport const TableVanilla = forwardRef<HTMLTableElement, TableVanillaProps>(\n ({ elevation, className, css, style, ...props }, ref) => (\n <table\n ref={ref}\n className={cx(tableRecipe({ elevation }), rowLinkTable, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTableVanilla.displayName = 'TableVanilla';\n\nexport type CaptionVanillaProps = React.HTMLAttributes<HTMLTableCaptionElement> &\n CSSProps &\n CaptionRecipeVariants;\n\nexport const CaptionVanilla = forwardRef<HTMLTableCaptionElement, CaptionVanillaProps>(\n (\n { size, weight, variant, gradient, transform, noWrap, className, css, style, ...props },\n ref,\n ) => (\n <caption\n ref={ref}\n className={cx(\n captionRecipe({ size, weight, variant, gradient, transform, noWrap }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nCaptionVanilla.displayName = 'CaptionVanilla';\n\nexport type TableSectionVanillaProps = React.HTMLAttributes<HTMLTableSectionElement> & CSSProps;\n\nconst section = (Tag: 'thead' | 'tbody' | 'tfoot', sectionClass: string, displayName: string) => {\n const Section = forwardRef<HTMLTableSectionElement, TableSectionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <Tag\n ref={ref}\n className={cx(sectionClass, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n );\n Section.displayName = displayName;\n return Section;\n};\n\nexport const TheadVanilla = section('thead', thead, 'TheadVanilla');\nexport const TbodyVanilla = section('tbody', tbody, 'TbodyVanilla');\nexport const TfootVanilla = section('tfoot', tfoot, 'TfootVanilla');\n\nexport type ThVanillaProps = Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n ThRecipeVariants &\n TableSortProps;\n\nexport const ThVanilla = forwardRef<HTMLTableCellElement, ThVanillaProps>(\n (\n {\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n align,\n sort,\n onSort,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => (\n <th\n ref={ref}\n aria-sort={sort && ARIA_SORT[sort]}\n className={cx(\n thRecipe({ size, weight, variant, gradient, transform, noWrap, align }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {onSort ? (\n <SortButtonVanilla sort={sort} onSort={onSort}>\n {children}\n </SortButtonVanilla>\n ) : (\n children\n )}\n </th>\n ),\n);\n\nThVanilla.displayName = 'ThVanilla';\n\nexport type TdVanillaProps = Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n TdRecipeVariants;\n\nexport const TdVanilla = forwardRef<HTMLTableCellElement, TdVanillaProps>(\n ({ subtle, align, className, css, style, ...props }, ref) => (\n <td\n ref={ref}\n className={cx(tdRecipe({ subtle, align }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTdVanilla.displayName = 'TdVanilla';\n\nexport type TrVanillaProps = React.HTMLAttributes<HTMLTableRowElement> &\n CSSProps &\n TrRecipeVariants &\n RowLinkShortcutProps & {\n /** Content shown in a full-width row below, toggled by a button in a new first cell. */\n collapsedContent?: ReactNode;\n /** Column span of the collapsed content row; set it to the number of columns. */\n collapsedContentColSpan?: number;\n /** Accessible name of the expand button. */\n expandLabel?: string;\n /** Adds an empty first cell, to line up with rows that have an expand button. */\n emptyFirstColumn?: boolean;\n /** Styles the empty first cell as a header, for a row in `TheadVanilla`. */\n tableHead?: boolean;\n };\n\nexport const TrVanilla = forwardRef<HTMLTableRowElement, TrVanillaProps>(\n (\n {\n collapsedContent,\n collapsedContentColSpan = 1,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n href,\n linkAs,\n linkCell,\n linkProps,\n linkOverlay,\n interactive,\n active,\n className,\n css,\n style,\n children,\n onClick,\n onAuxClick,\n ...props\n },\n ref,\n ) => {\n const [isOpen, setIsOpen] = useState(false);\n const contentId = useId();\n const inlineStyle = useInlineStyle(css, style);\n const collapsible = !!collapsedContent;\n\n return (\n <>\n <tr\n ref={ref}\n className={cx(\n trRecipe({ interactive: interactive ?? (href !== undefined || undefined), active }),\n rowLinkRow,\n className,\n )}\n data-collapsed={collapsible && !isOpen ? '' : undefined}\n style={inlineStyle}\n onClick={(event) => handleRowClick(event, onClick)}\n onAuxClick={(event) => {\n onAuxClick?.(event);\n openRowLink(event);\n }}\n {...props}\n >\n {emptyFirstColumn &&\n (tableHead ? <td className={cx(thRecipe(), emptyHeaderCell)} /> : <TdVanilla />)}\n {collapsible && (\n <TdVanilla className={toggleCell} onClick={stopEvent}>\n <ExpandToggleVanilla\n label={expandLabel}\n isOpen={isOpen}\n controls={contentId}\n onToggle={() => setIsOpen((open) => !open)}\n />\n </TdVanilla>\n )}\n {mapRowLink(\n children,\n { href, linkAs, linkCell, linkProps, linkOverlay },\n TdVanilla,\n RowLinkVanilla,\n { row: 'TrVanilla', cell: 'TdVanilla' },\n )}\n </tr>\n {collapsible && (\n <TrVanilla>\n <TdVanilla\n id={contentId}\n colSpan={collapsedContentColSpan}\n className={collapsedCell}\n data-closed={isOpen ? undefined : ''}\n >\n <div className={collapsedContentClass}>{collapsedContent}</div>\n </TdVanilla>\n </TrVanilla>\n )}\n </>\n );\n },\n);\n\nTrVanilla.displayName = 'TrVanilla';\n"],"mappings":";;;;;;;;;;;AA0CA,IAAa,eAAe,YACzB,EAAE,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAC/C,oBAAC,SAAD;CACO;CACL,WAAW,GAAG,YAAY,EAAE,UAAU,CAAC,GAAG,cAAc,SAAS;CACjE,OAAO,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,aAAa,cAAc;AAM3B,IAAa,iBAAiB,YAE1B,EAAE,MAAM,QAAQ,SAAS,UAAU,WAAW,QAAQ,WAAW,KAAK,OAAO,GAAG,SAChF,QAEA,oBAAC,WAAD;CACO;CACL,WAAW,GACT,cAAc;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC,GACpE,SACF;CACA,OAAO,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,eAAe,cAAc;AAI7B,IAAM,WAAW,KAAkC,cAAsB,gBAAwB;CAC/F,MAAM,UAAU,YACb,EAAE,WAAW,KAAK,OAAO,GAA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E,qBAAAC,YAAA,EAAA,UAAA,CACE,qBAAC,MAAD;EACO;EACL,WAAW,GACT,SAAS;GAAE,aAAa,gBAAgB,SAAS,KAAA,KAAa,KAAA;GAAY;EAAO,CAAC,GAClF,YACA,SACF;EACA,kBAAgB,eAAe,CAAC,SAAS,KAAK,KAAA;EAC9C,OAAO;EACP,UAAU,UAAU,eAAe,OAAO,OAAO;EACjD,aAAa,UAAU;GACrB,aAAa,KAAK;GAClB,YAAY,KAAK;EACnB;EACA,GAAI;EAdN,UAAA;GAgBG,qBACE,YAAY,oBAAC,MAAD,EAAI,WAAW,GAAG,SAAS,GAAA,YAAkB,EAAI,CAAA,IAAI,oBAAC,WAAD,CAAY,CAAA;GAC/E,eACC,oBAAC,WAAD;IAAW,WAAA;IAAuB,SAAS;IACzC,UAAA,oBAAC,qBAAD;KACE,OAAO;KACC;KACR,UAAU;KACV,gBAAgB,WAAW,SAAS,CAAC,IAAI;IAC1C,CAAA;GACQ,CAAA;GAEZ,WACC,UACA;IAAE;IAAM;IAAQ;IAAU;IAAW;GAAY,GACjD,WACA,gBACA;IAAE,KAAK;IAAa,MAAM;GAAY,CACxC;EACE;CACH,CAAA,GAAA,eACC,oBAAC,WAAD,EAAA,UACE,oBAAC,WAAD;EACE,IAAI;EACJ,SAAS;EACT,WAAA;EACA,eAAa,SAAS,KAAA,IAAY;EAElC,UAAA,oBAAC,OAAD;GAAK,WAAA;GAAmC,UAAAD;EAAsB,CAAA;CACrD,CAAA,EACF,CAAA,CAEb,EAAA,CAAA;AAEN,CACF;AAEA,UAAU,cAAc"}
|
|
1
|
+
{"version":3,"file":"Table.vanilla.js","names":["collapsedContent","_Fragment"],"sources":["../../../components/Table/Table.vanilla.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, useId, useState } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport {\n handleRowClick,\n mapRowLink,\n openRowLink,\n RowLinkShortcutProps,\n} from '@/components/RowLink/RowLink.utils';\nimport { RowLinkVanilla } from '@/components/RowLink/RowLink.vanilla';\nimport { rowLinkRow, rowLinkTable } from '@/components/RowLink/RowLink.vanilla.css';\n\nimport { ExpandToggleVanilla, stopEvent } from './ExpandToggle.vanilla';\nimport { ARIA_SORT, SortButtonVanilla } from './SortButton.vanilla';\nimport {\n captionRecipe,\n collapsedCell,\n collapsedContent as collapsedContentClass,\n emptyHeaderCell,\n tableRecipe,\n tbody,\n tdRecipe,\n tfoot,\n thead,\n thRecipe,\n toggleCell,\n trRecipe,\n} from './Table.vanilla.css';\nimport { TableSortProps } from './useTableSort';\n\nconst captionClass = withVariantKeys(captionRecipe);\nconst tableClass = withVariantKeys(tableRecipe);\nconst thClass = withVariantKeys(thRecipe);\n\ntype TableRecipeVariants = RecipeVariantProps<typeof tableRecipe>;\ntype CaptionRecipeVariants = RecipeVariantProps<typeof captionRecipe>;\ntype TrRecipeVariants = RecipeVariantProps<typeof trRecipe>;\ntype ThRecipeVariants = RecipeVariantProps<typeof thRecipe>;\ntype TdRecipeVariants = RecipeVariantProps<typeof tdRecipe>;\n\nexport type TableVanillaProps = React.TableHTMLAttributes<HTMLTableElement> &\n CSSProps &\n TableRecipeVariants;\n\nexport const TableVanilla = forwardRef<HTMLTableElement, TableVanillaProps>(\n ({ elevation, className, css, style, ...props }, ref) => (\n <table\n ref={ref}\n className={cx(tableClass({ elevation }), rowLinkTable, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTableVanilla.displayName = 'TableVanilla';\n\nexport type CaptionVanillaProps = React.HTMLAttributes<HTMLTableCaptionElement> &\n CSSProps &\n CaptionRecipeVariants;\n\nexport const CaptionVanilla = forwardRef<HTMLTableCaptionElement, CaptionVanillaProps>(\n (\n { size, weight, variant, gradient, transform, noWrap, className, css, style, ...props },\n ref,\n ) => (\n <caption\n ref={ref}\n className={cx(\n captionClass({ size, weight, variant, gradient, transform, noWrap }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nCaptionVanilla.displayName = 'CaptionVanilla';\n\nexport type TableSectionVanillaProps = React.HTMLAttributes<HTMLTableSectionElement> & CSSProps;\n\nconst section = (Tag: 'thead' | 'tbody' | 'tfoot', sectionClass: string, displayName: string) => {\n const Section = forwardRef<HTMLTableSectionElement, TableSectionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <Tag\n ref={ref}\n className={cx(sectionClass, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n );\n Section.displayName = displayName;\n return Section;\n};\n\nexport const TheadVanilla = section('thead', thead, 'TheadVanilla');\nexport const TbodyVanilla = section('tbody', tbody, 'TbodyVanilla');\nexport const TfootVanilla = section('tfoot', tfoot, 'TfootVanilla');\n\nexport type ThVanillaProps = Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n ThRecipeVariants &\n TableSortProps;\n\nexport const ThVanilla = forwardRef<HTMLTableCellElement, ThVanillaProps>(\n (\n {\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n align,\n sort,\n onSort,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => (\n <th\n ref={ref}\n aria-sort={sort && ARIA_SORT[sort]}\n className={cx(\n thClass({ size, weight, variant, gradient, transform, noWrap, align }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {onSort ? (\n <SortButtonVanilla sort={sort} onSort={onSort}>\n {children}\n </SortButtonVanilla>\n ) : (\n children\n )}\n </th>\n ),\n);\n\nThVanilla.displayName = 'ThVanilla';\n\nexport type TdVanillaProps = Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n TdRecipeVariants;\n\nexport const TdVanilla = forwardRef<HTMLTableCellElement, TdVanillaProps>(\n ({ subtle, align, className, css, style, ...props }, ref) => (\n <td\n ref={ref}\n className={cx(tdRecipe({ subtle, align }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTdVanilla.displayName = 'TdVanilla';\n\nexport type TrVanillaProps = React.HTMLAttributes<HTMLTableRowElement> &\n CSSProps &\n TrRecipeVariants &\n RowLinkShortcutProps & {\n /** Content shown in a full-width row below, toggled by a button in a new first cell. */\n collapsedContent?: ReactNode;\n /** Column span of the collapsed content row; set it to the number of columns. */\n collapsedContentColSpan?: number;\n /** Accessible name of the expand button. */\n expandLabel?: string;\n /** Adds an empty first cell, to line up with rows that have an expand button. */\n emptyFirstColumn?: boolean;\n /** Styles the empty first cell as a header, for a row in `TheadVanilla`. */\n tableHead?: boolean;\n };\n\nexport const TrVanilla = forwardRef<HTMLTableRowElement, TrVanillaProps>(\n (\n {\n collapsedContent,\n collapsedContentColSpan = 1,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n href,\n linkAs,\n linkCell,\n linkProps,\n linkOverlay,\n interactive,\n active,\n className,\n css,\n style,\n children,\n onClick,\n onAuxClick,\n ...props\n },\n ref,\n ) => {\n const [isOpen, setIsOpen] = useState(false);\n const contentId = useId();\n const inlineStyle = useInlineStyle(css, style);\n const collapsible = !!collapsedContent;\n\n return (\n <>\n <tr\n ref={ref}\n className={cx(\n trRecipe({ interactive: interactive ?? (href !== undefined || undefined), active }),\n rowLinkRow,\n className,\n )}\n data-collapsed={collapsible && !isOpen ? '' : undefined}\n style={inlineStyle}\n onClick={(event) => handleRowClick(event, onClick)}\n onAuxClick={(event) => {\n onAuxClick?.(event);\n openRowLink(event);\n }}\n {...props}\n >\n {emptyFirstColumn &&\n (tableHead ? <td className={cx(thClass(), emptyHeaderCell)} /> : <TdVanilla />)}\n {collapsible && (\n <TdVanilla className={toggleCell} onClick={stopEvent}>\n <ExpandToggleVanilla\n label={expandLabel}\n isOpen={isOpen}\n controls={contentId}\n onToggle={() => setIsOpen((open) => !open)}\n />\n </TdVanilla>\n )}\n {mapRowLink(\n children,\n { href, linkAs, linkCell, linkProps, linkOverlay },\n TdVanilla,\n RowLinkVanilla,\n { row: 'TrVanilla', cell: 'TdVanilla' },\n )}\n </tr>\n {collapsible && (\n <TrVanilla>\n <TdVanilla\n id={contentId}\n colSpan={collapsedContentColSpan}\n className={collapsedCell}\n data-closed={isOpen ? undefined : ''}\n >\n <div className={collapsedContentClass}>{collapsedContent}</div>\n </TdVanilla>\n </TrVanilla>\n )}\n </>\n );\n },\n);\n\nTrVanilla.displayName = 'TrVanilla';\n"],"mappings":";;;;;;;;;;;;AAkCA,IAAM,eAAe,gBAAgB,aAAa;AAClD,IAAM,aAAa,gBAAgB,WAAW;AAC9C,IAAM,UAAU,gBAAgB,QAAQ;AAYxC,IAAa,eAAe,YACzB,EAAE,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAC/C,oBAAC,SAAD;CACO;CACL,WAAW,GAAG,WAAW,EAAE,UAAU,CAAC,GAAG,cAAc,SAAS;CAChE,OAAO,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,aAAa,cAAc;AAM3B,IAAa,iBAAiB,YAE1B,EAAE,MAAM,QAAQ,SAAS,UAAU,WAAW,QAAQ,WAAW,KAAK,OAAO,GAAG,SAChF,QAEA,oBAAC,WAAD;CACO;CACL,WAAW,GACT,aAAa;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC,GACnE,SACF;CACA,OAAO,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,eAAe,cAAc;AAI7B,IAAM,WAAW,KAAkC,cAAsB,gBAAwB;CAC/F,MAAM,UAAU,YACb,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QACpC,oBAAC,KAAD;EACO;EACL,WAAW,GAAG,cAAc,SAAS;EACrC,OAAO,eAAe,KAAK,KAAK;EAChC,GAAI;CACL,CAAA,CAEL;CACA,QAAQ,cAAc;CACtB,OAAO;AACT;AAEA,IAAa,eAAe,QAAQ,SAAS,OAAO,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AA;EAC9C,OAAO;EACP,UAAU,UAAU,eAAe,OAAO,OAAO;EACjD,aAAa,UAAU;GACrB,aAAa,KAAK;GAClB,YAAY,KAAK;EACnB;EACA,GAAI;EAdN,UAAA;GAgBG,qBACE,YAAY,oBAAC,MAAD,EAAI,WAAW,GAAG,QAAQ,GAAA,YAAkB,EAAI,CAAA,IAAI,oBAAC,WAAD,CAAY,CAAA;GAC9E,eACC,oBAAC,WAAD;IAAW,WAAA;IAAuB,SAAS;IACzC,UAAA,oBAAC,qBAAD;KACE,OAAO;KACC;KACR,UAAU;KACV,gBAAgB,WAAW,SAAS,CAAC,IAAI;IAC1C,CAAA;GACQ,CAAA;GAEZ,WACC,UACA;IAAE;IAAM;IAAQ;IAAU;IAAW;GAAY,GACjD,WACA,gBACA;IAAE,KAAK;IAAa,MAAM;GAAY,CACxC;EACE;CACH,CAAA,GAAA,eACC,oBAAC,WAAD,EAAA,UACE,oBAAC,WAAD;EACE,IAAI;EACJ,SAAS;EACT,WAAA;EACA,eAAa,SAAS,KAAA,IAAY;EAElC,UAAA,oBAAC,OAAD;GAAK,WAAA;GAAmC,UAAAD;EAAsB,CAAA;CACrD,CAAA,EACF,CAAA,CAEb,EAAA,CAAA;AAEN,CACF;AAEA,UAAU,cAAc"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
const require_cssProps = require("../../styles/cssProps.cjs");
|
|
2
1
|
const require_cx = require("../../styles/cx.cjs");
|
|
3
|
-
const
|
|
2
|
+
const require_recipeVariants = require("../../styles/recipeVariants.cjs");
|
|
3
|
+
const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
|
|
4
4
|
const require_Text_vanilla_css = require("./Text.vanilla.css.cjs");
|
|
5
5
|
let react = require("react");
|
|
6
|
-
let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
|
|
7
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
7
|
// components/Text/Text.vanilla.tsx
|
|
8
|
+
var textClass = require_recipeVariants.withVariantKeys(require_Text_vanilla_css.textRecipe);
|
|
9
9
|
var TextVanillaComponentImpl = (0, react.forwardRef)(({ as, className, css, style, size, weight, variant, gradient, transform, noWrap, ...props }, ref) => {
|
|
10
10
|
const Component = as || "span";
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const mergedStyles = {
|
|
14
|
-
...cssStyles,
|
|
15
|
-
...style,
|
|
16
|
-
...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
|
|
17
|
-
};
|
|
18
|
-
const recipeClass = require_Text_vanilla_css.textRecipe({
|
|
11
|
+
const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
|
|
12
|
+
const recipeClass = textClass({
|
|
19
13
|
size,
|
|
20
14
|
weight,
|
|
21
15
|
variant,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.vanilla.cjs","names":["
|
|
1
|
+
{"version":3,"file":"Text.vanilla.cjs","names":["withVariantKeys","textRecipe","forwardRef","useInlineStyle","cx"],"sources":["../../../components/Text/Text.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { textRecipe } from './Text.vanilla.css';\n\nconst textClass = withVariantKeys(textRecipe);\n\ntype TextRecipeVariants = RecipeVariantProps<typeof textRecipe>;\n\ninterface TextOwnProps extends TextRecipeVariants, CSSProps {}\n\nexport type TextVanillaProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n TextOwnProps\n>;\n\ntype TextComponent = PolymorphicComponent<'span', TextVanillaProps<ElementType>>;\n\nconst TextVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'span'>(\n {\n as,\n className,\n css,\n style,\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n ...props\n }: TextVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'span';\n\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = textClass({ size, weight, variant, gradient, transform, noWrap });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nTextVanillaComponentImpl.displayName = 'TextVanilla';\n\nexport const TextVanilla = TextVanillaComponentImpl as TextComponent;\n"],"mappings":";;;;;;;AAcA,IAAM,YAAYA,uBAAAA,gBAAgBC,yBAAAA,UAAU;AAa5C,IAAM,4BAAA,GAA2BC,MAAAA,WAAAA,EAE7B,EACE,IACA,WACA,KACA,OACA,MACA,QACA,SACA,UACA,WACA,QACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAc,UAAU;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC;CAEpF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,yBAAyB,cAAc;AAEvC,IAAa,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.vanilla.css.cjs","names":[
|
|
1
|
+
{"version":3,"file":"Text.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.vanilla.css.js","names":[
|
|
1
|
+
{"version":3,"file":"Text.vanilla.css.js","names":[],"sources":[],"mappings":""}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import { processCSSProp } from "../../styles/cssProps.js";
|
|
2
1
|
import { cx } from "../../styles/cx.js";
|
|
3
|
-
import {
|
|
2
|
+
import { withVariantKeys } from "../../styles/recipeVariants.js";
|
|
3
|
+
import { useInlineStyle } from "../../styles/useInlineStyle.js";
|
|
4
4
|
import { textRecipe } from "./Text.vanilla.css.js";
|
|
5
5
|
import { forwardRef } from "react";
|
|
6
|
-
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
7
6
|
import { jsx } from "react/jsx-runtime";
|
|
8
7
|
// components/Text/Text.vanilla.tsx
|
|
8
|
+
var textClass = withVariantKeys(textRecipe);
|
|
9
9
|
var TextVanillaComponentImpl = forwardRef(({ as, className, css, style, size, weight, variant, gradient, transform, noWrap, ...props }, ref) => {
|
|
10
10
|
const Component = as || "span";
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const mergedStyles = {
|
|
14
|
-
...cssStyles,
|
|
15
|
-
...style,
|
|
16
|
-
...assignInlineVars(vars)
|
|
17
|
-
};
|
|
18
|
-
const recipeClass = textRecipe({
|
|
11
|
+
const mergedStyles = useInlineStyle(css, style);
|
|
12
|
+
const recipeClass = textClass({
|
|
19
13
|
size,
|
|
20
14
|
weight,
|
|
21
15
|
variant,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.vanilla.js","names":[],"sources":["../../../components/Text/Text.vanilla.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Text.vanilla.js","names":[],"sources":["../../../components/Text/Text.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { textRecipe } from './Text.vanilla.css';\n\nconst textClass = withVariantKeys(textRecipe);\n\ntype TextRecipeVariants = RecipeVariantProps<typeof textRecipe>;\n\ninterface TextOwnProps extends TextRecipeVariants, CSSProps {}\n\nexport type TextVanillaProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n TextOwnProps\n>;\n\ntype TextComponent = PolymorphicComponent<'span', TextVanillaProps<ElementType>>;\n\nconst TextVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'span'>(\n {\n as,\n className,\n css,\n style,\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n ...props\n }: TextVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'span';\n\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = textClass({ size, weight, variant, gradient, transform, noWrap });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nTextVanillaComponentImpl.displayName = 'TextVanilla';\n\nexport const TextVanilla = TextVanillaComponentImpl as TextComponent;\n"],"mappings":";;;;;;;AAcA,IAAM,YAAY,gBAAgB,UAAU;AAa5C,IAAM,2BAA2B,YAE7B,EACE,IACA,WACA,KACA,OACA,MACA,QACA,SACA,UACA,WACA,QACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,eAAe,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAc,UAAU;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC;CAEpF,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,yBAAyB,cAAc;AAEvC,IAAa,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.vanilla.cjs","names":["React","useFieldContext","EyeClosedIcon","EyeOpenIcon","_Fragment","ExclamationTriangleIcon","Tooltip","CrossCircledIcon","InputVanilla","FieldVanilla"],"sources":["../../../components/TextField/TextField.vanilla.tsx"],"sourcesContent":["import {\n CrossCircledIcon,\n ExclamationTriangleIcon,\n EyeClosedIcon,\n EyeOpenIcon,\n} from '@radix-ui/react-icons';\nimport React from 'react';\n\nimport { FieldVanilla } from '
|
|
1
|
+
{"version":3,"file":"TextField.vanilla.cjs","names":["React","useFieldContext","EyeClosedIcon","EyeOpenIcon","_Fragment","ExclamationTriangleIcon","Tooltip","CrossCircledIcon","InputVanilla","FieldVanilla"],"sources":["../../../components/TextField/TextField.vanilla.tsx"],"sourcesContent":["import {\n CrossCircledIcon,\n ExclamationTriangleIcon,\n EyeClosedIcon,\n EyeOpenIcon,\n} from '@radix-ui/react-icons';\nimport React from 'react';\n\nimport { FieldVanilla } from '@/components/Field/Field.vanilla';\nimport { FieldLabelProps, useFieldContext } from '@/components/Field/FieldContext';\nimport { InputVanilla, InputVanillaHandle, InputVanillaProps } from '@/components/Input';\nimport { Tooltip } from '@/components/Tooltip';\n\nimport { adornmentButton, adornmentGroup, invalidIcon } from './TextField.vanilla.css';\n\n// TYPES\nexport interface TextFieldLabelProps {\n variant: 'invalid' | 'subtle' | 'contrast' | 'default';\n htmlFor?: string;\n id?: string;\n}\n\nexport type TextFieldVanillaProps = InputVanillaProps & {\n type?: string;\n clearable?: boolean;\n label?: string | ((props: TextFieldLabelProps) => JSX.Element);\n description?: React.ReactNode;\n error?: React.ReactNode;\n announceError?: boolean;\n};\n\nexport const TextFieldVanilla = React.forwardRef<\n React.ElementRef<typeof InputVanilla>,\n TextFieldVanillaProps\n>(\n (\n {\n state,\n clearable,\n label: LabelOrComponent,\n description,\n error,\n announceError,\n id,\n type,\n disabled,\n readOnly,\n css,\n ...props\n },\n forwardedRef,\n ) => {\n const inputRef = React.useRef<InputVanillaHandle | null>(null);\n React.useImperativeHandle(forwardedRef, () => inputRef.current as InputVanillaHandle);\n\n const outerField = useFieldContext();\n const [innerType, setInnerType] = React.useState(type);\n const isPasswordVisible = React.useMemo(() => innerType !== 'password', [innerType]);\n\n const invalid = state === 'invalid' || Boolean(error) || Boolean(outerField?.invalid);\n\n const renderLabel = React.useMemo(() => {\n if (LabelOrComponent === undefined || LabelOrComponent === null) {\n return undefined;\n }\n if (typeof LabelOrComponent === 'string') {\n return LabelOrComponent;\n }\n return (labelProps: FieldLabelProps) => <LabelOrComponent {...labelProps} />;\n }, [LabelOrComponent]);\n\n const isPasswordType = React.useMemo(() => type === 'password', [type]);\n\n const typeOrInnerType = React.useMemo(\n () => (isPasswordType ? innerType : type),\n [isPasswordType, type, innerType],\n );\n\n const hasInnerAdornment = React.useMemo(\n () => clearable || isPasswordType || invalid,\n [clearable, isPasswordType, invalid],\n );\n\n const hasAdornmentGroup = React.useMemo(\n () => (clearable && invalid) || (clearable && isPasswordType) || (invalid && isPasswordType),\n [clearable, invalid, isPasswordType],\n );\n\n const clearDisabled = readOnly || disabled || Boolean(outerField?.disabled);\n\n const handleClear = React.useCallback(() => {\n const { current } = inputRef;\n if (current) {\n const setValue = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n setValue?.call(current, '');\n current.dispatchEvent(new Event('input', { bubbles: true }));\n current.focus();\n }\n }, [inputRef]);\n\n const togglePasswordVisibility = React.useCallback(() => {\n setInnerType((prevInnerType) => (prevInnerType === 'password' ? undefined : 'password'));\n }, [setInnerType]);\n\n const PasswordVisibilityToggleIcon = isPasswordVisible ? EyeClosedIcon : EyeOpenIcon;\n\n const passwordAction = React.useMemo(\n () => (isPasswordVisible ? 'Hide password' : 'Show password'),\n [isPasswordVisible],\n );\n\n const adornments = (\n <>\n {invalid && <ExclamationTriangleIcon className={invalidIcon} aria-hidden />}\n {isPasswordType && (\n <Tooltip content={passwordAction}>\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label={passwordAction}\n onClick={togglePasswordVisibility}\n >\n <PasswordVisibilityToggleIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n {clearable && !clearDisabled && (\n <Tooltip content=\"Clear\">\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label=\"Clear\"\n onClick={handleClear}\n >\n <CrossCircledIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n </>\n );\n\n const input = (\n <InputVanilla\n id={id}\n ref={inputRef}\n endAdornment={\n hasInnerAdornment &&\n (hasAdornmentGroup ? <div className={adornmentGroup}>{adornments}</div> : adornments)\n }\n state={state}\n type={typeOrInnerType}\n disabled={disabled}\n readOnly={readOnly}\n {...props}\n />\n );\n\n return (\n <FieldVanilla\n id={id}\n label={renderLabel}\n description={description}\n error={error}\n announceError={announceError}\n invalid={state === 'invalid'}\n disabled={disabled}\n css={{ boxSizing: 'border-box', ...css }}\n >\n {input}\n </FieldVanilla>\n );\n },\n);\n\nTextFieldVanilla.displayName = 'TextFieldVanilla';\n"],"mappings":";;;;;;;;;;;AA+BA,IAAa,mBAAmBA,MAAAA,QAAM,YAKlC,EACE,OACA,WACA,OAAO,kBACP,aACA,OACA,eACA,IACA,MACA,UACA,UACA,KACA,GAAG,SAEL,iBACG;CACH,MAAM,WAAWA,MAAAA,QAAM,OAAkC,IAAI;CAC7D,MAAA,QAAM,oBAAoB,oBAAoB,SAAS,OAA6B;CAEpF,MAAM,aAAaC,qBAAAA,gBAAgB;CACnC,MAAM,CAAC,WAAW,gBAAgBD,MAAAA,QAAM,SAAS,IAAI;CACrD,MAAM,oBAAoBA,MAAAA,QAAM,cAAc,cAAc,YAAY,CAAC,SAAS,CAAC;CAEnF,MAAM,UAAU,UAAU,aAAa,QAAQ,KAAK,KAAK,QAAQ,YAAY,OAAO;CAEpF,MAAM,cAAcA,MAAAA,QAAM,cAAc;EACtC,IAAI,qBAAqB,KAAA,KAAa,qBAAqB,MACzD;EAEF,IAAI,OAAO,qBAAqB,UAC9B,OAAO;EAET,QAAQ,eAAgC,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD,EAAkB,GAAI,WAAa,CAAA;CAC7E,GAAG,CAAC,gBAAgB,CAAC;CAErB,MAAM,iBAAiBA,MAAAA,QAAM,cAAc,SAAS,YAAY,CAAC,IAAI,CAAC;CAEtE,MAAM,kBAAkBA,MAAAA,QAAM,cACrB,iBAAiB,YAAY,MACpC;EAAC;EAAgB;EAAM;CAAS,CAClC;CAEA,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Aa,CAAA;GACrC,CAAA;EACD,CAAA;EAEV,aAAa,CAAC,iBACb,iBAAA,GAAA,kBAAA,IAAA,CAACA,gBAAAA,SAAD;GAAS,SAAQ;GACf,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IACE,MAAK;IACL,WAAA;IACA,cAAW;IACX,SAAS;IAET,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,kBAAD,EAAkB,eAAA,KAAa,CAAA;GACzB,CAAA;EACD,CAAA;CAEX,EAAA,CAAA;CAGJ,MAAM,QACJ,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,cAAD;EACM;EACJ,KAAK;EACL,cACE,sBACC,oBAAoB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAA;GAA4B,UAAA;EAAgB,CAAA,IAAI;EAErE;EACP,MAAM;EACI;EACA;EACV,GAAI;CACL,CAAA;CAGH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,cAAD;EACM;EACJ,OAAO;EACM;EACN;EACQ;EACf,SAAS,UAAU;EACT;EACV,KAAK;GAAE,WAAW;GAAc,GAAG;EAAI;EAEtC,UAAA;CACW,CAAA;AAElB,CACF;AAEA,iBAAiB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.vanilla.css.cjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"TextField.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.vanilla.css.js","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"TextField.vanilla.css.js","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.vanilla.js","names":["_Fragment"],"sources":["../../../components/TextField/TextField.vanilla.tsx"],"sourcesContent":["import {\n CrossCircledIcon,\n ExclamationTriangleIcon,\n EyeClosedIcon,\n EyeOpenIcon,\n} from '@radix-ui/react-icons';\nimport React from 'react';\n\nimport { FieldVanilla } from '
|
|
1
|
+
{"version":3,"file":"TextField.vanilla.js","names":["_Fragment"],"sources":["../../../components/TextField/TextField.vanilla.tsx"],"sourcesContent":["import {\n CrossCircledIcon,\n ExclamationTriangleIcon,\n EyeClosedIcon,\n EyeOpenIcon,\n} from '@radix-ui/react-icons';\nimport React from 'react';\n\nimport { FieldVanilla } from '@/components/Field/Field.vanilla';\nimport { FieldLabelProps, useFieldContext } from '@/components/Field/FieldContext';\nimport { InputVanilla, InputVanillaHandle, InputVanillaProps } from '@/components/Input';\nimport { Tooltip } from '@/components/Tooltip';\n\nimport { adornmentButton, adornmentGroup, invalidIcon } from './TextField.vanilla.css';\n\n// TYPES\nexport interface TextFieldLabelProps {\n variant: 'invalid' | 'subtle' | 'contrast' | 'default';\n htmlFor?: string;\n id?: string;\n}\n\nexport type TextFieldVanillaProps = InputVanillaProps & {\n type?: string;\n clearable?: boolean;\n label?: string | ((props: TextFieldLabelProps) => JSX.Element);\n description?: React.ReactNode;\n error?: React.ReactNode;\n announceError?: boolean;\n};\n\nexport const TextFieldVanilla = React.forwardRef<\n React.ElementRef<typeof InputVanilla>,\n TextFieldVanillaProps\n>(\n (\n {\n state,\n clearable,\n label: LabelOrComponent,\n description,\n error,\n announceError,\n id,\n type,\n disabled,\n readOnly,\n css,\n ...props\n },\n forwardedRef,\n ) => {\n const inputRef = React.useRef<InputVanillaHandle | null>(null);\n React.useImperativeHandle(forwardedRef, () => inputRef.current as InputVanillaHandle);\n\n const outerField = useFieldContext();\n const [innerType, setInnerType] = React.useState(type);\n const isPasswordVisible = React.useMemo(() => innerType !== 'password', [innerType]);\n\n const invalid = state === 'invalid' || Boolean(error) || Boolean(outerField?.invalid);\n\n const renderLabel = React.useMemo(() => {\n if (LabelOrComponent === undefined || LabelOrComponent === null) {\n return undefined;\n }\n if (typeof LabelOrComponent === 'string') {\n return LabelOrComponent;\n }\n return (labelProps: FieldLabelProps) => <LabelOrComponent {...labelProps} />;\n }, [LabelOrComponent]);\n\n const isPasswordType = React.useMemo(() => type === 'password', [type]);\n\n const typeOrInnerType = React.useMemo(\n () => (isPasswordType ? innerType : type),\n [isPasswordType, type, innerType],\n );\n\n const hasInnerAdornment = React.useMemo(\n () => clearable || isPasswordType || invalid,\n [clearable, isPasswordType, invalid],\n );\n\n const hasAdornmentGroup = React.useMemo(\n () => (clearable && invalid) || (clearable && isPasswordType) || (invalid && isPasswordType),\n [clearable, invalid, isPasswordType],\n );\n\n const clearDisabled = readOnly || disabled || Boolean(outerField?.disabled);\n\n const handleClear = React.useCallback(() => {\n const { current } = inputRef;\n if (current) {\n const setValue = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n setValue?.call(current, '');\n current.dispatchEvent(new Event('input', { bubbles: true }));\n current.focus();\n }\n }, [inputRef]);\n\n const togglePasswordVisibility = React.useCallback(() => {\n setInnerType((prevInnerType) => (prevInnerType === 'password' ? undefined : 'password'));\n }, [setInnerType]);\n\n const PasswordVisibilityToggleIcon = isPasswordVisible ? EyeClosedIcon : EyeOpenIcon;\n\n const passwordAction = React.useMemo(\n () => (isPasswordVisible ? 'Hide password' : 'Show password'),\n [isPasswordVisible],\n );\n\n const adornments = (\n <>\n {invalid && <ExclamationTriangleIcon className={invalidIcon} aria-hidden />}\n {isPasswordType && (\n <Tooltip content={passwordAction}>\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label={passwordAction}\n onClick={togglePasswordVisibility}\n >\n <PasswordVisibilityToggleIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n {clearable && !clearDisabled && (\n <Tooltip content=\"Clear\">\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label=\"Clear\"\n onClick={handleClear}\n >\n <CrossCircledIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n </>\n );\n\n const input = (\n <InputVanilla\n id={id}\n ref={inputRef}\n endAdornment={\n hasInnerAdornment &&\n (hasAdornmentGroup ? <div className={adornmentGroup}>{adornments}</div> : adornments)\n }\n state={state}\n type={typeOrInnerType}\n disabled={disabled}\n readOnly={readOnly}\n {...props}\n />\n );\n\n return (\n <FieldVanilla\n id={id}\n label={renderLabel}\n description={description}\n error={error}\n announceError={announceError}\n invalid={state === 'invalid'}\n disabled={disabled}\n css={{ boxSizing: 'border-box', ...css }}\n >\n {input}\n </FieldVanilla>\n );\n },\n);\n\nTextFieldVanilla.displayName = 'TextFieldVanilla';\n"],"mappings":";;;;;;;;;AA+BA,IAAa,mBAAmB,MAAM,YAKlC,EACE,OACA,WACA,OAAO,kBACP,aACA,OACA,eACA,IACA,MACA,UACA,UACA,KACA,GAAG,SAEL,iBACG;CACH,MAAM,WAAW,MAAM,OAAkC,IAAI;CAC7D,MAAM,oBAAoB,oBAAoB,SAAS,OAA6B;CAEpF,MAAM,aAAa,gBAAgB;CACnC,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAS,IAAI;CACrD,MAAM,oBAAoB,MAAM,cAAc,cAAc,YAAY,CAAC,SAAS,CAAC;CAEnF,MAAM,UAAU,UAAU,aAAa,QAAQ,KAAK,KAAK,QAAQ,YAAY,OAAO;CAEpF,MAAM,cAAc,MAAM,cAAc;EACtC,IAAI,qBAAqB,KAAA,KAAa,qBAAqB,MACzD;EAEF,IAAI,OAAO,qBAAqB,UAC9B,OAAO;EAET,QAAQ,eAAgC,oBAAC,kBAAD,EAAkB,GAAI,WAAa,CAAA;CAC7E,GAAG,CAAC,gBAAgB,CAAC;CAErB,MAAM,iBAAiB,MAAM,cAAc,SAAS,YAAY,CAAC,IAAI,CAAC;CAEtE,MAAM,kBAAkB,MAAM,cACrB,iBAAiB,YAAY,MACpC;EAAC;EAAgB;EAAM;CAAS,CAClC;CAEA,MAAM,oBAAoB,MAAM,cACxB,aAAa,kBAAkB,SACrC;EAAC;EAAW;EAAgB;CAAO,CACrC;CAEA,MAAM,oBAAoB,MAAM,cACvB,aAAa,WAAa,aAAa,kBAAoB,WAAW,gBAC7E;EAA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AAI;EAErE;EACP,MAAM;EACI;EACA;EACV,GAAI;CACL,CAAA;CAGH,OACE,oBAAC,cAAD;EACM;EACJ,OAAO;EACM;EACN;EACQ;EACf,SAAS,UAAU;EACT;EACV,KAAK;GAAE,WAAW;GAAc,GAAG;EAAI;EAEtC,UAAA;CACW,CAAA;AAElB,CACF;AAEA,iBAAiB,cAAc"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_cssProps = require("../../styles/cssProps.cjs");
|
|
3
2
|
const require_cx = require("../../styles/cx.cjs");
|
|
4
|
-
const
|
|
3
|
+
const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
|
|
5
4
|
const require_Field_vanilla = require("../Field/Field.vanilla.cjs");
|
|
6
5
|
const require_FieldContext = require("../Field/FieldContext.cjs");
|
|
7
6
|
const require_Label_vanilla = require("../Label/Label.vanilla.cjs");
|
|
8
7
|
const require_Textarea_vanilla_css = require("./Textarea.vanilla.css.cjs");
|
|
9
8
|
let react = require("react");
|
|
10
9
|
react = require_runtime.__toESM(react, 1);
|
|
11
|
-
let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
|
|
12
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
11
|
// components/Textarea/Textarea.vanilla.tsx
|
|
14
12
|
var TextareaVanillaControl = react.default.forwardRef(({ state, disabled, id, css, endAdornment, variant, cursor, resize, className, style, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }, forwardedRef) => {
|
|
15
|
-
const { colors } = require_themeContext.useVanillaExtractTheme();
|
|
16
13
|
const control = require_FieldContext.useFieldControl({
|
|
17
14
|
id,
|
|
18
15
|
disabled,
|
|
@@ -22,12 +19,7 @@ var TextareaVanillaControl = react.default.forwardRef(({ state, disabled, id, cs
|
|
|
22
19
|
});
|
|
23
20
|
const resolvedState = control.invalid ? "invalid" : state;
|
|
24
21
|
const hasEndAdornment = Boolean(endAdornment);
|
|
25
|
-
const
|
|
26
|
-
const mergedStyles = {
|
|
27
|
-
...cssStyles,
|
|
28
|
-
...style,
|
|
29
|
-
...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
|
|
30
|
-
};
|
|
22
|
+
const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
|
|
31
23
|
const textareaWrapperClass = require_Textarea_vanilla_css.textareaWrapperRecipe({
|
|
32
24
|
state: resolvedState,
|
|
33
25
|
disabled: control.disabled
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.vanilla.cjs","names":["React","
|
|
1
|
+
{"version":3,"file":"Textarea.vanilla.cjs","names":["React","useFieldControl","useInlineStyle","textareaWrapperRecipe","styledTextareaRecipe","cx","FieldVanilla","LabelVanilla"],"sources":["../../../components/Textarea/Textarea.vanilla.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { FieldVanilla } from '@/components/Field/Field.vanilla';\nimport { FieldLabelProps, useFieldControl } from '@/components/Field/FieldContext';\nimport { LabelVanilla } from '@/components/Label';\n\nimport {\n adornmentWrapperEnd,\n styledTextareaRecipe,\n textareaWrapperRecipe,\n} from './Textarea.vanilla.css';\n\ntype StyledTextareaRecipeVariants = RecipeVariantProps<typeof styledTextareaRecipe>;\n\nexport interface TextareaVanillaOwnProps extends CSSProps {\n variant?: StyledTextareaRecipeVariants['variant'];\n state?: StyledTextareaRecipeVariants['state'];\n cursor?: StyledTextareaRecipeVariants['cursor'];\n resize?: StyledTextareaRecipeVariants['resize'];\n label?: string;\n description?: React.ReactNode;\n error?: React.ReactNode;\n announceError?: boolean;\n endAdornment?: React.ReactNode;\n rootCss?: CSSProps['css'];\n}\n\nexport type TextareaVanillaProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> &\n TextareaVanillaOwnProps;\n\ntype TextareaVanillaControlProps = Omit<\n TextareaVanillaProps,\n 'label' | 'description' | 'error' | 'announceError' | 'rootCss'\n>;\n\nconst TextareaVanillaControl = React.forwardRef<HTMLTextAreaElement, TextareaVanillaControlProps>(\n (\n {\n state,\n disabled,\n id,\n css,\n endAdornment,\n variant,\n cursor,\n resize,\n className,\n style,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n forwardedRef,\n ) => {\n const control = useFieldControl({\n id,\n disabled,\n invalid: state === 'invalid',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n });\n const resolvedState = control.invalid ? 'invalid' : state;\n const hasEndAdornment = Boolean(endAdornment);\n\n const mergedStyles = useInlineStyle(css, style);\n\n const textareaWrapperClass = textareaWrapperRecipe({\n state: resolvedState,\n disabled: control.disabled,\n });\n const styledTextareaClass = styledTextareaRecipe({\n variant,\n state: resolvedState,\n cursor,\n resize,\n endAdornment: hasEndAdornment,\n });\n\n return (\n <div className={textareaWrapperClass}>\n <textarea\n id={control.id}\n disabled={control.disabled}\n ref={forwardedRef}\n className={cx(styledTextareaClass, className)}\n style={mergedStyles}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n {...props}\n />\n {hasEndAdornment && <div className={adornmentWrapperEnd}>{endAdornment}</div>}\n </div>\n );\n },\n);\n\nTextareaVanillaControl.displayName = 'TextareaVanillaControl';\n\nexport const TextareaVanilla = React.forwardRef<HTMLTextAreaElement, TextareaVanillaProps>(\n ({ label, description, error, announceError, id, rootCss, state, ...props }, forwardedRef) => {\n return (\n <FieldVanilla\n id={id}\n label={\n label &&\n ((labelProps: FieldLabelProps) => (\n <LabelVanilla {...labelProps} css={{ display: 'block' }}>\n {label}\n </LabelVanilla>\n ))\n }\n description={description}\n error={error}\n announceError={announceError}\n invalid={state === 'invalid'}\n disabled={props.disabled}\n css={rootCss}\n >\n <TextareaVanillaControl ref={forwardedRef} id={id} state={state} {...props} />\n </FieldVanilla>\n );\n },\n);\n\nTextareaVanilla.displayName = 'TextareaVanilla';\n"],"mappings":";;;;;;;;;;;AAwCA,IAAM,yBAAyBA,MAAAA,QAAM,YAEjC,EACE,OACA,UACA,IACA,KACA,cACA,SACA,QACA,QACA,WACA,OACA,oBAAoB,iBACpB,gBAAgB,aAChB,GAAG,SAEL,iBACG;CACH,MAAM,UAAUC,qBAAAA,gBAAgB;EAC9B;EACA;EACA,SAAS,UAAU;EACnB,oBAAoB;EACpB,gBAAgB;CAClB,CAAC;CACD,MAAM,gBAAgB,QAAQ,UAAU,YAAY;CACpD,MAAM,kBAAkB,QAAQ,YAAY;CAE5C,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,MAAM,uBAAuBC,6BAAAA,sBAAsB;EACjD,OAAO;EACP,UAAU,QAAQ;CACpB,CAAC;CACD,MAAM,sBAAsBC,6BAAAA,qBAAqB;EAC/C;EACA,OAAO;EACP;EACA;EACA,cAAc;CAChB,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAW;EAAhB,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;GACE,IAAI,QAAQ;GACZ,UAAU,QAAQ;GAClB,KAAK;GACL,WAAWC,WAAAA,GAAG,qBAAqB,SAAS;GAC5C,OAAO;GACP,oBAAkB,QAAQ;GAC1B,gBAAc,QAAQ;GACtB,GAAI;EACL,CAAA,GACA,mBAAmB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAA;GAAiC,UAAA;EAAkB,CAAA,CACzE;;AAET,CACF;AAEA,uBAAuB,cAAc;AAErC,IAAa,kBAAkBL,MAAAA,QAAM,YAClC,EAAE,OAAO,aAAa,OAAO,eAAe,IAAI,SAAS,OAAO,GAAG,SAAS,iBAAiB;CAC5F,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACM,sBAAAA,cAAD;EACM;EACJ,OACE,WACE,eACA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,cAAD;GAAc,GAAI;GAAY,KAAK,EAAE,SAAS,QAAQ;GACnD,UAAA;EACW,CAAA;EAGL;EACN;EACQ;EACf,SAAS,UAAU;EACnB,UAAU,MAAM;EAChB,KAAK;EAEL,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,wBAAD;GAAwB,KAAK;GAAkB;GAAW;GAAO,GAAI;EAAQ,CAAA;CACjE,CAAA;AAElB,CACF;AAEA,gBAAgB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.vanilla.css.cjs","names":[
|
|
1
|
+
{"version":3,"file":"Textarea.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.vanilla.css.js","names":[
|
|
1
|
+
{"version":3,"file":"Textarea.vanilla.css.js","names":[],"sources":[],"mappings":""}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { processCSSProp } from "../../styles/cssProps.js";
|
|
2
1
|
import { cx } from "../../styles/cx.js";
|
|
3
|
-
import {
|
|
2
|
+
import { useInlineStyle } from "../../styles/useInlineStyle.js";
|
|
4
3
|
import { FieldVanilla } from "../Field/Field.vanilla.js";
|
|
5
4
|
import { useFieldControl } from "../Field/FieldContext.js";
|
|
6
5
|
import { LabelVanilla } from "../Label/Label.vanilla.js";
|
|
7
6
|
import { styledTextareaRecipe, textareaWrapperRecipe } from "./Textarea.vanilla.css.js";
|
|
8
7
|
import React from "react";
|
|
9
|
-
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
10
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
9
|
// components/Textarea/Textarea.vanilla.tsx
|
|
12
10
|
var TextareaVanillaControl = React.forwardRef(({ state, disabled, id, css, endAdornment, variant, cursor, resize, className, style, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }, forwardedRef) => {
|
|
13
|
-
const { colors } = useVanillaExtractTheme();
|
|
14
11
|
const control = useFieldControl({
|
|
15
12
|
id,
|
|
16
13
|
disabled,
|
|
@@ -20,12 +17,7 @@ var TextareaVanillaControl = React.forwardRef(({ state, disabled, id, css, endAd
|
|
|
20
17
|
});
|
|
21
18
|
const resolvedState = control.invalid ? "invalid" : state;
|
|
22
19
|
const hasEndAdornment = Boolean(endAdornment);
|
|
23
|
-
const
|
|
24
|
-
const mergedStyles = {
|
|
25
|
-
...cssStyles,
|
|
26
|
-
...style,
|
|
27
|
-
...assignInlineVars(vars)
|
|
28
|
-
};
|
|
20
|
+
const mergedStyles = useInlineStyle(css, style);
|
|
29
21
|
const textareaWrapperClass = textareaWrapperRecipe({
|
|
30
22
|
state: resolvedState,
|
|
31
23
|
disabled: control.disabled
|