@liner-fe/prism 2.1.5 → 2.1.7

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.
@@ -6,7 +6,7 @@ declare const defaultButtonVariants: (props?: ({
6
6
  fill?: boolean | null | undefined;
7
7
  align?: "center" | "spaceBetween" | null | undefined;
8
8
  size?: "m" | "s" | "l" | "cta" | null | undefined;
9
- width?: "full" | "fit-content" | null | undefined;
9
+ width?: "fit-content" | "full" | null | undefined;
10
10
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
11
  declare const textButtonVariants: (props?: ({
12
12
  level?: "inverse-primary" | "neutral-primary" | "inverse-static-primary" | null | undefined;
@@ -3,9 +3,9 @@ import * as LabelPrimitive from '@radix-ui/react-label';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
  declare const defaultLabelVariants: (props?: ({
5
5
  level?: "primary" | "secondary" | null | undefined;
6
- position?: "top" | "right" | null | undefined;
6
+ position?: "right" | "top" | null | undefined;
7
7
  size?: "m" | "s" | "l" | null | undefined;
8
- offset?: "medium" | "high" | "low" | null | undefined;
8
+ offset?: "high" | "low" | "medium" | null | undefined;
9
9
  disabled?: boolean | null | undefined;
10
10
  error?: boolean | null | undefined;
11
11
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1 @@
1
+ export * from './components/Illust';
package/lib/illust.js ADDED
@@ -0,0 +1,44 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/constants/illust/size.ts
5
+ var illustSize = {
6
+ rectangle_standing_with_a_star: { width: 2422, height: 1282 },
7
+ rectangle_space_work: { width: 2422, height: 1282 },
8
+ rectangle_searching: { width: 2422, height: 1282 },
9
+ rectangle_cheerup_01: { width: 2422, height: 1282 },
10
+ rectangle_cheerup_02: { width: 2422, height: 1282 }
11
+ };
12
+
13
+ // src/components/Illust/index.tsx
14
+ import { useDarkTheme } from "@liner-fe/design-token";
15
+ import Image from "next/image";
16
+ import { jsx } from "react/jsx-runtime";
17
+ var ILLUST = "/illust";
18
+ var Illust = /* @__PURE__ */ __name((props) => {
19
+ const { isDarkMode } = useDarkTheme();
20
+ const { src, isOnlyLight, width, height, justifyContent = "center", alignItems = "center" } = props;
21
+ const prefixSrc = (() => {
22
+ if (isDarkMode && !isOnlyLight) {
23
+ return `${ILLUST}/dark/`;
24
+ }
25
+ return `${ILLUST}/light/`;
26
+ })();
27
+ const aspectRatio = illustSize[src] ? illustSize[src].width / illustSize[src].height : void 0;
28
+ const css = {
29
+ width,
30
+ height,
31
+ display: "flex",
32
+ justifyContent,
33
+ alignItems
34
+ };
35
+ if (aspectRatio) {
36
+ return /* @__PURE__ */ jsx("div", { style: css, children: /* @__PURE__ */ jsx(Image, { alt: src, ...props, src: `${prefixSrc}${src}.webp`, width, height: width / aspectRatio }) });
37
+ }
38
+ const size = width > height ? height : width;
39
+ return /* @__PURE__ */ jsx("div", { style: css, children: /* @__PURE__ */ jsx(Image, { alt: src, ...props, src: `${prefixSrc}${src}.webp`, width: size, height: size }) });
40
+ }, "Illust");
41
+ export {
42
+ Illust
43
+ };
44
+ //# sourceMappingURL=illust.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/constants/illust/size.ts", "../src/components/Illust/index.tsx"],
4
+ "sourcesContent": ["import { IllustName } from '@/types/illust';\n\nexport const illustSize: Partial<Record<IllustName, { width: number; height: number }>> = {\n rectangle_standing_with_a_star: { width: 2422, height: 1282 },\n rectangle_space_work: { width: 2422, height: 1282 },\n rectangle_searching: { width: 2422, height: 1282 },\n rectangle_cheerup_01: { width: 2422, height: 1282 },\n rectangle_cheerup_02: { width: 2422, height: 1282 },\n};\n", "import { illustSize } from '@/constants/illust/size';\nimport { IllustName } from '@/types/illust';\nimport { useDarkTheme } from '@liner-fe/design-token';\nimport { Property } from 'csstype';\nimport Image, { ImageProps } from 'next/image';\nimport { CSSProperties } from 'react';\n\ninterface IProps extends Omit<ImageProps, 'alt' | 'width' | 'height' | 'fill'> {\n src: IllustName;\n isOnlyLight?: boolean;\n width: number;\n height: number;\n justifyContent?: Property.JustifyContent;\n alignItems?: Property.AlignItems;\n}\n\nconst ILLUST = '/illust';\n\nexport const Illust = (props: IProps) => {\n const { isDarkMode } = useDarkTheme();\n const { src, isOnlyLight, width, height, justifyContent = 'center', alignItems = 'center' } = props;\n\n const prefixSrc = (() => {\n if (isDarkMode && !isOnlyLight) {\n return `${ILLUST}/dark/`;\n }\n\n return `${ILLUST}/light/`;\n })();\n\n const aspectRatio = illustSize[src] ? illustSize[src].width / illustSize[src].height : undefined;\n\n const css: CSSProperties = {\n width,\n height,\n display: 'flex',\n justifyContent,\n alignItems,\n };\n\n if (aspectRatio) {\n return (\n <div style={css}>\n <Image alt={src} {...props} src={`${prefixSrc}${src}.webp`} width={width} height={width / aspectRatio} />\n </div>\n );\n }\n\n const size = width > height ? height : width;\n\n return (\n <div style={css}>\n <Image alt={src} {...props} src={`${prefixSrc}${src}.webp`} width={size} height={size} />\n </div>\n );\n};\n"],
5
+ "mappings": ";;;;AAEO,IAAM,aAA6E;AAAA,EACxF,gCAAgC,EAAE,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC5D,sBAAsB,EAAE,OAAO,MAAM,QAAQ,KAAK;AAAA,EAClD,qBAAqB,EAAE,OAAO,MAAM,QAAQ,KAAK;AAAA,EACjD,sBAAsB,EAAE,OAAO,MAAM,QAAQ,KAAK;AAAA,EAClD,sBAAsB,EAAE,OAAO,MAAM,QAAQ,KAAK;AACpD;;;ACNA,SAAS,oBAAoB;AAE7B,OAAO,WAA2B;AAuC1B;AA3BR,IAAM,SAAS;AAER,IAAM,SAAS,wBAAC,UAAkB;AACvC,QAAM,EAAE,WAAW,IAAI,aAAa;AACpC,QAAM,EAAE,KAAK,aAAa,OAAO,QAAQ,iBAAiB,UAAU,aAAa,SAAS,IAAI;AAE9F,QAAM,aAAa,MAAM;AACvB,QAAI,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