@safestrong/ppa-component-library 1.6.5 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -10
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +78 -78
- package/readme.md +146 -146
package/dist/index.d.mts
CHANGED
|
@@ -28,7 +28,7 @@ type SingleSelect = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
|
28
28
|
label?: string;
|
|
29
29
|
labelHtml?: string;
|
|
30
30
|
placeholder?: string;
|
|
31
|
-
|
|
31
|
+
stateaction?: (param: any) => void;
|
|
32
32
|
outerclass?: string;
|
|
33
33
|
options?: {
|
|
34
34
|
label: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ type SingleSelect = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
|
28
28
|
label?: string;
|
|
29
29
|
labelHtml?: string;
|
|
30
30
|
placeholder?: string;
|
|
31
|
-
|
|
31
|
+
stateaction?: (param: any) => void;
|
|
32
32
|
outerclass?: string;
|
|
33
33
|
options?: {
|
|
34
34
|
label: string;
|
package/dist/index.js
CHANGED
|
@@ -183,7 +183,6 @@ function SingleSelect(attr) {
|
|
|
183
183
|
label: "",
|
|
184
184
|
value: ""
|
|
185
185
|
});
|
|
186
|
-
const inputKeyword = (0, import_react4.useDeferredValue)(keyword);
|
|
187
186
|
function selectItem({ label, value }, e) {
|
|
188
187
|
const triggerManual = attrInput.onChange;
|
|
189
188
|
if (triggerManual) {
|
|
@@ -192,9 +191,9 @@ function SingleSelect(attr) {
|
|
|
192
191
|
});
|
|
193
192
|
}
|
|
194
193
|
setSelected({ label, value });
|
|
195
|
-
if (attr.
|
|
196
|
-
if (stringOptions) attr.
|
|
197
|
-
if (options) attr.
|
|
194
|
+
if (attr.stateaction) {
|
|
195
|
+
if (stringOptions) attr.stateaction(value);
|
|
196
|
+
if (options) attr.stateaction({ label, value });
|
|
198
197
|
}
|
|
199
198
|
setKeyword("");
|
|
200
199
|
setTimeout(() => {
|
|
@@ -217,9 +216,9 @@ function SingleSelect(attr) {
|
|
|
217
216
|
}, [options, stringOptions]);
|
|
218
217
|
const filteredOptions = (0, import_react4.useMemo)(() => {
|
|
219
218
|
return availableOptions.filter(
|
|
220
|
-
({ label, value }) => label.toLowerCase().includes(
|
|
219
|
+
({ label, value }) => label.toLowerCase().includes(keyword.toLowerCase()) || value.toLowerCase().includes(keyword.toLowerCase())
|
|
221
220
|
);
|
|
222
|
-
}, [
|
|
221
|
+
}, [keyword, availableOptions]);
|
|
223
222
|
(0, import_react4.useEffect)(() => {
|
|
224
223
|
attrInput.value && autoUpdateValue(attrInput.value);
|
|
225
224
|
}, [attrInput.value]);
|
|
@@ -413,7 +412,6 @@ function MultiSelect(_a) {
|
|
|
413
412
|
]);
|
|
414
413
|
const { options = [], stringOptions = [] } = attr;
|
|
415
414
|
const [keyword, setKeyword] = (0, import_react10.useState)("");
|
|
416
|
-
const inputKeyword = (0, import_react10.useDeferredValue)(keyword);
|
|
417
415
|
const availableOptions = (0, import_react10.useMemo)(() => {
|
|
418
416
|
const isDefaultOption = options && options.length > 0;
|
|
419
417
|
if (!isDefaultOption)
|
|
@@ -422,7 +420,7 @@ function MultiSelect(_a) {
|
|
|
422
420
|
}, [options, stringOptions]);
|
|
423
421
|
function getFiltered() {
|
|
424
422
|
return availableOptions.filter(
|
|
425
|
-
({ label: label2, value }) => label2.toLowerCase().includes(
|
|
423
|
+
({ label: label2, value }) => label2.toLowerCase().includes(keyword.toLowerCase()) || value.toLowerCase().includes(keyword.toLowerCase())
|
|
426
424
|
);
|
|
427
425
|
}
|
|
428
426
|
function selectItem({ label: label2, value }) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/components/Button.tsx","../src/components/TextInput.tsx","../src/components/Slider.tsx","../src/components/SingleSelect.tsx","../src/components/Tooltip.tsx","../src/components/NavTabClient.tsx","../src/components/Card.tsx","../src/components/Toast.tsx","../src/components/Expandable.tsx","../src/components/MultiSelect.tsx","../src/components/ThemeToggle.tsx","../src/components/Dashboard.tsx","../src/components/Badge.tsx","../src/components/Skeleton.tsx","../src/components/Navigation.tsx","../src/components/Confirmation.tsx"],"sourcesContent":["export { default as Button } from \"./components/Button\";\r\nexport { default as TextInput } from \"./components/TextInput\";\r\nexport { default as Slider } from \"./components/Slider\";\r\nexport { default as SingleSelect } from \"./components/SingleSelect\";\r\nexport { default as Tooltip } from \"./components/Tooltip\";\r\nexport { default as NavTabClient } from \"./components/NavTabClient\";\r\nexport { default as Card } from \"./components/Card\";\r\nexport { default as Toast } from \"./components/Toast\";\r\nexport { default as Expandable } from \"./components/Expandable\";\r\nexport { default as MultiSelect } from \"./components/MultiSelect\";\r\nexport { default as ThemeToggle } from \"./components/ThemeToggle\";\r\nexport { default as Dashboard } from \"./components/Dashboard\";\r\nexport { default as Badge } from \"./components/Badge\";\r\nexport { default as Skeleton } from \"./components/Skeleton\";\r\nexport { default as Navigation } from \"./components/Navigation\";\r\nexport { default as Confirmation } from \"./components/Confirmation\";\r\n","import React from \"react\";\r\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faCircleNotch } from \"@fortawesome/free-solid-svg-icons\";\r\n\r\ntype Button = React.ButtonHTMLAttributes<HTMLButtonElement> & {\r\n icon?: IconProp;\r\n label?: string;\r\n btnType?: \"primary\" | \"secondary\" | \"tertiary\";\r\n isLoading?: boolean;\r\n};\r\n\r\nexport default function Button({\r\n label,\r\n icon,\r\n isLoading,\r\n btnType,\r\n className,\r\n ...rest\r\n}: Readonly<Button>) {\r\n const buttonIcon = isLoading ? faCircleNotch : icon;\r\n const loadingLabel = label && isLoading ? \"Memproses ...\" : \"\";\r\n return (\r\n <button\r\n {...rest}\r\n className={`${!icon && \"py-[0.84rem]\"} ${className} ${\r\n btnType == \"secondary\" && \"btn__secondary\"\r\n } btn__primary`}\r\n >\r\n {buttonIcon && icon && (\r\n <FontAwesomeIcon\r\n icon={buttonIcon}\r\n className={`text-[1.2rem] ${label && \"mr-[0.3rem]\"} ${\r\n isLoading && \"animate-spin\"\r\n }`}\r\n />\r\n )}\r\n {isLoading ? loadingLabel : label}\r\n </button>\r\n );\r\n}\r\n\r\nconst IconButton = (props: Readonly<Button>) => {\r\n return (\r\n <button\r\n {...props}\r\n className={`${props.className} ${\r\n props.label ? \"max-w-[content] px-[0.8rem]\" : \"\"\r\n } icon__button`}\r\n >\r\n {props.icon && <FontAwesomeIcon icon={props.icon} />}\r\n {props.label && (\r\n <span className=\"inline-block ml-[0.8rem] text-[1rem]\">\r\n {props.label}\r\n </span>\r\n )}\r\n </button>\r\n );\r\n};\r\n\r\nconst IconButtonGroup = ({ list }: { list: Button[] }) => {\r\n function getBtnClass(idx: number) {\r\n return `icon__button !h-[2.95rem] !rounded-[0] border-[0] ${\r\n idx !== 0 ? \"border-l border-l-[var(--color-border)]\" : \"\"\r\n }`;\r\n }\r\n return (\r\n <div className=\"icon__button_group\">\r\n {list.map((props, idx) => (\r\n <button key={idx} className={getBtnClass(idx)} {...props}>\r\n {props.icon && <FontAwesomeIcon icon={props.icon} />}\r\n </button>\r\n ))}\r\n </div>\r\n );\r\n};\r\n\r\nButton.IconButton = IconButton;\r\nButton.IconButtonGroup = IconButtonGroup;\r\n","import React from \"react\";\r\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nconst input__icon =\r\n \"w-[2rem] p-[0.9rem] px-[0.7rem] text-[1.2rem] bg-[var(--color-background-icon)] text-[var(--color-icon-input)] mr-2 group-focus-within:text-[var(--color-primary)]\";\r\n\r\nexport default function TextInput({\r\n label,\r\n labelFor,\r\n icon,\r\n outerclass,\r\n ...attr\r\n}: Readonly<\r\n React.InputHTMLAttributes<HTMLInputElement> & {\r\n label?: string;\r\n labelFor?: string;\r\n icon?: IconProp;\r\n outerclass?: string;\r\n }\r\n>) {\r\n return (\r\n <div className={`group ${outerclass} w-full`}>\r\n {label && (\r\n <label htmlFor={labelFor} className=\"text-input__label\">\r\n {label}\r\n </label>\r\n )}\r\n <div className={`text-input__wrapper overflow-hidden ${attr.className}`}>\r\n {icon && <FontAwesomeIcon icon={icon} className={input__icon} />}\r\n <input\r\n {...attr}\r\n className={`text-input w-full ${icon && \"!pl-[0.3rem]\"}`}\r\n />\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { faCheck } from \"@fortawesome/free-solid-svg-icons\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\n\r\nexport default function Slider(\r\n attr: Readonly<React.InputHTMLAttributes<HTMLInputElement>>\r\n) {\r\n return (\r\n <div className=\"flex items-center h-[3rem]\">\r\n <div className=\"slider__wrapper group\">\r\n <input id=\"slider\" type=\"checkbox\" className={input} {...attr} />\r\n <label htmlFor={attr.id || \"slider\"} className=\"slider\">\r\n <FontAwesomeIcon\r\n icon={faCheck}\r\n className=\"text-[0.7rem] translate-x-[0.2px]\"\r\n />\r\n </label>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nconst input = \"peer ... w-[3rem] h-[1.6rem] opacity-[0] cursor-pointer\";\r\n","\"use client\";\r\nimport React, { useDeferredValue, useEffect, useMemo, useState } from \"react\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faCheck, faChevronDown } from \"@fortawesome/free-solid-svg-icons\";\r\n\r\ntype SingleSelect = React.InputHTMLAttributes<HTMLInputElement> & {\r\n label?: string;\r\n labelHtml?: string;\r\n placeholder?: string;\r\n stateAction?:(param: any) => void;\r\n outerclass?: string;\r\n options?: {\r\n label: string;\r\n value: string;\r\n }[];\r\n stringOptions?: string[];\r\n};\r\n\r\nexport default function SingleSelect(attr: Readonly<SingleSelect>) {\r\n const { options = [], stringOptions = [], ...attrInput } = attr;\r\n const [keyword, setKeyword] = useState(\"\");\r\n const [selected, setSelected] = useState<{ label: string; value: any }>({\r\n label: \"\",\r\n value: \"\",\r\n });\r\n const inputKeyword = useDeferredValue(keyword);\r\n\r\n function selectItem(\r\n { label, value }: { label: string; value: any },\r\n e: React.MouseEvent<HTMLButtonElement>\r\n ) {\r\n const triggerManual = attrInput.onChange;\r\n if (triggerManual) {\r\n triggerManual?.({\r\n target: { value, name: attrInput.name },\r\n } as React.ChangeEvent<HTMLInputElement>);\r\n }\r\n setSelected({ label, value });\r\n if(attr.stateAction){\r\n if(stringOptions) attr.stateAction(value)\r\n if(options) attr.stateAction({label, value})\r\n }\r\n setKeyword(\"\");\r\n setTimeout(() => {\r\n (e.target as HTMLButtonElement).blur();\r\n }, 250);\r\n }\r\n\r\n function autoUpdateValue(updatedValue: string) {\r\n if (updatedValue) {\r\n const filtered = availableOptions.find(\r\n ({ value }) => value == updatedValue\r\n );\r\n if (filtered) setSelected(filtered);\r\n }\r\n }\r\n\r\n const availableOptions = useMemo(() => {\r\n let defaultOptions = options && options.length > 0;\r\n if (!defaultOptions)\r\n return stringOptions.map((opt) => ({ label: opt, value: opt }));\r\n return options;\r\n }, [options, stringOptions]);\r\n\r\n const filteredOptions = useMemo(() => {\r\n return availableOptions.filter(\r\n ({ label, value }) =>\r\n label.toLowerCase().includes(inputKeyword.toLowerCase()) ||\r\n value.toLowerCase().includes(inputKeyword.toLowerCase())\r\n );\r\n }, [inputKeyword, availableOptions]);\r\n\r\n useEffect(() => {\r\n attrInput.value && autoUpdateValue(attrInput.value as string);\r\n }, [attrInput.value]);\r\n\r\n return (\r\n <div className={`w-full group ${attr.outerclass}`}>\r\n {attrInput.label && (\r\n <label className=\"text-input__label\" htmlFor={attrInput.labelHtml}>\r\n {attrInput.label}\r\n </label>\r\n )}\r\n <div className={`${attrInput.className} text-input__wrapper relative`}>\r\n <input\r\n {...attrInput}\r\n {...(attrInput.onChange ? { onChange: attrInput.onChange } : {})}\r\n value={attrInput.value ?? selected.value}\r\n type=\"hidden\"\r\n />\r\n <input\r\n value={keyword}\r\n type=\"search\"\r\n onChange={(e) => setKeyword(e.target.value)}\r\n className={`${attrInput.name}-keyword ${input} ${\r\n selected.value && \"placeholder:text-[var(--color-text-primary)]\"\r\n }`}\r\n placeholder={selected.value ? selected.label : attrInput.placeholder}\r\n />\r\n <div className=\"select-item__wrapper\">\r\n {filteredOptions.length == 0 && keyword != \"\" && (\r\n <button disabled className=\"select-item text-[var(--color-danger)]\">\r\n Tidak ada Item\r\n </button>\r\n )}\r\n {filteredOptions.map(({ label, value }) => (\r\n <button\r\n type=\"button\"\r\n onClick={(e) => selectItem({ label, value }, e)}\r\n key={value}\r\n className=\"select-item\"\r\n >\r\n {label}\r\n {selected.value == value && (\r\n <FontAwesomeIcon\r\n icon={faCheck}\r\n className=\"text-[var(--color-primary)]\"\r\n />\r\n )}\r\n </button>\r\n ))}\r\n </div>\r\n <FontAwesomeIcon icon={faChevronDown} className={input__icon} />\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nSingleSelect.autoFill = autoFillInput;\r\n\r\nfunction autoFillInput(\r\n value: string,\r\n elName: string,\r\n list: { label: string; value: string }[]\r\n) {\r\n const inp = document.querySelector(`[name=\"${elName}\"]`) as HTMLInputElement;\r\n inp.value = `${value}`;\r\n const filtered = list.find((item) => item.value == value);\r\n const el = document.querySelector(`.${elName}-keyword`);\r\n el?.setAttribute(\"placeholder\", `${filtered?.label}`);\r\n}\r\n\r\nconst input__icon = \"pr-[0.7rem] text-[var(--color-icon-input)]\";\r\nconst input = \"text-input peer ... w-full\";\r\n","import React from \"react\";\r\n\r\ntype Tooltip = {\r\n children: React.ReactNode;\r\n text: string;\r\n position: \"top\" | \"bottom\" | \"right\" | \"left\";\r\n};\r\n\r\nexport default function Tooltip({\r\n children,\r\n text,\r\n position = \"top\",\r\n}: Readonly<Tooltip>) {\r\n function getAccent() {\r\n const mapping = {\r\n top,\r\n bottom,\r\n left,\r\n right,\r\n };\r\n return mapping[position];\r\n }\r\n return (\r\n <div className=\"relative\">\r\n <div className=\"peer\">{children}</div>\r\n <span className={`tooltip-text ${getAccent()}`}>{text}</span>\r\n </div>\r\n );\r\n}\r\n\r\nconst top =\r\n \"bottom-full translate-y-[-0.3rem] right-0 after:bottom-0 after:translate-y-[0.25rem] \";\r\nconst bottom =\r\n \"right-0 top-full translate-y-[0.3rem] after:top-[-0.4rem] after:translate-y-[0.2rem] \";\r\nconst right =\r\n \"left-full w-[max-content] translate-x-[0.6rem] after:left-[-0.2rem] top-[-0.2rem] after:top-[0.6rem]\";\r\nconst left =\r\n \"right-full w-[max-content] translate-x-[-0.6rem] top-[-0.2rem] after:right-[-0.2rem] after:top-[0.6rem]\";\r\n","import React from \"react\";\r\n\r\ntype Option = {\r\n label: string;\r\n value: string;\r\n};\r\n\r\nexport default function NavTabClient({\r\n items,\r\n state,\r\n}: Readonly<{\r\n items: Option[];\r\n state: {\r\n active: string;\r\n setActive: (val: string) => void;\r\n };\r\n}>) {\r\n return (\r\n <nav className=\"navtab__wrapper\">\r\n {items.map(({ label, value }) => (\r\n <button\r\n key={value}\r\n className={`navtab__item ${\r\n state.active == value\r\n ? \"navtab__item__active\"\r\n : \"hover:bg-[var(--color-border)]/50\"\r\n }`}\r\n onClick={() => state.setActive(value)}\r\n >\r\n {label}\r\n </button>\r\n ))}\r\n </nav>\r\n );\r\n}\r\n","import React from \"react\";\r\n\r\ntype Card = {\r\n children: React.ReactNode;\r\n className?: string;\r\n};\r\n\r\nexport default function Card({ children, className }: Readonly<Card>) {\r\n return <div className={`card ${className}`}>{children}</div>;\r\n}\r\n\r\nconst Footer = ({\r\n className,\r\n children,\r\n}: {\r\n className?: string;\r\n children?: React.ReactNode;\r\n}) => {\r\n return (\r\n <div className={`${className} border-t border-t-[var(--color-border)]`}>\r\n {children}\r\n </div>\r\n );\r\n};\r\n\r\nCard.Footer = Footer;\r\n","import React from \"react\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport {\r\n faCheckCircle,\r\n faInfoCircle,\r\n faQuestionCircle,\r\n faXmarkCircle,\r\n} from \"@fortawesome/free-solid-svg-icons\";\r\n\r\ntype ToastType = \"warning\" | \"success\" | \"info\" | \"danger\";\r\ntype Toast = {\r\n title: string;\r\n className?: string;\r\n description: string;\r\n type: ToastType;\r\n};\r\n\r\nexport default function Toast({\r\n title,\r\n description,\r\n type = \"info\",\r\n className,\r\n}: Readonly<Toast>) {\r\n return (\r\n <div className={`toast__wrapper group ${className}`}>\r\n <div className=\"toast__body\">\r\n <div style={{ background: getColor(type) }} className={bullet}></div>\r\n <div>\r\n <p className=\"toast__title\">{title}</p>\r\n <p className=\"toast__description\">{description}</p>\r\n </div>\r\n <div className={`toast__icon toast__icon__${type}`}></div>\r\n </div>\r\n <p\r\n className=\"toast__bar toast-bar-animate\"\r\n style={{ background: getColor(type) }}\r\n ></p>\r\n </div>\r\n );\r\n}\r\n\r\nconst Inline = ({\r\n className,\r\n text,\r\n type,\r\n}: {\r\n className?: string;\r\n text: string;\r\n type: ToastType;\r\n}) => {\r\n return (\r\n <div\r\n className={`toast__inline ${className}`}\r\n style={{ background: `var(--color-${type}-soft)`, opacity: 0.9 }}\r\n >\r\n <FontAwesomeIcon\r\n icon={getIcon(type)}\r\n className=\"text-[1.3rem]\"\r\n style={{ color: getColor(type) }}\r\n />\r\n <p>{text}</p>\r\n </div>\r\n );\r\n};\r\n\r\nToast.Inline = Inline;\r\n\r\nfunction getColor(type: string) {\r\n return `var(--color-${type})`;\r\n}\r\n\r\nfunction getIcon(type: string) {\r\n const mapping = {\r\n warning: faQuestionCircle,\r\n info: faInfoCircle,\r\n danger: faXmarkCircle,\r\n success: faCheckCircle,\r\n };\r\n //@ts-expect-error call object using array index\r\n return mapping[type];\r\n}\r\n\r\nconst bullet =\r\n \"w-[2rem] h-[2rem] absolute top-[-0.7rem] left-[-0.7rem] rounded-[50%]\";\r\n","import React from \"react\";\r\nimport { faCaretRight } from \"@fortawesome/free-solid-svg-icons\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\n\r\ntype Expandable = {\r\n children: React.ReactNode;\r\n title: string;\r\n className?: string;\r\n isOpen?: boolean;\r\n};\r\n\r\nexport default function Expandable({\r\n children,\r\n title,\r\n className,\r\n isOpen,\r\n}: Readonly<Expandable>) {\r\n const name = title.replace(\" \", \"\");\r\n return (\r\n <div className={`expandable ${className}`}>\r\n <input\r\n id={name}\r\n type=\"checkbox\"\r\n defaultChecked={isOpen}\r\n className=\"opacity-[0] peer absolute top-0 ex-title\"\r\n />\r\n <FontAwesomeIcon icon={faCaretRight} className=\"expandable__icon\" />\r\n <label htmlFor={name} className=\"expandable__title\">\r\n {title}\r\n </label>\r\n <div className=\"expandable__body\">\r\n <div className=\"p-[0.75rem] px-[1rem]\">{children}</div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import React, { useCallback, useDeferredValue, useMemo, useState } from \"react\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faCheck, faListCheck } from \"@fortawesome/free-solid-svg-icons\";\r\n\r\ntype Option = {\r\n value: string;\r\n label: string;\r\n};\r\n\r\ntype MultiSelect = {\r\n label?: string;\r\n labelHtml?: string;\r\n outerclass?: string;\r\n options?: Option[];\r\n stringOptions?: string[];\r\n state: { value: Option[]; select: (newVal: Option[]) => void };\r\n};\r\n\r\nexport default function MultiSelect({\r\n state,\r\n label,\r\n labelHtml,\r\n ...attr\r\n}: Readonly<MultiSelect>) {\r\n const { options = [], stringOptions = [] } = attr;\r\n const [keyword, setKeyword] = useState(\"\");\r\n const inputKeyword = useDeferredValue(keyword);\r\n\r\n const availableOptions = useMemo(() => {\r\n const isDefaultOption = options && options.length > 0;\r\n if (!isDefaultOption)\r\n return stringOptions.map((opt) => ({ label: opt, value: opt }));\r\n return options;\r\n }, [options, stringOptions]);\r\n\r\n function getFiltered() {\r\n return availableOptions.filter(\r\n ({ label, value }) =>\r\n label.toLowerCase().includes(inputKeyword.toLowerCase()) ||\r\n value.toLowerCase().includes(inputKeyword.toLowerCase())\r\n );\r\n }\r\n\r\n function selectItem({ label, value }: { label: string; value: string }) {\r\n //@ts-expect-error: avoid check\r\n state.select((prev) => {\r\n const isItemExist = prev.find((item: any) => item.value == value);\r\n if (isItemExist) {\r\n return prev.filter((item: any) => item.value != value);\r\n }\r\n return [...prev, { label, value }];\r\n });\r\n }\r\n\r\n function isItemExist(value: string) {\r\n return state.value.find((item: any) => item.value == value);\r\n }\r\n\r\n const selectUnSelectAll = useCallback(() => {\r\n const isAllSelected = state.value.length == availableOptions.length;\r\n state.select(isAllSelected ? [] : availableOptions);\r\n }, [state.value]);\r\n\r\n return (\r\n <div className={`group w-full ${attr.outerclass}`}>\r\n {label && (\r\n <label className=\"text-input__label\" htmlFor={labelHtml}>\r\n {label}\r\n </label>\r\n )}\r\n <div className=\"text-input__wrapper relative\">\r\n <input\r\n value={keyword}\r\n type=\"search\"\r\n placeholder={`${state.value.length} Dipilih`}\r\n className={`${input} ${\r\n state.value.length > 0 &&\r\n \"placeholder:text-[var(--color-text-primary)]\"\r\n }`}\r\n onChange={(e) => setKeyword(e.target.value)}\r\n />\r\n <div className=\"select-item__wrapper select-multiple__wrapper\">\r\n {getFiltered().length == 0 && keyword != \"\" && (\r\n <button disabled className=\"select-item text-[var(--color-danger)]\">\r\n Tidak ada Item\r\n </button>\r\n )}\r\n {getFiltered().map(({ label, value }) => (\r\n <button\r\n type=\"button\"\r\n onClick={() => selectItem({ label, value })}\r\n key={value}\r\n className=\"select-item\"\r\n >\r\n {label}\r\n {isItemExist(value) && (\r\n <FontAwesomeIcon\r\n icon={faCheck}\r\n className=\"text-[var(--color-primary)]\"\r\n />\r\n )}\r\n </button>\r\n ))}\r\n </div>\r\n <button\r\n type=\"button\"\r\n className=\"cursor-pointer\"\r\n onClick={selectUnSelectAll}\r\n >\r\n <FontAwesomeIcon icon={faListCheck} className={input__icon} />\r\n </button>\r\n </div>\r\n </div>\r\n );\r\n}\r\nconst input__icon = \"pr-[0.7rem] text-[1.2rem] text-[var(--color-icon-input)]\";\r\nconst input = \"text-input peer ... w-full\";\r\n","\"use client\";\r\nimport React from \"react\";\r\n\r\nexport default function ThemeToggle(\r\n attr: Readonly<React.InputHTMLAttributes<HTMLInputElement>>\r\n) {\r\n return (\r\n <div className=\"flex items-center h-[3rem]\">\r\n <label\r\n htmlFor={`${attr.id || \"theme-toggle\"}`}\r\n className=\"slider__wrapper slider-theme slider-theme-light\"\r\n >\r\n <input\r\n id=\"theme-toggle\"\r\n {...attr}\r\n type=\"checkbox\"\r\n className=\"peer ... w-[2rem] opacity-[0] cursor-pointer\"\r\n />\r\n <span className=\"slider-theme__bullet\"></span>\r\n </label>\r\n </div>\r\n );\r\n}\r\n","import React, { useState } from \"react\";\r\nimport MultiSelect from \"./MultiSelect\";\r\nimport SingleSelect from \"./SingleSelect\";\r\n\r\nconst list = [\r\n { label: \"Option 1\", value: \"option1\" },\r\n { label: \"Option 2\", value: \"option2\" },\r\n { label: \"Option 3\", value: \"option3\" },\r\n];\r\nconst stringList = [\"option1\", \"option2\", \"option3\"];\r\n\r\nexport default function Dashboard() {\r\n const [selectedItem, setSelectedItem] = useState<\r\n { label: string; value: string }[]\r\n >([]);\r\n const [sel, setSel] = useState({ label: \"\", value: \"\" });\r\n\r\n function updateState(item: string) {\r\n const filtered = list.find(({ value }) => value == item);\r\n filtered && setSel(filtered);\r\n }\r\n\r\n return (\r\n <div className=\"flex items-center gap-[1rem]\">\r\n <MultiSelect\r\n label=\"Multi Select\"\r\n stringOptions={stringList}\r\n state={{ value: selectedItem, select: setSelectedItem }}\r\n />\r\n <SingleSelect\r\n label=\"Single Select\"\r\n name=\"newinput\"\r\n stringOptions={stringList}\r\n placeholder=\"-- Pilih Status --\"\r\n value={sel.value}\r\n />\r\n </div>\r\n );\r\n}\r\n","import React from \"react\";\r\nexport default function Badge({\r\n text,\r\n type,\r\n className,\r\n}: {\r\n text: string;\r\n type: \"success\" | \"danger\" | \"warning\" | \"info\";\r\n className?: string;\r\n}) {\r\n return (\r\n <div className=\"badge__wrapper\">\r\n <span\r\n style={{\r\n background: `var(--color-${type})`,\r\n }}\r\n className={`badge ${className}`}\r\n >\r\n {text}\r\n </span>\r\n </div>\r\n );\r\n}\r\n","import React from \"react\";\r\nexport default function Skeleton({ className }: { className?: string }) {\r\n return (\r\n <div className={`${className} skeleton`}>\r\n <span className=\"skeleton__item skeleton-slide\"></span>\r\n </div>\r\n );\r\n}\r\n","import React from \"react\";\r\n\r\nexport default function Navigation() {\r\n return <nav></nav>;\r\n}\r\n\r\nconst URLNavigation = (props: {\r\n list: { label: string; href: string }[];\r\n activeUrl: string;\r\n outerclass?: string;\r\n CustomComponent?: React.ElementType;\r\n}) => {\r\n const Component = props.CustomComponent || \"a\";\r\n function getAnchorClass(href: string) {\r\n return href === props.activeUrl\r\n ? \"bg-[var(--color-primary-soft)] text-[var(--color-primary)]\"\r\n : \"text-[var(--color-text-secondary)]/70 hover:bg-[var(--color-border)]/40\";\r\n }\r\n\r\n return (\r\n <nav className={`nav__wrapper ${props.outerclass}`}>\r\n {props.list.map((prop) => (\r\n <Component\r\n key={prop.href}\r\n className={`${base__anchor} ${getAnchorClass(prop.href)}`}\r\n {...prop}\r\n >\r\n {prop.label}\r\n </Component>\r\n ))}\r\n </nav>\r\n );\r\n};\r\n\r\nNavigation.URL = URLNavigation;\r\n\r\nconst base__anchor =\r\n \"p-[0.8rem] h-full grid items-center transition-all leading-[1] px-[1.2rem] rounded-[0.4rem]\";\r\n","import React from \"react\";\r\n\r\nexport default function Confirmation({\r\n type = \"warning\",\r\n text,\r\n title,\r\n secondaryAction,\r\n secondaryLabel = \"Tidak\",\r\n mainAction,\r\n mainLabel = \"Ya\",\r\n}: {\r\n mainAction: () => void;\r\n secondaryAction?: () => void;\r\n mainLabel?: string;\r\n secondaryLabel?: string;\r\n title: string;\r\n text: string;\r\n type?: \"info\" | \"warning\" | \"danger\" | \"success\";\r\n}) {\r\n return (\r\n <div className=\"confirmation__outer\">\r\n <div className=\"confirmation__card\">\r\n <div className={wrapper}>\r\n <div className={`baloon__${type} baloon`}></div>\r\n <div>\r\n <h3 className=\"font-semibold\">{title}</h3>\r\n <p className={confirmation__text}>{text}</p>\r\n </div>\r\n </div>\r\n <div className=\"confirmation__footer\">\r\n {secondaryAction && (\r\n <button\r\n onClick={secondaryAction}\r\n type=\"button\"\r\n className=\"cursor-pointer\"\r\n style={{ color: `var(--color-${type})` }}\r\n >\r\n {secondaryLabel}\r\n </button>\r\n )}\r\n <button\r\n onClick={() => {\r\n mainAction();\r\n secondaryAction && secondaryAction();\r\n }}\r\n className=\"cursor-pointer btn__primary min-w-[8rem]\"\r\n style={{\r\n background: `var(--color-${type})`,\r\n border: `1px solid var(--color-${type})`,\r\n }}\r\n >\r\n {mainLabel}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nconst wrapper =\r\n \"pt-[0.5rem] pb-[1rem] px-[1.8rem] grid items-center gap-[1.5rem]\";\r\nconst confirmation__text =\r\n \"mt-[0.7rem] w-[90%] text-[var(--color-text-secondary)]\";\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAElB,+BAAgC;AAChC,kCAA8B;AASf,SAAR,OAAwB,IAOV;AAPU,eAC7B;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAjBF,IAY+B,IAM1B,iBAN0B,IAM1B;AAAA,IALH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAG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,QAAG,WAAU,mBAAiB,KAAM,GACrC,+BAAAA,QAAA,cAAC,OAAE,WAAW,sBAAqB,IAAK,CAC1C,CACF,GACA,+BAAAA,QAAA,cAAC,SAAI,WAAU,0BACZ,mBACC,+BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,SAAS;AAAA,MACT,MAAK;AAAA,MACL,WAAU;AAAA,MACV,OAAO,EAAE,OAAO,eAAe,IAAI,IAAI;AAAA;AAAA,IAEtC;AAAA,EACH,GAEF,+BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,MAAM;AACb,mBAAW;AACX,2BAAmB,gBAAgB;AAAA,MACrC;AAAA,MACA,WAAU;AAAA,MACV,OAAO;AAAA,QACL,YAAY,eAAe,IAAI;AAAA,QAC/B,QAAQ,yBAAyB,IAAI;AAAA,MACvC;AAAA;AAAA,IAEC;AAAA,EACH,CACF,CACF,CACF;AAEJ;AAEA,IAAM,UACJ;AACF,IAAM,qBACJ;","names":["React","list","import_react","import_react_fontawesome","React","import_react","import_free_solid_svg_icons","import_react_fontawesome","React","import_react","import_react_fontawesome","import_free_solid_svg_icons","React","input","input__icon","list","import_react","React","import_react","React","import_react","React","import_react","import_react_fontawesome","import_free_solid_svg_icons","React","import_react","import_free_solid_svg_icons","import_react_fontawesome","React","import_react","import_react_fontawesome","import_free_solid_svg_icons","label","isItemExist","React","input","input__icon","import_react","React","import_react","React","import_react","React","import_react","React","import_react","React","import_react","React"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/components/Button.tsx","../src/components/TextInput.tsx","../src/components/Slider.tsx","../src/components/SingleSelect.tsx","../src/components/Tooltip.tsx","../src/components/NavTabClient.tsx","../src/components/Card.tsx","../src/components/Toast.tsx","../src/components/Expandable.tsx","../src/components/MultiSelect.tsx","../src/components/ThemeToggle.tsx","../src/components/Dashboard.tsx","../src/components/Badge.tsx","../src/components/Skeleton.tsx","../src/components/Navigation.tsx","../src/components/Confirmation.tsx"],"sourcesContent":["export { default as Button } from \"./components/Button\";\nexport { default as TextInput } from \"./components/TextInput\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as SingleSelect } from \"./components/SingleSelect\";\nexport { default as Tooltip } from \"./components/Tooltip\";\nexport { default as NavTabClient } from \"./components/NavTabClient\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Toast } from \"./components/Toast\";\nexport { default as Expandable } from \"./components/Expandable\";\nexport { default as MultiSelect } from \"./components/MultiSelect\";\nexport { default as ThemeToggle } from \"./components/ThemeToggle\";\nexport { default as Dashboard } from \"./components/Dashboard\";\nexport { default as Badge } from \"./components/Badge\";\nexport { default as Skeleton } from \"./components/Skeleton\";\nexport { default as Navigation } from \"./components/Navigation\";\nexport { default as Confirmation } from \"./components/Confirmation\";\n","import React from \"react\";\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCircleNotch } from \"@fortawesome/free-solid-svg-icons\";\n\ntype Button = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n icon?: IconProp;\n label?: string;\n btnType?: \"primary\" | \"secondary\" | \"tertiary\";\n isLoading?: boolean;\n};\n\nexport default function Button({\n label,\n icon,\n isLoading,\n btnType,\n className,\n ...rest\n}: Readonly<Button>) {\n const buttonIcon = isLoading ? faCircleNotch : icon;\n const loadingLabel = label && isLoading ? \"Memproses ...\" : \"\";\n return (\n <button\n {...rest}\n className={`${!icon && \"py-[0.84rem]\"} ${className} ${\n btnType == \"secondary\" && \"btn__secondary\"\n } btn__primary`}\n >\n {buttonIcon && icon && (\n <FontAwesomeIcon\n icon={buttonIcon}\n className={`text-[1.2rem] ${label && \"mr-[0.3rem]\"} ${\n isLoading && \"animate-spin\"\n }`}\n />\n )}\n {isLoading ? loadingLabel : label}\n </button>\n );\n}\n\nconst IconButton = (props: Readonly<Button>) => {\n return (\n <button\n {...props}\n className={`${props.className} ${\n props.label ? \"max-w-[content] px-[0.8rem]\" : \"\"\n } icon__button`}\n >\n {props.icon && <FontAwesomeIcon icon={props.icon} />}\n {props.label && (\n <span className=\"inline-block ml-[0.8rem] text-[1rem]\">\n {props.label}\n </span>\n )}\n </button>\n );\n};\n\nconst IconButtonGroup = ({ list }: { list: Button[] }) => {\n function getBtnClass(idx: number) {\n return `icon__button !h-[2.95rem] !rounded-[0] border-[0] ${\n idx !== 0 ? \"border-l border-l-[var(--color-border)]\" : \"\"\n }`;\n }\n return (\n <div className=\"icon__button_group\">\n {list.map((props, idx) => (\n <button key={idx} className={getBtnClass(idx)} {...props}>\n {props.icon && <FontAwesomeIcon icon={props.icon} />}\n </button>\n ))}\n </div>\n );\n};\n\nButton.IconButton = IconButton;\nButton.IconButtonGroup = IconButtonGroup;\n","import React from \"react\";\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nconst input__icon =\n \"w-[2rem] p-[0.9rem] px-[0.7rem] text-[1.2rem] bg-[var(--color-background-icon)] text-[var(--color-icon-input)] mr-2 group-focus-within:text-[var(--color-primary)]\";\n\nexport default function TextInput({\n label,\n labelFor,\n icon,\n outerclass,\n ...attr\n}: Readonly<\n React.InputHTMLAttributes<HTMLInputElement> & {\n label?: string;\n labelFor?: string;\n icon?: IconProp;\n outerclass?: string;\n }\n>) {\n return (\n <div className={`group ${outerclass} w-full`}>\n {label && (\n <label htmlFor={labelFor} className=\"text-input__label\">\n {label}\n </label>\n )}\n <div className={`text-input__wrapper overflow-hidden ${attr.className}`}>\n {icon && <FontAwesomeIcon icon={icon} className={input__icon} />}\n <input\n {...attr}\n className={`text-input w-full ${icon && \"!pl-[0.3rem]\"}`}\n />\n </div>\n </div>\n );\n}\n","import React from \"react\";\nimport { faCheck } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\n\nexport default function Slider(\n attr: Readonly<React.InputHTMLAttributes<HTMLInputElement>>\n) {\n return (\n <div className=\"flex items-center h-[3rem]\">\n <div className=\"slider__wrapper group\">\n <input id=\"slider\" type=\"checkbox\" className={input} {...attr} />\n <label htmlFor={attr.id || \"slider\"} className=\"slider\">\n <FontAwesomeIcon\n icon={faCheck}\n className=\"text-[0.7rem] translate-x-[0.2px]\"\n />\n </label>\n </div>\n </div>\n );\n}\n\nconst input = \"peer ... w-[3rem] h-[1.6rem] opacity-[0] cursor-pointer\";\n","\"use client\";\nimport React, { useDeferredValue, useEffect, useMemo, useState } from \"react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCheck, faChevronDown } from \"@fortawesome/free-solid-svg-icons\";\n\ntype SingleSelect = React.InputHTMLAttributes<HTMLInputElement> & {\n label?: string;\n labelHtml?: string;\n placeholder?: string;\n stateaction?: (param: any) => void;\n outerclass?: string;\n options?: {\n label: string;\n value: string;\n }[];\n stringOptions?: string[];\n};\n\nexport default function SingleSelect(attr: Readonly<SingleSelect>) {\n const { options = [], stringOptions = [], ...attrInput } = attr;\n const [keyword, setKeyword] = useState(\"\");\n const [selected, setSelected] = useState<{ label: string; value: any }>({\n label: \"\",\n value: \"\",\n });\n // const inputKeyword = useDeferredValue(keyword);\n\n function selectItem(\n { label, value }: { label: string; value: any },\n e: React.MouseEvent<HTMLButtonElement>\n ) {\n const triggerManual = attrInput.onChange;\n if (triggerManual) {\n triggerManual?.({\n target: { value, name: attrInput.name },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n setSelected({ label, value });\n if (attr.stateaction) {\n if (stringOptions) attr.stateaction(value);\n if (options) attr.stateaction({ label, value });\n }\n setKeyword(\"\");\n setTimeout(() => {\n (e.target as HTMLButtonElement).blur();\n }, 250);\n }\n\n function autoUpdateValue(updatedValue: string) {\n if (updatedValue) {\n const filtered = availableOptions.find(\n ({ value }) => value == updatedValue\n );\n if (filtered) setSelected(filtered);\n }\n }\n\n const availableOptions = useMemo(() => {\n let defaultOptions = options && options.length > 0;\n if (!defaultOptions)\n return stringOptions.map((opt) => ({ label: opt, value: opt }));\n return options;\n }, [options, stringOptions]);\n\n const filteredOptions = useMemo(() => {\n return availableOptions.filter(\n ({ label, value }) =>\n label.toLowerCase().includes(keyword.toLowerCase()) ||\n value.toLowerCase().includes(keyword.toLowerCase())\n );\n }, [keyword, availableOptions]);\n\n useEffect(() => {\n attrInput.value && autoUpdateValue(attrInput.value as string);\n }, [attrInput.value]);\n\n return (\n <div className={`w-full group ${attr.outerclass}`}>\n {attrInput.label && (\n <label className=\"text-input__label\" htmlFor={attrInput.labelHtml}>\n {attrInput.label}\n </label>\n )}\n <div className={`${attrInput.className} text-input__wrapper relative`}>\n <input\n {...attrInput}\n {...(attrInput.onChange ? { onChange: attrInput.onChange } : {})}\n value={attrInput.value ?? selected.value}\n type=\"hidden\"\n />\n <input\n value={keyword}\n type=\"search\"\n onChange={(e) => setKeyword(e.target.value)}\n className={`${attrInput.name}-keyword ${input} ${\n selected.value && \"placeholder:text-[var(--color-text-primary)]\"\n }`}\n placeholder={selected.value ? selected.label : attrInput.placeholder}\n />\n <div className=\"select-item__wrapper\">\n {filteredOptions.length == 0 && keyword != \"\" && (\n <button disabled className=\"select-item text-[var(--color-danger)]\">\n Tidak ada Item\n </button>\n )}\n {filteredOptions.map(({ label, value }) => (\n <button\n type=\"button\"\n onClick={(e) => selectItem({ label, value }, e)}\n key={value}\n className=\"select-item\"\n >\n {label}\n {selected.value == value && (\n <FontAwesomeIcon\n icon={faCheck}\n className=\"text-[var(--color-primary)]\"\n />\n )}\n </button>\n ))}\n </div>\n <FontAwesomeIcon icon={faChevronDown} className={input__icon} />\n </div>\n </div>\n );\n}\n\nSingleSelect.autoFill = autoFillInput;\n\nfunction autoFillInput(\n value: string,\n elName: string,\n list: { label: string; value: string }[]\n) {\n const inp = document.querySelector(`[name=\"${elName}\"]`) as HTMLInputElement;\n inp.value = `${value}`;\n const filtered = list.find((item) => item.value == value);\n const el = document.querySelector(`.${elName}-keyword`);\n el?.setAttribute(\"placeholder\", `${filtered?.label}`);\n}\n\nconst input__icon = \"pr-[0.7rem] text-[var(--color-icon-input)]\";\nconst input = \"text-input peer ... w-full\";\n","import React from \"react\";\n\ntype Tooltip = {\n children: React.ReactNode;\n text: string;\n position: \"top\" | \"bottom\" | \"right\" | \"left\";\n};\n\nexport default function Tooltip({\n children,\n text,\n position = \"top\",\n}: Readonly<Tooltip>) {\n function getAccent() {\n const mapping = {\n top,\n bottom,\n left,\n right,\n };\n return mapping[position];\n }\n return (\n <div className=\"relative\">\n <div className=\"peer\">{children}</div>\n <span className={`tooltip-text ${getAccent()}`}>{text}</span>\n </div>\n );\n}\n\nconst top =\n \"bottom-full translate-y-[-0.3rem] right-0 after:bottom-0 after:translate-y-[0.25rem] \";\nconst bottom =\n \"right-0 top-full translate-y-[0.3rem] after:top-[-0.4rem] after:translate-y-[0.2rem] \";\nconst right =\n \"left-full w-[max-content] translate-x-[0.6rem] after:left-[-0.2rem] top-[-0.2rem] after:top-[0.6rem]\";\nconst left =\n \"right-full w-[max-content] translate-x-[-0.6rem] top-[-0.2rem] after:right-[-0.2rem] after:top-[0.6rem]\";\n","import React from \"react\";\n\ntype Option = {\n label: string;\n value: string;\n};\n\nexport default function NavTabClient({\n items,\n state,\n}: Readonly<{\n items: Option[];\n state: {\n active: string;\n setActive: (val: string) => void;\n };\n}>) {\n return (\n <nav className=\"navtab__wrapper\">\n {items.map(({ label, value }) => (\n <button\n key={value}\n className={`navtab__item ${\n state.active == value\n ? \"navtab__item__active\"\n : \"hover:bg-[var(--color-border)]/50\"\n }`}\n onClick={() => state.setActive(value)}\n >\n {label}\n </button>\n ))}\n </nav>\n );\n}\n","import React from \"react\";\n\ntype Card = {\n children: React.ReactNode;\n className?: string;\n};\n\nexport default function Card({ children, className }: Readonly<Card>) {\n return <div className={`card ${className}`}>{children}</div>;\n}\n\nconst Footer = ({\n className,\n children,\n}: {\n className?: string;\n children?: React.ReactNode;\n}) => {\n return (\n <div className={`${className} border-t border-t-[var(--color-border)]`}>\n {children}\n </div>\n );\n};\n\nCard.Footer = Footer;\n","import React from \"react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n faCheckCircle,\n faInfoCircle,\n faQuestionCircle,\n faXmarkCircle,\n} from \"@fortawesome/free-solid-svg-icons\";\n\ntype ToastType = \"warning\" | \"success\" | \"info\" | \"danger\";\ntype Toast = {\n title: string;\n className?: string;\n description: string;\n type: ToastType;\n};\n\nexport default function Toast({\n title,\n description,\n type = \"info\",\n className,\n}: Readonly<Toast>) {\n return (\n <div className={`toast__wrapper group ${className}`}>\n <div className=\"toast__body\">\n <div style={{ background: getColor(type) }} className={bullet}></div>\n <div>\n <p className=\"toast__title\">{title}</p>\n <p className=\"toast__description\">{description}</p>\n </div>\n <div className={`toast__icon toast__icon__${type}`}></div>\n </div>\n <p\n className=\"toast__bar toast-bar-animate\"\n style={{ background: getColor(type) }}\n ></p>\n </div>\n );\n}\n\nconst Inline = ({\n className,\n text,\n type,\n}: {\n className?: string;\n text: string;\n type: ToastType;\n}) => {\n return (\n <div\n className={`toast__inline ${className}`}\n style={{ background: `var(--color-${type}-soft)`, opacity: 0.9 }}\n >\n <FontAwesomeIcon\n icon={getIcon(type)}\n className=\"text-[1.3rem]\"\n style={{ color: getColor(type) }}\n />\n <p>{text}</p>\n </div>\n );\n};\n\nToast.Inline = Inline;\n\nfunction getColor(type: string) {\n return `var(--color-${type})`;\n}\n\nfunction getIcon(type: string) {\n const mapping = {\n warning: faQuestionCircle,\n info: faInfoCircle,\n danger: faXmarkCircle,\n success: faCheckCircle,\n };\n //@ts-expect-error call object using array index\n return mapping[type];\n}\n\nconst bullet =\n \"w-[2rem] h-[2rem] absolute top-[-0.7rem] left-[-0.7rem] rounded-[50%]\";\n","import React from \"react\";\nimport { faCaretRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\n\ntype Expandable = {\n children: React.ReactNode;\n title: string;\n className?: string;\n isOpen?: boolean;\n};\n\nexport default function Expandable({\n children,\n title,\n className,\n isOpen,\n}: Readonly<Expandable>) {\n const name = title.replace(\" \", \"\");\n return (\n <div className={`expandable ${className}`}>\n <input\n id={name}\n type=\"checkbox\"\n defaultChecked={isOpen}\n className=\"opacity-[0] peer absolute top-0 ex-title\"\n />\n <FontAwesomeIcon icon={faCaretRight} className=\"expandable__icon\" />\n <label htmlFor={name} className=\"expandable__title\">\n {title}\n </label>\n <div className=\"expandable__body\">\n <div className=\"p-[0.75rem] px-[1rem]\">{children}</div>\n </div>\n </div>\n );\n}\n","import React, { useCallback, useDeferredValue, useMemo, useState } from \"react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCheck, faListCheck } from \"@fortawesome/free-solid-svg-icons\";\n\ntype Option = {\n value: string;\n label: string;\n};\n\ntype MultiSelect = {\n label?: string;\n labelHtml?: string;\n outerclass?: string;\n options?: Option[];\n stringOptions?: string[];\n state: { value: Option[]; select: (newVal: Option[]) => void };\n};\n\nexport default function MultiSelect({\n state,\n label,\n labelHtml,\n ...attr\n}: Readonly<MultiSelect>) {\n const { options = [], stringOptions = [] } = attr;\n const [keyword, setKeyword] = useState(\"\");\n\n const availableOptions = useMemo(() => {\n const isDefaultOption = options && options.length > 0;\n if (!isDefaultOption)\n return stringOptions.map((opt) => ({ label: opt, value: opt }));\n return options;\n }, [options, stringOptions]);\n\n function getFiltered() {\n return availableOptions.filter(\n ({ label, value }) =>\n label.toLowerCase().includes(keyword.toLowerCase()) ||\n value.toLowerCase().includes(keyword.toLowerCase())\n );\n }\n\n function selectItem({ label, value }: { label: string; value: string }) {\n //@ts-expect-error: avoid check\n state.select((prev) => {\n const isItemExist = prev.find((item: any) => item.value == value);\n if (isItemExist) {\n return prev.filter((item: any) => item.value != value);\n }\n return [...prev, { label, value }];\n });\n }\n\n function isItemExist(value: string) {\n return state.value.find((item: any) => item.value == value);\n }\n\n const selectUnSelectAll = useCallback(() => {\n const isAllSelected = state.value.length == availableOptions.length;\n state.select(isAllSelected ? [] : availableOptions);\n }, [state.value]);\n\n return (\n <div className={`group w-full ${attr.outerclass}`}>\n {label && (\n <label className=\"text-input__label\" htmlFor={labelHtml}>\n {label}\n </label>\n )}\n <div className=\"text-input__wrapper relative\">\n <input\n value={keyword}\n type=\"search\"\n placeholder={`${state.value.length} Dipilih`}\n className={`${input} ${\n state.value.length > 0 &&\n \"placeholder:text-[var(--color-text-primary)]\"\n }`}\n onChange={(e) => setKeyword(e.target.value)}\n />\n <div className=\"select-item__wrapper select-multiple__wrapper\">\n {getFiltered().length == 0 && keyword != \"\" && (\n <button disabled className=\"select-item text-[var(--color-danger)]\">\n Tidak ada Item\n </button>\n )}\n {getFiltered().map(({ label, value }) => (\n <button\n type=\"button\"\n onClick={() => selectItem({ label, value })}\n key={value}\n className=\"select-item\"\n >\n {label}\n {isItemExist(value) && (\n <FontAwesomeIcon\n icon={faCheck}\n className=\"text-[var(--color-primary)]\"\n />\n )}\n </button>\n ))}\n </div>\n <button\n type=\"button\"\n className=\"cursor-pointer\"\n onClick={selectUnSelectAll}\n >\n <FontAwesomeIcon icon={faListCheck} className={input__icon} />\n </button>\n </div>\n </div>\n );\n}\nconst input__icon = \"pr-[0.7rem] text-[1.2rem] text-[var(--color-icon-input)]\";\nconst input = \"text-input peer ... w-full\";\n","\"use client\";\nimport React from \"react\";\n\nexport default function ThemeToggle(\n attr: Readonly<React.InputHTMLAttributes<HTMLInputElement>>\n) {\n return (\n <div className=\"flex items-center h-[3rem]\">\n <label\n htmlFor={`${attr.id || \"theme-toggle\"}`}\n className=\"slider__wrapper slider-theme slider-theme-light\"\n >\n <input\n id=\"theme-toggle\"\n {...attr}\n type=\"checkbox\"\n className=\"peer ... w-[2rem] opacity-[0] cursor-pointer\"\n />\n <span className=\"slider-theme__bullet\"></span>\n </label>\n </div>\n );\n}\n","import React, { useState } from \"react\";\nimport MultiSelect from \"./MultiSelect\";\nimport SingleSelect from \"./SingleSelect\";\n\nconst list = [\n { label: \"Option 1\", value: \"option1\" },\n { label: \"Option 2\", value: \"option2\" },\n { label: \"Option 3\", value: \"option3\" },\n];\nconst stringList = [\"option1\", \"option2\", \"option3\"];\n\nexport default function Dashboard() {\n const [selectedItem, setSelectedItem] = useState<\n { label: string; value: string }[]\n >([]);\n const [sel, setSel] = useState({ label: \"\", value: \"\" });\n\n function updateState(item: string) {\n const filtered = list.find(({ value }) => value == item);\n filtered && setSel(filtered);\n }\n\n return (\n <div className=\"flex items-center gap-[1rem]\">\n <MultiSelect\n label=\"Multi Select\"\n stringOptions={stringList}\n state={{ value: selectedItem, select: setSelectedItem }}\n />\n <SingleSelect\n label=\"Single Select\"\n name=\"newinput\"\n stringOptions={stringList}\n placeholder=\"-- Pilih Status --\"\n value={sel.value}\n />\n </div>\n );\n}\n","import React from \"react\";\nexport default function Badge({\n text,\n type,\n className,\n}: {\n text: string;\n type: \"success\" | \"danger\" | \"warning\" | \"info\";\n className?: string;\n}) {\n return (\n <div className=\"badge__wrapper\">\n <span\n style={{\n background: `var(--color-${type})`,\n }}\n className={`badge ${className}`}\n >\n {text}\n </span>\n </div>\n );\n}\n","import React from \"react\";\nexport default function Skeleton({ className }: { className?: string }) {\n return (\n <div className={`${className} skeleton`}>\n <span className=\"skeleton__item skeleton-slide\"></span>\n </div>\n );\n}\n","import React from \"react\";\n\nexport default function Navigation() {\n return <nav></nav>;\n}\n\nconst URLNavigation = (props: {\n list: { label: string; href: string }[];\n activeUrl: string;\n outerclass?: string;\n CustomComponent?: React.ElementType;\n}) => {\n const Component = props.CustomComponent || \"a\";\n function getAnchorClass(href: string) {\n return href === props.activeUrl\n ? \"bg-[var(--color-primary-soft)] text-[var(--color-primary)]\"\n : \"text-[var(--color-text-secondary)]/70 hover:bg-[var(--color-border)]/40\";\n }\n\n return (\n <nav className={`nav__wrapper ${props.outerclass}`}>\n {props.list.map((prop) => (\n <Component\n key={prop.href}\n className={`${base__anchor} ${getAnchorClass(prop.href)}`}\n {...prop}\n >\n {prop.label}\n </Component>\n ))}\n </nav>\n );\n};\n\nNavigation.URL = URLNavigation;\n\nconst base__anchor =\n \"p-[0.8rem] h-full grid items-center transition-all leading-[1] px-[1.2rem] rounded-[0.4rem]\";\n","import React from \"react\";\n\nexport default function Confirmation({\n type = \"warning\",\n text,\n title,\n secondaryAction,\n secondaryLabel = \"Tidak\",\n mainAction,\n mainLabel = \"Ya\",\n}: {\n mainAction: () => void;\n secondaryAction?: () => void;\n mainLabel?: string;\n secondaryLabel?: string;\n title: string;\n text: string;\n type?: \"info\" | \"warning\" | \"danger\" | \"success\";\n}) {\n return (\n <div className=\"confirmation__outer\">\n <div className=\"confirmation__card\">\n <div className={wrapper}>\n <div className={`baloon__${type} baloon`}></div>\n <div>\n <h3 className=\"font-semibold\">{title}</h3>\n <p className={confirmation__text}>{text}</p>\n </div>\n </div>\n <div className=\"confirmation__footer\">\n {secondaryAction && (\n <button\n onClick={secondaryAction}\n type=\"button\"\n className=\"cursor-pointer\"\n style={{ color: `var(--color-${type})` }}\n >\n {secondaryLabel}\n </button>\n )}\n <button\n onClick={() => {\n mainAction();\n secondaryAction && secondaryAction();\n }}\n className=\"cursor-pointer btn__primary min-w-[8rem]\"\n style={{\n background: `var(--color-${type})`,\n border: `1px solid var(--color-${type})`,\n }}\n >\n {mainLabel}\n </button>\n </div>\n </div>\n </div>\n );\n}\n\nconst wrapper =\n \"pt-[0.5rem] pb-[1rem] px-[1.8rem] grid items-center gap-[1.5rem]\";\nconst confirmation__text =\n \"mt-[0.7rem] w-[90%] text-[var(--color-text-secondary)]\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAElB,+BAAgC;AAChC,kCAA8B;AASf,SAAR,OAAwB,IAOV;AAPU,eAC7B;AAAA;AAAA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I,WAAW,WAAW,IAAI,WAAW,GAC1C,+BAAAA,QAAA,cAAC,aACC,+BAAAA,QAAA,cAAC,QAAG,WAAU,mBAAiB,KAAM,GACrC,+BAAAA,QAAA,cAAC,OAAE,WAAW,sBAAqB,IAAK,CAC1C,CACF,GACA,+BAAAA,QAAA,cAAC,SAAI,WAAU,0BACZ,mBACC,+BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,SAAS;AAAA,MACT,MAAK;AAAA,MACL,WAAU;AAAA,MACV,OAAO,EAAE,OAAO,eAAe,IAAI,IAAI;AAAA;AAAA,IAEtC;AAAA,EACH,GAEF,+BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,MAAM;AACb,mBAAW;AACX,2BAAmB,gBAAgB;AAAA,MACrC;AAAA,MACA,WAAU;AAAA,MACV,OAAO;AAAA,QACL,YAAY,eAAe,IAAI;AAAA,QAC/B,QAAQ,yBAAyB,IAAI;AAAA,MACvC;AAAA;AAAA,IAEC;AAAA,EACH,CACF,CACF,CACF;AAEJ;AAEA,IAAM,UACJ;AACF,IAAM,qBACJ;","names":["React","list","import_react","import_react_fontawesome","React","import_react","import_free_solid_svg_icons","import_react_fontawesome","React","import_react","import_react_fontawesome","import_free_solid_svg_icons","React","input","input__icon","list","import_react","React","import_react","React","import_react","React","import_react","import_react_fontawesome","import_free_solid_svg_icons","React","import_react","import_free_solid_svg_icons","import_react_fontawesome","React","import_react","import_react_fontawesome","import_free_solid_svg_icons","label","isItemExist","React","input","input__icon","import_react","React","import_react","React","import_react","React","import_react","React","import_react","React","import_react","React"]}
|
package/dist/index.mjs
CHANGED
|
@@ -124,7 +124,7 @@ function Slider(attr) {
|
|
|
124
124
|
var input = "peer ... w-[3rem] h-[1.6rem] opacity-[0] cursor-pointer";
|
|
125
125
|
|
|
126
126
|
// src/components/SingleSelect.tsx
|
|
127
|
-
import React4, {
|
|
127
|
+
import React4, { useEffect, useMemo, useState } from "react";
|
|
128
128
|
import { FontAwesomeIcon as FontAwesomeIcon4 } from "@fortawesome/react-fontawesome";
|
|
129
129
|
import { faCheck as faCheck2, faChevronDown } from "@fortawesome/free-solid-svg-icons";
|
|
130
130
|
function SingleSelect(attr) {
|
|
@@ -135,7 +135,6 @@ function SingleSelect(attr) {
|
|
|
135
135
|
label: "",
|
|
136
136
|
value: ""
|
|
137
137
|
});
|
|
138
|
-
const inputKeyword = useDeferredValue(keyword);
|
|
139
138
|
function selectItem({ label, value }, e) {
|
|
140
139
|
const triggerManual = attrInput.onChange;
|
|
141
140
|
if (triggerManual) {
|
|
@@ -144,9 +143,9 @@ function SingleSelect(attr) {
|
|
|
144
143
|
});
|
|
145
144
|
}
|
|
146
145
|
setSelected({ label, value });
|
|
147
|
-
if (attr.
|
|
148
|
-
if (stringOptions) attr.
|
|
149
|
-
if (options) attr.
|
|
146
|
+
if (attr.stateaction) {
|
|
147
|
+
if (stringOptions) attr.stateaction(value);
|
|
148
|
+
if (options) attr.stateaction({ label, value });
|
|
150
149
|
}
|
|
151
150
|
setKeyword("");
|
|
152
151
|
setTimeout(() => {
|
|
@@ -169,9 +168,9 @@ function SingleSelect(attr) {
|
|
|
169
168
|
}, [options, stringOptions]);
|
|
170
169
|
const filteredOptions = useMemo(() => {
|
|
171
170
|
return availableOptions.filter(
|
|
172
|
-
({ label, value }) => label.toLowerCase().includes(
|
|
171
|
+
({ label, value }) => label.toLowerCase().includes(keyword.toLowerCase()) || value.toLowerCase().includes(keyword.toLowerCase())
|
|
173
172
|
);
|
|
174
|
-
}, [
|
|
173
|
+
}, [keyword, availableOptions]);
|
|
175
174
|
useEffect(() => {
|
|
176
175
|
attrInput.value && autoUpdateValue(attrInput.value);
|
|
177
176
|
}, [attrInput.value]);
|
|
@@ -355,7 +354,7 @@ function Expandable({
|
|
|
355
354
|
}
|
|
356
355
|
|
|
357
356
|
// src/components/MultiSelect.tsx
|
|
358
|
-
import React10, { useCallback,
|
|
357
|
+
import React10, { useCallback, useMemo as useMemo2, useState as useState2 } from "react";
|
|
359
358
|
import { FontAwesomeIcon as FontAwesomeIcon7 } from "@fortawesome/react-fontawesome";
|
|
360
359
|
import { faCheck as faCheck3, faListCheck } from "@fortawesome/free-solid-svg-icons";
|
|
361
360
|
function MultiSelect(_a) {
|
|
@@ -370,7 +369,6 @@ function MultiSelect(_a) {
|
|
|
370
369
|
]);
|
|
371
370
|
const { options = [], stringOptions = [] } = attr;
|
|
372
371
|
const [keyword, setKeyword] = useState2("");
|
|
373
|
-
const inputKeyword = useDeferredValue2(keyword);
|
|
374
372
|
const availableOptions = useMemo2(() => {
|
|
375
373
|
const isDefaultOption = options && options.length > 0;
|
|
376
374
|
if (!isDefaultOption)
|
|
@@ -379,7 +377,7 @@ function MultiSelect(_a) {
|
|
|
379
377
|
}, [options, stringOptions]);
|
|
380
378
|
function getFiltered() {
|
|
381
379
|
return availableOptions.filter(
|
|
382
|
-
({ label: label2, value }) => label2.toLowerCase().includes(
|
|
380
|
+
({ label: label2, value }) => label2.toLowerCase().includes(keyword.toLowerCase()) || value.toLowerCase().includes(keyword.toLowerCase())
|
|
383
381
|
);
|
|
384
382
|
}
|
|
385
383
|
function selectItem({ label: label2, value }) {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Button.tsx","../src/components/TextInput.tsx","../src/components/Slider.tsx","../src/components/SingleSelect.tsx","../src/components/Tooltip.tsx","../src/components/NavTabClient.tsx","../src/components/Card.tsx","../src/components/Toast.tsx","../src/components/Expandable.tsx","../src/components/MultiSelect.tsx","../src/components/ThemeToggle.tsx","../src/components/Dashboard.tsx","../src/components/Badge.tsx","../src/components/Skeleton.tsx","../src/components/Navigation.tsx","../src/components/Confirmation.tsx"],"sourcesContent":["import React from \"react\";\r\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faCircleNotch } from \"@fortawesome/free-solid-svg-icons\";\r\n\r\ntype Button = React.ButtonHTMLAttributes<HTMLButtonElement> & {\r\n icon?: IconProp;\r\n label?: string;\r\n btnType?: \"primary\" | \"secondary\" | \"tertiary\";\r\n isLoading?: boolean;\r\n};\r\n\r\nexport default function Button({\r\n label,\r\n icon,\r\n isLoading,\r\n btnType,\r\n className,\r\n ...rest\r\n}: Readonly<Button>) {\r\n const buttonIcon = isLoading ? faCircleNotch : icon;\r\n const loadingLabel = label && isLoading ? \"Memproses ...\" : \"\";\r\n return (\r\n <button\r\n {...rest}\r\n className={`${!icon && \"py-[0.84rem]\"} ${className} ${\r\n btnType == \"secondary\" && \"btn__secondary\"\r\n } btn__primary`}\r\n >\r\n {buttonIcon && icon && (\r\n <FontAwesomeIcon\r\n icon={buttonIcon}\r\n className={`text-[1.2rem] ${label && \"mr-[0.3rem]\"} ${\r\n isLoading && \"animate-spin\"\r\n }`}\r\n />\r\n )}\r\n {isLoading ? loadingLabel : label}\r\n </button>\r\n );\r\n}\r\n\r\nconst IconButton = (props: Readonly<Button>) => {\r\n return (\r\n <button\r\n {...props}\r\n className={`${props.className} ${\r\n props.label ? \"max-w-[content] px-[0.8rem]\" : \"\"\r\n } icon__button`}\r\n >\r\n {props.icon && <FontAwesomeIcon icon={props.icon} />}\r\n {props.label && (\r\n <span className=\"inline-block ml-[0.8rem] text-[1rem]\">\r\n {props.label}\r\n </span>\r\n )}\r\n </button>\r\n );\r\n};\r\n\r\nconst IconButtonGroup = ({ list }: { list: Button[] }) => {\r\n function getBtnClass(idx: number) {\r\n return `icon__button !h-[2.95rem] !rounded-[0] border-[0] ${\r\n idx !== 0 ? \"border-l border-l-[var(--color-border)]\" : \"\"\r\n }`;\r\n }\r\n return (\r\n <div className=\"icon__button_group\">\r\n {list.map((props, idx) => (\r\n <button key={idx} className={getBtnClass(idx)} {...props}>\r\n {props.icon && <FontAwesomeIcon icon={props.icon} />}\r\n </button>\r\n ))}\r\n </div>\r\n );\r\n};\r\n\r\nButton.IconButton = IconButton;\r\nButton.IconButtonGroup = IconButtonGroup;\r\n","import React from \"react\";\r\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nconst input__icon =\r\n \"w-[2rem] p-[0.9rem] px-[0.7rem] text-[1.2rem] bg-[var(--color-background-icon)] text-[var(--color-icon-input)] mr-2 group-focus-within:text-[var(--color-primary)]\";\r\n\r\nexport default function TextInput({\r\n label,\r\n labelFor,\r\n icon,\r\n outerclass,\r\n ...attr\r\n}: Readonly<\r\n React.InputHTMLAttributes<HTMLInputElement> & {\r\n label?: string;\r\n labelFor?: string;\r\n icon?: IconProp;\r\n outerclass?: string;\r\n }\r\n>) {\r\n return (\r\n <div className={`group ${outerclass} w-full`}>\r\n {label && (\r\n <label htmlFor={labelFor} className=\"text-input__label\">\r\n {label}\r\n </label>\r\n )}\r\n <div className={`text-input__wrapper overflow-hidden ${attr.className}`}>\r\n {icon && <FontAwesomeIcon icon={icon} className={input__icon} />}\r\n <input\r\n {...attr}\r\n className={`text-input w-full ${icon && \"!pl-[0.3rem]\"}`}\r\n />\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { faCheck } from \"@fortawesome/free-solid-svg-icons\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\n\r\nexport default function Slider(\r\n attr: Readonly<React.InputHTMLAttributes<HTMLInputElement>>\r\n) {\r\n return (\r\n <div className=\"flex items-center h-[3rem]\">\r\n <div className=\"slider__wrapper group\">\r\n <input id=\"slider\" type=\"checkbox\" className={input} {...attr} />\r\n <label htmlFor={attr.id || \"slider\"} className=\"slider\">\r\n <FontAwesomeIcon\r\n icon={faCheck}\r\n className=\"text-[0.7rem] translate-x-[0.2px]\"\r\n />\r\n </label>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nconst input = \"peer ... w-[3rem] h-[1.6rem] opacity-[0] cursor-pointer\";\r\n","\"use client\";\r\nimport React, { useDeferredValue, useEffect, useMemo, useState } from \"react\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faCheck, faChevronDown } from \"@fortawesome/free-solid-svg-icons\";\r\n\r\ntype SingleSelect = React.InputHTMLAttributes<HTMLInputElement> & {\r\n label?: string;\r\n labelHtml?: string;\r\n placeholder?: string;\r\n stateAction?:(param: any) => void;\r\n outerclass?: string;\r\n options?: {\r\n label: string;\r\n value: string;\r\n }[];\r\n stringOptions?: string[];\r\n};\r\n\r\nexport default function SingleSelect(attr: Readonly<SingleSelect>) {\r\n const { options = [], stringOptions = [], ...attrInput } = attr;\r\n const [keyword, setKeyword] = useState(\"\");\r\n const [selected, setSelected] = useState<{ label: string; value: any }>({\r\n label: \"\",\r\n value: \"\",\r\n });\r\n const inputKeyword = useDeferredValue(keyword);\r\n\r\n function selectItem(\r\n { label, value }: { label: string; value: any },\r\n e: React.MouseEvent<HTMLButtonElement>\r\n ) {\r\n const triggerManual = attrInput.onChange;\r\n if (triggerManual) {\r\n triggerManual?.({\r\n target: { value, name: attrInput.name },\r\n } as React.ChangeEvent<HTMLInputElement>);\r\n }\r\n setSelected({ label, value });\r\n if(attr.stateAction){\r\n if(stringOptions) attr.stateAction(value)\r\n if(options) attr.stateAction({label, value})\r\n }\r\n setKeyword(\"\");\r\n setTimeout(() => {\r\n (e.target as HTMLButtonElement).blur();\r\n }, 250);\r\n }\r\n\r\n function autoUpdateValue(updatedValue: string) {\r\n if (updatedValue) {\r\n const filtered = availableOptions.find(\r\n ({ value }) => value == updatedValue\r\n );\r\n if (filtered) setSelected(filtered);\r\n }\r\n }\r\n\r\n const availableOptions = useMemo(() => {\r\n let defaultOptions = options && options.length > 0;\r\n if (!defaultOptions)\r\n return stringOptions.map((opt) => ({ label: opt, value: opt }));\r\n return options;\r\n }, [options, stringOptions]);\r\n\r\n const filteredOptions = useMemo(() => {\r\n return availableOptions.filter(\r\n ({ label, value }) =>\r\n label.toLowerCase().includes(inputKeyword.toLowerCase()) ||\r\n value.toLowerCase().includes(inputKeyword.toLowerCase())\r\n );\r\n }, [inputKeyword, availableOptions]);\r\n\r\n useEffect(() => {\r\n attrInput.value && autoUpdateValue(attrInput.value as string);\r\n }, [attrInput.value]);\r\n\r\n return (\r\n <div className={`w-full group ${attr.outerclass}`}>\r\n {attrInput.label && (\r\n <label className=\"text-input__label\" htmlFor={attrInput.labelHtml}>\r\n {attrInput.label}\r\n </label>\r\n )}\r\n <div className={`${attrInput.className} text-input__wrapper relative`}>\r\n <input\r\n {...attrInput}\r\n {...(attrInput.onChange ? { onChange: attrInput.onChange } : {})}\r\n value={attrInput.value ?? selected.value}\r\n type=\"hidden\"\r\n />\r\n <input\r\n value={keyword}\r\n type=\"search\"\r\n onChange={(e) => setKeyword(e.target.value)}\r\n className={`${attrInput.name}-keyword ${input} ${\r\n selected.value && \"placeholder:text-[var(--color-text-primary)]\"\r\n }`}\r\n placeholder={selected.value ? selected.label : attrInput.placeholder}\r\n />\r\n <div className=\"select-item__wrapper\">\r\n {filteredOptions.length == 0 && keyword != \"\" && (\r\n <button disabled className=\"select-item text-[var(--color-danger)]\">\r\n Tidak ada Item\r\n </button>\r\n )}\r\n {filteredOptions.map(({ label, value }) => (\r\n <button\r\n type=\"button\"\r\n onClick={(e) => selectItem({ label, value }, e)}\r\n key={value}\r\n className=\"select-item\"\r\n >\r\n {label}\r\n {selected.value == value && (\r\n <FontAwesomeIcon\r\n icon={faCheck}\r\n className=\"text-[var(--color-primary)]\"\r\n />\r\n )}\r\n </button>\r\n ))}\r\n </div>\r\n <FontAwesomeIcon icon={faChevronDown} className={input__icon} />\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nSingleSelect.autoFill = autoFillInput;\r\n\r\nfunction autoFillInput(\r\n value: string,\r\n elName: string,\r\n list: { label: string; value: string }[]\r\n) {\r\n const inp = document.querySelector(`[name=\"${elName}\"]`) as HTMLInputElement;\r\n inp.value = `${value}`;\r\n const filtered = list.find((item) => item.value == value);\r\n const el = document.querySelector(`.${elName}-keyword`);\r\n el?.setAttribute(\"placeholder\", `${filtered?.label}`);\r\n}\r\n\r\nconst input__icon = \"pr-[0.7rem] text-[var(--color-icon-input)]\";\r\nconst input = \"text-input peer ... w-full\";\r\n","import React from \"react\";\r\n\r\ntype Tooltip = {\r\n children: React.ReactNode;\r\n text: string;\r\n position: \"top\" | \"bottom\" | \"right\" | \"left\";\r\n};\r\n\r\nexport default function Tooltip({\r\n children,\r\n text,\r\n position = \"top\",\r\n}: Readonly<Tooltip>) {\r\n function getAccent() {\r\n const mapping = {\r\n top,\r\n bottom,\r\n left,\r\n right,\r\n };\r\n return mapping[position];\r\n }\r\n return (\r\n <div className=\"relative\">\r\n <div className=\"peer\">{children}</div>\r\n <span className={`tooltip-text ${getAccent()}`}>{text}</span>\r\n </div>\r\n );\r\n}\r\n\r\nconst top =\r\n \"bottom-full translate-y-[-0.3rem] right-0 after:bottom-0 after:translate-y-[0.25rem] \";\r\nconst bottom =\r\n \"right-0 top-full translate-y-[0.3rem] after:top-[-0.4rem] after:translate-y-[0.2rem] \";\r\nconst right =\r\n \"left-full w-[max-content] translate-x-[0.6rem] after:left-[-0.2rem] top-[-0.2rem] after:top-[0.6rem]\";\r\nconst left =\r\n \"right-full w-[max-content] translate-x-[-0.6rem] top-[-0.2rem] after:right-[-0.2rem] after:top-[0.6rem]\";\r\n","import React from \"react\";\r\n\r\ntype Option = {\r\n label: string;\r\n value: string;\r\n};\r\n\r\nexport default function NavTabClient({\r\n items,\r\n state,\r\n}: Readonly<{\r\n items: Option[];\r\n state: {\r\n active: string;\r\n setActive: (val: string) => void;\r\n };\r\n}>) {\r\n return (\r\n <nav className=\"navtab__wrapper\">\r\n {items.map(({ label, value }) => (\r\n <button\r\n key={value}\r\n className={`navtab__item ${\r\n state.active == value\r\n ? \"navtab__item__active\"\r\n : \"hover:bg-[var(--color-border)]/50\"\r\n }`}\r\n onClick={() => state.setActive(value)}\r\n >\r\n {label}\r\n </button>\r\n ))}\r\n </nav>\r\n );\r\n}\r\n","import React from \"react\";\r\n\r\ntype Card = {\r\n children: React.ReactNode;\r\n className?: string;\r\n};\r\n\r\nexport default function Card({ children, className }: Readonly<Card>) {\r\n return <div className={`card ${className}`}>{children}</div>;\r\n}\r\n\r\nconst Footer = ({\r\n className,\r\n children,\r\n}: {\r\n className?: string;\r\n children?: React.ReactNode;\r\n}) => {\r\n return (\r\n <div className={`${className} border-t border-t-[var(--color-border)]`}>\r\n {children}\r\n </div>\r\n );\r\n};\r\n\r\nCard.Footer = Footer;\r\n","import React from \"react\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport {\r\n faCheckCircle,\r\n faInfoCircle,\r\n faQuestionCircle,\r\n faXmarkCircle,\r\n} from \"@fortawesome/free-solid-svg-icons\";\r\n\r\ntype ToastType = \"warning\" | \"success\" | \"info\" | \"danger\";\r\ntype Toast = {\r\n title: string;\r\n className?: string;\r\n description: string;\r\n type: ToastType;\r\n};\r\n\r\nexport default function Toast({\r\n title,\r\n description,\r\n type = \"info\",\r\n className,\r\n}: Readonly<Toast>) {\r\n return (\r\n <div className={`toast__wrapper group ${className}`}>\r\n <div className=\"toast__body\">\r\n <div style={{ background: getColor(type) }} className={bullet}></div>\r\n <div>\r\n <p className=\"toast__title\">{title}</p>\r\n <p className=\"toast__description\">{description}</p>\r\n </div>\r\n <div className={`toast__icon toast__icon__${type}`}></div>\r\n </div>\r\n <p\r\n className=\"toast__bar toast-bar-animate\"\r\n style={{ background: getColor(type) }}\r\n ></p>\r\n </div>\r\n );\r\n}\r\n\r\nconst Inline = ({\r\n className,\r\n text,\r\n type,\r\n}: {\r\n className?: string;\r\n text: string;\r\n type: ToastType;\r\n}) => {\r\n return (\r\n <div\r\n className={`toast__inline ${className}`}\r\n style={{ background: `var(--color-${type}-soft)`, opacity: 0.9 }}\r\n >\r\n <FontAwesomeIcon\r\n icon={getIcon(type)}\r\n className=\"text-[1.3rem]\"\r\n style={{ color: getColor(type) }}\r\n />\r\n <p>{text}</p>\r\n </div>\r\n );\r\n};\r\n\r\nToast.Inline = Inline;\r\n\r\nfunction getColor(type: string) {\r\n return `var(--color-${type})`;\r\n}\r\n\r\nfunction getIcon(type: string) {\r\n const mapping = {\r\n warning: faQuestionCircle,\r\n info: faInfoCircle,\r\n danger: faXmarkCircle,\r\n success: faCheckCircle,\r\n };\r\n //@ts-expect-error call object using array index\r\n return mapping[type];\r\n}\r\n\r\nconst bullet =\r\n \"w-[2rem] h-[2rem] absolute top-[-0.7rem] left-[-0.7rem] rounded-[50%]\";\r\n","import React from \"react\";\r\nimport { faCaretRight } from \"@fortawesome/free-solid-svg-icons\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\n\r\ntype Expandable = {\r\n children: React.ReactNode;\r\n title: string;\r\n className?: string;\r\n isOpen?: boolean;\r\n};\r\n\r\nexport default function Expandable({\r\n children,\r\n title,\r\n className,\r\n isOpen,\r\n}: Readonly<Expandable>) {\r\n const name = title.replace(\" \", \"\");\r\n return (\r\n <div className={`expandable ${className}`}>\r\n <input\r\n id={name}\r\n type=\"checkbox\"\r\n defaultChecked={isOpen}\r\n className=\"opacity-[0] peer absolute top-0 ex-title\"\r\n />\r\n <FontAwesomeIcon icon={faCaretRight} className=\"expandable__icon\" />\r\n <label htmlFor={name} className=\"expandable__title\">\r\n {title}\r\n </label>\r\n <div className=\"expandable__body\">\r\n <div className=\"p-[0.75rem] px-[1rem]\">{children}</div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import React, { useCallback, useDeferredValue, useMemo, useState } from \"react\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faCheck, faListCheck } from \"@fortawesome/free-solid-svg-icons\";\r\n\r\ntype Option = {\r\n value: string;\r\n label: string;\r\n};\r\n\r\ntype MultiSelect = {\r\n label?: string;\r\n labelHtml?: string;\r\n outerclass?: string;\r\n options?: Option[];\r\n stringOptions?: string[];\r\n state: { value: Option[]; select: (newVal: Option[]) => void };\r\n};\r\n\r\nexport default function MultiSelect({\r\n state,\r\n label,\r\n labelHtml,\r\n ...attr\r\n}: Readonly<MultiSelect>) {\r\n const { options = [], stringOptions = [] } = attr;\r\n const [keyword, setKeyword] = useState(\"\");\r\n const inputKeyword = useDeferredValue(keyword);\r\n\r\n const availableOptions = useMemo(() => {\r\n const isDefaultOption = options && options.length > 0;\r\n if (!isDefaultOption)\r\n return stringOptions.map((opt) => ({ label: opt, value: opt }));\r\n return options;\r\n }, [options, stringOptions]);\r\n\r\n function getFiltered() {\r\n return availableOptions.filter(\r\n ({ label, value }) =>\r\n label.toLowerCase().includes(inputKeyword.toLowerCase()) ||\r\n value.toLowerCase().includes(inputKeyword.toLowerCase())\r\n );\r\n }\r\n\r\n function selectItem({ label, value }: { label: string; value: string }) {\r\n //@ts-expect-error: avoid check\r\n state.select((prev) => {\r\n const isItemExist = prev.find((item: any) => item.value == value);\r\n if (isItemExist) {\r\n return prev.filter((item: any) => item.value != value);\r\n }\r\n return [...prev, { label, value }];\r\n });\r\n }\r\n\r\n function isItemExist(value: string) {\r\n return state.value.find((item: any) => item.value == value);\r\n }\r\n\r\n const selectUnSelectAll = useCallback(() => {\r\n const isAllSelected = state.value.length == availableOptions.length;\r\n state.select(isAllSelected ? [] : availableOptions);\r\n }, [state.value]);\r\n\r\n return (\r\n <div className={`group w-full ${attr.outerclass}`}>\r\n {label && (\r\n <label className=\"text-input__label\" htmlFor={labelHtml}>\r\n {label}\r\n </label>\r\n )}\r\n <div className=\"text-input__wrapper relative\">\r\n <input\r\n value={keyword}\r\n type=\"search\"\r\n placeholder={`${state.value.length} Dipilih`}\r\n className={`${input} ${\r\n state.value.length > 0 &&\r\n \"placeholder:text-[var(--color-text-primary)]\"\r\n }`}\r\n onChange={(e) => setKeyword(e.target.value)}\r\n />\r\n <div className=\"select-item__wrapper select-multiple__wrapper\">\r\n {getFiltered().length == 0 && keyword != \"\" && (\r\n <button disabled className=\"select-item text-[var(--color-danger)]\">\r\n Tidak ada Item\r\n </button>\r\n )}\r\n {getFiltered().map(({ label, value }) => (\r\n <button\r\n type=\"button\"\r\n onClick={() => selectItem({ label, value })}\r\n key={value}\r\n className=\"select-item\"\r\n >\r\n {label}\r\n {isItemExist(value) && (\r\n <FontAwesomeIcon\r\n icon={faCheck}\r\n className=\"text-[var(--color-primary)]\"\r\n />\r\n )}\r\n </button>\r\n ))}\r\n </div>\r\n <button\r\n type=\"button\"\r\n className=\"cursor-pointer\"\r\n onClick={selectUnSelectAll}\r\n >\r\n <FontAwesomeIcon icon={faListCheck} className={input__icon} />\r\n </button>\r\n </div>\r\n </div>\r\n );\r\n}\r\nconst input__icon = \"pr-[0.7rem] text-[1.2rem] text-[var(--color-icon-input)]\";\r\nconst input = \"text-input peer ... w-full\";\r\n","\"use client\";\r\nimport React from \"react\";\r\n\r\nexport default function ThemeToggle(\r\n attr: Readonly<React.InputHTMLAttributes<HTMLInputElement>>\r\n) {\r\n return (\r\n <div className=\"flex items-center h-[3rem]\">\r\n <label\r\n htmlFor={`${attr.id || \"theme-toggle\"}`}\r\n className=\"slider__wrapper slider-theme slider-theme-light\"\r\n >\r\n <input\r\n id=\"theme-toggle\"\r\n {...attr}\r\n type=\"checkbox\"\r\n className=\"peer ... w-[2rem] opacity-[0] cursor-pointer\"\r\n />\r\n <span className=\"slider-theme__bullet\"></span>\r\n </label>\r\n </div>\r\n );\r\n}\r\n","import React, { useState } from \"react\";\r\nimport MultiSelect from \"./MultiSelect\";\r\nimport SingleSelect from \"./SingleSelect\";\r\n\r\nconst list = [\r\n { label: \"Option 1\", value: \"option1\" },\r\n { label: \"Option 2\", value: \"option2\" },\r\n { label: \"Option 3\", value: \"option3\" },\r\n];\r\nconst stringList = [\"option1\", \"option2\", \"option3\"];\r\n\r\nexport default function Dashboard() {\r\n const [selectedItem, setSelectedItem] = useState<\r\n { label: string; value: string }[]\r\n >([]);\r\n const [sel, setSel] = useState({ label: \"\", value: \"\" });\r\n\r\n function updateState(item: string) {\r\n const filtered = list.find(({ value }) => value == item);\r\n filtered && setSel(filtered);\r\n }\r\n\r\n return (\r\n <div className=\"flex items-center gap-[1rem]\">\r\n <MultiSelect\r\n label=\"Multi Select\"\r\n stringOptions={stringList}\r\n state={{ value: selectedItem, select: setSelectedItem }}\r\n />\r\n <SingleSelect\r\n label=\"Single Select\"\r\n name=\"newinput\"\r\n stringOptions={stringList}\r\n placeholder=\"-- Pilih Status --\"\r\n value={sel.value}\r\n />\r\n </div>\r\n );\r\n}\r\n","import React from \"react\";\r\nexport default function Badge({\r\n text,\r\n type,\r\n className,\r\n}: {\r\n text: string;\r\n type: \"success\" | \"danger\" | \"warning\" | \"info\";\r\n className?: string;\r\n}) {\r\n return (\r\n <div className=\"badge__wrapper\">\r\n <span\r\n style={{\r\n background: `var(--color-${type})`,\r\n }}\r\n className={`badge ${className}`}\r\n >\r\n {text}\r\n </span>\r\n </div>\r\n );\r\n}\r\n","import React from \"react\";\r\nexport default function Skeleton({ className }: { className?: string }) {\r\n return (\r\n <div className={`${className} skeleton`}>\r\n <span className=\"skeleton__item skeleton-slide\"></span>\r\n </div>\r\n );\r\n}\r\n","import React from \"react\";\r\n\r\nexport default function Navigation() {\r\n return <nav></nav>;\r\n}\r\n\r\nconst URLNavigation = (props: {\r\n list: { label: string; href: string }[];\r\n activeUrl: string;\r\n outerclass?: string;\r\n CustomComponent?: React.ElementType;\r\n}) => {\r\n const Component = props.CustomComponent || \"a\";\r\n function getAnchorClass(href: string) {\r\n return href === props.activeUrl\r\n ? \"bg-[var(--color-primary-soft)] text-[var(--color-primary)]\"\r\n : \"text-[var(--color-text-secondary)]/70 hover:bg-[var(--color-border)]/40\";\r\n }\r\n\r\n return (\r\n <nav className={`nav__wrapper ${props.outerclass}`}>\r\n {props.list.map((prop) => (\r\n <Component\r\n key={prop.href}\r\n className={`${base__anchor} ${getAnchorClass(prop.href)}`}\r\n {...prop}\r\n >\r\n {prop.label}\r\n </Component>\r\n ))}\r\n </nav>\r\n );\r\n};\r\n\r\nNavigation.URL = URLNavigation;\r\n\r\nconst base__anchor =\r\n \"p-[0.8rem] h-full grid items-center transition-all leading-[1] px-[1.2rem] rounded-[0.4rem]\";\r\n","import React from \"react\";\r\n\r\nexport default function Confirmation({\r\n type = \"warning\",\r\n text,\r\n title,\r\n secondaryAction,\r\n secondaryLabel = \"Tidak\",\r\n mainAction,\r\n mainLabel = \"Ya\",\r\n}: {\r\n mainAction: () => void;\r\n secondaryAction?: () => void;\r\n mainLabel?: string;\r\n secondaryLabel?: string;\r\n title: string;\r\n text: string;\r\n type?: \"info\" | \"warning\" | \"danger\" | \"success\";\r\n}) {\r\n return (\r\n <div className=\"confirmation__outer\">\r\n <div className=\"confirmation__card\">\r\n <div className={wrapper}>\r\n <div className={`baloon__${type} baloon`}></div>\r\n <div>\r\n <h3 className=\"font-semibold\">{title}</h3>\r\n <p className={confirmation__text}>{text}</p>\r\n </div>\r\n </div>\r\n <div className=\"confirmation__footer\">\r\n {secondaryAction && (\r\n <button\r\n onClick={secondaryAction}\r\n type=\"button\"\r\n className=\"cursor-pointer\"\r\n style={{ color: `var(--color-${type})` }}\r\n >\r\n {secondaryLabel}\r\n </button>\r\n )}\r\n <button\r\n onClick={() => {\r\n mainAction();\r\n secondaryAction && secondaryAction();\r\n }}\r\n className=\"cursor-pointer btn__primary min-w-[8rem]\"\r\n style={{\r\n background: `var(--color-${type})`,\r\n border: `1px solid var(--color-${type})`,\r\n }}\r\n >\r\n {mainLabel}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nconst wrapper =\r\n \"pt-[0.5rem] pb-[1rem] px-[1.8rem] grid items-center gap-[1.5rem]\";\r\nconst confirmation__text =\r\n \"mt-[0.7rem] w-[90%] text-[var(--color-text-secondary)]\";\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AAElB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AASf,SAAR,OAAwB,IAOV;AAPU,eAC7B;AAAA;AAAA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AACd,GAQG;AACD,SACE,gBAAAA,QAAA,cAAC,SAAI,WAAU,yBACb,gBAAAA,QAAA,cAAC,SAAI,WAAU,wBACb,gBAAAA,QAAA,cAAC,SAAI,WAAW,WACd,gBAAAA,QAAA,cAAC,SAAI,WAAW,WAAW,IAAI,WAAW,GAC1C,gBAAAA,QAAA,cAAC,aACC,gBAAAA,QAAA,cAAC,QAAG,WAAU,mBAAiB,KAAM,GACrC,gBAAAA,QAAA,cAAC,OAAE,WAAW,sBAAqB,IAAK,CAC1C,CACF,GACA,gBAAAA,QAAA,cAAC,SAAI,WAAU,0BACZ,mBACC,gBAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,SAAS;AAAA,MACT,MAAK;AAAA,MACL,WAAU;AAAA,MACV,OAAO,EAAE,OAAO,eAAe,IAAI,IAAI;AAAA;AAAA,IAEtC;AAAA,EACH,GAEF,gBAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,MAAM;AACb,mBAAW;AACX,2BAAmB,gBAAgB;AAAA,MACrC;AAAA,MACA,WAAU;AAAA,MACV,OAAO;AAAA,QACL,YAAY,eAAe,IAAI;AAAA,QAC/B,QAAQ,yBAAyB,IAAI;AAAA,MACvC;AAAA;AAAA,IAEC;AAAA,EACH,CACF,CACF,CACF;AAEJ;AAEA,IAAM,UACJ;AACF,IAAM,qBACJ;","names":["list","React","FontAwesomeIcon","React","FontAwesomeIcon","React","FontAwesomeIcon","React","FontAwesomeIcon","React","FontAwesomeIcon","faCheck","React","input","FontAwesomeIcon","faCheck","input__icon","list","React","React","React","React","FontAwesomeIcon","React","FontAwesomeIcon","React","useDeferredValue","useMemo","useState","FontAwesomeIcon","faCheck","useState","useDeferredValue","useMemo","label","isItemExist","React","input","FontAwesomeIcon","faCheck","input__icon","React","React","React","useState","useState","React","React","React","React","React","React"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Button.tsx","../src/components/TextInput.tsx","../src/components/Slider.tsx","../src/components/SingleSelect.tsx","../src/components/Tooltip.tsx","../src/components/NavTabClient.tsx","../src/components/Card.tsx","../src/components/Toast.tsx","../src/components/Expandable.tsx","../src/components/MultiSelect.tsx","../src/components/ThemeToggle.tsx","../src/components/Dashboard.tsx","../src/components/Badge.tsx","../src/components/Skeleton.tsx","../src/components/Navigation.tsx","../src/components/Confirmation.tsx"],"sourcesContent":["import React from \"react\";\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCircleNotch } from \"@fortawesome/free-solid-svg-icons\";\n\ntype Button = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n icon?: IconProp;\n label?: string;\n btnType?: \"primary\" | \"secondary\" | \"tertiary\";\n isLoading?: boolean;\n};\n\nexport default function Button({\n label,\n icon,\n isLoading,\n btnType,\n className,\n ...rest\n}: Readonly<Button>) {\n const buttonIcon = isLoading ? faCircleNotch : icon;\n const loadingLabel = label && isLoading ? \"Memproses ...\" : \"\";\n return (\n <button\n {...rest}\n className={`${!icon && \"py-[0.84rem]\"} ${className} ${\n btnType == \"secondary\" && \"btn__secondary\"\n } btn__primary`}\n >\n {buttonIcon && icon && (\n <FontAwesomeIcon\n icon={buttonIcon}\n className={`text-[1.2rem] ${label && \"mr-[0.3rem]\"} ${\n isLoading && \"animate-spin\"\n }`}\n />\n )}\n {isLoading ? loadingLabel : label}\n </button>\n );\n}\n\nconst IconButton = (props: Readonly<Button>) => {\n return (\n <button\n {...props}\n className={`${props.className} ${\n props.label ? \"max-w-[content] px-[0.8rem]\" : \"\"\n } icon__button`}\n >\n {props.icon && <FontAwesomeIcon icon={props.icon} />}\n {props.label && (\n <span className=\"inline-block ml-[0.8rem] text-[1rem]\">\n {props.label}\n </span>\n )}\n </button>\n );\n};\n\nconst IconButtonGroup = ({ list }: { list: Button[] }) => {\n function getBtnClass(idx: number) {\n return `icon__button !h-[2.95rem] !rounded-[0] border-[0] ${\n idx !== 0 ? \"border-l border-l-[var(--color-border)]\" : \"\"\n }`;\n }\n return (\n <div className=\"icon__button_group\">\n {list.map((props, idx) => (\n <button key={idx} className={getBtnClass(idx)} {...props}>\n {props.icon && <FontAwesomeIcon icon={props.icon} />}\n </button>\n ))}\n </div>\n );\n};\n\nButton.IconButton = IconButton;\nButton.IconButtonGroup = IconButtonGroup;\n","import React from \"react\";\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nconst input__icon =\n \"w-[2rem] p-[0.9rem] px-[0.7rem] text-[1.2rem] bg-[var(--color-background-icon)] text-[var(--color-icon-input)] mr-2 group-focus-within:text-[var(--color-primary)]\";\n\nexport default function TextInput({\n label,\n labelFor,\n icon,\n outerclass,\n ...attr\n}: Readonly<\n React.InputHTMLAttributes<HTMLInputElement> & {\n label?: string;\n labelFor?: string;\n icon?: IconProp;\n outerclass?: string;\n }\n>) {\n return (\n <div className={`group ${outerclass} w-full`}>\n {label && (\n <label htmlFor={labelFor} className=\"text-input__label\">\n {label}\n </label>\n )}\n <div className={`text-input__wrapper overflow-hidden ${attr.className}`}>\n {icon && <FontAwesomeIcon icon={icon} className={input__icon} />}\n <input\n {...attr}\n className={`text-input w-full ${icon && \"!pl-[0.3rem]\"}`}\n />\n </div>\n </div>\n );\n}\n","import React from \"react\";\nimport { faCheck } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\n\nexport default function Slider(\n attr: Readonly<React.InputHTMLAttributes<HTMLInputElement>>\n) {\n return (\n <div className=\"flex items-center h-[3rem]\">\n <div className=\"slider__wrapper group\">\n <input id=\"slider\" type=\"checkbox\" className={input} {...attr} />\n <label htmlFor={attr.id || \"slider\"} className=\"slider\">\n <FontAwesomeIcon\n icon={faCheck}\n className=\"text-[0.7rem] translate-x-[0.2px]\"\n />\n </label>\n </div>\n </div>\n );\n}\n\nconst input = \"peer ... w-[3rem] h-[1.6rem] opacity-[0] cursor-pointer\";\n","\"use client\";\nimport React, { useDeferredValue, useEffect, useMemo, useState } from \"react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCheck, faChevronDown } from \"@fortawesome/free-solid-svg-icons\";\n\ntype SingleSelect = React.InputHTMLAttributes<HTMLInputElement> & {\n label?: string;\n labelHtml?: string;\n placeholder?: string;\n stateaction?: (param: any) => void;\n outerclass?: string;\n options?: {\n label: string;\n value: string;\n }[];\n stringOptions?: string[];\n};\n\nexport default function SingleSelect(attr: Readonly<SingleSelect>) {\n const { options = [], stringOptions = [], ...attrInput } = attr;\n const [keyword, setKeyword] = useState(\"\");\n const [selected, setSelected] = useState<{ label: string; value: any }>({\n label: \"\",\n value: \"\",\n });\n // const inputKeyword = useDeferredValue(keyword);\n\n function selectItem(\n { label, value }: { label: string; value: any },\n e: React.MouseEvent<HTMLButtonElement>\n ) {\n const triggerManual = attrInput.onChange;\n if (triggerManual) {\n triggerManual?.({\n target: { value, name: attrInput.name },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n setSelected({ label, value });\n if (attr.stateaction) {\n if (stringOptions) attr.stateaction(value);\n if (options) attr.stateaction({ label, value });\n }\n setKeyword(\"\");\n setTimeout(() => {\n (e.target as HTMLButtonElement).blur();\n }, 250);\n }\n\n function autoUpdateValue(updatedValue: string) {\n if (updatedValue) {\n const filtered = availableOptions.find(\n ({ value }) => value == updatedValue\n );\n if (filtered) setSelected(filtered);\n }\n }\n\n const availableOptions = useMemo(() => {\n let defaultOptions = options && options.length > 0;\n if (!defaultOptions)\n return stringOptions.map((opt) => ({ label: opt, value: opt }));\n return options;\n }, [options, stringOptions]);\n\n const filteredOptions = useMemo(() => {\n return availableOptions.filter(\n ({ label, value }) =>\n label.toLowerCase().includes(keyword.toLowerCase()) ||\n value.toLowerCase().includes(keyword.toLowerCase())\n );\n }, [keyword, availableOptions]);\n\n useEffect(() => {\n attrInput.value && autoUpdateValue(attrInput.value as string);\n }, [attrInput.value]);\n\n return (\n <div className={`w-full group ${attr.outerclass}`}>\n {attrInput.label && (\n <label className=\"text-input__label\" htmlFor={attrInput.labelHtml}>\n {attrInput.label}\n </label>\n )}\n <div className={`${attrInput.className} text-input__wrapper relative`}>\n <input\n {...attrInput}\n {...(attrInput.onChange ? { onChange: attrInput.onChange } : {})}\n value={attrInput.value ?? selected.value}\n type=\"hidden\"\n />\n <input\n value={keyword}\n type=\"search\"\n onChange={(e) => setKeyword(e.target.value)}\n className={`${attrInput.name}-keyword ${input} ${\n selected.value && \"placeholder:text-[var(--color-text-primary)]\"\n }`}\n placeholder={selected.value ? selected.label : attrInput.placeholder}\n />\n <div className=\"select-item__wrapper\">\n {filteredOptions.length == 0 && keyword != \"\" && (\n <button disabled className=\"select-item text-[var(--color-danger)]\">\n Tidak ada Item\n </button>\n )}\n {filteredOptions.map(({ label, value }) => (\n <button\n type=\"button\"\n onClick={(e) => selectItem({ label, value }, e)}\n key={value}\n className=\"select-item\"\n >\n {label}\n {selected.value == value && (\n <FontAwesomeIcon\n icon={faCheck}\n className=\"text-[var(--color-primary)]\"\n />\n )}\n </button>\n ))}\n </div>\n <FontAwesomeIcon icon={faChevronDown} className={input__icon} />\n </div>\n </div>\n );\n}\n\nSingleSelect.autoFill = autoFillInput;\n\nfunction autoFillInput(\n value: string,\n elName: string,\n list: { label: string; value: string }[]\n) {\n const inp = document.querySelector(`[name=\"${elName}\"]`) as HTMLInputElement;\n inp.value = `${value}`;\n const filtered = list.find((item) => item.value == value);\n const el = document.querySelector(`.${elName}-keyword`);\n el?.setAttribute(\"placeholder\", `${filtered?.label}`);\n}\n\nconst input__icon = \"pr-[0.7rem] text-[var(--color-icon-input)]\";\nconst input = \"text-input peer ... w-full\";\n","import React from \"react\";\n\ntype Tooltip = {\n children: React.ReactNode;\n text: string;\n position: \"top\" | \"bottom\" | \"right\" | \"left\";\n};\n\nexport default function Tooltip({\n children,\n text,\n position = \"top\",\n}: Readonly<Tooltip>) {\n function getAccent() {\n const mapping = {\n top,\n bottom,\n left,\n right,\n };\n return mapping[position];\n }\n return (\n <div className=\"relative\">\n <div className=\"peer\">{children}</div>\n <span className={`tooltip-text ${getAccent()}`}>{text}</span>\n </div>\n );\n}\n\nconst top =\n \"bottom-full translate-y-[-0.3rem] right-0 after:bottom-0 after:translate-y-[0.25rem] \";\nconst bottom =\n \"right-0 top-full translate-y-[0.3rem] after:top-[-0.4rem] after:translate-y-[0.2rem] \";\nconst right =\n \"left-full w-[max-content] translate-x-[0.6rem] after:left-[-0.2rem] top-[-0.2rem] after:top-[0.6rem]\";\nconst left =\n \"right-full w-[max-content] translate-x-[-0.6rem] top-[-0.2rem] after:right-[-0.2rem] after:top-[0.6rem]\";\n","import React from \"react\";\n\ntype Option = {\n label: string;\n value: string;\n};\n\nexport default function NavTabClient({\n items,\n state,\n}: Readonly<{\n items: Option[];\n state: {\n active: string;\n setActive: (val: string) => void;\n };\n}>) {\n return (\n <nav className=\"navtab__wrapper\">\n {items.map(({ label, value }) => (\n <button\n key={value}\n className={`navtab__item ${\n state.active == value\n ? \"navtab__item__active\"\n : \"hover:bg-[var(--color-border)]/50\"\n }`}\n onClick={() => state.setActive(value)}\n >\n {label}\n </button>\n ))}\n </nav>\n );\n}\n","import React from \"react\";\n\ntype Card = {\n children: React.ReactNode;\n className?: string;\n};\n\nexport default function Card({ children, className }: Readonly<Card>) {\n return <div className={`card ${className}`}>{children}</div>;\n}\n\nconst Footer = ({\n className,\n children,\n}: {\n className?: string;\n children?: React.ReactNode;\n}) => {\n return (\n <div className={`${className} border-t border-t-[var(--color-border)]`}>\n {children}\n </div>\n );\n};\n\nCard.Footer = Footer;\n","import React from \"react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n faCheckCircle,\n faInfoCircle,\n faQuestionCircle,\n faXmarkCircle,\n} from \"@fortawesome/free-solid-svg-icons\";\n\ntype ToastType = \"warning\" | \"success\" | \"info\" | \"danger\";\ntype Toast = {\n title: string;\n className?: string;\n description: string;\n type: ToastType;\n};\n\nexport default function Toast({\n title,\n description,\n type = \"info\",\n className,\n}: Readonly<Toast>) {\n return (\n <div className={`toast__wrapper group ${className}`}>\n <div className=\"toast__body\">\n <div style={{ background: getColor(type) }} className={bullet}></div>\n <div>\n <p className=\"toast__title\">{title}</p>\n <p className=\"toast__description\">{description}</p>\n </div>\n <div className={`toast__icon toast__icon__${type}`}></div>\n </div>\n <p\n className=\"toast__bar toast-bar-animate\"\n style={{ background: getColor(type) }}\n ></p>\n </div>\n );\n}\n\nconst Inline = ({\n className,\n text,\n type,\n}: {\n className?: string;\n text: string;\n type: ToastType;\n}) => {\n return (\n <div\n className={`toast__inline ${className}`}\n style={{ background: `var(--color-${type}-soft)`, opacity: 0.9 }}\n >\n <FontAwesomeIcon\n icon={getIcon(type)}\n className=\"text-[1.3rem]\"\n style={{ color: getColor(type) }}\n />\n <p>{text}</p>\n </div>\n );\n};\n\nToast.Inline = Inline;\n\nfunction getColor(type: string) {\n return `var(--color-${type})`;\n}\n\nfunction getIcon(type: string) {\n const mapping = {\n warning: faQuestionCircle,\n info: faInfoCircle,\n danger: faXmarkCircle,\n success: faCheckCircle,\n };\n //@ts-expect-error call object using array index\n return mapping[type];\n}\n\nconst bullet =\n \"w-[2rem] h-[2rem] absolute top-[-0.7rem] left-[-0.7rem] rounded-[50%]\";\n","import React from \"react\";\nimport { faCaretRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\n\ntype Expandable = {\n children: React.ReactNode;\n title: string;\n className?: string;\n isOpen?: boolean;\n};\n\nexport default function Expandable({\n children,\n title,\n className,\n isOpen,\n}: Readonly<Expandable>) {\n const name = title.replace(\" \", \"\");\n return (\n <div className={`expandable ${className}`}>\n <input\n id={name}\n type=\"checkbox\"\n defaultChecked={isOpen}\n className=\"opacity-[0] peer absolute top-0 ex-title\"\n />\n <FontAwesomeIcon icon={faCaretRight} className=\"expandable__icon\" />\n <label htmlFor={name} className=\"expandable__title\">\n {title}\n </label>\n <div className=\"expandable__body\">\n <div className=\"p-[0.75rem] px-[1rem]\">{children}</div>\n </div>\n </div>\n );\n}\n","import React, { useCallback, useDeferredValue, useMemo, useState } from \"react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCheck, faListCheck } from \"@fortawesome/free-solid-svg-icons\";\n\ntype Option = {\n value: string;\n label: string;\n};\n\ntype MultiSelect = {\n label?: string;\n labelHtml?: string;\n outerclass?: string;\n options?: Option[];\n stringOptions?: string[];\n state: { value: Option[]; select: (newVal: Option[]) => void };\n};\n\nexport default function MultiSelect({\n state,\n label,\n labelHtml,\n ...attr\n}: Readonly<MultiSelect>) {\n const { options = [], stringOptions = [] } = attr;\n const [keyword, setKeyword] = useState(\"\");\n\n const availableOptions = useMemo(() => {\n const isDefaultOption = options && options.length > 0;\n if (!isDefaultOption)\n return stringOptions.map((opt) => ({ label: opt, value: opt }));\n return options;\n }, [options, stringOptions]);\n\n function getFiltered() {\n return availableOptions.filter(\n ({ label, value }) =>\n label.toLowerCase().includes(keyword.toLowerCase()) ||\n value.toLowerCase().includes(keyword.toLowerCase())\n );\n }\n\n function selectItem({ label, value }: { label: string; value: string }) {\n //@ts-expect-error: avoid check\n state.select((prev) => {\n const isItemExist = prev.find((item: any) => item.value == value);\n if (isItemExist) {\n return prev.filter((item: any) => item.value != value);\n }\n return [...prev, { label, value }];\n });\n }\n\n function isItemExist(value: string) {\n return state.value.find((item: any) => item.value == value);\n }\n\n const selectUnSelectAll = useCallback(() => {\n const isAllSelected = state.value.length == availableOptions.length;\n state.select(isAllSelected ? [] : availableOptions);\n }, [state.value]);\n\n return (\n <div className={`group w-full ${attr.outerclass}`}>\n {label && (\n <label className=\"text-input__label\" htmlFor={labelHtml}>\n {label}\n </label>\n )}\n <div className=\"text-input__wrapper relative\">\n <input\n value={keyword}\n type=\"search\"\n placeholder={`${state.value.length} Dipilih`}\n className={`${input} ${\n state.value.length > 0 &&\n \"placeholder:text-[var(--color-text-primary)]\"\n }`}\n onChange={(e) => setKeyword(e.target.value)}\n />\n <div className=\"select-item__wrapper select-multiple__wrapper\">\n {getFiltered().length == 0 && keyword != \"\" && (\n <button disabled className=\"select-item text-[var(--color-danger)]\">\n Tidak ada Item\n </button>\n )}\n {getFiltered().map(({ label, value }) => (\n <button\n type=\"button\"\n onClick={() => selectItem({ label, value })}\n key={value}\n className=\"select-item\"\n >\n {label}\n {isItemExist(value) && (\n <FontAwesomeIcon\n icon={faCheck}\n className=\"text-[var(--color-primary)]\"\n />\n )}\n </button>\n ))}\n </div>\n <button\n type=\"button\"\n className=\"cursor-pointer\"\n onClick={selectUnSelectAll}\n >\n <FontAwesomeIcon icon={faListCheck} className={input__icon} />\n </button>\n </div>\n </div>\n );\n}\nconst input__icon = \"pr-[0.7rem] text-[1.2rem] text-[var(--color-icon-input)]\";\nconst input = \"text-input peer ... w-full\";\n","\"use client\";\nimport React from \"react\";\n\nexport default function ThemeToggle(\n attr: Readonly<React.InputHTMLAttributes<HTMLInputElement>>\n) {\n return (\n <div className=\"flex items-center h-[3rem]\">\n <label\n htmlFor={`${attr.id || \"theme-toggle\"}`}\n className=\"slider__wrapper slider-theme slider-theme-light\"\n >\n <input\n id=\"theme-toggle\"\n {...attr}\n type=\"checkbox\"\n className=\"peer ... w-[2rem] opacity-[0] cursor-pointer\"\n />\n <span className=\"slider-theme__bullet\"></span>\n </label>\n </div>\n );\n}\n","import React, { useState } from \"react\";\nimport MultiSelect from \"./MultiSelect\";\nimport SingleSelect from \"./SingleSelect\";\n\nconst list = [\n { label: \"Option 1\", value: \"option1\" },\n { label: \"Option 2\", value: \"option2\" },\n { label: \"Option 3\", value: \"option3\" },\n];\nconst stringList = [\"option1\", \"option2\", \"option3\"];\n\nexport default function Dashboard() {\n const [selectedItem, setSelectedItem] = useState<\n { label: string; value: string }[]\n >([]);\n const [sel, setSel] = useState({ label: \"\", value: \"\" });\n\n function updateState(item: string) {\n const filtered = list.find(({ value }) => value == item);\n filtered && setSel(filtered);\n }\n\n return (\n <div className=\"flex items-center gap-[1rem]\">\n <MultiSelect\n label=\"Multi Select\"\n stringOptions={stringList}\n state={{ value: selectedItem, select: setSelectedItem }}\n />\n <SingleSelect\n label=\"Single Select\"\n name=\"newinput\"\n stringOptions={stringList}\n placeholder=\"-- Pilih Status --\"\n value={sel.value}\n />\n </div>\n );\n}\n","import React from \"react\";\nexport default function Badge({\n text,\n type,\n className,\n}: {\n text: string;\n type: \"success\" | \"danger\" | \"warning\" | \"info\";\n className?: string;\n}) {\n return (\n <div className=\"badge__wrapper\">\n <span\n style={{\n background: `var(--color-${type})`,\n }}\n className={`badge ${className}`}\n >\n {text}\n </span>\n </div>\n );\n}\n","import React from \"react\";\nexport default function Skeleton({ className }: { className?: string }) {\n return (\n <div className={`${className} skeleton`}>\n <span className=\"skeleton__item skeleton-slide\"></span>\n </div>\n );\n}\n","import React from \"react\";\n\nexport default function Navigation() {\n return <nav></nav>;\n}\n\nconst URLNavigation = (props: {\n list: { label: string; href: string }[];\n activeUrl: string;\n outerclass?: string;\n CustomComponent?: React.ElementType;\n}) => {\n const Component = props.CustomComponent || \"a\";\n function getAnchorClass(href: string) {\n return href === props.activeUrl\n ? \"bg-[var(--color-primary-soft)] text-[var(--color-primary)]\"\n : \"text-[var(--color-text-secondary)]/70 hover:bg-[var(--color-border)]/40\";\n }\n\n return (\n <nav className={`nav__wrapper ${props.outerclass}`}>\n {props.list.map((prop) => (\n <Component\n key={prop.href}\n className={`${base__anchor} ${getAnchorClass(prop.href)}`}\n {...prop}\n >\n {prop.label}\n </Component>\n ))}\n </nav>\n );\n};\n\nNavigation.URL = URLNavigation;\n\nconst base__anchor =\n \"p-[0.8rem] h-full grid items-center transition-all leading-[1] px-[1.2rem] rounded-[0.4rem]\";\n","import React from \"react\";\n\nexport default function Confirmation({\n type = \"warning\",\n text,\n title,\n secondaryAction,\n secondaryLabel = \"Tidak\",\n mainAction,\n mainLabel = \"Ya\",\n}: {\n mainAction: () => void;\n secondaryAction?: () => void;\n mainLabel?: string;\n secondaryLabel?: string;\n title: string;\n text: string;\n type?: \"info\" | \"warning\" | \"danger\" | \"success\";\n}) {\n return (\n <div className=\"confirmation__outer\">\n <div className=\"confirmation__card\">\n <div className={wrapper}>\n <div className={`baloon__${type} baloon`}></div>\n <div>\n <h3 className=\"font-semibold\">{title}</h3>\n <p className={confirmation__text}>{text}</p>\n </div>\n </div>\n <div className=\"confirmation__footer\">\n {secondaryAction && (\n <button\n onClick={secondaryAction}\n type=\"button\"\n className=\"cursor-pointer\"\n style={{ color: `var(--color-${type})` }}\n >\n {secondaryLabel}\n </button>\n )}\n <button\n onClick={() => {\n mainAction();\n secondaryAction && secondaryAction();\n }}\n className=\"cursor-pointer btn__primary min-w-[8rem]\"\n style={{\n background: `var(--color-${type})`,\n border: `1px solid var(--color-${type})`,\n }}\n >\n {mainLabel}\n </button>\n </div>\n </div>\n </div>\n );\n}\n\nconst wrapper =\n \"pt-[0.5rem] pb-[1rem] px-[1.8rem] grid items-center gap-[1.5rem]\";\nconst confirmation__text =\n \"mt-[0.7rem] w-[90%] text-[var(--color-text-secondary)]\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AAElB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AASf,SAAR,OAAwB,IAOV;AAPU,eAC7B;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAjBF,IAY+B,IAM1B,iBAN0B,IAM1B;AAAA,IALH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,aAAa,YAAY,gBAAgB;AAC/C,QAAM,eAAe,SAAS,YAAY,kBAAkB;AAC5D,SACE;AAAA,IAAC;AAAA,qCACK,OADL;AAAA,MAEC,WAAW,GAAG,CAAC,QAAQ,cAAc,IAAI,SAAS,IAChD,WAAW,eAAe,gBAC5B;AAAA;AAAA,IAEC,cAAc,QACb;AAAA,MAAC;AAAA;AAAA,QACC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AE,OAAO,eAAe,IAAI,IAAI;AAAA;AAAA,IAEtC;AAAA,EACH,GAEF,gBAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,MAAM;AACb,mBAAW;AACX,2BAAmB,gBAAgB;AAAA,MACrC;AAAA,MACA,WAAU;AAAA,MACV,OAAO;AAAA,QACL,YAAY,eAAe,IAAI;AAAA,QAC/B,QAAQ,yBAAyB,IAAI;AAAA,MACvC;AAAA;AAAA,IAEC;AAAA,EACH,CACF,CACF,CACF;AAEJ;AAEA,IAAM,UACJ;AACF,IAAM,qBACJ;","names":["list","React","FontAwesomeIcon","React","FontAwesomeIcon","React","FontAwesomeIcon","React","FontAwesomeIcon","React","FontAwesomeIcon","faCheck","React","input","FontAwesomeIcon","faCheck","input__icon","list","React","React","React","React","FontAwesomeIcon","React","FontAwesomeIcon","React","useMemo","useState","FontAwesomeIcon","faCheck","useState","useMemo","label","isItemExist","React","input","FontAwesomeIcon","faCheck","input__icon","React","React","React","useState","useState","React","React","React","React","React","React"]}
|
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
{
|
|
2
|
-
"devDependencies": {
|
|
3
|
-
"@chromatic-com/storybook": "3.2.2",
|
|
4
|
-
"@rollup/plugin-commonjs": "^28.0.6",
|
|
5
|
-
"@rollup/plugin-node-resolve": "^15.3.1",
|
|
6
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
7
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
8
|
-
"@storybook/addon-essentials": "8.4.2",
|
|
9
|
-
"@storybook/addon-interactions": "8.4.2",
|
|
10
|
-
"@storybook/addon-onboarding": "8.4.2",
|
|
11
|
-
"@storybook/addon-postcss": "^2.0.0",
|
|
12
|
-
"@storybook/addon-webpack5-compiler-swc": "1.0.5",
|
|
13
|
-
"@storybook/blocks": "8.4.2",
|
|
14
|
-
"@storybook/react": "8.4.2",
|
|
15
|
-
"@storybook/react-webpack5": "8.4.2",
|
|
16
|
-
"@storybook/test": "8.4.2",
|
|
17
|
-
"@tailwindcss/postcss": "^4.1.13",
|
|
18
|
-
"@types/react": "^18.3.12",
|
|
19
|
-
"autoprefixer": "^10.4.21",
|
|
20
|
-
"concurrently": "^9.2.0",
|
|
21
|
-
"postcss": "^8.5.6",
|
|
22
|
-
"postcss-cli": "^11.0.1",
|
|
23
|
-
"react": "^18.2.0 || ^19.0.0",
|
|
24
|
-
"react-dom": "^18.2.0 || ^19.0.0",
|
|
25
|
-
"rollup": "^4.46.2",
|
|
26
|
-
"rollup-plugin-dts": "^6.2.3",
|
|
27
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
28
|
-
"storybook": "^8.4.2",
|
|
29
|
-
"tailwindcss": "^4.1.12",
|
|
30
|
-
"tsup": "^8.5.0",
|
|
31
|
-
"typescript": "^5.9.2"
|
|
32
|
-
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"react": "^18.2.0 || ^19.0.0",
|
|
35
|
-
"react-dom": "^18.2.0 || ^19.0.0"
|
|
36
|
-
},
|
|
37
|
-
"name": "@safestrong/ppa-component-library",
|
|
38
|
-
"version": "1.6.
|
|
39
|
-
"description": "Collection of reusable components for any PPA web applications",
|
|
40
|
-
"main": "dist/index.cjs",
|
|
41
|
-
"module": "dist/index.js",
|
|
42
|
-
"types": "dist/index.d.ts",
|
|
43
|
-
"files": [
|
|
44
|
-
"dist",
|
|
45
|
-
"dist/types",
|
|
46
|
-
"dist/img"
|
|
47
|
-
],
|
|
48
|
-
"repository": "https://github.com/safestrong/ppa-component-library.git",
|
|
49
|
-
"author": "SS6 Development",
|
|
50
|
-
"license": "MIT",
|
|
51
|
-
"scripts": {
|
|
52
|
-
"build": "npm run build:css && tsup src/index.ts --dts --format esm,cjs --sourcemap",
|
|
53
|
-
"storybook": "concurrently \"npm:dev:css\" \"storybook dev -p 6006\"",
|
|
54
|
-
"build-storybook": "storybook build",
|
|
55
|
-
"build:css": "postcss ./src/styles.css -o ./dist/styles.css",
|
|
56
|
-
"dev:css": "postcss ./src/styles.css -o ./dist/styles.css --watch",
|
|
57
|
-
"rollup": "rollup -c --bundleConfigAsCjs"
|
|
58
|
-
},
|
|
59
|
-
"exports": {
|
|
60
|
-
".": {
|
|
61
|
-
"types": "./dist/index.d.ts",
|
|
62
|
-
"import": "./dist/index.js",
|
|
63
|
-
"require": "./dist/index.cjs"
|
|
64
|
-
},
|
|
65
|
-
"./styles.css": "./dist/styles.css",
|
|
66
|
-
"./img/*": "./dist/img/*"
|
|
67
|
-
},
|
|
68
|
-
"sideEffects": [
|
|
69
|
-
"**/*.css"
|
|
70
|
-
],
|
|
71
|
-
"dependencies": {
|
|
72
|
-
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
73
|
-
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
74
|
-
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
75
|
-
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
76
|
-
"@fortawesome/react-fontawesome": "^0.2.2"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"devDependencies": {
|
|
3
|
+
"@chromatic-com/storybook": "3.2.2",
|
|
4
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
5
|
+
"@rollup/plugin-node-resolve": "^15.3.1",
|
|
6
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
7
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
8
|
+
"@storybook/addon-essentials": "8.4.2",
|
|
9
|
+
"@storybook/addon-interactions": "8.4.2",
|
|
10
|
+
"@storybook/addon-onboarding": "8.4.2",
|
|
11
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
12
|
+
"@storybook/addon-webpack5-compiler-swc": "1.0.5",
|
|
13
|
+
"@storybook/blocks": "8.4.2",
|
|
14
|
+
"@storybook/react": "8.4.2",
|
|
15
|
+
"@storybook/react-webpack5": "8.4.2",
|
|
16
|
+
"@storybook/test": "8.4.2",
|
|
17
|
+
"@tailwindcss/postcss": "^4.1.13",
|
|
18
|
+
"@types/react": "^18.3.12",
|
|
19
|
+
"autoprefixer": "^10.4.21",
|
|
20
|
+
"concurrently": "^9.2.0",
|
|
21
|
+
"postcss": "^8.5.6",
|
|
22
|
+
"postcss-cli": "^11.0.1",
|
|
23
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
24
|
+
"react-dom": "^18.2.0 || ^19.0.0",
|
|
25
|
+
"rollup": "^4.46.2",
|
|
26
|
+
"rollup-plugin-dts": "^6.2.3",
|
|
27
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
28
|
+
"storybook": "^8.4.2",
|
|
29
|
+
"tailwindcss": "^4.1.12",
|
|
30
|
+
"tsup": "^8.5.0",
|
|
31
|
+
"typescript": "^5.9.2"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
35
|
+
"react-dom": "^18.2.0 || ^19.0.0"
|
|
36
|
+
},
|
|
37
|
+
"name": "@safestrong/ppa-component-library",
|
|
38
|
+
"version": "1.6.6",
|
|
39
|
+
"description": "Collection of reusable components for any PPA web applications",
|
|
40
|
+
"main": "dist/index.cjs",
|
|
41
|
+
"module": "dist/index.js",
|
|
42
|
+
"types": "dist/index.d.ts",
|
|
43
|
+
"files": [
|
|
44
|
+
"dist",
|
|
45
|
+
"dist/types",
|
|
46
|
+
"dist/img"
|
|
47
|
+
],
|
|
48
|
+
"repository": "https://github.com/safestrong/ppa-component-library.git",
|
|
49
|
+
"author": "SS6 Development",
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "npm run build:css && tsup src/index.ts --dts --format esm,cjs --sourcemap",
|
|
53
|
+
"storybook": "concurrently \"npm:dev:css\" \"storybook dev -p 6006\"",
|
|
54
|
+
"build-storybook": "storybook build",
|
|
55
|
+
"build:css": "postcss ./src/styles.css -o ./dist/styles.css",
|
|
56
|
+
"dev:css": "postcss ./src/styles.css -o ./dist/styles.css --watch",
|
|
57
|
+
"rollup": "rollup -c --bundleConfigAsCjs"
|
|
58
|
+
},
|
|
59
|
+
"exports": {
|
|
60
|
+
".": {
|
|
61
|
+
"types": "./dist/index.d.ts",
|
|
62
|
+
"import": "./dist/index.js",
|
|
63
|
+
"require": "./dist/index.cjs"
|
|
64
|
+
},
|
|
65
|
+
"./styles.css": "./dist/styles.css",
|
|
66
|
+
"./img/*": "./dist/img/*"
|
|
67
|
+
},
|
|
68
|
+
"sideEffects": [
|
|
69
|
+
"**/*.css"
|
|
70
|
+
],
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
73
|
+
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
74
|
+
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
75
|
+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
76
|
+
"@fortawesome/react-fontawesome": "^0.2.2"
|
|
77
|
+
}
|
|
78
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
# 📦 PPA Component Library
|
|
2
|
-
|
|
3
|
-
Reusable component for faster web development, simple and easy to use. Enabling user to define it's color theme, make the UI displayed consistently.
|
|
4
|
-
|
|
5
|
-
> You need additional package (mandatory) while using this component <br> > [Fontawesome](https://fontawesome.com/) and [Tailwind CSS](https://tailwindcss.com/)
|
|
6
|
-
|
|
7
|
-
## 💻 Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm i @safestrong/ppa-component-library
|
|
11
|
-
#OR
|
|
12
|
-
yarn add @safestrong/ppa-component-library
|
|
13
|
-
#OR
|
|
14
|
-
pnpm add @safestrong/ppa-component-library
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## 🕹 Usage
|
|
18
|
-
|
|
19
|
-
Import the component first <br>
|
|
20
|
-
`import { Button } from "@safestrong/ppa-component-library"` <br><br>
|
|
21
|
-
Use component in your page or your own component <br>
|
|
22
|
-
`<Button label="Click me" />`
|
|
23
|
-
|
|
24
|
-
## 📂 List
|
|
25
|
-
|
|
26
|
-
### Button - `<Button />`
|
|
27
|
-
|
|
28
|
-
| Prop | Type | Required | Default | Description |
|
|
29
|
-
| ----------- | ---------- | -------- | ------- | ---------------------------------- |
|
|
30
|
-
| `label` | `string` | ✅ Yes | — | The text inside the button. |
|
|
31
|
-
| `isLoading` | `boolean` | ❌ No | false | Loading state waiting |
|
|
32
|
-
| `btnType` | `enum` | ❌ No | primary | `primary`, `secondary`, `tertiary` |
|
|
33
|
-
| `icon` | `IconProp` | ❌ No | — | Icon inside the button. |
|
|
34
|
-
| `className` | `string` | ❌ No | — | Additional class for button. |
|
|
35
|
-
|
|
36
|
-
<hr>
|
|
37
|
-
|
|
38
|
-
### Card - `<Card />`
|
|
39
|
-
|
|
40
|
-
| Prop | Type | Required | Default | Description |
|
|
41
|
-
| ----------- | ----------------- | -------- | ------- | ------------------------- |
|
|
42
|
-
| `children` | `React.ReactNode` | ✅ Yes | — | Content inside. |
|
|
43
|
-
| `className` | `string` | ❌ No | - | Additional class for card |
|
|
44
|
-
|
|
45
|
-
<hr>
|
|
46
|
-
|
|
47
|
-
### Text Input - `<TextInput />`
|
|
48
|
-
|
|
49
|
-
| Prop | Type | Required | Default | Description |
|
|
50
|
-
| ---------- | ---------- | -------- | ------- | ---------------------------------- |
|
|
51
|
-
| `icon` | `IconProp` | ❌ No | — | Icon inside text input |
|
|
52
|
-
| `label` | `string` | ❌ No | - | Additional label if needed |
|
|
53
|
-
| `labelFor` | `string` | ❌ No | - | Label (if any) `htmlFor` attribute |
|
|
54
|
-
|
|
55
|
-
<hr>
|
|
56
|
-
|
|
57
|
-
### Toast - `<Toast />`
|
|
58
|
-
|
|
59
|
-
| Prop | Type | Required | Default | Description |
|
|
60
|
-
| ------------- | -------- | -------- | ------- | ----------------------------------- |
|
|
61
|
-
| `title` | `string` | ✅ Yes | — | Toast Title |
|
|
62
|
-
| `description` | `string` | ✅ Yes | - | Description on toast body |
|
|
63
|
-
| `type` | `enum` | ❌ No | `info` | `info`,`warning`,`success`,`danger` |
|
|
64
|
-
| `className` | `string` | ❌ No | - | Additional className for Toast body |
|
|
65
|
-
|
|
66
|
-
<hr>
|
|
67
|
-
|
|
68
|
-
### Expandable - `<Expandable />`
|
|
69
|
-
|
|
70
|
-
| Prop | Type | Required | Default | Description |
|
|
71
|
-
| ----------- | ----------------- | -------- | ------- | ------------------------------- |
|
|
72
|
-
| `title` | `string` | ✅ Yes | — | Title |
|
|
73
|
-
| `children` | `React.ReactNode` | ✅ Yes | - | Content inside |
|
|
74
|
-
| `isOpen` | `boolean` | ❌ No | false | Auto show/expand content |
|
|
75
|
-
| `className` | `string` | ❌ No | - | Additional class for Expandable |
|
|
76
|
-
|
|
77
|
-
<hr>
|
|
78
|
-
|
|
79
|
-
### Tooltip - `<Tooltip />`
|
|
80
|
-
|
|
81
|
-
| Prop | Type | Required | Default | Description |
|
|
82
|
-
| ---------- | ----------------- | -------- | ------- | -------------------------------- |
|
|
83
|
-
| `children` | `React.ReactNode` | ✅ Yes | — | Text content |
|
|
84
|
-
| `text` | `string` | ✅ Yes | - | Tooltip text |
|
|
85
|
-
| `position` | `string` | ❌ No | `top` | `top`, `bottom`, `right`, `left` |
|
|
86
|
-
|
|
87
|
-
<hr>
|
|
88
|
-
|
|
89
|
-
### Single Select - `<SingleSelect />` ✅ Client Component
|
|
90
|
-
|
|
91
|
-
| Prop | Type | Required | Default | Description |
|
|
92
|
-
| ----------- | -------------------------------- | -------- | ------- | ---------------------------------- |
|
|
93
|
-
| `label` | `string` | ❌ No | — | Additional label |
|
|
94
|
-
| `labelHtml` | `string` | ❌ No | - | Label (if any) `htmlFor` attribute |
|
|
95
|
-
| `options` | `{label:string, value:string}[]` | ❌ No | - | List Option |
|
|
96
|
-
| `stringOptions` | `string[]` | ❌ No | - | List Option |
|
|
97
|
-
|
|
98
|
-
<hr>
|
|
99
|
-
|
|
100
|
-
### Multi Select - `<MultiSelect />` ✅ Client Component
|
|
101
|
-
|
|
102
|
-
| Prop | Type | Required | Default | Description |
|
|
103
|
-
| ------- | --------------------------------- | -------- | ------- | ------------ |
|
|
104
|
-
| `state` | `React.useState<{value, select}>` | ✅ Yes | — | Text content |
|
|
105
|
-
| `options` | `{label:string, value:string}[]` | ❌ No | - | List Option |
|
|
106
|
-
`stringOptions` | `string[]` | ❌ No | - | List Option |
|
|
107
|
-
|
|
108
|
-
Example:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
export default function Dashboard() {
|
|
112
|
-
const [selectedItem, setSelectedItem] = useState([]);
|
|
113
|
-
return (
|
|
114
|
-
<MultiSelect
|
|
115
|
-
list={list}
|
|
116
|
-
state={{ value: selectedItem, select: setSelectedItem }}
|
|
117
|
-
/>
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
<hr>
|
|
123
|
-
|
|
124
|
-
### Slider - `<Slider />`
|
|
125
|
-
|
|
126
|
-
| Prop | Type | Required | Default | Description |
|
|
127
|
-
| --------------------- | --------------------- | -------- | ------- | ---------------------------------- |
|
|
128
|
-
| `InputHTMLAttributes` | `InputHTMLAttributes` | ❌ No | — | optinal attribute of input Element |
|
|
129
|
-
|
|
130
|
-
<hr>
|
|
131
|
-
|
|
132
|
-
### Theme Toggle - `<ThemeToggle />`
|
|
133
|
-
|
|
134
|
-
| Prop | Type | Required | Default | Description |
|
|
135
|
-
| --------------------- | --------------------- | -------- | ------- | ---------------------------------- |
|
|
136
|
-
| `InputHTMLAttributes` | `InputHTMLAttributes` | ❌ No | — | optinal attribute of input Element |
|
|
137
|
-
|
|
138
|
-
<hr>
|
|
139
|
-
|
|
140
|
-
### Tab Navigation - `<NavTabClient />` ✅ Client Component
|
|
141
|
-
|
|
142
|
-
| Prop | Type | Required | Default | Description |
|
|
143
|
-
| ---------- | -------------------------------- | -------- | ------- | ------------ |
|
|
144
|
-
| `children` | `React.ReactNode` | ✅ Yes | — | Text content |
|
|
145
|
-
| `state` | `string` | ✅ Yes | - | Tooltip text |
|
|
146
|
-
| `items` | `{label:string, value:string}[]` | ✅ Ye | - | List Option |
|
|
1
|
+
# 📦 PPA Component Library
|
|
2
|
+
|
|
3
|
+
Reusable component for faster web development, simple and easy to use. Enabling user to define it's color theme, make the UI displayed consistently.
|
|
4
|
+
|
|
5
|
+
> You need additional package (mandatory) while using this component <br> > [Fontawesome](https://fontawesome.com/) and [Tailwind CSS](https://tailwindcss.com/)
|
|
6
|
+
|
|
7
|
+
## 💻 Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @safestrong/ppa-component-library
|
|
11
|
+
#OR
|
|
12
|
+
yarn add @safestrong/ppa-component-library
|
|
13
|
+
#OR
|
|
14
|
+
pnpm add @safestrong/ppa-component-library
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 🕹 Usage
|
|
18
|
+
|
|
19
|
+
Import the component first <br>
|
|
20
|
+
`import { Button } from "@safestrong/ppa-component-library"` <br><br>
|
|
21
|
+
Use component in your page or your own component <br>
|
|
22
|
+
`<Button label="Click me" />`
|
|
23
|
+
|
|
24
|
+
## 📂 List
|
|
25
|
+
|
|
26
|
+
### Button - `<Button />`
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Required | Default | Description |
|
|
29
|
+
| ----------- | ---------- | -------- | ------- | ---------------------------------- |
|
|
30
|
+
| `label` | `string` | ✅ Yes | — | The text inside the button. |
|
|
31
|
+
| `isLoading` | `boolean` | ❌ No | false | Loading state waiting |
|
|
32
|
+
| `btnType` | `enum` | ❌ No | primary | `primary`, `secondary`, `tertiary` |
|
|
33
|
+
| `icon` | `IconProp` | ❌ No | — | Icon inside the button. |
|
|
34
|
+
| `className` | `string` | ❌ No | — | Additional class for button. |
|
|
35
|
+
|
|
36
|
+
<hr>
|
|
37
|
+
|
|
38
|
+
### Card - `<Card />`
|
|
39
|
+
|
|
40
|
+
| Prop | Type | Required | Default | Description |
|
|
41
|
+
| ----------- | ----------------- | -------- | ------- | ------------------------- |
|
|
42
|
+
| `children` | `React.ReactNode` | ✅ Yes | — | Content inside. |
|
|
43
|
+
| `className` | `string` | ❌ No | - | Additional class for card |
|
|
44
|
+
|
|
45
|
+
<hr>
|
|
46
|
+
|
|
47
|
+
### Text Input - `<TextInput />`
|
|
48
|
+
|
|
49
|
+
| Prop | Type | Required | Default | Description |
|
|
50
|
+
| ---------- | ---------- | -------- | ------- | ---------------------------------- |
|
|
51
|
+
| `icon` | `IconProp` | ❌ No | — | Icon inside text input |
|
|
52
|
+
| `label` | `string` | ❌ No | - | Additional label if needed |
|
|
53
|
+
| `labelFor` | `string` | ❌ No | - | Label (if any) `htmlFor` attribute |
|
|
54
|
+
|
|
55
|
+
<hr>
|
|
56
|
+
|
|
57
|
+
### Toast - `<Toast />`
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Required | Default | Description |
|
|
60
|
+
| ------------- | -------- | -------- | ------- | ----------------------------------- |
|
|
61
|
+
| `title` | `string` | ✅ Yes | — | Toast Title |
|
|
62
|
+
| `description` | `string` | ✅ Yes | - | Description on toast body |
|
|
63
|
+
| `type` | `enum` | ❌ No | `info` | `info`,`warning`,`success`,`danger` |
|
|
64
|
+
| `className` | `string` | ❌ No | - | Additional className for Toast body |
|
|
65
|
+
|
|
66
|
+
<hr>
|
|
67
|
+
|
|
68
|
+
### Expandable - `<Expandable />`
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Required | Default | Description |
|
|
71
|
+
| ----------- | ----------------- | -------- | ------- | ------------------------------- |
|
|
72
|
+
| `title` | `string` | ✅ Yes | — | Title |
|
|
73
|
+
| `children` | `React.ReactNode` | ✅ Yes | - | Content inside |
|
|
74
|
+
| `isOpen` | `boolean` | ❌ No | false | Auto show/expand content |
|
|
75
|
+
| `className` | `string` | ❌ No | - | Additional class for Expandable |
|
|
76
|
+
|
|
77
|
+
<hr>
|
|
78
|
+
|
|
79
|
+
### Tooltip - `<Tooltip />`
|
|
80
|
+
|
|
81
|
+
| Prop | Type | Required | Default | Description |
|
|
82
|
+
| ---------- | ----------------- | -------- | ------- | -------------------------------- |
|
|
83
|
+
| `children` | `React.ReactNode` | ✅ Yes | — | Text content |
|
|
84
|
+
| `text` | `string` | ✅ Yes | - | Tooltip text |
|
|
85
|
+
| `position` | `string` | ❌ No | `top` | `top`, `bottom`, `right`, `left` |
|
|
86
|
+
|
|
87
|
+
<hr>
|
|
88
|
+
|
|
89
|
+
### Single Select - `<SingleSelect />` ✅ Client Component
|
|
90
|
+
|
|
91
|
+
| Prop | Type | Required | Default | Description |
|
|
92
|
+
| ----------- | -------------------------------- | -------- | ------- | ---------------------------------- |
|
|
93
|
+
| `label` | `string` | ❌ No | — | Additional label |
|
|
94
|
+
| `labelHtml` | `string` | ❌ No | - | Label (if any) `htmlFor` attribute |
|
|
95
|
+
| `options` | `{label:string, value:string}[]` | ❌ No | - | List Option |
|
|
96
|
+
| `stringOptions` | `string[]` | ❌ No | - | List Option |
|
|
97
|
+
|
|
98
|
+
<hr>
|
|
99
|
+
|
|
100
|
+
### Multi Select - `<MultiSelect />` ✅ Client Component
|
|
101
|
+
|
|
102
|
+
| Prop | Type | Required | Default | Description |
|
|
103
|
+
| ------- | --------------------------------- | -------- | ------- | ------------ |
|
|
104
|
+
| `state` | `React.useState<{value, select}>` | ✅ Yes | — | Text content |
|
|
105
|
+
| `options` | `{label:string, value:string}[]` | ❌ No | - | List Option |
|
|
106
|
+
`stringOptions` | `string[]` | ❌ No | - | List Option |
|
|
107
|
+
|
|
108
|
+
Example:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
export default function Dashboard() {
|
|
112
|
+
const [selectedItem, setSelectedItem] = useState([]);
|
|
113
|
+
return (
|
|
114
|
+
<MultiSelect
|
|
115
|
+
list={list}
|
|
116
|
+
state={{ value: selectedItem, select: setSelectedItem }}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
<hr>
|
|
123
|
+
|
|
124
|
+
### Slider - `<Slider />`
|
|
125
|
+
|
|
126
|
+
| Prop | Type | Required | Default | Description |
|
|
127
|
+
| --------------------- | --------------------- | -------- | ------- | ---------------------------------- |
|
|
128
|
+
| `InputHTMLAttributes` | `InputHTMLAttributes` | ❌ No | — | optinal attribute of input Element |
|
|
129
|
+
|
|
130
|
+
<hr>
|
|
131
|
+
|
|
132
|
+
### Theme Toggle - `<ThemeToggle />`
|
|
133
|
+
|
|
134
|
+
| Prop | Type | Required | Default | Description |
|
|
135
|
+
| --------------------- | --------------------- | -------- | ------- | ---------------------------------- |
|
|
136
|
+
| `InputHTMLAttributes` | `InputHTMLAttributes` | ❌ No | — | optinal attribute of input Element |
|
|
137
|
+
|
|
138
|
+
<hr>
|
|
139
|
+
|
|
140
|
+
### Tab Navigation - `<NavTabClient />` ✅ Client Component
|
|
141
|
+
|
|
142
|
+
| Prop | Type | Required | Default | Description |
|
|
143
|
+
| ---------- | -------------------------------- | -------- | ------- | ------------ |
|
|
144
|
+
| `children` | `React.ReactNode` | ✅ Yes | — | Text content |
|
|
145
|
+
| `state` | `string` | ✅ Yes | - | Tooltip text |
|
|
146
|
+
| `items` | `{label:string, value:string}[]` | ✅ Ye | - | List Option |
|