karsten-design-system 1.2.0 → 1.2.1

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/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from './stories/components/card';
9
9
  export * from './stories/components/cardButton';
10
10
  export * from './stories/components/cardIconsButton';
11
11
  export * from './stories/components/chart';
12
+ export * from './stories/components/charts';
12
13
  export * from './stories/components/dialog';
13
14
  export * from './stories/components/divider';
14
15
  export * from './stories/components/emptyContent';
package/dist/index.js CHANGED
@@ -377,6 +377,55 @@ function Chart(props) {
377
377
  return jsx(Chart$1, { ...props });
378
378
  }
379
379
 
380
+ function Charts({ type, labels, datasets, title, stacked = false, horizontal = false, legendaLateral = false, className, }) {
381
+ const chartData = {
382
+ labels,
383
+ datasets: datasets.map((ds) => ({
384
+ ...ds,
385
+ backgroundColor: ds.backgroundColor || '#13294B',
386
+ borderColor: type === 'pie' || type === 'doughnut'
387
+ ? '#fff'
388
+ : ds.borderColor || '#13294B',
389
+ tension: type === 'filledLine' || type === 'line' ? 0.4 : 0,
390
+ fill: type === 'filledLine' ? true : false,
391
+ borderRadius: 4,
392
+ })),
393
+ };
394
+ const chartType = type === 'filledLine' ? 'line' : type;
395
+ const chartOptions = {
396
+ indexAxis: horizontal ? 'y' : 'x',
397
+ plugins: {
398
+ legend: {
399
+ position: legendaLateral ? 'right' : 'top',
400
+ labels: {
401
+ color: '#495057',
402
+ usePointStyle: true,
403
+ pointStyle: 'circle',
404
+ },
405
+ },
406
+ title: title
407
+ ? {
408
+ display: true,
409
+ text: title,
410
+ }
411
+ : undefined,
412
+ },
413
+ scales: {
414
+ x: {
415
+ stacked: stacked,
416
+ ticks: { color: '#495057' },
417
+ grid: { color: '#ebedef' },
418
+ },
419
+ y: {
420
+ stacked: stacked,
421
+ ticks: { color: '#495057' },
422
+ grid: { color: '#ebedef' },
423
+ },
424
+ },
425
+ };
426
+ return (jsx(Chart$1, { type: chartType, data: chartData, options: chartOptions, className: className, "aria-label": "chart" }));
427
+ }
428
+
380
429
  function Dialog({ title, description, labelConfirmButton, onClose, onClick, }) {
381
430
  return (jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 z-20 flex justify-center items-center", children: jsxs(Card, { className: "flex flex-col", children: [jsxs("div", { className: "flex flex-row items-center justify-between px-4 pt-4 pb-6 border-b border-b-stone", children: [jsx("h2", { className: "text-primary font-semibold", children: title }), jsx("i", { className: "pi pi-times", style: { color: '#606060', cursor: 'pointer' }, onClick: onClose })] }), jsxs("div", { className: "flex flex-col items-center p-6", children: [jsx("span", { className: "text-primary", children: description }), jsxs("div", { className: "w-100 flex flex-row justify-end pt-10 gap-4", children: [jsx("div", { className: "w-1/3", children: jsx(Button, { label: "Cancelar", variant: "outline", onClick: onClose }) }), jsx("div", { className: "w-1/3", children: jsx(Button, { label: labelConfirmButton, variant: "primary", onClick: onClick }) })] })] })] }) }));
382
431
  }
@@ -4605,5 +4654,5 @@ function Toast({ messages }) {
4605
4654
  : ''), "aria-label": "toast", children: [severity === 'success' && jsx(SuccessIcon, {}), severity === 'info' && jsx(InfoIcon, {}), severity === 'error' && jsx(ErrorIcon, {}), jsxs("div", { children: [jsx("strong", { children: summary }), jsx("p", { children: detail })] })] }, id))) }));
4606
4655
  }
4607
4656
 
4608
- export { Accordion, AutoComplete, BasicHeader, Breadcrumb, Button, CalendarInput, Card, CardButton, CardIconsButton, Chart, Dialog, Divider, EmptyContent, ExpandablePanel, FileUpload, FilterButton, Header, IconButton, InfoCard, Input, InputSwitch, InputTextArea, InternalMenu, Link, MegaMenu, Modal, MultiSelect, Notification, Paginator, RadioButton, Select, Sidebar, Skeleton, Spinner, Table, Tabs, TagStatus, Toast, Tooltip };
4657
+ export { Accordion, AutoComplete, BasicHeader, Breadcrumb, Button, CalendarInput, Card, CardButton, CardIconsButton, Chart, Charts, Dialog, Divider, EmptyContent, ExpandablePanel, FileUpload, FilterButton, Header, IconButton, InfoCard, Input, InputSwitch, InputTextArea, InternalMenu, Link, MegaMenu, Modal, MultiSelect, Notification, Paginator, RadioButton, Select, Sidebar, Skeleton, Spinner, Table, Tabs, TagStatus, Toast, Tooltip };
4609
4658
  //# sourceMappingURL=index.js.map