@uva-glass/component-library 1.0.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/README.md +3 -0
- package/dist/SelectListbox.module-wZfvJXBJ.js +22 -0
- package/dist/SelectListbox.module-wZfvJXBJ.js.map +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Card.css +1 -0
- package/dist/assets/ClipboardButton.css +1 -0
- package/dist/assets/Icon.css +1 -0
- package/dist/assets/IconButton.css +1 -0
- package/dist/assets/InfoMessage.css +1 -0
- package/dist/assets/SectionNotification.css +1 -0
- package/dist/assets/SelectListbox.css +1 -0
- package/dist/clsx-DB4S2d7J.js +23 -0
- package/dist/clsx-DB4S2d7J.js.map +1 -0
- package/dist/components/Button/Button.d.ts +8 -0
- package/dist/components/Button/Button.js +28 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/Button.stories.d.ts +5 -0
- package/dist/components/Button/Button.stories.js +25 -0
- package/dist/components/Button/Button.stories.js.map +1 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.js +5 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Card/Card.d.ts +10 -0
- package/dist/components/Card/Card.js +41 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Card/Card.stories.d.ts +8 -0
- package/dist/components/Card/Card.stories.js +49 -0
- package/dist/components/Card/Card.stories.js.map +1 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +5 -0
- package/dist/components/Card/index.js.map +1 -0
- package/dist/components/Icon/Icon.d.ts +11 -0
- package/dist/components/Icon/Icon.js +10 -0
- package/dist/components/Icon/Icon.js.map +1 -0
- package/dist/components/Icon/Icon.stories.d.ts +6 -0
- package/dist/components/Icon/Icon.stories.js +41 -0
- package/dist/components/Icon/Icon.stories.js.map +1 -0
- package/dist/components/Icon/icons/index.d.ts +152 -0
- package/dist/components/Icon/icons/index.js +57 -0
- package/dist/components/Icon/icons/index.js.map +1 -0
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/index.js +5 -0
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/IconButton/IconButton.d.ts +9 -0
- package/dist/components/IconButton/IconButton.js +30 -0
- package/dist/components/IconButton/IconButton.js.map +1 -0
- package/dist/components/IconButton/IconButton.stories.d.ts +5 -0
- package/dist/components/IconButton/IconButton.stories.js +48 -0
- package/dist/components/IconButton/IconButton.stories.js.map +1 -0
- package/dist/components/IconButton/index.d.ts +1 -0
- package/dist/components/IconButton/index.js +5 -0
- package/dist/components/IconButton/index.js.map +1 -0
- package/dist/components/InfoMessage/InfoMassage.stories.d.ts +5 -0
- package/dist/components/InfoMessage/InfoMassage.stories.js +23 -0
- package/dist/components/InfoMessage/InfoMassage.stories.js.map +1 -0
- package/dist/components/InfoMessage/InfoMessage.d.ts +7 -0
- package/dist/components/InfoMessage/InfoMessage.js +25 -0
- package/dist/components/InfoMessage/InfoMessage.js.map +1 -0
- package/dist/components/InfoMessage/index.d.ts +1 -0
- package/dist/components/InfoMessage/index.js +5 -0
- package/dist/components/InfoMessage/index.js.map +1 -0
- package/dist/components/SectionNotification/SectionNotification.d.ts +6 -0
- package/dist/components/SectionNotification/SectionNotification.js +20 -0
- package/dist/components/SectionNotification/SectionNotification.js.map +1 -0
- package/dist/components/SectionNotification/SectionNotification.stories.d.ts +6 -0
- package/dist/components/SectionNotification/SectionNotification.stories.js +21 -0
- package/dist/components/SectionNotification/SectionNotification.stories.js.map +1 -0
- package/dist/components/SectionNotification/index.d.ts +1 -0
- package/dist/components/SectionNotification/index.js +5 -0
- package/dist/components/SectionNotification/index.js.map +1 -0
- package/dist/components/SelectListbox/SelectListBox.stories.d.ts +9 -0
- package/dist/components/SelectListbox/SelectListBox.stories.js +117 -0
- package/dist/components/SelectListbox/SelectListBox.stories.js.map +1 -0
- package/dist/components/SelectListbox/SelectListbox.d.ts +45 -0
- package/dist/components/SelectListbox/SelectListbox.js +38 -0
- package/dist/components/SelectListbox/SelectListbox.js.map +1 -0
- package/dist/components/SelectListbox/SelectProvider.d.ts +28 -0
- package/dist/components/SelectListbox/SelectProvider.js +42 -0
- package/dist/components/SelectListbox/SelectProvider.js.map +1 -0
- package/dist/components/SelectListbox/components/SelectButton.d.ts +10 -0
- package/dist/components/SelectListbox/components/SelectButton.js +69 -0
- package/dist/components/SelectListbox/components/SelectButton.js.map +1 -0
- package/dist/components/SelectListbox/components/SelectContainer.d.ts +3 -0
- package/dist/components/SelectListbox/components/SelectContainer.js +22 -0
- package/dist/components/SelectListbox/components/SelectContainer.js.map +1 -0
- package/dist/components/SelectListbox/components/SelectOption.d.ts +10 -0
- package/dist/components/SelectListbox/components/SelectOption.js +55 -0
- package/dist/components/SelectListbox/components/SelectOption.js.map +1 -0
- package/dist/components/SelectListbox/components/SelectOptionBox.d.ts +8 -0
- package/dist/components/SelectListbox/components/SelectOptionBox.js +33 -0
- package/dist/components/SelectListbox/components/SelectOptionBox.js.map +1 -0
- package/dist/components/SelectListbox/index.d.ts +1 -0
- package/dist/components/SelectListbox/index.js +5 -0
- package/dist/components/SelectListbox/index.js.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +17 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/storyComponents/ClipboardButton/ClipboardButton.d.ts +5 -0
- package/dist/components/storyComponents/ClipboardButton/ClipboardButton.js +46 -0
- package/dist/components/storyComponents/ClipboardButton/ClipboardButton.js.map +1 -0
- package/dist/components/storyComponents/ClipboardButton/index.d.ts +1 -0
- package/dist/components/storyComponents/ClipboardButton/index.js +5 -0
- package/dist/components/storyComponents/ClipboardButton/index.js.map +1 -0
- package/dist/index-CZx-Vhwf.js +17360 -0
- package/dist/index-CZx-Vhwf.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/vite-env.d.js +2 -0
- package/dist/vite-env.d.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as i, useCallback as u, useEffect as l } from "react";
|
|
3
|
+
import { useSelect as m } from "../SelectProvider.js";
|
|
4
|
+
import { s as f } from "../../../SelectListbox.module-wZfvJXBJ.js";
|
|
5
|
+
const E = ({ children: o }) => {
|
|
6
|
+
const { isOpen: r, setIsOpen: n } = m(), t = i(null), e = u(
|
|
7
|
+
({ target: s }) => {
|
|
8
|
+
!s || !t.current || t.current.contains(s) || n(!1);
|
|
9
|
+
},
|
|
10
|
+
[n]
|
|
11
|
+
);
|
|
12
|
+
return l(() => {
|
|
13
|
+
if (r)
|
|
14
|
+
return document.addEventListener("click", e, !0), document.addEventListener("scroll", e, !0), () => {
|
|
15
|
+
document.removeEventListener("click", e, !0), document.removeEventListener("scroll", e, !0);
|
|
16
|
+
};
|
|
17
|
+
}, [e, r]), /* @__PURE__ */ c("div", { className: f["select-listbox-container"], ref: t, children: o });
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
E as SelectContainer
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=SelectContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectContainer.js","sources":["../../../../src/components/SelectListbox/components/SelectContainer.tsx"],"sourcesContent":["import { useCallback, useRef, useEffect } from 'react';\n\nimport type { PropsWithChildren } from 'react';\n\nimport { useSelect } from 'components/SelectListbox/SelectProvider';\nimport styles from 'components/SelectListbox/SelectListbox.module.css';\n\nexport const SelectContainer = ({ children }: PropsWithChildren) => {\n const { isOpen, setIsOpen } = useSelect();\n const listboxRef = useRef<HTMLDivElement>(null);\n\n const onMouseEventOutside = useCallback(\n ({ target }: Event | MouseEvent) => {\n if (!target || !listboxRef.current) return;\n\n if (!listboxRef.current.contains(target as Node)) {\n setIsOpen(false);\n }\n },\n [setIsOpen]\n );\n\n useEffect(() => {\n if (!isOpen) return;\n\n document.addEventListener('click', onMouseEventOutside, true);\n document.addEventListener('scroll', onMouseEventOutside, true);\n\n return () => {\n document.removeEventListener('click', onMouseEventOutside, true);\n document.removeEventListener('scroll', onMouseEventOutside, true);\n };\n }, [onMouseEventOutside, isOpen]);\n\n return (\n <div className={styles['select-listbox-container']} ref={listboxRef}>\n {children}\n </div>\n );\n};\n"],"names":["SelectContainer","children","isOpen","setIsOpen","useSelect","listboxRef","useRef","onMouseEventOutside","useCallback","target","useEffect","jsx","styles"],"mappings":";;;;AAOO,MAAMA,IAAkB,CAAC,EAAE,UAAAC,QAAkC;AAClE,QAAM,EAAE,QAAAC,GAAQ,WAAAC,EAAU,IAAIC,EAAU,GAClCC,IAAaC,EAAuB,IAAI,GAExCC,IAAsBC;AAAA,IAC1B,CAAC,EAAE,QAAAC,EAAA,MAAiC;AAC9B,MAAA,CAACA,KAAU,CAACJ,EAAW,WAEtBA,EAAW,QAAQ,SAASI,CAAc,KAC7CN,EAAU,EAAK;AAAA,IAEnB;AAAA,IACA,CAACA,CAAS;AAAA,EAAA;AAGZ,SAAAO,EAAU,MAAM;AACd,QAAKR;AAEI,sBAAA,iBAAiB,SAASK,GAAqB,EAAI,GACnD,SAAA,iBAAiB,UAAUA,GAAqB,EAAI,GAEtD,MAAM;AACF,iBAAA,oBAAoB,SAASA,GAAqB,EAAI,GACtD,SAAA,oBAAoB,UAAUA,GAAqB,EAAI;AAAA,MAAA;AAAA,EAClE,GACC,CAACA,GAAqBL,CAAM,CAAC,GAG9B,gBAAAS,EAAC,SAAI,WAAWC,EAAO,0BAA0B,GAAG,KAAKP,GACtD,UAAAJ,EACH,CAAA;AAEJ;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OptionValue } from 'components/SelectListbox/SelectProvider';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface SelectOptionProps {
|
|
5
|
+
option: OptionValue;
|
|
6
|
+
index: number;
|
|
7
|
+
key: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const SelectOption: ({ option, index, children }: SelectOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { c as v } from "../../../clsx-DB4S2d7J.js";
|
|
3
|
+
import { useRef as D, useEffect as p } from "react";
|
|
4
|
+
import { useSelect as y } from "../SelectProvider.js";
|
|
5
|
+
import { s as b } from "../../../SelectListbox.module-wZfvJXBJ.js";
|
|
6
|
+
const S = ({ option: s, index: l, children: m }) => {
|
|
7
|
+
const f = D(null), { isOpen: c, activeIndex: r, setActiveIndex: o, selectedValue: u, setSelectedValue: n, setIsOpen: i, options: t } = y(), w = (e) => {
|
|
8
|
+
n(t[e]), i(!1);
|
|
9
|
+
}, k = (e) => {
|
|
10
|
+
switch (e.key) {
|
|
11
|
+
case "Tab":
|
|
12
|
+
e.preventDefault(), c && i(!1);
|
|
13
|
+
break;
|
|
14
|
+
case "ArrowDown":
|
|
15
|
+
case "ArrowUp":
|
|
16
|
+
if (e.preventDefault(), !c)
|
|
17
|
+
return;
|
|
18
|
+
e.key === "ArrowDown" && r < t.length - 1 && o(Number((a) => a + 1)), e.key === "ArrowUp" && r > 0 && o(Number((a) => a - 1));
|
|
19
|
+
break;
|
|
20
|
+
case "Enter":
|
|
21
|
+
e.preventDefault(), t != null && t.length && r > -1 && !t[r].disabled && w(r);
|
|
22
|
+
break;
|
|
23
|
+
case "Escape":
|
|
24
|
+
c && (e.stopPropagation(), i(!1));
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return p(() => {
|
|
29
|
+
var e, a;
|
|
30
|
+
l === r && (c ? (e = f.current) == null || e.focus() : (a = f.current) == null || a.blur());
|
|
31
|
+
}, [r, l, c]), p(() => {
|
|
32
|
+
u.value === s.value && o(l);
|
|
33
|
+
}, [l, s.value, u.value, o]), /* @__PURE__ */ d(
|
|
34
|
+
"li",
|
|
35
|
+
{
|
|
36
|
+
className: v(b["select-listbox-option"], {
|
|
37
|
+
[b["select-listbox-option--active"]]: l === r
|
|
38
|
+
}),
|
|
39
|
+
...!s.disabled && {
|
|
40
|
+
onClick: () => n(s),
|
|
41
|
+
onKeyDown: k,
|
|
42
|
+
tabIndex: 0,
|
|
43
|
+
role: "option",
|
|
44
|
+
"aria-selected": u.value === s.value
|
|
45
|
+
},
|
|
46
|
+
ref: f,
|
|
47
|
+
children: m
|
|
48
|
+
},
|
|
49
|
+
`${s.value}`
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
S as SelectOption
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=SelectOption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectOption.js","sources":["../../../../src/components/SelectListbox/components/SelectOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\n\nimport type { KeyboardEvent, ReactNode } from 'react';\nimport type { OptionValue } from 'components/SelectListbox/SelectProvider';\n\nimport { useSelect } from 'components/SelectListbox/SelectProvider';\nimport styles from 'components/SelectListbox/SelectListbox.module.css';\n\nexport interface SelectOptionProps {\n option: OptionValue;\n index: number;\n key: string;\n children: ReactNode;\n}\n\nexport const SelectOption = ({ option, index, children }: SelectOptionProps) => {\n const selectOptionRef = useRef<HTMLLIElement>(null);\n const { isOpen, activeIndex, setActiveIndex, selectedValue, setSelectedValue, setIsOpen, options } = useSelect();\n\n const handleSelectOption = (aIndex: number) => {\n setSelectedValue(options[aIndex]);\n setIsOpen(false);\n };\n\n const onOptionKeyDown = (event: KeyboardEvent<HTMLLIElement>) => {\n switch (event.key) {\n case 'Tab':\n event.preventDefault();\n if (isOpen) {\n setIsOpen(false);\n }\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n if (!isOpen) {\n return;\n }\n if (event.key === 'ArrowDown' && activeIndex < options.length - 1) {\n setActiveIndex(Number((previousIndex: number) => previousIndex + 1));\n }\n if (event.key === 'ArrowUp' && activeIndex > 0) {\n setActiveIndex(Number((previousIndex: number) => previousIndex - 1));\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (options?.length && activeIndex > -1 && !options[activeIndex].disabled) {\n handleSelectOption(activeIndex);\n }\n break;\n case 'Escape':\n if (isOpen) {\n event.stopPropagation();\n setIsOpen(false);\n }\n break;\n }\n };\n\n useEffect(() => {\n if (index === activeIndex) {\n isOpen ? selectOptionRef.current?.focus() : selectOptionRef.current?.blur();\n }\n }, [activeIndex, index, isOpen]);\n\n useEffect(() => {\n if (selectedValue.value === option.value) {\n setActiveIndex(index);\n }\n }, [index, option.value, selectedValue.value, setActiveIndex]);\n\n return (\n <li\n className={clsx(styles['select-listbox-option'], {\n [styles['select-listbox-option--active']]: index === activeIndex,\n })}\n key={`${option.value}`}\n {...(!option.disabled && {\n onClick: () => setSelectedValue(option),\n onKeyDown: onOptionKeyDown,\n tabIndex: 0,\n role: 'option',\n 'aria-selected': selectedValue.value === option.value,\n })}\n ref={selectOptionRef}\n >\n {children}\n </li>\n );\n};\n"],"names":["SelectOption","option","index","children","selectOptionRef","useRef","isOpen","activeIndex","setActiveIndex","selectedValue","setSelectedValue","setIsOpen","options","useSelect","handleSelectOption","aIndex","onOptionKeyDown","event","previousIndex","useEffect","_a","_b","jsx","clsx","styles"],"mappings":";;;;;AAgBO,MAAMA,IAAe,CAAC,EAAE,QAAAC,GAAQ,OAAAC,GAAO,UAAAC,QAAkC;AACxE,QAAAC,IAAkBC,EAAsB,IAAI,GAC5C,EAAE,QAAAC,GAAQ,aAAAC,GAAa,gBAAAC,GAAgB,eAAAC,GAAe,kBAAAC,GAAkB,WAAAC,GAAW,SAAAC,MAAYC,KAE/FC,IAAqB,CAACC,MAAmB;AAC5B,IAAAL,EAAAE,EAAQG,CAAM,CAAC,GAChCJ,EAAU,EAAK;AAAA,EAAA,GAGXK,IAAkB,CAACC,MAAwC;AAC/D,YAAQA,EAAM,KAAK;AAAA,MACjB,KAAK;AACH,QAAAA,EAAM,eAAe,GACjBX,KACFK,EAAU,EAAK;AAEjB;AAAA,MACF,KAAK;AAAA,MACL,KAAK;AAEH,YADAM,EAAM,eAAe,GACjB,CAACX;AACH;AAEF,QAAIW,EAAM,QAAQ,eAAeV,IAAcK,EAAQ,SAAS,KAC9DJ,EAAe,OAAO,CAACU,MAA0BA,IAAgB,CAAC,CAAC,GAEjED,EAAM,QAAQ,aAAaV,IAAc,KAC3CC,EAAe,OAAO,CAACU,MAA0BA,IAAgB,CAAC,CAAC;AAErE;AAAA,MACF,KAAK;AACH,QAAAD,EAAM,eAAe,GACjBL,KAAA,QAAAA,EAAS,UAAUL,IAAc,MAAM,CAACK,EAAQL,CAAW,EAAE,YAC/DO,EAAmBP,CAAW;AAEhC;AAAA,MACF,KAAK;AACH,QAAID,MACFW,EAAM,gBAAgB,GACtBN,EAAU,EAAK;AAEjB;AAAA,IACJ;AAAA,EAAA;AAGF,SAAAQ,EAAU,MAAM;;AACd,IAAIjB,MAAUK,MACZD,KAASc,IAAAhB,EAAgB,YAAhB,QAAAgB,EAAyB,WAAUC,IAAAjB,EAAgB,YAAhB,QAAAiB,EAAyB;AAAA,EAEtE,GAAA,CAACd,GAAaL,GAAOI,CAAM,CAAC,GAE/Ba,EAAU,MAAM;AACV,IAAAV,EAAc,UAAUR,EAAO,SACjCO,EAAeN,CAAK;AAAA,EACtB,GACC,CAACA,GAAOD,EAAO,OAAOQ,EAAc,OAAOD,CAAc,CAAC,GAG3D,gBAAAc;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,uBAAuB,GAAG;AAAA,QAC/C,CAACA,EAAO,+BAA+B,CAAC,GAAGtB,MAAUK;AAAA,MAAA,CACtD;AAAA,MAEA,GAAI,CAACN,EAAO,YAAY;AAAA,QACvB,SAAS,MAAMS,EAAiBT,CAAM;AAAA,QACtC,WAAWe;AAAA,QACX,UAAU;AAAA,QACV,MAAM;AAAA,QACN,iBAAiBP,EAAc,UAAUR,EAAO;AAAA,MAClD;AAAA,MACA,KAAKG;AAAA,MAEJ,UAAAD;AAAA,IAAA;AAAA,IAVI,GAAGF,EAAO,KAAK;AAAA,EAAA;AAa1B;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SelectOptionBoxProps {
|
|
4
|
+
optionPositionRight?: boolean;
|
|
5
|
+
maxOptionHeight?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const SelectOptionBox: ({ optionPositionRight, maxOptionHeight, children }: SelectOptionBoxProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m } from "react";
|
|
3
|
+
import { c as a } from "../../../clsx-DB4S2d7J.js";
|
|
4
|
+
import { s } from "../../../SelectListbox.module-wZfvJXBJ.js";
|
|
5
|
+
import { useSelect as f } from "../SelectProvider.js";
|
|
6
|
+
const d = ({ optionPositionRight: t = !1, maxOptionHeight: e, children: r }) => {
|
|
7
|
+
const { listboxId: o, isOpen: i } = f(), c = m(null);
|
|
8
|
+
return i ? /* @__PURE__ */ l(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: a(s["select-listbox__wrapper"], {
|
|
12
|
+
[s["select-listbox__wrapper--align-right"]]: t
|
|
13
|
+
}),
|
|
14
|
+
style: { maxHeight: e || "" },
|
|
15
|
+
children: /* @__PURE__ */ l(
|
|
16
|
+
"ul",
|
|
17
|
+
{
|
|
18
|
+
className: s["select-listbox"],
|
|
19
|
+
role: "listbox",
|
|
20
|
+
ref: c,
|
|
21
|
+
id: o,
|
|
22
|
+
tabIndex: -1,
|
|
23
|
+
style: { maxHeight: e || "" },
|
|
24
|
+
children: r
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
) : null;
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
d as SelectOptionBox
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=SelectOptionBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectOptionBox.js","sources":["../../../../src/components/SelectListbox/components/SelectOptionBox.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { ReactNode } from 'react';\n\nimport styles from 'components/SelectListbox/SelectListbox.module.css';\nimport { useSelect } from 'components/SelectListbox/SelectProvider';\n\nexport interface SelectOptionBoxProps {\n optionPositionRight?: boolean;\n maxOptionHeight?: string;\n children: ReactNode;\n}\n\nexport const SelectOptionBox = ({ optionPositionRight = false, maxOptionHeight, children }: SelectOptionBoxProps) => {\n const { listboxId, isOpen } = useSelect();\n const selectOptionBoxRef = useRef<HTMLUListElement>(null);\n\n if (!isOpen) return null;\n\n return (\n <div\n className={clsx(styles['select-listbox__wrapper'], {\n [styles['select-listbox__wrapper--align-right']]: optionPositionRight,\n })}\n style={{ maxHeight: maxOptionHeight ? maxOptionHeight : '' }}\n >\n <ul\n className={styles['select-listbox']}\n role=\"listbox\"\n ref={selectOptionBoxRef}\n id={listboxId}\n tabIndex={-1}\n style={{ maxHeight: maxOptionHeight ? maxOptionHeight : '' }}\n >\n {children}\n </ul>\n </div>\n );\n};\n"],"names":["SelectOptionBox","optionPositionRight","maxOptionHeight","children","listboxId","isOpen","useSelect","selectOptionBoxRef","useRef","jsx","clsx","styles"],"mappings":";;;;;AAcO,MAAMA,IAAkB,CAAC,EAAE,qBAAAC,IAAsB,IAAO,iBAAAC,GAAiB,UAAAC,QAAqC;AACnH,QAAM,EAAE,WAAAC,GAAW,QAAAC,EAAO,IAAIC,EAAU,GAClCC,IAAqBC,EAAyB,IAAI;AAExD,SAAKH,IAGH,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,yBAAyB,GAAG;AAAA,QACjD,CAACA,EAAO,sCAAsC,CAAC,GAAGV;AAAA,MAAA,CACnD;AAAA,MACD,OAAO,EAAE,WAAWC,KAAoC,GAAG;AAAA,MAE3D,UAAA,gBAAAO;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWE,EAAO,gBAAgB;AAAA,UAClC,MAAK;AAAA,UACL,KAAKJ;AAAA,UACL,IAAIH;AAAA,UACJ,UAAU;AAAA,UACV,OAAO,EAAE,WAAWF,KAAoC,GAAG;AAAA,UAE1D,UAAAC;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA,IAlBgB;AAqBtB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SelectListbox';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Button as r } from "./Button/Button.js";
|
|
2
|
+
import { Card as f } from "./Card/Card.js";
|
|
3
|
+
import { Icon as m } from "./Icon/Icon.js";
|
|
4
|
+
import { IconButton as p } from "./IconButton/IconButton.js";
|
|
5
|
+
import { InfoMessage as i } from "./InfoMessage/InfoMessage.js";
|
|
6
|
+
import { SectionNotification as s } from "./SectionNotification/SectionNotification.js";
|
|
7
|
+
import { SelectListbox as u } from "./SelectListbox/SelectListbox.js";
|
|
8
|
+
export {
|
|
9
|
+
r as Button,
|
|
10
|
+
f as Card,
|
|
11
|
+
m as Icon,
|
|
12
|
+
p as IconButton,
|
|
13
|
+
i as InfoMessage,
|
|
14
|
+
s as SectionNotification,
|
|
15
|
+
u as SelectListbox
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import '../../../assets/ClipboardButton.css';
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useState as i } from "react";
|
|
4
|
+
const C = {
|
|
5
|
+
"clipboard-button": "_clipboard-button_1ihmb_1"
|
|
6
|
+
}, n = 2e3, c = ({ text: l }) => {
|
|
7
|
+
const [o, t] = i(!1);
|
|
8
|
+
return /* @__PURE__ */ e("div", { style: { position: "relative" }, children: /* @__PURE__ */ e("button", { onClick: () => {
|
|
9
|
+
o || navigator.clipboard.writeText(l).then(() => {
|
|
10
|
+
t(!0), setTimeout(() => {
|
|
11
|
+
t(!1);
|
|
12
|
+
}, n);
|
|
13
|
+
});
|
|
14
|
+
}, className: C["clipboard-button"], children: /* @__PURE__ */ e(
|
|
15
|
+
"svg",
|
|
16
|
+
{
|
|
17
|
+
width: "15",
|
|
18
|
+
height: "15",
|
|
19
|
+
viewBox: "0 0 15 15",
|
|
20
|
+
fill: "none",
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
className: "h-3 w-3",
|
|
23
|
+
children: o ? /* @__PURE__ */ e(
|
|
24
|
+
"path",
|
|
25
|
+
{
|
|
26
|
+
d: "M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",
|
|
27
|
+
fill: "currentColor",
|
|
28
|
+
fillRule: "evenodd",
|
|
29
|
+
clipRule: "evenodd"
|
|
30
|
+
}
|
|
31
|
+
) : /* @__PURE__ */ e(
|
|
32
|
+
"path",
|
|
33
|
+
{
|
|
34
|
+
d: "M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",
|
|
35
|
+
fill: "currentColor",
|
|
36
|
+
fillRule: "evenodd",
|
|
37
|
+
clipRule: "evenodd"
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
) }) });
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
c as ClipboardButton
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=ClipboardButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClipboardButton.js","sources":["../../../../src/components/storyComponents/ClipboardButton/ClipboardButton.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport styles from './ClipboardButton.module.css';\n\ninterface ClipboardButtonProps {\n text: string;\n}\n\nconst DELAY = 2000;\n\nexport const ClipboardButton = ({ text }: ClipboardButtonProps) => {\n const [isCopied, setIsCopied] = useState(false);\n\n const handleCopyClick = () => {\n if (!isCopied) {\n void navigator.clipboard.writeText(text).then(() => {\n setIsCopied(true);\n setTimeout(() => {\n setIsCopied(false);\n }, DELAY);\n });\n }\n };\n\n return (\n <div style={{ position: 'relative' }}>\n <button onClick={handleCopyClick} className={styles['clipboard-button']}>\n <svg\n width=\"15\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-3 w-3\"\n >\n {isCopied ? (\n <path\n d=\"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n ) : (\n <path\n d=\"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n )}\n </svg>\n </button>\n </div>\n );\n};\n"],"names":["DELAY","ClipboardButton","text","isCopied","setIsCopied","useState","jsx","styles"],"mappings":";;;;GAQMA,IAAQ,KAEDC,IAAkB,CAAC,EAAE,MAAAC,QAAiC;AACjE,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK;AAa9C,SACG,gBAAAC,EAAA,OAAA,EAAI,OAAO,EAAE,UAAU,WAAW,GACjC,UAAC,gBAAAA,EAAA,UAAA,EAAO,SAbY,MAAM;AAC5B,IAAKH,KACE,UAAU,UAAU,UAAUD,CAAI,EAAE,KAAK,MAAM;AAClD,MAAAE,EAAY,EAAI,GAChB,WAAW,MAAM;AACf,QAAAA,EAAY,EAAK;AAAA,SAChBJ,CAAK;AAAA,IAAA,CACT;AAAA,EACH,GAKoC,WAAWO,EAAO,kBAAkB,GACpE,UAAA,gBAAAD;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OAAM;AAAA,MACN,WAAU;AAAA,MAET,UACCH,IAAA,gBAAAG;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAK;AAAA,UACL,UAAS;AAAA,UACT,UAAS;AAAA,QAAA;AAAA,MAAA,IAGX,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAK;AAAA,UACL,UAAS;AAAA,UACT,UAAS;AAAA,QAAA;AAAA,MACX;AAAA,IAAA;AAAA,EAAA,EAGN,CAAA,EACF,CAAA;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ClipboardButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|