@sbkbs/ui 1.0.3 → 1.0.4
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/components/Accordion/Accordion.js +56 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +7 -0
- package/dist/components/Alert/Alert.js +32 -0
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/Alert/Alert.stories.d.ts +8 -0
- package/dist/components/Badge/Badge.js +35 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Badge/Badge.stories.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +10 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +26 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.stories.d.ts +8 -0
- package/dist/components/Button/Button.js +122 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Card/Card.js +33 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Card/Card.stories.d.ts +8 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.js +36 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +7 -0
- package/dist/components/Chip/Chip.js +19 -0
- package/dist/components/Chip/Chip.js.map +1 -0
- package/dist/components/Combobox/Combobox.d.ts +17 -0
- package/dist/components/Combobox/Combobox.js +143 -0
- package/dist/components/Combobox/Combobox.js.map +1 -0
- package/dist/components/Combobox/Combobox.stories.d.ts +9 -0
- package/dist/components/Divider/Divider.js +22 -0
- package/dist/components/Divider/Divider.js.map +1 -0
- package/dist/components/EmptyState/EmptyState.js +29 -0
- package/dist/components/EmptyState/EmptyState.js.map +1 -0
- package/dist/components/FileUpload/FileUpload.d.ts +13 -0
- package/dist/components/FileUpload/FileUpload.js +116 -0
- package/dist/components/FileUpload/FileUpload.js.map +1 -0
- package/dist/components/FileUpload/FileUpload.stories.d.ts +10 -0
- package/dist/components/Footer/Footer.js +54 -0
- package/dist/components/Footer/Footer.js.map +1 -0
- package/dist/components/Header/Header.js +114 -0
- package/dist/components/Header/Header.js.map +1 -0
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/components/Input/Input.js +78 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Input/Input.stories.d.ts +9 -0
- package/dist/components/Layout/Layout.js +41 -0
- package/dist/components/Layout/Layout.js.map +1 -0
- package/dist/components/Modal/Modal.js +113 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/Modal.stories.d.ts +8 -0
- package/dist/components/Navigation/Navigation.js +26 -0
- package/dist/components/Navigation/Navigation.js.map +1 -0
- package/dist/components/NumberInput/NumberInput.d.ts +12 -0
- package/dist/components/NumberInput/NumberInput.js +135 -0
- package/dist/components/NumberInput/NumberInput.js.map +1 -0
- package/dist/components/NumberInput/NumberInput.stories.d.ts +8 -0
- package/dist/components/PageHeader/PageHeader.js +29 -0
- package/dist/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/components/Pagination/Pagination.js +50 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/Pagination.stories.d.ts +8 -0
- package/dist/components/Paragraph/Paragraph.js +41 -0
- package/dist/components/Paragraph/Paragraph.js.map +1 -0
- package/dist/components/Popover/Popover.js +57 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Radio/Radio.js +36 -0
- package/dist/components/Radio/Radio.js.map +1 -0
- package/dist/components/Radio/Radio.stories.d.ts +7 -0
- package/dist/components/SectionHeader/SectionHeader.js +19 -0
- package/dist/components/SectionHeader/SectionHeader.js.map +1 -0
- package/dist/components/Select/Select.d.ts +2 -2
- package/dist/components/Select/Select.js +45 -0
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Select/Select.stories.d.ts +8 -0
- package/dist/components/Skeleton/Skeleton.js +25 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/Stepper/Stepper.d.ts +13 -0
- package/dist/components/Stepper/Stepper.js +97 -0
- package/dist/components/Stepper/Stepper.js.map +1 -0
- package/dist/components/Stepper/Stepper.stories.d.ts +8 -0
- package/dist/components/Subtitle/Subtitle.js +40 -0
- package/dist/components/Subtitle/Subtitle.js.map +1 -0
- package/dist/components/Switch/Switch.d.ts +2 -2
- package/dist/components/Switch/Switch.js +37 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Switch/Switch.stories.d.ts +8 -0
- package/dist/components/Table/Table.js +17 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Tabs/Tabs.js +62 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tabs/Tabs.stories.d.ts +8 -0
- package/dist/components/Tag/Tag.js +29 -0
- package/dist/components/Tag/Tag.js.map +1 -0
- package/dist/components/Textarea/Textarea.d.ts +2 -2
- package/dist/components/Textarea/Textarea.js +46 -0
- package/dist/components/Textarea/Textarea.js.map +1 -0
- package/dist/components/Textarea/Textarea.stories.d.ts +7 -0
- package/dist/components/Title/Title.js +47 -0
- package/dist/components/Title/Title.js.map +1 -0
- package/dist/components/Toast/Toast.js +110 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/Toast/Toast.stories.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.js +36 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2925 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/oficios-ui.umd.cjs +1 -1
- package/dist/oficios-ui.umd.cjs.map +1 -1
- package/dist/theme/ThemeProvider.d.ts +1 -1
- package/dist/theme/ThemeProvider.js +22 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme.css +54 -64
- package/dist/ui.css +1 -0
- package/dist/utils/cn.d.ts +7 -1
- package/dist/utils/cn.js +7 -0
- package/dist/utils/cn.js.map +1 -0
- package/package.json +42 -9
- package/dist/oficios-ui.css +0 -1
- package/dist/oficios-ui.js +0 -1386
- package/dist/oficios-ui.js.map +0 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
+
const d = ({
|
|
3
|
+
as: t = "p",
|
|
4
|
+
size: e = "md",
|
|
5
|
+
weight: a = "normal",
|
|
6
|
+
align: i = "left",
|
|
7
|
+
muted: n = !1,
|
|
8
|
+
italic: o = !1,
|
|
9
|
+
children: r,
|
|
10
|
+
className: l = "",
|
|
11
|
+
...s
|
|
12
|
+
}) => {
|
|
13
|
+
const m = t, g = {
|
|
14
|
+
xs: "text-[var(--font-size-xs)] leading-[var(--line-height-normal)]",
|
|
15
|
+
sm: "text-[var(--font-size-sm)] leading-[var(--line-height-normal)]",
|
|
16
|
+
md: "text-[var(--font-size-base)] leading-[var(--line-height-relaxed)]",
|
|
17
|
+
lg: "text-[var(--font-size-lg)] leading-[var(--line-height-loose)]"
|
|
18
|
+
}, f = {
|
|
19
|
+
light: "font-[var(--font-weight-light)]",
|
|
20
|
+
normal: "font-[var(--font-weight-normal)]",
|
|
21
|
+
medium: "font-[var(--font-weight-medium)]"
|
|
22
|
+
}, h = {
|
|
23
|
+
left: "text-left",
|
|
24
|
+
center: "text-center",
|
|
25
|
+
right: "text-right",
|
|
26
|
+
justify: "text-justify"
|
|
27
|
+
}, x = [
|
|
28
|
+
"m-0 text-[var(--text-primary)] transition-[var(--transition-colors)]",
|
|
29
|
+
g[e],
|
|
30
|
+
f[a],
|
|
31
|
+
h[i],
|
|
32
|
+
o ? "italic" : "not-italic",
|
|
33
|
+
n ? "text-[var(--text-muted)]" : "",
|
|
34
|
+
l
|
|
35
|
+
].filter(Boolean).join(" ");
|
|
36
|
+
return /* @__PURE__ */ v(m, { className: x, ...s, children: r });
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
d as Paragraph
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=Paragraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Paragraph.js","sources":["../../../src/components/Paragraph/Paragraph.tsx"],"sourcesContent":["import type React from 'react';\n\nexport interface ParagraphProps extends React.HTMLAttributes<HTMLParagraphElement> {\n align?: 'left' | 'center' | 'right' | 'justify';\n as?: 'p' | 'span' | 'div';\n children: React.ReactNode;\n italic?: boolean;\n muted?: boolean;\n size?: 'xs' | 'sm' | 'md' | 'lg';\n weight?: 'light' | 'normal' | 'medium';\n}\n\nexport const Paragraph: React.FC<ParagraphProps> = ({\n as = 'p',\n size = 'md',\n weight = 'normal',\n align = 'left',\n muted = false,\n italic = false,\n children,\n className = '',\n ...props\n}) => {\n const Component = as;\n const sizeClassMap: Record<NonNullable<ParagraphProps['size']>, string> = {\n xs: 'text-[var(--font-size-xs)] leading-[var(--line-height-normal)]',\n sm: 'text-[var(--font-size-sm)] leading-[var(--line-height-normal)]',\n md: 'text-[var(--font-size-base)] leading-[var(--line-height-relaxed)]',\n lg: 'text-[var(--font-size-lg)] leading-[var(--line-height-loose)]',\n };\n const weightClassMap: Record<NonNullable<ParagraphProps['weight']>, string> = {\n light: 'font-[var(--font-weight-light)]',\n normal: 'font-[var(--font-weight-normal)]',\n medium: 'font-[var(--font-weight-medium)]',\n };\n const alignClassMap: Record<NonNullable<ParagraphProps['align']>, string> = {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n justify: 'text-justify',\n };\n const combinedClass = [\n 'm-0 text-[var(--text-primary)] transition-[var(--transition-colors)]',\n sizeClassMap[size],\n weightClassMap[weight],\n alignClassMap[align],\n italic ? 'italic' : 'not-italic',\n muted ? 'text-[var(--text-muted)]' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <Component className={combinedClass} {...props}>\n {children}\n </Component>\n );\n};\n"],"names":["Paragraph","as","size","weight","align","muted","italic","children","className","props","Component","sizeClassMap","weightClassMap","alignClassMap","combinedClass"],"mappings":";AAYO,MAAMA,IAAsC,CAAC;AAAA,EAClD,IAAAC,IAAK;AAAA,EACL,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,OAAAC,IAAQ;AAAA,EACR,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAYT,GACZU,IAAoE;AAAA,IACxE,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,GAEAC,IAAwE;AAAA,IAC5E,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,EAAA,GAEJC,IAAsE;AAAA,IAC1E,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,SAAS;AAAA,EAAA,GAELC,IAAgB;AAAA,IACpB;AAAA,IACAH,EAAaT,CAAI;AAAA,IACjBU,EAAeT,CAAM;AAAA,IACrBU,EAAcT,CAAK;AAAA,IACnBE,IAAS,WAAW;AAAA,IACpBD,IAAQ,6BAA6B;AAAA,IACrCG;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BACGE,GAAA,EAAU,WAAWI,GAAgB,GAAGL,GACtC,UAAAF,GACH;AAEJ;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs as v, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useRef as a, useId as x, useEffect as d } from "react";
|
|
3
|
+
import { cn as w } from "../../utils/cn.js";
|
|
4
|
+
const E = ({ children: f, content: m, defaultOpen: p = !1 }) => {
|
|
5
|
+
const [n, t] = b(p), i = a(null), c = a(null), o = a(null), l = x();
|
|
6
|
+
return d(() => {
|
|
7
|
+
const e = (s) => {
|
|
8
|
+
var r;
|
|
9
|
+
(r = i.current) != null && r.contains(s.target) || t(!1);
|
|
10
|
+
};
|
|
11
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
12
|
+
}, []), d(() => {
|
|
13
|
+
if (!n || !o.current)
|
|
14
|
+
return;
|
|
15
|
+
const e = o.current.querySelector(
|
|
16
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
17
|
+
);
|
|
18
|
+
e == null || e.focus();
|
|
19
|
+
}, [n]), d(() => {
|
|
20
|
+
const e = (s) => {
|
|
21
|
+
var r;
|
|
22
|
+
s.key === "Escape" && (t(!1), (r = c.current) == null || r.focus());
|
|
23
|
+
};
|
|
24
|
+
return n && document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
25
|
+
}, [n]), /* @__PURE__ */ v("div", { className: "relative inline-flex", ref: i, children: [
|
|
26
|
+
/* @__PURE__ */ u(
|
|
27
|
+
"button",
|
|
28
|
+
{
|
|
29
|
+
"aria-controls": n ? l : void 0,
|
|
30
|
+
"aria-expanded": n,
|
|
31
|
+
"aria-haspopup": "dialog",
|
|
32
|
+
className: "inline-flex",
|
|
33
|
+
onClick: () => t((e) => !e),
|
|
34
|
+
ref: c,
|
|
35
|
+
type: "button",
|
|
36
|
+
children: f
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
n && /* @__PURE__ */ u(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: w(
|
|
43
|
+
"absolute left-1/2 top-full z-30 mt-2 w-max -translate-x-1/2 rounded-[var(--border-radius-md)] border border-[var(--border-color)] bg-[var(--bg-secondary)] p-3 shadow-[var(--shadow-md)]"
|
|
44
|
+
),
|
|
45
|
+
id: l,
|
|
46
|
+
ref: o,
|
|
47
|
+
role: "dialog",
|
|
48
|
+
tabIndex: -1,
|
|
49
|
+
children: m
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] });
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
E as Popover
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=Popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover.js","sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import type React from 'react';\nimport { useEffect, useId, useRef, useState } from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface PopoverProps {\n children: React.ReactNode;\n content: React.ReactNode;\n defaultOpen?: boolean;\n}\n\nexport const Popover: React.FC<PopoverProps> = ({ children, content, defaultOpen = false }) => {\n const [open, setOpen] = useState(defaultOpen);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const panelRef = useRef<HTMLDivElement | null>(null);\n const popoverId = useId();\n\n useEffect(() => {\n const onClickOutside = (event: MouseEvent) => {\n if (!containerRef.current?.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n document.addEventListener('mousedown', onClickOutside);\n return () => document.removeEventListener('mousedown', onClickOutside);\n }, []);\n\n useEffect(() => {\n if (!open || !panelRef.current) {\n return;\n }\n\n const focusable = panelRef.current.querySelector<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n focusable?.focus();\n }, [open]);\n\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpen(false);\n triggerRef.current?.focus();\n }\n };\n if (open) {\n document.addEventListener('keydown', onKeyDown);\n }\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [open]);\n\n return (\n <div className=\"relative inline-flex\" ref={containerRef}>\n <button\n aria-controls={open ? popoverId : undefined}\n aria-expanded={open}\n aria-haspopup=\"dialog\"\n className=\"inline-flex\"\n onClick={() => setOpen((prev) => !prev)}\n ref={triggerRef}\n type=\"button\"\n >\n {children}\n </button>\n {open && (\n <div\n className={cn(\n 'absolute left-1/2 top-full z-30 mt-2 w-max -translate-x-1/2 rounded-[var(--border-radius-md)] border border-[var(--border-color)] bg-[var(--bg-secondary)] p-3 shadow-[var(--shadow-md)]',\n )}\n id={popoverId}\n ref={panelRef}\n role=\"dialog\"\n tabIndex={-1}\n >\n {content}\n </div>\n )}\n </div>\n );\n};\n"],"names":["Popover","children","content","defaultOpen","open","setOpen","useState","containerRef","useRef","triggerRef","panelRef","popoverId","useId","useEffect","onClickOutside","event","_a","focusable","onKeyDown","jsxs","jsx","prev","cn"],"mappings":";;;AAUO,MAAMA,IAAkC,CAAC,EAAE,UAAAC,GAAU,SAAAC,GAAS,aAAAC,IAAc,SAAY;AAC7F,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAASH,CAAW,GACtCI,IAAeC,EAA8B,IAAI,GACjDC,IAAaD,EAAiC,IAAI,GAClDE,IAAWF,EAA8B,IAAI,GAC7CG,IAAYC,EAAA;AAElB,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAiB,CAACC,MAAsB;;AAC5C,OAAKC,IAAAT,EAAa,YAAb,QAAAS,EAAsB,SAASD,EAAM,WACxCV,EAAQ,EAAK;AAAA,IAEjB;AACA,oBAAS,iBAAiB,aAAaS,CAAc,GAC9C,MAAM,SAAS,oBAAoB,aAAaA,CAAc;AAAA,EACvE,GAAG,CAAA,CAAE,GAELD,EAAU,MAAM;AACd,QAAI,CAACT,KAAQ,CAACM,EAAS;AACrB;AAGF,UAAMO,IAAYP,EAAS,QAAQ;AAAA,MACjC;AAAA,IAAA;AAEF,IAAAO,KAAA,QAAAA,EAAW;AAAA,EACb,GAAG,CAACb,CAAI,CAAC,GAETS,EAAU,MAAM;AACd,UAAMK,IAAY,CAACH,MAAyB;;AAC1C,MAAIA,EAAM,QAAQ,aAChBV,EAAQ,EAAK,IACbW,IAAAP,EAAW,YAAX,QAAAO,EAAoB;AAAA,IAExB;AACA,WAAIZ,KACF,SAAS,iBAAiB,WAAWc,CAAS,GAEzC,MAAM,SAAS,oBAAoB,WAAWA,CAAS;AAAA,EAChE,GAAG,CAACd,CAAI,CAAC,GAGP,gBAAAe,EAAC,OAAA,EAAI,WAAU,wBAAuB,KAAKZ,GACzC,UAAA;AAAA,IAAA,gBAAAa;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,iBAAehB,IAAOO,IAAY;AAAA,QAClC,iBAAeP;AAAA,QACf,iBAAc;AAAA,QACd,WAAU;AAAA,QACV,SAAS,MAAMC,EAAQ,CAACgB,MAAS,CAACA,CAAI;AAAA,QACtC,KAAKZ;AAAA,QACL,MAAK;AAAA,QAEJ,UAAAR;AAAA,MAAA;AAAA,IAAA;AAAA,IAEFG,KACC,gBAAAgB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWE;AAAA,UACT;AAAA,QAAA;AAAA,QAEF,IAAIX;AAAA,QACJ,KAAKD;AAAA,QACL,MAAK;AAAA,QACL,UAAU;AAAA,QAET,UAAAR;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAEJ;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
3
3
|
helperText?: string;
|
|
4
4
|
label?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const Radio: React.
|
|
6
|
+
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import m from "react";
|
|
3
|
+
import { cn as c } from "../../utils/cn.js";
|
|
4
|
+
const d = m.forwardRef(
|
|
5
|
+
({ label: t, helperText: e, className: s, id: o, ...n }, l) => {
|
|
6
|
+
const i = o || `radio-${Math.random().toString(36).slice(2, 9)}`;
|
|
7
|
+
return /* @__PURE__ */ a(
|
|
8
|
+
"label",
|
|
9
|
+
{
|
|
10
|
+
className: c("inline-flex cursor-pointer items-start gap-2", s),
|
|
11
|
+
htmlFor: i,
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ r(
|
|
14
|
+
"input",
|
|
15
|
+
{
|
|
16
|
+
ref: l,
|
|
17
|
+
className: "mt-0.5 h-4 w-4 border-[var(--md-outline-variant)] bg-[var(--md-surface)] text-[var(--md-primary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--border-color-focus)]",
|
|
18
|
+
id: i,
|
|
19
|
+
type: "radio",
|
|
20
|
+
...n
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ a("span", { className: "grid gap-0.5", children: [
|
|
24
|
+
t && /* @__PURE__ */ r("span", { className: "text-sm text-[var(--text-primary)]", children: t }),
|
|
25
|
+
e && /* @__PURE__ */ r("span", { className: "text-xs text-[var(--text-muted)]", children: e })
|
|
26
|
+
] })
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
d.displayName = "Radio";
|
|
33
|
+
export {
|
|
34
|
+
d as Radio
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=Radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {\n helperText?: string;\n label?: string;\n}\n\nexport const Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n ({ label, helperText, className, id, ...props }, ref) => {\n const inputId = id || `radio-${Math.random().toString(36).slice(2, 9)}`;\n\n return (\n <label\n className={cn('inline-flex cursor-pointer items-start gap-2', className)}\n htmlFor={inputId}\n >\n <input\n ref={ref}\n className=\"mt-0.5 h-4 w-4 border-[var(--md-outline-variant)] bg-[var(--md-surface)] text-[var(--md-primary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--border-color-focus)]\"\n id={inputId}\n type=\"radio\"\n {...props}\n />\n <span className=\"grid gap-0.5\">\n {label && <span className=\"text-sm text-[var(--text-primary)]\">{label}</span>}\n {helperText && <span className=\"text-xs text-[var(--text-muted)]\">{helperText}</span>}\n </span>\n </label>\n );\n },\n);\n\nRadio.displayName = 'Radio';\n"],"names":["Radio","React","label","helperText","className","id","props","ref","inputId","jsxs","cn","jsx"],"mappings":";;;AAQO,MAAMA,IAAQC,EAAM;AAAA,EACzB,CAAC,EAAE,OAAAC,GAAO,YAAAC,GAAY,WAAAC,GAAW,IAAAC,GAAI,GAAGC,EAAA,GAASC,MAAQ;AACvD,UAAMC,IAAUH,KAAM,SAAS,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;AAErE,WACE,gBAAAI;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC,EAAG,gDAAgDN,CAAS;AAAA,QACvE,SAASI;AAAA,QAET,UAAA;AAAA,UAAA,gBAAAG;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAAJ;AAAA,cACA,WAAU;AAAA,cACV,IAAIC;AAAA,cACJ,MAAK;AAAA,cACJ,GAAGF;AAAA,YAAA;AAAA,UAAA;AAAA,UAEN,gBAAAG,EAAC,QAAA,EAAK,WAAU,gBACb,UAAA;AAAA,YAAAP,KAAS,gBAAAS,EAAC,QAAA,EAAK,WAAU,sCAAsC,UAAAT,GAAM;AAAA,YACrEC,KAAc,gBAAAQ,EAAC,QAAA,EAAK,WAAU,oCAAoC,UAAAR,EAAA,CAAW;AAAA,UAAA,EAAA,CAChF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAH,EAAM,cAAc;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Radio } from './Radio';
|
|
3
|
+
declare const meta: Meta<typeof Radio>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Radio>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Group: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as c } from "../../utils/cn.js";
|
|
3
|
+
const d = ({
|
|
4
|
+
title: a,
|
|
5
|
+
subtitle: t,
|
|
6
|
+
actions: r,
|
|
7
|
+
className: i,
|
|
8
|
+
...m
|
|
9
|
+
}) => /* @__PURE__ */ s("div", { className: c("flex items-start justify-between gap-4", i), ...m, children: [
|
|
10
|
+
/* @__PURE__ */ s("div", { className: "grid gap-1", children: [
|
|
11
|
+
/* @__PURE__ */ e("h2", { className: "m-0 text-xl font-semibold text-[var(--text-primary)]", children: a }),
|
|
12
|
+
t && /* @__PURE__ */ e("p", { className: "m-0 text-sm text-[var(--text-secondary)]", children: t })
|
|
13
|
+
] }),
|
|
14
|
+
r && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-2", children: r })
|
|
15
|
+
] });
|
|
16
|
+
export {
|
|
17
|
+
d as SectionHeader
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=SectionHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionHeader.js","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"sourcesContent":["import type React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface SectionHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n actions?: React.ReactNode;\n subtitle?: React.ReactNode;\n title: React.ReactNode;\n}\n\nexport const SectionHeader: React.FC<SectionHeaderProps> = ({\n title,\n subtitle,\n actions,\n className,\n ...props\n}) => {\n return (\n <div className={cn('flex items-start justify-between gap-4', className)} {...props}>\n <div className=\"grid gap-1\">\n <h2 className=\"m-0 text-xl font-semibold text-[var(--text-primary)]\">{title}</h2>\n {subtitle && <p className=\"m-0 text-sm text-[var(--text-secondary)]\">{subtitle}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n );\n};\n"],"names":["SectionHeader","title","subtitle","actions","className","props","jsxs","cn","jsx"],"mappings":";;AASO,MAAMA,IAA8C,CAAC;AAAA,EAC1D,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC,EAAC,SAAI,WAAWC,EAAG,0CAA0CH,CAAS,GAAI,GAAGC,GAC3E,UAAA;AAAA,EAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,cACb,UAAA;AAAA,IAAA,gBAAAE,EAAC,MAAA,EAAG,WAAU,wDAAwD,UAAAP,GAAM;AAAA,IAC3EC,KAAY,gBAAAM,EAAC,KAAA,EAAE,WAAU,4CAA4C,UAAAN,EAAA,CAAS;AAAA,EAAA,GACjF;AAAA,EACCC,KAAW,gBAAAK,EAAC,OAAA,EAAI,WAAU,oCAAoC,UAAAL,EAAA,CAAQ;AAAA,GACzE;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface SelectOption {
|
|
3
3
|
label: string;
|
|
4
4
|
value: string;
|
|
@@ -10,4 +10,4 @@ export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectE
|
|
|
10
10
|
options: SelectOption[];
|
|
11
11
|
size?: 'sm' | 'md' | 'lg';
|
|
12
12
|
}
|
|
13
|
-
export declare const Select: React.
|
|
13
|
+
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs as u, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import x from "react";
|
|
3
|
+
import { cn as b } from "../../utils/cn.js";
|
|
4
|
+
const f = x.forwardRef(
|
|
5
|
+
({ label: d, helperText: t, error: r, options: o, size: i = "md", className: l, id: n, ...c }, m) => {
|
|
6
|
+
const e = n || `select-${Math.random().toString(36).slice(2, 9)}`, v = {
|
|
7
|
+
sm: "min-h-8 px-3 py-1.5 text-sm",
|
|
8
|
+
md: "min-h-10 px-3.5 py-2 text-base",
|
|
9
|
+
lg: "min-h-12 px-4 py-3 text-lg"
|
|
10
|
+
}[i];
|
|
11
|
+
return /* @__PURE__ */ u("div", { className: "grid gap-1", children: [
|
|
12
|
+
d && /* @__PURE__ */ a(
|
|
13
|
+
"label",
|
|
14
|
+
{
|
|
15
|
+
className: "text-[var(--font-size-sm)] font-[var(--font-weight-semibold)] text-[var(--md-on-surface)]",
|
|
16
|
+
htmlFor: e,
|
|
17
|
+
children: d
|
|
18
|
+
}
|
|
19
|
+
),
|
|
20
|
+
/* @__PURE__ */ a(
|
|
21
|
+
"select",
|
|
22
|
+
{
|
|
23
|
+
ref: m,
|
|
24
|
+
"aria-describedby": r ? `${e}-error` : t ? `${e}-helper` : void 0,
|
|
25
|
+
"aria-invalid": r ? !0 : void 0,
|
|
26
|
+
className: b(
|
|
27
|
+
"w-full rounded-[var(--border-radius-md)] border border-[var(--md-outline-variant)] bg-[var(--md-surface)] text-[var(--md-on-surface)] outline-none transition focus:border-[var(--border-color-focus)] focus:[box-shadow:0_0_0_0.1875rem_rgba(47,93,140,0.15)] disabled:cursor-not-allowed disabled:opacity-60",
|
|
28
|
+
r && "border-[var(--md-error)]",
|
|
29
|
+
v,
|
|
30
|
+
l
|
|
31
|
+
),
|
|
32
|
+
id: e,
|
|
33
|
+
...c,
|
|
34
|
+
children: o.map((s) => /* @__PURE__ */ a("option", { value: s.value, children: s.label }, s.value))
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
r ? /* @__PURE__ */ a("span", { className: "text-xs text-[var(--md-error)]", id: `${e}-error`, role: "alert", children: r }) : t && /* @__PURE__ */ a("span", { className: "text-xs text-[var(--md-on-surface-variant)]", id: `${e}-helper`, children: t })
|
|
38
|
+
] });
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
f.displayName = "Select";
|
|
42
|
+
export {
|
|
43
|
+
f as Select
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface SelectOption {\n label: string;\n value: string;\n}\n\nexport interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {\n error?: string;\n helperText?: string;\n label?: string;\n options: SelectOption[];\n size?: 'sm' | 'md' | 'lg';\n}\n\nexport const Select = React.forwardRef<HTMLSelectElement, SelectProps>(\n ({ label, helperText, error, options, size = 'md', className, id, ...props }, ref) => {\n const selectId = id || `select-${Math.random().toString(36).slice(2, 9)}`;\n\n const sizeClass = {\n sm: 'min-h-8 px-3 py-1.5 text-sm',\n md: 'min-h-10 px-3.5 py-2 text-base',\n lg: 'min-h-12 px-4 py-3 text-lg',\n }[size];\n\n return (\n <div className=\"grid gap-1\">\n {label && (\n <label\n className=\"text-[var(--font-size-sm)] font-[var(--font-weight-semibold)] text-[var(--md-on-surface)]\"\n htmlFor={selectId}\n >\n {label}\n </label>\n )}\n <select\n ref={ref}\n aria-describedby={\n error ? `${selectId}-error` : helperText ? `${selectId}-helper` : undefined\n }\n aria-invalid={error ? true : undefined}\n className={cn(\n 'w-full rounded-[var(--border-radius-md)] border border-[var(--md-outline-variant)] bg-[var(--md-surface)] text-[var(--md-on-surface)] outline-none transition focus:border-[var(--border-color-focus)] focus:[box-shadow:0_0_0_0.1875rem_rgba(47,93,140,0.15)] disabled:cursor-not-allowed disabled:opacity-60',\n error && 'border-[var(--md-error)]',\n sizeClass,\n className,\n )}\n id={selectId}\n {...props}\n >\n {options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n {error ? (\n <span className=\"text-xs text-[var(--md-error)]\" id={`${selectId}-error`} role=\"alert\">\n {error}\n </span>\n ) : (\n helperText && (\n <span className=\"text-xs text-[var(--md-on-surface-variant)]\" id={`${selectId}-helper`}>\n {helperText}\n </span>\n )\n )}\n </div>\n );\n },\n);\n\nSelect.displayName = 'Select';\n"],"names":["Select","React","label","helperText","error","options","size","className","id","props","ref","selectId","sizeClass","jsxs","jsx","cn","option"],"mappings":";;;AAgBO,MAAMA,IAASC,EAAM;AAAA,EAC1B,CAAC,EAAE,OAAAC,GAAO,YAAAC,GAAY,OAAAC,GAAO,SAAAC,GAAS,MAAAC,IAAO,MAAM,WAAAC,GAAW,IAAAC,GAAI,GAAGC,EAAA,GAASC,MAAQ;AACpF,UAAMC,IAAWH,KAAM,UAAU,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC,IAEjEI,IAAY;AAAA,MAChB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,EACJN,CAAI;AAEN,WACE,gBAAAO,EAAC,OAAA,EAAI,WAAU,cACZ,UAAA;AAAA,MAAAX,KACC,gBAAAY;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,SAASH;AAAA,UAER,UAAAT;AAAA,QAAA;AAAA,MAAA;AAAA,MAGL,gBAAAY;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,KAAAJ;AAAA,UACA,oBACEN,IAAQ,GAAGO,CAAQ,WAAWR,IAAa,GAAGQ,CAAQ,YAAY;AAAA,UAEpE,gBAAcP,IAAQ,KAAO;AAAA,UAC7B,WAAWW;AAAA,YACT;AAAA,YACAX,KAAS;AAAA,YACTQ;AAAA,YACAL;AAAA,UAAA;AAAA,UAEF,IAAII;AAAA,UACH,GAAGF;AAAA,UAEH,UAAAJ,EAAQ,IAAI,CAACW,MACZ,gBAAAF,EAAC,UAAA,EAA0B,OAAOE,EAAO,OACtC,UAAAA,EAAO,MAAA,GADGA,EAAO,KAEpB,CACD;AAAA,QAAA;AAAA,MAAA;AAAA,MAEFZ,sBACE,QAAA,EAAK,WAAU,kCAAiC,IAAI,GAAGO,CAAQ,UAAU,MAAK,SAC5E,aACH,IAEAR,uBACG,QAAA,EAAK,WAAU,+CAA8C,IAAI,GAAGQ,CAAQ,WAC1E,UAAAR,EAAA,CACH;AAAA,IAAA,GAGN;AAAA,EAEJ;AACF;AAEAH,EAAO,cAAc;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Select } from './Select';
|
|
3
|
+
declare const meta: Meta<typeof Select>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Select>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const States: Story;
|
|
8
|
+
export declare const Sizes: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as d } from "../../utils/cn.js";
|
|
3
|
+
const l = ({
|
|
4
|
+
circle: r = !1,
|
|
5
|
+
width: e,
|
|
6
|
+
height: o,
|
|
7
|
+
className: a,
|
|
8
|
+
style: s,
|
|
9
|
+
...n
|
|
10
|
+
}) => /* @__PURE__ */ t(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: d(
|
|
14
|
+
"animate-pulse bg-[var(--md-surface-container-high)]",
|
|
15
|
+
r ? "rounded-full" : "rounded-[var(--border-radius-sm)]",
|
|
16
|
+
a
|
|
17
|
+
),
|
|
18
|
+
style: { width: e, height: o, ...s },
|
|
19
|
+
...n
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
export {
|
|
23
|
+
l as Skeleton
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.js","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import type React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n circle?: boolean;\n height?: string;\n width?: string;\n}\n\nexport const Skeleton: React.FC<SkeletonProps> = ({\n circle = false,\n width,\n height,\n className,\n style,\n ...props\n}) => {\n return (\n <div\n className={cn(\n 'animate-pulse bg-[var(--md-surface-container-high)]',\n circle ? 'rounded-full' : 'rounded-[var(--border-radius-sm)]',\n className,\n )}\n style={{ width, height, ...style }}\n {...props}\n />\n );\n};\n"],"names":["Skeleton","circle","width","height","className","style","props","jsx","cn"],"mappings":";;AASO,MAAMA,IAAoC,CAAC;AAAA,EAChD,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAP,IAAS,iBAAiB;AAAA,MAC1BG;AAAA,IAAA;AAAA,IAEF,OAAO,EAAE,OAAAF,GAAO,QAAAC,GAAQ,GAAGE,EAAA;AAAA,IAC1B,GAAGC;AAAA,EAAA;AAAA;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface StepperItem {
|
|
3
|
+
description?: string;
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export type StepStatus = 'completed' | 'active' | 'pending';
|
|
8
|
+
export interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
currentStep: string;
|
|
10
|
+
items: StepperItem[];
|
|
11
|
+
orientation?: 'horizontal' | 'vertical';
|
|
12
|
+
}
|
|
13
|
+
export declare const Stepper: React.FC<StepperProps>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { cn as a } from "../../utils/cn.js";
|
|
3
|
+
const f = ({
|
|
4
|
+
items: n,
|
|
5
|
+
currentStep: o,
|
|
6
|
+
orientation: m = "horizontal",
|
|
7
|
+
className: c,
|
|
8
|
+
...p
|
|
9
|
+
}) => {
|
|
10
|
+
const s = n.findIndex((e) => e.id === o), v = (e) => e < s ? "completed" : e === s ? "active" : "pending", i = m === "horizontal";
|
|
11
|
+
return /* @__PURE__ */ r(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
"aria-label": "Progresso",
|
|
15
|
+
className: a(i ? "flex items-start" : "flex flex-col", c),
|
|
16
|
+
role: "list",
|
|
17
|
+
...p,
|
|
18
|
+
children: n.map((e, l) => {
|
|
19
|
+
const t = v(l), x = l === n.length - 1;
|
|
20
|
+
return /* @__PURE__ */ d(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
className: a("flex", i ? "flex-1 flex-col items-center" : "gap-4"),
|
|
24
|
+
role: "listitem",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ d(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: a(
|
|
30
|
+
i ? "flex w-full items-center" : "flex flex-col items-center"
|
|
31
|
+
),
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ r(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
"aria-current": t === "active" ? "step" : void 0,
|
|
37
|
+
className: a(
|
|
38
|
+
"relative z-10 flex h-9 w-9 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition",
|
|
39
|
+
t === "completed" && "border-[var(--md-primary)] bg-[var(--md-primary)] text-[var(--md-on-primary)]",
|
|
40
|
+
t === "active" && "border-[var(--md-primary)] bg-[var(--md-surface)] text-[var(--md-primary)]",
|
|
41
|
+
t === "pending" && "border-[var(--md-outline-variant)] bg-[var(--md-surface)] text-[var(--text-muted)]"
|
|
42
|
+
),
|
|
43
|
+
children: t === "completed" ? /* @__PURE__ */ r(
|
|
44
|
+
"svg",
|
|
45
|
+
{
|
|
46
|
+
className: "h-4 w-4",
|
|
47
|
+
fill: "none",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
strokeWidth: "2.5",
|
|
50
|
+
viewBox: "0 0 24 24",
|
|
51
|
+
children: /* @__PURE__ */ r("path", { d: "M20 6 9 17l-5-5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
52
|
+
}
|
|
53
|
+
) : l + 1
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
!x && /* @__PURE__ */ r(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: a(
|
|
60
|
+
"transition",
|
|
61
|
+
i ? "h-0.5 flex-1" : "my-1 ml-[1.0625rem] w-0.5 flex-1",
|
|
62
|
+
l < s ? "bg-[var(--md-primary)]" : "bg-[var(--md-outline-variant)]"
|
|
63
|
+
),
|
|
64
|
+
"aria-hidden": "true"
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ d("div", { className: a("mt-2 text-center", i ? "" : "mt-0 pb-6 text-left"), children: [
|
|
71
|
+
/* @__PURE__ */ r(
|
|
72
|
+
"p",
|
|
73
|
+
{
|
|
74
|
+
className: a(
|
|
75
|
+
"text-sm font-medium leading-tight",
|
|
76
|
+
t === "active" && "text-[var(--md-primary)]",
|
|
77
|
+
t === "completed" && "text-[var(--text-primary)]",
|
|
78
|
+
t === "pending" && "text-[var(--text-muted)]"
|
|
79
|
+
),
|
|
80
|
+
children: e.label
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
e.description && /* @__PURE__ */ r("p", { className: "mt-0.5 text-xs text-[var(--text-muted)]", children: e.description })
|
|
84
|
+
] })
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
e.id
|
|
88
|
+
);
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
f.displayName = "Stepper";
|
|
94
|
+
export {
|
|
95
|
+
f as Stepper
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=Stepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.js","sources":["../../../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface StepperItem {\n description?: string;\n id: string;\n label: string;\n}\n\nexport type StepStatus = 'completed' | 'active' | 'pending';\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n currentStep: string;\n items: StepperItem[];\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport const Stepper: React.FC<StepperProps> = ({\n items,\n currentStep,\n orientation = 'horizontal',\n className,\n ...props\n}) => {\n const currentIndex = items.findIndex((item) => item.id === currentStep);\n\n const getStatus = (index: number): StepStatus => {\n if (index < currentIndex) return 'completed';\n if (index === currentIndex) return 'active';\n return 'pending';\n };\n\n const isHorizontal = orientation === 'horizontal';\n\n return (\n <div\n aria-label=\"Progresso\"\n className={cn(isHorizontal ? 'flex items-start' : 'flex flex-col', className)}\n role=\"list\"\n {...props}\n >\n {items.map((item, index) => {\n const status = getStatus(index);\n const isLast = index === items.length - 1;\n\n return (\n <div\n key={item.id}\n className={cn('flex', isHorizontal ? 'flex-1 flex-col items-center' : 'gap-4')}\n role=\"listitem\"\n >\n {/* Step indicator + connector */}\n <div\n className={cn(\n isHorizontal ? 'flex w-full items-center' : 'flex flex-col items-center',\n )}\n >\n {/* Circle */}\n <div\n aria-current={status === 'active' ? 'step' : undefined}\n className={cn(\n 'relative z-10 flex h-9 w-9 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition',\n status === 'completed' &&\n 'border-[var(--md-primary)] bg-[var(--md-primary)] text-[var(--md-on-primary)]',\n status === 'active' &&\n 'border-[var(--md-primary)] bg-[var(--md-surface)] text-[var(--md-primary)]',\n status === 'pending' &&\n 'border-[var(--md-outline-variant)] bg-[var(--md-surface)] text-[var(--text-muted)]',\n )}\n >\n {status === 'completed' ? (\n <svg\n className=\"h-4 w-4\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M20 6 9 17l-5-5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n ) : (\n index + 1\n )}\n </div>\n\n {/* Connector line */}\n {!isLast && (\n <div\n className={cn(\n 'transition',\n isHorizontal ? 'h-0.5 flex-1' : 'my-1 ml-[1.0625rem] w-0.5 flex-1',\n index < currentIndex\n ? 'bg-[var(--md-primary)]'\n : 'bg-[var(--md-outline-variant)]',\n )}\n aria-hidden=\"true\"\n />\n )}\n </div>\n\n {/* Label + description */}\n <div className={cn('mt-2 text-center', isHorizontal ? '' : 'mt-0 pb-6 text-left')}>\n <p\n className={cn(\n 'text-sm font-medium leading-tight',\n status === 'active' && 'text-[var(--md-primary)]',\n status === 'completed' && 'text-[var(--text-primary)]',\n status === 'pending' && 'text-[var(--text-muted)]',\n )}\n >\n {item.label}\n </p>\n {item.description && (\n <p className=\"mt-0.5 text-xs text-[var(--text-muted)]\">{item.description}</p>\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nStepper.displayName = 'Stepper';\n"],"names":["Stepper","items","currentStep","orientation","className","props","currentIndex","item","getStatus","index","isHorizontal","jsx","cn","status","isLast","jsxs"],"mappings":";;AAiBO,MAAMA,IAAkC,CAAC;AAAA,EAC9C,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,WAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAeL,EAAM,UAAU,CAACM,MAASA,EAAK,OAAOL,CAAW,GAEhEM,IAAY,CAACC,MACbA,IAAQH,IAAqB,cAC7BG,MAAUH,IAAqB,WAC5B,WAGHI,IAAeP,MAAgB;AAErC,SACE,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,cAAW;AAAA,MACX,WAAWC,EAAGF,IAAe,qBAAqB,iBAAiBN,CAAS;AAAA,MAC5E,MAAK;AAAA,MACJ,GAAGC;AAAA,MAEH,UAAAJ,EAAM,IAAI,CAACM,GAAME,MAAU;AAC1B,cAAMI,IAASL,EAAUC,CAAK,GACxBK,IAASL,MAAUR,EAAM,SAAS;AAExC,eACE,gBAAAc;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAWH,EAAG,QAAQF,IAAe,iCAAiC,OAAO;AAAA,YAC7E,MAAK;AAAA,YAGL,UAAA;AAAA,cAAA,gBAAAK;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWH;AAAA,oBACTF,IAAe,6BAA6B;AAAA,kBAAA;AAAA,kBAI9C,UAAA;AAAA,oBAAA,gBAAAC;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,gBAAcE,MAAW,WAAW,SAAS;AAAA,wBAC7C,WAAWD;AAAA,0BACT;AAAA,0BACAC,MAAW,eACT;AAAA,0BACFA,MAAW,YACT;AAAA,0BACFA,MAAW,aACT;AAAA,wBAAA;AAAA,wBAGH,gBAAW,cACV,gBAAAF;AAAA,0BAAC;AAAA,0BAAA;AAAA,4BACC,WAAU;AAAA,4BACV,MAAK;AAAA,4BACL,QAAO;AAAA,4BACP,aAAY;AAAA,4BACZ,SAAQ;AAAA,4BAER,4BAAC,QAAA,EAAK,GAAE,mBAAkB,eAAc,SAAQ,gBAAe,QAAA,CAAQ;AAAA,0BAAA;AAAA,wBAAA,IAGzEF,IAAQ;AAAA,sBAAA;AAAA,oBAAA;AAAA,oBAKX,CAACK,KACA,gBAAAH;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,WAAWC;AAAA,0BACT;AAAA,0BACAF,IAAe,iBAAiB;AAAA,0BAChCD,IAAQH,IACJ,2BACA;AAAA,wBAAA;AAAA,wBAEN,eAAY;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACd;AAAA,gBAAA;AAAA,cAAA;AAAA,cAKJ,gBAAAS,EAAC,SAAI,WAAWH,EAAG,oBAAoBF,IAAe,KAAK,qBAAqB,GAC9E,UAAA;AAAA,gBAAA,gBAAAC;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAWC;AAAA,sBACT;AAAA,sBACAC,MAAW,YAAY;AAAA,sBACvBA,MAAW,eAAe;AAAA,sBAC1BA,MAAW,aAAa;AAAA,oBAAA;AAAA,oBAGzB,UAAAN,EAAK;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAEPA,EAAK,eACJ,gBAAAI,EAAC,OAAE,WAAU,2CAA2C,YAAK,YAAA,CAAY;AAAA,cAAA,EAAA,CAE7E;AAAA,YAAA;AAAA,UAAA;AAAA,UApEKJ,EAAK;AAAA,QAAA;AAAA,MAuEhB,CAAC;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAP,EAAQ,cAAc;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Stepper } from './Stepper';
|
|
3
|
+
declare const meta: Meta<typeof Stepper>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Stepper>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Controlled: Story;
|
|
8
|
+
export declare const Vertical: Story;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
+
const h = ({
|
|
3
|
+
as: t = "p",
|
|
4
|
+
size: e = "md",
|
|
5
|
+
weight: o = "normal",
|
|
6
|
+
align: n = "left",
|
|
7
|
+
muted: a = !1,
|
|
8
|
+
italic: s = !1,
|
|
9
|
+
children: i,
|
|
10
|
+
className: r = "",
|
|
11
|
+
...l
|
|
12
|
+
}) => {
|
|
13
|
+
const m = t, f = {
|
|
14
|
+
xs: "text-[var(--font-size-xs)]",
|
|
15
|
+
sm: "text-[var(--font-size-sm)]",
|
|
16
|
+
md: "text-[var(--font-size-base)]",
|
|
17
|
+
lg: "text-[var(--font-size-lg)]"
|
|
18
|
+
}, c = {
|
|
19
|
+
normal: "font-[var(--font-weight-normal)]",
|
|
20
|
+
medium: "font-[var(--font-weight-medium)]",
|
|
21
|
+
semibold: "font-[var(--font-weight-semibold)]"
|
|
22
|
+
}, x = {
|
|
23
|
+
left: "text-left",
|
|
24
|
+
center: "text-center",
|
|
25
|
+
right: "text-right"
|
|
26
|
+
}, g = [
|
|
27
|
+
"m-0 leading-[var(--line-height-normal)] text-[var(--text-secondary)] transition-[var(--transition-colors)]",
|
|
28
|
+
f[e],
|
|
29
|
+
c[o],
|
|
30
|
+
x[n],
|
|
31
|
+
s ? "italic" : "not-italic",
|
|
32
|
+
a ? "text-[var(--text-muted)] opacity-80" : "",
|
|
33
|
+
r
|
|
34
|
+
].filter(Boolean).join(" ");
|
|
35
|
+
return /* @__PURE__ */ v(m, { className: g, ...l, children: i });
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
h as Subtitle
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=Subtitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Subtitle.js","sources":["../../../src/components/Subtitle/Subtitle.tsx"],"sourcesContent":["import type React from 'react';\n\nexport interface SubtitleProps extends React.HTMLAttributes<HTMLParagraphElement> {\n align?: 'left' | 'center' | 'right';\n as?: 'p' | 'span' | 'div';\n children: React.ReactNode;\n italic?: boolean;\n muted?: boolean;\n size?: 'xs' | 'sm' | 'md' | 'lg';\n weight?: 'normal' | 'medium' | 'semibold';\n}\n\nexport const Subtitle: React.FC<SubtitleProps> = ({\n as = 'p',\n size = 'md',\n weight = 'normal',\n align = 'left',\n muted = false,\n italic = false,\n children,\n className = '',\n ...props\n}) => {\n const Component = as;\n const sizeClassMap: Record<NonNullable<SubtitleProps['size']>, string> = {\n xs: 'text-[var(--font-size-xs)]',\n sm: 'text-[var(--font-size-sm)]',\n md: 'text-[var(--font-size-base)]',\n lg: 'text-[var(--font-size-lg)]',\n };\n const weightClassMap: Record<NonNullable<SubtitleProps['weight']>, string> = {\n normal: 'font-[var(--font-weight-normal)]',\n medium: 'font-[var(--font-weight-medium)]',\n semibold: 'font-[var(--font-weight-semibold)]',\n };\n const alignClassMap: Record<NonNullable<SubtitleProps['align']>, string> = {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n };\n const combinedClass = [\n 'm-0 leading-[var(--line-height-normal)] text-[var(--text-secondary)] transition-[var(--transition-colors)]',\n sizeClassMap[size],\n weightClassMap[weight],\n alignClassMap[align],\n italic ? 'italic' : 'not-italic',\n muted ? 'text-[var(--text-muted)] opacity-80' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <Component className={combinedClass} {...props}>\n {children}\n </Component>\n );\n};\n"],"names":["Subtitle","as","size","weight","align","muted","italic","children","className","props","Component","sizeClassMap","weightClassMap","alignClassMap","combinedClass"],"mappings":";AAYO,MAAMA,IAAoC,CAAC;AAAA,EAChD,IAAAC,IAAK;AAAA,EACL,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,OAAAC,IAAQ;AAAA,EACR,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAYT,GACZU,IAAmE;AAAA,IACvE,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,GAEAC,IAAuE;AAAA,IAC3E,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,EAAA,GAENC,IAAqE;AAAA,IACzE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,EAAA,GAEHC,IAAgB;AAAA,IACpB;AAAA,IACAH,EAAaT,CAAI;AAAA,IACjBU,EAAeT,CAAM;AAAA,IACrBU,EAAcT,CAAK;AAAA,IACnBE,IAAS,WAAW;AAAA,IACpBD,IAAQ,wCAAwC;AAAA,IAChDG;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BACGE,GAAA,EAAU,WAAWI,GAAgB,GAAGL,GACtC,UAAAF,GACH;AAEJ;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
|
|
3
3
|
checked?: boolean;
|
|
4
4
|
label?: string;
|
|
5
5
|
onCheckedChange?: (checked: boolean) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare const Switch: React.
|
|
7
|
+
export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import m from "react";
|
|
3
|
+
import { cn as s } from "../../utils/cn.js";
|
|
4
|
+
const f = m.forwardRef(
|
|
5
|
+
({ checked: r = !1, onCheckedChange: i, label: e, className: a, ...o }, l) => /* @__PURE__ */ n("div", { className: s("inline-flex items-center gap-2", a), children: [
|
|
6
|
+
/* @__PURE__ */ t(
|
|
7
|
+
"button",
|
|
8
|
+
{
|
|
9
|
+
ref: l,
|
|
10
|
+
"aria-checked": r,
|
|
11
|
+
className: s(
|
|
12
|
+
"relative inline-flex h-6 w-11 items-center rounded-full border transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--border-color-focus)]",
|
|
13
|
+
r ? "border-[var(--md-primary)] bg-[var(--md-primary)]" : "border-[var(--md-outline)] bg-[var(--md-surface-container-high)]"
|
|
14
|
+
),
|
|
15
|
+
onClick: () => i == null ? void 0 : i(!r),
|
|
16
|
+
role: "switch",
|
|
17
|
+
type: "button",
|
|
18
|
+
...o,
|
|
19
|
+
children: /* @__PURE__ */ t(
|
|
20
|
+
"span",
|
|
21
|
+
{
|
|
22
|
+
className: s(
|
|
23
|
+
"inline-block h-5 w-5 rounded-full bg-[var(--md-surface)] shadow transition",
|
|
24
|
+
r ? "translate-x-5" : "translate-x-0.5"
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
e && /* @__PURE__ */ t("span", { className: "text-sm text-[var(--text-primary)]", children: e })
|
|
31
|
+
] })
|
|
32
|
+
);
|
|
33
|
+
f.displayName = "Switch";
|
|
34
|
+
export {
|
|
35
|
+
f as Switch
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface SwitchProps extends Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'onChange'\n> {\n checked?: boolean;\n label?: string;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport const Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(\n ({ checked = false, onCheckedChange, label, className, ...props }, ref) => {\n return (\n <div className={cn('inline-flex items-center gap-2', className)}>\n <button\n ref={ref}\n aria-checked={checked}\n className={cn(\n 'relative inline-flex h-6 w-11 items-center rounded-full border transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--border-color-focus)]',\n checked\n ? 'border-[var(--md-primary)] bg-[var(--md-primary)]'\n : 'border-[var(--md-outline)] bg-[var(--md-surface-container-high)]',\n )}\n onClick={() => onCheckedChange?.(!checked)}\n role=\"switch\"\n type=\"button\"\n {...props}\n >\n <span\n className={cn(\n 'inline-block h-5 w-5 rounded-full bg-[var(--md-surface)] shadow transition',\n checked ? 'translate-x-5' : 'translate-x-0.5',\n )}\n />\n </button>\n {label && <span className=\"text-sm text-[var(--text-primary)]\">{label}</span>}\n </div>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\n"],"names":["Switch","React","checked","onCheckedChange","label","className","props","ref","cn","jsx"],"mappings":";;;AAYO,MAAMA,IAASC,EAAM;AAAA,EAC1B,CAAC,EAAE,SAAAC,IAAU,IAAO,iBAAAC,GAAiB,OAAAC,GAAO,WAAAC,GAAW,GAAGC,EAAA,GAASC,wBAE9D,OAAA,EAAI,WAAWC,EAAG,kCAAkCH,CAAS,GAC5D,UAAA;AAAA,IAAA,gBAAAI;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAF;AAAA,QACA,gBAAcL;AAAA,QACd,WAAWM;AAAA,UACT;AAAA,UACAN,IACI,sDACA;AAAA,QAAA;AAAA,QAEN,SAAS,MAAMC,KAAA,gBAAAA,EAAkB,CAACD;AAAA,QAClC,MAAK;AAAA,QACL,MAAK;AAAA,QACJ,GAAGI;AAAA,QAEJ,UAAA,gBAAAG;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWD;AAAA,cACT;AAAA,cACAN,IAAU,kBAAkB;AAAA,YAAA;AAAA,UAC9B;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,IAEDE,KAAS,gBAAAK,EAAC,QAAA,EAAK,WAAU,sCAAsC,UAAAL,EAAA,CAAM;AAAA,EAAA,GACxE;AAGN;AAEAJ,EAAO,cAAc;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Switch } from './Switch';
|
|
3
|
+
declare const meta: Meta<typeof Switch>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Switch>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Controlled: Story;
|
|
8
|
+
export declare const States: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as d } from "../../utils/cn.js";
|
|
3
|
+
const b = ({ className: e, children: o, ...a }) => /* @__PURE__ */ r("div", { className: "overflow-x-auto rounded-[var(--border-radius-md)] border border-[var(--border-color)]", children: /* @__PURE__ */ r(
|
|
4
|
+
"table",
|
|
5
|
+
{
|
|
6
|
+
className: d(
|
|
7
|
+
"w-full min-w-[36rem] border-collapse bg-[var(--bg-secondary)] text-left",
|
|
8
|
+
e
|
|
9
|
+
),
|
|
10
|
+
...a,
|
|
11
|
+
children: o
|
|
12
|
+
}
|
|
13
|
+
) });
|
|
14
|
+
export {
|
|
15
|
+
b as Table
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.js","sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["import type React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {}\n\nexport const Table: React.FC<TableProps> = ({ className, children, ...props }) => {\n return (\n <div className=\"overflow-x-auto rounded-[var(--border-radius-md)] border border-[var(--border-color)]\">\n <table\n className={cn(\n 'w-full min-w-[36rem] border-collapse bg-[var(--bg-secondary)] text-left',\n className,\n )}\n {...props}\n >\n {children}\n </table>\n </div>\n );\n};\n"],"names":["Table","className","children","props","jsx","cn"],"mappings":";;AAKO,MAAMA,IAA8B,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,QAElE,gBAAAC,EAAC,OAAA,EAAI,WAAU,yFACb,UAAA,gBAAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGE;AAAA,IAEH,UAAAD;AAAA,EAAA;AAAA,GAEL;"}
|