@lism-css/ui 0.2.3 → 0.8.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.
Files changed (60) hide show
  1. package/dist/components/Accordion/astro/index.d.ts +10 -10
  2. package/dist/components/Accordion/getProps.d.ts +40 -19
  3. package/dist/components/Accordion/react/AccIcon.d.ts +1 -6
  4. package/dist/components/Accordion/react/Accordion.d.ts +23 -7
  5. package/dist/components/Accordion/react/index.d.ts +6 -4
  6. package/dist/components/Accordion/setAccordion.d.ts +4 -1
  7. package/dist/components/Accordion/setAccordion.js +39 -42
  8. package/dist/components/Callout/getProps.d.ts +1 -1
  9. package/dist/components/Details/astro/index.d.ts +13 -0
  10. package/dist/components/Details/getProps.d.ts +40 -0
  11. package/dist/components/Details/react/Details.d.ts +37 -0
  12. package/dist/components/Details/react/index.d.ts +9 -0
  13. package/dist/components/Modal/getProps.d.ts +2 -2
  14. package/dist/components/Modal/setModal.d.ts +3 -0
  15. package/dist/components/Modal/setModal.js +24 -29
  16. package/dist/components/Tabs/getProps.d.ts +1 -1
  17. package/dist/components/astro.d.ts +1 -0
  18. package/dist/components/react.d.ts +1 -0
  19. package/dist/helper/animation.d.ts +18 -0
  20. package/dist/helper/animation.js +12 -0
  21. package/dist/helper/uuid.d.ts +1 -0
  22. package/dist/style.css +1 -1
  23. package/package.json +2 -2
  24. package/src/components/Accordion/_style.css +60 -35
  25. package/src/components/Accordion/astro/Button.astro +13 -0
  26. package/src/components/Accordion/astro/Heading.astro +10 -0
  27. package/src/components/Accordion/astro/Icon.astro +15 -0
  28. package/src/components/Accordion/astro/Item.astro +31 -0
  29. package/src/components/Accordion/astro/Panel.astro +14 -0
  30. package/src/components/Accordion/astro/Root.astro +17 -0
  31. package/src/components/Accordion/astro/index.js +10 -7
  32. package/src/components/Accordion/getProps.js +61 -16
  33. package/src/components/Accordion/react/AccIcon.jsx +5 -4
  34. package/src/components/Accordion/react/Accordion.jsx +56 -28
  35. package/src/components/Accordion/react/index.js +6 -3
  36. package/src/components/Accordion/setAccordion.js +114 -88
  37. package/src/components/Callout/getProps.ts +1 -1
  38. package/src/components/Details/_style.css +48 -0
  39. package/src/components/Details/astro/Content.astro +17 -0
  40. package/src/components/Details/astro/Details.astro +18 -0
  41. package/src/components/Details/astro/Icon.astro +14 -0
  42. package/src/components/{Accordion/astro/AccLabel.astro → Details/astro/Summary.astro} +1 -2
  43. package/src/components/Details/astro/Title.astro +10 -0
  44. package/src/components/Details/astro/index.js +10 -0
  45. package/src/components/Details/getProps.js +23 -0
  46. package/src/components/Details/react/Details.jsx +66 -0
  47. package/src/components/Details/react/index.js +6 -0
  48. package/src/components/Modal/script.js +1 -0
  49. package/src/components/Modal/setModal.ts +64 -68
  50. package/src/components/Tabs/astro/Tabs.astro +3 -2
  51. package/src/components/astro.ts +1 -0
  52. package/src/components/react.ts +1 -0
  53. package/src/helper/animation.ts +36 -0
  54. package/src/{components/Tabs/astro/helper.js → helper/uuid.js} +1 -1
  55. package/dist/components/Tabs/astro/helper.d.ts +0 -1
  56. package/src/components/Accordion/astro/AccBody.astro +0 -13
  57. package/src/components/Accordion/astro/AccHeader.astro +0 -13
  58. package/src/components/Accordion/astro/AccHeaderLabel.astro +0 -12
  59. package/src/components/Accordion/astro/AccIcon.astro +0 -17
  60. package/src/components/Accordion/astro/Accordion.astro +0 -22
@@ -1,15 +1,15 @@
1
- import { default as Root } from './Accordion.astro';
2
- import { default as Header } from './AccHeader.astro';
3
- import { default as HeaderLabel } from './AccHeaderLabel.astro';
4
- import { default as Body } from './AccBody.astro';
5
- import { default as Icon } from './AccIcon.astro';
6
- import { default as Label } from './AccLabel.astro';
1
+ import { default as Root } from './Root.astro';
2
+ import { default as Item } from './Item.astro';
3
+ import { default as Heading } from './Heading.astro';
4
+ import { default as Panel } from './Panel.astro';
5
+ import { default as Icon } from './Icon.astro';
6
+ import { default as Button } from './Button.astro';
7
7
  declare namespace _default {
8
8
  export { Root };
9
- export { Header };
10
- export { HeaderLabel };
11
- export { Body };
9
+ export { Item };
10
+ export { Heading };
11
+ export { Panel };
12
12
  export { Icon };
13
- export { Label };
13
+ export { Button };
14
14
  }
15
15
  export default _default;
@@ -1,31 +1,52 @@
1
- export function getAccProps({ lismClass, ...props }: {
1
+ export function getRootProps({ lismClass, allowMultiple, ...props }: {
2
2
  [x: string]: any;
3
3
  lismClass: any;
4
+ allowMultiple: any;
4
5
  }): {
5
6
  [x: string]: any;
6
7
  };
7
- export function getAccIconProps({ isTrigger, ...props }: {
8
+ export function getItemProps({ lismClass, ...props }: {
8
9
  [x: string]: any;
9
- isTrigger: any;
10
+ lismClass: any;
10
11
  }): {
11
- lismClass: string;
12
- tag: string;
12
+ [x: string]: any;
13
+ };
14
+ export function getHeadingProps(props: any): any;
15
+ export function getPanelProps({ lismClass, _contextID, accID, isOpen, ...props }: {
16
+ [x: string]: any;
17
+ lismClass: any;
18
+ _contextID: any;
19
+ accID?: string | undefined;
20
+ isOpen?: boolean | undefined;
21
+ }): {
22
+ panelProps: {
23
+ lismClass: string;
24
+ id: any;
25
+ hidden: string | undefined;
26
+ pos: string;
27
+ ov: string;
28
+ };
29
+ contentProps: {
30
+ lismClass: string;
31
+ layout: string;
32
+ };
13
33
  };
14
34
  export namespace defaultProps {
15
- namespace header {
35
+ namespace button {
16
36
  let lismClass: string;
37
+ let tag: string;
38
+ let layout: string;
39
+ let setPlain: number;
40
+ let g: string;
41
+ let w: string;
42
+ let ai: string;
43
+ let jc: string;
17
44
  }
18
- namespace label {
19
- let lismClass_1: string;
20
- export { lismClass_1 as lismClass };
21
- export let tag: string;
22
- }
23
- namespace body {
24
- let lismClass_2: string;
25
- export { lismClass_2 as lismClass };
26
- }
27
- namespace inner {
28
- let lismClass_3: string;
29
- export { lismClass_3 as lismClass };
30
- }
45
+ let icon: {
46
+ lismClass: string;
47
+ tag: string;
48
+ pi: string;
49
+ fxsh: string;
50
+ 'aria-hidden': string;
51
+ };
31
52
  }
@@ -1,6 +1 @@
1
- export default function AccIcon({ icon, viewBox, children, ...props }: {
2
- [x: string]: any;
3
- icon?: string | undefined;
4
- viewBox: any;
5
- children?: null | undefined;
6
- }): import("react").JSX.Element;
1
+ export default function AccIcon(props: any): import("react").JSX.Element;
@@ -1,23 +1,39 @@
1
1
  import { default as React } from 'react';
2
- export function Accordion({ children, ...props }: {
2
+ /**
3
+ * 複数の AccordionItem をラップするルート要素
4
+ */
5
+ export function AccordionRoot({ children, ...props }: {
3
6
  [x: string]: any;
4
7
  children: any;
5
8
  }): React.JSX.Element;
6
- export function Header({ children, ...props }: {
9
+ /**
10
+ * 個別のアコーディオンアイテム(<div> ベース、setEvent で開閉イベントを登録)
11
+ */
12
+ export function AccordionItem({ children, ...props }: {
7
13
  [x: string]: any;
8
14
  children: any;
9
15
  }): React.JSX.Element;
10
- export function Label({ children, ...props }: {
16
+ /**
17
+ * 見出しエリアのラッパー(デフォルトは <div role="heading">)
18
+ * tag に h2〜h6 を指定すると role は付与されない
19
+ */
20
+ export function Heading({ children, ...props }: {
11
21
  [x: string]: any;
12
22
  children: any;
13
23
  }): React.JSX.Element;
14
- export function Body({ children, flow, innerProps, ...props }: {
24
+ /**
25
+ * 開閉トリガーボタン
26
+ * accID: Context から取得できればそれを優先、なければ props / プレースホルダー
27
+ */
28
+ export function Button({ children, accID: _accID, ...props }: {
15
29
  [x: string]: any;
16
30
  children: any;
17
- flow: any;
18
- innerProps: any;
31
+ accID?: string | undefined;
19
32
  }): React.JSX.Element;
20
- export function HeaderLabel({ children, ...props }: {
33
+ /**
34
+ * パネル
35
+ */
36
+ export function Panel({ children, ...props }: {
21
37
  [x: string]: any;
22
38
  children: any;
23
39
  }): React.JSX.Element;
@@ -1,11 +1,13 @@
1
- import { Accordion as Root, Header, Label, Body, HeaderLabel } from './Accordion';
1
+ import { AccordionRoot as Root, AccordionItem as Item, Heading, Panel, Button } from './Accordion';
2
2
  import { default as Icon } from './AccIcon';
3
3
  declare namespace _default {
4
4
  export { Root };
5
+ export { Item };
5
6
  export { Header };
6
- export { Label };
7
+ export { Heading };
8
+ export { Panel };
7
9
  export { Icon };
8
- export { Body };
9
- export { HeaderLabel };
10
+ export { Button };
10
11
  }
11
12
  export default _default;
13
+ declare const Header: typeof Heading;
@@ -1,3 +1,6 @@
1
- export function setEvent(details: any): (() => void) | undefined;
1
+ export function setEvent(accordionItem: any): () => void;
2
2
  export default setAccordion;
3
+ /**
4
+ * ページ内の全アコーディオンにイベントをセット(Astro用)
5
+ */
3
6
  declare function setAccordion(): void;
@@ -1,48 +1,45 @@
1
- const l = (e) => {
2
- const t = e.querySelector(".c--accordion_body"), n = t ? t.getAnimations() : [];
3
- return Promise.allSettled(n.map((o) => o.finished));
4
- }, s = async (e) => {
5
- e.open && e.hasAttribute("data-opened") || (e.open = !0, requestAnimationFrame(() => {
6
- e.setAttribute("data-opened", "");
7
- }));
8
- }, a = async (e) => {
9
- !e.open && !e.hasAttribute("data-opened") || (e.removeAttribute("data-opened"), await l(e), e.open = !1);
10
- }, i = (e) => {
11
- let t = !1;
12
- const n = e.parentNode;
13
- return n != null && (t = n.dataset.multiple !== "disallow"), t;
14
- }, p = (e, t) => {
15
- if (e.open)
16
- e.open && a(e);
17
- else {
18
- if (!t) {
19
- const o = e.parentNode.querySelector("[data-opened]");
20
- requestAnimationFrame(() => {
21
- o != null && a(o);
22
- });
23
- }
24
- s(e);
25
- }
26
- }, u = (e) => {
27
- const t = e.open, n = e.hasAttribute("data-opened");
28
- t && !n && e.setAttribute("data-opened", ""), !t && n && e.removeAttribute("data-opened");
29
- }, m = (e) => {
30
- const t = i(e), n = e.querySelector("summary");
31
- if (!n) return;
32
- const o = (c) => {
33
- c.preventDefault(), p(e, t);
34
- }, r = () => {
35
- u(e);
1
+ import { maybePauseAnimation as l, waitFrame as s, waitAnimation as u } from "../../helper/animation.js";
2
+ let d = "until-found";
3
+ const i = (e) => {
4
+ const t = e.querySelector(".c--accordion_heading"), n = e.querySelector(".c--accordion_panel");
5
+ return {
6
+ heading: t,
7
+ button: t.querySelector("button"),
8
+ panel: n,
9
+ content: n.querySelector(".c--accordion_content")
36
10
  };
37
- return n.addEventListener("click", o), e.addEventListener("toggle", r), () => {
38
- n.removeEventListener("click", o), e.removeEventListener("toggle", r);
11
+ }, f = (e) => {
12
+ const t = e.parentNode;
13
+ t && (t.hasAttribute("data-allow-multiple") || t.querySelectorAll(":scope > [data-opened]").forEach((n) => p(n)));
14
+ };
15
+ async function A(e) {
16
+ const { panel: t, content: n, button: a } = i(e);
17
+ l(t), t.removeAttribute("hidden"), await s(), e.style.setProperty("--_panel-h", `${n.offsetHeight}px`), await s(), e.setAttribute("data-opened", ""), a.setAttribute("aria-expanded", "true"), await u(t) !== "canceled" && e.style.removeProperty("--_panel-h");
18
+ }
19
+ async function p(e) {
20
+ const { panel: t, button: n } = i(e);
21
+ l(t), e.style.setProperty("--_panel-h", `${t.offsetHeight}px`), await s(), e.removeAttribute("data-opened"), n.setAttribute("aria-expanded", "false"), e.style.removeProperty("--_panel-h"), await u(t) !== "canceled" && t.setAttribute("hidden", d);
22
+ }
23
+ function c(e) {
24
+ e.hasAttribute("data-opened") ? p(e) : (f(e), A(e));
25
+ }
26
+ const b = (e) => {
27
+ const { button: t, panel: n } = i(e);
28
+ n.hasAttribute("hidden") && (d = n.getAttribute("hidden"));
29
+ const a = (r) => {
30
+ r.preventDefault(), c(e);
31
+ }, o = (r) => {
32
+ r.preventDefault(), c(e);
33
+ };
34
+ return t.addEventListener("click", a), n.addEventListener("beforematch", o), () => {
35
+ t.removeEventListener("click", a), n.removeEventListener("beforematch", o);
39
36
  };
40
- }, d = () => {
41
- document.querySelectorAll(".c--accordion").forEach((t) => {
42
- m(t);
37
+ }, y = () => {
38
+ document.querySelectorAll(".c--accordion_item").forEach((t) => {
39
+ b(t);
43
40
  });
44
41
  };
45
42
  export {
46
- d as default,
47
- m as setEvent
43
+ y as default,
44
+ b as setEvent
48
45
  };
@@ -15,7 +15,7 @@ export default function getCalloutProps({ type, keycolor, icon, title, flow, ...
15
15
  p: string;
16
16
  g: string;
17
17
  bdc: string;
18
- 'bd-x-s': boolean;
18
+ 'bd-x-s': string;
19
19
  bdw: string;
20
20
  bxsh: string;
21
21
  bdrs: string;
@@ -0,0 +1,13 @@
1
+ import { default as Root } from './Details.astro';
2
+ import { default as Summary } from './Summary.astro';
3
+ import { default as Title } from './Title.astro';
4
+ import { default as Content } from './Content.astro';
5
+ import { default as Icon } from './Icon.astro';
6
+ declare namespace _default {
7
+ export { Root };
8
+ export { Summary };
9
+ export { Title };
10
+ export { Content };
11
+ export { Icon };
12
+ }
13
+ export default _default;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Detailsコンポーネントのルート要素用プロパティを生成
3
+ * @param {Object} props - コンポーネントのプロパティ
4
+ * @param {string} props.lismClass - 追加のLismクラス
5
+ * @returns {Object} 処理済みプロパティ
6
+ */
7
+ export function getDetailsProps({ lismClass, ...props }: {
8
+ lismClass: string;
9
+ }): Object;
10
+ export namespace defaultProps {
11
+ namespace summary {
12
+ let lismClass: string;
13
+ let layout: string;
14
+ let g: string;
15
+ let ai: string;
16
+ }
17
+ namespace title {
18
+ let lismClass_1: string;
19
+ export { lismClass_1 as lismClass };
20
+ export let tag: string;
21
+ export let fx: string;
22
+ export let setPlain: number;
23
+ }
24
+ let icon: {
25
+ lismClass: string;
26
+ tag: string;
27
+ 'aria-hidden': string;
28
+ };
29
+ namespace body {
30
+ let lismClass_2: string;
31
+ export { lismClass_2 as lismClass };
32
+ }
33
+ namespace content {
34
+ let lismClass_3: string;
35
+ export { lismClass_3 as lismClass };
36
+ let layout_1: string;
37
+ export { layout_1 as layout };
38
+ export let flow: string;
39
+ }
40
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Details - ルートコンポーネント
3
+ * details要素をレンダリング
4
+ */
5
+ export function Details({ children, ...props }: {
6
+ [x: string]: any;
7
+ children: any;
8
+ }): import("react").JSX.Element;
9
+ /**
10
+ * Summary - サマリーコンポーネント
11
+ * details要素のsummary部分
12
+ */
13
+ export function Summary({ children, ...props }: {
14
+ [x: string]: any;
15
+ children: any;
16
+ }): import("react").JSX.Element;
17
+ /**
18
+ * Title - タイトルコンポーネント
19
+ */
20
+ export function Title({ children, ...props }: {
21
+ [x: string]: any;
22
+ children: any;
23
+ }): import("react").JSX.Element;
24
+ /**
25
+ * Icon - アイコンコンポーネント
26
+ */
27
+ export function Icon({ children, ...props }: {
28
+ [x: string]: any;
29
+ children: any;
30
+ }): import("react").JSX.Element;
31
+ /**
32
+ * Content - コンテンツコンポーネント
33
+ */
34
+ export function Content({ children, ...props }: {
35
+ [x: string]: any;
36
+ children: any;
37
+ }): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { Details as Root, Summary, Title, Icon, Content } from './Details';
2
+ declare namespace _default {
3
+ export { Root };
4
+ export { Summary };
5
+ export { Title };
6
+ export { Icon };
7
+ export { Content };
8
+ }
9
+ export default _default;
@@ -5,7 +5,7 @@ export function getProps({ lismClass, duration, style, ...props }: {
5
5
  style?: {} | undefined;
6
6
  }): {
7
7
  style: {};
8
- lismClass: any;
8
+ lismClass: string;
9
9
  setPlain: boolean;
10
10
  tag: string;
11
11
  };
@@ -15,7 +15,7 @@ export function getInnerProps({ lismClass, offset, style, ...props }: {
15
15
  offset: any;
16
16
  style?: {} | undefined;
17
17
  }): {
18
- lismClass: any;
18
+ lismClass: string;
19
19
  style: {};
20
20
  };
21
21
  export namespace defaultProps {
@@ -1,3 +1,6 @@
1
+ /**
2
+ * モーダルの開閉イベントを設定する
3
+ */
1
4
  export declare function setEvent(modal: HTMLDialogElement): void;
2
5
  declare const setModal: () => void;
3
6
  export default setModal;
@@ -1,42 +1,37 @@
1
- let s = null;
2
- const o = async (e) => {
3
- const n = e.getAnimations();
4
- n.length > 0 && await Promise.allSettled(n.map((c) => c.finished));
5
- };
6
- async function d(e) {
7
- e.open && e.dataset.isOpen || (e.showModal(), requestAnimationFrame(() => {
8
- e.dataset.isOpen = "1";
9
- }));
10
- }
11
- async function a(e) {
12
- e.dataset.isOpen !== void 0 && (delete e.dataset.isOpen, await o(e), e.close());
13
- }
14
- function l(e) {
1
+ import { waitAnimation as o } from "../../helper/animation.js";
2
+ function r(e) {
15
3
  if (!e || !e.id) return;
16
- const n = document.querySelectorAll(`[data-modal-open="${e.id}"]`), c = e.querySelectorAll(`[data-modal-close="${e.id}"]`);
17
- e.addEventListener("click", (t) => {
18
- t.target === e && a(e);
19
- }), e.addEventListener("close", (t) => {
20
- s && (delete s.dataset.targetOpened, s = null), a(e);
21
- }), n.forEach((t) => {
22
- t == null || t.addEventListener("click", (i) => {
23
- t.dataset.targetOpened = "1", s = t, d(e);
4
+ let n = null;
5
+ const a = document.querySelectorAll(`[data-modal-open="${e.id}"]`), c = e.querySelectorAll(`[data-modal-close="${e.id}"]`), i = () => {
6
+ e.open && e.hasAttribute("data-is-open") || (e.showModal(), requestAnimationFrame(() => {
7
+ e.dataset.isOpen = "1";
8
+ }));
9
+ }, s = async () => {
10
+ e.hasAttribute("data-is-open") && (e.removeAttribute("data-is-open"), await o(e), e.close());
11
+ };
12
+ a.forEach((t) => {
13
+ t == null || t.addEventListener("click", () => {
14
+ t.dataset.targetOpened = "1", n = t, i();
24
15
  });
25
16
  }), c.forEach((t) => {
26
- t == null || t.addEventListener("click", (i) => {
27
- a(e);
17
+ t == null || t.addEventListener("click", () => {
18
+ s();
28
19
  });
20
+ }), e.addEventListener("click", (t) => {
21
+ t.target === e && s();
22
+ }), e.addEventListener("close", () => {
23
+ n && (n.removeAttribute("data-target-opened"), n = null);
29
24
  }), e.addEventListener("cancel", (t) => {
30
- t.preventDefault(), a(e);
25
+ t.preventDefault(), s();
31
26
  });
32
27
  }
33
- const u = () => {
28
+ const d = () => {
34
29
  const e = document.querySelectorAll(".c--modal");
35
30
  e == null || e.forEach((n) => {
36
- l(n);
31
+ r(n);
37
32
  });
38
33
  };
39
34
  export {
40
- u as default,
41
- l as setEvent
35
+ d as default,
36
+ r as setEvent
42
37
  };
@@ -2,5 +2,5 @@ export default function getTabsProps({ lismClass, ...props }: {
2
2
  [x: string]: any;
3
3
  lismClass: any;
4
4
  }): {
5
- lismClass: any;
5
+ lismClass: string;
6
6
  };
@@ -5,6 +5,7 @@ export { default as Badge } from './Badge/astro';
5
5
  export { default as Button } from './Button/astro';
6
6
  export { default as Callout } from './Callout/astro';
7
7
  export { default as Chat } from './Chat/astro';
8
+ export { default as Details } from './Details/astro';
8
9
  export { default as Modal } from './Modal/astro';
9
10
  export { default as NavMenu } from './NavMenu/astro';
10
11
  export { default as ShapeDivider } from './ShapeDivider/astro';
@@ -5,6 +5,7 @@ export { default as Badge } from './Badge/react';
5
5
  export { default as Button } from './Button/react';
6
6
  export { default as Callout } from './Callout/react';
7
7
  export { default as Chat } from './Chat/react';
8
+ export { default as Details } from './Details/react';
8
9
  export { default as Modal } from './Modal/react';
9
10
  export { default as NavMenu } from './NavMenu/react';
10
11
  export { default as ShapeDivider } from './ShapeDivider/react';
@@ -0,0 +1,18 @@
1
+ type AnimationStatus = 'none' | 'finished' | 'canceled';
2
+ /**
3
+ * 1フレーム待機する(requestAnimationFrame のPromiseラッパー)
4
+ */
5
+ export declare const waitFrame: () => Promise<number>;
6
+ /**
7
+ * 要素のアニメーションが完了するのを待つ
8
+ * @returns アニメーションの結果ステータス
9
+ * - 'none': アニメーションが実行されていなかった
10
+ * - 'finished': すべてのアニメーションが正常に完了
11
+ * - 'canceled': pause() 等でキャンセルされたアニメーションがあった
12
+ */
13
+ export declare const waitAnimation: (el: HTMLElement) => Promise<AnimationStatus>;
14
+ /**
15
+ * 実行中のアニメーションがあれば一旦停止させる
16
+ */
17
+ export declare const maybePauseAnimation: (el: HTMLElement) => void;
18
+ export {};
@@ -0,0 +1,12 @@
1
+ const a = () => new Promise((n) => requestAnimationFrame(n)), s = async (n) => {
2
+ const t = n.getAnimations();
3
+ return t.length === 0 ? "none" : (await Promise.allSettled(t.map((e) => e.finished))).every((e) => e.status === "fulfilled") ? "finished" : "canceled";
4
+ }, o = (n) => {
5
+ const t = n.getAnimations();
6
+ t.length !== 0 && t.forEach((i) => i.pause());
7
+ };
8
+ export {
9
+ o as maybePauseAnimation,
10
+ s as waitAnimation,
11
+ a as waitFrame
12
+ };
@@ -0,0 +1 @@
1
+ export default function uuidv4(): string;
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- @layer lism.modules{.c--accordion{--duration:var(--acc-duration,0.25s)}.c--accordion[data-opened]{--_notOpen: }.c--accordion:not([data-opened]){--_isOpen: }.c--accordion_header{align-items:center;display:grid;gap:.5em;grid:auto/1fr auto;--focus-offset:-1px;&::-webkit-details-marker{display:none}}.c--accordion_body{display:grid;grid:1fr/auto;transition-duration:var(--duration);transition-property:margin-block,padding-block,opacity,grid-template}.c--accordion_inner{overflow:hidden}.c--accordion:not([data-opened])>.c--accordion_body{grid:0fr/auto;margin-block:0!important;padding-block:0!important}.c--accordion_icon{display:grid}.c--accordion_icon>.a--icon{transform:var(--_isOpen,scaleY(-1));transition:transform var(--duration)}.c--badge{--c:var(--base);--bgc:var(--text);--bdc:transparent;background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c)}.c--badge--outline{--c:var(--text);--bgc:transparent;--bdc:currentColor}.c--button{--c:var(--base);--bgc:var(--text);--bdc:var(--bgc);background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c);gap:var(--s10);place-content:center;place-items:center;text-decoration:none}.c--button--outline{--c:var(--text);--bgc:transparent;--bdc:var(--c)}}@layer lism.modules{}@layer lism.modules{:where(.c--button)>.a--icon{scale:1.05}.c--button:where(.l--grid){grid-template-columns:minmax(1em,auto) 1fr minmax(1em,auto);justify-items:center}.c--button:where(.l--grid)>:not(.a--icon){grid-column:2}}@layer lism.modules{.c--chat{--cbox-bgPct:8%;--gta:"avatar name" "avatar body";--gtc:auto 1fr;--gtr:minmax(1.5rem,auto) auto;--_avator-size:clamp(48px,32px + 5cqw,64px);--_deco-size:calc(min(var(--_avator-size), 80px)/4 + 0.25rem);--_deco-mask:none;--_deco-t:0;--_deco-scale:1;--_deco-inset-x:0;gap:0 calc(var(--_deco-size) + 1px)}.c--chat_avatar{grid-area:avatar;width:var(--_avator-size)}.c--chat_name{grid-area:name}.c--chat_body{grid-area:body}.c--chat_content{max-width:var(--sz--s)}.c--chat_deco{height:var(--_deco-size);top:var(--_deco-t);inset-inline:var(--_deco-inset-x);-webkit-mask:var(--_deco-mask) center/contain no-repeat;mask:var(--_deco-mask) center/contain no-repeat;scale:var(--_deco-scale);width:var(--_deco-size)}.c--chat--speak{--_deco-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"><path d="M8,8L8,8C7.4,4.8,5.4,2,2.6,0.4L2,0h6V8z"/></svg>')}[data-chat-dir=start]{--_deco-inset-x:auto calc(100% - 1px)}[data-chat-dir=end]{--_deco-scale:-1 1;--_deco-inset-x:calc(100% - 1px) auto;--gta:"name avatar" "body avatar";--gtc:1fr auto}}.c--chat--speak[data-chat-dir=start]>div>.c--chat_content{border-start-start-radius:0}.c--chat--speak[data-chat-dir=end]>div>.c--chat_content{border-start-end-radius:0}@layer lism.modules{.c--navMenu{--link-td:none;--hl:var(--hl--s);--_item-p:var(--s20);--focus-offset:-1px}.c--navMenu_nest{--_item-p:inherit}.c--navMenu_link{padding:var(--_item-p)}.c--navMenu_item,.c--navMenu_nest{--bdc:inherit}.c--shapeDivider{--level:0;--_inner-offset:0px;--_inner-stretch:1;--_flipX:1;--_flipY:1;height:clamp(5px * var(--level),1cqw * var(--level),12px * var(--level));overflow:visible}}@layer lism.modules{.c--shapeDivider:where([data-flip^=X]){--_flipX:-1}.c--shapeDivider:where([data-flip$=Y]){--_flipY:-1}.c--shapeDivider_inner{--offsetY:0.5px;--offsetX:-0.5px;height:100%;scale:calc(var(--_flipX)*var(--_inner-stretch)) var(--_flipY);translate:calc(var(--offsetX) + var(--_inner-offset)) calc(var(--offsetY)*var(--_flipY));width:calc(100% + 1px)}.c--shapeDivider_svg{display:block}:where([data-has-animation=true]) .c--shapeDivider_svg{animation:lism--slideShape 12s linear infinite alternate;transform-origin:100% 0}}@keyframes lism--slideShape{0%{transform:scaleX(4)}to{transform:scaleX(4) translateX(75%)}}
1
+ @layer lism.modules{.c--accordion{--duration:var(--acc-duration,0.25s)}.c--accordion_item{--_panel-h:0px;--_icon-transform:rotate(0deg)}.c--accordion_item[data-opened]{--_icon-transform:rotate(90deg);--_panel-h:auto}.c--accordion_panel{height:var(--_panel-h);transition:height var(--duration)}[hidden]>.c--accordion_content{position:absolute}.c--accordion_icon{display:grid;height:1em;width:1em;&:after,&:before{background-color:currentColor;content:"";display:block;grid-area:1/1}&:before{height:100%;transform:var(--_icon-transform);transition:transform var(--duration);width:.1em}&:after{height:.1em;width:100%}}.c--accordion_button:focus-visible{outline:2px solid currentColor;outline-color:revert;outline-offset:-3px}@media (prefers-reduced-motion:reduce){.c--accordion_item{--duration:0s}}@media (scripting:none){.c--accordion_panel{content-visibility:visible!important;height:auto!important}.c--accordion_content{position:static!important}}}@layer lism.modules{.c--badge{--c:var(--base);--bgc:var(--text);--bdc:transparent;background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c)}.c--badge--outline{--c:var(--text);--bgc:transparent;--bdc:currentColor}.c--button{--c:var(--base);--bgc:var(--text);--bdc:var(--bgc);background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c);gap:var(--s10);place-content:center;place-items:center;text-decoration:none}.c--button--outline{--c:var(--text);--bgc:transparent;--bdc:var(--c)}}@layer lism.modules{:where(.c--button)>.a--icon{scale:1.05}.c--button:where(.l--grid){grid-template-columns:minmax(1em,auto) 1fr minmax(1em,auto);justify-items:center}.c--button:where(.l--grid)>:not(.a--icon){grid-column:2}}@layer lism.modules{.c--chat{--cbox-bgPct:8%;--gta:"avatar name" "avatar body";--gtc:auto 1fr;--gtr:minmax(1.5rem,auto) auto;--_avator-size:clamp(48px,32px + 5cqw,64px);--_deco-size:calc(min(var(--_avator-size), 80px)/4 + 0.25rem);--_deco-mask:none;--_deco-t:0;--_deco-scale:1;--_deco-inset-x:0;gap:0 calc(var(--_deco-size) + 1px)}.c--chat_avatar{grid-area:avatar;width:var(--_avator-size)}.c--chat_name{grid-area:name}.c--chat_body{grid-area:body}.c--chat_content{max-width:var(--sz--s)}.c--chat_deco{height:var(--_deco-size);top:var(--_deco-t);inset-inline:var(--_deco-inset-x);-webkit-mask:var(--_deco-mask) center/contain no-repeat;mask:var(--_deco-mask) center/contain no-repeat;scale:var(--_deco-scale);width:var(--_deco-size)}.c--chat--speak{--_deco-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"><path d="M8,8L8,8C7.4,4.8,5.4,2,2.6,0.4L2,0h6V8z"/></svg>')}[data-chat-dir=start]{--_deco-inset-x:auto calc(100% - 1px)}[data-chat-dir=end]{--_deco-scale:-1 1;--_deco-inset-x:calc(100% - 1px) auto;--gta:"name avatar" "body avatar";--gtc:1fr auto}}.c--chat--speak[data-chat-dir=start]>div>.c--chat_content{border-start-start-radius:0}.c--chat--speak[data-chat-dir=end]>div>.c--chat_content{border-start-end-radius:0}@layer lism.modules{.c--navMenu{--link-td:none;--hl:var(--hl--s);--_item-p:var(--s20);--focus-offset:-1px}.c--navMenu_nest{--_item-p:inherit}.c--navMenu_link{padding:var(--_item-p)}.c--navMenu_item,.c--navMenu_nest{--bdc:inherit}.c--shapeDivider{--level:0;--_inner-offset:0px;--_inner-stretch:1;--_flipX:1;--_flipY:1;height:clamp(5px * var(--level),1cqw * var(--level),12px * var(--level));overflow:visible}}@layer lism.modules{.c--shapeDivider:where([data-flip^=X]){--_flipX:-1}.c--shapeDivider:where([data-flip$=Y]){--_flipY:-1}.c--shapeDivider_inner{--offsetY:0.5px;--offsetX:-0.5px;height:100%;scale:calc(var(--_flipX)*var(--_inner-stretch)) var(--_flipY);translate:calc(var(--offsetX) + var(--_inner-offset)) calc(var(--offsetY)*var(--_flipY));width:calc(100% + 1px)}.c--shapeDivider_svg{display:block}:where([data-has-animation=true]) .c--shapeDivider_svg{animation:lism--slideShape 12s linear infinite alternate;transform-origin:100% 0}}@keyframes lism--slideShape{0%{transform:scaleX(4)}to{transform:scaleX(4) translateX(75%)}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lism-css/ui",
3
- "version": "0.2.3",
3
+ "version": "0.8.0",
4
4
  "description": "UI components by lism-css.",
5
5
  "author": {
6
6
  "name": "ddryo",
@@ -39,7 +39,7 @@
39
39
  "url": "https://github.com/lism-css/lism-css/issues"
40
40
  },
41
41
  "dependencies": {
42
- "lism-css": "0.8.3"
42
+ "lism-css": "0.8.4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@babel/cli": "^7.27.2",