@liner-fe/prism 2.1.52 → 2.1.54
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/CheckBox/index.d.ts +1 -1
- package/lib/components/Label/index.d.ts +1 -1
- package/lib/components/Popover/index.d.ts +1 -1
- package/lib/components/Radio/index.d.ts +1 -1
- package/lib/components/Select/index.d.ts +1 -1
- package/lib/components/Slider/index.d.ts +1 -1
- package/lib/components/Tooltip/index.d.ts +2 -3
- package/lib/illust.js +10 -41
- package/lib/illust.js.map +4 -4
- package/lib/{index.mjs → index.js} +1778 -279
- package/lib/{index.mjs.map → index.js.map} +4 -4
- package/package.json +12 -20
- package/lib/index.cjs +0 -10242
- package/lib/index.cjs.map +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { Label as LabelPrimitive } from 'radix-ui';
|
|
3
3
|
import { VariantProps } from 'cva';
|
|
4
4
|
declare const defaultLabelVariants: (props?: ({
|
|
5
5
|
level?: "primary" | "secondary" | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
interface RadioItemProps extends ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> {
|
|
4
4
|
label?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Select as SelectPrimitive } from 'radix-ui';
|
|
2
2
|
import { IconProps } from '../Icon';
|
|
3
3
|
import { ComponentProps, ComponentPropsWithoutRef } from 'react';
|
|
4
4
|
export interface SelectProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Root> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Tooltip as TooltipPrimitive } from 'radix-ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
interface TooltipRootProps {
|
|
4
4
|
/**
|
|
@@ -32,8 +32,7 @@ interface TooltipRootProps {
|
|
|
32
32
|
*/
|
|
33
33
|
disableHoverableContent?: boolean;
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
type Side = (typeof SIDE_OPTIONS)[number];
|
|
35
|
+
type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
37
36
|
interface TooltipTriggerProps {
|
|
38
37
|
/**
|
|
39
38
|
* @param by
|
package/lib/illust.js
CHANGED
|
@@ -1,40 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
1
|
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
2
|
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
|
-
prefetchIllust: () => prefetchIllust
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(illust_exports);
|
|
38
3
|
|
|
39
4
|
// src/constants/illust/size.ts
|
|
40
5
|
var ratio = { "16:9": { width: 1344, height: 756 }, "4:3": { width: 1008, height: 756 } };
|
|
@@ -63,7 +28,7 @@ var illustSize = {
|
|
|
63
28
|
};
|
|
64
29
|
|
|
65
30
|
// src/components/Illust/index.tsx
|
|
66
|
-
|
|
31
|
+
import Image from "next/image";
|
|
67
32
|
|
|
68
33
|
// src/constants/illust/path.ts
|
|
69
34
|
var ILLUST = "/illust";
|
|
@@ -71,9 +36,9 @@ var DARK_MODE_ILLUST_PREFIX = `${ILLUST}/dark/`;
|
|
|
71
36
|
var LIGHT_MODE_ILLUST_PREFIX = `${ILLUST}/light/`;
|
|
72
37
|
|
|
73
38
|
// src/hooks/useIllust.ts
|
|
74
|
-
|
|
39
|
+
import { useDarkTheme } from "@liner-fe/design-token";
|
|
75
40
|
var useIllust = /* @__PURE__ */ __name(({ darkSrc, src }) => {
|
|
76
|
-
const { isDarkMode } =
|
|
41
|
+
const { isDarkMode } = useDarkTheme();
|
|
77
42
|
const sourcePrefix = (() => {
|
|
78
43
|
if (isDarkMode) {
|
|
79
44
|
if (darkSrc?.inverse) {
|
|
@@ -91,7 +56,7 @@ var useIllust = /* @__PURE__ */ __name(({ darkSrc, src }) => {
|
|
|
91
56
|
}, "useIllust");
|
|
92
57
|
|
|
93
58
|
// src/components/Illust/index.tsx
|
|
94
|
-
|
|
59
|
+
import { jsx } from "react/jsx-runtime";
|
|
95
60
|
var Illust = /* @__PURE__ */ __name((props) => {
|
|
96
61
|
const { src, width, margin } = props;
|
|
97
62
|
const { sourcePrefix, currentSourceByColorTheme } = useIllust({ darkSrc: src.dark, src: src.light });
|
|
@@ -101,8 +66,8 @@ var Illust = /* @__PURE__ */ __name((props) => {
|
|
|
101
66
|
margin
|
|
102
67
|
};
|
|
103
68
|
const source = `${sourcePrefix}${currentSourceByColorTheme}.webp`;
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
|
|
69
|
+
return /* @__PURE__ */ jsx("div", { style: css, children: /* @__PURE__ */ jsx(
|
|
70
|
+
Image,
|
|
106
71
|
{
|
|
107
72
|
alt: currentSourceByColorTheme,
|
|
108
73
|
...props,
|
|
@@ -115,4 +80,8 @@ var Illust = /* @__PURE__ */ __name((props) => {
|
|
|
115
80
|
|
|
116
81
|
// src/utils/illust.ts
|
|
117
82
|
var prefetchIllust = /* @__PURE__ */ __name(async ({ name, isDark = false }) => await fetch(`${ILLUST}${isDark ? "/dark/" : "/light/"}${name}.webp`), "prefetchIllust");
|
|
83
|
+
export {
|
|
84
|
+
Illust,
|
|
85
|
+
prefetchIllust
|
|
86
|
+
};
|
|
118
87
|
//# sourceMappingURL=illust.js.map
|
package/lib/illust.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": ["../src/constants/illust/size.ts", "../src/components/Illust/index.tsx", "../src/constants/illust/path.ts", "../src/hooks/useIllust.ts", "../src/utils/illust.ts"],
|
|
4
|
+
"sourcesContent": ["import { IllustType } from '@/types/illust';\n\nconst ratio = { '16:9': { width: 1344, height: 756 }, '4:3': { width: 1008, height: 756 } };\n\nexport const illustSize: Partial<Record<IllustType, { width: number; height: number }>> = {\n 'object-pencil_paper-16_9': ratio['16:9'],\n 'object-smoke-16_9': ratio['16:9'],\n 'person-standing_with_a_star-16_9': ratio['16:9'],\n 'person-searching-16_9': ratio['16:9'],\n 'person-cheerup-16_9': ratio['16:9'],\n 'object-graduation_cap_pencil-4_3': ratio['4:3'],\n 'object-book_pencil-4_3': ratio['4:3'],\n 'object-puzzle-4_3': ratio['4:3'],\n 'object-magnifying_glass-4_3': ratio['4:3'],\n 'object-lock-4_3': ratio['4:3'],\n 'object-empty_box-4_3': ratio['4:3'],\n 'person-working_01-4_3': ratio['4:3'],\n 'person-searching_01-4_3': ratio['4:3'],\n 'person-worried_01-4_3': ratio['4:3'],\n 'person-worried_02-4_3': ratio['4:3'],\n 'person-worried_03-4_3': ratio['4:3'],\n 'person-worried_04-4_3': ratio['4:3'],\n 'person-working_02-4_3': ratio['4:3'],\n 'person-bye-4_3': ratio['4:3'],\n 'person-space_in_work-4_3': ratio['4:3'],\n 'person-cheerup-4_3': ratio['4:3'],\n};\n", "import { illustSize } from '@/constants/illust/size';\nimport Image, { ImageProps } from 'next/image';\nimport { CSSProperties } from 'react';\nimport { useIllust } from '@/hooks/useIllust';\nimport { IllustType } from '@/types/illust';\nimport { Property } from 'csstype';\n\nexport interface Source<T extends false | true = true> {\n name: IllustType;\n inverse?: T;\n}\n\ninterface IProps extends Omit<ImageProps, 'alt' | 'width' | 'height' | 'fill' | 'src'> {\n width: number;\n src: { light: Source<false>; dark?: Source };\n margin?: Property.Margin<string>;\n}\n\nexport const Illust = (props: IProps) => {\n const { src, width, margin } = props;\n const { sourcePrefix, currentSourceByColorTheme } = useIllust({ darkSrc: src.dark, src: src.light });\n\n const aspectRatio = illustSize[currentSourceByColorTheme]\n ? illustSize[currentSourceByColorTheme].width / illustSize[currentSourceByColorTheme].height\n : undefined;\n\n const css: CSSProperties = {\n width,\n margin,\n };\n\n const source = `${sourcePrefix}${currentSourceByColorTheme}.webp`;\n\n return (\n <div style={css}>\n <Image\n alt={currentSourceByColorTheme}\n {...props}\n src={source}\n width={width}\n height={aspectRatio ? width / aspectRatio : width}\n />\n </div>\n );\n};\n", "export const ILLUST = '/illust';\n\nexport const DARK_MODE_ILLUST_PREFIX = `${ILLUST}/dark/`;\nexport const LIGHT_MODE_ILLUST_PREFIX = `${ILLUST}/light/`;\n", "import { DARK_MODE_ILLUST_PREFIX, LIGHT_MODE_ILLUST_PREFIX } from '@/constants/illust/path';\nimport { Source } from '@/illust';\nimport { useDarkTheme } from '@liner-fe/design-token';\n\nexport const useIllust = ({ darkSrc, src }: { darkSrc?: Source; src: Source<false> }) => {\n const { isDarkMode } = useDarkTheme();\n\n const sourcePrefix = (() => {\n if (isDarkMode) {\n if (darkSrc?.inverse) {\n return LIGHT_MODE_ILLUST_PREFIX;\n }\n\n return DARK_MODE_ILLUST_PREFIX;\n }\n\n if (src.inverse === false) {\n return DARK_MODE_ILLUST_PREFIX;\n }\n\n return LIGHT_MODE_ILLUST_PREFIX;\n })();\n\n const currentSourceByColorTheme = isDarkMode ? darkSrc?.name || src.name : src.name;\n\n return { sourcePrefix, currentSourceByColorTheme, isDarkMode };\n};\n", "import { ILLUST } from '@/constants/illust/path';\nimport { IllustType } from '@/types/illust';\n\nexport const prefetchIllust = async ({ name, isDark = false }: { name: IllustType; isDark?: boolean }) =>\n await fetch(`${ILLUST}${isDark ? '/dark/' : '/light/'}${name}.webp`);\n"],
|
|
5
|
+
"mappings": ";;;;AAEA,IAAM,QAAQ,EAAE,QAAQ,EAAE,OAAO,MAAM,QAAQ,IAAI,GAAG,OAAO,EAAE,OAAO,MAAM,QAAQ,IAAI,EAAE;AAEnF,IAAM,aAA6E;AAAA,EACxF,4BAA4B,MAAM,MAAM;AAAA,EACxC,qBAAqB,MAAM,MAAM;AAAA,EACjC,oCAAoC,MAAM,MAAM;AAAA,EAChD,yBAAyB,MAAM,MAAM;AAAA,EACrC,uBAAuB,MAAM,MAAM;AAAA,EACnC,oC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