@apipass/design-system 1.24.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/lib/charts.index.cjs +2 -0
- package/dist/lib/charts.index.cjs.map +1 -0
- package/dist/lib/charts.index.js +7 -0
- package/dist/lib/charts.index.js.map +1 -0
- package/dist/lib/embedded-styles.js +1 -1
- package/dist/lib/lib.index.cjs +1 -1
- package/dist/lib/lib.index.js +735 -731
- package/dist/lib/lib.index.js.map +1 -1
- package/dist/lib/style.css +1 -1
- package/dist/lib/ui/components/DataTable/DataTable.cjs.map +1 -1
- package/dist/lib/ui/components/DataTable/DataTable.js.map +1 -1
- package/dist/lib/ui/components/KeyValue/KeyValue.cjs +2 -0
- package/dist/lib/ui/components/KeyValue/KeyValue.cjs.map +1 -0
- package/dist/lib/ui/components/KeyValue/KeyValue.js +77 -0
- package/dist/lib/ui/components/KeyValue/KeyValue.js.map +1 -0
- package/dist/lib/ui/layout/Section/Section.cjs +1 -1
- package/dist/lib/ui/layout/Section/Section.cjs.map +1 -1
- package/dist/lib/ui/layout/Section/Section.js.map +1 -1
- package/dist/lib/ui/primitives/Fieldset/Fieldset.cjs.map +1 -1
- package/dist/lib/ui/primitives/Fieldset/Fieldset.js.map +1 -1
- package/dist/lib/ui/primitives/Navigation/Navigation.cjs +1 -1
- package/dist/lib/ui/primitives/Navigation/Navigation.cjs.map +1 -1
- package/dist/lib/ui/primitives/Navigation/Navigation.js +20 -36
- package/dist/lib/ui/primitives/Navigation/Navigation.js.map +1 -1
- package/dist/lib/ui/primitives/NavigationPill/NavigationPill.cjs +2 -0
- package/dist/lib/ui/primitives/NavigationPill/NavigationPill.cjs.map +1 -0
- package/dist/lib/ui/primitives/NavigationPill/NavigationPill.js +33 -0
- package/dist/lib/ui/primitives/NavigationPill/NavigationPill.js.map +1 -0
- package/dist/lib/ui/primitives/Pagination/Pagination.cjs.map +1 -1
- package/dist/lib/ui/primitives/Pagination/Pagination.js.map +1 -1
- package/dist/lib/ui/primitives/Tab/Tab.cjs +1 -1
- package/dist/lib/ui/primitives/Tab/Tab.cjs.map +1 -1
- package/dist/lib/ui/primitives/Tab/Tab.js +39 -21
- package/dist/lib/ui/primitives/Tab/Tab.js.map +1 -1
- package/dist/lib/ui/primitives/Toast/Toast.cjs.map +1 -1
- package/dist/lib/ui/primitives/Toast/Toast.js.map +1 -1
- package/dist/types/charts.index.d.ts +2 -0
- package/dist/types/ui/components/KeyValue/KeyValue.d.ts +16 -0
- package/dist/types/ui/components/index.d.ts +1 -1
- package/dist/types/ui/primitives/Navigation/Navigation.d.ts +0 -4
- package/dist/types/ui/primitives/NavigationPill/NavigationPill.d.ts +10 -0
- package/dist/types/ui/primitives/Tab/Tab.d.ts +7 -3
- package/dist/types/ui/primitives/index.d.ts +1 -0
- package/package.json +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.cjs","sources":["../../../../../src/ui/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useMediaQuery } from \"hooks\";\nimport { IconArrowLeft, IconArrowRight } from \"icons\";\nimport type React from \"react\";\nimport { AnchorOrButton } from \"utils\";\nimport \"./pagination.css\";\n\nexport type PaginationManualProps = React.ComponentPropsWithoutRef<\"nav\">;\n\nexport type PaginationControlledProps = {\n page: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n previousLabel: string;\n nextLabel: string;\n className?: string;\n};\n\nexport type PaginationProps = PaginationManualProps | PaginationControlledProps;\n\nfunction isControlledProps(\n props: PaginationProps,\n): props is PaginationControlledProps {\n return \"totalPages\" in props;\n}\n\nexport function Pagination(props: PaginationProps) {\n if (isControlledProps(props)) {\n const { page, totalPages, onPageChange, previousLabel, nextLabel, className } = props;\n if (totalPages <= 1) return null;\n return (\n <nav aria-label=\"Page navigation\" className={clsx(className, \"pagination\")}>\n <PaginationPrevious isDisabled={page <= 1} onPress={() => onPageChange(Math.max(1, page - 1))}>\n {previousLabel}\n </PaginationPrevious>\n <PaginationList>\n {buildPaginationPages(page, totalPages).map((p, i) =>\n p === \"...\" ? (\n <PaginationGap key={`gap-${i}`} />\n ) : (\n <PaginationPage key={p} current={p === page} onPress={() => onPageChange(p)}>\n {String(p)}\n </PaginationPage>\n ),\n )}\n </PaginationList>\n <PaginationNext isDisabled={page >= totalPages} onPress={() => onPageChange(Math.min(totalPages, page + 1))}>\n {nextLabel}\n </PaginationNext>\n </nav>\n );\n }\n const { \"aria-label\": ariaLabel = \"Page navigation\", className, ...rest } = props;\n return <nav aria-label={ariaLabel} {...rest} className={clsx(className, \"pagination\")} />;\n}\n\nexport function PaginationPrevious({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Previous\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Previous page\"\n >\n <IconArrowLeft size=\"16\" />\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationNext({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Next\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Next page\"\n >\n {children}\n <IconArrowRight size=\"16\" />\n </AnchorOrButton>\n );\n}\n\nexport function PaginationList({ children }: { children: React.ReactNode }) {\n const { isTabletUp } = useMediaQuery();\n return isTabletUp && <span className=\"pagination-list\">{children}</span>;\n}\n\nexport function PaginationPage({\n href,\n onPress,\n children,\n current = false,\n}: {\n href?: string;\n onPress?: () => void;\n children: string;\n current?: boolean;\n}) {\n return (\n <AnchorOrButton\n {...(href ? { href } : {})}\n onPress={onPress}\n aria-label={`Page ${children}`}\n aria-current={current ? \"page\" : undefined}\n className={clsx(\"pagination-btn\", current && \"pagination-btn-active\")}\n >\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationGap() {\n return (\n <div aria-hidden=\"true\" className=\"pagination-gap\">\n …\n </div>\n );\n}\n\nexport function buildPaginationPages(current: number, total: number): Array<number | \"...\"> {\n if (total <= 6) return Array.from({ length: total }, (_, i) => i + 1);\n const head = [1, 2, 3];\n const tail = [total - 1, total];\n if (current <= 4) return [...head, \"...\", ...tail];\n if (current >= total - 3) return [1, 2, \"...\", total - 2, total - 1, total];\n return [1, \"...\", current - 1, current, current + 1, \"...\", total];\n}\n"],"names":["isControlledProps","props","Pagination","page","totalPages","onPageChange","previousLabel","nextLabel","className","jsxs","clsx","jsx","PaginationPrevious","PaginationList","buildPaginationPages","p","i","PaginationGap","PaginationPage","PaginationNext","ariaLabel","rest","href","onPress","isDisabled","children","AnchorOrButton","IconArrowLeft","IconArrowRight","isTabletUp","useMediaQuery","current","total","_","head","tail"],"mappings":"yXAoBA,SAASA,EACPC,EACoC,CACpC,MAAO,eAAgBA,CACzB,CAEO,SAASC,EAAWD,EAAwB,CACjD,GAAID,EAAkBC,CAAK,EAAG,CAC5B,KAAM,CAAE,KAAAE,EAAM,WAAAC,EAAY,aAAAC,EAAc,cAAAC,EAAe,UAAAC,EAAW,UAAAC,GAAcP,EAChF,OAAIG,GAAc,EAAU,KAE1BK,OAAC,OAAI,aAAW,kBAAkB,UAAWC,EAAAA,KAAKF,EAAW,YAAY,EACvE,SAAA,CAAAG,EAAAA,IAACC,EAAA,CAAmB,WAAYT,GAAQ,EAAG,QAAS,IAAME,EAAa,KAAK,IAAI,EAAGF,EAAO,CAAC,CAAC,EACzF,SAAAG,EACH,EACAK,EAAAA,IAACE,EAAA,CACE,SAAAC,EAAqBX,EAAMC,CAAU,EAAE,IAAI,CAACW,EAAGC,IAC9CD,I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AAe,EACDd,EAAAA,IAACiB,EAAAA,eAAA,CAAe,KAAK,IAAA,CAAK,CAAA,CAAA,CAAA,CAGhC,CAEO,SAASf,EAAe,CAAE,SAAAY,GAA2C,CAC1E,KAAM,CAAE,WAAAI,CAAA,EAAeC,gBAAA,EACvB,OAAOD,GAAclB,EAAAA,IAAC,OAAA,CAAK,UAAU,kBAAmB,SAAAc,EAAS,CACnE,CAEO,SAASP,EAAe,CAC7B,KAAAI,EACA,QAAAC,EACA,SAAAE,EACA,QAAAM,EAAU,EACZ,EAKG,CACD,OACEpB,EAAAA,IAACe,EAAAA,eAAA,CACE,GAAIJ,EAAO,CAAE,KAAAA,CAAA,EAAS,CAAA,EACvB,QAAAC,EACA,aAAY,QAAQE,CAAQ,GAC5B,eAAcM,EAAU,OAAS,OACjC,UAAWrB,EAAAA,KAAK,iBAAkBqB,GAAW,uBAAuB,EAEnE,SAAAN,CAAA,CAAA,CAGP,CAEO,SAASR,GAAgB,CAC9B,aACG,MAAA,CAAI,cAAY,OAAO,UAAU,iBAAiB,SAAA,IAEnD,CAEJ,
|
|
1
|
+
{"version":3,"file":"Pagination.cjs","sources":["../../../../../src/ui/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useMediaQuery } from \"hooks\";\nimport { IconArrowLeft, IconArrowRight } from \"icons\";\nimport type React from \"react\";\nimport { AnchorOrButton } from \"utils\";\nimport \"./pagination.css\";\n\nexport type PaginationManualProps = React.ComponentPropsWithoutRef<\"nav\">;\n\nexport type PaginationControlledProps = {\n page: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n previousLabel: string;\n nextLabel: string;\n className?: string;\n};\n\nexport type PaginationProps = PaginationManualProps | PaginationControlledProps;\n\nfunction isControlledProps(\n props: PaginationProps,\n): props is PaginationControlledProps {\n return \"totalPages\" in props;\n}\n\nexport function Pagination(props: PaginationProps) {\n if (isControlledProps(props)) {\n const { page, totalPages, onPageChange, previousLabel, nextLabel, className } = props;\n if (totalPages <= 1) return null;\n return (\n <nav aria-label=\"Page navigation\" className={clsx(className, \"pagination\")}>\n <PaginationPrevious isDisabled={page <= 1} onPress={() => onPageChange(Math.max(1, page - 1))}>\n {previousLabel}\n </PaginationPrevious>\n <PaginationList>\n {buildPaginationPages(page, totalPages).map((p, i) =>\n p === \"...\" ? (\n <PaginationGap key={`gap-${i}`} />\n ) : (\n <PaginationPage key={p} current={p === page} onPress={() => onPageChange(p)}>\n {String(p)}\n </PaginationPage>\n ),\n )}\n </PaginationList>\n <PaginationNext isDisabled={page >= totalPages} onPress={() => onPageChange(Math.min(totalPages, page + 1))}>\n {nextLabel}\n </PaginationNext>\n </nav>\n );\n }\n const { \"aria-label\": ariaLabel = \"Page navigation\", className, ...rest } = props;\n return <nav aria-label={ariaLabel} {...rest} className={clsx(className, \"pagination\")} />;\n}\n\nexport function PaginationPrevious({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Previous\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Previous page\"\n >\n <IconArrowLeft size=\"16\" />\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationNext({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Next\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Next page\"\n >\n {children}\n <IconArrowRight size=\"16\" />\n </AnchorOrButton>\n );\n}\n\nexport function PaginationList({ children }: { children: React.ReactNode }) {\n const { isTabletUp } = useMediaQuery();\n return isTabletUp && <span className=\"pagination-list\">{children}</span>;\n}\n\nexport function PaginationPage({\n href,\n onPress,\n children,\n current = false,\n}: {\n href?: string;\n onPress?: () => void;\n children: string;\n current?: boolean;\n}) {\n return (\n <AnchorOrButton\n {...(href ? { href } : {})}\n onPress={onPress}\n aria-label={`Page ${children}`}\n aria-current={current ? \"page\" : undefined}\n className={clsx(\"pagination-btn\", current && \"pagination-btn-active\")}\n >\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationGap() {\n return (\n <div aria-hidden=\"true\" className=\"pagination-gap\">\n …\n </div>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components -- utilitário reaproveitado fora deste arquivo, não é um componente\nexport function buildPaginationPages(current: number, total: number): Array<number | \"...\"> {\n if (total <= 6) return Array.from({ length: total }, (_, i) => i + 1);\n const head = [1, 2, 3];\n const tail = [total - 1, total];\n if (current <= 4) return [...head, \"...\", ...tail];\n if (current >= total - 3) return [1, 2, \"...\", total - 2, total - 1, total];\n return [1, \"...\", current - 1, current, current + 1, \"...\", total];\n}\n"],"names":["isControlledProps","props","Pagination","page","totalPages","onPageChange","previousLabel","nextLabel","className","jsxs","clsx","jsx","PaginationPrevious","PaginationList","buildPaginationPages","p","i","PaginationGap","PaginationPage","PaginationNext","ariaLabel","rest","href","onPress","isDisabled","children","AnchorOrButton","IconArrowLeft","IconArrowRight","isTabletUp","useMediaQuery","current","total","_","head","tail"],"mappings":"yXAoBA,SAASA,EACPC,EACoC,CACpC,MAAO,eAAgBA,CACzB,CAEO,SAASC,EAAWD,EAAwB,CACjD,GAAID,EAAkBC,CAAK,EAAG,CAC5B,KAAM,CAAE,KAAAE,EAAM,WAAAC,EAAY,aAAAC,EAAc,cAAAC,EAAe,UAAAC,EAAW,UAAAC,GAAcP,EAChF,OAAIG,GAAc,EAAU,KAE1BK,OAAC,OAAI,aAAW,kBAAkB,UAAWC,EAAAA,KAAKF,EAAW,YAAY,EACvE,SAAA,CAAAG,EAAAA,IAACC,EAAA,CAAmB,WAAYT,GAAQ,EAAG,Q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AAOD,EAAU,EAAGA,EAASA,EAAU,EAAG,MAAOC,CAAK,CACnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../../../src/ui/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useMediaQuery } from \"hooks\";\nimport { IconArrowLeft, IconArrowRight } from \"icons\";\nimport type React from \"react\";\nimport { AnchorOrButton } from \"utils\";\nimport \"./pagination.css\";\n\nexport type PaginationManualProps = React.ComponentPropsWithoutRef<\"nav\">;\n\nexport type PaginationControlledProps = {\n page: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n previousLabel: string;\n nextLabel: string;\n className?: string;\n};\n\nexport type PaginationProps = PaginationManualProps | PaginationControlledProps;\n\nfunction isControlledProps(\n props: PaginationProps,\n): props is PaginationControlledProps {\n return \"totalPages\" in props;\n}\n\nexport function Pagination(props: PaginationProps) {\n if (isControlledProps(props)) {\n const { page, totalPages, onPageChange, previousLabel, nextLabel, className } = props;\n if (totalPages <= 1) return null;\n return (\n <nav aria-label=\"Page navigation\" className={clsx(className, \"pagination\")}>\n <PaginationPrevious isDisabled={page <= 1} onPress={() => onPageChange(Math.max(1, page - 1))}>\n {previousLabel}\n </PaginationPrevious>\n <PaginationList>\n {buildPaginationPages(page, totalPages).map((p, i) =>\n p === \"...\" ? (\n <PaginationGap key={`gap-${i}`} />\n ) : (\n <PaginationPage key={p} current={p === page} onPress={() => onPageChange(p)}>\n {String(p)}\n </PaginationPage>\n ),\n )}\n </PaginationList>\n <PaginationNext isDisabled={page >= totalPages} onPress={() => onPageChange(Math.min(totalPages, page + 1))}>\n {nextLabel}\n </PaginationNext>\n </nav>\n );\n }\n const { \"aria-label\": ariaLabel = \"Page navigation\", className, ...rest } = props;\n return <nav aria-label={ariaLabel} {...rest} className={clsx(className, \"pagination\")} />;\n}\n\nexport function PaginationPrevious({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Previous\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Previous page\"\n >\n <IconArrowLeft size=\"16\" />\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationNext({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Next\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Next page\"\n >\n {children}\n <IconArrowRight size=\"16\" />\n </AnchorOrButton>\n );\n}\n\nexport function PaginationList({ children }: { children: React.ReactNode }) {\n const { isTabletUp } = useMediaQuery();\n return isTabletUp && <span className=\"pagination-list\">{children}</span>;\n}\n\nexport function PaginationPage({\n href,\n onPress,\n children,\n current = false,\n}: {\n href?: string;\n onPress?: () => void;\n children: string;\n current?: boolean;\n}) {\n return (\n <AnchorOrButton\n {...(href ? { href } : {})}\n onPress={onPress}\n aria-label={`Page ${children}`}\n aria-current={current ? \"page\" : undefined}\n className={clsx(\"pagination-btn\", current && \"pagination-btn-active\")}\n >\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationGap() {\n return (\n <div aria-hidden=\"true\" className=\"pagination-gap\">\n …\n </div>\n );\n}\n\nexport function buildPaginationPages(current: number, total: number): Array<number | \"...\"> {\n if (total <= 6) return Array.from({ length: total }, (_, i) => i + 1);\n const head = [1, 2, 3];\n const tail = [total - 1, total];\n if (current <= 4) return [...head, \"...\", ...tail];\n if (current >= total - 3) return [1, 2, \"...\", total - 2, total - 1, total];\n return [1, \"...\", current - 1, current, current + 1, \"...\", total];\n}\n"],"names":["isControlledProps","props","Pagination","page","totalPages","onPageChange","previousLabel","nextLabel","className","jsxs","clsx","jsx","PaginationPrevious","PaginationList","buildPaginationPages","p","i","PaginationGap","PaginationPage","PaginationNext","ariaLabel","rest","href","onPress","isDisabled","children","AnchorOrButton","IconArrowLeft","IconArrowRight","isTabletUp","useMediaQuery","current","total","_","head","tail"],"mappings":";;;;;;;AAoBA,SAASA,EACPC,GACoC;AACpC,SAAO,gBAAgBA;AACzB;AAEO,SAASC,EAAWD,GAAwB;AACjD,MAAID,EAAkBC,CAAK,GAAG;AAC5B,UAAM,EAAE,MAAAE,GAAM,YAAAC,GAAY,cAAAC,GAAc,eAAAC,GAAe,WAAAC,GAAW,WAAAC,MAAcP;AAChF,WAAIG,KAAc,IAAU,OAE1B,gBAAAK,EAAC,SAAI,cAAW,mBAAkB,WAAWC,EAAKF,GAAW,YAAY,GACvE,UAAA;AAAA,MAAA,gBAAAG,EAACC,GAAA,EAAmB,YAAYT,KAAQ,GAAG,SAAS,MAAME,EAAa,KAAK,IAAI,GAAGF,IAAO,CAAC,CAAC,GACzF,UAAAG,GACH;AAAA,MACA,gBAAAK,EAACE,GAAA,EACE,UAAAC,EAAqBX,GAAMC,CAAU,EAAE;AAAA,QAAI,CAACW,GAAGC,MAC9CD,MAAM,0BACHE,GAAA,CAAA,GAAmB,OAAOD,CAAC,EAAI,IAEhC,gBAAAL,EAACO,KAAuB,SAASH,MAAMZ,GAAM,SAAS,MAAME,EAAaU,CAAC,GACvE,UAAA,OAAOA,CAAC,EAAA,GADUA,CAErB;AAAA,MAAA,GAGN;AAAA,MACA,gBAAAJ,EAACQ,GAAA,EAAe,YAAYhB,KAAQC,GAAY,SAAS,MAAMC,EAAa,KAAK,IAAID,GAAYD,IAAO,CAAC,CAAC,GACvG,UAAAI,EAAA,CACH;AAAA,IAAA,GACF;AAAA,EAEJ;AACA,QAAM,EAAE,cAAca,IAAY,mBAAmB,WAAAZ,GAAW,GAAGa,MAASpB;AAC5E,SAAO,gBAAAU,EAAC,OAAA,EA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,EAC7B,MAAAI;AAAA,EACA,SAAAC;AAAA,EACA,UAAAE;AAAA,EACA,SAAAM,IAAU;AACZ,GAKG;AACD,SACE,gBAAApB;AAAA,IAACe;AAAA,IAAA;AAAA,MACE,GAAIJ,IAAO,EAAE,MAAAA,EAAA,IAAS,CAAA;AAAA,MACvB,SAAAC;AAAA,MACA,cAAY,QAAQE,CAAQ;AAAA,MAC5B,gBAAcM,IAAU,SAAS;AAAA,MACjC,WAAWrB,EAAK,kBAAkBqB,KAAW,uBAAuB;AAAA,MAEnE,UAAAN;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,SAASR,IAAgB;AAC9B,2BACG,OAAA,EAAI,eAAY,QAAO,WAAU,kBAAiB,UAAA,KAEnD;AAEJ;
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../../../src/ui/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useMediaQuery } from \"hooks\";\nimport { IconArrowLeft, IconArrowRight } from \"icons\";\nimport type React from \"react\";\nimport { AnchorOrButton } from \"utils\";\nimport \"./pagination.css\";\n\nexport type PaginationManualProps = React.ComponentPropsWithoutRef<\"nav\">;\n\nexport type PaginationControlledProps = {\n page: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n previousLabel: string;\n nextLabel: string;\n className?: string;\n};\n\nexport type PaginationProps = PaginationManualProps | PaginationControlledProps;\n\nfunction isControlledProps(\n props: PaginationProps,\n): props is PaginationControlledProps {\n return \"totalPages\" in props;\n}\n\nexport function Pagination(props: PaginationProps) {\n if (isControlledProps(props)) {\n const { page, totalPages, onPageChange, previousLabel, nextLabel, className } = props;\n if (totalPages <= 1) return null;\n return (\n <nav aria-label=\"Page navigation\" className={clsx(className, \"pagination\")}>\n <PaginationPrevious isDisabled={page <= 1} onPress={() => onPageChange(Math.max(1, page - 1))}>\n {previousLabel}\n </PaginationPrevious>\n <PaginationList>\n {buildPaginationPages(page, totalPages).map((p, i) =>\n p === \"...\" ? (\n <PaginationGap key={`gap-${i}`} />\n ) : (\n <PaginationPage key={p} current={p === page} onPress={() => onPageChange(p)}>\n {String(p)}\n </PaginationPage>\n ),\n )}\n </PaginationList>\n <PaginationNext isDisabled={page >= totalPages} onPress={() => onPageChange(Math.min(totalPages, page + 1))}>\n {nextLabel}\n </PaginationNext>\n </nav>\n );\n }\n const { \"aria-label\": ariaLabel = \"Page navigation\", className, ...rest } = props;\n return <nav aria-label={ariaLabel} {...rest} className={clsx(className, \"pagination\")} />;\n}\n\nexport function PaginationPrevious({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Previous\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Previous page\"\n >\n <IconArrowLeft size=\"16\" />\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationNext({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Next\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Next page\"\n >\n {children}\n <IconArrowRight size=\"16\" />\n </AnchorOrButton>\n );\n}\n\nexport function PaginationList({ children }: { children: React.ReactNode }) {\n const { isTabletUp } = useMediaQuery();\n return isTabletUp && <span className=\"pagination-list\">{children}</span>;\n}\n\nexport function PaginationPage({\n href,\n onPress,\n children,\n current = false,\n}: {\n href?: string;\n onPress?: () => void;\n children: string;\n current?: boolean;\n}) {\n return (\n <AnchorOrButton\n {...(href ? { href } : {})}\n onPress={onPress}\n aria-label={`Page ${children}`}\n aria-current={current ? \"page\" : undefined}\n className={clsx(\"pagination-btn\", current && \"pagination-btn-active\")}\n >\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationGap() {\n return (\n <div aria-hidden=\"true\" className=\"pagination-gap\">\n …\n </div>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components -- utilitário reaproveitado fora deste arquivo, não é um componente\nexport function buildPaginationPages(current: number, total: number): Array<number | \"...\"> {\n if (total <= 6) return Array.from({ length: total }, (_, i) => i + 1);\n const head = [1, 2, 3];\n const tail = [total - 1, total];\n if (current <= 4) return [...head, \"...\", ...tail];\n if (current >= total - 3) return [1, 2, \"...\", total - 2, total - 1, total];\n return [1, \"...\", current - 1, current, current + 1, \"...\", total];\n}\n"],"names":["isControlledProps","props","Pagination","page","totalPages","onPageChange","previousLabel","nextLabel","className","jsxs","clsx","jsx","PaginationPrevious","PaginationList","buildPaginationPages","p","i","PaginationGap","PaginationPage","PaginationNext","ariaLabel","rest","href","onPress","isDisabled","children","AnchorOrButton","IconArrowLeft","IconArrowRight","isTabletUp","useMediaQuery","current","total","_","head","tail"],"mappings":";;;;;;;AAoBA,SAASA,EACPC,GACoC;AACpC,SAAO,gBAAgBA;AACzB;AAEO,SAASC,EAAWD,GAAwB;AACjD,MAAID,EAAkBC,CAAK,GAAG;AAC5B,UAAM,EAAE,MAAAE,GAAM,YAAAC,GAAY,cAAAC,GAAc,eAAAC,GAAe,WAAAC,GAAW,WAAAC,MAAcP;AAChF,WAAIG,KAAc,IAAU,OAE1B,gBAAAK,EAAC,SAAI,cAAW,mBAAkB,WAAWC,EAAKF,GAAW,YAAY,GACvE,UAAA;AAAA,MAAA,gBAAAG,EAACC,GAAA,EAAmB,YAAYT,KAAQ,GAAG,SAAS,MAAME,EAAa,KAAK,IAAI,GAAGF,IAAO,CAAC,CAAC,GACzF,UAAAG,GACH;AAAA,MACA,gBAAAK,EAACE,GAAA,EACE,UAAAC,EAAqBX,GAAMC,CAAU,EAAE;AAAA,QAAI,CAACW,GAAGC,MAC9CD,MAAM,0BACHE,GAA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,GAAG,GAAG,OAAOA,IAAQ,GAAGA,IAAQ,GAAGA,CAAK,IACnE,CAAC,GAAG,OAAOD,IAAU,GAAGA,GAASA,IAAU,GAAG,OAAOC,CAAK;AACnE;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),c=require("../../../vendor/clsx/dist/clsx.cjs"),n=require("react-aria-components");;/* empty css */const i=require("../../icons/IconX.cjs");function o({className:e,children:a,onClose:t,closeButtonLabel:l,...r}){const b=c.clsx(e,"tab");return s.jsx(n.Tab,{className:b,"aria-label":a,...r,children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"tab-label",children:a}),s.jsx(n.Button,{className:"tab-close","aria-label":l,onPress:t,children:s.jsx(i.IconX,{size:"16"})})]})})}function u({className:e,...a}){const t=c.clsx(e,"tab-list");return s.jsx(n.TabList,{className:t,...a})}function m({className:e,...a}){const t=c.clsx(e,"tab-panel");return s.jsx(n.TabPanel,{className:t,...a})}function x({className:e,...a}){const t=c.clsx(e,"tabs");return s.jsx(n.Tabs,{className:t,...a})}exports.Tab=o;exports.TabList=u;exports.TabPanel=m;exports.Tabs=x;
|
|
2
2
|
//# sourceMappingURL=Tab.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.cjs","sources":["../../../../../src/ui/primitives/Tab/Tab.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n Tab as RACTab,\n TabList as RACTabList,\n TabPanel as RACTabPanel,\n Tabs as RACTabs,\n type TabListProps as RACTabListProps,\n type TabPanelProps as RACTabPanelProps,\n type TabProps as RACTabProps,\n type TabsProps as RACTabsProps,\n} from \"react-aria-components\";\nimport \"./tab.css\";\n\nexport type TabProps = RACTabProps;\nexport function Tab({
|
|
1
|
+
{"version":3,"file":"Tab.cjs","sources":["../../../../../src/ui/primitives/Tab/Tab.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { IconX } from \"icons\";\nimport {\n Button as RACButton,\n Tab as RACTab,\n TabList as RACTabList,\n TabPanel as RACTabPanel,\n Tabs as RACTabs,\n type PressEvent as RACPressEvent,\n type TabListProps as RACTabListProps,\n type TabPanelProps as RACTabPanelProps,\n type TabProps as RACTabProps,\n type TabsProps as RACTabsProps,\n} from \"react-aria-components\";\nimport \"./tab.css\";\n\nexport type TabProps = Omit<RACTabProps, \"children\"> & {\n children: string;\n onClose: (e: RACPressEvent) => void;\n closeButtonLabel: string;\n};\nexport function Tab({\n className,\n children,\n onClose,\n closeButtonLabel,\n ...props\n}: TabProps) {\n const classNames = clsx(className, \"tab\");\n return (\n <RACTab className={classNames} aria-label={children} {...props}>\n <>\n <span className=\"tab-label\">{children}</span>\n <RACButton\n className=\"tab-close\"\n aria-label={closeButtonLabel}\n onPress={onClose}\n >\n <IconX size=\"16\" />\n </RACButton>\n </>\n </RACTab>\n );\n}\n\nexport type TabListProps<T> = RACTabListProps<T>;\nexport function TabList<T extends object>({\n className,\n ...props\n}: TabListProps<T>) {\n const classNames = clsx(className, \"tab-list\");\n return <RACTabList className={classNames} {...props} />;\n}\n\nexport type TabPanelProps = RACTabPanelProps;\nexport function TabPanel({ className, ...props }: TabPanelProps) {\n const classNames = clsx(className, \"tab-panel\");\n return <RACTabPanel className={classNames} {...props} />;\n}\n\nexport type TabsProps = RACTabsProps;\nexport function Tabs({ className, ...props }: TabsProps) {\n const classNames = clsx(className, \"tabs\");\n return <RACTabs className={classNames} {...props} />;\n}\n"],"names":["Tab","className","children","onClose","closeButtonLabel","props","classNames","clsx","jsx","RACTab","jsxs","Fragment","RACButton","IconX","TabList","RACTabList","TabPanel","RACTabPanel","Tabs","RACTabs"],"mappings":"0QAqBO,SAASA,EAAI,CAClB,UAAAC,EACA,SAAAC,EACA,QAAAC,EACA,iBAAAC,EACA,GAAGC,CACL,EAAa,CACX,MAAMC,EAAaC,EAAAA,KAAKN,EAAW,KAAK,EACxC,OACEO,EAAAA,IAACC,EAAAA,KAAO,UAAWH,EAAY,aAAYJ,EAAW,GAAGG,EACvD,SAAAK,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAH,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAa,SAAAN,CAAA,CAAS,EACtCM,EAAAA,IAACI,EAAAA,OAAA,CACC,UAAU,YACV,aAAYR,EACZ,QAASD,EAET,SAAAK,EAAAA,IAACK,EAAAA,MAAA,CAAM,KAAK,IAAA,CAAK,CAAA,CAAA,CACnB,CAAA,CACF,CAAA,CACF,CAEJ,CAGO,SAASC,EAA0B,CACxC,UAAAb,EACA,GAAGI,CACL,EAAoB,CAClB,MAAMC,EAAaC,EAAAA,KAAKN,EAAW,UAAU,EAC7C,OAAOO,EAAAA,IAACO,EAAAA,QAAA,CAAW,UAAWT,EAAa,GAAGD,EAAO,CACvD,CAGO,SAASW,EAAS,CAAE,UAAAf,EAAW,GAAGI,GAAwB,CAC/D,MAAMC,EAAaC,EAAAA,KAAKN,EAAW,WAAW,EAC9C,OAAOO,EAAAA,IAACS,EAAAA,SAAA,CAAY,UAAWX,EAAa,GAAGD,EAAO,CACxD,CAGO,SAASa,EAAK,CAAE,UAAAjB,EAAW,GAAGI,GAAoB,CACvD,MAAMC,EAAaC,EAAAA,KAAKN,EAAW,MAAM,EACzC,OAAOO,EAAAA,IAACW,EAAAA,KAAA,CAAQ,UAAWb,EAAa,GAAGD,EAAO,CACpD"}
|
|
@@ -1,30 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { clsx as
|
|
3
|
-
import { Tab as
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as n } from "../../../vendor/clsx/dist/clsx.js";
|
|
3
|
+
import { Tab as m, Button as i, TabList as T, TabPanel as N, Tabs as u } from "react-aria-components";
|
|
4
4
|
/* empty css */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { IconX as f } from "../../icons/IconX.js";
|
|
6
|
+
function d({
|
|
7
|
+
className: s,
|
|
8
|
+
children: a,
|
|
9
|
+
onClose: t,
|
|
10
|
+
closeButtonLabel: l,
|
|
11
|
+
...r
|
|
12
|
+
}) {
|
|
13
|
+
const c = n(s, "tab");
|
|
14
|
+
return /* @__PURE__ */ e(m, { className: c, "aria-label": a, ...r, children: /* @__PURE__ */ o(b, { children: [
|
|
15
|
+
/* @__PURE__ */ e("span", { className: "tab-label", children: a }),
|
|
16
|
+
/* @__PURE__ */ e(
|
|
17
|
+
i,
|
|
18
|
+
{
|
|
19
|
+
className: "tab-close",
|
|
20
|
+
"aria-label": l,
|
|
21
|
+
onPress: t,
|
|
22
|
+
children: /* @__PURE__ */ e(f, { size: "16" })
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
] }) });
|
|
8
26
|
}
|
|
9
|
-
function
|
|
10
|
-
className:
|
|
11
|
-
...
|
|
27
|
+
function h({
|
|
28
|
+
className: s,
|
|
29
|
+
...a
|
|
12
30
|
}) {
|
|
13
|
-
const t =
|
|
14
|
-
return /* @__PURE__ */
|
|
31
|
+
const t = n(s, "tab-list");
|
|
32
|
+
return /* @__PURE__ */ e(T, { className: t, ...a });
|
|
15
33
|
}
|
|
16
|
-
function
|
|
17
|
-
const t =
|
|
18
|
-
return /* @__PURE__ */
|
|
34
|
+
function j({ className: s, ...a }) {
|
|
35
|
+
const t = n(s, "tab-panel");
|
|
36
|
+
return /* @__PURE__ */ e(N, { className: t, ...a });
|
|
19
37
|
}
|
|
20
|
-
function
|
|
21
|
-
const t =
|
|
22
|
-
return /* @__PURE__ */
|
|
38
|
+
function g({ className: s, ...a }) {
|
|
39
|
+
const t = n(s, "tabs");
|
|
40
|
+
return /* @__PURE__ */ e(u, { className: t, ...a });
|
|
23
41
|
}
|
|
24
42
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
43
|
+
d as Tab,
|
|
44
|
+
h as TabList,
|
|
45
|
+
j as TabPanel,
|
|
46
|
+
g as Tabs
|
|
29
47
|
};
|
|
30
48
|
//# sourceMappingURL=Tab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.js","sources":["../../../../../src/ui/primitives/Tab/Tab.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n Tab as RACTab,\n TabList as RACTabList,\n TabPanel as RACTabPanel,\n Tabs as RACTabs,\n type TabListProps as RACTabListProps,\n type TabPanelProps as RACTabPanelProps,\n type TabProps as RACTabProps,\n type TabsProps as RACTabsProps,\n} from \"react-aria-components\";\nimport \"./tab.css\";\n\nexport type TabProps = RACTabProps;\nexport function Tab({
|
|
1
|
+
{"version":3,"file":"Tab.js","sources":["../../../../../src/ui/primitives/Tab/Tab.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { IconX } from \"icons\";\nimport {\n Button as RACButton,\n Tab as RACTab,\n TabList as RACTabList,\n TabPanel as RACTabPanel,\n Tabs as RACTabs,\n type PressEvent as RACPressEvent,\n type TabListProps as RACTabListProps,\n type TabPanelProps as RACTabPanelProps,\n type TabProps as RACTabProps,\n type TabsProps as RACTabsProps,\n} from \"react-aria-components\";\nimport \"./tab.css\";\n\nexport type TabProps = Omit<RACTabProps, \"children\"> & {\n children: string;\n onClose: (e: RACPressEvent) => void;\n closeButtonLabel: string;\n};\nexport function Tab({\n className,\n children,\n onClose,\n closeButtonLabel,\n ...props\n}: TabProps) {\n const classNames = clsx(className, \"tab\");\n return (\n <RACTab className={classNames} aria-label={children} {...props}>\n <>\n <span className=\"tab-label\">{children}</span>\n <RACButton\n className=\"tab-close\"\n aria-label={closeButtonLabel}\n onPress={onClose}\n >\n <IconX size=\"16\" />\n </RACButton>\n </>\n </RACTab>\n );\n}\n\nexport type TabListProps<T> = RACTabListProps<T>;\nexport function TabList<T extends object>({\n className,\n ...props\n}: TabListProps<T>) {\n const classNames = clsx(className, \"tab-list\");\n return <RACTabList className={classNames} {...props} />;\n}\n\nexport type TabPanelProps = RACTabPanelProps;\nexport function TabPanel({ className, ...props }: TabPanelProps) {\n const classNames = clsx(className, \"tab-panel\");\n return <RACTabPanel className={classNames} {...props} />;\n}\n\nexport type TabsProps = RACTabsProps;\nexport function Tabs({ className, ...props }: TabsProps) {\n const classNames = clsx(className, \"tabs\");\n return <RACTabs className={classNames} {...props} />;\n}\n"],"names":["Tab","className","children","onClose","closeButtonLabel","props","classNames","clsx","jsx","RACTab","jsxs","Fragment","RACButton","IconX","TabList","RACTabList","TabPanel","RACTabPanel","Tabs","RACTabs"],"mappings":";;;;;AAqBO,SAASA,EAAI;AAAA,EAClB,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,GAAGC;AACL,GAAa;AACX,QAAMC,IAAaC,EAAKN,GAAW,KAAK;AACxC,SACE,gBAAAO,EAACC,KAAO,WAAWH,GAAY,cAAYJ,GAAW,GAAGG,GACvD,UAAA,gBAAAK,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAH,EAAC,QAAA,EAAK,WAAU,aAAa,UAAAN,EAAA,CAAS;AAAA,IACtC,gBAAAM;AAAA,MAACI;AAAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,cAAYR;AAAA,QACZ,SAASD;AAAA,QAET,UAAA,gBAAAK,EAACK,GAAA,EAAM,MAAK,KAAA,CAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EACnB,EAAA,CACF,EAAA,CACF;AAEJ;AAGO,SAASC,EAA0B;AAAA,EACxC,WAAAb;AAAA,EACA,GAAGI;AACL,GAAoB;AAClB,QAAMC,IAAaC,EAAKN,GAAW,UAAU;AAC7C,SAAO,gBAAAO,EAACO,GAAA,EAAW,WAAWT,GAAa,GAAGD,GAAO;AACvD;AAGO,SAASW,EAAS,EAAE,WAAAf,GAAW,GAAGI,KAAwB;AAC/D,QAAMC,IAAaC,EAAKN,GAAW,WAAW;AAC9C,SAAO,gBAAAO,EAACS,GAAA,EAAY,WAAWX,GAAa,GAAGD,GAAO;AACxD;AAGO,SAASa,EAAK,EAAE,WAAAjB,GAAW,GAAGI,KAAoB;AACvD,QAAMC,IAAaC,EAAKN,GAAW,MAAM;AACzC,SAAO,gBAAAO,EAACW,GAAA,EAAQ,WAAWb,GAAa,GAAGD,GAAO;AACpD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.cjs","sources":["../../../../../src/ui/primitives/Toast/Toast.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n IconAlertTriangle,\n IconCheckCircle,\n IconInfo,\n IconXCircle,\n} from \"icons\";\nimport {\n ToastContainer as RTToastContainer,\n type IconProps as RTIconProps,\n type ToastContainerProps as RTToastContainerProps,\n} from \"react-toastify\";\nimport \"react-toastify/dist/ReactToastify.css\";\nimport \"./toast.css\";\n\n// Re-export the full react-toastify imperative API so consumers get everything\n// (toast.success/error/..., toast.promise, toast.update, dismiss, etc.) from a\n// single design-system entry point.\nexport { toast } from \"react-toastify\";\nexport type {\n Id,\n Theme,\n ToastContent,\n ToastOptions,\n ToastPosition,\n TypeOptions,\n} from \"react-toastify\";\n\n/**\n * Maps each react-toastify toast type to the matching design-system icon.\n * Icons inherit the toast's text color via `--icon-color: currentColor`\n * (see toast.css), so they stay on-brand per variant. Returning `null` for\n * the `default` type hides the icon slot for plain toasts.\n */\nfunction dsToastIcon({ type }: RTIconProps): React.ReactNode {\n switch (type) {\n case \"success\":\n return <IconCheckCircle size=\"20\" />;\n case \"error\":\n return <IconXCircle size=\"20\" />;\n case \"warning\":\n return <IconAlertTriangle size=\"20\" />;\n case \"info\":\n return <IconInfo size=\"20\" />;\n default:\n return null;\n }\n}\n\nexport type ToastContainerProps = RTToastContainerProps;\n\n/**\n * Design-system-themed react-toastify container. Styling is applied by mapping\n * `--toastify-*` variables onto `--sds-*` tokens in toast.css (scoped to the\n * `.apipass-toast-container` class added here), so toasts read as the same\n * family as the `Notification` primitive.\n *\n * Mount this once inside your app/MFE root. For shadow-root micro-frontends,\n * mount it inside the federated module root (not the Angular Shell) so toasts\n * render inside the shadow tree where the injected design-system CSS applies.\n */\nexport function ToastContainer({\n className,\n position = \"top-right\",\n autoClose = 5000,\n theme = \"colored\",\n icon = dsToastIcon,\n ...props\n}: ToastContainerProps) {\n return (\n <RTToastContainer\n className={clsx(\n \"apipass-toast-container\",\n typeof className === \"string\" ? className : undefined,\n )}\n position={position}\n autoClose={autoClose}\n theme={theme}\n icon={icon}\n {...props}\n />\n );\n}\n"],"names":["dsToastIcon","type","jsx","IconCheckCircle","IconXCircle","IconAlertTriangle","IconInfo","ToastContainer","className","position","autoClose","theme","icon","props","RTToastContainer","clsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toast.cjs","sources":["../../../../../src/ui/primitives/Toast/Toast.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n IconAlertTriangle,\n IconCheckCircle,\n IconInfo,\n IconXCircle,\n} from \"icons\";\nimport {\n ToastContainer as RTToastContainer,\n type IconProps as RTIconProps,\n type ToastContainerProps as RTToastContainerProps,\n} from \"react-toastify\";\nimport \"react-toastify/dist/ReactToastify.css\";\nimport \"./toast.css\";\n\n// Re-export the full react-toastify imperative API so consumers get everything\n// (toast.success/error/..., toast.promise, toast.update, dismiss, etc.) from a\n// single design-system entry point.\n// eslint-disable-next-line react-refresh/only-export-components -- re-export de API imperativa, não é um componente\nexport { toast } from \"react-toastify\";\nexport type {\n Id,\n Theme,\n ToastContent,\n ToastOptions,\n ToastPosition,\n TypeOptions,\n} from \"react-toastify\";\n\n/**\n * Maps each react-toastify toast type to the matching design-system icon.\n * Icons inherit the toast's text color via `--icon-color: currentColor`\n * (see toast.css), so they stay on-brand per variant. Returning `null` for\n * the `default` type hides the icon slot for plain toasts.\n */\nfunction dsToastIcon({ type }: RTIconProps): React.ReactNode {\n switch (type) {\n case \"success\":\n return <IconCheckCircle size=\"20\" />;\n case \"error\":\n return <IconXCircle size=\"20\" />;\n case \"warning\":\n return <IconAlertTriangle size=\"20\" />;\n case \"info\":\n return <IconInfo size=\"20\" />;\n default:\n return null;\n }\n}\n\nexport type ToastContainerProps = RTToastContainerProps;\n\n/**\n * Design-system-themed react-toastify container. Styling is applied by mapping\n * `--toastify-*` variables onto `--sds-*` tokens in toast.css (scoped to the\n * `.apipass-toast-container` class added here), so toasts read as the same\n * family as the `Notification` primitive.\n *\n * Mount this once inside your app/MFE root. For shadow-root micro-frontends,\n * mount it inside the federated module root (not the Angular Shell) so toasts\n * render inside the shadow tree where the injected design-system CSS applies.\n */\nexport function ToastContainer({\n className,\n position = \"top-right\",\n autoClose = 5000,\n theme = \"colored\",\n icon = dsToastIcon,\n ...props\n}: ToastContainerProps) {\n return (\n <RTToastContainer\n className={clsx(\n \"apipass-toast-container\",\n typeof className === \"string\" ? className : undefined,\n )}\n position={position}\n autoClose={autoClose}\n theme={theme}\n icon={icon}\n {...props}\n />\n );\n}\n"],"names":["dsToastIcon","type","jsx","IconCheckCircle","IconXCircle","IconAlertTriangle","IconInfo","ToastContainer","className","position","autoClose","theme","icon","props","RTToastContainer","clsx"],"mappings":"ifAmCA,SAASA,EAAY,CAAE,KAAAC,GAAsC,CAC3D,OAAQA,EAAA,CACN,IAAK,UACH,OAAOC,EAAAA,IAACC,EAAAA,gBAAA,CAAgB,KAAK,IAAA,CAAK,EACpC,IAAK,QACH,OAAOD,EAAAA,IAACE,EAAAA,YAAA,CAAY,KAAK,IAAA,CAAK,EAChC,IAAK,UACH,OAAOF,EAAAA,IAACG,EAAAA,kBAAA,CAAkB,KAAK,IAAA,CAAK,EACtC,IAAK,OACH,OAAOH,EAAAA,IAACI,EAAAA,SAAA,CAAS,KAAK,IAAA,CAAK,EAC7B,QACE,OAAO,IAAA,CAEb,CAcO,SAASC,EAAe,CAC7B,UAAAC,EACA,SAAAC,EAAW,YACX,UAAAC,EAAY,IACZ,MAAAC,EAAQ,UACR,KAAAC,EAAOZ,EACP,GAAGa,CACL,EAAwB,CACtB,OACEX,EAAAA,IAACY,EAAAA,eAAA,CACC,UAAWC,EAAAA,KACT,0BACA,OAAOP,GAAc,SAAWA,EAAY,MAAA,EAE9C,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,KAAAC,EACC,GAAGC,CAAA,CAAA,CAGV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sources":["../../../../../src/ui/primitives/Toast/Toast.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n IconAlertTriangle,\n IconCheckCircle,\n IconInfo,\n IconXCircle,\n} from \"icons\";\nimport {\n ToastContainer as RTToastContainer,\n type IconProps as RTIconProps,\n type ToastContainerProps as RTToastContainerProps,\n} from \"react-toastify\";\nimport \"react-toastify/dist/ReactToastify.css\";\nimport \"./toast.css\";\n\n// Re-export the full react-toastify imperative API so consumers get everything\n// (toast.success/error/..., toast.promise, toast.update, dismiss, etc.) from a\n// single design-system entry point.\nexport { toast } from \"react-toastify\";\nexport type {\n Id,\n Theme,\n ToastContent,\n ToastOptions,\n ToastPosition,\n TypeOptions,\n} from \"react-toastify\";\n\n/**\n * Maps each react-toastify toast type to the matching design-system icon.\n * Icons inherit the toast's text color via `--icon-color: currentColor`\n * (see toast.css), so they stay on-brand per variant. Returning `null` for\n * the `default` type hides the icon slot for plain toasts.\n */\nfunction dsToastIcon({ type }: RTIconProps): React.ReactNode {\n switch (type) {\n case \"success\":\n return <IconCheckCircle size=\"20\" />;\n case \"error\":\n return <IconXCircle size=\"20\" />;\n case \"warning\":\n return <IconAlertTriangle size=\"20\" />;\n case \"info\":\n return <IconInfo size=\"20\" />;\n default:\n return null;\n }\n}\n\nexport type ToastContainerProps = RTToastContainerProps;\n\n/**\n * Design-system-themed react-toastify container. Styling is applied by mapping\n * `--toastify-*` variables onto `--sds-*` tokens in toast.css (scoped to the\n * `.apipass-toast-container` class added here), so toasts read as the same\n * family as the `Notification` primitive.\n *\n * Mount this once inside your app/MFE root. For shadow-root micro-frontends,\n * mount it inside the federated module root (not the Angular Shell) so toasts\n * render inside the shadow tree where the injected design-system CSS applies.\n */\nexport function ToastContainer({\n className,\n position = \"top-right\",\n autoClose = 5000,\n theme = \"colored\",\n icon = dsToastIcon,\n ...props\n}: ToastContainerProps) {\n return (\n <RTToastContainer\n className={clsx(\n \"apipass-toast-container\",\n typeof className === \"string\" ? className : undefined,\n )}\n position={position}\n autoClose={autoClose}\n theme={theme}\n icon={icon}\n {...props}\n />\n );\n}\n"],"names":["dsToastIcon","type","jsx","IconCheckCircle","IconXCircle","IconAlertTriangle","IconInfo","ToastContainer","className","position","autoClose","theme","icon","props","RTToastContainer","clsx"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Toast.js","sources":["../../../../../src/ui/primitives/Toast/Toast.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n IconAlertTriangle,\n IconCheckCircle,\n IconInfo,\n IconXCircle,\n} from \"icons\";\nimport {\n ToastContainer as RTToastContainer,\n type IconProps as RTIconProps,\n type ToastContainerProps as RTToastContainerProps,\n} from \"react-toastify\";\nimport \"react-toastify/dist/ReactToastify.css\";\nimport \"./toast.css\";\n\n// Re-export the full react-toastify imperative API so consumers get everything\n// (toast.success/error/..., toast.promise, toast.update, dismiss, etc.) from a\n// single design-system entry point.\n// eslint-disable-next-line react-refresh/only-export-components -- re-export de API imperativa, não é um componente\nexport { toast } from \"react-toastify\";\nexport type {\n Id,\n Theme,\n ToastContent,\n ToastOptions,\n ToastPosition,\n TypeOptions,\n} from \"react-toastify\";\n\n/**\n * Maps each react-toastify toast type to the matching design-system icon.\n * Icons inherit the toast's text color via `--icon-color: currentColor`\n * (see toast.css), so they stay on-brand per variant. Returning `null` for\n * the `default` type hides the icon slot for plain toasts.\n */\nfunction dsToastIcon({ type }: RTIconProps): React.ReactNode {\n switch (type) {\n case \"success\":\n return <IconCheckCircle size=\"20\" />;\n case \"error\":\n return <IconXCircle size=\"20\" />;\n case \"warning\":\n return <IconAlertTriangle size=\"20\" />;\n case \"info\":\n return <IconInfo size=\"20\" />;\n default:\n return null;\n }\n}\n\nexport type ToastContainerProps = RTToastContainerProps;\n\n/**\n * Design-system-themed react-toastify container. Styling is applied by mapping\n * `--toastify-*` variables onto `--sds-*` tokens in toast.css (scoped to the\n * `.apipass-toast-container` class added here), so toasts read as the same\n * family as the `Notification` primitive.\n *\n * Mount this once inside your app/MFE root. For shadow-root micro-frontends,\n * mount it inside the federated module root (not the Angular Shell) so toasts\n * render inside the shadow tree where the injected design-system CSS applies.\n */\nexport function ToastContainer({\n className,\n position = \"top-right\",\n autoClose = 5000,\n theme = \"colored\",\n icon = dsToastIcon,\n ...props\n}: ToastContainerProps) {\n return (\n <RTToastContainer\n className={clsx(\n \"apipass-toast-container\",\n typeof className === \"string\" ? className : undefined,\n )}\n position={position}\n autoClose={autoClose}\n theme={theme}\n icon={icon}\n {...props}\n />\n );\n}\n"],"names":["dsToastIcon","type","jsx","IconCheckCircle","IconXCircle","IconAlertTriangle","IconInfo","ToastContainer","className","position","autoClose","theme","icon","props","RTToastContainer","clsx"],"mappings":";;;;;;;;;;AAmCA,SAASA,EAAY,EAAE,MAAAC,KAAsC;AAC3D,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO,gBAAAC,EAACC,GAAA,EAAgB,MAAK,KAAA,CAAK;AAAA,IACpC,KAAK;AACH,aAAO,gBAAAD,EAACE,GAAA,EAAY,MAAK,KAAA,CAAK;AAAA,IAChC,KAAK;AACH,aAAO,gBAAAF,EAACG,GAAA,EAAkB,MAAK,KAAA,CAAK;AAAA,IACtC,KAAK;AACH,aAAO,gBAAAH,EAACI,GAAA,EAAS,MAAK,KAAA,CAAK;AAAA,IAC7B;AACE,aAAO;AAAA,EAAA;AAEb;AAcO,SAASC,EAAe;AAAA,EAC7B,WAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAOZ;AAAA,EACP,GAAGa;AACL,GAAwB;AACtB,SACE,gBAAAX;AAAA,IAACY;AAAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACA,OAAOP,KAAc,WAAWA,IAAY;AAAA,MAAA;AAAA,MAE9C,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,OAAAC;AAAA,MACA,MAAAC;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./keyValue.css";
|
|
2
|
+
export type KeyValuePair = {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
export type KeyValueProps = {
|
|
7
|
+
pairs: KeyValuePair[];
|
|
8
|
+
onChange: (pairs: KeyValuePair[]) => void;
|
|
9
|
+
keyPlaceholder: string;
|
|
10
|
+
valuePlaceholder: string;
|
|
11
|
+
addRowButtonLabel: string;
|
|
12
|
+
removeRowButtonLabel: string;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function KeyValue({ pairs, onChange, keyPlaceholder, valuePlaceholder, addRowButtonLabel, removeRowButtonLabel, isDisabled, className, }: KeyValueProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from "./Breadcrumb/Breadcrumb";
|
|
2
2
|
export * from "./Card/Card";
|
|
3
3
|
export * from "./charts/chart-palette";
|
|
4
|
-
export * from "./charts/TimeSeriesChart/TimeSeriesChart";
|
|
5
4
|
export * from "./ConfirmDialog/ConfirmDialog";
|
|
6
5
|
export * from "./DataTable/DataTable";
|
|
7
6
|
export * from "./FormModal/FormModal";
|
|
7
|
+
export * from "./KeyValue/KeyValue";
|
|
8
8
|
export * from "./PageHeader/PageHeader";
|
|
9
9
|
export * from "./Sidebar/Sidebar";
|
|
10
10
|
export * from "./Widget/Widget";
|
|
@@ -5,10 +5,6 @@ export type NavigationProps = ComponentPropsWithoutRef<"nav"> & {
|
|
|
5
5
|
direction?: "column" | "row";
|
|
6
6
|
};
|
|
7
7
|
export declare function Navigation({ className, direction, ...props }: NavigationProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export type NavigationPillProps = AnchorOrButtonProps & {
|
|
9
|
-
isSelected?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare function NavigationPill({ className, isSelected, ...props }: NavigationPillProps): import("react/jsx-runtime").JSX.Element;
|
|
12
8
|
export type NavigationButtonProps = AnchorOrButtonProps & {
|
|
13
9
|
isSelected?: boolean;
|
|
14
10
|
icon?: ReactNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TabListProps as RACTabListProps, type TabPanelProps as RACTabPanelProps, type TabProps as RACTabProps, type TabsProps as RACTabsProps } from "react-aria-components";
|
|
2
|
+
import "./navigationPill.css";
|
|
3
|
+
export type NavigationPillProps = RACTabProps;
|
|
4
|
+
export declare function NavigationPill({ className, ...props }: NavigationPillProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export type NavigationPillListProps<T> = RACTabListProps<T>;
|
|
6
|
+
export declare function NavigationPillList<T extends object>({ className, ...props }: NavigationPillListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export type NavigationPillPanelProps = RACTabPanelProps;
|
|
8
|
+
export declare function NavigationPillPanel({ className, ...props }: NavigationPillPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export type NavigationPillsProps = RACTabsProps;
|
|
10
|
+
export declare function NavigationPills({ className, ...props }: NavigationPillsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { type TabListProps as RACTabListProps, type TabPanelProps as RACTabPanelProps, type TabProps as RACTabProps, type TabsProps as RACTabsProps } from "react-aria-components";
|
|
1
|
+
import { type PressEvent as RACPressEvent, type TabListProps as RACTabListProps, type TabPanelProps as RACTabPanelProps, type TabProps as RACTabProps, type TabsProps as RACTabsProps } from "react-aria-components";
|
|
2
2
|
import "./tab.css";
|
|
3
|
-
export type TabProps = RACTabProps
|
|
4
|
-
|
|
3
|
+
export type TabProps = Omit<RACTabProps, "children"> & {
|
|
4
|
+
children: string;
|
|
5
|
+
onClose: (e: RACPressEvent) => void;
|
|
6
|
+
closeButtonLabel: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function Tab({ className, children, onClose, closeButtonLabel, ...props }: TabProps): import("react/jsx-runtime").JSX.Element;
|
|
5
9
|
export type TabListProps<T> = RACTabListProps<T>;
|
|
6
10
|
export declare function TabList<T extends object>({ className, ...props }: TabListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
11
|
export type TabPanelProps = RACTabPanelProps;
|
|
@@ -21,6 +21,7 @@ export * from "./ListBox/ListBox";
|
|
|
21
21
|
export * from "./Logo/Logo";
|
|
22
22
|
export * from "./Menu/Menu";
|
|
23
23
|
export * from "./Navigation/Navigation";
|
|
24
|
+
export * from "./NavigationPill/NavigationPill";
|
|
24
25
|
export * from "./Notification/Notification";
|
|
25
26
|
export * from "./Pagination/Pagination";
|
|
26
27
|
export * from "./Radio/Radio";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apipass/design-system",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "APIPass React Design System",
|
|
6
6
|
"sideEffects": [
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
"import": "./dist/lib/lib.index.js",
|
|
22
22
|
"require": "./dist/lib/lib.index.cjs"
|
|
23
23
|
},
|
|
24
|
+
"./charts": {
|
|
25
|
+
"types": "./dist/types/charts.index.d.ts",
|
|
26
|
+
"import": "./dist/lib/charts.index.js",
|
|
27
|
+
"require": "./dist/lib/charts.index.cjs"
|
|
28
|
+
},
|
|
24
29
|
"./style.css": "./dist/lib/style.css",
|
|
25
30
|
"./embedded-styles": {
|
|
26
31
|
"types": "./dist/lib/embedded-styles.d.ts",
|
|
@@ -37,6 +42,7 @@
|
|
|
37
42
|
"app:build": "tsc && vite build",
|
|
38
43
|
"app:lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
39
44
|
"app:preview": "vite preview",
|
|
45
|
+
"storybook:install": "npm ci",
|
|
40
46
|
"storybook": "storybook dev -p 6006 --no-open",
|
|
41
47
|
"storybook:build": "storybook build --output-dir dist/storybook",
|
|
42
48
|
"build": "npm run app:build; npm run storybook:build",
|