azeriand-library 1.13.3 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/card/card.d.ts +5 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.esm.js +23 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +23 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
-
export type CardProps = {
|
|
1
|
+
import { MouseEventHandler, ReactNode, ElementType } from 'react';
|
|
2
|
+
export type CardProps<T extends ElementType = 'article'> = {
|
|
3
|
+
as?: T;
|
|
3
4
|
children?: ReactNode;
|
|
4
5
|
noPadding?: boolean;
|
|
5
6
|
noBlur?: boolean;
|
|
@@ -10,5 +11,5 @@ export type CardProps = {
|
|
|
10
11
|
onClick?: MouseEventHandler<HTMLElement>;
|
|
11
12
|
className?: string;
|
|
12
13
|
style?: React.CSSProperties;
|
|
13
|
-
}
|
|
14
|
-
export declare function Card({ children, noPadding, noBlur, appearance, color, intensity, dark, onClick, className, style }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
} & React.ComponentPropsWithoutRef<T>;
|
|
15
|
+
export declare function Card<T extends ElementType = 'article'>({ as, children, noPadding, noBlur, appearance, color, intensity, dark, onClick, className, style, ...rest }: CardProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export { Input } from './components/input/input';
|
|
|
8
8
|
export { Calendar } from './components/calendar/calendar';
|
|
9
9
|
export { ThemeContext, ThemeContextComponent } from './components/theme-context';
|
|
10
10
|
export { Dropdown } from './components/dropdown/dropdown';
|
|
11
|
-
export { DropdownButton } from './components/dropdown/dropdown-button';
|
|
12
11
|
export { NewSlider } from './components/slider/slider';
|
|
13
12
|
export { Tab } from './components/tab/tab';
|
|
14
13
|
export { Timeline } from './components/timeline/timeline';
|
package/dist/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
try {
|
|
4
4
|
if (typeof document != "undefined") {
|
|
5
5
|
var elementStyle = document.createElement("style");
|
|
6
|
-
elementStyle.appendChild(document.createTextNode('.card{\n /* border-radius: 20px; */\n color: var(--card-text-color, white);\n}\n\n.card.glass{\n background-color: color-mix(in oklch, var(--glass-color), transparent 80%);\n border: 1px solid color-mix(in oklch, var(--glass-color), transparent 40%);\n -webkit-backface-visibility: hidden;\n -webkit-perspective: 1000;\n -webkit-transform: translate3d(0,0,0);\n -webkit-transform: translateZ(0);\n backface-visibility: hidden;\n perspective: 1000;\n transform: translate3d(0,0,0);\n transform: translateZ(0);\n}\n\n.card.mate{\n background-color: var(--glass-color);\n}\n\n.card.outlined{\n border: solid white 2px;\n}\n\nbutton .card.ghost:hover, button .card.outlined:hover{\n background: color-mix(in oklch, var(--glass-color), transparent 80%);\n}\n\nbutton .card.glass:hover{\n box-shadow: 0 4px 10px color-mix(in oklch, var(--glass-color), transparent 85%);\n}\n\nbutton .card.mate:hover{\n background-color: color-mix(in oklch, var(--glass-color), white 10%) \n}\nbutton{\n background: none;\n color: inherit;\n border: none;\n padding: 0;\n font: inherit;\n cursor: pointer;\n outline: inherit;\n font-weight: bold;\n}\n\nbutton:focus {\n outline: revert;\n}\n.section-name{\n color: hsla(0, 0%, 100%, 0.7);\n}input:disabled{\n color: hsla(0, 0%, 100%, 0.5);\n font-weight: bold;\n}\n\ninput::-moz-placeholder{\n color: hsla(0, 0%, 100%, 0.5);\n \n}\n\ninput::placeholder{\n color: hsla(0, 0%, 100%, 0.5);\n \n}\n\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput:focus{\n outline: none;\n}.MuiDateCalendar-root{\n color: white;\n}.dropdown-content{\n box-shadow: rgba(149, 157, 165, 0.2)\n 0px 8px 24px;\n max-height: 40%vh;\n scrollbar-width: none;\n -ms-overflow-style: none;\n z-index: 10;\n}\n\n.dropdown-content::-webkit-scrollbar{\n width: 0;\n height: 0;\n}\n\n.dropdown-item:hover{\n background-color: rgb(240, 249, 255);\n}.button-open{\n border: rgb(147, 197, 253) 2px solid;\n}.vertical-line::before {\n content: "";\n position: absolute;\n width: 1.5px;\n height: 100%;\n background-color: white;\n left: 0;\n top: 0;\n transform: translateX(5.1px);\n}'));
|
|
6
|
+
elementStyle.appendChild(document.createTextNode('.card{\n /* border-radius: 20px; */\n color: var(--card-text-color, white);\n}\n\n.card.glass{\n background-color: color-mix(in oklch, var(--glass-color), transparent 80%);\n border: 1px solid color-mix(in oklch, var(--glass-color), transparent 40%);\n -webkit-backface-visibility: hidden;\n -webkit-perspective: 1000;\n -webkit-transform: translate3d(0,0,0);\n -webkit-transform: translateZ(0);\n backface-visibility: hidden;\n perspective: 1000;\n transform: translate3d(0,0,0);\n transform: translateZ(0);\n}\n\n.card.mate{\n background-color: var(--glass-color);\n}\n\n.card.outlined{\n border: solid white 2px;\n}\n\nbutton .card.ghost:hover, button .card.outlined:hover{\n background: color-mix(in oklch, var(--glass-color), transparent 80%);\n}\n\nbutton .card.glass:hover{\n box-shadow: 0 4px 10px color-mix(in oklch, var(--glass-color), transparent 85%);\n}\n\nbutton .card.mate:hover{\n background-color: color-mix(in oklch, var(--glass-color), white 10%) \n}\nbutton{\n background: none;\n color: inherit;\n border: none;\n padding: 0;\n font: inherit;\n cursor: pointer;\n outline: inherit;\n font-weight: bold;\n}\n\nbutton:focus {\n outline: revert;\n}\n.section-name{\n color: hsla(0, 0%, 100%, 0.7);\n}input:disabled{\n color: hsla(0, 0%, 100%, 0.5);\n font-weight: bold;\n}\n\ninput::-moz-placeholder{\n color: hsla(0, 0%, 100%, 0.5);\n \n}\n\ninput::placeholder{\n color: hsla(0, 0%, 100%, 0.5);\n \n}\n\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput:focus{\n outline: none;\n}.MuiDateCalendar-root{\n color: white;\n}.dropdown-content{\n box-shadow: rgba(149, 157, 165, 0.2)\n 0px 8px 24px;\n max-height: 40%vh;\n scrollbar-width: none;\n -ms-overflow-style: none;\n z-index: 10;\n}\n\n.dropdown-content::-webkit-scrollbar{\n width: 0;\n height: 0;\n}\n\n.dropdown-item:hover{\n background-color: rgb(240, 249, 255);\n}.button-open{\n border: rgb(147, 197, 253) 2px solid;\n border-radius: 7px;\n}.vertical-line::before {\n content: "";\n position: absolute;\n width: 1.5px;\n height: 100%;\n background-color: white;\n left: 0;\n top: 0;\n transform: translateX(5.1px);\n}'));
|
|
7
7
|
document.head.appendChild(elementStyle);
|
|
8
8
|
}
|
|
9
9
|
} catch (e) {
|
|
@@ -15745,7 +15745,21 @@ function ThemeContextComponent({ children }) {
|
|
|
15745
15745
|
const [theme, setTheme] = useState(DEFAULT_THEME);
|
|
15746
15746
|
return /* @__PURE__ */ jsx$1(ThemeContext.Provider, { value: { theme, setTheme }, children: /* @__PURE__ */ jsx$1(LocalizationProvider, { dateAdapter: AdapterDayjs, children }) });
|
|
15747
15747
|
}
|
|
15748
|
-
function Card({
|
|
15748
|
+
function Card({
|
|
15749
|
+
as,
|
|
15750
|
+
children,
|
|
15751
|
+
noPadding,
|
|
15752
|
+
noBlur = false,
|
|
15753
|
+
appearance = "glass",
|
|
15754
|
+
color: color2 = "neutral",
|
|
15755
|
+
intensity,
|
|
15756
|
+
dark: dark2 = true,
|
|
15757
|
+
onClick,
|
|
15758
|
+
className,
|
|
15759
|
+
style: style2,
|
|
15760
|
+
...rest
|
|
15761
|
+
}) {
|
|
15762
|
+
const Component = as || "article";
|
|
15749
15763
|
let [classNames, setClassNames] = useState("");
|
|
15750
15764
|
let [cardStyle, setCardStyle] = useState({});
|
|
15751
15765
|
const { theme } = useContext(ThemeContext);
|
|
@@ -15769,14 +15783,14 @@ function Card({ children, noPadding, noBlur = false, appearance = "glass", color
|
|
|
15769
15783
|
}
|
|
15770
15784
|
setClassNames(`card ${rounded} ${appearance} ${className} ${noPadding ? "" : "p-[2rem]"}`);
|
|
15771
15785
|
}, [color2, intensity, dark2, appearance, noBlur, className, theme]);
|
|
15772
|
-
return /* @__PURE__ */ jsx$1(
|
|
15786
|
+
return /* @__PURE__ */ jsx$1(Component, { className: classNames, style: cardStyle, onClick, ...rest, children });
|
|
15773
15787
|
}
|
|
15774
15788
|
function Button({ children, label, icon, position: position2 = "left", onClick, size, className, ...cardProps }) {
|
|
15775
|
-
let defaultCardClassNames = "flex justify-center items-center gap-x-[0.40rem] box-border cursor-pointer";
|
|
15789
|
+
let defaultCardClassNames = "flex justify-center items-center gap-x-[0.40rem] box-border cursor-pointer w-fit ";
|
|
15776
15790
|
let specificCardClassNames = "min-w-[2.5rem] px-[1rem] py-1";
|
|
15777
15791
|
if (size === "sm") {
|
|
15778
15792
|
specificCardClassNames = "min-w-auto text-xs px-[0.5rem] py-1";
|
|
15779
|
-
className =
|
|
15793
|
+
className = `${className}`;
|
|
15780
15794
|
}
|
|
15781
15795
|
if (icon && !label) {
|
|
15782
15796
|
specificCardClassNames = "square-8 p-2";
|
|
@@ -15793,12 +15807,12 @@ function Button({ children, label, icon, position: position2 = "left", onClick,
|
|
|
15793
15807
|
onClick(ev);
|
|
15794
15808
|
}
|
|
15795
15809
|
};
|
|
15796
|
-
return /* @__PURE__ */
|
|
15810
|
+
return /* @__PURE__ */ jsxs(Card, { as: "button", noBlur: true, noPadding: true, className: cardClassNames + className, onClick: buttonClick, ...cardProps, children: [
|
|
15797
15811
|
position2 === "left" && icon,
|
|
15798
15812
|
label,
|
|
15799
15813
|
children,
|
|
15800
15814
|
position2 === "right" && icon
|
|
15801
|
-
] })
|
|
15815
|
+
] });
|
|
15802
15816
|
}
|
|
15803
15817
|
function Badge({ label, size, ...cardProps }) {
|
|
15804
15818
|
let cardClassNames = "rounded-md";
|
|
@@ -15971,7 +15985,7 @@ function Input({ type, value, disabled, placeholder, size, maxLength, onChange,
|
|
|
15971
15985
|
onChange == null ? void 0 : onChange(ev.target.value);
|
|
15972
15986
|
}
|
|
15973
15987
|
const classnames = `flex`;
|
|
15974
|
-
const inputClassName = `flex justify-center items-center border-none bg-
|
|
15988
|
+
const inputClassName = `flex justify-center items-center border-none bg-transparent py-[0.5rem] px-[1rem] m-0 w-full ${centerText ? "text-center" : ""}`;
|
|
15975
15989
|
const directionClassName = iconPosition === "left" ? "pl-2" : "flex-row-reverse pr-2";
|
|
15976
15990
|
return /* @__PURE__ */ jsx$1("div", { className: classnames, children: /* @__PURE__ */ jsxs(Card, { className: `flex justify-center items-center rounded-md ${className} ${icon ? directionClassName : ""}`, noBlur: true, noPadding: true, ...cardProps, style: cardProps.style, children: [
|
|
15977
15991
|
icon && /* @__PURE__ */ jsx$1("div", { className: "flex items-center", children: icon }),
|
|
@@ -16034,7 +16048,7 @@ function Dropdown({ buttonText, options = [], onSelected }) {
|
|
|
16034
16048
|
};
|
|
16035
16049
|
return /* @__PURE__ */ jsxs("div", { tabIndex: 0, className: "relative w-fit", onBlur: () => setOpen(false), children: [
|
|
16036
16050
|
/* @__PURE__ */ jsx$1(DropdownButton, { toggle: toggleDropdown, open, children: optionSelected }),
|
|
16037
|
-
open && /* @__PURE__ */ jsx$1(Card, { noBlur: true, appearance: "
|
|
16051
|
+
open && /* @__PURE__ */ jsx$1(Card, { noPadding: true, noBlur: true, appearance: "outlined", className: "absolute flex flex-col items-center p-[0.5rem] mt-[0.5rem] w-full text-center rounded-lg overflow-y-scroll dropdown-content", children: options.map((option) => /* @__PURE__ */ jsx$1("div", { className: "p-[0.5rem] m-[0.1rem] w-full rounded-lg cursor-pointer", onMouseDown: () => itemClicked(option), children: option }, option)) })
|
|
16038
16052
|
] });
|
|
16039
16053
|
}
|
|
16040
16054
|
function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {
|
|
@@ -17864,7 +17878,6 @@ export {
|
|
|
17864
17878
|
Card,
|
|
17865
17879
|
Checkbox,
|
|
17866
17880
|
Dropdown,
|
|
17867
|
-
DropdownButton,
|
|
17868
17881
|
Input,
|
|
17869
17882
|
NewSlider,
|
|
17870
17883
|
SectionName,
|