@liner-fe/prism 2.1.6 → 2.1.8
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/lib/components/Button/index.d.ts +1 -1
- package/lib/components/Label/index.d.ts +2 -2
- package/lib/illust.d.ts +1 -0
- package/lib/illust.js +75 -0
- package/lib/illust.js.map +7 -0
- package/lib/index.cjs +9442 -0
- package/lib/index.cjs.map +7 -0
- package/lib/index.d.ts +0 -1
- package/lib/{index.js → index.mjs} +1 -40
- package/lib/{index.js.map → index.mjs.map} +4 -4
- package/package.json +3 -2
|
@@ -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?: "
|
|
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?: "
|
|
6
|
+
position?: "right" | "top" | null | undefined;
|
|
7
7
|
size?: "m" | "s" | "l" | null | undefined;
|
|
8
|
-
offset?: "
|
|
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;
|
package/lib/illust.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/Illust';
|
package/lib/illust.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/illust.ts
|
|
32
|
+
var illust_exports = {};
|
|
33
|
+
__export(illust_exports, {
|
|
34
|
+
Illust: () => Illust
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(illust_exports);
|
|
37
|
+
|
|
38
|
+
// src/constants/illust/size.ts
|
|
39
|
+
var illustSize = {
|
|
40
|
+
rectangle_standing_with_a_star: { width: 2422, height: 1282 },
|
|
41
|
+
rectangle_space_work: { width: 2422, height: 1282 },
|
|
42
|
+
rectangle_searching: { width: 2422, height: 1282 },
|
|
43
|
+
rectangle_cheerup_01: { width: 2422, height: 1282 },
|
|
44
|
+
rectangle_cheerup_02: { width: 2422, height: 1282 }
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/components/Illust/index.tsx
|
|
48
|
+
var import_design_token = require("@liner-fe/design-token");
|
|
49
|
+
var import_image = __toESM(require("next/image"));
|
|
50
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
51
|
+
var ILLUST = "/illust";
|
|
52
|
+
var Illust = /* @__PURE__ */ __name((props) => {
|
|
53
|
+
const { isDarkMode } = (0, import_design_token.useDarkTheme)();
|
|
54
|
+
const { src, isOnlyLight, width, height, justifyContent = "center", alignItems = "center" } = props;
|
|
55
|
+
const prefixSrc = (() => {
|
|
56
|
+
if (isDarkMode && !isOnlyLight) {
|
|
57
|
+
return `${ILLUST}/dark/`;
|
|
58
|
+
}
|
|
59
|
+
return `${ILLUST}/light/`;
|
|
60
|
+
})();
|
|
61
|
+
const aspectRatio = illustSize[src] ? illustSize[src].width / illustSize[src].height : void 0;
|
|
62
|
+
const css = {
|
|
63
|
+
width,
|
|
64
|
+
height,
|
|
65
|
+
display: "flex",
|
|
66
|
+
justifyContent,
|
|
67
|
+
alignItems
|
|
68
|
+
};
|
|
69
|
+
if (aspectRatio) {
|
|
70
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: css, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { alt: src, ...props, src: `${prefixSrc}${src}.webp`, width, height: width / aspectRatio }) });
|
|
71
|
+
}
|
|
72
|
+
const size = width > height ? height : width;
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: css, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { alt: src, ...props, src: `${prefixSrc}${src}.webp`, width: size, height: size }) });
|
|
74
|
+
}, "Illust");
|
|
75
|
+
//# sourceMappingURL=illust.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/illust.ts", "../src/constants/illust/size.ts", "../src/components/Illust/index.tsx"],
|
|
4
|
+
"sourcesContent": ["export * from './components/Illust';\n", "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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,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,0BAA6B;AAE7B,mBAAkC;AAuC1B;AA3BR,IAAM,SAAS;AAER,IAAM,SAAS,wBAAC,UAAkB;AACvC,QAAM,EAAE,WAAW,QAAI,kCAAa;AACpC,QAAM,EAAE,KAAK,aAAa,OAAO,QAAQ,iBAAiB,UAAU,aAAa,SAAS,IAAI;AAE9F,QAAM,aAAa,MAAM;AACvB,QAAI,cAAc,CAAC,aAAa;AAC9B,aAAO,GAAG,MAAM;AAAA,IAClB;AAEA,WAAO,GAAG,MAAM;AAAA,EAClB,GAAG;AAEH,QAAM,cAAc,WAAW,GAAG,IAAI,WAAW,GAAG,EAAE,QAAQ,WAAW,GAAG,EAAE,SAAS;AAEvF,QAAM,MAAqB;AAAA,IACzB;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF;AAEA,MAAI,aAAa;AACf,WACE,4CAAC,SAAI,OAAO,KACV,sDAAC,aAAAA,SAAA,EAAM,KAAK,KAAM,GAAG,OAAO,KAAK,GAAG,SAAS,GAAG,GAAG,SAAS,OAAc,QAAQ,QAAQ,aAAa,GACzG;AAAA,EAEJ;AAEA,QAAM,OAAO,QAAQ,SAAS,SAAS;AAEvC,SACE,4CAAC,SAAI,OAAO,KACV,sDAAC,aAAAA,SAAA,EAAM,KAAK,KAAM,GAAG,OAAO,KAAK,GAAG,SAAS,GAAG,GAAG,SAAS,OAAO,MAAM,QAAQ,MAAM,GACzF;AAEJ,GArCsB;",
|
|
6
|
+
"names": ["Image"]
|
|
7
|
+
}
|