@proef/common-ui 2.6.38 → 2.6.40

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.
@@ -0,0 +1,21 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { ChevronUpIcon, ChevronDownIcon } from "../../../foundations/icons/icons.js";
4
+ const ExpandButton = forwardRef(function ExpandButton2({ expanded = false, type = "button", title, className = "", ...props }, ref) {
5
+ return /* @__PURE__ */ jsx(
6
+ "button",
7
+ {
8
+ ref,
9
+ type,
10
+ title: title ?? props["aria-label"],
11
+ "aria-expanded": expanded,
12
+ className: `inline-flex w-8 shrink-0 cursor-pointer items-center justify-center self-stretch rounded-lg border border-border bg-card text-muted-foreground transition-colors duration-150 hover:bg-muted hover:text-primary focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:hover:text-foreground ${className}`,
13
+ ...props,
14
+ children: expanded ? /* @__PURE__ */ jsx(ChevronUpIcon, { size: 18, "aria-hidden": true }) : /* @__PURE__ */ jsx(ChevronDownIcon, { size: 18, "aria-hidden": true })
15
+ }
16
+ );
17
+ });
18
+ export {
19
+ ExpandButton as default
20
+ };
21
+ //# sourceMappingURL=ExpandButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpandButton.js","sources":["../../../../../../src/v1/primitives/buttons/ExpandButton/ExpandButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\r\nimport { ChevronDownIcon, ChevronUpIcon } from '../../../foundations/icons/icons'\r\n\r\nexport interface ExpandButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {\r\n /**\r\n * Nome acessível (e tooltip): o botão só tem um ícone. Obrigatório.\r\n * Ex: «Expandir os cartões».\r\n */\r\n 'aria-label': string\r\n /**\r\n * `false` (por omissão): a zona está recolhida e o botão tem a seta para baixo («Expandir»).\r\n * `true`: está aberta e a seta aponta para cima («Recolher»). Dá `aria-expanded`.\r\n */\r\n expanded?: boolean\r\n}\r\n\r\n/**\r\n * Botão para expandir ou recolher uma zona (ex: os cartões compactos do Cockpit passam a\r\n * expandidos). É uma **tira estreita (32px) que ocupa a altura do que a rodeia**: fica ao lado\r\n * de uma fila de cartões e tem a altura deles, ao contrário do [Button](?path=/docs/v1-primitives-buttons-button--docs)\r\n * só com ícone, que é quadrado.\r\n *\r\n * A altura segue o contentor (`self-stretch`). Para a fixar, ou para mudar a largura, passar\r\n * `className` (ex: `h-[92px]`).\r\n *\r\n * **Aceita os atributos HTML do [&lt;button&gt;](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button)**\r\n * (`onClick`, `disabled`, `title`, `ref`, ...). Por omissão não submete formulários (`type=\"button\"`).\r\n */\r\nconst ExpandButton = forwardRef<HTMLButtonElement, ExpandButtonProps>(function ExpandButton(\r\n { expanded = false, type = 'button', title, className = '', ...props },\r\n ref,\r\n) {\r\n return (\r\n <button\r\n ref={ref}\r\n type={type}\r\n title={title ?? props['aria-label']}\r\n aria-expanded={expanded}\r\n className={\r\n 'inline-flex w-8 shrink-0 cursor-pointer items-center justify-center self-stretch rounded-lg border border-border bg-card text-muted-foreground transition-colors duration-150 ' +\r\n 'hover:bg-muted hover:text-primary focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:outline-none ' +\r\n `disabled:cursor-not-allowed disabled:opacity-50 dark:hover:text-foreground ${className}`\r\n }\r\n {...props}\r\n >\r\n {expanded ? <ChevronUpIcon size={18} aria-hidden /> : <ChevronDownIcon size={18} aria-hidden />}\r\n </button>\r\n )\r\n})\r\n\r\nexport default ExpandButton\r\n"],"names":["ExpandButton"],"mappings":";;;AA4BA,MAAM,eAAe,WAAiD,SAASA,cAC7E,EAAE,WAAW,OAAO,OAAO,UAAU,OAAO,YAAY,IAAI,GAAG,MAAA,GAC/D,KACA;AACA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,OAAO,SAAS,MAAM,YAAY;AAAA,MAClC,iBAAe;AAAA,MACf,WACE,4WAE8E,SAAS;AAAA,MAExF,GAAG;AAAA,MAEH,UAAA,WAAW,oBAAC,eAAA,EAAc,MAAM,IAAI,eAAW,KAAA,CAAC,IAAK,oBAAC,iBAAA,EAAgB,MAAM,IAAI,eAAW,KAAA,CAAC;AAAA,IAAA;AAAA,EAAA;AAGnG,CAAC;"}