@liner-fe/prism 3.5.4 → 3.6.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/lib/index.d.ts +219 -3
- package/lib/index.js +279 -0
- package/package.json +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SystemKeys, TypographyCaptionPrefix, TypographyParagraphPrefix, TypographyHeadingPrefix, TypographyTitlePrefix, TypographyDisplayPrefix, BasicColorType } from '@liner-fe/design-token-primitive';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import react__default, { ButtonHTMLAttributes, HTMLAttributes, JSX, ReactNode, ComponentPropsWithoutRef, InputHTMLAttributes, MouseEventHandler, ReactElement } from 'react';
|
|
3
|
+
import react__default, { ButtonHTMLAttributes, HTMLAttributes, JSX, ReactNode, ComponentPropsWithoutRef, InputHTMLAttributes, MouseEventHandler, ReactElement, CSSProperties, ElementType } from 'react';
|
|
4
4
|
import * as cva from 'cva';
|
|
5
5
|
import { VariantProps } from 'cva';
|
|
6
6
|
import { IconProps, IconComponentType } from '@liner-fe/icon';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
8
|
import * as _artsy_fresnel_dist_Media from '@artsy/fresnel/dist/Media';
|
|
9
|
-
import { breakpointOrigin } from '@liner-fe/design-token';
|
|
9
|
+
import { breakpointOrigin, vars } from '@liner-fe/design-token';
|
|
10
10
|
import { Popover as Popover$1, Tooltip as Tooltip$1, Checkbox as Checkbox$1, RadioGroup, Select as Select$1, Label as Label$1, Avatar as Avatar$1, AlertDialog as AlertDialog$1, Dialog as Dialog$1 } from 'radix-ui';
|
|
11
11
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
12
12
|
import { PopoverProps, PopoverPortalProps } from '@radix-ui/react-popover';
|
|
@@ -1036,4 +1036,220 @@ interface RatioProps extends react.HTMLAttributes<HTMLDivElement> {
|
|
|
1036
1036
|
*/
|
|
1037
1037
|
declare const Ratio: react.ForwardRefExoticComponent<RatioProps & react.RefAttributes<HTMLDivElement>>;
|
|
1038
1038
|
|
|
1039
|
-
|
|
1039
|
+
/** padding prop 스케일. `component-*`(컴포넌트 내부 여백) / `section-*`(섹션 여백) 계열. */
|
|
1040
|
+
type PaddingToken = keyof typeof vars.padding;
|
|
1041
|
+
/** gap prop 스케일. `positive-*` 계열(요소 사이 간격). */
|
|
1042
|
+
type GapToken = keyof typeof vars.gap;
|
|
1043
|
+
/** margin prop 스케일. 원시 size 스케일(`minus*`로 음수 마진 지원). */
|
|
1044
|
+
type MarginToken = keyof typeof vars.size;
|
|
1045
|
+
/** Section 세로 여백 스케일 — padding 토큰 중 `section-*` 계열만. */
|
|
1046
|
+
type SectionPaddingToken = Extract<PaddingToken, `section-${string}`>;
|
|
1047
|
+
type BoxDisplay = 'none' | 'inline' | 'inline-block' | 'block' | 'flex' | 'inline-flex' | 'grid' | 'inline-grid' | 'contents';
|
|
1048
|
+
interface PaddingProps {
|
|
1049
|
+
/** 전체 padding */
|
|
1050
|
+
p?: PaddingToken;
|
|
1051
|
+
/** 좌우 padding (padding-inline) */
|
|
1052
|
+
px?: PaddingToken;
|
|
1053
|
+
/** 상하 padding (padding-block) */
|
|
1054
|
+
py?: PaddingToken;
|
|
1055
|
+
/** padding-top */
|
|
1056
|
+
pt?: PaddingToken;
|
|
1057
|
+
/** padding-right */
|
|
1058
|
+
pr?: PaddingToken;
|
|
1059
|
+
/** padding-bottom */
|
|
1060
|
+
pb?: PaddingToken;
|
|
1061
|
+
/** padding-left */
|
|
1062
|
+
pl?: PaddingToken;
|
|
1063
|
+
}
|
|
1064
|
+
interface MarginProps {
|
|
1065
|
+
/** 전체 margin */
|
|
1066
|
+
m?: MarginToken;
|
|
1067
|
+
/** 좌우 margin (margin-inline) */
|
|
1068
|
+
mx?: MarginToken;
|
|
1069
|
+
/** 상하 margin (margin-block) */
|
|
1070
|
+
my?: MarginToken;
|
|
1071
|
+
/** margin-top */
|
|
1072
|
+
mt?: MarginToken;
|
|
1073
|
+
/** margin-right */
|
|
1074
|
+
mr?: MarginToken;
|
|
1075
|
+
/** margin-bottom */
|
|
1076
|
+
mb?: MarginToken;
|
|
1077
|
+
/** margin-left */
|
|
1078
|
+
ml?: MarginToken;
|
|
1079
|
+
}
|
|
1080
|
+
interface SizingProps {
|
|
1081
|
+
/** raw CSS 값. 예: `'100%'`, `'320px'` */
|
|
1082
|
+
width?: CSSProperties['width'];
|
|
1083
|
+
height?: CSSProperties['height'];
|
|
1084
|
+
minWidth?: CSSProperties['minWidth'];
|
|
1085
|
+
maxWidth?: CSSProperties['maxWidth'];
|
|
1086
|
+
minHeight?: CSSProperties['minHeight'];
|
|
1087
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
1088
|
+
}
|
|
1089
|
+
interface PositionProps {
|
|
1090
|
+
position?: CSSProperties['position'];
|
|
1091
|
+
inset?: CSSProperties['inset'];
|
|
1092
|
+
overflow?: CSSProperties['overflow'];
|
|
1093
|
+
}
|
|
1094
|
+
interface FlexItemProps {
|
|
1095
|
+
flexBasis?: CSSProperties['flexBasis'];
|
|
1096
|
+
flexGrow?: CSSProperties['flexGrow'];
|
|
1097
|
+
flexShrink?: CSSProperties['flexShrink'];
|
|
1098
|
+
}
|
|
1099
|
+
interface GridItemProps {
|
|
1100
|
+
gridColumn?: CSSProperties['gridColumn'];
|
|
1101
|
+
gridRow?: CSSProperties['gridRow'];
|
|
1102
|
+
gridArea?: CSSProperties['gridArea'];
|
|
1103
|
+
}
|
|
1104
|
+
/** Box가 소비하는 모든 레이아웃 prop의 합집합. Flex/Grid/Container/Section이 확장한다. */
|
|
1105
|
+
interface LayoutProps extends PaddingProps, MarginProps, SizingProps, PositionProps, FlexItemProps, GridItemProps {
|
|
1106
|
+
display?: BoxDisplay;
|
|
1107
|
+
}
|
|
1108
|
+
interface BoxProps extends LayoutProps, Omit<HTMLAttributes<HTMLElement>, 'color'> {
|
|
1109
|
+
/** 렌더할 엘리먼트. 기본 `div`. */
|
|
1110
|
+
as?: ElementType;
|
|
1111
|
+
/** true면 자식 엘리먼트에 props를 병합(radix Slot). `as`보다 우선. */
|
|
1112
|
+
asChild?: boolean;
|
|
1113
|
+
}
|
|
1114
|
+
declare const gapTok: (k?: GapToken) => string | undefined;
|
|
1115
|
+
/**
|
|
1116
|
+
* Box 레이아웃 prop들을 inline style로 해석한다.
|
|
1117
|
+
* 우선순위: 축약(p/px/py, m/mx/my) < 개별 변(pt/pr/pb/pl, mt/mr/mb/ml).
|
|
1118
|
+
*/
|
|
1119
|
+
declare function resolveLayoutStyle(props: LayoutProps): CSSProperties;
|
|
1120
|
+
/**
|
|
1121
|
+
* LayoutProps를 소비하고 나머지(HTML 속성)만 남긴다.
|
|
1122
|
+
* Flex/Grid/Container/Section이 Box에 위임할 때 자기 prop만 뽑고 나머지를 넘기기 위해 쓴다.
|
|
1123
|
+
*/
|
|
1124
|
+
declare function splitLayoutProps<T extends LayoutProps>(props: T): {
|
|
1125
|
+
layout: LayoutProps;
|
|
1126
|
+
rest: Omit<T, keyof LayoutProps>;
|
|
1127
|
+
};
|
|
1128
|
+
/** align/justify 문자열을 flexbox CSS 값으로 매핑. Flex에서 재사용. */
|
|
1129
|
+
declare const FLEX_ALIGN: {
|
|
1130
|
+
readonly start: "flex-start";
|
|
1131
|
+
readonly center: "center";
|
|
1132
|
+
readonly end: "flex-end";
|
|
1133
|
+
readonly baseline: "baseline";
|
|
1134
|
+
readonly stretch: "stretch";
|
|
1135
|
+
};
|
|
1136
|
+
declare const FLEX_JUSTIFY: {
|
|
1137
|
+
readonly start: "flex-start";
|
|
1138
|
+
readonly center: "center";
|
|
1139
|
+
readonly end: "flex-end";
|
|
1140
|
+
readonly between: "space-between";
|
|
1141
|
+
readonly around: "space-around";
|
|
1142
|
+
readonly evenly: "space-evenly";
|
|
1143
|
+
};
|
|
1144
|
+
|
|
1145
|
+
/**
|
|
1146
|
+
* 토큰 세이프한 spacing(padding/margin)·display·sizing prop을 붙인 범용 레이아웃 블록.
|
|
1147
|
+
* 너비 제약이나 정렬 의견이 없다(그건 Container/Flex의 역할). 기본 `div`로 렌더하며
|
|
1148
|
+
* `as`로 시맨틱 엘리먼트, `asChild`로 자식에 병합할 수 있다.
|
|
1149
|
+
*
|
|
1150
|
+
* ```tsx
|
|
1151
|
+
* <Box p="component-400" m="8" maxWidth="640px">…</Box>
|
|
1152
|
+
* ```
|
|
1153
|
+
*/
|
|
1154
|
+
declare const Box: react.ForwardRefExoticComponent<BoxProps & react.RefAttributes<HTMLElement>>;
|
|
1155
|
+
|
|
1156
|
+
type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
1157
|
+
type FlexAlign = keyof typeof FLEX_ALIGN;
|
|
1158
|
+
type FlexJustify = keyof typeof FLEX_JUSTIFY;
|
|
1159
|
+
type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
1160
|
+
interface FlexProps extends BoxProps {
|
|
1161
|
+
/** true면 `inline-flex`로 렌더. */
|
|
1162
|
+
inline?: boolean;
|
|
1163
|
+
/** flex-direction. 기본 `row`. */
|
|
1164
|
+
direction?: FlexDirection;
|
|
1165
|
+
/** align-items. `start | center | end | baseline | stretch`. */
|
|
1166
|
+
align?: FlexAlign;
|
|
1167
|
+
/** justify-content. `start | center | end | between | around | evenly`. */
|
|
1168
|
+
justify?: FlexJustify;
|
|
1169
|
+
/** flex-wrap. 기본 `nowrap`. */
|
|
1170
|
+
wrap?: FlexWrap;
|
|
1171
|
+
/** 요소 사이 간격(gap 토큰). */
|
|
1172
|
+
gap?: GapToken;
|
|
1173
|
+
/** 가로 간격(column-gap). `gap`보다 우선. */
|
|
1174
|
+
gapX?: GapToken;
|
|
1175
|
+
/** 세로 간격(row-gap). `gap`보다 우선. */
|
|
1176
|
+
gapY?: GapToken;
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* flexbox 컨테이너. Box 위에 flex 배치 prop(direction/align/justify/wrap/gap)을 얹는다.
|
|
1180
|
+
* 모든 Box prop(padding/margin/sizing/asChild 등)을 그대로 받는다.
|
|
1181
|
+
*
|
|
1182
|
+
* ```tsx
|
|
1183
|
+
* <Flex direction="column" gap="positive-300" align="center" p="component-400">…</Flex>
|
|
1184
|
+
* ```
|
|
1185
|
+
*/
|
|
1186
|
+
declare const Flex: react.ForwardRefExoticComponent<FlexProps & react.RefAttributes<HTMLElement>>;
|
|
1187
|
+
|
|
1188
|
+
type GridAlign = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
|
|
1189
|
+
type GridJustify = 'start' | 'center' | 'end' | 'between';
|
|
1190
|
+
type GridFlow = 'row' | 'column' | 'dense' | 'row-dense' | 'column-dense';
|
|
1191
|
+
interface GridProps extends BoxProps {
|
|
1192
|
+
/** true면 `inline-grid`로 렌더. */
|
|
1193
|
+
inline?: boolean;
|
|
1194
|
+
/** grid-template-columns. 숫자 N → `repeat(N, minmax(0, 1fr))`, 문자열 → 그대로. */
|
|
1195
|
+
columns?: number | string;
|
|
1196
|
+
/** grid-template-rows. 숫자 N → `repeat(N, minmax(0, 1fr))`, 문자열 → 그대로. */
|
|
1197
|
+
rows?: number | string;
|
|
1198
|
+
/** grid-auto-flow. */
|
|
1199
|
+
flow?: GridFlow;
|
|
1200
|
+
/** align-items. `start | center | end | baseline | stretch`. */
|
|
1201
|
+
align?: GridAlign;
|
|
1202
|
+
/** justify-content. `start | center | end | between`. */
|
|
1203
|
+
justify?: GridJustify;
|
|
1204
|
+
/** 셀 사이 간격(gap 토큰). */
|
|
1205
|
+
gap?: GapToken;
|
|
1206
|
+
/** 가로 간격(column-gap). `gap`보다 우선. */
|
|
1207
|
+
gapX?: GapToken;
|
|
1208
|
+
/** 세로 간격(row-gap). `gap`보다 우선. */
|
|
1209
|
+
gapY?: GapToken;
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* CSS grid 컨테이너. Box 위에 grid 배치 prop(columns/rows/flow/align/justify/gap)을 얹는다.
|
|
1213
|
+
*
|
|
1214
|
+
* ```tsx
|
|
1215
|
+
* <Grid columns={3} gap="positive-200">…</Grid>
|
|
1216
|
+
* <Grid columns="1fr 2fr" rows="auto 1fr">…</Grid>
|
|
1217
|
+
* ```
|
|
1218
|
+
*/
|
|
1219
|
+
declare const Grid: react.ForwardRefExoticComponent<GridProps & react.RefAttributes<HTMLElement>>;
|
|
1220
|
+
|
|
1221
|
+
/** Container 최대 너비 프리셋 — breakpoint 토큰 값을 재사용한다. */
|
|
1222
|
+
type ContainerSize = 's' | 'm' | 'l' | 'xl';
|
|
1223
|
+
interface ContainerProps extends BoxProps {
|
|
1224
|
+
/** 최대 너비 프리셋. 기본 `l`(1366px). `maxWidth`를 직접 주면 그 값이 우선한다. */
|
|
1225
|
+
size?: ContainerSize;
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* 콘텐츠를 읽기 좋은 최대 너비로 제한하고 가로 중앙 정렬하는 페이지 레벨 래퍼다.
|
|
1229
|
+
* 와이드 스크린에서 본문이 화면 끝까지 늘어나지 않게 감쌀 때 쓴다.
|
|
1230
|
+
* (Box와 달리 `max-width` + 중앙정렬 의견을 가진 프리셋이다.)
|
|
1231
|
+
*
|
|
1232
|
+
* ```tsx
|
|
1233
|
+
* <Container size="l" px="component-400">…</Container>
|
|
1234
|
+
* ```
|
|
1235
|
+
*/
|
|
1236
|
+
declare const Container: react.ForwardRefExoticComponent<ContainerProps & react.RefAttributes<HTMLElement>>;
|
|
1237
|
+
|
|
1238
|
+
interface SectionProps extends BoxProps {
|
|
1239
|
+
/**
|
|
1240
|
+
* 세로 여백 프리셋(`section-*` 토큰). 기본 `section-400`.
|
|
1241
|
+
* `py`를 직접 주면 그 값이 우선한다.
|
|
1242
|
+
*/
|
|
1243
|
+
size?: SectionPaddingToken;
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* 페이지를 세로로 나누는 구획이다. `section-*` 여백 스케일로 위아래 리듬을 준다.
|
|
1247
|
+
* 기본 시맨틱 엘리먼트는 `<section>`이며 `as`로 바꿀 수 있다.
|
|
1248
|
+
*
|
|
1249
|
+
* ```tsx
|
|
1250
|
+
* <Section size="section-500">…</Section>
|
|
1251
|
+
* ```
|
|
1252
|
+
*/
|
|
1253
|
+
declare const Section: react.ForwardRefExoticComponent<SectionProps & react.RefAttributes<HTMLElement>>;
|
|
1254
|
+
|
|
1255
|
+
export { AlertDialog, type AlertDialogAction, type AlertDialogConfirmAction, type AlertDialogContentProps, Avatar, type AvatarLoadingStatus, type AvatarProps, type AvatarSize, Badge, type BadgeColor, type BadgeIconProps, type BadgeProps, type BadgeSize, type BadgeVariant, BottomSheet, type BottomSheetAction, type BottomSheetConfirmAction, type BottomSheetContentProps, type BottomSheetMode, Box, type BoxDisplay, type BoxProps, type BreakPointsKey, Button, type ButtonIconProps, type ButtonProps, type ButtonSizeType, Caption, Checkbox, CoachMark, type CoachMarkContentProps, type CommonButtonProps, CompactCoachMark, type CompactCoachMarkContentProps, Container, type ContainerProps, type ContainerSize, DEFAULT_LEVEL_OPTIONS, DEFAULT_SIZE_OPTIONS, DefaultButton, type DefaultButtonProps, type DefaultLevelType, Dialog, type DialogAction, type DialogConfirmAction, type DialogContentProps, Display, FLEX_ALIGN, FLEX_JUSTIFY, Flex, type FlexAlign, type FlexDirection, type FlexItemProps, type FlexJustify, type FlexProps, type FlexWrap, type GapToken, Grid, type GridAlign, type GridFlow, type GridItemProps, type GridJustify, type GridProps, Heading, ICON_LEVEL_OPTIONS, ICON_SIZE_OPTIONS, type ICaptionProps, type IDisplayProps, type IHeadingProps, type IPropsAccent, type IPropsAnswer, type IPropsNormal, type IPropsNormalBold, type IPropsPost, type ITitleProps, IconButton, type IconButtonProps, LOGOS, Label, type LayoutProps, List, type ListGroupProps, ListItem, type ListItemProps, type ListProps, Loading, type LoadingLevelType, Logo, type LogoCategory, type LogoName, type LogoProps, type MarginProps, type MarginToken, Media, MediaContextProvider, type PaddingProps, type PaddingToken, Paragraph, type ParagraphProps, Popover, type PopoverContentProps, type PositionProps, PrimitiveCoachMark, type PrimitiveCoachMarkContentProps, type PrimitiveCoachMarkRootProps, PrimitiveListItem, type PrimitiveListItemProps, type PromiseToastOptions, RATIO, Radio, Ratio, type RatioProps, Section, type SectionPaddingToken, type SectionProps, Select, type SelectButtonSize, type SelectContentProps, type SelectFieldSize, type SelectGroupProps, type SelectItemProps, type SelectPrimitiveItemProps, type SelectProps, type SelectTriggerProps, type SelectTriggerType, type SelectWidthOptions, type SizingProps, TEXT_LEVEL_OPTIONS, TEXT_SIZE_OPTIONS, Tag, TextButton, type TextButtonProps, type TextSizeType, Textfield, type TextfieldButtonProps, type TextfieldLabelType, type TextfieldProps, Title, type ToastOptions, type ToastType, Toaster, Tooltip, Typography, arrayToStyleObject, isEmptyObject, objectToArray, gapTok as resolveGapToken, resolveLayoutStyle, rootMediaStyle, splitLayoutProps, toast };
|
package/lib/index.js
CHANGED
|
@@ -3631,21 +3631,296 @@ var Ratio = React5.forwardRef(
|
|
|
3631
3631
|
({ ratio = 1, children, ...props }, ref) => /* @__PURE__ */ jsx39(AspectRatioPrimitive.Root, { ref, ratio, ...props, children })
|
|
3632
3632
|
);
|
|
3633
3633
|
Ratio.displayName = "Ratio";
|
|
3634
|
+
|
|
3635
|
+
// src/components/Box/index.tsx
|
|
3636
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
3637
|
+
import { Slot as SlotPrimitive2 } from "radix-ui";
|
|
3638
|
+
import { vars as vars2 } from "@liner-fe/design-token";
|
|
3639
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3640
|
+
var { Slot: Slot2 } = SlotPrimitive2;
|
|
3641
|
+
var padTok = /* @__PURE__ */ __name((k) => k ? vars2.padding[k] : void 0, "padTok");
|
|
3642
|
+
var gapTok = /* @__PURE__ */ __name((k) => k ? vars2.gap[k] : void 0, "gapTok");
|
|
3643
|
+
var marginTok = /* @__PURE__ */ __name((k) => k ? vars2.size[k] : void 0, "marginTok");
|
|
3644
|
+
function resolveLayoutStyle(props) {
|
|
3645
|
+
const {
|
|
3646
|
+
p,
|
|
3647
|
+
px,
|
|
3648
|
+
py,
|
|
3649
|
+
pt,
|
|
3650
|
+
pr,
|
|
3651
|
+
pb,
|
|
3652
|
+
pl,
|
|
3653
|
+
m,
|
|
3654
|
+
mx,
|
|
3655
|
+
my,
|
|
3656
|
+
mt,
|
|
3657
|
+
mr,
|
|
3658
|
+
mb,
|
|
3659
|
+
ml,
|
|
3660
|
+
display,
|
|
3661
|
+
width,
|
|
3662
|
+
height,
|
|
3663
|
+
minWidth,
|
|
3664
|
+
maxWidth,
|
|
3665
|
+
minHeight,
|
|
3666
|
+
maxHeight,
|
|
3667
|
+
position,
|
|
3668
|
+
inset,
|
|
3669
|
+
overflow,
|
|
3670
|
+
flexBasis,
|
|
3671
|
+
flexGrow,
|
|
3672
|
+
flexShrink,
|
|
3673
|
+
gridColumn,
|
|
3674
|
+
gridRow,
|
|
3675
|
+
gridArea
|
|
3676
|
+
} = props;
|
|
3677
|
+
const style = {};
|
|
3678
|
+
if (p) style.padding = padTok(p);
|
|
3679
|
+
if (px) {
|
|
3680
|
+
style.paddingLeft = padTok(px);
|
|
3681
|
+
style.paddingRight = padTok(px);
|
|
3682
|
+
}
|
|
3683
|
+
if (py) {
|
|
3684
|
+
style.paddingTop = padTok(py);
|
|
3685
|
+
style.paddingBottom = padTok(py);
|
|
3686
|
+
}
|
|
3687
|
+
if (pt) style.paddingTop = padTok(pt);
|
|
3688
|
+
if (pr) style.paddingRight = padTok(pr);
|
|
3689
|
+
if (pb) style.paddingBottom = padTok(pb);
|
|
3690
|
+
if (pl) style.paddingLeft = padTok(pl);
|
|
3691
|
+
if (m) style.margin = marginTok(m);
|
|
3692
|
+
if (mx) {
|
|
3693
|
+
style.marginLeft = marginTok(mx);
|
|
3694
|
+
style.marginRight = marginTok(mx);
|
|
3695
|
+
}
|
|
3696
|
+
if (my) {
|
|
3697
|
+
style.marginTop = marginTok(my);
|
|
3698
|
+
style.marginBottom = marginTok(my);
|
|
3699
|
+
}
|
|
3700
|
+
if (mt) style.marginTop = marginTok(mt);
|
|
3701
|
+
if (mr) style.marginRight = marginTok(mr);
|
|
3702
|
+
if (mb) style.marginBottom = marginTok(mb);
|
|
3703
|
+
if (ml) style.marginLeft = marginTok(ml);
|
|
3704
|
+
if (display) style.display = display;
|
|
3705
|
+
if (width !== void 0) style.width = width;
|
|
3706
|
+
if (height !== void 0) style.height = height;
|
|
3707
|
+
if (minWidth !== void 0) style.minWidth = minWidth;
|
|
3708
|
+
if (maxWidth !== void 0) style.maxWidth = maxWidth;
|
|
3709
|
+
if (minHeight !== void 0) style.minHeight = minHeight;
|
|
3710
|
+
if (maxHeight !== void 0) style.maxHeight = maxHeight;
|
|
3711
|
+
if (position) style.position = position;
|
|
3712
|
+
if (inset !== void 0) style.inset = inset;
|
|
3713
|
+
if (overflow) style.overflow = overflow;
|
|
3714
|
+
if (flexBasis !== void 0) style.flexBasis = flexBasis;
|
|
3715
|
+
if (flexGrow !== void 0) style.flexGrow = flexGrow;
|
|
3716
|
+
if (flexShrink !== void 0) style.flexShrink = flexShrink;
|
|
3717
|
+
if (gridColumn !== void 0) style.gridColumn = gridColumn;
|
|
3718
|
+
if (gridRow !== void 0) style.gridRow = gridRow;
|
|
3719
|
+
if (gridArea !== void 0) style.gridArea = gridArea;
|
|
3720
|
+
return style;
|
|
3721
|
+
}
|
|
3722
|
+
__name(resolveLayoutStyle, "resolveLayoutStyle");
|
|
3723
|
+
function splitLayoutProps(props) {
|
|
3724
|
+
const {
|
|
3725
|
+
p,
|
|
3726
|
+
px,
|
|
3727
|
+
py,
|
|
3728
|
+
pt,
|
|
3729
|
+
pr,
|
|
3730
|
+
pb,
|
|
3731
|
+
pl,
|
|
3732
|
+
m,
|
|
3733
|
+
mx,
|
|
3734
|
+
my,
|
|
3735
|
+
mt,
|
|
3736
|
+
mr,
|
|
3737
|
+
mb,
|
|
3738
|
+
ml,
|
|
3739
|
+
display,
|
|
3740
|
+
width,
|
|
3741
|
+
height,
|
|
3742
|
+
minWidth,
|
|
3743
|
+
maxWidth,
|
|
3744
|
+
minHeight,
|
|
3745
|
+
maxHeight,
|
|
3746
|
+
position,
|
|
3747
|
+
inset,
|
|
3748
|
+
overflow,
|
|
3749
|
+
flexBasis,
|
|
3750
|
+
flexGrow,
|
|
3751
|
+
flexShrink,
|
|
3752
|
+
gridColumn,
|
|
3753
|
+
gridRow,
|
|
3754
|
+
gridArea,
|
|
3755
|
+
...rest
|
|
3756
|
+
} = props;
|
|
3757
|
+
return {
|
|
3758
|
+
layout: {
|
|
3759
|
+
p,
|
|
3760
|
+
px,
|
|
3761
|
+
py,
|
|
3762
|
+
pt,
|
|
3763
|
+
pr,
|
|
3764
|
+
pb,
|
|
3765
|
+
pl,
|
|
3766
|
+
m,
|
|
3767
|
+
mx,
|
|
3768
|
+
my,
|
|
3769
|
+
mt,
|
|
3770
|
+
mr,
|
|
3771
|
+
mb,
|
|
3772
|
+
ml,
|
|
3773
|
+
display,
|
|
3774
|
+
width,
|
|
3775
|
+
height,
|
|
3776
|
+
minWidth,
|
|
3777
|
+
maxWidth,
|
|
3778
|
+
minHeight,
|
|
3779
|
+
maxHeight,
|
|
3780
|
+
position,
|
|
3781
|
+
inset,
|
|
3782
|
+
overflow,
|
|
3783
|
+
flexBasis,
|
|
3784
|
+
flexGrow,
|
|
3785
|
+
flexShrink,
|
|
3786
|
+
gridColumn,
|
|
3787
|
+
gridRow,
|
|
3788
|
+
gridArea
|
|
3789
|
+
},
|
|
3790
|
+
rest
|
|
3791
|
+
};
|
|
3792
|
+
}
|
|
3793
|
+
__name(splitLayoutProps, "splitLayoutProps");
|
|
3794
|
+
var FLEX_ALIGN = {
|
|
3795
|
+
start: "flex-start",
|
|
3796
|
+
center: "center",
|
|
3797
|
+
end: "flex-end",
|
|
3798
|
+
baseline: "baseline",
|
|
3799
|
+
stretch: "stretch"
|
|
3800
|
+
};
|
|
3801
|
+
var FLEX_JUSTIFY = {
|
|
3802
|
+
start: "flex-start",
|
|
3803
|
+
center: "center",
|
|
3804
|
+
end: "flex-end",
|
|
3805
|
+
between: "space-between",
|
|
3806
|
+
around: "space-around",
|
|
3807
|
+
evenly: "space-evenly"
|
|
3808
|
+
};
|
|
3809
|
+
var Box = forwardRef26(/* @__PURE__ */ __name(function Box2({ as: Tag2 = "div", asChild, className, style, children, ...props }, ref) {
|
|
3810
|
+
const { layout, rest } = splitLayoutProps(props);
|
|
3811
|
+
const Comp = asChild ? Slot2 : Tag2;
|
|
3812
|
+
return /* @__PURE__ */ jsx40(Comp, { ref, className, style: { ...resolveLayoutStyle(layout), ...style }, ...rest, children });
|
|
3813
|
+
}, "Box"));
|
|
3814
|
+
|
|
3815
|
+
// src/components/Flex/index.tsx
|
|
3816
|
+
import { forwardRef as forwardRef27 } from "react";
|
|
3817
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3818
|
+
var Flex = forwardRef27(/* @__PURE__ */ __name(function Flex2({ inline, direction, align, justify, wrap, gap, gapX, gapY, style, ...boxProps }, ref) {
|
|
3819
|
+
const flexStyle = {
|
|
3820
|
+
display: inline ? "inline-flex" : "flex",
|
|
3821
|
+
flexDirection: direction,
|
|
3822
|
+
alignItems: align ? FLEX_ALIGN[align] : void 0,
|
|
3823
|
+
justifyContent: justify ? FLEX_JUSTIFY[justify] : void 0,
|
|
3824
|
+
flexWrap: wrap,
|
|
3825
|
+
gap: gapTok(gap),
|
|
3826
|
+
columnGap: gapTok(gapX),
|
|
3827
|
+
rowGap: gapTok(gapY)
|
|
3828
|
+
};
|
|
3829
|
+
return /* @__PURE__ */ jsx41(Box, { ref, style: { ...flexStyle, ...style }, ...boxProps });
|
|
3830
|
+
}, "Flex"));
|
|
3831
|
+
|
|
3832
|
+
// src/components/Grid/index.tsx
|
|
3833
|
+
import { forwardRef as forwardRef28 } from "react";
|
|
3834
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3835
|
+
var GRID_JUSTIFY = {
|
|
3836
|
+
start: "start",
|
|
3837
|
+
center: "center",
|
|
3838
|
+
end: "end",
|
|
3839
|
+
between: "space-between"
|
|
3840
|
+
};
|
|
3841
|
+
var GRID_FLOW = {
|
|
3842
|
+
row: "row",
|
|
3843
|
+
column: "column",
|
|
3844
|
+
dense: "dense",
|
|
3845
|
+
"row-dense": "row dense",
|
|
3846
|
+
"column-dense": "column dense"
|
|
3847
|
+
};
|
|
3848
|
+
var track = /* @__PURE__ */ __name((v) => {
|
|
3849
|
+
if (v === void 0) return void 0;
|
|
3850
|
+
return typeof v === "number" ? `repeat(${v}, minmax(0, 1fr))` : v;
|
|
3851
|
+
}, "track");
|
|
3852
|
+
var Grid = forwardRef28(/* @__PURE__ */ __name(function Grid2({ inline, columns, rows, flow, align, justify, gap, gapX, gapY, style, ...boxProps }, ref) {
|
|
3853
|
+
const gridStyle = {
|
|
3854
|
+
display: inline ? "inline-grid" : "grid",
|
|
3855
|
+
gridTemplateColumns: track(columns),
|
|
3856
|
+
gridTemplateRows: track(rows),
|
|
3857
|
+
gridAutoFlow: flow ? GRID_FLOW[flow] : void 0,
|
|
3858
|
+
alignItems: align,
|
|
3859
|
+
justifyContent: justify ? GRID_JUSTIFY[justify] : void 0,
|
|
3860
|
+
gap: gapTok(gap),
|
|
3861
|
+
columnGap: gapTok(gapX),
|
|
3862
|
+
rowGap: gapTok(gapY)
|
|
3863
|
+
};
|
|
3864
|
+
return /* @__PURE__ */ jsx42(Box, { ref, style: { ...gridStyle, ...style }, ...boxProps });
|
|
3865
|
+
}, "Grid"));
|
|
3866
|
+
|
|
3867
|
+
// src/components/Container/index.tsx
|
|
3868
|
+
import { forwardRef as forwardRef29 } from "react";
|
|
3869
|
+
import { breakpointOrigin as breakpointOrigin2 } from "@liner-fe/design-token";
|
|
3870
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3871
|
+
var SIZE_MAX_WIDTH = {
|
|
3872
|
+
s: breakpointOrigin2.s,
|
|
3873
|
+
// 600px
|
|
3874
|
+
m: breakpointOrigin2.m,
|
|
3875
|
+
// 1024px
|
|
3876
|
+
l: breakpointOrigin2.l,
|
|
3877
|
+
// 1366px
|
|
3878
|
+
xl: breakpointOrigin2.xl
|
|
3879
|
+
// 1536px
|
|
3880
|
+
};
|
|
3881
|
+
var Container = forwardRef29(/* @__PURE__ */ __name(function Container2({ size = "l", style, maxWidth, ...boxProps }, ref) {
|
|
3882
|
+
const containerStyle = {
|
|
3883
|
+
width: "100%",
|
|
3884
|
+
marginInline: "auto"
|
|
3885
|
+
};
|
|
3886
|
+
return /* @__PURE__ */ jsx43(
|
|
3887
|
+
Box,
|
|
3888
|
+
{
|
|
3889
|
+
ref,
|
|
3890
|
+
maxWidth: maxWidth ?? SIZE_MAX_WIDTH[size],
|
|
3891
|
+
style: { ...containerStyle, ...style },
|
|
3892
|
+
...boxProps
|
|
3893
|
+
}
|
|
3894
|
+
);
|
|
3895
|
+
}, "Container"));
|
|
3896
|
+
|
|
3897
|
+
// src/components/Section/index.tsx
|
|
3898
|
+
import { forwardRef as forwardRef30 } from "react";
|
|
3899
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3900
|
+
var Section = forwardRef30(/* @__PURE__ */ __name(function Section2({ size = "section-400", py, as = "section", ...boxProps }, ref) {
|
|
3901
|
+
return /* @__PURE__ */ jsx44(Box, { ref, as, py: py ?? size, ...boxProps });
|
|
3902
|
+
}, "Section"));
|
|
3634
3903
|
export {
|
|
3635
3904
|
AlertDialog,
|
|
3636
3905
|
Avatar,
|
|
3637
3906
|
Badge,
|
|
3638
3907
|
BottomSheet,
|
|
3908
|
+
Box,
|
|
3639
3909
|
Button,
|
|
3640
3910
|
Caption,
|
|
3641
3911
|
Checkbox,
|
|
3642
3912
|
CoachMark,
|
|
3643
3913
|
CompactCoachMark,
|
|
3914
|
+
Container,
|
|
3644
3915
|
DEFAULT_LEVEL_OPTIONS,
|
|
3645
3916
|
DEFAULT_SIZE_OPTIONS,
|
|
3646
3917
|
DefaultButton,
|
|
3647
3918
|
Dialog,
|
|
3648
3919
|
Display,
|
|
3920
|
+
FLEX_ALIGN,
|
|
3921
|
+
FLEX_JUSTIFY,
|
|
3922
|
+
Flex,
|
|
3923
|
+
Grid,
|
|
3649
3924
|
Heading,
|
|
3650
3925
|
ICON_LEVEL_OPTIONS,
|
|
3651
3926
|
ICON_SIZE_OPTIONS,
|
|
@@ -3665,6 +3940,7 @@ export {
|
|
|
3665
3940
|
RATIO,
|
|
3666
3941
|
Radio,
|
|
3667
3942
|
Ratio,
|
|
3943
|
+
Section,
|
|
3668
3944
|
Select,
|
|
3669
3945
|
TEXT_LEVEL_OPTIONS,
|
|
3670
3946
|
TEXT_SIZE_OPTIONS,
|
|
@@ -3678,6 +3954,9 @@ export {
|
|
|
3678
3954
|
arrayToStyleObject,
|
|
3679
3955
|
isEmptyObject,
|
|
3680
3956
|
objectToArray,
|
|
3957
|
+
gapTok as resolveGapToken,
|
|
3958
|
+
resolveLayoutStyle,
|
|
3681
3959
|
rootMediaStyle,
|
|
3960
|
+
splitLayoutProps,
|
|
3682
3961
|
toast
|
|
3683
3962
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liner-fe/prism",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"dependencies": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"react-dom": "^19.1.0",
|
|
21
21
|
"jotai": "2.18.0",
|
|
22
22
|
"vaul": "1.1.2",
|
|
23
|
+
"@liner-fe/design-token": "^3.0.5",
|
|
23
24
|
"@liner-fe/design-token-primitive": "^0.2.50",
|
|
24
|
-
"@liner-fe/icon": "^2.0.
|
|
25
|
-
"@liner-fe/illust": "^1.0.1"
|
|
26
|
-
"@liner-fe/design-token": "^3.0.5"
|
|
25
|
+
"@liner-fe/icon": "^2.0.24",
|
|
26
|
+
"@liner-fe/illust": "^1.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@chromatic-com/storybook": "^1.5.0",
|