@activecollab/components 2.0.598 → 2.0.599
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/Chip/Chip.js.map +1 -1
- package/dist/cjs/components/Chip/Styles.js +3 -1
- package/dist/cjs/components/Chip/Styles.js.map +1 -1
- package/dist/cjs/components/PillButton/PillButton.js.map +1 -1
- package/dist/cjs/components/PillButton/Styles.js +2 -1
- package/dist/cjs/components/PillButton/Styles.js.map +1 -1
- package/dist/cjs/components/PillGroup/PillGroup.js.map +1 -1
- package/dist/cjs/components/PillGroup/Styles.js +5 -2
- package/dist/cjs/components/PillGroup/Styles.js.map +1 -1
- package/dist/cjs/components/PropertyList/BulletStyles.js +1 -1
- package/dist/cjs/components/PropertyList/BulletStyles.js.map +1 -1
- package/dist/cjs/components/PropertyList/PropertyList.js +12 -1
- package/dist/cjs/components/PropertyList/PropertyList.js.map +1 -1
- package/dist/cjs/components/PropertyList/PropertyListPopover.js +22 -1
- package/dist/cjs/components/PropertyList/PropertyListPopover.js.map +1 -1
- package/dist/cjs/components/PropertyList/Styles.js +30 -27
- package/dist/cjs/components/PropertyList/Styles.js.map +1 -1
- package/dist/cjs/components/PropertyList/TimeStyles.js +1 -1
- package/dist/cjs/components/PropertyList/TimeStyles.js.map +1 -1
- package/dist/cjs/components/Typography/Variants/Body1.js.map +1 -1
- package/dist/esm/components/Chip/Chip.d.ts +1 -1
- package/dist/esm/components/Chip/Chip.d.ts.map +1 -1
- package/dist/esm/components/Chip/Chip.js.map +1 -1
- package/dist/esm/components/Chip/Styles.d.ts.map +1 -1
- package/dist/esm/components/Chip/Styles.js +2 -2
- package/dist/esm/components/Chip/Styles.js.map +1 -1
- package/dist/esm/components/PillButton/PillButton.d.ts +2 -2
- 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 +2 -1
- package/dist/esm/components/PillButton/Styles.js.map +1 -1
- package/dist/esm/components/PillGroup/PillGroup.d.ts +2 -2
- package/dist/esm/components/PillGroup/PillGroup.d.ts.map +1 -1
- package/dist/esm/components/PillGroup/PillGroup.js.map +1 -1
- package/dist/esm/components/PillGroup/Styles.d.ts.map +1 -1
- package/dist/esm/components/PillGroup/Styles.js +2 -1
- package/dist/esm/components/PillGroup/Styles.js.map +1 -1
- package/dist/esm/components/PropertyList/BulletStyles.js +1 -1
- package/dist/esm/components/PropertyList/BulletStyles.js.map +1 -1
- package/dist/esm/components/PropertyList/PropertyList.d.ts.map +1 -1
- package/dist/esm/components/PropertyList/PropertyList.js +12 -1
- package/dist/esm/components/PropertyList/PropertyList.js.map +1 -1
- package/dist/esm/components/PropertyList/PropertyListPopover.d.ts +3 -1
- package/dist/esm/components/PropertyList/PropertyListPopover.d.ts.map +1 -1
- package/dist/esm/components/PropertyList/PropertyListPopover.js +20 -0
- package/dist/esm/components/PropertyList/PropertyListPopover.js.map +1 -1
- package/dist/esm/components/PropertyList/Styles.d.ts +1 -0
- package/dist/esm/components/PropertyList/Styles.d.ts.map +1 -1
- package/dist/esm/components/PropertyList/Styles.js +30 -27
- package/dist/esm/components/PropertyList/Styles.js.map +1 -1
- package/dist/esm/components/PropertyList/TimeStyles.js +1 -1
- package/dist/esm/components/PropertyList/TimeStyles.js.map +1 -1
- package/dist/esm/components/Typography/Variants/Body1.d.ts +1 -1
- package/dist/esm/components/Typography/Variants/Body1.d.ts.map +1 -1
- package/dist/esm/components/Typography/Variants/Body1.js.map +1 -1
- package/dist/index.js +75 -35
- 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":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_Card","_Icons","_Typography","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SOLID_SURFACE","disabledSurface","StyledPropertyList","exports","styled","Card","withConfig","displayName","componentId","_ref","$ticket","css","_ref2","$solid","_ref3","$roomy","_ref4","$disabled","StyledPropertyListDivider","div","_ref5","$layout","$density","concat","highlight","StyledPropertyListRow","_ref6","$tone","_ref7","_ref8","_ref9","$clickable","_ref0","StyledPropertyListTableLabel","span","StyledPropertyListIcon","_ref1","$size","_ref10","_ref11","$scale","StyledPropertyListLabelText","Body2","_ref12","StyledPropertyListValue","_ref13","_ref14","$placeholder","StyledPropertyListAddIcon","StyledPropertyListTableValue","StyledPropertyListTableAction","StyledPropertyListChevron","StyledPropertyListToggle","button","StyledPropertyListBranch","StyledPropertyListBranchLine","StyledPropertyListTicketLabel","Caption2","_ref15","StyledPropertyListTicketLine","_ref16","$parts","StyledPropertyListTicketText","Body1","_ref17","$wrap","_ref18","StyledPropertyListTicketCaret","ArrowDownSmallIcon","StyledPropertyListTicketValue","_ref19","StyledPropertyListTicketAddIcon","AddCrossTinyIcon","fillCell","StyledPropertyListCells","_ref20","$cells","StyledPropertyListCell","StyledPropertyListCellSplit","StyledPropertyListCellMain","StyledPropertyListCellAside","StyledPropertyListTear","StyledPropertyListFooterTear","StyledPropertyListFooter","CONTAINER_CSS"],"sources":["../../../../src/components/PropertyList/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { Card } from \"../Card\";\nimport { AddCrossTinyIcon, ArrowDownSmallIcon } from \"../Icons\";\nimport { Body1, Body2, Caption2 } from \"../Typography\";\n\nconst SOLID_SURFACE =\n \"var(--object-layout-card-surface, var(--surface-raised))\";\n\nexport type PropertyListDensity = \"form\" | \"page\";\nexport type PropertyListLayoutName = \"stacked\" | \"table\" | \"ticket\";\nexport type PropertyListTone = \"regular\" | \"alert\";\nexport type PropertyListCells = \"grid\" | \"row\";\n\nconst disabledSurface =\n \"color-mix(in srgb, var(--surface-raised) 50%, transparent)\";\n\nexport const StyledPropertyList = styled(Card)<{\n $disabled?: boolean;\n $ticket?: PropertyListCells;\n $solid?: boolean;\n $roomy?: boolean;\n}>`\n display: flex;\n flex-direction: column;\n overflow: clip;\n\n ${({ $ticket }) =>\n $ticket &&\n css`\n ${$ticket === \"grid\" && \"container-type: inline-size;\"}\n gap: 4px;\n min-width: 0;\n overflow: visible;\n padding: ${$ticket === \"grid\" ? \"4px 16px 16px\" : \"16px\"};\n `}\n\n ${({ $solid }) =>\n $solid &&\n css`\n && {\n background-color: ${SOLID_SURFACE};\n }\n `}\n\n ${({ $roomy }) =>\n $roomy &&\n css`\n & .c-property-list__row {\n padding-top: 10px;\n padding-bottom: 10px;\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n && {\n background-color: ${disabledSurface};\n }\n\n &&:hover {\n background-color: ${disabledSurface};\n }\n `}\n`;\n\nexport const StyledPropertyListDivider = styled.div<{\n $layout: PropertyListLayoutName;\n $density: PropertyListDensity;\n}>`\n flex-shrink: 0;\n height: 1px;\n background-color: var(--border-raised);\n ${({ $layout, $density }) =>\n $layout === \"stacked\" && `margin-left: ${$density === \"page\" ? 44 : 46}px;`}\n`;\n\nconst highlight =\n \"linear-gradient(var(--highlight-dark), var(--highlight-dark))\";\n\nexport const StyledPropertyListRow = styled.div<{\n $layout: PropertyListLayoutName;\n $density: PropertyListDensity;\n $tone: PropertyListTone;\n $clickable: boolean;\n $disabled?: boolean;\n}>`\n position: relative;\n width: 100%;\n border: 0;\n text-align: left;\n background-color: ${({ $tone, $layout }) =>\n $tone === \"alert\" && $layout !== \"ticket\"\n ? \"var(--alert-surface-subtle)\"\n : \"transparent\"};\n\n ${({ $layout, $density }) =>\n $layout === \"table\"\n ? css`\n display: grid;\n grid-template-columns: 185px minmax(0, 1fr) auto;\n align-items: center;\n min-height: 36px;\n padding: 4px 12px;\n `\n : $layout === \"ticket\"\n ? css`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 2px;\n width: auto;\n min-width: 0;\n margin: 0;\n padding: 6px 8px;\n color: inherit;\n `\n : css`\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: ${$density === \"page\" ? 44 : 40}px;\n padding: 6px 12px;\n `}\n\n ${({ $disabled, $density }) =>\n $disabled &&\n css`\n cursor: default;\n\n > * {\n opacity: 0.4;\n }\n\n && .c-property-list__value[data-placeholder] {\n color: ${$density === \"page\"\n ? \"var(--muted-text)\"\n : \"var(--color-theme-800)\"};\n }\n `}\n\n ${({ $clickable, $disabled, $layout }) =>\n $clickable &&\n !$disabled &&\n $layout === \"ticket\" &&\n css`\n cursor: pointer;\n border-radius: 10px;\n\n &:hover,\n &[aria-expanded=\"true\"] {\n background-color: var(--color-theme-200);\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n }\n `}\n\n ${({ $clickable, $disabled, $tone, $layout }) =>\n $clickable &&\n !$disabled &&\n $layout !== \"ticket\" &&\n css`\n cursor: pointer;\n\n &:hover,\n &:focus-visible,\n &[aria-expanded=\"true\"] {\n ${$tone === \"alert\"\n ? `background-image: ${highlight};`\n : \"background-color: var(--color-theme-200);\"}\n }\n\n &:focus-visible {\n outline: none;\n }\n `}\n`;\n\nexport const StyledPropertyListTableLabel = styled.span`\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n padding-right: 8px;\n`;\n\nexport const StyledPropertyListIcon = styled.span<{\n $size: number;\n $scale: boolean;\n}>`\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: ${({ $size }) => $size}px;\n height: ${({ $size }) => $size}px;\n\n & svg {\n fill: var(--color-theme-700);\n ${({ $scale, $size }) => $scale && `width: ${$size}px; height: ${$size}px;`}\n }\n`;\n\nexport const StyledPropertyListLabelText = styled(Body2)<{\n $layout: PropertyListLayoutName;\n $density: PropertyListDensity;\n}>`\n && {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--color-theme-700);\n\n ${({ $layout, $density }) =>\n $layout === \"stacked\" &&\n css`\n flex: 1 1 0%;\n ${$density === \"page\" ? \"margin-left: -4px;\" : \"padding-left: 6px;\"}\n `}\n }\n`;\n\nexport const StyledPropertyListValue = styled(Body2)<{\n $density: PropertyListDensity;\n $placeholder: boolean;\n}>`\n && {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: ${({ $density }) =>\n $density === \"page\"\n ? \"calc(15px * var(--text-scale, 1))\"\n : \"calc(1em + 1px)\"};\n\n ${({ $placeholder, $density }) =>\n !$placeholder &&\n `color: ${\n $density === \"page\" ? \"var(--muted-text)\" : \"var(--color-theme-800)\"\n };`}\n }\n`;\n\nexport const StyledPropertyListAddIcon = styled.span`\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n\n & svg {\n fill: var(--color-theme-700);\n }\n`;\n\nexport const StyledPropertyListTableValue = styled.span`\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n`;\n\nexport const StyledPropertyListTableAction = styled.span`\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n min-width: 16px;\n padding-left: 8px;\n`;\n\nexport const StyledPropertyListChevron = styled.span`\n display: flex;\n flex-shrink: 0;\n\n & svg {\n fill: var(--color-theme-700);\n }\n`;\n\nexport const StyledPropertyListToggle = styled.button`\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 36px;\n padding: 0 12px;\n border: 0;\n background-color: transparent;\n color: var(--color-theme-600);\n font-size: calc(13px * var(--text-scale, 1));\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n\n &:hover,\n &:focus-visible {\n background-color: var(--color-theme-200);\n }\n\n &:disabled {\n cursor: default;\n opacity: 0.4;\n background-color: transparent;\n }\n`;\n\nexport const StyledPropertyListBranch = styled.span`\n position: absolute;\n top: 0;\n left: 19px;\n width: 13px;\n height: 50%;\n border: 0 solid var(--color-theme-500);\n border-bottom-width: 1px;\n border-left-width: 1px;\n border-bottom-left-radius: 4px;\n pointer-events: none;\n`;\n\nexport const StyledPropertyListBranchLine = styled.span`\n position: absolute;\n top: 50%;\n bottom: 0;\n left: 19px;\n width: 1px;\n background-color: var(--color-theme-500);\n pointer-events: none;\n`;\n\nexport const StyledPropertyListTicketLabel = styled(Caption2)<{\n $tone: PropertyListTone;\n}>`\n && {\n text-transform: uppercase;\n letter-spacing: 0.09em;\n color: ${({ $tone }) =>\n $tone === \"alert\" ? \"var(--red-alert)\" : \"var(--color-theme-600)\"};\n }\n`;\n\nexport const StyledPropertyListTicketLine = styled.span<{ $parts: boolean }>`\n display: flex;\n align-items: center;\n gap: 4px;\n min-width: 0;\n ${({ $parts }) => $parts && \"min-height: 24px;\"}\n`;\n\nexport const StyledPropertyListTicketText = styled(Body1)<{\n $parts: boolean;\n $wrap?: boolean;\n $tone: PropertyListTone;\n}>`\n && {\n min-width: 0;\n ${({ $parts, $wrap }) =>\n $parts\n ? css`\n display: flex;\n align-items: center;\n gap: 6px;\n ${$wrap ? \"flex-wrap: wrap; row-gap: 4px;\" : \"white-space: nowrap;\"}\n `\n : css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `}\n ${({ $tone }) => $tone === \"alert\" && \"color: var(--red-alert);\"}\n }\n`;\n\nexport const StyledPropertyListTicketCaret = styled(ArrowDownSmallIcon)`\n flex-shrink: 0;\n fill: var(--color-theme-600);\n`;\n\nexport const StyledPropertyListTicketValue = styled.span<{\n $placeholder: boolean;\n}>`\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n ${({ $placeholder }) => $placeholder && \"color: var(--color-theme-600);\"}\n`;\n\nexport const StyledPropertyListTicketAddIcon = styled(AddCrossTinyIcon)`\n flex-shrink: 0;\n width: 12px;\n height: 12px;\n fill: var(--color-theme-600);\n`;\n\nconst fillCell = css`\n display: flex;\n min-width: 0;\n\n > * {\n flex: 1 1 0%;\n min-width: 0;\n }\n\n & .c-property-list__row {\n width: 100%;\n }\n`;\n\nexport const StyledPropertyListCells = styled.div<{\n $cells: PropertyListCells;\n}>`\n min-width: 0;\n\n ${({ $cells }) =>\n $cells === \"grid\"\n ? css`\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n align-items: start;\n column-gap: 16px;\n `\n : css`\n display: flex;\n flex-wrap: wrap;\n align-items: flex-end;\n gap: 12px 24px;\n `}\n`;\n\nexport const StyledPropertyListCell = styled.div`\n ${fillCell}\n padding-bottom: 1px;\n`;\n\nexport const StyledPropertyListCellSplit = styled.div`\n display: flex;\n align-items: flex-start;\n gap: 8px;\n min-width: 0;\n`;\n\nexport const StyledPropertyListCellMain = styled.div`\n ${fillCell}\n flex: 1 1 0%;\n`;\n\nexport const StyledPropertyListCellAside = styled.div`\n display: flex;\n flex-shrink: 0;\n align-self: center;\n align-items: center;\n gap: 8px;\n\n &::before {\n content: \"\";\n width: 1px;\n height: 16px;\n background-color: var(--border-raised);\n }\n\n &:empty {\n display: none;\n }\n`;\n\nexport const StyledPropertyListTear = styled.div`\n grid-column: 1 / -1;\n margin: -6px 0;\n`;\n\nexport const StyledPropertyListFooterTear = styled.div`\n position: relative;\n z-index: 1;\n margin: -10px 0 -14px;\n`;\n\nexport const StyledPropertyListFooter = styled.div`\n margin: 0 -16px -16px;\n overflow: clip;\n border-radius: 0 0 11px 11px;\n\n && > .c-property-list.c-property-list,\n && > .c-property-list.c-property-list:hover {\n border: 0;\n border-radius: 0;\n box-shadow: none;\n background-color: transparent;\n }\n`;\n\n// Only the tear line at the end of a line of cells shows.\nexport const CONTAINER_CSS = `\n@container (max-width: 619.98px) {\n .c-property-list__cells--grid > .c-property-list__tear:not(:nth-child(4n)) { display: none; }\n}\n@container (min-width: 620px) and (max-width: 719.98px) {\n .c-property-list__cells.c-property-list__cells--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n .c-property-list__cells--grid > .c-property-list__tear:not(:nth-child(6n)) { display: none; }\n}\n@container (min-width: 720px) {\n .c-property-list__cells.c-property-list__cells--grid { grid-template-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Ab,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0LAiBpD;AAEM,IAAMyE,sBAAsB,GAAA9E,OAAA,CAAA8E,sBAAA,GAAG7E,yBAAM,CAACe,GAAG,CAAAb,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,yCAG/C;AAEM,IAAM0E,4BAA4B,GAAA/E,OAAA,CAAA+E,4BAAA,GAAG9E,yBAAM,CAACe,GAAG,CAAAb,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,yDAIrD;AAEM,IAAM2E,wBAAwB,GAAAhF,OAAA,CAAAgF,wBAAA,GAAG/E,yBAAM,CAACe,GAAG,CAAAb,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gOAYjD;;AAED;AACO,IAAM4E,aAAa,GAAAjF,OAAA,CAAAiF,aAAA,+oBAYzB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_Card","_Icons","_Typography","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SOLID_SURFACE","disabledSurface","StyledPropertyList","exports","styled","Card","withConfig","displayName","componentId","_ref","$ticket","css","_ref2","$solid","_ref3","$roomy","_ref4","$disabled","StyledPropertyListDivider","div","_ref5","$layout","$density","concat","highlight","StyledPropertyListRow","_ref6","$tone","_ref7","_ref8","_ref9","$clickable","_ref0","StyledPropertyListTableLabel","span","StyledPropertyListIcon","_ref1","$size","_ref10","_ref11","$muted","_ref12","$scale","StyledPropertyListLabelText","Body2","_ref13","StyledPropertyListValue","_ref14","_ref15","$placeholder","StyledPropertyListAddIcon","StyledPropertyListTableValue","StyledPropertyListTableAction","StyledPropertyListChevron","StyledPropertyListToggle","button","StyledPropertyListBranch","StyledPropertyListBranchLine","StyledPropertyListTicketLabel","Caption2","_ref16","StyledPropertyListTicketLine","_ref17","$parts","StyledPropertyListTicketText","Body1","_ref18","$wrap","_ref19","StyledPropertyListTicketCaret","ArrowDownSmallIcon","StyledPropertyListTicketValue","_ref20","StyledPropertyListTicketAddIcon","AddCrossTinyIcon","fillCell","StyledPropertyListCells","_ref21","$cells","StyledPropertyListCell","StyledPropertyListCellSplit","StyledPropertyListCellMain","StyledPropertyListCellAside","StyledPropertyListTear","StyledPropertyListFooterTear","StyledPropertyListFooter","CONTAINER_CSS"],"sources":["../../../../src/components/PropertyList/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { Card } from \"../Card\";\nimport { AddCrossTinyIcon, ArrowDownSmallIcon } from \"../Icons\";\nimport { Body1, Body2, Caption2 } from \"../Typography\";\n\nconst SOLID_SURFACE =\n \"var(--object-layout-card-surface, var(--surface-raised))\";\n\nexport type PropertyListDensity = \"form\" | \"page\";\nexport type PropertyListLayoutName = \"stacked\" | \"table\" | \"ticket\";\nexport type PropertyListTone = \"regular\" | \"alert\";\nexport type PropertyListCells = \"grid\" | \"row\";\n\nconst disabledSurface =\n \"color-mix(in srgb, var(--surface-raised) 50%, transparent)\";\n\nexport const StyledPropertyList = styled(Card)<{\n $disabled?: boolean;\n $ticket?: PropertyListCells;\n $solid?: boolean;\n $roomy?: boolean;\n}>`\n display: flex;\n flex-direction: column;\n overflow: clip;\n\n ${({ $ticket }) =>\n $ticket &&\n css`\n ${$ticket === \"grid\" && \"container-type: inline-size;\"}\n gap: 4px;\n min-width: 0;\n overflow: visible;\n padding: ${$ticket === \"grid\" ? \"4px 16px 16px\" : \"16px\"};\n `}\n\n ${({ $solid }) =>\n $solid &&\n css`\n &&,\n &&:hover {\n background-color: ${SOLID_SURFACE};\n }\n `}\n\n ${({ $roomy }) =>\n $roomy &&\n css`\n & .c-property-list__row {\n padding-top: 10px;\n padding-bottom: 10px;\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n && {\n background-color: ${disabledSurface};\n }\n\n &&:hover {\n background-color: ${disabledSurface};\n }\n `}\n`;\n\nexport const StyledPropertyListDivider = styled.div<{\n $layout: PropertyListLayoutName;\n $density: PropertyListDensity;\n}>`\n flex-shrink: 0;\n height: 1px;\n background-color: var(--border-raised);\n ${({ $layout, $density }) =>\n $layout === \"stacked\" && `margin-left: ${$density === \"page\" ? 44 : 46}px;`}\n`;\n\nconst highlight =\n \"linear-gradient(var(--highlight-dark), var(--highlight-dark))\";\n\nexport const StyledPropertyListRow = styled.div<{\n $layout: PropertyListLayoutName;\n $density: PropertyListDensity;\n $tone: PropertyListTone;\n $clickable: boolean;\n $disabled?: boolean;\n}>`\n position: relative;\n width: 100%;\n border: 0;\n text-align: left;\n background-color: ${({ $tone, $layout }) =>\n $tone === \"alert\" && $layout !== \"ticket\"\n ? \"var(--alert-surface-subtle)\"\n : \"transparent\"};\n\n ${({ $layout, $density }) =>\n $layout === \"table\"\n ? css`\n display: grid;\n grid-template-columns: 185px minmax(0, 1fr) auto;\n align-items: center;\n min-height: 36px;\n padding: 4px 12px;\n `\n : $layout === \"ticket\"\n ? css`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 2px;\n width: auto;\n min-width: 0;\n margin: 0;\n padding: 6px 8px;\n color: inherit;\n `\n : css`\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: ${$density === \"page\" ? 44 : 40}px;\n padding: 6px 12px;\n `}\n\n ${({ $disabled, $density }) =>\n $disabled &&\n css`\n cursor: default;\n\n > * {\n opacity: 0.4;\n }\n\n && .c-property-list__value[data-placeholder] {\n color: ${$density === \"page\"\n ? \"var(--muted-text)\"\n : \"var(--color-theme-800)\"};\n }\n `}\n\n ${({ $clickable, $disabled, $layout }) =>\n $clickable &&\n !$disabled &&\n $layout === \"ticket\" &&\n css`\n cursor: pointer;\n border-radius: 10px;\n\n &:hover,\n &[aria-expanded=\"true\"] {\n background-color: var(--color-theme-200);\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n }\n `}\n\n ${({ $clickable, $disabled, $tone, $layout }) =>\n $clickable &&\n !$disabled &&\n $layout !== \"ticket\" &&\n css`\n cursor: pointer;\n\n &:hover,\n &:focus-visible,\n &[aria-expanded=\"true\"] {\n ${$tone === \"alert\"\n ? `background-image: ${highlight};`\n : \"background-color: var(--color-theme-200);\"}\n }\n\n &:focus-visible {\n outline: none;\n }\n `}\n`;\n\nexport const StyledPropertyListTableLabel = styled.span`\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n padding-right: 8px;\n`;\n\nexport const StyledPropertyListIcon = styled.span<{\n $size: number;\n $scale: boolean;\n $muted?: boolean;\n}>`\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: ${({ $size }) => $size}px;\n height: ${({ $size }) => $size}px;\n\n & svg {\n fill: var(--color-theme-${({ $muted }) => ($muted ? 600 : 700)});\n ${({ $scale, $size }) => $scale && `width: ${$size}px; height: ${$size}px;`}\n }\n`;\n\nexport const StyledPropertyListLabelText = styled(Body2)<{\n $layout: PropertyListLayoutName;\n $density: PropertyListDensity;\n}>`\n && {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--color-theme-700);\n\n ${({ $layout, $density }) =>\n $layout === \"stacked\" &&\n css`\n flex: 1 1 0%;\n ${$density === \"page\" ? \"margin-left: -4px;\" : \"padding-left: 6px;\"}\n `}\n }\n`;\n\nexport const StyledPropertyListValue = styled(Body2)<{\n $density: PropertyListDensity;\n $placeholder: boolean;\n}>`\n && {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: ${({ $density }) =>\n $density === \"page\"\n ? \"calc(15px * var(--text-scale, 1))\"\n : \"calc(1em + 1px)\"};\n\n ${({ $placeholder, $density }) =>\n !$placeholder &&\n `color: ${\n $density === \"page\" ? \"var(--muted-text)\" : \"var(--color-theme-800)\"\n };`}\n }\n`;\n\nexport const StyledPropertyListAddIcon = styled.span`\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n\n & svg {\n fill: var(--color-theme-700);\n }\n`;\n\nexport const StyledPropertyListTableValue = styled.span`\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n`;\n\nexport const StyledPropertyListTableAction = styled.span`\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n min-width: 16px;\n padding-left: 8px;\n`;\n\nexport const StyledPropertyListChevron = styled.span`\n display: flex;\n flex-shrink: 0;\n\n & svg {\n fill: var(--color-theme-700);\n }\n`;\n\nexport const StyledPropertyListToggle = styled.button`\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 36px;\n padding: 0 12px;\n border: 0;\n background-color: transparent;\n color: var(--color-theme-600);\n font-size: calc(13px * var(--text-scale, 1));\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n\n &:hover,\n &:focus-visible {\n background-color: var(--color-theme-200);\n }\n\n &:disabled {\n cursor: default;\n opacity: 0.4;\n background-color: transparent;\n }\n`;\n\nexport const StyledPropertyListBranch = styled.span`\n position: absolute;\n top: 0;\n left: 19px;\n width: 13px;\n height: 50%;\n border: 0 solid var(--color-theme-500);\n border-bottom-width: 1px;\n border-left-width: 1px;\n border-bottom-left-radius: 4px;\n pointer-events: none;\n`;\n\nexport const StyledPropertyListBranchLine = styled.span`\n position: absolute;\n top: 50%;\n bottom: 0;\n left: 19px;\n width: 1px;\n background-color: var(--color-theme-500);\n pointer-events: none;\n`;\n\nexport const StyledPropertyListTicketLabel = styled(Caption2)<{\n $tone: PropertyListTone;\n}>`\n && {\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: ${({ $tone }) =>\n $tone === \"alert\" ? \"var(--red-alert)\" : \"var(--color-theme-600)\"};\n }\n`;\n\nexport const StyledPropertyListTicketLine = styled.span<{ $parts: boolean }>`\n display: flex;\n align-items: center;\n gap: 4px;\n min-width: 0;\n ${({ $parts }) => $parts && \"min-height: 24px;\"}\n`;\n\nexport const StyledPropertyListTicketText = styled(Body1)<{\n $parts: boolean;\n $wrap?: boolean;\n $tone: PropertyListTone;\n}>`\n && {\n min-width: 0;\n ${({ $parts, $wrap }) =>\n $parts\n ? css`\n display: flex;\n align-items: center;\n gap: 6px;\n ${$wrap ? \"flex-wrap: wrap; row-gap: 4px;\" : \"white-space: nowrap;\"}\n `\n : css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `}\n ${({ $tone }) => $tone === \"alert\" && \"color: var(--red-alert);\"}\n }\n`;\n\nexport const StyledPropertyListTicketCaret = styled(ArrowDownSmallIcon)`\n flex-shrink: 0;\n fill: var(--color-theme-600);\n`;\n\nexport const StyledPropertyListTicketValue = styled.span<{\n $placeholder: boolean;\n}>`\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n ${({ $placeholder }) => $placeholder && \"color: var(--color-theme-500);\"}\n`;\n\nexport const StyledPropertyListTicketAddIcon = styled(AddCrossTinyIcon)`\n flex-shrink: 0;\n width: 12px;\n height: 12px;\n fill: var(--color-theme-500);\n`;\n\nconst fillCell = css`\n display: flex;\n min-width: 0;\n\n > * {\n flex: 1 1 0%;\n min-width: 0;\n }\n\n & .c-property-list__row {\n width: 100%;\n }\n`;\n\nexport const StyledPropertyListCells = styled.div<{\n $cells: PropertyListCells;\n}>`\n min-width: 0;\n\n ${({ $cells }) =>\n $cells === \"grid\"\n ? css`\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n align-items: start;\n column-gap: 16px;\n `\n : css`\n display: flex;\n flex-wrap: wrap;\n align-items: flex-end;\n gap: 12px 24px;\n `}\n`;\n\nexport const StyledPropertyListCell = styled.div`\n ${fillCell}\n padding-bottom: 1px;\n`;\n\nexport const StyledPropertyListCellSplit = styled.div`\n display: flex;\n align-items: flex-start;\n gap: 8px;\n min-width: 0;\n`;\n\nexport const StyledPropertyListCellMain = styled.div`\n ${fillCell}\n flex: 1 1 0%;\n`;\n\nexport const StyledPropertyListCellAside = styled.div`\n display: flex;\n flex-shrink: 0;\n align-self: center;\n align-items: center;\n gap: 8px;\n\n &::before {\n content: \"\";\n width: 1px;\n height: 16px;\n background-color: var(--border-raised);\n }\n\n &:empty {\n display: none;\n }\n`;\n\nexport const StyledPropertyListTear = styled.div`\n grid-column: 1 / -1;\n margin: -6px 0;\n`;\n\nexport const StyledPropertyListFooterTear = styled.div`\n position: relative;\n z-index: 1;\n margin: -10px 0 -14px;\n`;\n\nexport const StyledPropertyListFooter = styled.div`\n margin: 0 -16px -16px;\n overflow: clip;\n border-radius: 0 0 11px 11px;\n\n && > .c-property-list.c-property-list,\n && > .c-property-list.c-property-list:hover {\n border: 0;\n border-radius: 0;\n box-shadow: none;\n background-color: transparent;\n }\n`;\n\n// Only the tear line at the end of a line of cells shows.\nexport const CONTAINER_CSS = `\n@container (max-width: 619.98px) {\n .c-property-list__cells--grid > .c-property-list__tear:not(:nth-child(4n)) { display: none; }\n}\n@container (min-width: 620px) and (max-width: 719.98px) {\n .c-property-list__cells.c-property-list__cells--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n .c-property-list__cells--grid > .c-property-list__tear:not(:nth-child(6n)) { display: none; }\n}\n@container (min-width: 720px) {\n .c-property-list__cells.c-property-list__cells--grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n .c-property-list__cells--grid > .c-property-list__tear:not(:nth-child(8n)) { display: none; }\n}\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAuD,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,wBAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,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AG,CAAAb,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gOAYjD;;AAED;AACO,IAAM8E,aAAa,GAAAnF,OAAA,CAAAmF,aAAA,+oBAYzB","ignoreList":[]}
|
|
@@ -25,7 +25,7 @@ var StyledPropertyListMoment = exports.StyledPropertyListMoment = _styledCompone
|
|
|
25
25
|
var StyledPropertyListMomentLabel = exports.StyledPropertyListMomentLabel = (0, _styledComponents.default)(_Typography.Caption2).withConfig({
|
|
26
26
|
displayName: "TimeStyles__StyledPropertyListMomentLabel",
|
|
27
27
|
componentId: "sc-ld4yoe-2"
|
|
28
|
-
})(["&&{text-transform:uppercase;letter-spacing:0.
|
|
28
|
+
})(["&&{text-transform:uppercase;letter-spacing:0.05em;color:var(--color-theme-600);}"]);
|
|
29
29
|
|
|
30
30
|
// The font of the row, as the frontend time inherits it.
|
|
31
31
|
var StyledPropertyListMomentValue = exports.StyledPropertyListMomentValue = _styledComponents.default.span.withConfig({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeStyles.js","names":["_styledComponents","_interopRequireDefault","require","_Styles","_Typography","e","__esModule","default","StyledPropertyListTime","exports","styled","div","withConfig","displayName","componentId","_ref","$clickable","StyledPropertyListMoment","span","_ref2","$end","StyledPropertyListMomentLabel","Caption2","StyledPropertyListMomentValue","StyledPropertyListMomentCaption","Caption1","StyledPropertyListTimeLength","StyledPropertyListTimeDash","ticketDash"],"sources":["../../../../src/components/PropertyList/TimeStyles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { ticketDash } from \"../TicketPerforation/Styles\";\nimport { Caption1, Caption2 } from \"../Typography\";\n\nexport const StyledPropertyListTime = styled.div<{ $clickable: boolean }>`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 16px;\n width: 100%;\n min-width: 0;\n margin: 0;\n padding: 6px 8px;\n border: 0;\n background-color: transparent;\n color: inherit;\n text-align: left;\n\n ${({ $clickable }) =>\n $clickable &&\n `\n cursor: pointer;\n border-radius: 10px;\n\n &:hover,\n &[aria-expanded=\"true\"] {\n background-color: var(--color-theme-200);\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n }\n `}\n`;\n\nexport const StyledPropertyListMoment = styled.span<{ $end: boolean }>`\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n align-items: ${({ $end }) => ($end ? \"flex-end\" : \"flex-start\")};\n`;\n\nexport const StyledPropertyListMomentLabel = styled(Caption2)`\n && {\n text-transform: uppercase;\n letter-spacing: 0.
|
|
1
|
+
{"version":3,"file":"TimeStyles.js","names":["_styledComponents","_interopRequireDefault","require","_Styles","_Typography","e","__esModule","default","StyledPropertyListTime","exports","styled","div","withConfig","displayName","componentId","_ref","$clickable","StyledPropertyListMoment","span","_ref2","$end","StyledPropertyListMomentLabel","Caption2","StyledPropertyListMomentValue","StyledPropertyListMomentCaption","Caption1","StyledPropertyListTimeLength","StyledPropertyListTimeDash","ticketDash"],"sources":["../../../../src/components/PropertyList/TimeStyles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { ticketDash } from \"../TicketPerforation/Styles\";\nimport { Caption1, Caption2 } from \"../Typography\";\n\nexport const StyledPropertyListTime = styled.div<{ $clickable: boolean }>`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 16px;\n width: 100%;\n min-width: 0;\n margin: 0;\n padding: 6px 8px;\n border: 0;\n background-color: transparent;\n color: inherit;\n text-align: left;\n\n ${({ $clickable }) =>\n $clickable &&\n `\n cursor: pointer;\n border-radius: 10px;\n\n &:hover,\n &[aria-expanded=\"true\"] {\n background-color: var(--color-theme-200);\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n }\n `}\n`;\n\nexport const StyledPropertyListMoment = styled.span<{ $end: boolean }>`\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n align-items: ${({ $end }) => ($end ? \"flex-end\" : \"flex-start\")};\n`;\n\nexport const StyledPropertyListMomentLabel = styled(Caption2)`\n && {\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: var(--color-theme-600);\n }\n`;\n\n// The font of the row, as the frontend time inherits it.\nexport const StyledPropertyListMomentValue = styled.span`\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: calc(34px * var(--text-scale, 1));\n line-height: 42px;\n font-weight: 600;\n color: var(--color-theme-900);\n`;\n\nexport const StyledPropertyListMomentCaption = styled(Caption1)`\n && {\n color: var(--color-theme-600);\n }\n`;\n\nexport const StyledPropertyListTimeLength = styled.span`\n display: flex;\n flex: 1 1 0%;\n align-items: center;\n gap: 12px;\n min-width: 0;\n\n > .c-property-list-time__length {\n flex-shrink: 0;\n }\n`;\n\nexport const StyledPropertyListTimeDash = styled.span`\n ${ticketDash(\"primary\")}\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAAmD,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5C,IAAMG,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAGE,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gMAc5C,UAAAC,IAAA;EAAA,IAAGC,UAAU,GAAAD,IAAA,CAAVC,UAAU;EAAA,OACbA,UAAU,uQAaT;AAAA,EACJ;AAEM,IAAMC,wBAAwB,GAAAR,OAAA,CAAAQ,wBAAA,GAAGP,yBAAM,CAACQ,IAAI,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2EAIlC,UAAAK,KAAA;EAAA,IAAGC,IAAI,GAAAD,KAAA,CAAJC,IAAI;EAAA,OAAQA,IAAI,GAAG,UAAU,GAAG,YAAY;AAAA,CAAC,CAChE;AAEM,IAAMC,6BAA6B,GAAAZ,OAAA,CAAAY,6BAAA,GAAG,IAAAX,yBAAM,EAACY,oBAAQ,CAAC,CAAAV,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,wFAM5D;;AAED;AACO,IAAMS,6BAA6B,GAAAd,OAAA,CAAAc,6BAAA,GAAGb,yBAAM,CAACQ,IAAI,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,yJAQvD;AAEM,IAAMU,+BAA+B,GAAAf,OAAA,CAAAe,+BAAA,GAAG,IAAAd,yBAAM,EAACe,oBAAQ,CAAC,CAAAb,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,yCAI9D;AAEM,IAAMY,4BAA4B,GAAAjB,OAAA,CAAAiB,4BAAA,GAAGhB,yBAAM,CAACQ,IAAI,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,wHAUtD;AAEM,IAAMa,0BAA0B,GAAAlB,OAAA,CAAAkB,0BAAA,GAAGjB,yBAAM,CAACQ,IAAI,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aACjD,IAAAc,kBAAU,EAAC,SAAS,CAAC,CACxB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Body1.js","names":["_react","_interopRequireWildcard","require","_Typography","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","Body1","exports","forwardRef","_ref","ref","_ref$weight","weight","children","props","createElement","Typography","variant","displayName"],"sources":["../../../../../src/components/Typography/Variants/Body1.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { ITypographyProps, Typography } from \"../Typography\";\n\nexport interface IBodyProps {\n /** Font weight. */\n weight?: \"regular\" | \"
|
|
1
|
+
{"version":3,"file":"Body1.js","names":["_react","_interopRequireWildcard","require","_Typography","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","Body1","exports","forwardRef","_ref","ref","_ref$weight","weight","children","props","createElement","Typography","variant","displayName"],"sources":["../../../../../src/components/Typography/Variants/Body1.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { ITypographyProps, Typography } from \"../Typography\";\n\nexport interface IBodyProps {\n /** Font weight. */\n weight?: \"regular\" | \"medium\" | \"semibold\" | \"bold\";\n}\n\nexport const Body1 = forwardRef<\n HTMLDivElement,\n IBodyProps & Omit<ITypographyProps, keyof IBodyProps | \"variant\">\n>(({ weight = \"regular\", children, ...props }, ref) => {\n return (\n <Typography variant=\"Body 1\" weight={weight} ref={ref} {...props}>\n {children}\n </Typography>\n );\n});\n\nBody1.displayName = \"Body1\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAA6D,IAAAE,SAAA;AAAA,SAAAH,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,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QAAAwB,oBAAA,CAAAd,IAAA,CAAAhB,CAAA,EAAAM,CAAA,MAAAC,CAAA,CAAAD,CAAA,IAAAN,CAAA,CAAAM,CAAA,aAAAC,CAAA;AAAA,SAAAoB,8BAAAxB,CAAA,EAAAH,CAAA,gBAAAG,CAAA,iBAAAF,CAAA,gBAAAG,CAAA,IAAAD,CAAA,SAAAY,cAAA,CAAAC,IAAA,CAAAb,CAAA,EAAAC,CAAA,gBAAAJ,CAAA,CAAA6B,OAAA,CAAAzB,CAAA,aAAAH,CAAA,CAAAG,CAAA,IAAAD,CAAA,CAAAC,CAAA,YAAAH,CAAA;AAOtD,IAAM8B,KAAK,GAAAC,OAAA,CAAAD,KAAA,gBAAG,IAAAE,iBAAU,EAG7B,UAAAC,IAAA,EAA6CC,GAAG,EAAK;EAAA,IAAAC,WAAA,GAAAF,IAAA,CAAlDG,MAAM;IAANA,MAAM,GAAAD,WAAA,cAAG,SAAS,GAAAA,WAAA;IAAEE,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IAAKC,KAAK,GAAAb,wBAAA,CAAAQ,IAAA,EAAAnC,SAAA;EACzC,oBACEJ,MAAA,CAAAe,OAAA,CAAA8B,aAAA,CAAC1C,WAAA,CAAA2C,UAAU,EAAArB,QAAA;IAACsB,OAAO,EAAC,QAAQ;IAACL,MAAM,EAAEA,MAAO;IAACF,GAAG,EAAEA;EAAI,GAAKI,KAAK,GAC7DD,QACS,CAAC;AAEjB,CAAC,CAAC;AAEFP,KAAK,CAACY,WAAW,GAAG,OAAO","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import { InputSize } from "../Input/types";
|
|
3
3
|
import { ITypographyProps } from "../Typography/Typography";
|
|
4
|
-
export type ChipSize = InputSize | "tiny" | "compact";
|
|
4
|
+
export type ChipSize = InputSize | "tiny" | "compact" | "tag";
|
|
5
5
|
export type ChipShape = "rounded" | "soft" | "pill";
|
|
6
6
|
export type ChipTone = "neutral" | "muted" | "info" | "primary" | "bordered" | "warning" | "alert" | "success" | "inverse";
|
|
7
7
|
export interface ChipProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAc,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAExE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAc,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAExE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AACpD,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,OAAO,GACP,MAAM,GACN,SAAS,GACT,UAAU,GACV,SAAS,GACT,OAAO,GACP,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,qGAAqG;IACrG,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qGAAqG;IACrG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sFAAsF;IACtF,SAAS,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,gBAAgB,CAAC;CACpC;AAED,eAAO,MAAM,IAAI,sMA6EhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.js","names":["React","useMemo","ChipCloseIcon","ChipContainer","ChipTrigger","Typography","Chip","forwardRef","_ref","ref","_ref2","startAdornment","label","onClose","_ref$size","size","_ref$shape","shape","tone","tint","tintStrong","paletteColor","_ref$uppercase","uppercase","_ref$closeMode","closeMode","color","backgroundColor","closeClassName","typographyProps","rest","_objectWithoutPropertiesLoose","_excluded","showClose","variant","createElement","_extends","$shape","$tone","$tint","$tintStrong","$paletteColor","$closeMode","weight","transform","undefined","onClick","className","fill","displayName"],"sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from \"react\";\n\nimport { ChipCloseIcon, ChipContainer, ChipTrigger } from \"./Styles\";\nimport { InputSize } from \"../Input/types\";\nimport { Typography, ITypographyProps } from \"../Typography/Typography\";\n\nexport type ChipSize = InputSize | \"tiny\" | \"compact\";\nexport type ChipShape = \"rounded\" | \"soft\" | \"pill\";\nexport type ChipTone =\n | \"neutral\"\n | \"muted\"\n | \"info\"\n | \"primary\"\n | \"bordered\"\n | \"warning\"\n | \"alert\"\n | \"success\"\n | \"inverse\";\n\nexport interface ChipProps {\n label: string;\n onClose?: React.MouseEventHandler<HTMLButtonElement>;\n startAdornment?: ReactNode;\n size?: ChipSize;\n /** Corner shape: 4px, 6px or a full pill. */\n shape?: ChipShape;\n /** A semantic surface and text color from the theme. \"inverse\" is a dark surface with light text. */\n tone?: ChipTone;\n /** A data color. The theme mixes the surface and the text from it. */\n tint?: string;\n /** A stronger shade of the tint, which the light themes mix from. */\n tintStrong?: string;\n /** Any saved color. The chip shows the label fill of its base palette color. It wins over `tint`. */\n paletteColor?: string;\n uppercase?: boolean;\n /** \"overlay\" draws the close button over the end of the label, on hover and focus. */\n closeMode?: \"inline\" | \"overlay\";\n color?: string;\n backgroundColor?: string;\n closeClassName?: string;\n typographyProps?: ITypographyProps;\n}\n\nexport const Chip = React.forwardRef<\n HTMLDivElement,\n ChipProps & Omit<React.ComponentPropsWithoutRef<\"div\">, keyof ChipProps>\n>(\n (\n {\n startAdornment,\n label,\n onClose,\n size = \"regular\",\n shape = \"rounded\",\n tone,\n tint,\n tintStrong,\n paletteColor,\n uppercase = false,\n closeMode = \"inline\",\n color,\n backgroundColor,\n closeClassName,\n typographyProps,\n ...rest\n },\n ref\n ) => {\n const showClose = typeof onClose === \"function\";\n const variant = useMemo(() => {\n switch (size) {\n case \"big\":\n return \"Body 1\";\n case \"biggest\":\n return \"Body 1\";\n default:\n return \"Caption 1\";\n }\n }, [size]);\n\n return (\n <ChipContainer\n data-testid=\"chip-container\"\n {...rest}\n ref={ref}\n size={size}\n showClose={showClose && closeMode === \"inline\"}\n color={color}\n backgroundColor={backgroundColor}\n $shape={shape}\n $tone={tone}\n $tint={tint}\n $tintStrong={tintStrong}\n $paletteColor={paletteColor}\n $closeMode={closeMode}\n >\n {startAdornment}\n <Typography\n variant={variant}\n data-testid=\"chip-typography\"\n weight={size === \"biggest\" ? \"medium\" : \"regular\"}\n transform={uppercase ? \"uppercase\" : undefined}\n {...typographyProps}\n >\n {label}\n </Typography>\n {showClose ? (\n <ChipTrigger size={size} onClick={onClose} className={closeClassName}>\n <ChipCloseIcon\n fill={\n paletteColor\n ? \"var(--color-theme-900)\"\n : tint ?? color ?? \"currentColor\"\n }\n />\n </ChipTrigger>\n ) : null}\n </ChipContainer>\n );\n }\n);\n\nChip.displayName = \"Chip\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAeC,OAAO,QAAQ,OAAO;AAEjD,SAASC,aAAa,EAAEC,aAAa,EAAEC,WAAW,QAAQ,UAAU;AAEpE,SAASC,UAAU,QAA0B,0BAA0B;AAuCvE,OAAO,MAAMC,IAAI,gBAAGN,KAAK,CAACO,UAAU,CAIlC,CAAAC,IAAA,EAmBEC,GAAG,KACA;EAAA,IAAAC,KAAA;EAAA,IAlBDC,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,OAAO,GAAAL,IAAA,CAAPK,OAAO;IAAAC,SAAA,GAAAN,IAAA,CACPO,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAG,SAAS,GAAAA,SAAA;IAAAE,UAAA,GAAAR,IAAA,CAChBS,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,SAAS,GAAAA,UAAA;IACjBE,IAAI,GAAAV,IAAA,CAAJU,IAAI;IACJC,IAAI,GAAAX,IAAA,CAAJW,IAAI;IACJC,UAAU,GAAAZ,IAAA,CAAVY,UAAU;IACVC,YAAY,GAAAb,IAAA,CAAZa,YAAY;IAAAC,cAAA,GAAAd,IAAA,CACZe,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAG,KAAK,GAAAA,cAAA;IAAAE,cAAA,GAAAhB,IAAA,CACjBiB,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAG,QAAQ,GAAAA,cAAA;IACpBE,KAAK,GAAAlB,IAAA,CAALkB,KAAK;IACLC,eAAe,GAAAnB,IAAA,CAAfmB,eAAe;IACfC,cAAc,GAAApB,IAAA,CAAdoB,cAAc;IACdC,eAAe,GAAArB,IAAA,CAAfqB,eAAe;IACZC,IAAI,GAAAC,6BAA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AI,WAAJA,IAAI,GAAIO,KAAK,YAAAhB,KAAA,GAAI;EACtB,CACF,CACU,CAAC,GACZ,IACS,CAAC;AAEpB,CACF,CAAC;AAEDJ,IAAI,CAAC2C,WAAW,GAAG,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Chip.js","names":["React","useMemo","ChipCloseIcon","ChipContainer","ChipTrigger","Typography","Chip","forwardRef","_ref","ref","_ref2","startAdornment","label","onClose","_ref$size","size","_ref$shape","shape","tone","tint","tintStrong","paletteColor","_ref$uppercase","uppercase","_ref$closeMode","closeMode","color","backgroundColor","closeClassName","typographyProps","rest","_objectWithoutPropertiesLoose","_excluded","showClose","variant","createElement","_extends","$shape","$tone","$tint","$tintStrong","$paletteColor","$closeMode","weight","transform","undefined","onClick","className","fill","displayName"],"sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from \"react\";\n\nimport { ChipCloseIcon, ChipContainer, ChipTrigger } from \"./Styles\";\nimport { InputSize } from \"../Input/types\";\nimport { Typography, ITypographyProps } from \"../Typography/Typography\";\n\nexport type ChipSize = InputSize | \"tiny\" | \"compact\" | \"tag\";\nexport type ChipShape = \"rounded\" | \"soft\" | \"pill\";\nexport type ChipTone =\n | \"neutral\"\n | \"muted\"\n | \"info\"\n | \"primary\"\n | \"bordered\"\n | \"warning\"\n | \"alert\"\n | \"success\"\n | \"inverse\";\n\nexport interface ChipProps {\n label: string;\n onClose?: React.MouseEventHandler<HTMLButtonElement>;\n startAdornment?: ReactNode;\n size?: ChipSize;\n /** Corner shape: 4px, 6px or a full pill. */\n shape?: ChipShape;\n /** A semantic surface and text color from the theme. \"inverse\" is a dark surface with light text. */\n tone?: ChipTone;\n /** A data color. The theme mixes the surface and the text from it. */\n tint?: string;\n /** A stronger shade of the tint, which the light themes mix from. */\n tintStrong?: string;\n /** Any saved color. The chip shows the label fill of its base palette color. It wins over `tint`. */\n paletteColor?: string;\n uppercase?: boolean;\n /** \"overlay\" draws the close button over the end of the label, on hover and focus. */\n closeMode?: \"inline\" | \"overlay\";\n color?: string;\n backgroundColor?: string;\n closeClassName?: string;\n typographyProps?: ITypographyProps;\n}\n\nexport const Chip = React.forwardRef<\n HTMLDivElement,\n ChipProps & Omit<React.ComponentPropsWithoutRef<\"div\">, keyof ChipProps>\n>(\n (\n {\n startAdornment,\n label,\n onClose,\n size = \"regular\",\n shape = \"rounded\",\n tone,\n tint,\n tintStrong,\n paletteColor,\n uppercase = false,\n closeMode = \"inline\",\n color,\n backgroundColor,\n closeClassName,\n typographyProps,\n ...rest\n },\n ref\n ) => {\n const showClose = typeof onClose === \"function\";\n const variant = useMemo(() => {\n switch (size) {\n case \"big\":\n return \"Body 1\";\n case \"biggest\":\n return \"Body 1\";\n default:\n return \"Caption 1\";\n }\n }, [size]);\n\n return (\n <ChipContainer\n data-testid=\"chip-container\"\n {...rest}\n ref={ref}\n size={size}\n showClose={showClose && closeMode === \"inline\"}\n color={color}\n backgroundColor={backgroundColor}\n $shape={shape}\n $tone={tone}\n $tint={tint}\n $tintStrong={tintStrong}\n $paletteColor={paletteColor}\n $closeMode={closeMode}\n >\n {startAdornment}\n <Typography\n variant={variant}\n data-testid=\"chip-typography\"\n weight={size === \"biggest\" ? \"medium\" : \"regular\"}\n transform={uppercase ? \"uppercase\" : undefined}\n {...typographyProps}\n >\n {label}\n </Typography>\n {showClose ? (\n <ChipTrigger size={size} onClick={onClose} className={closeClassName}>\n <ChipCloseIcon\n fill={\n paletteColor\n ? \"var(--color-theme-900)\"\n : tint ?? color ?? \"currentColor\"\n }\n />\n </ChipTrigger>\n ) : null}\n </ChipContainer>\n );\n }\n);\n\nChip.displayName = \"Chip\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAeC,OAAO,QAAQ,OAAO;AAEjD,SAASC,aAAa,EAAEC,aAAa,EAAEC,WAAW,QAAQ,UAAU;AAEpE,SAASC,UAAU,QAA0B,0BAA0B;AAuCvE,OAAO,MAAMC,IAAI,gBAAGN,KA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xC,eAAO,MAAM,WAAW,4SAmDvB,CAAC;AAuBF,eAAO,MAAM,MAAM;;;;CAA2D,CAAC;AA2C/E,UAAU,QAAQ;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACrC;AAGD,eAAO,MAAM,aAAa,+
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Chip/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAQxC,eAAO,MAAM,WAAW,4SAmDvB,CAAC;AAuBF,eAAO,MAAM,MAAM;;;;CAA2D,CAAC;AA2C/E,UAAU,QAAQ;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACrC;AAGD,eAAO,MAAM,aAAa,+FA0KzB,CAAC;AAIF,eAAO,MAAM,SAAS,qEAKrB,CAAC;AAIF,eAAO,MAAM,aAAa;;0EAEzB,CAAC"}
|
|
@@ -41,7 +41,7 @@ const TONES = {
|
|
|
41
41
|
export const ChipContainer = styled.div.withConfig({
|
|
42
42
|
displayName: "Styles__ChipContainer",
|
|
43
43
|
componentId: "sc-7s0bd1-1"
|
|
44
|
-
})(["align-items:center;border-radius:", ";display:flex;height:1.5rem;max-width:220px;overflow:hidden;padding-left:0.375rem;", " ", " background-color:var(--color-theme-400);color:var(--color-theme-900);font-size:calc(0.875rem * var(--text-scale,1));font-weight:400;letter-spacing:0.02em;line-height:1.375;", "{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", ""], props => {
|
|
44
|
+
})(["align-items:center;border-radius:", ";display:flex;height:1.5rem;max-width:220px;overflow:hidden;padding-left:0.375rem;", " ", " background-color:var(--color-theme-400);color:var(--color-theme-900);font-size:calc(0.875rem * var(--text-scale,1));font-weight:400;letter-spacing:0.02em;line-height:1.375;", "{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", ""], props => {
|
|
45
45
|
var _props$$shape;
|
|
46
46
|
return RADIUS[(_props$$shape = props.$shape) != null ? _props$$shape : "rounded"];
|
|
47
47
|
}, FontStyle, BoxSizingStyle, StyledTypography, props => props.$tone && TONES[props.$tone], props => props.$tone && css(["", "{color:inherit;}svg{fill:currentColor;}"], StyledTypography), _ref => {
|
|
@@ -57,7 +57,7 @@ export const ChipContainer = styled.div.withConfig({
|
|
|
57
57
|
}, _ref4 => {
|
|
58
58
|
let backgroundColor = _ref4.backgroundColor;
|
|
59
59
|
return backgroundColor && css(["background-color:", ";"], backgroundColor);
|
|
60
|
-
}, props => props.showClose ? null : css(["padding-right:0.375rem;"]), props => props.size === "regular" && css(["height:24px;"]), props => props.size === "small" && css(["height:18px;"]), props => props.size === "compact" && css(["height:20px;padding-left:0.5rem;", ""], props.showClose ? "" : "padding-right: 0.5rem;"), props => props.size === "tiny" && css(["height:16.5px;padding-left:0.25rem;", ""], props.showClose ? "" : "padding-right: 0.25rem;"), props => {
|
|
60
|
+
}, props => props.showClose ? null : css(["padding-right:0.375rem;"]), props => props.size === "regular" && css(["height:24px;"]), props => props.size === "small" && css(["height:18px;"]), props => props.size === "tag" && css(["height:22px;"]), props => props.size === "compact" && css(["height:20px;padding-left:0.5rem;", ""], props.showClose ? "" : "padding-right: 0.5rem;"), props => props.size === "tiny" && css(["height:16.5px;padding-left:0.25rem;", ""], props.showClose ? "" : "padding-right: 0.25rem;"), props => {
|
|
61
61
|
var _props$backgroundColo, _props$backgroundColo2;
|
|
62
62
|
return props.$closeMode === "overlay" && css(["position:relative;padding-right:0.375rem;", "{position:absolute;top:0;right:0;bottom:0;height:auto;margin:0;border-radius:0 inherit inherit 0;opacity:0;background-color:var(--chip-surface,var(--surface-raised));background-image:linear-gradient( ", ",", " );}&:hover ", ",", ":focus-visible{opacity:1;}"], ChipTrigger, props.$paletteColor ? paletteSurface(props.$paletteColor) : props.$tint ? tintSurface(props.$tint, props.$tintStrong) : (_props$backgroundColo = props.backgroundColor) != null ? _props$backgroundColo : "transparent", props.$paletteColor ? paletteSurface(props.$paletteColor) : props.$tint ? tintSurface(props.$tint, props.$tintStrong) : (_props$backgroundColo2 = props.backgroundColor) != null ? _props$backgroundColo2 : "transparent", ChipTrigger, ChipTrigger);
|
|
63
63
|
}, props => props.size === "big" && css(["height:30px;"]), props => props.size === "biggest" && css(["height:40px;"]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","CloseSmallIcon","swatchPaletteBaseOf","swatchPaletteFill","Trigger","StyledTypography","ChipTrigger","withConfig","displayName","componentId","props","size","tintSource","tint","strong","tintSurface","tintText","paletteSurface","color","RADIUS","rounded","soft","pill","TONES","neutral","muted","info","primary","bordered","warning","alert","success","inverse","ChipContainer","div","_props$$shape","$shape","$tone","_ref","$tint","$tintStrong","_ref2","$paletteColor","_ref3","_ref4","backgroundColor","showClose","_props$backgroundColo","_props$backgroundColo2","$closeMode","ChipLabel","span","ChipCloseIcon"],"sources":["../../../../src/components/Chip/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport type { ChipProps } from \"./Chip\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\nimport { CloseSmallIcon } from \"../Icons\";\nimport { swatchPaletteBaseOf, swatchPaletteFill } from \"../SwatchPalette\";\nimport { Trigger } from \"../Trigger\";\nimport { StyledTypography } from \"../Typography/Styles\";\n\nexport const ChipTrigger = styled(Trigger)<Pick<ChipProps, \"size\">>`\n align-items: center;\n display: flex;\n justify-content: center;\n margin-left: 0.125rem;\n\n &:hover {\n background-color: var(--color-theme-transparent-400);\n }\n\n ${(props) =>\n props.size === \"regular\" &&\n css`\n height: 24px;\n width: 24px;\n `}\n\n ${(props) =>\n props.size === \"small\" &&\n css`\n height: 18px;\n width: 18px;\n `}\n\n ${(props) =>\n props.size === \"tiny\" &&\n css`\n height: 16.5px;\n width: 16.5px;\n `}\n\n ${(props) =>\n props.size === \"compact\" &&\n css`\n height: 20px;\n width: 20px;\n `}\n\n ${(props) =>\n props.size === \"big\" &&\n css`\n height: 30px;\n width: 30px;\n `}\n\n ${(props) =>\n props.size === \"biggest\" &&\n css`\n height: 40px;\n width: 40px;\n `}\n`;\n\nChipTrigger.displayName = \"ChipTrigger\";\n\n// The theme picks the source color, and how much of it the surface and the text take.\nconst tintSource = (tint: string, strong = tint) =>\n `color-mix(in srgb, ${strong} var(--chip-tint-strong, 0%), ${tint})`;\n\nconst tintSurface = (tint: string, strong?: string) =>\n `color-mix(in srgb, ${tintSource(\n tint,\n strong\n )} var(--chip-tint-surface, 13%), transparent)`;\n\nconst tintText = (tint: string, strong?: string) =>\n `color-mix(in srgb, ${tintSource(\n tint,\n strong\n )} var(--chip-tint-text, 100%), #000)`;\n\nconst paletteSurface = (color: string) =>\n swatchPaletteFill(swatchPaletteBaseOf(color), \"label\");\n\nexport const RADIUS = { rounded: \"0.25rem\", soft: \"0.375rem\", pill: \"9999px\" };\n\nconst TONES = {\n neutral: css`\n background-color: var(--pill-background);\n color: var(--color-theme-700);\n `,\n muted: css`\n background-color: var(--color-theme-200);\n color: var(--color-theme-700);\n `,\n info: css`\n background-color: #a0cbfd1a;\n border: 1px solid #a0cbfd;\n color: #568ccb;\n `,\n primary: css`\n background-color: color-mix(in srgb, var(--color-primary) 15%, transparent);\n color: var(--color-primary);\n `,\n bordered: css`\n background-color: var(--color-theme-200);\n border: 1px solid var(--border-primary);\n color: var(--color-theme-900);\n `,\n warning: css`\n background-color: var(--note-bg);\n color: var(--warning-text);\n `,\n alert: css`\n background-color: var(--alert-surface-subtle);\n color: var(--red-alert);\n `,\n success: css`\n background-color: var(--success-surface);\n color: var(--color-sucess-green);\n `,\n inverse: css`\n background-color: var(--color-theme-900);\n color: var(--color-theme-100);\n `,\n};\n\ninterface ChipLook {\n showClose: boolean;\n $shape?: ChipProps[\"shape\"];\n $tone?: ChipProps[\"tone\"];\n $tint?: string;\n $tintStrong?: string;\n $paletteColor?: string;\n $closeMode?: ChipProps[\"closeMode\"];\n}\n\n// prettier-ignore\nexport const ChipContainer = styled.div<Partial<ChipProps> & ChipLook>`\n align-items: center;\n border-radius: ${(props) => RADIUS[props.$shape ?? \"rounded\"]};\n display: flex;\n height: 1.5rem;\n max-width: 220px;\n overflow: hidden;\n padding-left: 0.375rem;\n\n ${FontStyle}\n ${BoxSizingStyle}\n\n background-color: var(--color-theme-400);\n color: var(--color-theme-900);\n font-size: calc(0.875rem * var(--text-scale, 1));\n font-weight: 400;\n letter-spacing: 0.02em;\n line-height: 1.375;\n\n ${StyledTypography} {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n ${(props) => props.$tone && TONES[props.$tone]}\n\n ${(props) =>\n props.$tone &&\n css`\n ${StyledTypography} {\n color: inherit;\n }\n\n svg {\n fill: currentColor;\n }\n `}\n\n ${({ $tint, $tintStrong }) =>\n $tint &&\n css`\n background-color: ${tintSurface($tint, $tintStrong)};\n\n ${StyledTypography} {\n color: ${tintText($tint, $tintStrong)};\n }\n\n ${ChipTrigger} svg {\n fill: ${tintText($tint, $tintStrong)};\n }\n `}\n\n ${({ $paletteColor }) =>\n $paletteColor &&\n css`\n background-color: ${swatchPaletteFill(swatchPaletteBaseOf($paletteColor))};\n background-color: ${paletteSurface($paletteColor)};\n\n ${StyledTypography} {\n color: var(--color-theme-900);\n }\n\n ${ChipTrigger} svg {\n fill: var(--color-theme-900);\n }\n `}\n\n ${({ color }) =>\n color &&\n css`\n ${StyledTypography} {\n color: ${color};\n }\n `}\n\n ${({ backgroundColor }) =>\n backgroundColor &&\n css`\n background-color: ${backgroundColor};\n `}\n\n ${(props) =>\n props.showClose\n ? null\n : css`\n padding-right: 0.375rem;\n `}\n\n ${(props) =>\n props.size === \"regular\" &&\n css`\n height: 24px;\n `}\n\n ${(props) =>\n props.size === \"small\" &&\n css`\n height: 18px;\n `}\n\n ${(props) =>\n props.size === \"compact\" &&\n css`\n height: 20px;\n padding-left: 0.5rem;\n ${props.showClose ? \"\" : \"padding-right: 0.5rem;\"}\n `}\n\n ${(props) =>\n props.size === \"tiny\" &&\n css`\n height: 16.5px;\n padding-left: 0.25rem;\n ${props.showClose ? \"\" : \"padding-right: 0.25rem;\"}\n `}\n\n ${(props) =>\n props.$closeMode === \"overlay\" &&\n css`\n position: relative;\n padding-right: 0.375rem;\n\n ${ChipTrigger} {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n height: auto;\n margin: 0;\n border-radius: 0 inherit inherit 0;\n opacity: 0;\n background-color: var(--chip-surface, var(--surface-raised));\n background-image: linear-gradient(\n ${props.$paletteColor\n ? paletteSurface(props.$paletteColor)\n : props.$tint\n ? tintSurface(props.$tint, props.$tintStrong)\n : props.backgroundColor ?? \"transparent\"},\n ${props.$paletteColor\n ? paletteSurface(props.$paletteColor)\n : props.$tint\n ? tintSurface(props.$tint, props.$tintStrong)\n : props.backgroundColor ?? \"transparent\"}\n );\n }\n\n &:hover ${ChipTrigger}, ${ChipTrigger}:focus-visible {\n opacity: 1;\n }\n `}\n\n ${(props) =>\n props.size === \"big\" &&\n css`\n height: 30px;\n `}\n\n ${(props) =>\n props.size === \"biggest\" &&\n css`\n height: 40px;\n `}\n`;\n\nChipContainer.displayName = \"ChipContainer\";\n\nexport const ChipLabel = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n`;\n\nChipLabel.displayName = \"ChipLabel\";\n\nexport const ChipCloseIcon = styled(CloseSmallIcon)`\n color: var(--color-theme-700);\n`;\n\nChipCloseIcon.displayName = \"ChipCloseIcon\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,mBAAmB,EAAEC,iBAAiB,QAAQ,kBAAkB;AACzE,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,gBAAgB,QAAQ,sBAAsB;AAEvD,OAAO,MAAMC,WAAW,GAAGT,MAAM,CAACO,OAAO,CAAC,CAAAG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+KAUrCC,KAAK,IACNA,KAAK,CAACC,IAAI,KAAK,SAAS,IACxBb,GAAG,6BAGF,EAEAY,KAAK,IACNA,KAAK,CAACC,IAAI,KAAK,OAAO,IACtBb,GAAG,6BAGF,EAEAY,KAAK,IACNA,KAAK,CAACC,IAAI,KAAK,MAAM,IACrBb,GAAG,iCAGF,EAEAY,KAAK,IACNA,KAAK,CAACC,IAAI,KAAK,SAAS,IACxBb,GAAG,6BAGF,EAEAY,KAAK,IACNA,KAAK,CAACC,IAAI,KAAK,KAAK,IACpBb,GAAG,6BAGF,EAEEY,KAAK,IACRA,KAAK,CAACC,IAAI,KAAK,SAAS,IACxBb,GAAG,6BAGF,CACJ;AAEDQ,WAAW,CAACE,WAAW,GAAG,aAAa;;AAEvC;AACA,MAAMI,UA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,WAAA;AAAA,qCAElD;AAED2C,aAAa,CAAC5C,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","CloseSmallIcon","swatchPaletteBaseOf","swatchPaletteFill","Trigger","StyledTypography","ChipTrigger","withConfig","displayName","componentId","props","size","tintSource","tint","strong","tintSurface","tintText","paletteSurface","color","RADIUS","rounded","soft","pill","TONES","neutral","muted","info","primary","bordered","warning","alert","success","inverse","ChipContainer","div","_props$$shape","$shape","$tone","_ref","$tint","$tintStrong","_ref2","$paletteColor","_ref3","_ref4","backgroundColor","showClose","_props$backgroundColo","_props$backgroundColo2","$closeMode","ChipLabel","span","ChipCloseIcon"],"sources":["../../../../src/components/Chip/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport type { ChipProps } from \"./Chip\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\nimport { CloseSmallIcon } from \"../Icons\";\nimport { swatchPaletteBaseOf, swatchPaletteFill } from \"../SwatchPalette\";\nimport { Trigger } from \"../Trigger\";\nimport { StyledTypography } from \"../Typography/Styles\";\n\nexport const ChipTrigger = styled(Trigger)<Pick<ChipProps, \"size\">>`\n align-items: center;\n display: flex;\n justify-content: center;\n margin-left: 0.125rem;\n\n &:hover {\n background-color: var(--color-theme-transparent-400);\n }\n\n ${(props) =>\n props.size === \"regular\" &&\n css`\n height: 24px;\n width: 24px;\n `}\n\n ${(props) =>\n props.size === \"small\" &&\n css`\n height: 18px;\n width: 18px;\n `}\n\n ${(props) =>\n props.size === \"tiny\" &&\n css`\n height: 16.5px;\n width: 16.5px;\n `}\n\n ${(props) =>\n props.size === \"compact\" &&\n css`\n height: 20px;\n width: 20px;\n `}\n\n ${(props) =>\n props.size === \"big\" &&\n css`\n height: 30px;\n width: 30px;\n `}\n\n ${(props) =>\n props.size === \"biggest\" &&\n css`\n height: 40px;\n width: 40px;\n `}\n`;\n\nChipTrigger.displayName = \"ChipTrigger\";\n\n// The theme picks the source color, and how much of it the surface and the text take.\nconst tintSource = (tint: string, strong = tint) =>\n `color-mix(in srgb, ${strong} var(--chip-tint-strong, 0%), ${tint})`;\n\nconst tintSurface = (tint: string, strong?: string) =>\n `color-mix(in srgb, ${tintSource(\n tint,\n strong\n )} var(--chip-tint-surface, 13%), transparent)`;\n\nconst tintText = (tint: string, strong?: string) =>\n `color-mix(in srgb, ${tintSource(\n tint,\n strong\n )} var(--chip-tint-text, 100%), #000)`;\n\nconst paletteSurface = (color: string) =>\n swatchPaletteFill(swatchPaletteBaseOf(color), \"label\");\n\nexport const RADIUS = { rounded: \"0.25rem\", soft: \"0.375rem\", pill: \"9999px\" };\n\nconst TONES = {\n neutral: css`\n background-color: var(--pill-background);\n color: var(--color-theme-700);\n `,\n muted: css`\n background-color: var(--color-theme-200);\n color: var(--color-theme-700);\n `,\n info: css`\n background-color: #a0cbfd1a;\n border: 1px solid #a0cbfd;\n color: #568ccb;\n `,\n primary: css`\n background-color: color-mix(in srgb, var(--color-primary) 15%, transparent);\n color: var(--color-primary);\n `,\n bordered: css`\n background-color: var(--color-theme-200);\n border: 1px solid var(--border-primary);\n color: var(--color-theme-900);\n `,\n warning: css`\n background-color: var(--note-bg);\n color: var(--warning-text);\n `,\n alert: css`\n background-color: var(--alert-surface-subtle);\n color: var(--red-alert);\n `,\n success: css`\n background-color: var(--success-surface);\n color: var(--color-sucess-green);\n `,\n inverse: css`\n background-color: var(--color-theme-900);\n color: var(--color-theme-100);\n `,\n};\n\ninterface ChipLook {\n showClose: boolean;\n $shape?: ChipProps[\"shape\"];\n $tone?: ChipProps[\"tone\"];\n $tint?: string;\n $tintStrong?: string;\n $paletteColor?: string;\n $closeMode?: ChipProps[\"closeMode\"];\n}\n\n// prettier-ignore\nexport const ChipContainer = styled.div<Partial<ChipProps> & ChipLook>`\n align-items: center;\n border-radius: ${(props) => RADIUS[props.$shape ?? \"rounded\"]};\n display: flex;\n height: 1.5rem;\n max-width: 220px;\n overflow: hidden;\n padding-left: 0.375rem;\n\n ${FontStyle}\n ${BoxSizingStyle}\n\n background-color: var(--color-theme-400);\n color: var(--color-theme-900);\n font-size: calc(0.875rem * var(--text-scale, 1));\n font-weight: 400;\n letter-spacing: 0.02em;\n line-height: 1.375;\n\n ${StyledTypography} {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n ${(props) => props.$tone && TONES[props.$tone]}\n\n ${(props) =>\n props.$tone &&\n css`\n ${StyledTypography} {\n color: inherit;\n }\n\n svg {\n fill: currentColor;\n }\n `}\n\n ${({ $tint, $tintStrong }) =>\n $tint &&\n css`\n background-color: ${tintSurface($tint, $tintStrong)};\n\n ${StyledTypography} {\n color: ${tintText($tint, $tintStrong)};\n }\n\n ${ChipTrigger} svg {\n fill: ${tintText($tint, $tintStrong)};\n }\n `}\n\n ${({ $paletteColor }) =>\n $paletteColor &&\n css`\n background-color: ${swatchPaletteFill(swatchPaletteBaseOf($paletteColor))};\n background-color: ${paletteSurface($paletteColor)};\n\n ${StyledTypography} {\n color: var(--color-theme-900);\n }\n\n ${ChipTrigger} svg {\n fill: var(--color-theme-900);\n }\n `}\n\n ${({ color }) =>\n color &&\n css`\n ${StyledTypography} {\n color: ${color};\n }\n `}\n\n ${({ backgroundColor }) =>\n backgroundColor &&\n css`\n background-color: ${backgroundColor};\n `}\n\n ${(props) =>\n props.showClose\n ? null\n : css`\n padding-right: 0.375rem;\n `}\n\n ${(props) =>\n props.size === \"regular\" &&\n css`\n height: 24px;\n `}\n\n ${(props) =>\n props.size === \"small\" &&\n css`\n height: 18px;\n `}\n\n ${(props) =>\n props.size === \"tag\" &&\n css`\n height: 22px;\n `}\n\n ${(props) =>\n props.size === \"compact\" &&\n css`\n height: 20px;\n padding-left: 0.5rem;\n ${props.showClose ? \"\" : \"padding-right: 0.5rem;\"}\n `}\n\n ${(props) =>\n props.size === \"tiny\" &&\n css`\n height: 16.5px;\n padding-left: 0.25rem;\n ${props.showClose ? \"\" : \"padding-right: 0.25rem;\"}\n `}\n\n ${(props) =>\n props.$closeMode === \"overlay\" &&\n css`\n position: relative;\n padding-right: 0.375rem;\n\n ${ChipTrigger} {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n height: auto;\n margin: 0;\n border-radius: 0 inherit inherit 0;\n opacity: 0;\n background-color: var(--chip-surface, var(--surface-raised));\n background-image: linear-gradient(\n ${props.$paletteColor\n ? paletteSurface(props.$paletteColor)\n : props.$tint\n ? tintSurface(props.$tint, props.$tintStrong)\n : props.backgroundColor ?? \"transparent\"},\n ${props.$paletteColor\n ? paletteSurface(props.$paletteColor)\n : props.$tint\n ? tintSurface(props.$tint, props.$tintStrong)\n : props.backgroundColor ?? \"transparent\"}\n );\n }\n\n &:hover ${ChipTrigger}, ${ChipTrigger}:focus-visible {\n opacity: 1;\n }\n `}\n\n ${(props) =>\n props.size === \"big\" &&\n css`\n height: 30px;\n `}\n\n ${(props) =>\n props.size === \"biggest\" &&\n css`\n height: 40px;\n `}\n`;\n\nChipContainer.displayName = \"ChipContainer\";\n\nexport const ChipLabel = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n`;\n\nChipLabel.displayName = \"ChipLabel\";\n\nexport const ChipCloseIcon = styled(CloseSmallIcon)`\n color: var(--color-theme-700);\n`;\n\nChipCloseIcon.displayName = \"ChipCloseIcon\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,mBAAmB,EAAEC,iBAAiB,QAAQ,kBAAkB;AACzE,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,gBAAgB,QAAQ,sBAAsB;AAEvD,OAAO,MAAMC,WAAW,GAAGT,MAAM,CAACO,OAAO,CAAC,CAAAG,U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AAK,CAAC6B,KAAK,EAAE7B,KAAK,CAAC8B,WAAW,CAAC,IAAAQ,sBAAA,GAC3CtC,KAAK,CAACmC,eAAe,YAAAG,sBAAA,GAAI,aAAa,EAIpC1C,WAAW,EAAKA,WAAW,CAGtC;AAAA,GAEAI,KAAK,IACNA,KAAK,CAACC,IAAI,KAAK,KAAK,IACpBb,GAAG,kBAEF,EAEEY,KAAK,IACNA,KAAK,CAACC,IAAI,KAAK,SAAS,IACxBb,GAAG,kBAEF,CACN;AAEDmC,aAAa,CAACzB,WAAW,GAAG,eAAe;AAE3C,OAAO,MAAM0C,SAAS,GAAGrD,MAAM,CAACsD,IAAI,CAAA5C,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6EAKnC;AAEDyC,SAAS,CAAC1C,WAAW,GAAG,WAAW;AAEnC,OAAO,MAAM4C,aAAa,GAAGvD,MAAM,CAACI,cAAc,CAAC,CAAAM,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qCAElD;AAED2C,aAAa,CAAC5C,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -14,8 +14,8 @@ export interface PillButtonProps extends ComponentPropsWithoutRef<"button"> {
|
|
|
14
14
|
iconOnly?: boolean;
|
|
15
15
|
/** Hide the placeholder and keep the icon, always or only on small screens. */
|
|
16
16
|
compact?: boolean | "mobile";
|
|
17
|
-
/** 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. */
|
|
18
|
-
size?: "xsmall" | "small" | "dense" | "medium";
|
|
17
|
+
/** 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, "tag" is 22px with the text of "xsmall", for a switch in an object header. */
|
|
18
|
+
size?: "xsmall" | "tag" | "small" | "dense" | "medium";
|
|
19
19
|
/** Side padding. "tight" suits a value that draws to its own edges, like avatars. */
|
|
20
20
|
inset?: "default" | "tight";
|
|
21
21
|
/** Dims a disabled pill. Set false to keep the full look of a read-only indicator, still with no hover. */
|
|
@@ -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,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,
|
|
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,2OAA2O;IAC3O,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;IACvD,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 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,CAC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AAsB,EAAEmB,OAAO;MAC/B,uBAAuB,EAAElB,MAAM;MAC/B,0BAA0B,EAAEE;IAC9B,CAAC,EACDW,SACF,CAAE;IACF,gBAAcb;EAAO,GACjBe,IAAI;IACR,cAAYM,SAAU;IACtBI,KAAK,EAAE1B,IAAK;IACZ2B,OAAO,EAAEC,OAAO,CAAC3B,MAAM,CAAE;IACzB4B,MAAM,EAAEV,OAAQ;IAChBW,SAAS,EAAE3B,QAAS;IACpB4B,QAAQ,EAAE1B,OAAQ;IAClB2B,KAAK,EAAEzB,IAAK;IACZ0B,MAAM,EAAExB,KAAM;IACdyB,YAAY,EAAEvB;EAAY,IAEzBQ,OAAO,IAAIvB,IAAI,gBACdX,KAAA,CAAAuC,aAAA,CAAClC,cAAc;IAACwB,SAAS,EAAC;EAAqB,GAC5ClB,IACa,CAAC,GACf,IAAI,EACPuB,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
|
+
{"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, \"tag\" is 22px with the text of \"xsmall\", for a switch in an object header. */\n size?: \"xsmall\" | \"tag\" | \"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,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,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;AAwPF,eAAO,MAAM,gBAAgB,0FAiG5B,CAAC"}
|
|
@@ -41,6 +41,7 @@ const toneStyle = tone => {
|
|
|
41
41
|
const compactStyle = css(["", "{display:none;}"], StyledPillPlaceholder);
|
|
42
42
|
const PILL_HEIGHTS = {
|
|
43
43
|
xsmall: "18px",
|
|
44
|
+
tag: "22px",
|
|
44
45
|
small: "24px",
|
|
45
46
|
dense: "24px",
|
|
46
47
|
medium: "26px"
|
|
@@ -52,6 +53,6 @@ const xsmallStyle = css(["gap:3px;--c-pill-padding-x:6px;font-size:calc(0.625rem
|
|
|
52
53
|
export const StyledPillButton = styled.button.withConfig({
|
|
53
54
|
displayName: "Styles__StyledPillButton",
|
|
54
55
|
componentId: "sc-14yhio0-2"
|
|
55
|
-
})(["", " ", " display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;max-width:100%;height:", ";margin:0;--c-pill-padding-x:", ";padding:0 var(--c-pill-padding-x);border:none;border-radius:var(--ac-br-rounded);font-size:calc(0.875rem * var(--text-scale,1));font-weight:500;line-height:1;white-space:nowrap;color:", ";cursor:pointer;user-select:none;&:focus{outline:none;}&:disabled{cursor:default;opacity:", ";pointer-events:none;}", " ", " ", " ", " ", " ", " ", " ", " &[aria-haspopup][aria-expanded=\"true\"],.c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"]{", "}"], FontStyle, BoxSizingStyle, props => PILL_HEIGHTS[props.$size], props => props.$inset === "tight" ? "6px" : "10px", props => props.$empty ? "var(--color-theme-700)" : "var(--color-theme-800)", props => props.$dimDisabled ? "50%" : "100%", props => toneStyle(props.$tone), props => props.$tone === "ghost" && props.$empty && css(["", ",", "{opacity:0;}.c-pill-host:hover &.c-pill-button--ghost,&:hover,&:focus-visible,&[aria-expanded=\"true\"]{", ",", "{opacity:1;}}"], StyledPillIcon, StyledPillPlaceholder, StyledPillIcon, StyledPillPlaceholder), props => props.$iconOnly && css(["width:", ";padding:0;", " svg{width:16px;height:16px;}"], props.$tone === "raised" ? "28px" : "36px", StyledPillIcon), props => props.$size === "xsmall" && xsmallStyle, props => props.$size === "dense" && denseStyle, props => props.$compact === true && compactStyle, props => props.$compact === "mobile" && css(["@media (max-width:768px){", "}"], compactStyle), props => props.$active && css(["&,&:hover,&:focus-visible{", "}"], activeStyle(props.$tone)), props => activeStyle(props.$tone));
|
|
56
|
+
})(["", " ", " display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;max-width:100%;height:", ";margin:0;--c-pill-padding-x:", ";padding:0 var(--c-pill-padding-x);border:none;border-radius:var(--ac-br-rounded);font-size:calc(0.875rem * var(--text-scale,1));font-weight:500;line-height:1;white-space:nowrap;color:", ";cursor:pointer;user-select:none;&:focus{outline:none;}&:disabled{cursor:default;opacity:", ";pointer-events:none;}", " ", " ", " ", " ", " ", " ", " ", " &[aria-haspopup][aria-expanded=\"true\"],.c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"]{", "}"], FontStyle, BoxSizingStyle, props => PILL_HEIGHTS[props.$size], props => props.$inset === "tight" ? "6px" : "10px", props => props.$empty ? "var(--color-theme-700)" : "var(--color-theme-800)", props => props.$dimDisabled ? "50%" : "100%", props => toneStyle(props.$tone), props => props.$tone === "ghost" && props.$empty && css(["", ",", "{opacity:0;}.c-pill-host:hover &.c-pill-button--ghost,&:hover,&:focus-visible,&[aria-expanded=\"true\"]{", ",", "{opacity:1;}}"], StyledPillIcon, StyledPillPlaceholder, StyledPillIcon, StyledPillPlaceholder), props => props.$iconOnly && css(["width:", ";padding:0;", " svg{width:16px;height:16px;}"], props.$tone === "raised" ? "28px" : "36px", StyledPillIcon), props => (props.$size === "xsmall" || props.$size === "tag") && xsmallStyle, props => props.$size === "dense" && denseStyle, props => props.$compact === true && compactStyle, props => props.$compact === "mobile" && css(["@media (max-width:768px){", "}"], compactStyle), props => props.$active && css(["&,&:hover,&:focus-visible{", "}"], activeStyle(props.$tone)), props => activeStyle(props.$tone));
|
|
56
57
|
StyledPillButton.displayName = "StyledPillButton";
|
|
57
58
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -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 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,I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,GAAG,MAAO,EAQlEF,KAAK,IACbA,KAAK,CAACG,MAAM,GAAG,wBAAwB,GAAG,wBAAwB,EAUtDH,KAAK,IAAMA,KAAK,CAACI,YAAY,GAAG,KAAK,GAAG,MAAO,EAI1DJ,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","tag","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 tag: \"22px\",\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) =>\n (props.$size === \"xsmall\" || props.$size === \"tag\") && 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.$t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AAK,IACNA,KAAK,CAACM,SAAS,IACflC,GAAG,6DACQ4B,KAAK,CAACK,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,EAGjD9B,cAAc,CAIjB,EAEAyB,KAAK,IACN,CAACA,KAAK,CAACC,KAAK,KAAK,QAAQ,IAAID,KAAK,CAACC,KAAK,KAAK,KAAK,KAAKJ,WAAW,EAEjEG,KAAK,IAAKA,KAAK,CAACC,KAAK,KAAK,OAAO,IAAIL,UAAU,EAE/CI,KAAK,IAAKA,KAAK,CAACO,QAAQ,KAAK,IAAI,IAAIlB,YAAY,EAEjDW,KAAK,IACNA,KAAK,CAACO,QAAQ,KAAK,QAAQ,IAC3BnC,GAAG,qCAEGiB,YAAY,CAEjB,EAGAW,KAAK,IACNA,KAAK,CAACQ,OAAO,IACbpC,GAAG,sCAIGc,WAAW,CAACc,KAAK,CAACK,KAAK,CAAC,CAE7B,EAKEL,KAAK,IAAKd,WAAW,CAACc,KAAK,CAACK,KAAK,CAAC,CAExC;AAEDP,gBAAgB,CAACpB,WAAW,GAAG,kBAAkB","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ComponentPropsWithoutRef } from "react";
|
|
2
2
|
export interface PillGroupProps extends ComponentPropsWithoutRef<"div"> {
|
|
3
|
-
/** "soft" joins filled pills with small gaps. "outlined" puts them in one frame with dividers. "raised" sticks raised pills together. */
|
|
4
|
-
appearance?: "soft" | "outlined" | "raised";
|
|
3
|
+
/** "soft" joins filled pills with small gaps. "strong" is "soft" with a stronger fill in the light theme, for pills on a white surface. "outlined" puts them in one frame with dividers. "raised" sticks raised pills together. */
|
|
4
|
+
appearance?: "soft" | "strong" | "outlined" | "raised";
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* @component PillGroup
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/PillGroup/PillGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,wBAAwB,EAAc,MAAM,OAAO,CAAC;AAMpE,MAAM,WAAW,cAAe,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACrE,
|
|
1
|
+
{"version":3,"file":"PillGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/PillGroup/PillGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,wBAAwB,EAAc,MAAM,OAAO,CAAC;AAMpE,MAAM,WAAW,cAAe,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACrE,mOAAmO;IACnO,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;CACxD;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,uFAgBrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillGroup.js","names":["React","forwardRef","classnames","StyledPillGroup","PillGroup","_ref","ref","_ref$appearance","appearance","className","children","args","_objectWithoutPropertiesLoose","_excluded","createElement","_extends","role","$appearance","displayName"],"sources":["../../../../src/components/PillGroup/PillGroup.tsx"],"sourcesContent":["import React, { ComponentPropsWithoutRef, forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledPillGroup } from \"./Styles\";\n\nexport interface PillGroupProps extends ComponentPropsWithoutRef<\"div\"> {\n /** \"soft\" joins filled pills with small gaps. \"outlined\" puts them in one frame with dividers. \"raised\" sticks raised pills together. */\n appearance?: \"soft\" | \"outlined\" | \"raised\";\n}\n\n/**\n * @component PillGroup\n * @description\n * Joins PillButton children into one segmented control. The outer pills keep their round ends.\n * A child may wrap its pill, for example in a Tooltip or a picker, the group still finds it.\n *\n * @example\n * <PillGroup aria-label=\"Task fields\">\n * <PillButton icon={<PersonPlusIcon />} placeholder=\"Assignee\" />\n * <PillButton icon={<CalendarIcon />} placeholder=\"Dates\" />\n * </PillGroup>\n */\nexport const PillGroup = forwardRef<HTMLDivElement, PillGroupProps>(\n ({ appearance = \"soft\", className, children, ...args }, ref) => (\n <StyledPillGroup\n ref={ref}\n role=\"group\"\n className={classnames(\n \"c-pill-group\",\n `c-pill-group--${appearance}`,\n className\n )}\n $appearance={appearance}\n {...args}\n >\n {children}\n </StyledPillGroup>\n )\n);\n\nPillGroup.displayName = \"PillGroup\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAA8BC,UAAU,QAAQ,OAAO;AAEnE,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,eAAe,QAAQ,UAAU;AAO1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,gBAAGH,UAAU,CACjC,CAAAI,IAAA,EAAwDC,GAAG;EAAA,IAAAC,eAAA,GAAAF,IAAA,CAAxDG,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,MAAM,GAAAA,eAAA;IAAEE,SAAS,GAAAJ,IAAA,CAATI,SAAS;IAAEC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IAAKC,IAAI,GAAAC,6BAAA,CAAAP,IAAA,EAAAQ,SAAA;EAAA,oBAClDb,KAAA,CAAAc,aAAA,CAACX,eAAe,EAAAY,QAAA;IACdT,GAAG,EAAEA,GAAI;IACTU,IAAI,EAAC,OAAO;IACZP,SAAS,EAAEP,UAAU,CACnB,cAAc,qBACGM,UAAU,EAC3BC,SACF,CAAE;IACFQ,WAAW,EAAET;EAAW,GACpBG,IAAI,GAEPD,QACc,CAAC;AAAA,CAEtB,CAAC;AAEDN,SAAS,CAACc,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"PillGroup.js","names":["React","forwardRef","classnames","StyledPillGroup","PillGroup","_ref","ref","_ref$appearance","appearance","className","children","args","_objectWithoutPropertiesLoose","_excluded","createElement","_extends","role","$appearance","displayName"],"sources":["../../../../src/components/PillGroup/PillGroup.tsx"],"sourcesContent":["import React, { ComponentPropsWithoutRef, forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledPillGroup } from \"./Styles\";\n\nexport interface PillGroupProps extends ComponentPropsWithoutRef<\"div\"> {\n /** \"soft\" joins filled pills with small gaps. \"strong\" is \"soft\" with a stronger fill in the light theme, for pills on a white surface. \"outlined\" puts them in one frame with dividers. \"raised\" sticks raised pills together. */\n appearance?: \"soft\" | \"strong\" | \"outlined\" | \"raised\";\n}\n\n/**\n * @component PillGroup\n * @description\n * Joins PillButton children into one segmented control. The outer pills keep their round ends.\n * A child may wrap its pill, for example in a Tooltip or a picker, the group still finds it.\n *\n * @example\n * <PillGroup aria-label=\"Task fields\">\n * <PillButton icon={<PersonPlusIcon />} placeholder=\"Assignee\" />\n * <PillButton icon={<CalendarIcon />} placeholder=\"Dates\" />\n * </PillGroup>\n */\nexport const PillGroup = forwardRef<HTMLDivElement, PillGroupProps>(\n ({ appearance = \"soft\", className, children, ...args }, ref) => (\n <StyledPillGroup\n ref={ref}\n role=\"group\"\n className={classnames(\n \"c-pill-group\",\n `c-pill-group--${appearance}`,\n className\n )}\n $appearance={appearance}\n {...args}\n >\n {children}\n </StyledPillGroup>\n )\n);\n\nPillGroup.displayName = \"PillGroup\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAA8BC,UAAU,QAAQ,OAAO;AAEnE,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,eAAe,QAAQ,UAAU;AAO1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,gBAAGH,UAAU,CACjC,CAAAI,IAAA,EAAwDC,GAAG;EAAA,IAAAC,eAAA,GAAAF,IAAA,CAAxDG,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,MAAM,GAAAA,eAAA;IAAEE,SAAS,GAAAJ,IAAA,CAATI,SAAS;IAAEC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IAAKC,IAAI,GAAAC,6BAAA,CAAAP,IAAA,EAAAQ,SAAA;EAAA,oBAClDb,KAAA,CAAAc,aAAA,CAACX,eAAe,EAAAY,QAAA;IACdT,GAAG,EAAEA,GAAI;IACTU,IAAI,EAAC,OAAO;IACZP,SAAS,EAAEP,UAAU,CACnB,cAAc,qBACGM,UAAU,EAC3BC,SACF,CAAE;IACFQ,WAAW,EAAET;EAAW,GACpBG,IAAI,GAEPD,QACc,CAAC;AAAA,CAEtB,CAAC;AAEDN,SAAS,CAACc,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/PillGroup/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/PillGroup/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAa7C,eAAO,MAAM,eAAe;iBACb,WAAW,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;SAsGvD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
+
import { DARK_THEME_SELECTOR } from "../../utils/themes";
|
|
2
3
|
import { BoxSizingStyle } from "../BoxSizingStyle";
|
|
3
4
|
const first = "& > .c-pill-button:first-child, & > :first-child .c-pill-button";
|
|
4
5
|
const last = "& > .c-pill-button:last-child, & > :last-child .c-pill-button";
|
|
@@ -8,6 +9,6 @@ const lastText = "& > .c-pill-button:not(.c-pill-button--icon-only):last-child,
|
|
|
8
9
|
export const StyledPillGroup = styled.div.withConfig({
|
|
9
10
|
displayName: "Styles__StyledPillGroup",
|
|
10
11
|
componentId: "sc-1x5hpq8-0"
|
|
11
|
-
})(["", " display:inline-flex;align-items:stretch;flex-shrink:0;max-width:100%;& > *{display:inline-flex;min-width:0;}.c-pill-button{border-radius:0;}", "{border-top-left-radius:var(--ac-br-rounded);border-bottom-left-radius:var(--ac-br-rounded);}", "{border-top-right-radius:var(--ac-br-rounded);border-bottom-right-radius:var(--ac-br-rounded);}", "{padding-left:calc(var(--c-pill-padding-x,10px) + 4px);}", "{padding-right:calc(var(--c-pill-padding-x,10px) + 4px);}", " ", " ", ""], BoxSizingStyle, first, last, firstText, lastText, props => props.$appearance === "soft" && css(["gap:2px;"]), props => props.$appearance === "raised" && css(["border-radius:var(--ac-br-rounded);box-shadow:0 1px 1px rgba(0,0,0,0.22);", "{width:auto;padding-left:7px;padding-right:calc(var(--c-pill-padding-x,10px) + 4px);}& > * + *{margin-left:-1px;}.c-pill-button:hover,.c-pill-button:focus-visible{position:relative;z-index:1;}"], lastIconOnly), props => props.$appearance === "outlined" && css(["border:1px solid var(--pill-border);border-radius:var(--ac-br-6);overflow:hidden;.c-pill-button{height:24px;}.c-pill-button:not(.c-pill-button--accent){background-color:transparent;}", ",", "{border-radius:0;}& > * + *{border-left:1px solid var(--pill-border);}"], first, last));
|
|
12
|
+
})(["", " display:inline-flex;align-items:stretch;flex-shrink:0;max-width:100%;& > *{display:inline-flex;min-width:0;}.c-pill-button{border-radius:0;}", "{border-top-left-radius:var(--ac-br-rounded);border-bottom-left-radius:var(--ac-br-rounded);}", "{border-top-right-radius:var(--ac-br-rounded);border-bottom-right-radius:var(--ac-br-rounded);}", "{padding-left:calc(var(--c-pill-padding-x,10px) + 4px);}", "{padding-right:calc(var(--c-pill-padding-x,10px) + 4px);}", " ", " ", " ", ""], BoxSizingStyle, first, last, firstText, lastText, props => (props.$appearance === "soft" || props.$appearance === "strong") && css(["gap:2px;"]), props => props.$appearance === "strong" && css(["--pill-background:rgba(48,48,55,0.1);--pill-background-hover:rgba(48,48,55,0.15);", " &{--pill-background:inherit;--pill-background-hover:inherit;}"], DARK_THEME_SELECTOR), props => props.$appearance === "raised" && css(["border-radius:var(--ac-br-rounded);box-shadow:0 1px 1px rgba(0,0,0,0.22);", "{width:auto;padding-left:7px;padding-right:calc(var(--c-pill-padding-x,10px) + 4px);}& > * + *{margin-left:-1px;}.c-pill-button:hover,.c-pill-button:focus-visible{position:relative;z-index:1;}"], lastIconOnly), props => props.$appearance === "outlined" && css(["border:1px solid var(--pill-border);border-radius:var(--ac-br-6);overflow:hidden;.c-pill-button{height:24px;}.c-pill-button:not(.c-pill-button--accent){background-color:transparent;}", ",", "{border-radius:0;}& > * + *{border-left:1px solid var(--pill-border);}"], first, last));
|
|
12
13
|
StyledPillGroup.displayName = "StyledPillGroup";
|
|
13
14
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","first","last","firstText","lastIconOnly","lastText","StyledPillGroup","div","withConfig","displayName","componentId","props","$appearance"],"sources":["../../../../src/components/PillGroup/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { PillGroupProps } from \"./PillGroup\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\n\nconst first = \"& > .c-pill-button:first-child, & > :first-child .c-pill-button\";\nconst last = \"& > .c-pill-button:last-child, & > :last-child .c-pill-button\";\nconst firstText =\n \"& > .c-pill-button:not(.c-pill-button--icon-only):first-child, & > :first-child .c-pill-button:not(.c-pill-button--icon-only)\";\nconst lastIconOnly =\n \"& > .c-pill-button--icon-only:last-child, & > :last-child .c-pill-button--icon-only\";\nconst lastText =\n \"& > .c-pill-button:not(.c-pill-button--icon-only):last-child, & > :last-child .c-pill-button:not(.c-pill-button--icon-only)\";\n\nexport const StyledPillGroup = styled.div<{\n $appearance: NonNullable<PillGroupProps[\"appearance\"]>;\n}>`\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: stretch;\n flex-shrink: 0;\n max-width: 100%;\n\n & > * {\n display: inline-flex;\n min-width: 0;\n }\n\n .c-pill-button {\n border-radius: 0;\n }\n\n ${first} {\n border-top-left-radius: var(--ac-br-rounded);\n border-bottom-left-radius: var(--ac-br-rounded);\n }\n\n ${last} {\n border-top-right-radius: var(--ac-br-rounded);\n border-bottom-right-radius: var(--ac-br-rounded);\n }\n\n /* The round ends of the group get 4px more room inside, so the first and last labels do not crowd the curve. */\n ${firstText} {\n padding-left: calc(var(--c-pill-padding-x, 10px) + 4px);\n }\n\n ${lastText} {\n padding-right: calc(var(--c-pill-padding-x, 10px) + 4px);\n }\n\n ${(props) =>\n props.$appearance === \"soft\" &&\n css`\n gap: 2px;\n `}\n\n ${(props) =>\n props.$appearance === \"raised\" &&\n css`\n border-radius: var(--ac-br-rounded);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);\n\n /* An icon at the round end gets the same room as the first label. */\n ${lastIconOnly} {\n width: auto;\n padding-left: 7px;\n padding-right: calc(var(--c-pill-padding-x, 10px) + 4px);\n }\n\n /* The neighbors share one border. */\n & > * + * {\n margin-left: -1px;\n }\n\n .c-pill-button:hover,\n .c-pill-button:focus-visible {\n position: relative;\n z-index: 1;\n }\n `}\n\n ${(props) =>\n props.$appearance === \"outlined\" &&\n css`\n border: 1px solid var(--pill-border);\n border-radius: var(--ac-br-6);\n overflow: hidden;\n\n .c-pill-button {\n height: 24px;\n }\n\n .c-pill-button:not(.c-pill-button--accent) {\n background-color: transparent;\n }\n\n ${first}, ${last} {\n border-radius: 0;\n }\n\n & > * + * {\n border-left: 1px solid var(--pill-border);\n }\n `}\n`;\n\nStyledPillGroup.displayName = \"StyledPillGroup\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAAc,QAAQ,mBAAmB;AAElD,MAAMC,KAAK,GAAG,iEAAiE;AAC/E,MAAMC,IAAI,GAAG,+DAA+D;AAC5E,MAAMC,SAAS,GACb,+HAA+H;AACjI,MAAMC,YAAY,GAChB,qFAAqF;AACvF,MAAMC,QAAQ,GACZ,6HAA6H;AAE/H,OAAO,MAAMC,eAAe,
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","DARK_THEME_SELECTOR","BoxSizingStyle","first","last","firstText","lastIconOnly","lastText","StyledPillGroup","div","withConfig","displayName","componentId","props","$appearance"],"sources":["../../../../src/components/PillGroup/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { PillGroupProps } from \"./PillGroup\";\nimport { DARK_THEME_SELECTOR } from \"../../utils/themes\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\n\nconst first = \"& > .c-pill-button:first-child, & > :first-child .c-pill-button\";\nconst last = \"& > .c-pill-button:last-child, & > :last-child .c-pill-button\";\nconst firstText =\n \"& > .c-pill-button:not(.c-pill-button--icon-only):first-child, & > :first-child .c-pill-button:not(.c-pill-button--icon-only)\";\nconst lastIconOnly =\n \"& > .c-pill-button--icon-only:last-child, & > :last-child .c-pill-button--icon-only\";\nconst lastText =\n \"& > .c-pill-button:not(.c-pill-button--icon-only):last-child, & > :last-child .c-pill-button:not(.c-pill-button--icon-only)\";\n\nexport const StyledPillGroup = styled.div<{\n $appearance: NonNullable<PillGroupProps[\"appearance\"]>;\n}>`\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: stretch;\n flex-shrink: 0;\n max-width: 100%;\n\n & > * {\n display: inline-flex;\n min-width: 0;\n }\n\n .c-pill-button {\n border-radius: 0;\n }\n\n ${first} {\n border-top-left-radius: var(--ac-br-rounded);\n border-bottom-left-radius: var(--ac-br-rounded);\n }\n\n ${last} {\n border-top-right-radius: var(--ac-br-rounded);\n border-bottom-right-radius: var(--ac-br-rounded);\n }\n\n /* The round ends of the group get 4px more room inside, so the first and last labels do not crowd the curve. */\n ${firstText} {\n padding-left: calc(var(--c-pill-padding-x, 10px) + 4px);\n }\n\n ${lastText} {\n padding-right: calc(var(--c-pill-padding-x, 10px) + 4px);\n }\n\n ${(props) =>\n (props.$appearance === \"soft\" || props.$appearance === \"strong\") &&\n css`\n gap: 2px;\n `}\n\n ${(props) =>\n props.$appearance === \"strong\" &&\n css`\n --pill-background: rgba(48, 48, 55, 0.1);\n --pill-background-hover: rgba(48, 48, 55, 0.15);\n\n ${DARK_THEME_SELECTOR} & {\n --pill-background: inherit;\n --pill-background-hover: inherit;\n }\n `}\n\n ${(props) =>\n props.$appearance === \"raised\" &&\n css`\n border-radius: var(--ac-br-rounded);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);\n\n /* An icon at the round end gets the same room as the first label. */\n ${lastIconOnly} {\n width: auto;\n padding-left: 7px;\n padding-right: calc(var(--c-pill-padding-x, 10px) + 4px);\n }\n\n /* The neighbors share one border. */\n & > * + * {\n margin-left: -1px;\n }\n\n .c-pill-button:hover,\n .c-pill-button:focus-visible {\n position: relative;\n z-index: 1;\n }\n `}\n\n ${(props) =>\n props.$appearance === \"outlined\" &&\n css`\n border: 1px solid var(--pill-border);\n border-radius: var(--ac-br-6);\n overflow: hidden;\n\n .c-pill-button {\n height: 24px;\n }\n\n .c-pill-button:not(.c-pill-button--accent) {\n background-color: transparent;\n }\n\n ${first}, ${last} {\n border-radius: 0;\n }\n\n & > * + * {\n border-left: 1px solid var(--pill-border);\n }\n `}\n`;\n\nStyledPillGroup.displayName = \"StyledPillGroup\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,mBAAmB,QAAQ,oBAAoB;AACxD,SAASC,cAAc,QAAQ,mBAAmB;AAElD,MAAMC,KAAK,GAAG,iEAAiE;AAC/E,MAAMC,IAAI,GAAG,+DAA+D;AAC5E,MAAMC,SAAS,GACb,+HAA+H;AACjI,MAAMC,YAAY,GAChB,qFAAqF;AACvF,MAAMC,QAAQ,GACZ,6HAA6H;AAE/H,OAAO,MAAMC,eAAe,GAAGT,MAAM,CAACU,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0eAGrCV,cAAc,EAedC,KAAK,EAKLC,IAAI,EAMJC,SAAS,EAITE,QAAQ,EAIPM,KAAK,IACN,CAACA,KAAK,CAACC,WAAW,KAAK,MAAM,IAAID,KAAK,CAACC,WAAW,KAAK,QAAQ,KAC/Dd,GAAG,cAEF,EAEAa,KAAK,IACNA,KAAK,CAACC,WAAW,KAAK,QAAQ,IAC9Bd,GAAG,0JAICC,mBAAmB,CAItB,EAEAY,KAAK,IACNA,KAAK,CAACC,WAAW,KAAK,QAAQ,IAC9Bd,GAAG,oRAKCM,YAAY,CAgBf,EAEAO,KAAK,IACNA,KAAK,CAACC,WAAW,KAAK,UAAU,IAChCd,GAAG,4QAaCG,KAAK,EAAKC,IAAI,CAOjB,CACJ;AAEDI,eAAe,CAACG,WAAW,GAAG,iBAAiB","ignoreList":[]}
|