@petnow/ui 4.0.3 → 4.1.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/dist/Popup-D9fn8MGc.js +90 -0
- package/dist/Popup-D9fn8MGc.js.map +1 -0
- package/dist/TailwindUtil-aZk2bbTo.js +71 -0
- package/dist/TailwindUtil-aZk2bbTo.js.map +1 -0
- package/dist/index.es.js +25 -5523
- package/dist/v0/checkbox.js +36 -0
- package/dist/v0/checkbox.js.map +1 -0
- package/dist/v0/radio.js +16 -0
- package/dist/v0/radio.js.map +1 -0
- package/dist/v0/tabs.js +62 -0
- package/dist/v0/tabs.js.map +1 -0
- package/dist/v0/toggle.js +20 -0
- package/dist/v0/toggle.js.map +1 -0
- package/dist/v1/badge.js +338 -0
- package/dist/v1/badge.js.map +1 -0
- package/dist/v1/chip.js +53 -0
- package/dist/v1/chip.js.map +1 -0
- package/dist/v1/cta-button.js +62 -0
- package/dist/v1/cta-button.js.map +1 -0
- package/dist/v1/icons/action/cancel-filled.js +22 -0
- package/dist/v1/icons/action/cancel-filled.js.map +1 -0
- package/dist/v1/icons/action/cancel.js +19 -0
- package/dist/v1/icons/action/cancel.js.map +1 -0
- package/dist/v1/icons/action/chevron-down.js +19 -0
- package/dist/v1/icons/action/chevron-down.js.map +1 -0
- package/dist/v1/icons/action/chevron-left.js +19 -0
- package/dist/v1/icons/action/chevron-left.js.map +1 -0
- package/dist/v1/icons/action/chevron-right.js +19 -0
- package/dist/v1/icons/action/chevron-right.js.map +1 -0
- package/dist/v1/icons/action/chevron-up.js +19 -0
- package/dist/v1/icons/action/chevron-up.js.map +1 -0
- package/dist/v1/icons/action/filter.js +19 -0
- package/dist/v1/icons/action/filter.js.map +1 -0
- package/dist/v1/icons/action/retry.js +19 -0
- package/dist/v1/icons/action/retry.js.map +1 -0
- package/dist/v1/icons/action/sorting.js +19 -0
- package/dist/v1/icons/action/sorting.js.map +1 -0
- package/dist/v1/icons/static/close.js +19 -0
- package/dist/v1/icons/static/close.js.map +1 -0
- package/dist/v1/icons/static/delete.js +30 -0
- package/dist/v1/icons/static/delete.js.map +1 -0
- package/dist/v1/icons/static/recent.js +32 -0
- package/dist/v1/icons/static/recent.js.map +1 -0
- package/dist/v1/icons/static/report.js +28 -0
- package/dist/v1/icons/static/report.js.map +1 -0
- package/dist/v1/icons/static/shield-done.js +21 -0
- package/dist/v1/icons/static/shield-done.js.map +1 -0
- package/dist/v1/popup.js +5 -0
- package/dist/v1/text-field.js +286 -0
- package/dist/v1/text-field.js.map +1 -0
- package/package.json +94 -3
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js +0 -57
- package/dist/index.umd.js.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { t as e } from "../TailwindUtil-aZk2bbTo.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/v0/checkbox/Checkbox.tsx
|
|
4
|
+
var r = ({ className: r, id: i, onChange: a, disabled: o, isChecked: s }) => /* @__PURE__ */ n("label", {
|
|
5
|
+
className: "relative flex h-min w-min cursor-pointer items-center rounded-full",
|
|
6
|
+
htmlFor: i,
|
|
7
|
+
children: [/* @__PURE__ */ t("input", {
|
|
8
|
+
type: "checkbox",
|
|
9
|
+
disabled: o,
|
|
10
|
+
className: e(r, "before:content[''] peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary border-petnow-grey-primary relative size-6 cursor-pointer appearance-none rounded-xl border transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-6 before:w-6 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity"),
|
|
11
|
+
id: i,
|
|
12
|
+
checked: s,
|
|
13
|
+
onChange: (e) => {
|
|
14
|
+
a?.(e.target.checked);
|
|
15
|
+
}
|
|
16
|
+
}), /* @__PURE__ */ t("span", {
|
|
17
|
+
className: "text-petnow-grey-secondary pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-checked:text-white",
|
|
18
|
+
children: /* @__PURE__ */ t("svg", {
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
+
className: "h-4 w-4",
|
|
21
|
+
viewBox: "0 0 20 20",
|
|
22
|
+
fill: "currentColor",
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
strokeWidth: "1",
|
|
25
|
+
children: /* @__PURE__ */ t("path", {
|
|
26
|
+
fillRule: "evenodd",
|
|
27
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
28
|
+
clipRule: "evenodd"
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { r as default };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":[],"sources":["../../src/components/v0/checkbox/Checkbox.tsx"],"sourcesContent":["import { cn } from \"../../../utils/TailwindUtil\";\n\ninterface Props {\n className?: string;\n id?: string;\n onChange?: (newValue: boolean) => void;\n disabled?: boolean;\n isChecked?: boolean;\n}\n\nconst Checkbox = ({ className, id, onChange, disabled, isChecked }: Props) => {\n return (\n <label className=\"relative flex h-min w-min cursor-pointer items-center rounded-full\" htmlFor={id}>\n <input\n type=\"checkbox\"\n disabled={disabled}\n className={cn(\n className,\n \"before:content[''] peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary border-petnow-grey-primary relative size-6 cursor-pointer appearance-none rounded-xl border transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-6 before:w-6 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity\",\n )}\n id={id}\n checked={isChecked}\n onChange={(event) => {\n onChange?.(event.target.checked);\n }}\n />\n <span className=\"text-petnow-grey-secondary pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-checked:text-white\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"1\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n </span>\n </label>\n );\n};\n\nexport default Checkbox;\n"],"mappings":";;;AAUA,IAAM,KAAY,EAAE,cAAW,OAAI,aAAU,aAAU,mBAEnD,kBAAC,SAAD;CAAO,WAAU;CAAqE,SAAS;WAA/F,CACE,kBAAC,SAAD;EACE,MAAK;EACK;EACV,WAAW,EACT,GACA,2cACD;EACG;EACJ,SAAS;EACT,WAAW,MAAU;AACnB,OAAW,EAAM,OAAO,QAAQ;;EAElC,CAAA,EACF,kBAAC,QAAD;EAAM,WAAU;YACd,kBAAC,OAAD;GACE,OAAM;GACN,WAAU;GACV,SAAQ;GACR,MAAK;GACL,QAAO;GACP,aAAY;aAEZ,kBAAC,QAAD;IACE,UAAS;IACT,GAAE;IACF,UAAS;IACH,CAAA;GACJ,CAAA;EACD,CAAA,CACD"}
|
package/dist/v0/radio.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as e } from "../TailwindUtil-aZk2bbTo.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/v0/radio/Radio.tsx
|
|
4
|
+
var n = ({ className: n, id: r, name: i, onChange: a, disabled: o, isChecked: s }) => /* @__PURE__ */ t("input", {
|
|
5
|
+
type: "radio",
|
|
6
|
+
disabled: o,
|
|
7
|
+
checked: s,
|
|
8
|
+
id: r,
|
|
9
|
+
name: i,
|
|
10
|
+
className: e("petnowRadio size-[3.5vw]", n),
|
|
11
|
+
onChange: a
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as default };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.js","names":[],"sources":["../../src/components/v0/radio/Radio.tsx"],"sourcesContent":["import { cn } from \"../../../utils/TailwindUtil\";\n\ninterface Props {\n className?: string;\n id?: string;\n name?: string;\n onChange?: () => void;\n disabled?: boolean;\n isChecked?: boolean;\n}\n\nconst Radio = ({ className, id, name, onChange, disabled, isChecked }: Props) => {\n return (\n <input\n type=\"radio\"\n disabled={disabled}\n checked={isChecked}\n id={id}\n name={name}\n className={cn(\"petnowRadio size-[3.5vw]\", className)}\n onChange={onChange}\n />\n );\n};\n\nexport default Radio;\n"],"mappings":";;;AAWA,IAAM,KAAS,EAAE,cAAW,OAAI,SAAM,aAAU,aAAU,mBAEtD,kBAAC,SAAD;CACE,MAAK;CACK;CACV,SAAS;CACL;CACE;CACN,WAAW,EAAG,4BAA4B,EAAU;CAC1C;CACV,CAAA"}
|
package/dist/v0/tabs.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../TailwindUtil-aZk2bbTo.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { useRef as r, useState as i } from "react";
|
|
5
|
+
import a from "react-swipeable-views";
|
|
6
|
+
//#region src/components/v0/tabs/Tabs.tsx
|
|
7
|
+
var o = (e) => typeof e == "function" ? e : null, s = o(a.default?.default) ?? o(a.default) ?? o(a), c = ({ className: a, tabList: o, isCuratedcontent: c, unswipeableContent: l, defaultIndex: u = 0, onTabChange: d, disabled: f, allowScrollToSection: p = !0 }) => {
|
|
8
|
+
let [m, h] = i(u), g = r(null), _ = (e) => {
|
|
9
|
+
e.current && window.scrollTo({
|
|
10
|
+
top: e.current.offsetTop - 50,
|
|
11
|
+
behavior: "smooth"
|
|
12
|
+
});
|
|
13
|
+
}, v = (e) => {
|
|
14
|
+
h(e), p && _(g), d?.(e);
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ n("div", {
|
|
17
|
+
ref: g,
|
|
18
|
+
className: "w-full",
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ n("div", {
|
|
21
|
+
className: e(a?.tab, `z-50 mb-[20px] flex w-full flex-col bg-white ${c && "sticky top-[50px]"}`),
|
|
22
|
+
children: [/* @__PURE__ */ t("div", {
|
|
23
|
+
className: "flex",
|
|
24
|
+
children: o.map((n, r) => /* @__PURE__ */ t("div", {
|
|
25
|
+
className: "flex flex-1 flex-col",
|
|
26
|
+
children: /* @__PURE__ */ t("button", {
|
|
27
|
+
className: e(a?.tabTitle, `cursor-pointer ${m === r ? "text-petnow-grey-30 text-label-large" : "text-petnow-grey-70 text-body-large disabled:opacity-40"}`),
|
|
28
|
+
onClick: () => v(r),
|
|
29
|
+
disabled: f,
|
|
30
|
+
children: n.displayName
|
|
31
|
+
})
|
|
32
|
+
}, n.key))
|
|
33
|
+
}), /* @__PURE__ */ t("div", {
|
|
34
|
+
className: e(a?.underline, `relative h-[2px] w-full ${f ? "bg-petnow-grey-70/40" : "bg-petnow-grey-70"}`),
|
|
35
|
+
children: /* @__PURE__ */ t("div", {
|
|
36
|
+
className: e(a?.selectedUnderline, "bg-petnow-grey-30 absolute h-[2px] transition-all duration-200"),
|
|
37
|
+
style: (() => {
|
|
38
|
+
let e = 100 / o.length;
|
|
39
|
+
return {
|
|
40
|
+
width: `${e}%`,
|
|
41
|
+
left: `${m * e}%`
|
|
42
|
+
};
|
|
43
|
+
})()
|
|
44
|
+
})
|
|
45
|
+
})]
|
|
46
|
+
}),
|
|
47
|
+
l,
|
|
48
|
+
s ? /* @__PURE__ */ t(s, {
|
|
49
|
+
index: m,
|
|
50
|
+
onChangeIndex: (e) => {
|
|
51
|
+
h(e), d?.(e);
|
|
52
|
+
},
|
|
53
|
+
disabled: f,
|
|
54
|
+
children: o.map((e) => /* @__PURE__ */ t("div", { children: e.content }, e.key))
|
|
55
|
+
}) : /* @__PURE__ */ t("div", { children: o[m]?.content })
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
export { c as default };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","names":[],"sources":["../../src/components/v0/tabs/Tabs.tsx"],"sourcesContent":["\"use client\";\n\nimport { ReactNode, useRef, useState } from \"react\";\nimport SwipeableViewsImport from \"react-swipeable-views\";\n\nimport { cn } from \"../../../utils/TailwindUtil\";\n\ntype SwipeableViewsProps = {\n index: number;\n onChangeIndex?: (index: number) => void;\n disabled?: boolean;\n children?: ReactNode;\n};\n\nconst asSwipeableViews = (candidate: unknown): React.ComponentType<SwipeableViewsProps> | null => {\n return typeof candidate === \"function\" ? (candidate as React.ComponentType<SwipeableViewsProps>) : null;\n};\n\nconst SwipeableViews =\n asSwipeableViews((SwipeableViewsImport as { default?: { default?: unknown } }).default?.default) ??\n asSwipeableViews((SwipeableViewsImport as { default?: unknown }).default) ??\n asSwipeableViews(SwipeableViewsImport);\n\ninterface TabItem {\n readonly displayName: string;\n readonly key: string;\n readonly content: ReactNode;\n}\n\ninterface Props<T extends TabItem> {\n tabList: Readonly<T[]>;\n isCuratedcontent?: true;\n unswipeableContent?: ReactNode;\n defaultIndex?: number;\n onTabChange?: (index: number) => void;\n disabled?: boolean;\n className?: {\n tab?: string;\n tabTitle?: string;\n selectedUnderline?: string;\n underline?: string;\n };\n allowScrollToSection?: boolean;\n}\n\nconst Tabs = <T extends TabItem>({\n className,\n tabList,\n isCuratedcontent,\n unswipeableContent,\n defaultIndex = 0,\n onTabChange,\n disabled,\n allowScrollToSection = true,\n}: Props<T>) => {\n const [currentTabIndex, setCurrentTabIndex] = useState<number>(defaultIndex);\n const TabRef = useRef<HTMLDivElement>(null);\n\n const scrollToSection = (elementRef: React.RefObject<HTMLDivElement | null>) => {\n if (elementRef.current) {\n window.scrollTo({\n top: elementRef.current.offsetTop - 50,\n behavior: \"smooth\",\n });\n }\n };\n\n const handleTabClick = (index: number) => {\n setCurrentTabIndex(index);\n if (allowScrollToSection) scrollToSection(TabRef);\n onTabChange?.(index);\n };\n\n const underlineStyle = () => {\n const listLength = tabList.length;\n const widthPercent = 100 / listLength;\n return {\n width: `${widthPercent}%`,\n left: `${currentTabIndex * widthPercent}%`,\n };\n };\n\n return (\n <div ref={TabRef} className=\"w-full\">\n <div\n className={cn(\n className?.tab,\n `z-50 mb-[20px] flex w-full flex-col bg-white ${isCuratedcontent && \"sticky top-[50px]\"}`,\n )}\n >\n <div className=\"flex\">\n {tabList.map((tab, index) => (\n <div key={tab.key} className=\"flex flex-1 flex-col\">\n <button\n className={cn(\n className?.tabTitle,\n `cursor-pointer ${\n currentTabIndex === index\n ? \"text-petnow-grey-30 text-label-large\"\n : \"text-petnow-grey-70 text-body-large disabled:opacity-40\"\n }`,\n )}\n onClick={() => handleTabClick(index)}\n disabled={disabled}\n >\n {tab.displayName}\n </button>\n </div>\n ))}\n </div>\n <div\n className={cn(\n className?.underline,\n `relative h-[2px] w-full ${disabled ? \"bg-petnow-grey-70/40\" : \"bg-petnow-grey-70\"}`,\n )}\n >\n <div\n className={cn(\n className?.selectedUnderline,\n \"bg-petnow-grey-30 absolute h-[2px] transition-all duration-200\",\n )}\n style={underlineStyle()}\n />\n </div>\n </div>\n\n {unswipeableContent}\n\n {SwipeableViews ? (\n <SwipeableViews\n index={currentTabIndex}\n onChangeIndex={(index) => {\n setCurrentTabIndex(index);\n onTabChange?.(index);\n }}\n disabled={disabled}\n >\n {tabList.map((tab) => (\n <div key={tab.key}>{tab.content}</div>\n ))}\n </SwipeableViews>\n ) : (\n <div>{tabList[currentTabIndex]?.content}</div>\n )}\n </div>\n );\n};\n\nexport default Tabs;\n"],"mappings":";;;;;;AAcA,IAAM,KAAoB,MACjB,OAAO,KAAc,aAAc,IAAyD,MAG/F,IACJ,EAAkB,EAA6D,SAAS,QAAQ,IAChG,EAAkB,EAA+C,QAAQ,IACzE,EAAiB,EAAqB,EAwBlC,KAA2B,EAC/B,cACA,YACA,qBACA,uBACA,kBAAe,GACf,gBACA,aACA,0BAAuB,SACT;CACd,IAAM,CAAC,GAAiB,KAAsB,EAAiB,EAAa,EACtE,IAAS,EAAuB,KAAK,EAErC,KAAmB,MAAuD;AAC9E,EAAI,EAAW,WACb,OAAO,SAAS;GACd,KAAK,EAAW,QAAQ,YAAY;GACpC,UAAU;GACX,CAAC;IAIA,KAAkB,MAAkB;AAGxC,EAFA,EAAmB,EAAM,EACrB,KAAsB,EAAgB,EAAO,EACjD,IAAc,EAAM;;AAYtB,QACE,kBAAC,OAAD;EAAK,KAAK;EAAQ,WAAU;YAA5B;GACE,kBAAC,OAAD;IACE,WAAW,EACT,GAAW,KACX,gDAAgD,KAAoB,sBACrE;cAJH,CAME,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAQ,KAAK,GAAK,MACjB,kBAAC,OAAD;MAAmB,WAAU;gBAC3B,kBAAC,UAAD;OACE,WAAW,EACT,GAAW,UACX,kBACE,MAAoB,IAChB,yCACA,4DAEP;OACD,eAAe,EAAe,EAAM;OAC1B;iBAET,EAAI;OACE,CAAA;MACL,EAfI,EAAI,IAeR,CACN;KACE,CAAA,EACN,kBAAC,OAAD;KACE,WAAW,EACT,GAAW,WACX,2BAA2B,IAAW,yBAAyB,sBAChE;eAED,kBAAC,OAAD;MACE,WAAW,EACT,GAAW,mBACX,iEACD;MACD,cAhDmB;OAE3B,IAAM,IAAe,MADF,EAAQ;AAE3B,cAAO;QACL,OAAO,GAAG,EAAa;QACvB,MAAM,GAAG,IAAkB,EAAa;QACzC;UA0C8B;MACvB,CAAA;KACE,CAAA,CACF;;GAEL;GAEA,IACC,kBAAC,GAAD;IACE,OAAO;IACP,gBAAgB,MAAU;AAExB,KADA,EAAmB,EAAM,EACzB,IAAc,EAAM;;IAEZ;cAET,EAAQ,KAAK,MACZ,kBAAC,OAAD,EAAA,UAAoB,EAAI,SAAc,EAA5B,EAAI,IAAwB,CACtC;IACa,CAAA,GAEjB,kBAAC,OAAD,EAAA,UAAM,EAAQ,IAAkB,SAAc,CAAA;GAE5C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as e } from "../TailwindUtil-aZk2bbTo.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/v0/toggle/Toggle.tsx
|
|
4
|
+
var r = ({ className: r, id: i, name: a, onChange: o, disabled: s, isChecked: c }) => /* @__PURE__ */ n("label", {
|
|
5
|
+
htmlFor: i,
|
|
6
|
+
className: "relative inline-flex cursor-pointer items-center",
|
|
7
|
+
children: [/* @__PURE__ */ t("input", {
|
|
8
|
+
type: "checkbox",
|
|
9
|
+
disabled: s,
|
|
10
|
+
checked: c,
|
|
11
|
+
id: i,
|
|
12
|
+
name: a,
|
|
13
|
+
className: "peer sr-only",
|
|
14
|
+
onChange: o
|
|
15
|
+
}), /* @__PURE__ */ t("div", { className: e(r, "bg-petnow-grey-primary peer-checked:bg-petnow-orange-primary h-[32px] w-[52px] rounded-full duration-[250ms] peer-focus:outline-none after:absolute after:start-[2px] after:top-[3px] after:size-[26px] after:rounded-full after:bg-white after:shadow-[0_3px_8px_0_rgba(0,0,0,0.15)] after:transition-all after:duration-[250ms] after:content-[''] peer-checked:after:translate-x-[calc(100%-4px)] peer-checked:after:border-white", s && "cursor-not-allowed opacity-50") })]
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as default };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.js","names":[],"sources":["../../src/components/v0/toggle/Toggle.tsx"],"sourcesContent":["import { cn } from \"../../../utils/TailwindUtil\";\n\ninterface Props {\n className?: string;\n id?: string;\n name?: string;\n onChange: () => void;\n disabled?: boolean;\n isChecked?: boolean;\n}\n\nconst Toggle = ({ className, id, name, onChange, disabled, isChecked }: Props) => {\n return (\n <label htmlFor={id} className=\"relative inline-flex cursor-pointer items-center\">\n <input\n type=\"checkbox\"\n disabled={disabled}\n checked={isChecked}\n id={id}\n name={name}\n className=\"peer sr-only\"\n onChange={onChange}\n />\n <div\n className={cn(\n className,\n \"bg-petnow-grey-primary peer-checked:bg-petnow-orange-primary h-[32px] w-[52px] rounded-full duration-[250ms] peer-focus:outline-none after:absolute after:start-[2px] after:top-[3px] after:size-[26px] after:rounded-full after:bg-white after:shadow-[0_3px_8px_0_rgba(0,0,0,0.15)] after:transition-all after:duration-[250ms] after:content-[''] peer-checked:after:translate-x-[calc(100%-4px)] peer-checked:after:border-white\",\n disabled && \"cursor-not-allowed opacity-50\",\n )}\n />\n </label>\n );\n};\n\nexport default Toggle;\n"],"mappings":";;;AAWA,IAAM,KAAU,EAAE,cAAW,OAAI,SAAM,aAAU,aAAU,mBAEvD,kBAAC,SAAD;CAAO,SAAS;CAAI,WAAU;WAA9B,CACE,kBAAC,SAAD;EACE,MAAK;EACK;EACV,SAAS;EACL;EACE;EACN,WAAU;EACA;EACV,CAAA,EACF,kBAAC,OAAD,EACE,WAAW,EACT,GACA,waACA,KAAY,gCACb,EACD,CAAA,CACI"}
|
package/dist/v1/badge.js
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../TailwindUtil-aZk2bbTo.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import * as r from "react";
|
|
5
|
+
import { cva as i } from "class-variance-authority";
|
|
6
|
+
//#region src/components/v1/badge/Badge.tsx
|
|
7
|
+
var a = i("inline-flex items-center justify-center overflow-hidden", {
|
|
8
|
+
variants: {
|
|
9
|
+
type: {
|
|
10
|
+
filled: "",
|
|
11
|
+
outlined: "",
|
|
12
|
+
tinted: ""
|
|
13
|
+
},
|
|
14
|
+
color: {
|
|
15
|
+
orange: "",
|
|
16
|
+
blue: "",
|
|
17
|
+
red: "",
|
|
18
|
+
green: "",
|
|
19
|
+
neutral: ""
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
large: "rounded-[4px] h-[28px] px-2 py-1 gap-1",
|
|
23
|
+
small: "rounded-[2px] h-[17px] px-1 py-0.5 gap-1"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
compoundVariants: [
|
|
27
|
+
{
|
|
28
|
+
type: "filled",
|
|
29
|
+
color: "orange",
|
|
30
|
+
className: "bg-surface-base-accent-3-badge"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: "filled",
|
|
34
|
+
color: "blue",
|
|
35
|
+
className: "bg-surface-base-sub-3"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: "filled",
|
|
39
|
+
color: "red",
|
|
40
|
+
className: "bg-surface-base-critical-2"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: "filled",
|
|
44
|
+
color: "green",
|
|
45
|
+
className: "bg-surface-base-success-2"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: "filled",
|
|
49
|
+
color: "neutral",
|
|
50
|
+
className: "bg-surface-base-neutral-5"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "tinted",
|
|
54
|
+
color: "orange",
|
|
55
|
+
className: "bg-surface-base-accent-1-badge"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: "tinted",
|
|
59
|
+
color: "blue",
|
|
60
|
+
className: "bg-surface-base-sub-1"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: "tinted",
|
|
64
|
+
color: "red",
|
|
65
|
+
className: "bg-surface-base-critical-1"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "tinted",
|
|
69
|
+
color: "green",
|
|
70
|
+
className: "bg-surface-base-success-1"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "tinted",
|
|
74
|
+
color: "neutral",
|
|
75
|
+
className: "bg-surface-base-neutral-2"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: "outlined",
|
|
79
|
+
color: "orange",
|
|
80
|
+
className: "border border-border-prominent-accent-badge"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: "outlined",
|
|
84
|
+
color: "blue",
|
|
85
|
+
className: "border border-border-prominent-sub"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "outlined",
|
|
89
|
+
color: "red",
|
|
90
|
+
className: "border border-border-prominent-critical"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: "outlined",
|
|
94
|
+
color: "green",
|
|
95
|
+
className: "border border-border-prominent-success"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: "outlined",
|
|
99
|
+
color: "neutral",
|
|
100
|
+
className: "border border-border-base-neutral-5"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
defaultVariants: {
|
|
104
|
+
type: "filled",
|
|
105
|
+
color: "neutral",
|
|
106
|
+
size: "large"
|
|
107
|
+
}
|
|
108
|
+
}), o = i("", {
|
|
109
|
+
variants: {
|
|
110
|
+
type: {
|
|
111
|
+
filled: "",
|
|
112
|
+
outlined: "",
|
|
113
|
+
tinted: ""
|
|
114
|
+
},
|
|
115
|
+
color: {
|
|
116
|
+
orange: "",
|
|
117
|
+
blue: "",
|
|
118
|
+
red: "",
|
|
119
|
+
green: "",
|
|
120
|
+
neutral: ""
|
|
121
|
+
},
|
|
122
|
+
size: {
|
|
123
|
+
large: "text-caption-12-medium",
|
|
124
|
+
small: "text-caption-11-medium"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
compoundVariants: [
|
|
128
|
+
{
|
|
129
|
+
type: "filled",
|
|
130
|
+
color: "orange",
|
|
131
|
+
className: "text-text-prominent-neutral-1"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
type: "filled",
|
|
135
|
+
color: "blue",
|
|
136
|
+
className: "text-text-prominent-neutral-1"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: "filled",
|
|
140
|
+
color: "red",
|
|
141
|
+
className: "text-text-prominent-neutral-1"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
type: "filled",
|
|
145
|
+
color: "green",
|
|
146
|
+
className: "text-text-prominent-neutral-1"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
type: "filled",
|
|
150
|
+
color: "neutral",
|
|
151
|
+
className: "text-text-prominent-neutral-1"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: "tinted",
|
|
155
|
+
color: "orange",
|
|
156
|
+
className: "text-text-prominent-accent-1-badge"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: "tinted",
|
|
160
|
+
color: "blue",
|
|
161
|
+
className: "text-text-prominent-sub"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
type: "tinted",
|
|
165
|
+
color: "red",
|
|
166
|
+
className: "text-text-prominent-critical"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: "tinted",
|
|
170
|
+
color: "green",
|
|
171
|
+
className: "text-text-prominent-success"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: "tinted",
|
|
175
|
+
color: "neutral",
|
|
176
|
+
className: "text-text-base-neutral-3"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
type: "outlined",
|
|
180
|
+
color: "orange",
|
|
181
|
+
className: "text-text-prominent-accent-1-badge"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: "outlined",
|
|
185
|
+
color: "blue",
|
|
186
|
+
className: "text-text-prominent-sub"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
type: "outlined",
|
|
190
|
+
color: "red",
|
|
191
|
+
className: "text-text-prominent-critical"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
type: "outlined",
|
|
195
|
+
color: "green",
|
|
196
|
+
className: "text-text-prominent-success"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
type: "outlined",
|
|
200
|
+
color: "neutral",
|
|
201
|
+
className: "text-text-base-neutral-3"
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
defaultVariants: {
|
|
205
|
+
type: "filled",
|
|
206
|
+
color: "neutral",
|
|
207
|
+
size: "large"
|
|
208
|
+
}
|
|
209
|
+
}), s = i("shrink-0", {
|
|
210
|
+
variants: {
|
|
211
|
+
type: {
|
|
212
|
+
filled: "",
|
|
213
|
+
outlined: "",
|
|
214
|
+
tinted: ""
|
|
215
|
+
},
|
|
216
|
+
color: {
|
|
217
|
+
orange: "",
|
|
218
|
+
blue: "",
|
|
219
|
+
red: "",
|
|
220
|
+
green: "",
|
|
221
|
+
neutral: ""
|
|
222
|
+
},
|
|
223
|
+
size: {
|
|
224
|
+
large: "size-[20px]",
|
|
225
|
+
small: "hidden"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
compoundVariants: [
|
|
229
|
+
{
|
|
230
|
+
type: "filled",
|
|
231
|
+
color: "orange",
|
|
232
|
+
className: "text-icon-base-neutral-1"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
type: "filled",
|
|
236
|
+
color: "blue",
|
|
237
|
+
className: "text-icon-base-neutral-1"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
type: "filled",
|
|
241
|
+
color: "red",
|
|
242
|
+
className: "text-icon-base-neutral-1"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
type: "filled",
|
|
246
|
+
color: "green",
|
|
247
|
+
className: "text-icon-base-neutral-1"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
type: "filled",
|
|
251
|
+
color: "neutral",
|
|
252
|
+
className: "text-icon-base-neutral-1"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
type: "tinted",
|
|
256
|
+
color: "orange",
|
|
257
|
+
className: "text-icon-prominent-accent-1-badge"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
type: "tinted",
|
|
261
|
+
color: "blue",
|
|
262
|
+
className: "text-icon-prominent-sub"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
type: "tinted",
|
|
266
|
+
color: "red",
|
|
267
|
+
className: "text-icon-prominent-critical"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
type: "tinted",
|
|
271
|
+
color: "green",
|
|
272
|
+
className: "text-icon-prominent-success"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
type: "tinted",
|
|
276
|
+
color: "neutral",
|
|
277
|
+
className: "text-icon-base-neutral-3"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
type: "outlined",
|
|
281
|
+
color: "orange",
|
|
282
|
+
className: "text-icon-prominent-accent-1-badge"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
type: "outlined",
|
|
286
|
+
color: "blue",
|
|
287
|
+
className: "text-icon-prominent-sub"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
type: "outlined",
|
|
291
|
+
color: "red",
|
|
292
|
+
className: "text-icon-prominent-critical"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
type: "outlined",
|
|
296
|
+
color: "green",
|
|
297
|
+
className: "text-icon-prominent-success"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
type: "outlined",
|
|
301
|
+
color: "neutral",
|
|
302
|
+
className: "text-icon-base-neutral-3"
|
|
303
|
+
}
|
|
304
|
+
],
|
|
305
|
+
defaultVariants: {
|
|
306
|
+
type: "filled",
|
|
307
|
+
color: "neutral",
|
|
308
|
+
size: "large"
|
|
309
|
+
}
|
|
310
|
+
}), c = r.forwardRef(({ label: r, icon: i, type: c = "filled", color: l = "neutral", size: u = "large", className: d, ...f }, p) => /* @__PURE__ */ n("div", {
|
|
311
|
+
ref: p,
|
|
312
|
+
className: e(a({
|
|
313
|
+
type: c,
|
|
314
|
+
color: l,
|
|
315
|
+
size: u
|
|
316
|
+
}), d),
|
|
317
|
+
...f,
|
|
318
|
+
children: [i && /* @__PURE__ */ t(i, {
|
|
319
|
+
className: s({
|
|
320
|
+
type: c,
|
|
321
|
+
color: l,
|
|
322
|
+
size: u
|
|
323
|
+
}),
|
|
324
|
+
"aria-hidden": !0
|
|
325
|
+
}), /* @__PURE__ */ t("span", {
|
|
326
|
+
className: o({
|
|
327
|
+
type: c,
|
|
328
|
+
color: l,
|
|
329
|
+
size: u
|
|
330
|
+
}),
|
|
331
|
+
children: r
|
|
332
|
+
})]
|
|
333
|
+
}));
|
|
334
|
+
c.displayName = "Badge";
|
|
335
|
+
//#endregion
|
|
336
|
+
export { c as Badge };
|
|
337
|
+
|
|
338
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","names":[],"sources":["../../src/components/v1/badge/Badge.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../../utils/TailwindUtil\";\n\ntype BadgeType = \"filled\" | \"outlined\" | \"tinted\";\ntype BadgeColor = \"orange\" | \"blue\" | \"red\" | \"green\" | \"neutral\";\ntype BadgeSize = \"small\" | \"large\";\n\nexport interface BadgeProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n label: string;\n icon?: React.ComponentType<{ className?: string }>;\n type?: BadgeType;\n color?: BadgeColor;\n size?: BadgeSize;\n}\n\nconst badgeVariants = cva(\"inline-flex items-center justify-center overflow-hidden\", {\n variants: {\n type: {\n filled: \"\",\n outlined: \"\",\n tinted: \"\",\n },\n color: {\n orange: \"\",\n blue: \"\",\n red: \"\",\n green: \"\",\n neutral: \"\",\n },\n size: {\n large: \"rounded-[4px] h-[28px] px-2 py-1 gap-1\",\n small: \"rounded-[2px] h-[17px] px-1 py-0.5 gap-1\",\n },\n },\n compoundVariants: [\n {\n type: \"filled\",\n color: \"orange\",\n className: \"bg-surface-base-accent-3-badge\",\n },\n {\n type: \"filled\",\n color: \"blue\",\n className: \"bg-surface-base-sub-3\",\n },\n {\n type: \"filled\",\n color: \"red\",\n className: \"bg-surface-base-critical-2\",\n },\n {\n type: \"filled\",\n color: \"green\",\n className: \"bg-surface-base-success-2\",\n },\n {\n type: \"filled\",\n color: \"neutral\",\n className: \"bg-surface-base-neutral-5\",\n },\n {\n type: \"tinted\",\n color: \"orange\",\n className: \"bg-surface-base-accent-1-badge\",\n },\n {\n type: \"tinted\",\n color: \"blue\",\n className: \"bg-surface-base-sub-1\",\n },\n {\n type: \"tinted\",\n color: \"red\",\n className: \"bg-surface-base-critical-1\",\n },\n {\n type: \"tinted\",\n color: \"green\",\n className: \"bg-surface-base-success-1\",\n },\n {\n type: \"tinted\",\n color: \"neutral\",\n className: \"bg-surface-base-neutral-2\",\n },\n {\n type: \"outlined\",\n color: \"orange\",\n className: \"border border-border-prominent-accent-badge\",\n },\n {\n type: \"outlined\",\n color: \"blue\",\n className: \"border border-border-prominent-sub\",\n },\n {\n type: \"outlined\",\n color: \"red\",\n className: \"border border-border-prominent-critical\",\n },\n {\n type: \"outlined\",\n color: \"green\",\n className: \"border border-border-prominent-success\",\n },\n {\n type: \"outlined\",\n color: \"neutral\",\n className: \"border border-border-base-neutral-5\",\n },\n ],\n defaultVariants: {\n type: \"filled\",\n color: \"neutral\",\n size: \"large\",\n },\n});\n\nconst badgeTextVariants = cva(\"\", {\n variants: {\n type: {\n filled: \"\",\n outlined: \"\",\n tinted: \"\",\n },\n color: {\n orange: \"\",\n blue: \"\",\n red: \"\",\n green: \"\",\n neutral: \"\",\n },\n size: {\n large: \"text-caption-12-medium\",\n small: \"text-caption-11-medium\",\n },\n },\n compoundVariants: [\n {\n type: \"filled\",\n color: \"orange\",\n className: \"text-text-prominent-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"blue\",\n className: \"text-text-prominent-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"red\",\n className: \"text-text-prominent-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"green\",\n className: \"text-text-prominent-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"neutral\",\n className: \"text-text-prominent-neutral-1\",\n },\n {\n type: \"tinted\",\n color: \"orange\",\n className: \"text-text-prominent-accent-1-badge\",\n },\n {\n type: \"tinted\",\n color: \"blue\",\n className: \"text-text-prominent-sub\",\n },\n {\n type: \"tinted\",\n color: \"red\",\n className: \"text-text-prominent-critical\",\n },\n {\n type: \"tinted\",\n color: \"green\",\n className: \"text-text-prominent-success\",\n },\n {\n type: \"tinted\",\n color: \"neutral\",\n className: \"text-text-base-neutral-3\",\n },\n {\n type: \"outlined\",\n color: \"orange\",\n className: \"text-text-prominent-accent-1-badge\",\n },\n {\n type: \"outlined\",\n color: \"blue\",\n className: \"text-text-prominent-sub\",\n },\n {\n type: \"outlined\",\n color: \"red\",\n className: \"text-text-prominent-critical\",\n },\n {\n type: \"outlined\",\n color: \"green\",\n className: \"text-text-prominent-success\",\n },\n {\n type: \"outlined\",\n color: \"neutral\",\n className: \"text-text-base-neutral-3\",\n },\n ],\n defaultVariants: {\n type: \"filled\",\n color: \"neutral\",\n size: \"large\",\n },\n});\n\nconst badgeIconVariants = cva(\"shrink-0\", {\n variants: {\n type: {\n filled: \"\",\n outlined: \"\",\n tinted: \"\",\n },\n color: {\n orange: \"\",\n blue: \"\",\n red: \"\",\n green: \"\",\n neutral: \"\",\n },\n size: {\n large: \"size-[20px]\",\n small: \"hidden\",\n },\n },\n compoundVariants: [\n {\n type: \"filled\",\n color: \"orange\",\n className: \"text-icon-base-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"blue\",\n className: \"text-icon-base-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"red\",\n className: \"text-icon-base-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"green\",\n className: \"text-icon-base-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"neutral\",\n className: \"text-icon-base-neutral-1\",\n },\n {\n type: \"tinted\",\n color: \"orange\",\n className: \"text-icon-prominent-accent-1-badge\",\n },\n {\n type: \"tinted\",\n color: \"blue\",\n className: \"text-icon-prominent-sub\",\n },\n {\n type: \"tinted\",\n color: \"red\",\n className: \"text-icon-prominent-critical\",\n },\n {\n type: \"tinted\",\n color: \"green\",\n className: \"text-icon-prominent-success\",\n },\n {\n type: \"tinted\",\n color: \"neutral\",\n className: \"text-icon-base-neutral-3\",\n },\n {\n type: \"outlined\",\n color: \"orange\",\n className: \"text-icon-prominent-accent-1-badge\",\n },\n {\n type: \"outlined\",\n color: \"blue\",\n className: \"text-icon-prominent-sub\",\n },\n {\n type: \"outlined\",\n color: \"red\",\n className: \"text-icon-prominent-critical\",\n },\n {\n type: \"outlined\",\n color: \"green\",\n className: \"text-icon-prominent-success\",\n },\n {\n type: \"outlined\",\n color: \"neutral\",\n className: \"text-icon-base-neutral-3\",\n },\n ],\n defaultVariants: {\n type: \"filled\",\n color: \"neutral\",\n size: \"large\",\n },\n});\n\nconst Badge = React.forwardRef<HTMLDivElement, BadgeProps>(\n ({ label, icon: Icon, type = \"filled\", color = \"neutral\", size = \"large\", className, ...props }, ref) => {\n return (\n <div ref={ref} className={cn(badgeVariants({ type, color, size }), className)} {...props}>\n {Icon && <Icon className={badgeIconVariants({ type, color, size })} aria-hidden />}\n <span className={badgeTextVariants({ type, color, size })}>{label}</span>\n </div>\n );\n },\n);\n\nBadge.displayName = \"Badge\";\n\nexport { Badge };\n"],"mappings":"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"}
|
package/dist/v1/chip.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../TailwindUtil-aZk2bbTo.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
import { cva as r } from "class-variance-authority";
|
|
6
|
+
//#region src/components/v1/chip/Chip.tsx
|
|
7
|
+
var i = r("inline-flex items-center justify-center gap-1 rounded-full border px-[11px] py-[7px] transition-colors duration-200", {
|
|
8
|
+
variants: {
|
|
9
|
+
selected: {
|
|
10
|
+
true: "bg-surface-base-accent-1 border-border-prominent-accent",
|
|
11
|
+
false: "bg-surface-base-neutral-1 border-border-base-neutral-2"
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
true: "opacity-40 pointer-events-none",
|
|
15
|
+
false: ""
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
selected: !1,
|
|
20
|
+
disabled: !1
|
|
21
|
+
}
|
|
22
|
+
}), a = r("text-body-14-medium", {
|
|
23
|
+
variants: { selected: {
|
|
24
|
+
true: "text-text-prominent-accent-1",
|
|
25
|
+
false: "text-text-base-neutral-3"
|
|
26
|
+
} },
|
|
27
|
+
defaultVariants: { selected: !1 }
|
|
28
|
+
}), o = r("size-[18px] shrink-0", {
|
|
29
|
+
variants: { selected: {
|
|
30
|
+
true: "text-icon-prominent-accent-1",
|
|
31
|
+
false: "text-icon-base-neutral-3"
|
|
32
|
+
} },
|
|
33
|
+
defaultVariants: { selected: !1 }
|
|
34
|
+
}), s = ({ className: r, label: s, icon: c, selected: l = !1, disabled: u = !1, onPress: d, onClick: f, type: p = "button", ...m }) => /* @__PURE__ */ n("button", {
|
|
35
|
+
type: p,
|
|
36
|
+
className: e(i({
|
|
37
|
+
selected: l,
|
|
38
|
+
disabled: u
|
|
39
|
+
}), r),
|
|
40
|
+
onClick: (e) => {
|
|
41
|
+
f?.(e), e.defaultPrevented || d?.();
|
|
42
|
+
},
|
|
43
|
+
disabled: u,
|
|
44
|
+
...m,
|
|
45
|
+
children: [c && /* @__PURE__ */ t(c, { className: o({ selected: l }) }), /* @__PURE__ */ t("span", {
|
|
46
|
+
className: a({ selected: l }),
|
|
47
|
+
children: s
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
//#endregion
|
|
51
|
+
export { s as Chip };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip.js","names":[],"sources":["../../src/components/v1/chip/Chip.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../../utils/TailwindUtil\";\n\nexport interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n label: string;\n icon?: React.ComponentType<{ className?: string }>;\n selected?: boolean;\n onPress?: () => void;\n}\n\nconst chipVariants = cva(\n \"inline-flex items-center justify-center gap-1 rounded-full border px-[11px] py-[7px] transition-colors duration-200\",\n {\n variants: {\n selected: {\n true: \"bg-surface-base-accent-1 border-border-prominent-accent\",\n false: \"bg-surface-base-neutral-1 border-border-base-neutral-2\",\n },\n disabled: {\n true: \"opacity-40 pointer-events-none\",\n false: \"\",\n },\n },\n defaultVariants: {\n selected: false,\n disabled: false,\n },\n },\n);\n\nconst chipTextVariants = cva(\"text-body-14-medium\", {\n variants: {\n selected: {\n true: \"text-text-prominent-accent-1\",\n false: \"text-text-base-neutral-3\",\n },\n },\n defaultVariants: {\n selected: false,\n },\n});\n\nconst chipIconVariants = cva(\"size-[18px] shrink-0\", {\n variants: {\n selected: {\n true: \"text-icon-prominent-accent-1\",\n false: \"text-icon-base-neutral-3\",\n },\n },\n defaultVariants: {\n selected: false,\n },\n});\n\nconst Chip = ({\n className,\n label,\n icon: Icon,\n selected = false,\n disabled = false,\n onPress,\n onClick,\n type = \"button\",\n ...props\n}: ChipProps) => {\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n onPress?.();\n }\n };\n\n return (\n <button\n type={type}\n className={cn(chipVariants({ selected, disabled }), className)}\n onClick={handleClick}\n disabled={disabled}\n {...props}\n >\n {Icon && <Icon className={chipIconVariants({ selected })} />}\n <span className={chipTextVariants({ selected })}>{label}</span>\n </button>\n );\n};\n\nexport { Chip };\n"],"mappings":";;;;;;AAcA,IAAM,IAAe,EACnB,uHACA;CACE,UAAU;EACR,UAAU;GACR,MAAM;GACN,OAAO;GACR;EACD,UAAU;GACR,MAAM;GACN,OAAO;GACR;EACF;CACD,iBAAiB;EACf,UAAU;EACV,UAAU;EACX;CACF,CACF,EAEK,IAAmB,EAAI,uBAAuB;CAClD,UAAU,EACR,UAAU;EACR,MAAM;EACN,OAAO;EACR,EACF;CACD,iBAAiB,EACf,UAAU,IACX;CACF,CAAC,EAEI,IAAmB,EAAI,wBAAwB;CACnD,UAAU,EACR,UAAU;EACR,MAAM;EACN,OAAO;EACR,EACF;CACD,iBAAiB,EACf,UAAU,IACX;CACF,CAAC,EAEI,KAAQ,EACZ,cACA,UACA,MAAM,GACN,cAAW,IACX,cAAW,IACX,YACA,YACA,UAAO,UACP,GAAG,QAWD,kBAAC,UAAD;CACQ;CACN,WAAW,EAAG,EAAa;EAAE;EAAU;EAAU,CAAC,EAAE,EAAU;CAC9D,UAZiB,MAA+C;AAGlE,EAFA,IAAU,EAAM,EAEX,EAAM,oBACT,KAAW;;CASD;CACV,GAAI;WALN,CAOG,KAAQ,kBAAC,GAAD,EAAM,WAAW,EAAiB,EAAE,aAAU,CAAC,EAAI,CAAA,EAC5D,kBAAC,QAAD;EAAM,WAAW,EAAiB,EAAE,aAAU,CAAC;YAAG;EAAa,CAAA,CACxD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../TailwindUtil-aZk2bbTo.js";
|
|
3
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import * as i from "react";
|
|
5
|
+
import { cva as a } from "class-variance-authority";
|
|
6
|
+
//#region src/components/v1/cta-button/CTAButton.tsx
|
|
7
|
+
var o = a("flex flex-row items-center justify-center gap-1 shadow-none duration-200 transition-all", {
|
|
8
|
+
variants: {
|
|
9
|
+
hierarchy: {
|
|
10
|
+
primary: "bg-surface-primary-accent hover:bg-surface-primary-accent-pressed text-text-prominent-neutral-1",
|
|
11
|
+
secondary: "bg-surface-secondary-accent hover:bg-surface-secondary-accent-pressed text-text-prominent-accent-2",
|
|
12
|
+
tertiary: "bg-background-base-neutral-1 hover:bg-surface-tertiary-accent-pressed border-border-prominent-accent border text-text-prominent-accent-1"
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
large: "h-14 px-4 py-4 gap-1 text-title-18-medium rounded-[10px]",
|
|
16
|
+
medium: "h-[46px] px-4 py-3 gap-1 text-body-16-medium rounded-[8px]",
|
|
17
|
+
small: "h-10 px-3 py-2 gap-1 text-body-16-medium rounded-[6px]"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
hierarchy: "primary",
|
|
22
|
+
size: "large"
|
|
23
|
+
}
|
|
24
|
+
}), s = a("shrink-0", {
|
|
25
|
+
variants: {
|
|
26
|
+
hierarchy: {
|
|
27
|
+
primary: "text-icon-base-neutral-1",
|
|
28
|
+
secondary: "text-icon-prominent-accent-2",
|
|
29
|
+
tertiary: "text-icon-prominent-accent-1"
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
large: "size-6",
|
|
33
|
+
medium: "size-[22px]",
|
|
34
|
+
small: "size-5"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
hierarchy: "primary",
|
|
39
|
+
size: "large"
|
|
40
|
+
}
|
|
41
|
+
}), c = i.forwardRef(({ label: i, icon: a, hierarchy: c = "primary", size: l = "large", disabled: u = !1, className: d, type: f = "button", ...p }, m) => {
|
|
42
|
+
let h = /* @__PURE__ */ r(t, { children: [a && /* @__PURE__ */ n(a, { className: s({
|
|
43
|
+
hierarchy: c,
|
|
44
|
+
size: l
|
|
45
|
+
}) }), i] });
|
|
46
|
+
return /* @__PURE__ */ n("button", {
|
|
47
|
+
ref: m,
|
|
48
|
+
type: f,
|
|
49
|
+
className: e(o({
|
|
50
|
+
hierarchy: c,
|
|
51
|
+
size: l
|
|
52
|
+
}), "opacity-100 disabled:opacity-40 disabled:pointer-events-none", d),
|
|
53
|
+
disabled: u,
|
|
54
|
+
...p,
|
|
55
|
+
children: h
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
c.displayName = "CTAButton";
|
|
59
|
+
//#endregion
|
|
60
|
+
export { c as CTAButton };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=cta-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cta-button.js","names":[],"sources":["../../src/components/v1/cta-button/CTAButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../../utils/TailwindUtil\";\n\nconst ctaButtonVariants = cva(\n \"flex flex-row items-center justify-center gap-1 shadow-none duration-200 transition-all\",\n {\n variants: {\n hierarchy: {\n primary: \"bg-surface-primary-accent hover:bg-surface-primary-accent-pressed text-text-prominent-neutral-1\",\n secondary: \"bg-surface-secondary-accent hover:bg-surface-secondary-accent-pressed text-text-prominent-accent-2\",\n tertiary:\n \"bg-background-base-neutral-1 hover:bg-surface-tertiary-accent-pressed border-border-prominent-accent border text-text-prominent-accent-1\",\n },\n size: {\n large: \"h-14 px-4 py-4 gap-1 text-title-18-medium rounded-[10px]\",\n medium: \"h-[46px] px-4 py-3 gap-1 text-body-16-medium rounded-[8px]\",\n small: \"h-10 px-3 py-2 gap-1 text-body-16-medium rounded-[6px]\",\n },\n },\n defaultVariants: {\n hierarchy: \"primary\",\n size: \"large\",\n },\n },\n);\n\nconst ctaButtonIconVariants = cva(\"shrink-0\", {\n variants: {\n hierarchy: {\n primary: \"text-icon-base-neutral-1\",\n secondary: \"text-icon-prominent-accent-2\",\n tertiary: \"text-icon-prominent-accent-1\",\n },\n size: {\n large: \"size-6\",\n medium: \"size-[22px]\",\n small: \"size-5\",\n },\n },\n defaultVariants: {\n hierarchy: \"primary\",\n size: \"large\",\n },\n});\n\nexport interface CTAButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\">,\n VariantProps<typeof ctaButtonVariants> {\n label: string | React.ReactNode;\n icon?: React.ComponentType<{ className?: string }>;\n className?: string;\n}\n\nconst CTAButton = React.forwardRef<HTMLButtonElement, CTAButtonProps>(\n (\n {\n label,\n icon: Icon,\n hierarchy = \"primary\",\n size = \"large\",\n disabled = false,\n className,\n type = \"button\",\n ...props\n },\n ref,\n ) => {\n const content = (\n <>\n {Icon && <Icon className={ctaButtonIconVariants({ hierarchy, size })} />}\n {label}\n </>\n );\n\n const buttonClassName = cn(\n ctaButtonVariants({ hierarchy, size }),\n \"opacity-100 disabled:opacity-40 disabled:pointer-events-none\",\n className,\n );\n\n return (\n <button ref={ref} type={type} className={buttonClassName} disabled={disabled} {...props}>\n {content}\n </button>\n );\n },\n);\n\nCTAButton.displayName = \"CTAButton\";\n\nexport { CTAButton };\n"],"mappings":";;;;;;AAOA,IAAM,IAAoB,EACxB,2FACA;CACE,UAAU;EACR,WAAW;GACT,SAAS;GACT,WAAW;GACX,UACE;GACH;EACD,MAAM;GACJ,OAAO;GACP,QAAQ;GACR,OAAO;GACR;EACF;CACD,iBAAiB;EACf,WAAW;EACX,MAAM;EACP;CACF,CACF,EAEK,IAAwB,EAAI,YAAY;CAC5C,UAAU;EACR,WAAW;GACT,SAAS;GACT,WAAW;GACX,UAAU;GACX;EACD,MAAM;GACJ,OAAO;GACP,QAAQ;GACR,OAAO;GACR;EACF;CACD,iBAAiB;EACf,WAAW;EACX,MAAM;EACP;CACF,CAAC,EAUI,IAAY,EAAM,YAEpB,EACE,UACA,MAAM,GACN,eAAY,WACZ,UAAO,SACP,cAAW,IACX,cACA,UAAO,UACP,GAAG,KAEL,MACG;CACH,IAAM,IACJ,kBAAA,GAAA,EAAA,UAAA,CACG,KAAQ,kBAAC,GAAD,EAAM,WAAW,EAAsB;EAAE;EAAW;EAAM,CAAC,EAAI,CAAA,EACvE,EACA,EAAA,CAAA;AASL,QACE,kBAAC,UAAD;EAAa;EAAW;EAAM,WAPR,EACtB,EAAkB;GAAE;GAAW;GAAM,CAAC,EACtC,gEACA,EACD;EAGqE;EAAU,GAAI;YAC/E;EACM,CAAA;EAGd;AAED,EAAU,cAAc"}
|