@activecollab/components 2.0.592 → 2.0.593
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/cjs/components/BatchEdit/BatchEdit.js +164 -23
- package/dist/cjs/components/BatchEdit/BatchEdit.js.map +1 -1
- package/dist/cjs/components/BatchEdit/BatchProperties.js +19 -3
- package/dist/cjs/components/BatchEdit/BatchProperties.js.map +1 -1
- package/dist/cjs/components/BatchEdit/Styles.js +67 -1
- package/dist/cjs/components/BatchEdit/Styles.js.map +1 -1
- package/dist/cjs/components/PillButton/PillButton.js.map +1 -1
- package/dist/cjs/components/PillButton/Styles.js +1 -1
- package/dist/cjs/components/PillButton/Styles.js.map +1 -1
- package/dist/cjs/components/Popper/Popper.js +20 -2
- package/dist/cjs/components/Popper/Popper.js.map +1 -1
- package/dist/esm/components/BatchEdit/BatchEdit.d.ts +33 -2
- package/dist/esm/components/BatchEdit/BatchEdit.d.ts.map +1 -1
- package/dist/esm/components/BatchEdit/BatchEdit.js +149 -24
- package/dist/esm/components/BatchEdit/BatchEdit.js.map +1 -1
- package/dist/esm/components/BatchEdit/BatchProperties.d.ts +7 -1
- package/dist/esm/components/BatchEdit/BatchProperties.d.ts.map +1 -1
- package/dist/esm/components/BatchEdit/BatchProperties.js +20 -4
- package/dist/esm/components/BatchEdit/BatchProperties.js.map +1 -1
- package/dist/esm/components/BatchEdit/Styles.d.ts +18 -0
- package/dist/esm/components/BatchEdit/Styles.d.ts.map +1 -1
- package/dist/esm/components/BatchEdit/Styles.js +66 -0
- package/dist/esm/components/BatchEdit/Styles.js.map +1 -1
- package/dist/esm/components/PillButton/PillButton.d.ts +1 -1
- package/dist/esm/components/PillButton/PillButton.d.ts.map +1 -1
- package/dist/esm/components/PillButton/PillButton.js.map +1 -1
- package/dist/esm/components/PillButton/Styles.d.ts.map +1 -1
- package/dist/esm/components/PillButton/Styles.js +1 -1
- package/dist/esm/components/PillButton/Styles.js.map +1 -1
- package/dist/esm/components/Popper/Popper.d.ts.map +1 -1
- package/dist/esm/components/Popper/Popper.js +18 -2
- package/dist/esm/components/Popper/Popper.js.map +1 -1
- package/dist/index.js +485 -255
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BatchEdit.js","names":["React","classnames","StyledBatchEdit","StyledBatchEditCount","StyledBatchEditCounter","StyledBatchEditGroup","StyledBatchEditIconButton","Button","CloseIcon","Tooltip","BatchEdit","_ref","open","count","onClose","onClearAll","_ref$selectedLabel","selectedLabel","_ref$clearAllLabel","clearAllLabel","_ref$closeLabel","closeLabel","_ref$fitContent","fitContent","_ref$renderInPortal","renderInPortal","children","className","style","createElement","$fitContent","$gap","weight","variant","onClick","disabled","title","$dark","displayName","BatchEditGroup","_ref2","_ref2$gap","gap","BatchEditAction","_ref3","_ref3$disabled","_ref3$tooltipDisabled","tooltipDisabled","_ref3$iconTone","iconTone","testId","disable"],"sources":["../../../../src/components/BatchEdit/BatchEdit.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n MouseEventHandler,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledBatchEdit,\n StyledBatchEditCount,\n StyledBatchEditCounter,\n StyledBatchEditGroup,\n StyledBatchEditIconButton,\n} from \"./Styles\";\nimport { Button } from \"../Button\";\nimport { CloseIcon } from \"../Icons\";\nimport { Tooltip } from \"../Tooltip\";\n\nexport interface IBatchEditProps {\n /** Shows the bar. */\n open: boolean;\n /** The number of selected items. */\n count: number;\n /** Called when the reader clicks the close button. */\n onClose?: () => void;\n /** Called when the reader clicks Clear All. The button is disabled with no selection. */\n onClearAll?: () => void;\n /** The text before the count. A colon follows it. */\n selectedLabel?: string;\n /** The text of the Clear All button. */\n clearAllLabel?: string;\n /** The tooltip and the accessible name of the close button. */\n closeLabel?: string;\n /** Sizes the bar to its content, from 800px up to the window less 32px, with 32px gaps, as the project list does. */\n fitContent?: boolean;\n /** Renders the bar in a portal at the bottom of the page. Set to false to render it in place. */\n renderInPortal?: boolean;\n /** The action groups between Clear All and the close button. */\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\n/** The floating batch edit bar: the selection count, Clear All, the actions and a close button. */\nexport const BatchEdit = ({\n open,\n count,\n onClose,\n onClearAll,\n selectedLabel = \"Selected\",\n clearAllLabel = \"Clear All\",\n closeLabel = \"Close\",\n fitContent = false,\n renderInPortal = true,\n children,\n className,\n style,\n}: IBatchEditProps) => (\n <StyledBatchEdit\n open={open}\n renderInPortal={renderInPortal}\n $fitContent={fitContent}\n style={style}\n className={classnames(\"c-batch-edit\", className)}\n >\n <StyledBatchEditGroup $gap={24}>\n <StyledBatchEditCount weight=\"bold\">\n {selectedLabel}:\n <StyledBatchEditCounter data-testid=\"batch-edit-counter\">\n {count}\n </StyledBatchEditCounter>\n </StyledBatchEditCount>\n <Button variant=\"tertiary\" onClick={onClearAll} disabled={count === 0}>\n {clearAllLabel}\n </Button>\n </StyledBatchEditGroup>\n\n {children}\n\n <Tooltip title={closeLabel}>\n <StyledBatchEditIconButton\n $dark\n onClick={onClose}\n variant=\"text gray\"\n aria-label={closeLabel}\n >\n <CloseIcon />\n </StyledBatchEditIconButton>\n </Tooltip>\n </StyledBatchEdit>\n);\n\nBatchEdit.displayName = \"BatchEdit\";\n\nexport interface IBatchEditGroupProps {\n /** The gap between the parts in pixels: 8 for project actions, 24 for task actions, 16 for menus. */\n gap?: number;\n children?: ReactNode;\n className?: string;\n}\n\n/** A row of batch edit parts, such as the action icons or the property menus with Update. */\nexport const BatchEditGroup = ({\n gap = 16,\n children,\n className,\n}: IBatchEditGroupProps) => (\n <StyledBatchEditGroup\n $gap={gap}\n className={classnames(\"c-batch-edit-group\", className)}\n >\n {children}\n </StyledBatchEditGroup>\n);\n\nBatchEditGroup.displayName = \"BatchEditGroup\";\n\nexport interface IBatchEditActionProps {\n /** The tooltip and the accessible name of the action. */\n title: string;\n /** The icon of the action. */\n children: ReactElement;\n /** Called when the reader clicks the action. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n /** Disables the action. */\n disabled?: boolean;\n /** Hides the tooltip. The default follows `disabled`. */\n tooltipDisabled?: boolean;\n /** Dark paints the icon theme-900, as the task bar does. Gray keeps the gray of the button, as the project bar does. */\n iconTone?: \"dark\" | \"gray\";\n \"data-testid\"?: string;\n}\n\n/** An icon action of the batch edit bar, such as Complete, Move or Move to Trash. */\nexport const BatchEditAction = ({\n title,\n children,\n onClick,\n disabled = false,\n tooltipDisabled = disabled,\n iconTone = \"dark\",\n \"data-testid\": testId,\n}: IBatchEditActionProps) => (\n <Tooltip title={title} disable={tooltipDisabled}>\n <StyledBatchEditIconButton\n $dark={iconTone === \"dark\"}\n variant=\"text gray\"\n aria-label={title}\n disabled={disabled}\n data-testid={testId}\n onClick={onClick}\n >\n {children}\n </StyledBatchEditIconButton>\n </Tooltip>\n);\n\nBatchEditAction.displayName = \"BatchEditAction\";\n"],"mappings":"AAAA,OAAOA,KAAK,MAKL,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,eAAe,EACfC,oBAAoB,EACpBC,sBAAsB,EACtBC,oBAAoB,EACpBC,yBAAyB,QACpB,UAAU;AACjB,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,SAAS,QAAQ,UAAU;AACpC,SAASC,OAAO,QAAQ,YAAY;AA2BpC;AACA,OAAO,MAAMC,SAAS,GAAGC,IAAA;EAAA,IACvBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IAAAC,kBAAA,GAAAL,IAAA,CACVM,aAAa;IAAbA,aAAa,GAAAD,kBAAA,cAAG,UAAU,GAAAA,kBAAA;IAAAE,kBAAA,GAAAP,IAAA,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EJ;EAAgB,gBAC9C/C,KAAA,CAAA6B,aAAA,CAACvB,yBAAyB;IACxB+B,KAAK,EAAEY,QAAQ,KAAK,MAAO;IAC3BhB,OAAO,EAAC,WAAW;IACnB,cAAYG,KAAM;IAClBD,QAAQ,EAAEA,QAAS;IACnB,eAAae,MAAO;IACpBhB,OAAO,EAAEA;EAAQ,GAEhBR,QACwB,CACpB,CAAC;AAAA,CACX;AAEDiB,eAAe,CAACL,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"BatchEdit.js","names":["React","Children","useEffect","useState","createPortal","classnames","BATCH_EDIT_STRIP_MS","StyledBatchEdit","StyledBatchEditClip","StyledBatchEditClipInner","StyledBatchEditCount","StyledBatchEditCounter","StyledBatchEditFloat","StyledBatchEditGroup","StyledBatchEditIconButton","StyledBatchEditStrip","StyledBatchEditStripClose","StyledBatchEditStripCount","StyledBatchEditStripGroups","Button","CloseIcon","PillButton","PillGroup","Tooltip","useClipPresence","open","_useState","isRendered","setIsRendered","undefined","timer","setTimeout","clearTimeout","BatchEditStrip","_ref","count","container","_ref$bleed","bleed","_ref$standalone","standalone","_ref$actions","actions","_ref$hasChanges","hasChanges","onUpdate","_ref$updateDisabled","updateDisabled","onClearChanges","_ref$updateLabel","updateLabel","_ref$clearChangesLabe","clearChangesLabel","onClose","onClearAll","_ref$selectedLabel","selectedLabel","_ref$clearAllLabel","clearAllLabel","_ref$closeLabel","closeLabel","children","className","style","menus","toArray","createElement","$open","margin","$standalone","paddingBottom","appearance","tone","disabled","dimDisabled","placeholder","onClick","length","map","action","key","id","icon","label","title","variant","BatchEditFloat","_ref2","_ref2$selectedLabel","_ref2$clearAllLabel","_ref2$closeLabel","_ref2$fitContent","fitContent","_ref2$renderInPortal","renderInPortal","$fitContent","$gap","weight","$dark","BatchEdit","props","look","displayName","BatchEditGroup","_ref3","_ref3$gap","gap","BatchEditAction","_ref4","_ref4$disabled","_ref4$tooltipDisabled","tooltipDisabled","_ref4$iconTone","iconTone","testId","disable"],"sources":["../../../../src/components/BatchEdit/BatchEdit.tsx"],"sourcesContent":["import React, {\n Children,\n CSSProperties,\n MouseEventHandler,\n ReactElement,\n ReactNode,\n useEffect,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport classnames from \"classnames\";\n\nimport {\n BATCH_EDIT_STRIP_MS,\n StyledBatchEdit,\n StyledBatchEditClip,\n StyledBatchEditClipInner,\n StyledBatchEditCount,\n StyledBatchEditCounter,\n StyledBatchEditFloat,\n StyledBatchEditGroup,\n StyledBatchEditIconButton,\n StyledBatchEditStrip,\n StyledBatchEditStripClose,\n StyledBatchEditStripCount,\n StyledBatchEditStripGroups,\n} from \"./Styles\";\nimport { Button } from \"../Button\";\nimport { CloseIcon } from \"../Icons\";\nimport { PillButton } from \"../PillButton\";\nimport { PillGroup } from \"../PillGroup\";\nimport { Tooltip } from \"../Tooltip\";\n\nexport interface IBatchEditStripAction {\n id: string;\n /** The text of the pill. */\n label: string;\n icon: ReactElement;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n disabled?: boolean;\n \"data-testid\"?: string;\n}\n\nexport interface IBatchEditProps {\n /** Shows the bar. */\n open: boolean;\n /** \"float\" is the floating bar at the bottom of the page. \"strip\" is the band under the toolbar of a list, in `container`. */\n look?: \"float\" | \"strip\";\n /** Strip only: the element that the strip renders in. Without it the strip renders nothing. */\n container?: Element | null;\n /** Strip only: the pixels that the strip reaches past the padding of its paper. */\n bleed?: number;\n /** Strip only: rounds every corner, for a list with no paper above it. */\n standalone?: boolean;\n /** Strip only: the action pills after Clear All. */\n actions?: IBatchEditStripAction[];\n /** Strip only: shows Update and Clear Properties after the property menus. */\n hasChanges?: boolean;\n /** Strip only: called when the reader clicks Update. */\n onUpdate?: MouseEventHandler<HTMLButtonElement>;\n /** Strip only: disables Update. */\n updateDisabled?: boolean;\n /** Strip only: called when the reader clears the picked property values. */\n onClearChanges?: MouseEventHandler<HTMLButtonElement>;\n /** Strip only: the text of the Update pill. */\n updateLabel?: string;\n /** Strip only: the tooltip and the accessible name of the Clear Properties pill. */\n clearChangesLabel?: string;\n /** The number of selected items. */\n count: number;\n /** Called when the reader clicks the close button. */\n onClose?: () => void;\n /** Called when the reader clicks Clear All. The button is disabled with no selection. */\n onClearAll?: () => void;\n /** The text before the count. A colon follows it. */\n selectedLabel?: string;\n /** The text of the Clear All button. */\n clearAllLabel?: string;\n /** The tooltip and the accessible name of the close button. */\n closeLabel?: string;\n /** Sizes the bar to its content, from 800px up to the window less 32px, with 32px gaps, as the project list does. */\n fitContent?: boolean;\n /** Renders the bar in a portal at the bottom of the page. Set to false to render it in place. */\n renderInPortal?: boolean;\n /** The action groups between Clear All and the close button. */\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\n// The strip stays in the page while it clips shut, and leaves after the animation.\nconst useClipPresence = (open: boolean) => {\n const [isRendered, setIsRendered] = useState(open);\n\n useEffect(() => {\n if (open) {\n setIsRendered(true);\n\n return undefined;\n }\n\n const timer = setTimeout(() => setIsRendered(false), BATCH_EDIT_STRIP_MS);\n\n return () => clearTimeout(timer);\n }, [open]);\n\n return open || isRendered;\n};\n\n/** The band under the toolbar of a list: the count with Clear All, the action pills, the property menus, Update and a close button. */\nconst BatchEditStrip = ({\n open,\n count,\n container,\n bleed = 0,\n standalone = false,\n actions = [],\n hasChanges = false,\n onUpdate,\n updateDisabled = false,\n onClearChanges,\n updateLabel = \"Update\",\n clearChangesLabel = \"Clear Properties\",\n onClose,\n onClearAll,\n selectedLabel = \"Selected\",\n clearAllLabel = \"Clear All\",\n closeLabel = \"Close\",\n children,\n className,\n style,\n}: IBatchEditProps) => {\n const isRendered = useClipPresence(open);\n const menus = Children.toArray(children);\n\n if (!container || !isRendered) {\n return null;\n }\n\n return createPortal(\n <StyledBatchEditClip\n $open={open}\n style={bleed ? { margin: `-${bleed}px -${bleed}px 0` } : undefined}\n data-testid=\"batch-edit-strip-clip\"\n >\n <StyledBatchEditClipInner\n $standalone={standalone}\n style={bleed ? { paddingBottom: `${bleed}px` } : undefined}\n >\n <StyledBatchEditStrip\n $standalone={standalone}\n style={style}\n className={classnames(\"c-batch-edit c-batch-edit--strip\", className)}\n data-testid=\"batch-edit-strip\"\n >\n <StyledBatchEditStripGroups>\n <StyledBatchEditFloat>\n <PillGroup appearance=\"raised\">\n <PillButton tone=\"well\" disabled dimDisabled={false}>\n <StyledBatchEditStripCount>\n <span data-testid=\"batch-edit-counter\">{count}</span>{\" \"}\n {selectedLabel}\n </StyledBatchEditStripCount>\n </PillButton>\n <PillButton\n tone=\"raised\"\n placeholder={clearAllLabel}\n onClick={onClearAll}\n disabled={count === 0}\n />\n </PillGroup>\n </StyledBatchEditFloat>\n {actions.length ? (\n <StyledBatchEditFloat>\n <PillGroup appearance=\"raised\">\n {actions.map((action) => (\n <PillButton\n key={action.id}\n tone=\"raised\"\n icon={action.icon}\n placeholder={action.label}\n onClick={action.onClick}\n disabled={action.disabled}\n data-testid={action[\"data-testid\"]}\n />\n ))}\n </PillGroup>\n </StyledBatchEditFloat>\n ) : null}\n {menus.length ? (\n <StyledBatchEditFloat>\n <PillGroup appearance=\"raised\">{menus}</PillGroup>\n </StyledBatchEditFloat>\n ) : null}\n {hasChanges ? (\n <StyledBatchEditFloat>\n <PillGroup appearance=\"raised\">\n <PillButton\n tone=\"primary\"\n placeholder={updateLabel}\n onClick={onUpdate}\n disabled={updateDisabled}\n data-testid=\"batch-update\"\n />\n <Tooltip title={clearChangesLabel}>\n <PillButton\n tone=\"raised\"\n icon={<CloseIcon />}\n aria-label={clearChangesLabel}\n onClick={onClearChanges}\n data-testid=\"batch-clear-properties\"\n />\n </Tooltip>\n </PillGroup>\n </StyledBatchEditFloat>\n ) : null}\n </StyledBatchEditStripGroups>\n <Tooltip title={closeLabel}>\n <StyledBatchEditStripClose\n variant=\"text gray\"\n aria-label={closeLabel}\n onClick={onClose}\n >\n <CloseIcon />\n </StyledBatchEditStripClose>\n </Tooltip>\n </StyledBatchEditStrip>\n </StyledBatchEditClipInner>\n </StyledBatchEditClip>,\n container\n );\n};\n\n/** The floating bar at the bottom of the page. */\nconst BatchEditFloat = ({\n open,\n count,\n onClose,\n onClearAll,\n selectedLabel = \"Selected\",\n clearAllLabel = \"Clear All\",\n closeLabel = \"Close\",\n fitContent = false,\n renderInPortal = true,\n children,\n className,\n style,\n}: IBatchEditProps) => (\n <StyledBatchEdit\n open={open}\n renderInPortal={renderInPortal}\n $fitContent={fitContent}\n style={style}\n className={classnames(\"c-batch-edit\", className)}\n >\n <StyledBatchEditGroup $gap={24}>\n <StyledBatchEditCount weight=\"bold\">\n {selectedLabel}:\n <StyledBatchEditCounter data-testid=\"batch-edit-counter\">\n {count}\n </StyledBatchEditCounter>\n </StyledBatchEditCount>\n <Button variant=\"tertiary\" onClick={onClearAll} disabled={count === 0}>\n {clearAllLabel}\n </Button>\n </StyledBatchEditGroup>\n\n {children}\n\n <Tooltip title={closeLabel}>\n <StyledBatchEditIconButton\n $dark\n onClick={onClose}\n variant=\"text gray\"\n aria-label={closeLabel}\n >\n <CloseIcon />\n </StyledBatchEditIconButton>\n </Tooltip>\n </StyledBatchEdit>\n);\n\n/** The batch edit bar: the selection count, Clear All, the actions and a close button. The look sets a floating bar or a strip under the toolbar. */\nexport const BatchEdit = (props: IBatchEditProps) =>\n props.look === \"strip\" ? (\n <BatchEditStrip {...props} />\n ) : (\n <BatchEditFloat {...props} />\n );\n\nBatchEdit.displayName = \"BatchEdit\";\n\nexport interface IBatchEditGroupProps {\n /** The gap between the parts in pixels: 8 for project actions, 24 for task actions, 16 for menus. */\n gap?: number;\n children?: ReactNode;\n className?: string;\n}\n\n/** A row of batch edit parts, such as the action icons or the property menus with Update. */\nexport const BatchEditGroup = ({\n gap = 16,\n children,\n className,\n}: IBatchEditGroupProps) => (\n <StyledBatchEditGroup\n $gap={gap}\n className={classnames(\"c-batch-edit-group\", className)}\n >\n {children}\n </StyledBatchEditGroup>\n);\n\nBatchEditGroup.displayName = \"BatchEditGroup\";\n\nexport interface IBatchEditActionProps {\n /** The tooltip and the accessible name of the action. */\n title: string;\n /** The icon of the action. */\n children: ReactElement;\n /** Called when the reader clicks the action. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n /** Disables the action. */\n disabled?: boolean;\n /** Hides the tooltip. The default follows `disabled`. */\n tooltipDisabled?: boolean;\n /** Dark paints the icon theme-900, as the task bar does. Gray keeps the gray of the button, as the project bar does. */\n iconTone?: \"dark\" | \"gray\";\n \"data-testid\"?: string;\n}\n\n/** An icon action of the batch edit bar, such as Complete, Move or Move to Trash. */\nexport const BatchEditAction = ({\n title,\n children,\n onClick,\n disabled = false,\n tooltipDisabled = disabled,\n iconTone = \"dark\",\n \"data-testid\": testId,\n}: IBatchEditActionProps) => (\n <Tooltip title={title} disable={tooltipDisabled}>\n <StyledBatchEditIconButton\n $dark={iconTone === \"dark\"}\n variant=\"text gray\"\n aria-label={title}\n disabled={disabled}\n data-testid={testId}\n onClick={onClick}\n >\n {children}\n </StyledBatchEditIconButton>\n </Tooltip>\n);\n\nBatchEditAction.displayName = \"BatchEditAction\";\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,QAAQ,EAKRC,SAAS,EACTC,QAAQ,QACH,OAAO;AACd,SAASC,YAAY,QAAQ,WAAW;AAExC,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,mBAAmB,EACnBC,eAAe,EACfC,mBAAmB,EACnBC,wBAAwB,EACxBC,oBAAoB,EACpBC,sBAAsB,EACtBC,oBAAoB,EACpBC,oBAAoB,EACpBC,yBAAyB,EACzBC,oBAAoB,EACpBC,yBAAyB,EACzBC,yBAAyB,EACzBC,0BAA0B,QACrB,UAAU;AACjB,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,SAAS,QAAQ,UAAU;AACpC,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,OAAO,QAAQ,YAAY;AA2DpC;AACA,MAAMC,eAAe,GAAIC,IAAa,IAA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A,IAC7BxB,KAAK,GAAAwB,KAAA,CAALxB,KAAK;IACLvB,QAAQ,GAAA+C,KAAA,CAAR/C,QAAQ;IACRe,OAAO,GAAAgC,KAAA,CAAPhC,OAAO;IAAAiC,cAAA,GAAAD,KAAA,CACPnC,QAAQ;IAARA,QAAQ,GAAAoC,cAAA,cAAG,KAAK,GAAAA,cAAA;IAAAC,qBAAA,GAAAF,KAAA,CAChBG,eAAe;IAAfA,eAAe,GAAAD,qBAAA,cAAGrC,QAAQ,GAAAqC,qBAAA;IAAAE,cAAA,GAAAJ,KAAA,CAC1BK,QAAQ;IAARA,QAAQ,GAAAD,cAAA,cAAG,MAAM,GAAAA,cAAA;IACFE,MAAM,GAAAN,KAAA,CAArB,aAAa;EAAA,oBAEb5G,KAAA,CAAAkE,aAAA,CAAC3C,OAAO;IAAC6D,KAAK,EAAEA,KAAM;IAAC+B,OAAO,EAAEJ;EAAgB,gBAC9C/G,KAAA,CAAAkE,aAAA,CAACpD,yBAAyB;IACxBoF,KAAK,EAAEe,QAAQ,KAAK,MAAO;IAC3B5B,OAAO,EAAC,WAAW;IACnB,cAAYD,KAAM;IAClBX,QAAQ,EAAEA,QAAS;IACnB,eAAayC,MAAO;IACpBtC,OAAO,EAAEA;EAAQ,GAEhBf,QACwB,CACpB,CAAC;AAAA,CACX;AAED8C,eAAe,CAACL,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -5,6 +5,8 @@ export interface IBatchPropertyItem {
|
|
|
5
5
|
id: string;
|
|
6
6
|
/** The name in the menu and in the header of the pane. */
|
|
7
7
|
name: string;
|
|
8
|
+
/** An icon before the name in the menu. */
|
|
9
|
+
icon?: ReactElement;
|
|
8
10
|
}
|
|
9
11
|
export interface IBatchPropertiesProps {
|
|
10
12
|
/** The properties that the menu lists. */
|
|
@@ -33,12 +35,16 @@ export interface IBatchPropertiesProps {
|
|
|
33
35
|
defaultOpen?: boolean;
|
|
34
36
|
/** The id of the property whose pane shows when the menu opens first. */
|
|
35
37
|
defaultItem?: string;
|
|
38
|
+
/** "float" is the counter button of the floating bar. "strip" is a raised pill with a badge, for the strip of BatchEdit. */
|
|
39
|
+
look?: "float" | "strip";
|
|
40
|
+
/** A class of the popper of the menu. */
|
|
41
|
+
popperClassName?: string;
|
|
36
42
|
className?: string;
|
|
37
43
|
"data-testid"?: string;
|
|
38
44
|
}
|
|
39
45
|
/** A batch edit menu: a counter button that opens a list of properties, each with its own pane. */
|
|
40
46
|
export declare const BatchProperties: {
|
|
41
|
-
({ items, renderPane, counts, counter, onClear, onClose, disabled, label, icon, clearAllLabel, backLabel, defaultOpen, defaultItem, className, "data-testid": testId, }: IBatchPropertiesProps): React.JSX.Element;
|
|
47
|
+
({ items, renderPane, counts, counter, onClear, onClose, disabled, label, icon, clearAllLabel, backLabel, defaultOpen, defaultItem, look, popperClassName, className, "data-testid": testId, }: IBatchPropertiesProps): React.JSX.Element;
|
|
42
48
|
displayName: string;
|
|
43
49
|
};
|
|
44
50
|
//# sourceMappingURL=BatchProperties.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BatchProperties.d.ts","sourceRoot":"","sources":["../../../../src/components/BatchEdit/BatchProperties.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,YAAY,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BatchProperties.d.ts","sourceRoot":"","sources":["../../../../src/components/BatchEdit/BatchProperties.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,YAAY,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAc7E,OAAO,EAAwB,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAM5E,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,wEAAwE;IACxE,UAAU,EAAE,CACV,IAAI,EAAE,kBAAkB,EACxB,KAAK,EAAE,kBAAkB,KACtB,SAAS,CAAC;IACf,8FAA8F;IAC9F,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4HAA4H;IAC5H,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,mGAAmG;AACnG,eAAO,MAAM,eAAe;oMAkBzB,qBAAqB;;CA2GvB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import classnames from "classnames";
|
|
3
|
-
import { StyledBatchPropertiesItem, StyledBatchPropertiesList, StyledBatchPropertiesMenu, StyledBatchPropertiesName, StyledBatchPropertiesTrigger } from "./Styles";
|
|
3
|
+
import { StyledBatchPropertiesItem, StyledBatchPropertiesItemIcon, StyledBatchPropertiesList, StyledBatchPropertiesMenu, StyledBatchPropertiesName, StyledBatchPropertiesPillLabel, StyledBatchPropertiesTrigger } from "./Styles";
|
|
4
4
|
import { Badge } from "../Badge";
|
|
5
5
|
import { DrilldownMenuContent } from "../DrilldownMenu";
|
|
6
6
|
import { ArrowRightIcon, EditIcon } from "../Icons";
|
|
7
|
+
import { PillButton } from "../PillButton";
|
|
7
8
|
const WIDTH = 260;
|
|
8
9
|
/** A batch edit menu: a counter button that opens a list of properties, each with its own pane. */
|
|
9
10
|
export const BatchProperties = _ref => {
|
|
@@ -26,6 +27,9 @@ export const BatchProperties = _ref => {
|
|
|
26
27
|
_ref$defaultOpen = _ref.defaultOpen,
|
|
27
28
|
defaultOpen = _ref$defaultOpen === void 0 ? false : _ref$defaultOpen,
|
|
28
29
|
defaultItem = _ref.defaultItem,
|
|
30
|
+
_ref$look = _ref.look,
|
|
31
|
+
look = _ref$look === void 0 ? "float" : _ref$look,
|
|
32
|
+
popperClassName = _ref.popperClassName,
|
|
29
33
|
className = _ref.className,
|
|
30
34
|
_ref$dataTestid = _ref["data-testid"],
|
|
31
35
|
testId = _ref$dataTestid === void 0 ? "batch-properties" : _ref$dataTestid;
|
|
@@ -49,12 +53,24 @@ export const BatchProperties = _ref => {
|
|
|
49
53
|
title: item.name,
|
|
50
54
|
content: props => renderPane(item, props)
|
|
51
55
|
}));
|
|
56
|
+
const isStrip = look === "strip";
|
|
52
57
|
return /*#__PURE__*/React.createElement(StyledBatchPropertiesMenu, {
|
|
53
58
|
open: open,
|
|
54
59
|
onOpen: () => setOpen(true),
|
|
55
60
|
onClose: handleClose,
|
|
56
|
-
position: "top-start",
|
|
57
|
-
|
|
61
|
+
position: isStrip ? "bottom-start" : "top-start",
|
|
62
|
+
popperClassName: popperClassName,
|
|
63
|
+
target: isStrip ? /*#__PURE__*/React.createElement(PillButton, {
|
|
64
|
+
tone: "raised",
|
|
65
|
+
active: open,
|
|
66
|
+
disabled: disabled,
|
|
67
|
+
"data-testid": testId,
|
|
68
|
+
className: classnames("c-batch-properties", className)
|
|
69
|
+
}, /*#__PURE__*/React.createElement(StyledBatchPropertiesPillLabel, null, icon, label, total > 0 ? /*#__PURE__*/React.createElement(Badge, {
|
|
70
|
+
value: total,
|
|
71
|
+
dimension: 16,
|
|
72
|
+
isStandalone: true
|
|
73
|
+
}) : null)) : /*#__PURE__*/React.createElement(StyledBatchPropertiesTrigger, {
|
|
58
74
|
active: open,
|
|
59
75
|
disabled: disabled,
|
|
60
76
|
"data-testid": testId,
|
|
@@ -91,7 +107,7 @@ export const BatchProperties = _ref => {
|
|
|
91
107
|
openSubmenu(item.id);
|
|
92
108
|
}
|
|
93
109
|
}
|
|
94
|
-
}, /*#__PURE__*/React.createElement(StyledBatchPropertiesName, null, item.name), count > 0 ? /*#__PURE__*/React.createElement(Badge, {
|
|
110
|
+
}, item.icon ? /*#__PURE__*/React.createElement(StyledBatchPropertiesItemIcon, null, item.icon) : null, /*#__PURE__*/React.createElement(StyledBatchPropertiesName, null, item.name), count > 0 ? /*#__PURE__*/React.createElement(Badge, {
|
|
95
111
|
value: count,
|
|
96
112
|
dimension: 16,
|
|
97
113
|
isStandalone: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BatchProperties.js","names":["React","useState","classnames","StyledBatchPropertiesItem","StyledBatchPropertiesList","StyledBatchPropertiesMenu","StyledBatchPropertiesName","StyledBatchPropertiesTrigger","Badge","DrilldownMenuContent","ArrowRightIcon","EditIcon","WIDTH","BatchProperties","_ref","items","renderPane","_ref$counts","counts","counter","onClear","onClose","_ref$disabled","disabled","_ref$label","label","_ref$icon","icon","createElement","_ref$clearAllLabel","clearAllLabel","backLabel","_ref$defaultOpen","defaultOpen","defaultItem","className","_ref$dataTestid","testId","_useState","open","setOpen","total","filter","item","_counts$item$id","id","length","handleClose","handleClear","event","stopPropagation","submenus","map","title","name","content","props","onOpen","position","target","active","tooltipText","onClearAll","width","initialView","_ref2","openSubmenu","style","tabIndex","_counts$item$id2","count","key","onClick","onKeyDown","preventDefault","value","dimension","isStandalone","displayName"],"sources":["../../../../src/components/BatchEdit/BatchProperties.tsx"],"sourcesContent":["import React, { MouseEvent, ReactElement, ReactNode, useState } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledBatchPropertiesItem,\n StyledBatchPropertiesList,\n StyledBatchPropertiesMenu,\n StyledBatchPropertiesName,\n StyledBatchPropertiesTrigger,\n} from \"./Styles\";\nimport { Badge } from \"../Badge\";\nimport { DrilldownMenuContent, SubmenuRenderProps } from \"../DrilldownMenu\";\nimport { ArrowRightIcon, EditIcon } from \"../Icons\";\n\nconst WIDTH = 260;\n\nexport interface IBatchPropertyItem {\n /** Identifies the property. `renderPane` and `counts` use it. */\n id: string;\n /** The name in the menu and in the header of the pane. */\n name: string;\n}\n\nexport interface IBatchPropertiesProps {\n /** The properties that the menu lists. */\n items: IBatchPropertyItem[];\n /** Renders the pane of a property. `goBack` slides back to the list. */\n renderPane: (\n item: IBatchPropertyItem,\n props: SubmenuRenderProps\n ) => ReactNode;\n /** The number of picked values per property id. A count above 0 shows a badge in the list. */\n counts?: Record<string, number>;\n /** The number on the trigger. The default is the number of properties with a count. */\n counter?: number;\n /** Called when the reader clicks the clear button of the trigger. */\n onClear?: () => void;\n /** Called when the menu closes. */\n onClose?: () => void;\n /** Disables the trigger. */\n disabled?: boolean;\n /** The text of the trigger. */\n label?: string;\n /** The icon of the trigger. */\n icon?: ReactElement;\n /** The tooltip of the clear button of the trigger. */\n clearAllLabel?: string;\n /** The accessible label of the back button in each pane. */\n backLabel?: string;\n /** Opens the menu when it mounts. */\n defaultOpen?: boolean;\n /** The id of the property whose pane shows when the menu opens first. */\n defaultItem?: string;\n className?: string;\n \"data-testid\"?: string;\n}\n\n/** A batch edit menu: a counter button that opens a list of properties, each with its own pane. */\nexport const BatchProperties = ({\n items,\n renderPane,\n counts = {},\n counter,\n onClear,\n onClose,\n disabled = false,\n label = \"Properties\",\n icon = <EditIcon />,\n clearAllLabel = \"Clear All\",\n backLabel,\n defaultOpen = false,\n defaultItem,\n className,\n \"data-testid\": testId = \"batch-properties\",\n}: IBatchPropertiesProps) => {\n const [open, setOpen] = useState(defaultOpen);\n const total =\n counter ?? items.filter((item) => (counts[item.id] ?? 0) > 0).length;\n\n const handleClose = () => {\n setOpen(false);\n onClose?.();\n };\n\n const handleClear = (event?: MouseEvent) => {\n event?.stopPropagation();\n onClear?.();\n };\n\n const submenus = items.map((item) => ({\n id: item.id,\n title: item.name,\n content: (props: SubmenuRenderProps) => renderPane(item, props),\n }));\n\n return (\n <StyledBatchPropertiesMenu\n open={open}\n onOpen={() => setOpen(true)}\n onClose={handleClose}\n position=\"top-start\"\n target={\n <StyledBatchPropertiesTrigger\n active={open}\n disabled={disabled}\n data-testid={testId}\n className={classnames(\"c-batch-properties\", className)}\n label={label}\n icon={icon}\n tooltipText={clearAllLabel}\n onClearAll={handleClear}\n counter={total}\n />\n }\n >\n <DrilldownMenuContent\n width={WIDTH}\n submenus={submenus}\n backLabel={backLabel}\n initialView={defaultItem}\n >\n {({ openSubmenu }) => (\n <div style={{ width: WIDTH }}>\n <StyledBatchPropertiesList tabIndex={0}>\n {items.map((item) => {\n const count = counts[item.id] ?? 0;\n\n return (\n <StyledBatchPropertiesItem\n key={item.id}\n data-id={item.id}\n onClick={() => openSubmenu(item.id)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n openSubmenu(item.id);\n }\n }}\n >\n <StyledBatchPropertiesName>\n {item.name}\n </StyledBatchPropertiesName>\n {count > 0 ? (\n <Badge value={count} dimension={16} isStandalone />\n ) : null}\n <ArrowRightIcon />\n </StyledBatchPropertiesItem>\n );\n })}\n </StyledBatchPropertiesList>\n </div>\n )}\n </DrilldownMenuContent>\n </StyledBatchPropertiesMenu>\n );\n};\n\nBatchProperties.displayName = \"BatchProperties\";\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AC,CAAC;YACtBR,WAAW,CAACvB,IAAI,CAACE,EAAE,CAAC;UACtB;QACF;MAAE,gBAEF7C,KAAA,CAAA4B,aAAA,CAACtB,yBAAyB,QACvBqC,IAAI,CAACW,IACmB,CAAC,EAC3BgB,KAAK,GAAG,CAAC,gBACRtE,KAAA,CAAA4B,aAAA,CAACpB,KAAK;QAACmE,KAAK,EAAEL,KAAM;QAACM,SAAS,EAAE,EAAG;QAACC,YAAY;MAAA,CAAE,CAAC,GACjD,IAAI,eACR7E,KAAA,CAAA4B,aAAA,CAAClB,cAAc,MAAE,CACQ,CAAC;IAEhC,CAAC,CACwB,CACxB,CAAC;EAAA,CAEY,CACG,CAAC;AAEhC,CAAC;AAEDG,eAAe,CAACiE,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"BatchProperties.js","names":["React","useState","classnames","StyledBatchPropertiesItem","StyledBatchPropertiesItemIcon","StyledBatchPropertiesList","StyledBatchPropertiesMenu","StyledBatchPropertiesName","StyledBatchPropertiesPillLabel","StyledBatchPropertiesTrigger","Badge","DrilldownMenuContent","ArrowRightIcon","EditIcon","PillButton","WIDTH","BatchProperties","_ref","items","renderPane","_ref$counts","counts","counter","onClear","onClose","_ref$disabled","disabled","_ref$label","label","_ref$icon","icon","createElement","_ref$clearAllLabel","clearAllLabel","backLabel","_ref$defaultOpen","defaultOpen","defaultItem","_ref$look","look","popperClassName","className","_ref$dataTestid","testId","_useState","open","setOpen","total","filter","item","_counts$item$id","id","length","handleClose","handleClear","event","stopPropagation","submenus","map","title","name","content","props","isStrip","onOpen","position","target","tone","active","value","dimension","isStandalone","tooltipText","onClearAll","width","initialView","_ref2","openSubmenu","style","tabIndex","_counts$item$id2","count","key","onClick","onKeyDown","preventDefault","displayName"],"sources":["../../../../src/components/BatchEdit/BatchProperties.tsx"],"sourcesContent":["import React, { MouseEvent, ReactElement, ReactNode, useState } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledBatchPropertiesItem,\n StyledBatchPropertiesItemIcon,\n StyledBatchPropertiesList,\n StyledBatchPropertiesMenu,\n StyledBatchPropertiesName,\n StyledBatchPropertiesPillLabel,\n StyledBatchPropertiesTrigger,\n} from \"./Styles\";\nimport { Badge } from \"../Badge\";\nimport { DrilldownMenuContent, SubmenuRenderProps } from \"../DrilldownMenu\";\nimport { ArrowRightIcon, EditIcon } from \"../Icons\";\nimport { PillButton } from \"../PillButton\";\n\nconst WIDTH = 260;\n\nexport interface IBatchPropertyItem {\n /** Identifies the property. `renderPane` and `counts` use it. */\n id: string;\n /** The name in the menu and in the header of the pane. */\n name: string;\n /** An icon before the name in the menu. */\n icon?: ReactElement;\n}\n\nexport interface IBatchPropertiesProps {\n /** The properties that the menu lists. */\n items: IBatchPropertyItem[];\n /** Renders the pane of a property. `goBack` slides back to the list. */\n renderPane: (\n item: IBatchPropertyItem,\n props: SubmenuRenderProps\n ) => ReactNode;\n /** The number of picked values per property id. A count above 0 shows a badge in the list. */\n counts?: Record<string, number>;\n /** The number on the trigger. The default is the number of properties with a count. */\n counter?: number;\n /** Called when the reader clicks the clear button of the trigger. */\n onClear?: () => void;\n /** Called when the menu closes. */\n onClose?: () => void;\n /** Disables the trigger. */\n disabled?: boolean;\n /** The text of the trigger. */\n label?: string;\n /** The icon of the trigger. */\n icon?: ReactElement;\n /** The tooltip of the clear button of the trigger. */\n clearAllLabel?: string;\n /** The accessible label of the back button in each pane. */\n backLabel?: string;\n /** Opens the menu when it mounts. */\n defaultOpen?: boolean;\n /** The id of the property whose pane shows when the menu opens first. */\n defaultItem?: string;\n /** \"float\" is the counter button of the floating bar. \"strip\" is a raised pill with a badge, for the strip of BatchEdit. */\n look?: \"float\" | \"strip\";\n /** A class of the popper of the menu. */\n popperClassName?: string;\n className?: string;\n \"data-testid\"?: string;\n}\n\n/** A batch edit menu: a counter button that opens a list of properties, each with its own pane. */\nexport const BatchProperties = ({\n items,\n renderPane,\n counts = {},\n counter,\n onClear,\n onClose,\n disabled = false,\n label = \"Properties\",\n icon = <EditIcon />,\n clearAllLabel = \"Clear All\",\n backLabel,\n defaultOpen = false,\n defaultItem,\n look = \"float\",\n popperClassName,\n className,\n \"data-testid\": testId = \"batch-properties\",\n}: IBatchPropertiesProps) => {\n const [open, setOpen] = useState(defaultOpen);\n const total =\n counter ?? items.filter((item) => (counts[item.id] ?? 0) > 0).length;\n\n const handleClose = () => {\n setOpen(false);\n onClose?.();\n };\n\n const handleClear = (event?: MouseEvent) => {\n event?.stopPropagation();\n onClear?.();\n };\n\n const submenus = items.map((item) => ({\n id: item.id,\n title: item.name,\n content: (props: SubmenuRenderProps) => renderPane(item, props),\n }));\n\n const isStrip = look === \"strip\";\n\n return (\n <StyledBatchPropertiesMenu\n open={open}\n onOpen={() => setOpen(true)}\n onClose={handleClose}\n position={isStrip ? \"bottom-start\" : \"top-start\"}\n popperClassName={popperClassName}\n target={\n isStrip ? (\n <PillButton\n tone=\"raised\"\n active={open}\n disabled={disabled}\n data-testid={testId}\n className={classnames(\"c-batch-properties\", className)}\n >\n <StyledBatchPropertiesPillLabel>\n {icon}\n {label}\n {total > 0 ? (\n <Badge value={total} dimension={16} isStandalone />\n ) : null}\n </StyledBatchPropertiesPillLabel>\n </PillButton>\n ) : (\n <StyledBatchPropertiesTrigger\n active={open}\n disabled={disabled}\n data-testid={testId}\n className={classnames(\"c-batch-properties\", className)}\n label={label}\n icon={icon}\n tooltipText={clearAllLabel}\n onClearAll={handleClear}\n counter={total}\n />\n )\n }\n >\n <DrilldownMenuContent\n width={WIDTH}\n submenus={submenus}\n backLabel={backLabel}\n initialView={defaultItem}\n >\n {({ openSubmenu }) => (\n <div style={{ width: WIDTH }}>\n <StyledBatchPropertiesList tabIndex={0}>\n {items.map((item) => {\n const count = counts[item.id] ?? 0;\n\n return (\n <StyledBatchPropertiesItem\n key={item.id}\n data-id={item.id}\n onClick={() => openSubmenu(item.id)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n openSubmenu(item.id);\n }\n }}\n >\n {item.icon ? (\n <StyledBatchPropertiesItemIcon>\n {item.icon}\n </StyledBatchPropertiesItemIcon>\n ) : null}\n <StyledBatchPropertiesName>\n {item.name}\n </StyledBatchPropertiesName>\n {count > 0 ? (\n <Badge value={count} dimension={16} isStandalone />\n ) : null}\n <ArrowRightIcon />\n </StyledBatchPropertiesItem>\n );\n })}\n </StyledBatchPropertiesList>\n </div>\n )}\n </DrilldownMenuContent>\n </StyledBatchPropertiesMenu>\n );\n};\n\nBatchProperties.displayName = \"BatchProperties\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAyCC,QAAQ,QAAQ,OAAO;AAE5E,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,yBAAyB,EACzBC,6BAA6B,EAC7BC,yBAAyB,EACzBC,yBAAyB,EACzBC,yBAAyB,EACzBC,8BAA8B,EAC9BC,4BAA4B,QACvB,UAAU;AACjB,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,oBAAoB,QAA4B,kBAAkB;AAC3E,SAASC,cAAc,EAAEC,QAAQ,QAAQ,UAAU;AACnD,SAASC,UAAU,QAAQ,eAAe;AAE1C,MAAMC,KAAK,GAAG,GAAG;AAiDjB;AACA,OAAO,MAAMC,eAAe,GAAGC,IAAA,IAkBF;EAAA,IAjB3BC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IAAAC,WAAA,GAAAH,IAAA,CACVI,MAAM;IAANA,MAAM,GAAAD,WAAA,cAAG,CAAC,CAAC,GAAAA,WAAA;IACXE,OAAO,GAAAL,IAAA,CAAPK,OAAO;IACPC,OAAO,GAAAN,IAAA,CAAPM,OAAO;IACPC,OAAO,GAAAP,IAAA,CAAPO,OAAO;IAAAC,aAAA,GAAAR,IAAA,CACPS,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAG,KAAK,GAAAA,aAAA;IAAAE,UAAA,GAAAV,IAAA,CAChBW,KAAK;IA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ACnB,IAAI,gBACR9B,KAAA,CAAA+B,aAAA,CAAC3B,6BAA6B,QAC3B6C,IAAI,CAACnB,IACuB,CAAC,GAC9B,IAAI,eACR9B,KAAA,CAAA+B,aAAA,CAACxB,yBAAyB,QACvB0C,IAAI,CAACW,IACmB,CAAC,EAC3BqB,KAAK,GAAG,CAAC,gBACRjF,KAAA,CAAA+B,aAAA,CAACrB,KAAK;QAAC2D,KAAK,EAAEY,KAAM;QAACX,SAAS,EAAE,EAAG;QAACC,YAAY;MAAA,CAAE,CAAC,GACjD,IAAI,eACRvE,KAAA,CAAA+B,aAAA,CAACnB,cAAc,MAAE,CACQ,CAAC;IAEhC,CAAC,CACwB,CACxB,CAAC;EAAA,CAEY,CACG,CAAC;AAEhC,CAAC;AAEDI,eAAe,CAACsE,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -29,4 +29,22 @@ export declare const StyledBatchPropertiesItem: import("styled-components").Styl
|
|
|
29
29
|
children?: import("react").ReactNode | undefined;
|
|
30
30
|
} & import("react").HTMLAttributes<HTMLLIElement> & import("react").RefAttributes<HTMLLIElement>>, any, {}, never>;
|
|
31
31
|
export declare const StyledBatchPropertiesName: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
32
|
+
export declare const BATCH_EDIT_STRIP_MS = 200;
|
|
33
|
+
export declare const StyledBatchEditClip: import("styled-components").StyledComponent<"div", any, {
|
|
34
|
+
$open: boolean;
|
|
35
|
+
}, never>;
|
|
36
|
+
export declare const StyledBatchEditClipInner: import("styled-components").StyledComponent<"div", any, {
|
|
37
|
+
$standalone: boolean;
|
|
38
|
+
}, never>;
|
|
39
|
+
export declare const StyledBatchEditStrip: import("styled-components").StyledComponent<"div", any, {
|
|
40
|
+
$standalone: boolean;
|
|
41
|
+
}, never>;
|
|
42
|
+
export declare const StyledBatchEditFloat: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
43
|
+
export declare const StyledBatchEditStripCount: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
44
|
+
export declare const StyledBatchEditStripGroups: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
45
|
+
export declare const StyledBatchEditStripClose: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").IconButtonProps & {
|
|
46
|
+
children?: import("react").ReactNode | undefined;
|
|
47
|
+
} & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
48
|
+
export declare const StyledBatchPropertiesPillLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
49
|
+
export declare const StyledBatchPropertiesItemIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
32
50
|
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/BatchEdit/Styles.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,eAAO,MAAM,eAAe;iBAAkC,OAAO;SAcpE,CAAC;AAIF,eAAO,MAAM,oBAAoB;UAAsB,MAAM;SAI5D,CAAC;AAIF,eAAO,MAAM,oBAAoB,mQAIhC,CAAC;AAIF,eAAO,MAAM,sBAAsB,oEAGlC,CAAC;AAWF,eAAO,MAAM,yBAAyB;;;WAA+B,OAAO;SAE3E,CAAC;AAIF,eAAO,MAAM,4BAA4B,0LAMxC,CAAC;AAIF,eAAO,MAAM,yBAAyB,qGAKrC,CAAC;AAIF,eAAO,MAAM,yBAAyB;;;;;;;;;;kBAUrC,CAAC;AAIF,eAAO,MAAM,yBAAyB;;kHAIrC,CAAC;AAIF,eAAO,MAAM,yBAAyB,oEAMrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/BatchEdit/Styles.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,eAAO,MAAM,eAAe;iBAAkC,OAAO;SAcpE,CAAC;AAIF,eAAO,MAAM,oBAAoB;UAAsB,MAAM;SAI5D,CAAC;AAIF,eAAO,MAAM,oBAAoB,mQAIhC,CAAC;AAIF,eAAO,MAAM,sBAAsB,oEAGlC,CAAC;AAWF,eAAO,MAAM,yBAAyB;;;WAA+B,OAAO;SAE3E,CAAC;AAIF,eAAO,MAAM,4BAA4B,0LAMxC,CAAC;AAIF,eAAO,MAAM,yBAAyB,qGAKrC,CAAC;AAIF,eAAO,MAAM,yBAAyB;;;;;;;;;;kBAUrC,CAAC;AAIF,eAAO,MAAM,yBAAyB;;kHAIrC,CAAC;AAIF,eAAO,MAAM,yBAAyB,oEAMrC,CAAC;AAIF,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAGvC,eAAO,MAAM,mBAAmB;WAAuB,OAAO;SAgB7D,CAAC;AAIF,eAAO,MAAM,wBAAwB;iBAA6B,OAAO;SAIxE,CAAC;AAKF,eAAO,MAAM,oBAAoB;iBAA6B,OAAO;SAyBpE,CAAC;AAIF,eAAO,MAAM,oBAAoB,oEAGhC,CAAC;AAIF,eAAO,MAAM,yBAAyB,qEAMrC,CAAC;AAKF,eAAO,MAAM,0BAA0B,oEAOtC,CAAC;AAIF,eAAO,MAAM,yBAAyB;;sEAErC,CAAC;AAKF,eAAO,MAAM,8BAA8B,qEAkB1C,CAAC;AAIF,eAAO,MAAM,6BAA6B,qEASzC,CAAC"}
|
|
@@ -67,4 +67,70 @@ export const StyledBatchPropertiesName = styled.div.withConfig({
|
|
|
67
67
|
componentId: "sc-wphosb-9"
|
|
68
68
|
})(["flex:1 1 0%;padding-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
69
69
|
StyledBatchPropertiesName.displayName = "StyledBatchPropertiesName";
|
|
70
|
+
export const BATCH_EDIT_STRIP_MS = 200;
|
|
71
|
+
|
|
72
|
+
// The strip opens and closes by the height of its row, from no height when it mounts.
|
|
73
|
+
export const StyledBatchEditClip = styled.div.withConfig({
|
|
74
|
+
displayName: "Styles__StyledBatchEditClip",
|
|
75
|
+
componentId: "sc-wphosb-10"
|
|
76
|
+
})(["display:grid;grid-template-rows:", ";transition:grid-template-rows ", "ms ease-out;", " @media (prefers-reduced-motion:reduce){transition:none;}"], _ref4 => {
|
|
77
|
+
let $open = _ref4.$open;
|
|
78
|
+
return $open ? "1fr" : "0fr";
|
|
79
|
+
}, BATCH_EDIT_STRIP_MS, _ref5 => {
|
|
80
|
+
let $open = _ref5.$open;
|
|
81
|
+
return $open && css(["@starting-style{grid-template-rows:0fr;}"]);
|
|
82
|
+
});
|
|
83
|
+
StyledBatchEditClip.displayName = "StyledBatchEditClip";
|
|
84
|
+
export const StyledBatchEditClipInner = styled.div.withConfig({
|
|
85
|
+
displayName: "Styles__StyledBatchEditClipInner",
|
|
86
|
+
componentId: "sc-wphosb-11"
|
|
87
|
+
})(["min-height:0;overflow:hidden;", ""], _ref6 => {
|
|
88
|
+
let $standalone = _ref6.$standalone;
|
|
89
|
+
return $standalone && "padding-bottom: 8px;";
|
|
90
|
+
});
|
|
91
|
+
StyledBatchEditClipInner.displayName = "StyledBatchEditClipInner";
|
|
92
|
+
|
|
93
|
+
// A light theme takes a softer tint with an accent edge, so the strip does not fight the paper and its shadow.
|
|
94
|
+
export const StyledBatchEditStrip = styled.div.withConfig({
|
|
95
|
+
displayName: "Styles__StyledBatchEditStrip",
|
|
96
|
+
componentId: "sc-wphosb-12"
|
|
97
|
+
})(["--batch-edit-strip-base:var(--color-primary-300);display:flex;align-items:center;gap:8px;min-height:52px;padding:8px 8px 8px 12px;border-radius:", ";background-color:var(--page-paper-main);background-image:linear-gradient( var(--color-primary-100),var(--color-primary-100) ),linear-gradient(var(--batch-edit-strip-base),var(--batch-edit-strip-base));box-shadow:inset 0 0 0 1px var(--batch-edit-strip-edge,transparent);@supports (color:light-dark(red,red)){--batch-edit-strip-base:light-dark( var(--color-primary-200),var(--color-primary-300) );--batch-edit-strip-edge:light-dark(var(--color-primary-400),transparent);}"], _ref7 => {
|
|
98
|
+
let $standalone = _ref7.$standalone;
|
|
99
|
+
return $standalone ? "var(--ac-br-8)" : "var(--ac-br-8) var(--ac-br-8) 0 0";
|
|
100
|
+
});
|
|
101
|
+
StyledBatchEditStrip.displayName = "StyledBatchEditStrip";
|
|
102
|
+
export const StyledBatchEditFloat = styled.div.withConfig({
|
|
103
|
+
displayName: "Styles__StyledBatchEditFloat",
|
|
104
|
+
componentId: "sc-wphosb-13"
|
|
105
|
+
})(["border-radius:9999px;box-shadow:0 4px 12px -4px rgba(0,0,0,0.35);"]);
|
|
106
|
+
StyledBatchEditFloat.displayName = "StyledBatchEditFloat";
|
|
107
|
+
export const StyledBatchEditStripCount = styled.span.withConfig({
|
|
108
|
+
displayName: "Styles__StyledBatchEditStripCount",
|
|
109
|
+
componentId: "sc-wphosb-14"
|
|
110
|
+
})(["white-space:nowrap;[data-testid=\"batch-edit-counter\"]{font-variant-numeric:tabular-nums;}"]);
|
|
111
|
+
StyledBatchEditStripCount.displayName = "StyledBatchEditStripCount";
|
|
112
|
+
|
|
113
|
+
// A narrow strip wraps its groups into more rows, so no button leaves the screen.
|
|
114
|
+
export const StyledBatchEditStripGroups = styled.div.withConfig({
|
|
115
|
+
displayName: "Styles__StyledBatchEditStripGroups",
|
|
116
|
+
componentId: "sc-wphosb-15"
|
|
117
|
+
})(["display:flex;flex:1;flex-wrap:wrap;align-items:center;gap:8px;min-width:0;"]);
|
|
118
|
+
StyledBatchEditStripGroups.displayName = "StyledBatchEditStripGroups";
|
|
119
|
+
export const StyledBatchEditStripClose = styled(IconButton).withConfig({
|
|
120
|
+
displayName: "Styles__StyledBatchEditStripClose",
|
|
121
|
+
componentId: "sc-wphosb-16"
|
|
122
|
+
})(["flex-shrink:0;"]);
|
|
123
|
+
StyledBatchEditStripClose.displayName = "StyledBatchEditStripClose";
|
|
124
|
+
|
|
125
|
+
// The icon of a menu pill takes the size and the color of an action pill icon.
|
|
126
|
+
export const StyledBatchPropertiesPillLabel = styled.span.withConfig({
|
|
127
|
+
displayName: "Styles__StyledBatchPropertiesPillLabel",
|
|
128
|
+
componentId: "sc-wphosb-17"
|
|
129
|
+
})(["display:flex;align-items:center;gap:6px;> svg{flex-shrink:0;width:18px;height:18px;}> svg:not([fill=\"none\"]){fill:currentColor;}> svg[stroke]{stroke:currentColor;}"]);
|
|
130
|
+
StyledBatchPropertiesPillLabel.displayName = "StyledBatchPropertiesPillLabel";
|
|
131
|
+
export const StyledBatchPropertiesItemIcon = styled.span.withConfig({
|
|
132
|
+
displayName: "Styles__StyledBatchPropertiesItemIcon",
|
|
133
|
+
componentId: "sc-wphosb-18"
|
|
134
|
+
})(["display:flex;flex-shrink:0;margin-right:8px;svg{width:16px;height:16px;}"]);
|
|
135
|
+
StyledBatchPropertiesItemIcon.displayName = "StyledBatchPropertiesItemIcon";
|
|
70
136
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","CounterButton","IconButton","List","Menu","Toolbar","Body2","StyledBatchEdit","withConfig","displayName","componentId","_ref","$fitContent","StyledBatchEditGroup","div","_ref2","$gap","StyledBatchEditCount","StyledBatchEditCounter","darkIcons","StyledBatchEditIconButton","_ref3","$dark","StyledBatchPropertiesTrigger","StyledBatchPropertiesMenu","StyledBatchPropertiesList","StyledBatchPropertiesItem","Item","StyledBatchPropertiesName"],"sources":["../../../../src/components/BatchEdit/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { CounterButton } from \"../CounterButton\";\nimport { IconButton } from \"../IconButton\";\nimport { List } from \"../List\";\nimport { Menu } from \"../Menu\";\nimport { Toolbar } from \"../Toolbar\";\nimport { Body2 } from \"../Typography\";\n\nexport const StyledBatchEdit = styled(Toolbar)<{ $fitContent: boolean }>`\n && {\n justify-content: space-between;\n height: 56px;\n\n ${({ $fitContent }) =>\n $fitContent &&\n css`\n width: max-content;\n min-width: 800px;\n max-width: calc(100vw - 32px);\n gap: 32px;\n `}\n }\n`;\n\nStyledBatchEdit.displayName = \"StyledBatchEdit\";\n\nexport const StyledBatchEditGroup = styled.div<{ $gap: number }>`\n display: flex;\n align-items: center;\n gap: ${({ $gap }) => $gap}px;\n`;\n\nStyledBatchEditGroup.displayName = \"StyledBatchEditGroup\";\n\nexport const StyledBatchEditCount = styled(Body2)`\n && {\n display: flex;\n }\n`;\n\nStyledBatchEditCount.displayName = \"StyledBatchEditCount\";\n\nexport const StyledBatchEditCounter = styled.div`\n width: 30px;\n margin-left: 4px;\n`;\n\nStyledBatchEditCounter.displayName = \"StyledBatchEditCounter\";\n\n// The frontend paints these icons theme-900 over every state of the button.\nconst darkIcons = css`\n svg {\n fill: var(--color-theme-900) !important;\n }\n`;\n\nexport const StyledBatchEditIconButton = styled(IconButton)<{ $dark: boolean }>`\n ${({ $dark }) => $dark && darkIcons}\n`;\n\nStyledBatchEditIconButton.displayName = \"StyledBatchEditIconButton\";\n\nexport const StyledBatchPropertiesTrigger = styled(CounterButton)`\n ${darkIcons}\n\n .c-counter-button__label {\n color: var(--color-theme-900) !important;\n }\n`;\n\nStyledBatchPropertiesTrigger.displayName = \"StyledBatchPropertiesTrigger\";\n\nexport const StyledBatchPropertiesMenu = styled(Menu)`\n && {\n position: relative;\n overflow: hidden;\n }\n`;\n\nStyledBatchPropertiesMenu.displayName = \"StyledBatchPropertiesMenu\";\n\nexport const StyledBatchPropertiesList = styled(List)`\n && {\n padding-top: 8px;\n padding-bottom: 8px;\n }\n\n &&:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n`;\n\nStyledBatchPropertiesList.displayName = \"StyledBatchPropertiesList\";\n\nexport const StyledBatchPropertiesItem = styled(List.Item)`\n && {\n padding-right: 12px;\n }\n`;\n\nStyledBatchPropertiesItem.displayName = \"StyledBatchPropertiesItem\";\n\nexport const StyledBatchPropertiesName = styled.div`\n flex: 1 1 0%;\n padding-right: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nStyledBatchPropertiesName.displayName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,aACvDW,KAAA;EAAA,IAAGC,KAAK,GAAAD,KAAA,CAALC,KAAK;EAAA,OAAOA,KAAK,IAAIH,SAAS;AAAA,EACpC;AAEDC,yBAAyB,CAACX,WAAW,GAAG,2BAA2B;AAEnE,OAAO,MAAMc,4BAA4B,GAAGxB,MAAM,CAACE,aAAa,CAAC,CAAAO,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gFAC7DS,SAAS,CAKZ;AAEDI,4BAA4B,CAACd,WAAW,GAAG,8BAA8B;AAEzE,OAAO,MAAMe,yBAAyB,GAAGzB,MAAM,CAACK,IAAI,CAAC,CAAAI,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,8CAKpD;AAEDc,yBAAyB,CAACf,WAAW,GAAG,2BAA2B;AAEnE,OAAO,MAAMgB,yBAAyB,GAAG1B,MAAM,CAACI,IAAI,CAAC,CAAAK,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0GAUpD;AAEDe,yBAAyB,CAAChB,WAAW,GAAG,2BAA2B;AAEnE,OAAO,MAAMiB,yBAAyB,GAAG3B,MAAM,CAACI,IAAI,CAACwB,IAAI,CAAC,CAAAnB,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+BAIzD;AAEDgB,yBAAyB,CAACjB,WAAW,GAAG,2BAA2B;AAEnE,OAAO,MAAMmB,yBAAyB,GAAG7B,MAAM,CAACe,GAAG,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gGAMlD;AAEDkB,yBAAyB,CAACnB,WAAW,GAAG,2BAA2B","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","CounterButton","IconButton","List","Menu","Toolbar","Body2","StyledBatchEdit","withConfig","displayName","componentId","_ref","$fitContent","StyledBatchEditGroup","div","_ref2","$gap","StyledBatchEditCount","StyledBatchEditCounter","darkIcons","StyledBatchEditIconButton","_ref3","$dark","StyledBatchPropertiesTrigger","StyledBatchPropertiesMenu","StyledBatchPropertiesList","StyledBatchPropertiesItem","Item","StyledBatchPropertiesName","BATCH_EDIT_STRIP_MS","StyledBatchEditClip","_ref4","$open","_ref5","StyledBatchEditClipInner","_ref6","$standalone","StyledBatchEditStrip","_ref7","StyledBatchEditFloat","StyledBatchEditStripCount","span","StyledBatchEditStripGroups","StyledBatchEditStripClose","StyledBatchPropertiesPillLabel","StyledBatchPropertiesItemIcon"],"sources":["../../../../src/components/BatchEdit/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { CounterButton } from \"../CounterButton\";\nimport { IconButton } from \"../IconButton\";\nimport { List } from \"../List\";\nimport { Menu } from \"../Menu\";\nimport { Toolbar } from \"../Toolbar\";\nimport { Body2 } from \"../Typography\";\n\nexport const StyledBatchEdit = styled(Toolbar)<{ $fitContent: boolean }>`\n && {\n justify-content: space-between;\n height: 56px;\n\n ${({ $fitContent }) =>\n $fitContent &&\n css`\n width: max-content;\n min-width: 800px;\n max-width: calc(100vw - 32px);\n gap: 32px;\n `}\n }\n`;\n\nStyledBatchEdit.displayName = \"StyledBatchEdit\";\n\nexport const StyledBatchEditGroup = styled.div<{ $gap: number }>`\n display: flex;\n align-items: center;\n gap: ${({ $gap }) => $gap}px;\n`;\n\nStyledBatchEditGroup.displayName = \"StyledBatchEditGroup\";\n\nexport const StyledBatchEditCount = styled(Body2)`\n && {\n display: flex;\n }\n`;\n\nStyledBatchEditCount.displayName = \"StyledBatchEditCount\";\n\nexport const StyledBatchEditCounter = styled.div`\n width: 30px;\n margin-left: 4px;\n`;\n\nStyledBatchEditCounter.displayName = \"StyledBatchEditCounter\";\n\n// The frontend paints these icons theme-900 over every state of the button.\nconst darkIcons = css`\n svg {\n fill: var(--color-theme-900) !important;\n }\n`;\n\nexport const StyledBatchEditIconButton = styled(IconButton)<{ $dark: boolean }>`\n ${({ $dark }) => $dark && darkIcons}\n`;\n\nStyledBatchEditIconButton.displayName = \"StyledBatchEditIconButton\";\n\nexport const StyledBatchPropertiesTrigger = styled(CounterButton)`\n ${darkIcons}\n\n .c-counter-button__label {\n color: var(--color-theme-900) !important;\n }\n`;\n\nStyledBatchPropertiesTrigger.displayName = \"StyledBatchPropertiesTrigger\";\n\nexport const StyledBatchPropertiesMenu = styled(Menu)`\n && {\n position: relative;\n overflow: hidden;\n }\n`;\n\nStyledBatchPropertiesMenu.displayName = \"StyledBatchPropertiesMenu\";\n\nexport const StyledBatchPropertiesList = styled(List)`\n && {\n padding-top: 8px;\n padding-bottom: 8px;\n }\n\n &&:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n`;\n\nStyledBatchPropertiesList.displayName = \"StyledBatchPropertiesList\";\n\nexport const StyledBatchPropertiesItem = styled(List.Item)`\n && {\n padding-right: 12px;\n }\n`;\n\nStyledBatchPropertiesItem.displayName = \"StyledBatchPropertiesItem\";\n\nexport const StyledBatchPropertiesName = styled.div`\n flex: 1 1 0%;\n padding-right: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nStyledBatchPropertiesName.displayName = \"StyledBatchPropertiesName\";\n\nexport const BATCH_EDIT_STRIP_MS = 200;\n\n// The strip opens and closes by the height of its row, from no height when it mounts.\nexport const StyledBatchEditClip = styled.div<{ $open: boolean }>`\n display: grid;\n grid-template-rows: ${({ $open }) => ($open ? \"1fr\" : \"0fr\")};\n transition: grid-template-rows ${BATCH_EDIT_STRIP_MS}ms ease-out;\n\n ${({ $open }) =>\n $open &&\n css`\n @starting-style {\n grid-template-rows: 0fr;\n }\n `}\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n`;\n\nStyledBatchEditClip.displayName = \"StyledBatchEditClip\";\n\nexport const StyledBatchEditClipInner = styled.div<{ $standalone: boolean }>`\n min-height: 0;\n overflow: hidden;\n ${({ $standalone }) => $standalone && \"padding-bottom: 8px;\"}\n`;\n\nStyledBatchEditClipInner.displayName = \"StyledBatchEditClipInner\";\n\n// A light theme takes a softer tint with an accent edge, so the strip does not fight the paper and its shadow.\nexport const StyledBatchEditStrip = styled.div<{ $standalone: boolean }>`\n --batch-edit-strip-base: var(--color-primary-300);\n\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: 52px;\n padding: 8px 8px 8px 12px;\n border-radius: ${({ $standalone }) =>\n $standalone ? \"var(--ac-br-8)\" : \"var(--ac-br-8) var(--ac-br-8) 0 0\"};\n background-color: var(--page-paper-main);\n background-image: linear-gradient(\n var(--color-primary-100),\n var(--color-primary-100)\n ),\n linear-gradient(var(--batch-edit-strip-base), var(--batch-edit-strip-base));\n box-shadow: inset 0 0 0 1px var(--batch-edit-strip-edge, transparent);\n\n @supports (color: light-dark(red, red)) {\n --batch-edit-strip-base: light-dark(\n var(--color-primary-200),\n var(--color-primary-300)\n );\n --batch-edit-strip-edge: light-dark(var(--color-primary-400), transparent);\n }\n`;\n\nStyledBatchEditStrip.displayName = \"StyledBatchEditStrip\";\n\nexport const StyledBatchEditFloat = styled.div`\n border-radius: 9999px;\n box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.35);\n`;\n\nStyledBatchEditFloat.displayName = \"StyledBatchEditFloat\";\n\nexport const StyledBatchEditStripCount = styled.span`\n white-space: nowrap;\n\n [data-testid=\"batch-edit-counter\"] {\n font-variant-numeric: tabular-nums;\n }\n`;\n\nStyledBatchEditStripCount.displayName = \"StyledBatchEditStripCount\";\n\n// A narrow strip wraps its groups into more rows, so no button leaves the screen.\nexport const StyledBatchEditStripGroups = styled.div`\n display: flex;\n flex: 1;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n min-width: 0;\n`;\n\nStyledBatchEditStripGroups.displayName = \"StyledBatchEditStripGroups\";\n\nexport const StyledBatchEditStripClose = styled(IconButton)`\n flex-shrink: 0;\n`;\n\nStyledBatchEditStripClose.displayName = \"StyledBatchEditStripClose\";\n\n// The icon of a menu pill takes the size and the color of an action pill icon.\nexport const StyledBatchPropertiesPillLabel = styled.span`\n display: flex;\n align-items: center;\n gap: 6px;\n\n > svg {\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n }\n\n > svg:not([fill=\"none\"]) {\n fill: currentColor;\n }\n\n > svg[stroke] {\n stroke: currentColor;\n }\n`;\n\nStyledBatchPropertiesPillLabel.displayName = \"StyledBatchPropertiesPillLabel\";\n\nexport const StyledBatchPropertiesItemIcon = styled.span`\n display: flex;\n flex-shrink: 0;\n margin-right: 8px;\n\n svg {\n width: 16px;\n height: 16px;\n }\n`;\n\nStyledBatchPropertiesItemIcon.displayName = \"StyledBatchPropertiesItemIcon\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,KAAK,QAAQ,eAAe;AAErC,OAAO,MAAMC,eAAe,GAAGR,MAAM,CAACM,OAAO,CAAC,CAAAG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2DAKxCC,IAAA;EAAA,IAAGC,WAAW,GAAAD,IAAA,CAAXC,WAAW;EAAA,OACdA,WAAW,IACXZ,GAAG,8EAKF;AAAA,EAEN;AAEDO,eAAe,CAACE,WAAW,GAAG,iBAAiB;AAE/C,OAAO,MAAMI,oBAAoB,GAAGd,MAAM,CAACe,GAAG,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oDAGrCK,KAAA;EAAA,IAAGC,IAAI,GAAAD,KAAA,CAAJC,IAAI;EAAA,OAAOA,IAAI;AAAA,EAC1B;AAEDH,oBAAoB,CAACJ,WAAW,GAAG,sBAAsB;AAEzD,OAAO,MAAMQ,oBAAoB,GAAGlB,MAAM,CAACO,KAAK,CAAC,CAAAE,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,yBAIhD;AAEDO,oBAAoB,CAACR,WAAW,GAAG,sBAAsB;AAEzD,OAAO,MAAM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AA;EAAAC,WAAA;AAAA,mGAMnD;AAED8B,yBAAyB,CAAC/B,WAAW,GAAG,2BAA2B;;AAEnE;AACA,OAAO,MAAMiC,0BAA0B,GAAG3C,MAAM,CAACe,GAAG,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kFAOnD;AAEDgC,0BAA0B,CAACjC,WAAW,GAAG,4BAA4B;AAErE,OAAO,MAAMkC,yBAAyB,GAAG5C,MAAM,CAACG,UAAU,CAAC,CAAAM,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,sBAE1D;AAEDiC,yBAAyB,CAAClC,WAAW,GAAG,2BAA2B;;AAEnE;AACA,OAAO,MAAMmC,8BAA8B,GAAG7C,MAAM,CAAC0C,IAAI,CAAAjC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6KAkBxD;AAEDkC,8BAA8B,CAACnC,WAAW,GAAG,gCAAgC;AAE7E,OAAO,MAAMoC,6BAA6B,GAAG9C,MAAM,CAAC0C,IAAI,CAAAjC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gFASvD;AAEDmC,6BAA6B,CAACpC,WAAW,GAAG,+BAA+B","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ export interface PillButtonProps extends ComponentPropsWithoutRef<"button"> {
|
|
|
6
6
|
endIcon?: ReactElement;
|
|
7
7
|
/** Label shown next to the icon while the pill has no value. */
|
|
8
8
|
placeholder?: ReactNode;
|
|
9
|
-
/** Fill of the pill. "ghost" stays empty until hover, focus, open, or hover of a `c-pill-host` ancestor. "alert" and "warning" look soft and get their own active look, for example an active flag. "accent" has a soft fill and the text of the primary color, for an action that must stand out. "primary" is a solid primary pill for the main action of a raised group, for example Update. "well" is a
|
|
9
|
+
/** Fill of the pill. "ghost" stays empty until hover, focus, open, or hover of a `c-pill-host` ancestor. "alert" and "warning" look soft and get their own active look, for example an active flag. "accent" has a soft fill and the text of the primary color, for an action that must stand out. "primary" is a solid primary pill for the main action of a raised group, for example Update. "well" is a flat pill in the page background for a value in a raised group, for example a count. */
|
|
10
10
|
tone?: "soft" | "alternate" | "ghost" | "outlined" | "alert" | "warning" | "accent" | "raised" | "primary" | "well";
|
|
11
11
|
/** Selected or pressed state. */
|
|
12
12
|
active?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillButton.d.ts","sourceRoot":"","sources":["../../../../src/components/PillButton/PillButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,wBAAwB,EAExB,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AAUf,MAAM,WAAW,eAAgB,SAAQ,wBAAwB,CAAC,QAAQ,CAAC;IACzE,8CAA8C;IAC9C,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,mFAAmF;IACnF,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,gEAAgE;IAChE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"PillButton.d.ts","sourceRoot":"","sources":["../../../../src/components/PillButton/PillButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,wBAAwB,EAExB,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AAUf,MAAM,WAAW,eAAgB,SAAQ,wBAAwB,CAAC,QAAQ,CAAC;IACzE,8CAA8C;IAC9C,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,mFAAmF;IACnF,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,gEAAgE;IAChE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,oeAAoe;IACpe,IAAI,CAAC,EACD,MAAM,GACN,WAAW,GACX,OAAO,GACP,UAAU,GACV,OAAO,GACP,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,CAAC;IACX,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC7B,gKAAgK;IAChK,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC/C,qFAAqF;IACrF,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,2GAA2G;IAC3G,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,2FAwEtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillButton.js","names":["React","Children","forwardRef","classnames","StyledPillButton","StyledPillIcon","StyledPillPlaceholder","PillButton","_ref","ref","_args$ariaLabel","icon","endIcon","placeholder","_ref$tone","tone","active","_ref$iconOnly","iconOnly","_ref$compact","compact","_ref$size","size","_ref$inset","inset","_ref$dimDisabled","dimDisabled","_ref$type","type","className","children","args","_objectWithoutPropertiesLoose","_excluded","isEmpty","toArray","length","ariaLabel","undefined","createElement","_extends","$tone","$active","Boolean","$empty","$iconOnly","$compact","$size","$inset","$dimDisabled","displayName"],"sources":["../../../../src/components/PillButton/PillButton.tsx"],"sourcesContent":["import React, {\n Children,\n ComponentPropsWithoutRef,\n forwardRef,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledPillButton,\n StyledPillIcon,\n StyledPillPlaceholder,\n} from \"./Styles\";\n\nexport interface PillButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n /** Icon shown while the pill has no value. */\n icon?: ReactElement;\n /** Icon after the placeholder, for example a caret on a pill that opens a menu. */\n endIcon?: ReactElement;\n /** Label shown next to the icon while the pill has no value. */\n placeholder?: ReactNode;\n /** Fill of the pill. \"ghost\" stays empty until hover, focus, open, or hover of a `c-pill-host` ancestor. \"alert\" and \"warning\" look soft and get their own active look, for example an active flag. \"accent\" has a soft fill and the text of the primary color, for an action that must stand out. \"primary\" is a solid primary pill for the main action of a raised group, for example Update. \"well\" is a
|
|
1
|
+
{"version":3,"file":"PillButton.js","names":["React","Children","forwardRef","classnames","StyledPillButton","StyledPillIcon","StyledPillPlaceholder","PillButton","_ref","ref","_args$ariaLabel","icon","endIcon","placeholder","_ref$tone","tone","active","_ref$iconOnly","iconOnly","_ref$compact","compact","_ref$size","size","_ref$inset","inset","_ref$dimDisabled","dimDisabled","_ref$type","type","className","children","args","_objectWithoutPropertiesLoose","_excluded","isEmpty","toArray","length","ariaLabel","undefined","createElement","_extends","$tone","$active","Boolean","$empty","$iconOnly","$compact","$size","$inset","$dimDisabled","displayName"],"sources":["../../../../src/components/PillButton/PillButton.tsx"],"sourcesContent":["import React, {\n Children,\n ComponentPropsWithoutRef,\n forwardRef,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledPillButton,\n StyledPillIcon,\n StyledPillPlaceholder,\n} from \"./Styles\";\n\nexport interface PillButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n /** Icon shown while the pill has no value. */\n icon?: ReactElement;\n /** Icon after the placeholder, for example a caret on a pill that opens a menu. */\n endIcon?: ReactElement;\n /** Label shown next to the icon while the pill has no value. */\n placeholder?: ReactNode;\n /** Fill of the pill. \"ghost\" stays empty until hover, focus, open, or hover of a `c-pill-host` ancestor. \"alert\" and \"warning\" look soft and get their own active look, for example an active flag. \"accent\" has a soft fill and the text of the primary color, for an action that must stand out. \"primary\" is a solid primary pill for the main action of a raised group, for example Update. \"well\" is a flat pill in the page background for a value in a raised group, for example a count. */\n tone?:\n | \"soft\"\n | \"alternate\"\n | \"ghost\"\n | \"outlined\"\n | \"alert\"\n | \"warning\"\n | \"accent\"\n | \"raised\"\n | \"primary\"\n | \"well\";\n /** Selected or pressed state. */\n active?: boolean;\n /** A square-ish pill that holds only its icon, for example a close button. */\n iconOnly?: boolean;\n /** Hide the placeholder and keep the icon, always or only on small screens. */\n compact?: boolean | \"mobile\";\n /** Height: \"medium\" is 26px, \"small\" is 24px like a small Button, \"dense\" is 24px with 12px text and icon, \"xsmall\" is 18px with 10px text like a type chip. */\n size?: \"xsmall\" | \"small\" | \"dense\" | \"medium\";\n /** Side padding. \"tight\" suits a value that draws to its own edges, like avatars. */\n inset?: \"default\" | \"tight\";\n /** Dims a disabled pill. Set false to keep the full look of a read-only indicator, still with no hover. */\n dimDisabled?: boolean;\n}\n\n/**\n * @component PillButton\n * @description\n * A rounded trigger for a field value, for example the assignees, the dates or the label of a task.\n * With no children it shows its icon and placeholder. With children it shows only the children.\n * It forwards its ref and click handler, so a Menu or a Select can use it as a target.\n * Put several pills in a PillGroup to make a segmented control.\n *\n * @example\n * <PillButton icon={<CalendarIcon />} placeholder=\"Dates\" />\n * <PillButton tone=\"ghost\">Sep 24. - 30.</PillButton>\n */\nexport const PillButton = forwardRef<HTMLButtonElement, PillButtonProps>(\n (\n {\n icon,\n endIcon,\n placeholder,\n tone = \"soft\",\n active,\n iconOnly = false,\n compact = false,\n size = \"medium\",\n inset = \"default\",\n dimDisabled = true,\n type = \"button\",\n className,\n children,\n ...args\n },\n ref\n ) => {\n const isEmpty = Children.toArray(children).length === 0;\n const ariaLabel =\n args[\"aria-label\"] ??\n (isEmpty && compact && typeof placeholder === \"string\"\n ? placeholder\n : undefined);\n\n return (\n <StyledPillButton\n ref={ref}\n type={type}\n className={classnames(\n \"c-pill-button\",\n `c-pill-button--${tone}`,\n {\n \"c-pill-button--empty\": isEmpty,\n \"c-pill-button--active\": active,\n \"c-pill-button--icon-only\": iconOnly,\n },\n className\n )}\n aria-pressed={active}\n {...args}\n aria-label={ariaLabel}\n $tone={tone}\n $active={Boolean(active)}\n $empty={isEmpty}\n $iconOnly={iconOnly}\n $compact={compact}\n $size={size}\n $inset={inset}\n $dimDisabled={dimDisabled}\n >\n {isEmpty && icon ? (\n <StyledPillIcon className=\"c-pill-button__icon\">\n {icon}\n </StyledPillIcon>\n ) : null}\n {isEmpty && placeholder && !iconOnly ? (\n <StyledPillPlaceholder className=\"c-pill-button__placeholder\">\n {placeholder}\n </StyledPillPlaceholder>\n ) : null}\n {isEmpty && endIcon && !iconOnly ? (\n <StyledPillIcon className=\"c-pill-button__end-icon\">\n {endIcon}\n </StyledPillIcon>\n ) : null}\n {isEmpty ? null : children}\n </StyledPillButton>\n );\n }\n);\n\nPillButton.displayName = \"PillButton\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,QAAQ,EAERC,UAAU,QAGL,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,gBAAgB,EAChBC,cAAc,EACdC,qBAAqB,QAChB,UAAU;AAmCjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,gBAAGL,UAAU,CAClC,CAAAM,IAAA,EAiBEC,GAAG,KACA;EAAA,IAAAC,eAAA;EAAA,IAhBDC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IACJC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IAAAC,SAAA,GAAAN,IAAA,CACXO,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAG,MAAM,GAAAA,SAAA;IACbE,MAAM,GAAAR,IAAA,CAANQ,MAAM;IAAAC,aAAA,GAAAT,IAAA,CACNU,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAG,KAAK,GAAAA,aAAA;IAAAE,YAAA,GAAAX,IAAA,CAChBY,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,KAAK,GAAAA,YAAA;IAAAE,SAAA,GAAAb,IAAA,CACfc,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAG,QAAQ,GAAAA,SAAA;IAAAE,UAAA,GAAAf,IAAA,CACfgB,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,SAAS,GAAAA,UAAA;IAAAE,gBAAA,GAAAjB,IAAA,CACjBkB,WAAW;IAAXA,WAAW,GAAAD,gBA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PuB,OAAO,IAAIrB,WAAW,IAAI,CAACK,QAAQ,gBAClClB,KAAA,CAAAuC,aAAA,CAACjC,qBAAqB;IAACuB,SAAS,EAAC;EAA4B,GAC1DhB,WACoB,CAAC,GACtB,IAAI,EACPqB,OAAO,IAAItB,OAAO,IAAI,CAACM,QAAQ,gBAC9BlB,KAAA,CAAAuC,aAAA,CAAClC,cAAc;IAACwB,SAAS,EAAC;EAAyB,GAChDjB,OACa,CAAC,GACf,IAAI,EACPsB,OAAO,GAAG,IAAI,GAAGJ,QACF,CAAC;AAEvB,CACF,CAAC;AAEDvB,UAAU,CAAC2C,WAAW,GAAG,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/PillButton/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,UAAU,qBAAqB;IAC7B,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,qEAU1B,CAAC;AAIF,eAAO,MAAM,qBAAqB,qEAGjC,CAAC;
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/PillButton/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,UAAU,qBAAqB;IAC7B,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,qEAU1B,CAAC;AAIF,eAAO,MAAM,qBAAqB,qEAGjC,CAAC;AAuPF,eAAO,MAAM,gBAAgB,0FAgG5B,CAAC"}
|
|
@@ -29,7 +29,7 @@ const toneStyle = tone => {
|
|
|
29
29
|
case "primary":
|
|
30
30
|
return css(["&&{gap:6px;font-weight:600;}border:1px solid var(--color-primary);background-color:var(--color-primary);background-image:linear-gradient( var(--color-primary-800),var(--color-primary) );box-shadow:inset 0 1px 0 rgba(255,255,255,0.35);color:var(--page-paper-main);", "{color:inherit;}&:hover{background-color:var(--color-primary-800);background-image:none;}&:focus-visible{outline:2px solid var(--color-primary);outline-offset:1px;}"], StyledPillIcon);
|
|
31
31
|
case "well":
|
|
32
|
-
return css(["&&{gap:6px;font-weight:600;}border:1px solid var(--color-theme-400);background-color:var(--body-bg-main);
|
|
32
|
+
return css(["&&{gap:6px;font-weight:600;}border:1px solid var(--color-theme-400);background-color:var(--body-bg-main);color:var(--color-theme-900);", "{color:inherit;}&:focus-visible{outline:2px solid var(--color-primary);outline-offset:1px;}"], StyledPillIcon);
|
|
33
33
|
case "ghost":
|
|
34
34
|
return css(["background-color:transparent;.c-pill-host:hover &.c-pill-button--ghost,&:focus-visible{background-color:var(--pill-background);}.c-pill-host:hover &.c-pill-button--ghost:hover,&:hover{background-color:var(--pill-background-hover);", "}"], hoverTextStyle);
|
|
35
35
|
case "outlined":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","StyledPillIcon","span","withConfig","displayName","componentId","StyledPillPlaceholder","ACTIVE_COLORS","alert","warning","activeColors","tone","activeStyle","hoverTextStyle","toneStyle","compactStyle","PILL_HEIGHTS","xsmall","small","dense","medium","denseStyle","xsmallStyle","StyledPillButton","button","props","$size","$inset","$empty","$dimDisabled","$tone","$iconOnly","$compact","$active"],"sources":["../../../../src/components/PillButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { PillButtonProps } from \"./PillButton\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\ninterface StyledPillButtonProps {\n $tone: NonNullable<PillButtonProps[\"tone\"]>;\n $active: boolean;\n $empty: boolean;\n $iconOnly: boolean;\n $compact: PillButtonProps[\"compact\"];\n $size: NonNullable<PillButtonProps[\"size\"]>;\n $inset: NonNullable<PillButtonProps[\"inset\"]>;\n $dimDisabled: boolean;\n}\n\nexport const StyledPillIcon = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n color: var(--color-theme-600);\n\n svg {\n width: 18px;\n height: 18px;\n fill: currentColor;\n }\n`;\n\nStyledPillIcon.displayName = \"StyledPillIcon\";\n\nexport const StyledPillPlaceholder = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nStyledPillPlaceholder.displayName = \"StyledPillPlaceholder\";\n\nconst ACTIVE_COLORS = {\n alert: [\"var(--alert-surface-subtle)\", \"var(--red-alert)\"],\n warning: [\"var(--note-bg)\", \"var(--warning-text)\"],\n};\n\nconst activeColors = (tone: StyledPillButtonProps[\"$tone\"]) =>\n tone === \"alert\" || tone === \"warning\"\n ? ACTIVE_COLORS[tone]\n : [\"var(--pill-background-active)\", \"var(--color-primary)\"];\n\nconst activeStyle = (tone: StyledPillButtonProps[\"$tone\"]) => css`\n background-color: ${activeColors(tone)[0]};\n color: ${activeColors(tone)[1]};\n\n ${StyledPillIcon} {\n color: ${activeColors(tone)[1]};\n }\n\n /* An icon in the value takes the color of the text too, its outline as well. */\n svg {\n fill: currentColor;\n }\n\n svg [stroke]:not([stroke=\"none\"]) {\n stroke: currentColor;\n }\n`;\n\nconst hoverTextStyle = css`\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: var(--color-theme-900);\n }\n`;\n\nconst toneStyle = (tone: StyledPillButtonProps[\"$tone\"]) => {\n switch (tone) {\n case \"alternate\":\n return css`\n background-color: var(--color-theme-300);\n\n &:hover,\n &:focus-visible {\n background-color: var(--color-theme-400);\n ${hoverTextStyle}\n }\n `;\n case \"accent\":\n return css`\n background-color: color-mix(\n in srgb,\n var(--color-primary) 15%,\n transparent\n );\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n\n &:hover,\n &:focus-visible {\n background-color: color-mix(\n in srgb,\n var(--color-primary) 25%,\n transparent\n );\n color: var(--color-primary);\n }\n `;\n case \"raised\":\n return css`\n && {\n gap: 6px;\n font-weight: 600;\n }\n\n border: 1px solid var(--color-theme-400);\n background-color: var(--color-theme-200);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: inherit;\n }\n\n @supports (color: light-dark(red, red)) {\n border-color: light-dark(var(--color-theme-400), #494e59);\n background-color: transparent;\n background-image: linear-gradient(\n light-dark(#ffffff, #3a3f49),\n light-dark(#f3f4f6, #31353e)\n );\n color: light-dark(var(--color-theme-900), #eceef1);\n\n &:hover {\n background-image: linear-gradient(\n light-dark(#f8f9fa, #444a55),\n light-dark(#eceef1, #3a3f49)\n );\n }\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: 1px;\n }\n\n &[aria-expanded=\"true\"] {\n background-image: none;\n }\n `;\n case \"primary\":\n return css`\n && {\n gap: 6px;\n font-weight: 600;\n }\n\n border: 1px solid var(--color-primary);\n background-color: var(--color-primary);\n background-image: linear-gradient(\n var(--color-primary-800),\n var(--color-primary)\n );\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);\n color: var(--page-paper-main);\n\n ${StyledPillIcon} {\n color: inherit;\n }\n\n &:hover {\n background-color: var(--color-primary-800);\n background-image: none;\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: 1px;\n }\n `;\n case \"well\":\n return css`\n && {\n gap: 6px;\n font-weight: 600;\n }\n\n border: 1px solid var(--color-theme-400);\n background-color: var(--body-bg-main);\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: inherit;\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: 1px;\n }\n `;\n case \"ghost\":\n return css`\n background-color: transparent;\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:focus-visible {\n background-color: var(--pill-background);\n }\n\n .c-pill-host:hover &.c-pill-button--ghost:hover,\n &:hover {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n case \"outlined\":\n return css`\n background-color: transparent;\n border: 1px solid var(--color-theme-700);\n\n &:hover,\n &:focus-visible {\n border-color: var(--color-primary);\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n }\n `;\n default:\n return css`\n background-color: var(--pill-background);\n\n &:hover,\n &:focus-visible {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n }\n};\n\nconst compactStyle = css`\n ${StyledPillPlaceholder} {\n display: none;\n }\n`;\n\nconst PILL_HEIGHTS = {\n xsmall: \"18px\",\n small: \"24px\",\n dense: \"24px\",\n medium: \"26px\",\n};\n\nconst denseStyle = css`\n gap: 4px;\n --c-pill-padding-x: 11px;\n font-size: calc(0.75rem * var(--text-scale, 1));\n\n ${StyledPillIcon} svg {\n width: 12px;\n height: 12px;\n }\n`;\n\n/* The size of a type chip: small caps of an object type or a state switch. */\nconst xsmallStyle = css`\n gap: 3px;\n --c-pill-padding-x: 6px;\n font-size: calc(0.625rem * var(--text-scale, 1));\n font-weight: 600;\n\n ${StyledPillIcon} svg {\n width: 12px;\n height: 12px;\n }\n`;\n\nexport const StyledPillButton = styled.button<StyledPillButtonProps>`\n ${FontStyle}\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex-shrink: 0;\n max-width: 100%;\n height: ${(props) => PILL_HEIGHTS[props.$size]};\n margin: 0;\n --c-pill-padding-x: ${(props) => (props.$inset === \"tight\" ? \"6px\" : \"10px\")};\n padding: 0 var(--c-pill-padding-x);\n border: none;\n border-radius: var(--ac-br-rounded);\n font-size: calc(0.875rem * var(--text-scale, 1));\n font-weight: 500;\n line-height: 1;\n white-space: nowrap;\n color: ${(props) =>\n props.$empty ? \"var(--color-theme-700)\" : \"var(--color-theme-800)\"};\n cursor: pointer;\n user-select: none;\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: ${(props) => (props.$dimDisabled ? \"50%\" : \"100%\")};\n pointer-events: none;\n }\n\n ${(props) => toneStyle(props.$tone)}\n\n ${(props) =>\n props.$tone === \"ghost\" &&\n props.$empty &&\n css`\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 0;\n }\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:hover,\n &:focus-visible,\n &[aria-expanded=\"true\"] {\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 1;\n }\n }\n `}\n\n ${(props) =>\n props.$iconOnly &&\n css`\n width: ${props.$tone === \"raised\" ? \"28px\" : \"36px\"};\n padding: 0;\n\n ${StyledPillIcon} svg {\n width: 16px;\n height: 16px;\n }\n `}\n\n ${(props) => props.$size === \"xsmall\" && xsmallStyle}\n\n ${(props) => props.$size === \"dense\" && denseStyle}\n\n ${(props) => props.$compact === true && compactStyle}\n\n ${(props) =>\n props.$compact === \"mobile\" &&\n css`\n @media (max-width: 768px) {\n ${compactStyle}\n }\n `}\n\n /* An active pill keeps its look on hover and focus. */\n ${(props) =>\n props.$active &&\n css`\n &,\n &:hover,\n &:focus-visible {\n ${activeStyle(props.$tone)}\n }\n `}\n\n /* Last, so an open trigger shows the active look in every tone. */\n &[aria-haspopup][aria-expanded=\"true\"],\n .c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"] {\n ${(props) => activeStyle(props.$tone)}\n }\n`;\n\nStyledPillButton.displayName = \"StyledPillButton\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAaxC,OAAO,MAAMC,cAAc,GAAGJ,MAAM,CAACK,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qHAUxC;AAEDJ,cAAc,CAACG,WAAW,GAAG,gBAAgB;AAE7C,OAAO,MAAME,qBAAqB,GAAGT,MAAM,CAACK,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+CAG/C;AAEDC,qBAAqB,CAACF,WAAW,GAAG,uBAAuB;AAE3D,MAAMG,aAAa,GAAG;EACpBC,KAAK,EAAE,CAAC,6BAA6B,EAAE,kBAAkB,CAAC;EAC1DC,OAAO,EAAE,CAAC,gBAAgB,EAAE,qBAAqB;AACnD,CAAC;AAED,MAAMC,YAAY,GAAIC,IAAoC,IACxDA,IAAI,KAAK,OAAO,IAAIA,IAAI,KAAK,SAAS,GAClCJ,aAAa,CAACI,IAAI,CAAC,GACnB,CAAC,+BAA+B,EAAE,sBAAsB,CAAC;AAE/D,MAAMC,WAAW,GAAID,IAAoC,IAAKb,GAAG,yIAC3CY,YAAY,CAACC,IAAI,CAAC,CAAC,CAAC,CAAC,EAChCD,YAAY,CAACC,IAAI,CAAC,CAAC,CAAC,CAAC,EAE5BV,cAAc,EACLS,YAAY,CAACC,IAAI,CAAC,CAAC,CAAC,CAAC,CAWjC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I1DJ,KAAK,IAAKX,SAAS,CAACW,KAAK,CAACK,KAAK,CAAC,EAEhCL,KAAK,IACNA,KAAK,CAACK,KAAK,KAAK,OAAO,IACvBL,KAAK,CAACG,MAAM,IACZ9B,GAAG,8IACCG,cAAc,EAAKK,qBAAqB,EAQtCL,cAAc,EAAKK,qBAAqB,CAI7C,EAEAmB,KAAK,IACNA,KAAK,CAACM,SAAS,IACfjC,GAAG,6DACQ2B,KAAK,CAACK,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,EAGjD7B,cAAc,CAIjB,EAEAwB,KAAK,IAAKA,KAAK,CAACC,KAAK,KAAK,QAAQ,IAAIJ,WAAW,EAEjDG,KAAK,IAAKA,KAAK,CAACC,KAAK,KAAK,OAAO,IAAIL,UAAU,EAE/CI,KAAK,IAAKA,KAAK,CAACO,QAAQ,KAAK,IAAI,IAAIjB,YAAY,EAEjDU,KAAK,IACNA,KAAK,CAACO,QAAQ,KAAK,QAAQ,IAC3BlC,GAAG,qCAEGiB,YAAY,CAEjB,EAGAU,KAAK,IACNA,KAAK,CAACQ,OAAO,IACbnC,GAAG,sCAIGc,WAAW,CAACa,KAAK,CAACK,KAAK,CAAC,CAE7B,EAKEL,KAAK,IAAKb,WAAW,CAACa,KAAK,CAACK,KAAK,CAAC,CAExC;AAEDP,gBAAgB,CAACnB,WAAW,GAAG,kBAAkB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","StyledPillIcon","span","withConfig","displayName","componentId","StyledPillPlaceholder","ACTIVE_COLORS","alert","warning","activeColors","tone","activeStyle","hoverTextStyle","toneStyle","compactStyle","PILL_HEIGHTS","xsmall","small","dense","medium","denseStyle","xsmallStyle","StyledPillButton","button","props","$size","$inset","$empty","$dimDisabled","$tone","$iconOnly","$compact","$active"],"sources":["../../../../src/components/PillButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { PillButtonProps } from \"./PillButton\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\ninterface StyledPillButtonProps {\n $tone: NonNullable<PillButtonProps[\"tone\"]>;\n $active: boolean;\n $empty: boolean;\n $iconOnly: boolean;\n $compact: PillButtonProps[\"compact\"];\n $size: NonNullable<PillButtonProps[\"size\"]>;\n $inset: NonNullable<PillButtonProps[\"inset\"]>;\n $dimDisabled: boolean;\n}\n\nexport const StyledPillIcon = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n color: var(--color-theme-600);\n\n svg {\n width: 18px;\n height: 18px;\n fill: currentColor;\n }\n`;\n\nStyledPillIcon.displayName = \"StyledPillIcon\";\n\nexport const StyledPillPlaceholder = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nStyledPillPlaceholder.displayName = \"StyledPillPlaceholder\";\n\nconst ACTIVE_COLORS = {\n alert: [\"var(--alert-surface-subtle)\", \"var(--red-alert)\"],\n warning: [\"var(--note-bg)\", \"var(--warning-text)\"],\n};\n\nconst activeColors = (tone: StyledPillButtonProps[\"$tone\"]) =>\n tone === \"alert\" || tone === \"warning\"\n ? ACTIVE_COLORS[tone]\n : [\"var(--pill-background-active)\", \"var(--color-primary)\"];\n\nconst activeStyle = (tone: StyledPillButtonProps[\"$tone\"]) => css`\n background-color: ${activeColors(tone)[0]};\n color: ${activeColors(tone)[1]};\n\n ${StyledPillIcon} {\n color: ${activeColors(tone)[1]};\n }\n\n /* An icon in the value takes the color of the text too, its outline as well. */\n svg {\n fill: currentColor;\n }\n\n svg [stroke]:not([stroke=\"none\"]) {\n stroke: currentColor;\n }\n`;\n\nconst hoverTextStyle = css`\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: var(--color-theme-900);\n }\n`;\n\nconst toneStyle = (tone: StyledPillButtonProps[\"$tone\"]) => {\n switch (tone) {\n case \"alternate\":\n return css`\n background-color: var(--color-theme-300);\n\n &:hover,\n &:focus-visible {\n background-color: var(--color-theme-400);\n ${hoverTextStyle}\n }\n `;\n case \"accent\":\n return css`\n background-color: color-mix(\n in srgb,\n var(--color-primary) 15%,\n transparent\n );\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n\n &:hover,\n &:focus-visible {\n background-color: color-mix(\n in srgb,\n var(--color-primary) 25%,\n transparent\n );\n color: var(--color-primary);\n }\n `;\n case \"raised\":\n return css`\n && {\n gap: 6px;\n font-weight: 600;\n }\n\n border: 1px solid var(--color-theme-400);\n background-color: var(--color-theme-200);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: inherit;\n }\n\n @supports (color: light-dark(red, red)) {\n border-color: light-dark(var(--color-theme-400), #494e59);\n background-color: transparent;\n background-image: linear-gradient(\n light-dark(#ffffff, #3a3f49),\n light-dark(#f3f4f6, #31353e)\n );\n color: light-dark(var(--color-theme-900), #eceef1);\n\n &:hover {\n background-image: linear-gradient(\n light-dark(#f8f9fa, #444a55),\n light-dark(#eceef1, #3a3f49)\n );\n }\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: 1px;\n }\n\n &[aria-expanded=\"true\"] {\n background-image: none;\n }\n `;\n case \"primary\":\n return css`\n && {\n gap: 6px;\n font-weight: 600;\n }\n\n border: 1px solid var(--color-primary);\n background-color: var(--color-primary);\n background-image: linear-gradient(\n var(--color-primary-800),\n var(--color-primary)\n );\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);\n color: var(--page-paper-main);\n\n ${StyledPillIcon} {\n color: inherit;\n }\n\n &:hover {\n background-color: var(--color-primary-800);\n background-image: none;\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: 1px;\n }\n `;\n case \"well\":\n return css`\n && {\n gap: 6px;\n font-weight: 600;\n }\n\n border: 1px solid var(--color-theme-400);\n background-color: var(--body-bg-main);\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: inherit;\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: 1px;\n }\n `;\n case \"ghost\":\n return css`\n background-color: transparent;\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:focus-visible {\n background-color: var(--pill-background);\n }\n\n .c-pill-host:hover &.c-pill-button--ghost:hover,\n &:hover {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n case \"outlined\":\n return css`\n background-color: transparent;\n border: 1px solid var(--color-theme-700);\n\n &:hover,\n &:focus-visible {\n border-color: var(--color-primary);\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n }\n `;\n default:\n return css`\n background-color: var(--pill-background);\n\n &:hover,\n &:focus-visible {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n }\n};\n\nconst compactStyle = css`\n ${StyledPillPlaceholder} {\n display: none;\n }\n`;\n\nconst PILL_HEIGHTS = {\n xsmall: \"18px\",\n small: \"24px\",\n dense: \"24px\",\n medium: \"26px\",\n};\n\nconst denseStyle = css`\n gap: 4px;\n --c-pill-padding-x: 11px;\n font-size: calc(0.75rem * var(--text-scale, 1));\n\n ${StyledPillIcon} svg {\n width: 12px;\n height: 12px;\n }\n`;\n\n/* The size of a type chip: small caps of an object type or a state switch. */\nconst xsmallStyle = css`\n gap: 3px;\n --c-pill-padding-x: 6px;\n font-size: calc(0.625rem * var(--text-scale, 1));\n font-weight: 600;\n\n ${StyledPillIcon} svg {\n width: 12px;\n height: 12px;\n }\n`;\n\nexport const StyledPillButton = styled.button<StyledPillButtonProps>`\n ${FontStyle}\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex-shrink: 0;\n max-width: 100%;\n height: ${(props) => PILL_HEIGHTS[props.$size]};\n margin: 0;\n --c-pill-padding-x: ${(props) => (props.$inset === \"tight\" ? \"6px\" : \"10px\")};\n padding: 0 var(--c-pill-padding-x);\n border: none;\n border-radius: var(--ac-br-rounded);\n font-size: calc(0.875rem * var(--text-scale, 1));\n font-weight: 500;\n line-height: 1;\n white-space: nowrap;\n color: ${(props) =>\n props.$empty ? \"var(--color-theme-700)\" : \"var(--color-theme-800)\"};\n cursor: pointer;\n user-select: none;\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: ${(props) => (props.$dimDisabled ? \"50%\" : \"100%\")};\n pointer-events: none;\n }\n\n ${(props) => toneStyle(props.$tone)}\n\n ${(props) =>\n props.$tone === \"ghost\" &&\n props.$empty &&\n css`\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 0;\n }\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:hover,\n &:focus-visible,\n &[aria-expanded=\"true\"] {\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 1;\n }\n }\n `}\n\n ${(props) =>\n props.$iconOnly &&\n css`\n width: ${props.$tone === \"raised\" ? \"28px\" : \"36px\"};\n padding: 0;\n\n ${StyledPillIcon} svg {\n width: 16px;\n height: 16px;\n }\n `}\n\n ${(props) => props.$size === \"xsmall\" && xsmallStyle}\n\n ${(props) => props.$size === \"dense\" && denseStyle}\n\n ${(props) => props.$compact === true && compactStyle}\n\n ${(props) =>\n props.$compact === \"mobile\" &&\n css`\n @media (max-width: 768px) {\n ${compactStyle}\n }\n `}\n\n /* An active pill keeps its look on hover and focus. */\n ${(props) =>\n props.$active &&\n css`\n &,\n &:hover,\n &:focus-visible {\n ${activeStyle(props.$tone)}\n }\n `}\n\n /* Last, so an open trigger shows the active look in every tone. */\n &[aria-haspopup][aria-expanded=\"true\"],\n .c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"] {\n ${(props) => activeStyle(props.$tone)}\n }\n`;\n\nStyledPillButton.displayName = \"StyledPillButton\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAaxC,OAAO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,SAAS,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC3C;AAED,UAAU,WAAY,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5E,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAAC;IAC3C,WAAW;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mBAAmB;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,4BAA4B;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,eAAe;IACf,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,2BAA2B;IAC3B,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,OAAA,KAAK,IAAI,CAAC;IAC/B,uFAAuF;IACvF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAE7B,yBAAyB;IACzB,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;CACvD;AAED,eAAO,MAAM,MAAM,oFA4MlB,CAAC"}
|
|
@@ -121,13 +121,29 @@ export const Popper = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
121
121
|
observer.observe(anchorEl);
|
|
122
122
|
return () => observer.disconnect();
|
|
123
123
|
}, [anchorEl, followAnchor, open]);
|
|
124
|
+
|
|
125
|
+
// Content that grows after the popper opens, such as a list that shows more rows, moves or flips it to stay on the screen.
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
const node = ownRef.current;
|
|
128
|
+
if (!open || !node || typeof ResizeObserver === "undefined") {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// eslint-disable-next-line compat/compat -- guarded above
|
|
133
|
+
const observer = new ResizeObserver(() => {
|
|
134
|
+
var _popperRef$current2;
|
|
135
|
+
(_popperRef$current2 = popperRef.current) == null || _popperRef$current2.update();
|
|
136
|
+
});
|
|
137
|
+
observer.observe(node);
|
|
138
|
+
return () => observer.disconnect();
|
|
139
|
+
}, [open]);
|
|
124
140
|
useEffect(() => {
|
|
125
141
|
if (!open) {
|
|
126
142
|
return undefined;
|
|
127
143
|
}
|
|
128
144
|
const update = () => {
|
|
129
|
-
var _popperRef$
|
|
130
|
-
return (_popperRef$
|
|
145
|
+
var _popperRef$current3;
|
|
146
|
+
return (_popperRef$current3 = popperRef.current) == null ? void 0 : _popperRef$current3.update();
|
|
131
147
|
};
|
|
132
148
|
window.addEventListener(ANCHOR_MOVE_EVENT, update);
|
|
133
149
|
return () => window.removeEventListener(ANCHOR_MOVE_EVENT, update);
|