@loword/loword-design-system 0.0.14 → 0.0.15

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.
@@ -118,12 +118,12 @@ const Slide = ({ slidesPerView = 'auto', index, total, className, style, childre
118
118
  const Prev = ({ className, children, ...props }) => {
119
119
  const { scrollPrev, canScrollPrev, orientation } = useCarouselContext();
120
120
  return (_jsx("button", { type: "button", onClick: scrollPrev, disabled: !canScrollPrev, "aria-label": props['aria-label'] ?? '이전', className: cn('ld-carousel__nav', orientation === 'vertical' && 'ld-carousel__nav--vertical', className), children: children ??
121
- (orientation === 'vertical' ? (_jsx(ChevronUp, { size: 32, strokeWidth: 1.4 })) : (_jsx(ChevronLeft, { size: 32, strokeWidth: 1.4 }))) }));
121
+ (orientation === 'vertical' ? (_jsx(ChevronUp, { size: 28, strokeWidth: 1.4 })) : (_jsx(ChevronLeft, { size: 28, strokeWidth: 1.4 }))) }));
122
122
  };
123
123
  const Next = ({ className, children, ...props }) => {
124
124
  const { scrollNext, canScrollNext, orientation } = useCarouselContext();
125
125
  return (_jsx("button", { type: "button", onClick: scrollNext, disabled: !canScrollNext, "aria-label": props['aria-label'] ?? '다음', className: cn('ld-carousel__nav', orientation === 'vertical' && 'ld-carousel__nav--vertical', className), children: children ??
126
- (orientation === 'vertical' ? (_jsx(ChevronDown, { size: 32, strokeWidth: 1.4 })) : (_jsx(ChevronRight, { size: 32, strokeWidth: 1.4 }))) }));
126
+ (orientation === 'vertical' ? (_jsx(ChevronDown, { size: 28, strokeWidth: 1.4 })) : (_jsx(ChevronRight, { size: 28, strokeWidth: 1.4 }))) }));
127
127
  };
128
128
  const TopArrows = ({ className, children, ...props }) => {
129
129
  const { scrollNext, scrollPrev, canScrollNext, canScrollPrev, orientation } = useCarouselContext();
@@ -28,6 +28,14 @@ export interface LDCarouselProps {
28
28
  showCounter?: boolean;
29
29
  /** 한 화면에 보일 슬라이드 수. 기본 1. `'auto'`면 각 슬라이드가 내용 폭대로 배치 */
30
30
  slidesPerView?: number | 'auto';
31
+ /** 여러 행으로 쌓는 그리드 설정. 미지정 시 단일 행 */
32
+ grid?: {
33
+ /** 세로로 쌓을 행 개수. 2 이상이면 슬라이드를 행 개수만큼 세로로 묶어 한 열씩 넘긴다.
34
+ * 열이 달라도 같은 행은 같은 선상에서 시작하며, 카드 높이 자체는 콘텐츠대로 유지된다 */
35
+ rows: number;
36
+ /** 채우는 순서. 'row'(가로 우선: 0,1,2 / 3,4,5) · 'col'(세로 우선: 0,1 / 2,3). 기본 'row' */
37
+ fill?: 'row' | 'col';
38
+ };
31
39
  /** 슬라이드 사이 간격(Tailwind gap 단위 px). 기본 16 */
32
40
  gap?: number;
33
41
  className?: string;
@@ -41,7 +49,7 @@ export interface LDCarouselProps {
41
49
  * 고급 커스터마이징이 필요하면 `LDCarousel.Root` 등 compound API를 직접 조합하세요.
42
50
  */
43
51
  declare const LDCarousel: {
44
- ({ slides, orientation, loop, autoplay, autoScroll, align, containScroll, options, arrowPosition, showDots, showCounter, slidesPerView, gap, className, style, viewportClassName, slideClassName, }: LDCarouselProps): import("react/jsx-runtime").JSX.Element;
52
+ ({ slides, orientation, loop, autoplay, autoScroll, align, containScroll, options, arrowPosition, showDots, showCounter, slidesPerView, grid, gap, className, style, viewportClassName, slideClassName, }: LDCarouselProps): import("react/jsx-runtime").JSX.Element;
45
53
  Root: ({ orientation, loop, autoplay, autoScroll, align, containScroll, options, gap, className, style, children, }: RootProps) => import("react/jsx-runtime").JSX.Element;
46
54
  Viewport: ({ className, children }: import("./CarouselBase.js").ViewportProps) => import("react/jsx-runtime").JSX.Element;
47
55
  Container: ({ className, style, children }: import("./CarouselBase.js").ContainerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"LDCarousel.d.ts","sourceRoot":"","sources":["../../../src/components/LDCarousel/LDCarousel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,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CAAC;IACF,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,QAAA,MAAM,UAAU;+MAmBb,eAAe;;;;;;;;;;CAsFjB,CAAC;AAYF,eAAe,UAAU,CAAC"}
@@ -1,15 +1,27 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Fragment } from 'react';
3
4
  import CarouselBase from './CarouselBase.js';
4
5
  import cn from '../../utils/cn.js';
5
6
  /**
6
7
  * embla-carousel 기반 기본 캐러셀.
7
8
  * 고급 커스터마이징이 필요하면 `LDCarousel.Root` 등 compound API를 직접 조합하세요.
8
9
  */
9
- const LDCarousel = ({ slides, orientation = 'horizontal', loop = false, autoplay = false, autoScroll = false, align = 'start', containScroll = 'trimSnaps', options, arrowPosition = 'top', showDots = false, showCounter = false, slidesPerView = 'auto', gap = 16, className, style, viewportClassName, slideClassName, }) => {
10
+ const LDCarousel = ({ slides, orientation = 'horizontal', loop = false, autoplay = false, autoScroll = false, align = 'start', containScroll = 'trimSnaps', options, arrowPosition = 'top', showDots = false, showCounter = false, slidesPerView = 'auto', grid, gap = 16, className, style, viewportClassName, slideClassName, }) => {
10
11
  const isVertical = orientation === 'vertical';
11
- const total = slides.length;
12
- return (_jsx(CarouselBase.Root, { orientation: orientation, loop: loop, autoplay: autoplay, autoScroll: autoScroll, align: align, containScroll: containScroll, options: options, gap: gap, className: className, style: style, children: _jsxs("div", { className: "flex flex-col gap-3", children: [arrowPosition === 'top' && _jsx(CarouselBase.TopArrows, {}), _jsxs("div", { className: cn('flex items-center gap-3 w-full relative', isVertical && 'flex-col'), children: [arrowPosition === 'side' && _jsx(CarouselBase.Prev, {}), _jsx(CarouselBase.Viewport, { className: cn('w-full', viewportClassName), children: _jsx(CarouselBase.Container, { children: slides.map((slide, i) => (_jsx(CarouselBase.Slide, { slidesPerView: slidesPerView, index: i, total: total, className: slideClassName, children: slide }, i))) }) }), arrowPosition === 'side' && _jsx(CarouselBase.Next, {})] }), (showDots || showCounter) && (_jsxs("div", { className: "flex items-center justify-center gap-3", children: [showDots && (_jsx(CarouselBase.Dots, { className: isVertical ? 'flex-col' : undefined })), showCounter && _jsx(CarouselBase.Counter, {})] }))] }) }));
12
+ const rows = grid?.rows ?? 1;
13
+ const columnCount = Math.ceil(slides.length / rows);
14
+ const columns = rows <= 1
15
+ ? slides.map((_, i) => [i])
16
+ : Array.from({ length: columnCount }, (_, col) => Array.from({ length: rows }, (_, row) => grid?.fill === 'col' ? col * rows + row : row * columnCount + col).filter((i) => i < slides.length));
17
+ return (_jsx(CarouselBase.Root, { orientation: orientation, loop: loop, autoplay: autoplay, autoScroll: autoScroll, align: align, containScroll: containScroll, options: options, gap: gap, className: className, style: style, children: _jsxs("div", { className: "flex flex-col gap-3", children: [arrowPosition === 'top' && _jsx(CarouselBase.TopArrows, {}), _jsxs("div", { className: cn('flex items-center gap-3 w-full relative', isVertical && 'flex-col'), children: [arrowPosition === 'side' && _jsx(CarouselBase.Prev, {}), _jsx(CarouselBase.Viewport, { className: cn('w-full', viewportClassName), children: _jsx(CarouselBase.Container, { children: columns.map((column, i) => (_jsx(CarouselBase.Slide, { slidesPerView: slidesPerView, index: i, total: columns.length, className: slideClassName, children: rows <= 1 ? (slides[i]) : (
18
+ // 행 트랙을 균등 분할해야 열이 달라도 같은 행이 같은 선상에서 시작한다.
19
+ // (슬라이드끼리는 flex stretch로 이미 높이가 같음)
20
+ // items-start: 위치만 맞추고 카드 높이는 콘텐츠대로 둔다.
21
+ _jsx("div", { className: "grid h-full items-start", style: {
22
+ gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`,
23
+ rowGap: gap,
24
+ }, children: column.map((slideIndex) => (_jsx(Fragment, { children: slides[slideIndex] }, slideIndex))) })) }, i))) }) }), arrowPosition === 'side' && _jsx(CarouselBase.Next, {})] }), (showDots || showCounter) && (_jsxs("div", { className: "flex items-center justify-center gap-3", children: [showDots && (_jsx(CarouselBase.Dots, { className: isVertical ? 'flex-col' : undefined })), showCounter && _jsx(CarouselBase.Counter, {})] }))] }) }));
13
25
  };
14
26
  LDCarousel.Root = CarouselBase.Root;
15
27
  LDCarousel.Viewport = CarouselBase.Viewport;
package/dist/index.css CHANGED
@@ -2144,9 +2144,6 @@
2144
2144
  .border-danger600 {
2145
2145
  border-color: var(--color-danger600);
2146
2146
  }
2147
- .border-gray-200 {
2148
- border-color: var(--color-gray-200);
2149
- }
2150
2147
  .border-lb500 {
2151
2148
  border-color: var(--color-lb500);
2152
2149
  }
@@ -2914,6 +2911,9 @@
2914
2911
  .outline-danger600 {
2915
2912
  outline-color: var(--color-danger600);
2916
2913
  }
2914
+ .outline-gray-200 {
2915
+ outline-color: var(--color-gray-200);
2916
+ }
2917
2917
  .outline-lb500 {
2918
2918
  outline-color: var(--color-lb500);
2919
2919
  }
@@ -5409,20 +5409,28 @@
5409
5409
  height: 100%;
5410
5410
  }
5411
5411
  .ld-carousel__nav {
5412
- position: absolute;
5413
- top: 50%;
5414
- transform: translateY(-50%);
5415
5412
  display: flex;
5416
5413
  align-items: center;
5417
5414
  justify-content: center;
5418
- padding: 0;
5419
- background: transparent;
5420
- z-index: 10;
5415
+ background: var(--color-white);
5421
5416
  cursor: pointer;
5422
- transition: all 300ms ease-out;
5423
5417
  border-radius: 9999px;
5424
- width: 32px;
5425
- height: 32px;
5418
+ flex-shrink: 0;
5419
+ width: 50px;
5420
+ height: 50px;
5421
+ transition: all 300ms ease-out;
5422
+ --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
5423
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
5424
+ }
5425
+ @media (max-width: calc(768px - 1px)) {
5426
+ .ld-carousel__nav {
5427
+ width: 40px;
5428
+ height: 40px;
5429
+ }
5430
+ .ld-carousel__nav svg {
5431
+ width: 20px;
5432
+ height: 20px;
5433
+ }
5426
5434
  }
5427
5435
  .ld-carousel__nav:disabled {
5428
5436
  opacity: 0.4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loword/loword-design-system",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "로워드 디자인 시스템 컴포넌트 패키지(Tailwind v4)",
5
5
  "keywords": [
6
6
  "react",
@@ -8,20 +8,29 @@
8
8
  }
9
9
 
10
10
  .ld-carousel__nav {
11
- position: absolute;
12
- top: 50%;
13
- transform: translateY(-50%);
14
11
  display: flex;
15
12
  align-items: center;
16
13
  justify-content: center;
17
- padding: 0;
18
- background: transparent;
19
- z-index: 10;
14
+ background: var(--color-white);
20
15
  cursor: pointer;
21
- transition: all 300ms ease-out;
22
16
  border-radius: 9999px;
23
- width: 32px;
24
- height: 32px;
17
+ flex-shrink: 0;
18
+ width: 50px;
19
+ height: 50px;
20
+ transition: all 300ms ease-out;
21
+ @apply shadow-lg;
22
+ }
23
+
24
+ @variant mobile {
25
+ .ld-carousel__nav {
26
+ width: 40px;
27
+ height: 40px;
28
+ }
29
+
30
+ .ld-carousel__nav svg {
31
+ width: 20px;
32
+ height: 20px;
33
+ }
25
34
  }
26
35
 
27
36
  .ld-carousel__nav:disabled {