@nurihaus/web-design-system 3.9.5 → 3.10.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.
@@ -1,6 +1,8 @@
1
1
  export declare const variant: readonly ["neutral", "success", "warning", "danger"];
2
2
  /** 나타날 때 모션 세기. 주지 않으면 움직이지 않는다 (ADR 0008) */
3
3
  export declare const motion: readonly ["weak", "strong"];
4
+ /** action 자리. below 는 본문 아래 줄, inline 은 본문 오른쪽 같은 줄 */
5
+ export declare const actionPlacement: readonly ["below", "inline"];
4
6
  export declare const noticeProps: {
5
7
  variant: {
6
8
  type: "className";
@@ -13,4 +15,10 @@ export declare const noticeProps: {
13
15
  className: string;
14
16
  values: readonly ["weak", "strong"];
15
17
  };
18
+ actionPlacement: {
19
+ type: "className";
20
+ className: string;
21
+ values: readonly ["below", "inline"];
22
+ default: "below";
23
+ };
16
24
  };
@@ -1,6 +1,6 @@
1
1
  import { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  import { TrackProps } from '../logging/logging-type';
3
- import { motion, variant } from './notice-props';
3
+ import { actionPlacement, motion, variant } from './notice-props';
4
4
  export type BaseNoticeProps = ComponentPropsWithRef<'div'>;
5
5
  /** Toast 의 action 과 같은 모양. Notice 는 Radix Toast 가 아니라 altText 가 없다. track 은 버튼(CTAButton)이 보낸다 */
6
6
  export interface NoticeAction extends TrackProps {
@@ -14,8 +14,10 @@ export interface NoticeProps extends Omit<ComponentPropsWithRef<'div'>, 'title'>
14
14
  title?: ReactNode;
15
15
  /** 본문 글 */
16
16
  children: ReactNode;
17
- /** 본문 아래 작은 버튼(CTAButton xs·primary·outline) 하나 */
17
+ /** 작은 버튼(CTAButton xs·primary·outline) 하나. 자리는 actionPlacement 가 정한다 */
18
18
  action?: NoticeAction;
19
+ /** action 자리. 'below'(기본) 는 본문 아래 줄, 'inline' 은 본문 오른쪽 같은 줄(마지막 줄에 맞춘다). action 이 없으면 효과가 없다 */
20
+ actionPlacement?: (typeof actionPlacement)[number];
19
21
  /** 조건부로 나타나는 안내만 준다. 나타날 때 흐려졌다 선명해진다 */
20
22
  motion?: (typeof motion)[number];
21
23
  }
@@ -1,5 +1,5 @@
1
1
  import type { StoryObj } from '@storybook/react-webpack5';
2
- import { motion, variant } from './notice-props';
2
+ import { actionPlacement, motion, variant } from './notice-props';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  parameters: {
@@ -23,6 +23,12 @@ declare const meta: {
23
23
  };
24
24
  options: readonly ["weak", "strong"];
25
25
  };
26
+ actionPlacement: {
27
+ control: {
28
+ type: "select";
29
+ };
30
+ options: readonly ["below", "inline"];
31
+ };
26
32
  };
27
33
  args: {
28
34
  children: string;
@@ -298,6 +304,7 @@ declare const meta: {
298
304
  variant?: (typeof variant)[number] | undefined;
299
305
  motion?: (typeof motion)[number] | undefined;
300
306
  action?: import("./notice-type").NoticeAction | undefined;
307
+ actionPlacement?: (typeof actionPlacement)[number] | undefined;
301
308
  ref?: import("react").LegacyRef<HTMLDivElement> | undefined;
302
309
  }>) => import("react/jsx-runtime").JSX.Element)[];
303
310
  };
@@ -307,5 +314,7 @@ export declare const Default: Story;
307
314
  export declare const Variants: Story;
308
315
  export declare const WithTitle: Story;
309
316
  export declare const WithAction: Story;
317
+ /** 짧은 안내와 버튼 하나를 같은 줄에 둔다. 본문이 길면 글만 줄바꿈되고 버튼은 마지막 줄 옆에 남는다 */
318
+ export declare const InlineAction: Story;
310
319
  /** 버튼을 누르면 안내가 나타난다. weak·strong 을 견준다 */
311
320
  export declare const Motion: Story;
@@ -315,8 +315,8 @@ declare const meta: {
315
315
  height?: number | string | undefined;
316
316
  width?: number | string | undefined;
317
317
  shape?: (typeof shapes)[number] | undefined;
318
- lines?: number | undefined;
319
318
  animated?: boolean | undefined;
319
+ lines?: number | undefined;
320
320
  ref?: import("react").LegacyRef<HTMLSpanElement> | undefined;
321
321
  }>) => import("react/jsx-runtime").JSX.Element)[];
322
322
  };
@@ -3073,6 +3073,15 @@
3073
3073
  --motion-slide-offset: translateY(100%);
3074
3074
  }
3075
3075
 
3076
+ .drawer.side-bottom.fit-content {
3077
+ height: auto;
3078
+ max-height: var(--sheet-max-height);
3079
+ }
3080
+
3081
+ .drawer.side-bottom.fit-screen {
3082
+ height: var(--sheet-max-height);
3083
+ }
3084
+
3076
3085
  .drawer[data-state='open'] {
3077
3086
  animation: motion-enter-slide var(--motion-enter-duration) var(--motion-enter-ease);
3078
3087
  }
@@ -4479,6 +4488,67 @@
4479
4488
  content: none;
4480
4489
  }
4481
4490
 
4491
+ /* 끌기 핸들이 있는 줄: 줄은 div 이고 여백·간격은 안쪽 누르는 영역(list-row-main)이 갖는다 */
4492
+
4493
+ .list-row.has-handle {
4494
+ gap: 0;
4495
+ padding: 0;
4496
+ }
4497
+
4498
+ .list-row-handle {
4499
+ display: flex;
4500
+ flex: none;
4501
+ align-items: center;
4502
+ padding-inline-start: var(--spacing-4);
4503
+ color: var(--icon-secondary);
4504
+ cursor: grab;
4505
+ touch-action: none;
4506
+ }
4507
+
4508
+ .list-row-main {
4509
+ display: flex;
4510
+ flex: 1;
4511
+ align-items: center;
4512
+ align-self: stretch;
4513
+ gap: var(--spacing-12);
4514
+ min-width: 0;
4515
+ padding: var(--spacing-10) var(--spacing-16) var(--spacing-10) var(--spacing-4);
4516
+ border: 0;
4517
+ background-color: transparent;
4518
+ color: inherit;
4519
+ font: inherit;
4520
+ text-align: start;
4521
+ text-decoration: none;
4522
+ }
4523
+
4524
+ .list-row-main:is(a[href],button) {
4525
+ cursor: pointer;
4526
+ }
4527
+
4528
+ .list-row-main:is(a[href],button):focus-visible {
4529
+ outline-offset: calc(var(--focus-ring-width) * -1);
4530
+ }
4531
+
4532
+ /* 하나만 다른 줄. 면 테두리 안쪽에 맞춘 모서리이고 위·아래 구분선은 그리지 않는다 */
4533
+
4534
+ .list-row.highlighted {
4535
+ border: var(--border-width-strong) solid var(--border-accent);
4536
+ border-radius: calc(var(--radius-surface) - var(--hairline));
4537
+ }
4538
+
4539
+ .list-row.highlighted::before,
4540
+ .list-row.highlighted + .list-row::before {
4541
+ content: none;
4542
+ }
4543
+
4544
+ .list-row.dragging {
4545
+ background-color: var(--surface-muted);
4546
+ }
4547
+
4548
+ .list-row.dragging .list-row-handle {
4549
+ cursor: grabbing;
4550
+ }
4551
+
4482
4552
  .list-row-leading {
4483
4553
  display: flex;
4484
4554
  flex: none;
@@ -5729,6 +5799,23 @@ button.modal-with-double-button-close-button {
5729
5799
  align-self: flex-start;
5730
5800
  }
5731
5801
 
5802
+ /* 같은 줄: 글은 줄바꿈되고 버튼은 줄지 않은 채 본문 마지막 줄 옆에 붙는다 */
5803
+
5804
+ .notice.action-placement-inline .notice-body {
5805
+ flex-direction: row;
5806
+ gap: var(--spacing-12);
5807
+ }
5808
+
5809
+ .notice.action-placement-inline .notice-text {
5810
+ flex: 1;
5811
+ min-width: 0;
5812
+ }
5813
+
5814
+ .notice.action-placement-inline .notice-action {
5815
+ flex: none;
5816
+ align-self: flex-end;
5817
+ }
5818
+
5732
5819
  .base-pagination:where(.item) {
5733
5820
  display: inline-flex;
5734
5821
  align-items: center;
package/dist/drawer.js CHANGED
@@ -41,6 +41,7 @@ var common_props = __nuri_require__(7298);
41
41
 
42
42
  var sizes = ['s', 'm', 'l'];
43
43
  var sides = ['right', 'left', 'bottom'];
44
+ var fits = ['size', 'content', 'screen'];
44
45
  var drawerContentProps = {
45
46
  size: (0,common_props/* sizeProp */.lw)(sizes, 'm'),
46
47
  side: {
@@ -48,6 +49,12 @@ var drawerContentProps = {
48
49
  className: 'side',
49
50
  values: sides,
50
51
  "default": 'right'
52
+ },
53
+ fit: {
54
+ type: 'className',
55
+ className: 'fit',
56
+ values: fits,
57
+ "default": 'size'
51
58
  }
52
59
  };
53
60
  ;// ./components/drawer/drawer.tsx